query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
b392ecfe9d29ba89022c4a7e7aa05f44
Shows the page where the user is in the leaderboard Does nothing for a guest
[ { "docid": "22abbfed153fee9067bfb65a076d0daa", "score": "0.58122927", "text": "function toYourPage() {\n var username = app.username;\n if (username == null) return;\n\n\n var index = snapshotArrs[activeBoard].map(function(player) {\n return player.username;\n }).indexOf(username);\n\n playerIndex = Math.floor(index/10) * 10;\n createTable(activeBoard);\n\n //This is the fading animation on the row that represents the player\n document.getElementById(\"userRow\").classList.toggle('w3-animate-opacity');\n}", "title": "" } ]
[ { "docid": "024694961dd18b2d5d080caae59e347f", "score": "0.7471748", "text": "static showLeaderboard() {\n \n const leaderboardPage = document.querySelector('#leaderboard')\n\n leaderboardPage.className = 'show_leaderboard'\n history.pushState(null, null, '/#/leaderboard')\n\n }", "title": "" }, { "docid": "ca7ff203b47ff6e649a82c1146c4f2f8", "score": "0.6754577", "text": "monitoringLeaderPresence(members){\n var doesLeaderExist = members.filter((user) => user.isAdmin).length > 0 ;\n if(!doesLeaderExist){\n window.location.href ='/vote';\n }\n }", "title": "" }, { "docid": "454d9c82edc2a0b6500f416950bfb37e", "score": "0.6563764", "text": "function mainDisplay() {\n let mostRecentObservations = Model.get_recent_observations(10);\n let userLeaderboard = Model.get_top_ten_users();\n \n // display ten most recent observations \n // display top ten users leaderboard\n views.homePageView(\"target\", mostRecentObservations, \"target2\", userLeaderboard);\n}", "title": "" }, { "docid": "83a5b7d2082ba411512e6becd60b5b5d", "score": "0.63372016", "text": "action() {\n //if user id exists, return true\n if(Meteor.userId()) {\n FlowRouter.go('project-book');\n }\n BlazeLayout.render('HomeLayout');\n }", "title": "" }, { "docid": "2f7d749a7303f88f5ee4d2e6907f0dcb", "score": "0.6257837", "text": "function loadUserSpecificPage(userId) {\n loginPage.style.display = \"none\";\n // console.log(`This is the user page! ${userId}`);\n const dashboard = document.createElement(\"h2\");\n const taskContainer = document.querySelector(\".output__tasks\");\n dashboard.textContent = \"Dashboard\";\n taskContainer.appendChild(dashboard);\n \n location.reload();\n\n // friendsList.getFriendsList()\n\n taskForm.taskFormBuilder();\n taskList.listTasks();\n\n }", "title": "" }, { "docid": "81a4c579a4360ae5bab318312d41c913", "score": "0.6240388", "text": "function ownersHomePage(req, res, next){\n\tres.render(\"ownersHomePage\");\n\tres.end();\n}", "title": "" }, { "docid": "a3bd1a36c779cb88f2f322fa6219f149", "score": "0.6206309", "text": "index(request, response) {\n logger.info('trainer dashboard rendering');\n let members = userstore.getAllUsers();\n const viewData = {\n title: 'Trainer Dashboard',\n members: members,\n };\n logger.info('rendering all users: ', members);\n response.render('trainerdashboard', viewData);\n }", "title": "" }, { "docid": "5748a0f4aac352cc310b132400279a2b", "score": "0.6195323", "text": "function show_leader_board() {\n if(leaderboard.is(\":visible\"))\n {\n\t\tcredOpen = false;\n leaderboard.hide();\n }\n else\n\t{\n\t\tCONFIRM.play();\n\t\tcredOpen = true;\n Highest_score.sort(score_comp);\n leaderboard.empty();\n leaderboard.show();\n leaderboard.append('<h1>' + '1. ' + Highest_score[0]['Name'] + ': ' + Highest_score[0]['Score'] + '</h1>');\n leaderboard.append('<h1>' + '2. ' + Highest_score[1]['Name'] + ': ' + Highest_score[1]['Score'] + '</h1>');\n leaderboard.append('<h1>' + '3. ' + Highest_score[2]['Name'] + ': ' + Highest_score[2]['Score'] + '</h1>');\n leaderboard.append('<h1>' + '4. ' + Highest_score[3]['Name'] + ': ' + Highest_score[3]['Score'] + '</h1>');\n leaderboard.append('<h1>' + '5. ' + Highest_score[4]['Name'] + ': ' + Highest_score[4]['Score'] + '</h1>');\n leaderboard.append('<h1>' + '6. ' + Highest_score[5]['Name'] + ': ' + Highest_score[5]['Score'] + '</h1>');\n leaderboard.append('<h1>' + '7. ' + Highest_score[6]['Name'] + ': ' + Highest_score[6]['Score'] + '</h1>');\n leaderboard.append('<h1>' + '8. ' + Highest_score[7]['Name'] + ': ' + Highest_score[7]['Score'] + '</h1>');\n leaderboard.append('<h1>' + '9. ' + Highest_score[8]['Name'] + ': ' + Highest_score[8]['Score'] + '</h1>');\n leaderboard.append('<h1>' + '10. ' + Highest_score[9]['Name'] + ': ' + Highest_score[9]['Score'] + '</h1>');\n leaderboard.append(\"<button type='Settings' onClick='show_leader_board()'>Return to Main Menu</button>\");\n }\n}", "title": "" }, { "docid": "c46f3af758cdc83fd0a2c17e66de2d33", "score": "0.6128377", "text": "function showUserpage(){\n var username = window.localStorage.getItem(\"Username\");\n var currentUser = getUser(username);\n\n if(username != null){\n //user has logined before\n\n var nickname = window.localStorage.getItem(\"Nickname\");\n var signature;\n if(window.localStorage.getItem(\"Signature\") == \"null\"){\n signature = \"Please input your signature (footer)\"\n }else{\n signature = window.localStorage.getItem(\"Signature\");\n }\n\n var headpic = window.localStorage.getItem(\"Headpic\");\n\n var userTop = $(\"<div id='user_top'></div>\");\n var userTopLeft = $(\"<div id='user_top_left' style='float:left' ><img style='width:100px;height:100px;' src='\"+headpic+\"'>\");\n var userTopCenter = $(\"<div id='user_top_center'></div>\");\n userTopCenter.append(\"<span style='font-weight:bold;font-size:24px;'>\"+nickname+\"</span><br/>\");\n userTopCenter.append(\"<div style='line-height:30px;display:block;margin-top:10px;font-size:16px;'>\"+signature+\"</div><br/>\");\n var userTopicRight = $(\"<div id='user_top_right'><ons-icon icon='ion-chevron-right'></ons-icon></div>\");\n userTop.append(userTopLeft);\n userTop.append(userTopCenter);\n userTop.append(userTopicRight);\n var userBottom1 = $(\"<div id='user_bottom'></div>\");\n var bottomList1 = $(\"<div class='user_bottom_lists' ><ons-icon size='25px' class='iconthem' icon='ion-android-favorite'></ons-icon>&nbsp;My Teams<ons-icon size='23px' class='iconarrow' icon='ion-chevron-right'></ons-icon></div>\");\n var bottomList2 = $(\"<div class='user_bottom_lists' ><ons-icon size='25px' class='iconthem' icon='ion-document-text'></ons-icon>&nbsp;&nbsp;My Posts<ons-icon size='23px' class='iconarrow' icon='ion-chevron-right'></ons-icon></div>\");\n var bottomList3 = $(\"<div class='user_bottom_lists' ><ons-icon size='21px' class='iconthem' icon='ion-eye'></ons-icon>&nbsp;Recent Viewing<ons-icon size='23px' class='iconarrow' icon='ion-chevron-right'></ons-icon></div>\");\n if(navigator.onLine){\n userTop.on(\"click\",function(){\n myNavigator.pushPage(\"profile.html\",{data:{currentuser:currentUser}});\n })\n bottomList1.on(\"click\",function(){\n myNavigator.pushPage(\"myteams.html\",{data:{currentuser:currentUser}});\n })\n bottomList2.on(\"click\",function(){\n myNavigator.pushPage(\"myposts.html\",{data:{currentuser:currentUser}});\n })\n }\n bottomList3.on(\"click\",function(){\n myNavigator.pushPage(\"viewing.html\");\n })\n userBottom1.append(bottomList1);\n userBottom1.append(bottomList2);\n userBottom1.append(bottomList3);\n var userBottom2 = $(\"<div id='user_bottom'></div>\");\n var bottomList5 = $(\"<div class='user_bottom_lists' ><ons-icon size='23px' class='iconthem' icon='ion-information-circled'></ons-icon>&nbsp;About<ons-icon size='23px' class='iconarrow' icon='ion-chevron-right'></ons-icon></div>\");\n bottomList5.on(\"click\",function(){\n myNavigator.pushPage(\"appinfo.html\");\n })\n userBottom2.append(bottomList5);\n var userBottom3 = $(\"<div id='user_bottom'></div>\");\n var bottomList6 = $(\"<div id='logb' class='user_bottom_lists' >Log out</div>\");\n userBottom3.append(bottomList6);\n $(\"#usermainpage\").append(userTop);\n $(\"#usermainpage\").append(userBottom1);\n $(\"#usermainpage\").append(userBottom2);\n $(\"#usermainpage\").append(userBottom3);\n bottomList6.on(\"click\",function(){\n logout();\n })\n }else{\n $(\"#usermainpage\").html(\"\");\n var str = \"After signing in, you can follow topic, add and reply to post. Besides, you can use more functions like voting, inputting rich text etc.\"\n var toSign = $(\"<span/>\").attr(\"id\",\"signnwo\").html(str);\n $(\"#usermainpage\").append(toSign);\n\n var onsBu = $(\"<ons-button/>\").attr(\"id\",\"onsb\").html(\"Sign in for more functions\");\n onsBu.attr(\"modifier\",\"large\");\n onsBu.on(\"click\",function(){\n myNavigator.pushPage('login.html');\n });\n $(\"#usermainpage\").append(onsBu);\n }\n }", "title": "" }, { "docid": "4880ef0bbcfb9aa816b9a2e030dc304d", "score": "0.6103633", "text": "function showProfilePage(loggedinUserName) {\n\n $('#profile-page').hide();\n $('#signin-form').hide();\n $('#sign-in-page').show();\n $('#js-signout-link').show();\n $('#js-signout-link').text(\"Sign out \" + loggedinUserName);\n $('#js-signin-link').hide();\n $('#profileUsername').text(loggedinUserName);\n $('#miles-number').text(currentScore + myActivities.activityPoints);\n displayProfileActivities(myActivities);\n}", "title": "" }, { "docid": "ffc74dd0ea10c6dd1311e0b9cca11a5f", "score": "0.6063101", "text": "renderDefaultHomePage() {\n if(this.props.account.username) {\n return (\n <div>\n <GuidelinesList/>\n </div>\n )\n } else {\n return (\n <div>\n <h1>\n Please Log in\n </h1>\n </div>\n )\n }\n }", "title": "" }, { "docid": "b41626a5f0d195e87a2309aa92fe5cf6", "score": "0.60347366", "text": "index(request, response) {\n logger.info('dashboard rendering');\n const loggedInUser = accounts.getCurrentUser(request);\n let memberStats = analytics.generateMemberStats(loggedInUser);\n const viewData = {\n title: 'Member Dashboard',\n assessmentlist: assessmentStore.getAssessmentList(loggedInUser.id),\n user: loggedInUser,\n stats: memberStats,\n };\n logger.info('about to render user: ', loggedInUser);\n response.render('dashboard', viewData);\n }", "title": "" }, { "docid": "b99d4b1469a5526ab34b4e12ed701834", "score": "0.6016219", "text": "function userPage() {\r\n\tif (sessionStorage.getItem(\"username\") === \"[email protected]\") {\r\n\t\twindow.location.replace(\"user_central_master.html\");\r\n\t} else {\r\n\t\twindow.location.replace(\"user_central.html\");\r\n\t}\r\n}", "title": "" }, { "docid": "e9b00d099eb169bcbf6155bf3a9babf1", "score": "0.60001403", "text": "function renderFacultyPage(req, res) {\n /* Helper callback function that renders dashboard page\n for a faculty member.\n */\n // Canvas ID of faculty member is passed in the URL\n var userId = parseInt(req.params['userId']);\n protectCanvasData(req, res, userId, null, renderFacultyPageSecured);\n\n\n} // end function renderFacultyPage", "title": "" }, { "docid": "cdee1ac536efcefc451f039148814734", "score": "0.5991037", "text": "function halfProfile(req, res, next){\r\n let username = req.session.username;\r\n user = model.getUser(req.params.user);\r\n if(user === -1){\r\n res.status(404).send(\"User does not exist (I might remove this as it gives away too much information)\")\r\n }\r\n res.render('halfProfile', {userObj: user});\r\n return;\r\n}", "title": "" }, { "docid": "b959338bb25af491949c591f78977387", "score": "0.5974745", "text": "function viewHighScore(event) {\n event.preventDefault();\n organizeLeaderBoards();\n toggleDisplay(\".leaderboard-screen\");\n}", "title": "" }, { "docid": "64d0e85068085e2a97508f53703d4459", "score": "0.59608006", "text": "function displaySignUpPage() {}", "title": "" }, { "docid": "327566a38a47cca8c63f8c96cf861223", "score": "0.59315586", "text": "monitoringLeaderPresence (members) {\n const doesLeaderExist = members.filter(user => user.isAdmin).length > 0\n if (!doesLeaderExist) {\n this.$router.push('/vote')\n }\n }", "title": "" }, { "docid": "0347143e4caa0799c4936f8e6272886d", "score": "0.59257674", "text": "function viewProfile(){\n\t// :TODO: check login status\n\tQ.select('h1').text('Profile');\n\tQ.select('.page-body').html('<h2>You know who you are</h2><p>I don\\'t have describe you to yourself</p>');\n\tdocument.title = 'Profile';\n}", "title": "" }, { "docid": "cce15b383f18d5d72d556db4f5b04be8", "score": "0.58863926", "text": "function fullProfile(req, res, next){\r\n let username = req.session.username;\r\n user = model.getUser(username);\r\n if(user === -1){\r\n res.status(404).send(\"User does not exist (I might remove this as it gives away too much information)\")\r\n }\r\n res.render('profile', {userObj: user});\r\n return; //this shouldn't be necesary\r\n }", "title": "" }, { "docid": "8270b3565777298073df6689e87f16ca", "score": "0.58291876", "text": "function showUserPage(store) {\n store.dispatch('CORE_SET_PAGE_LOADING', true);\n store.dispatch('SET_PAGE_NAME', PageNames.USER_MGMT_PAGE);\n const userCollection = FacilityUserResource.getCollection();\n const facilityIdPromise = FacilityUserResource.getCurrentFacility();\n const userPromise = userCollection.fetch();\n\n const promises = [facilityIdPromise, userPromise];\n\n ConditionalPromise.all(promises).only(\n samePageCheckGenerator(store),\n ([facilityId, users]) => {\n const pageState = {\n users: users.map(_userState),\n facility_id: facilityId[0],\n };\n store.dispatch('SET_PAGE_STATE', pageState);\n store.dispatch('CORE_SET_PAGE_LOADING', false);\n store.dispatch('CORE_SET_ERROR', null);\n store.dispatch('CORE_SET_TITLE', _managePageTitle('Users'));\n },\n error => { coreActions.handleApiError(store, error); }\n );\n}", "title": "" }, { "docid": "34b5bd72005326cf00281e09439ad88c", "score": "0.5804956", "text": "function userAccess(req, res) {\n // If the user already has an account send them to the members page\n if (req.user) {\n res.redirect(\"/members\", renderMemberPage);\n // res.render(\"members\");\n }\n res.render('signup');\n}", "title": "" }, { "docid": "8d4cf7566759f1e53cd37a83efe661e5", "score": "0.58018404", "text": "present(){\n let user = this.state.feed[this.state.index];\n return (\n <div>\n <h1>{user.handle}</h1>\n <h3>Score: {user.score}</h3>\n <h5>{this.state.feedLookup[this.state.index]}</h5>\n\n </div>\n\n );\n }", "title": "" }, { "docid": "c4cea50cdc80e3f1226031e41d5f4fd0", "score": "0.5798428", "text": "function show(req,res) {\n res.render('portal/profiles/show')\n}", "title": "" }, { "docid": "f11287dd248c7cd2ff81b81916a63d4c", "score": "0.578555", "text": "function renderMarketHome(req, res, next) {\n res.render('contestA/marketHome.hbs', { user: req.user });\n}", "title": "" }, { "docid": "eb1a76cd41a46de1ce1f32e07f486c5e", "score": "0.57800114", "text": "async index({ auth, view }) {\n\t\tawait auth.getUser();\n return view.render(\"dashboard.welcome\");\n }", "title": "" }, { "docid": "968a5966c5ffeb34718d61f7b353bf78", "score": "0.57744306", "text": "renderDetail() {\n\n if (!this.state.publicView && (this.props.page === 'ADMIN' || this.props.page === 'LEADER')) {\n return this.renderPersonalDetail()\n } else {\n return <UserPublicDetail member={this.props.user} page={this.props.page}/>\n }\n }", "title": "" }, { "docid": "21aaa6581108dd6d7d9f959d29e8a6ee", "score": "0.57687855", "text": "function showUserPageInfo() {\n return `\n <div id=\"info\">\n User home page, Active user name in the model: ${model.activeUser}\n </div>\n `;\n}", "title": "" }, { "docid": "451d588d9369de018e520cd2ab03f318", "score": "0.5740567", "text": "function getIndexpage(req, res) {\n res.render('index.ejs', { userExists: 'start' });\n}", "title": "" }, { "docid": "06b05691cba70fcec0c8e01c24df6638", "score": "0.5739097", "text": "function backToProfile(){\n if (loggedInUser.objectType == \"Freelancer\") {\n window.location.href=\"./UserProfile.html\";\n }else { \n window.location.href=\"./companyProfile.html\";\n };\n }", "title": "" }, { "docid": "92de6a58b485f7ca6a805ed9e1f2ecd3", "score": "0.5733466", "text": "function displayUser3() {\n const user = loginUser(\"stian\");\n createVisuals(user.email, \"indianred\");\n createSeparator();\n}", "title": "" }, { "docid": "fe1af20830dee3d9b938f54360b38afb", "score": "0.5730819", "text": "function renderPage(res, playerScore){\n console.log(\"2\");\n pullScores(function(scores){\n\n //get just the scores.\n let justnumbers = scores.slice().map(function(v){return v.Score});\n\n //get unique scores\n let uniqueScores = []\n justnumbers.forEach(function(item, index){\n if(uniqueScores.indexOf(item) == -1){\n uniqueScores.push(item);\n }\n });\n\n //sort unique scores to determine rank\n uniqueScores = uniqueScores.sort(function(a,b){return b-a});\n\n //set default values.\n let name = \"\";\n let score = 0;\n let playerRank = \"none\";\n\n if(playerScore != null){\n name = playerScore.Name;\n score = playerScore.Score;\n playerRank = uniqueScores.indexOf(score)+1;\n }\n\n\n\n res.render('leaderboard', {\n title: 'LeaderBoard',\n scores: scores,\n playerName: name,\n playerScore: score,\n playerRank: playerRank\n });\n })\n}", "title": "" }, { "docid": "9e28f7eb5fb27656b2cbb487c051cea1", "score": "0.56956524", "text": "function printWelcome(){\n let user = retrieveUserInfo();\n let output = \"\";\n output += \"<div class=\\\"bottom-left\\\">Welcome, \" + user.username + \"<br>\";\n\n if (user.role == \"student\"){\n output += \"Please proceed to record your project information.\"\n }\n else if (user.role == \"marker\"){\n output += \"Please proceed to mark the projects.\"\n }\n output += \"</div>\"\n document.getElementById(\"welcome\").innerHTML = output;\n}", "title": "" }, { "docid": "cb66f7f8a17d9ed289f9799959433dae", "score": "0.56862617", "text": "pageHeader(){\r\n if(this.state.currentTeamId){\r\n return this.currentTeam().teamLeague;\r\n }\r\n return \"Team Listing\";\r\n }", "title": "" }, { "docid": "913520e13cd650a2b4e68675cf1f041b", "score": "0.56785184", "text": "function leaderBoard(){\n window.location.href=\"./game/leaderboard\"; \n}", "title": "" }, { "docid": "de2a73d7d175b08905bd8bbe04a157cd", "score": "0.56656164", "text": "function publicPage(req,res, next){ \n\t\tif(req.isAuthenticated()){\n\t\t\tres.redirect('/chatrooms');\n\t\t}\n\t\telse{\n\t\t\tnext();\n\t\t}\n\t}", "title": "" }, { "docid": "04a1c40c0b3522dcbd6cf9ef34a51a27", "score": "0.56646466", "text": "function main() {\n // TODO if the user is already logged in, redirect him to the main page\n}", "title": "" }, { "docid": "eba5941184a5f50a34d9d586096a56d4", "score": "0.56644994", "text": "function Homepage() {\n\n const { currentUser } = useContext(UserContext);\n\n return (\n <div className=\"homepage\">\n <div className=\"container text-center\">\n <img src={hero} alt=\"Man applying for jobs\" className=\"heroimage\" />\n <h1 className=\"mb-4 font-weight-bold\">Jobly</h1>\n <h5 className=\"lead\">Connecting companies and jobs seekers since 2021!</h5>\n {currentUser ? \n <h3>Welcome back, {currentUser.firstName || currentUser.username}</h3>\n : (\n <p>\n <Link className=\"btn btn-primary btn-lg font-weight-bold mx-2 my-2\" to=\"/login\">\n Login \n </Link>\n <Link className=\"btn btn-primary btn-lg font-weight-bold mx-2 my-2\" to=\"/signup\">\n Signup \n </Link>\n </p>\n )\n }\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "1a6ec33343f085aa19f3dcdf7e87367a", "score": "0.56591463", "text": "showLoggedInState() {\n\t\tlet formattedDate = moment( this.currentUser.createdAt ).calendar();\n\n\t\t$(\"#profile-name\").text(`Name: ${this.currentUser.name}`);\n\t\t$(\"#profile-username\").text(`Username: ${this.currentUser.username}`);\n\t\t$(\"#profile-account-date\").text(`Account Created: ${formattedDate}`);\n\n\t\tthis.$navUserProfile.text(this.currentUser.username);\n\t\tthis.$app.addClass('authenticated');\n\t}", "title": "" }, { "docid": "056bb8ed17d1f8188b0c3dcebbec8725", "score": "0.5656833", "text": "renderDetail() {\n\n if (this.props.page === 'ADMIN' || this.props.page === 'LEADER') {\n return this.renderPersonalDetail()\n } else {\n // Not used\n return <UserPublicDetail task={this.props.user} page={this.props.page}/>\n }\n }", "title": "" }, { "docid": "812b0c2ffa158b67eb8c0a8e45ee9bfb", "score": "0.5655793", "text": "function renderWithUser(user) {\n $(\"#members-list\").empty();\n $(\"#mainPage\").show(); \n $('#loginModal').modal(\"hide\"); // login modal for mobile app users when they tap send message without signing in\n if (getUrlParameter('profile')) {\n var profileID = getUrlParameter('profile');\n var memberDocRef = fbi.doc(profileID);\n memberDocRef\n .get()\n .then(doc => {\n if (!doc.exists) {\n console.log(\"User does not exist in database\");\n window.location.replace('index.html');\n } else { \n fbi\n .where(firebase.firestore.FieldPath.documentId(), '==', profileID)\n .limit(1)\n .get()\n .then(function(querySnapshot) {\n loadMembers(querySnapshot, true);\n });\n }\n })\n .catch(err => {\n console.log(\"Error getting document\", err);\n });\n } else { \n initLoad();\n }\n showAdminToggle();\n}", "title": "" }, { "docid": "77f1b5f6a5a3b41d1290a4cd3509d835", "score": "0.5650659", "text": "renderPage() {\r\n if (!this.state.club) {\r\n this.setState({ club: this.props.clubs });\r\n }\r\n const { activeItem } = this.state;\r\n const image = 'https://pbs.twimg.com/profile_images/1052001602628857856/AGtSZNoO_400x400.jpg';\r\n if (this.props.clubs === undefined) {\r\n return (\r\n <h1>ERROR 404: Yo put in something that exists</h1>\r\n );\r\n }\r\n return (\r\n <div className=\"profile\">\r\n <Grid>\r\n <Grid.Column width={4} className=\"user_info\">\r\n <Image className=\"profile_picture\"\r\n src={(this.props.clubs.image !== 'N/A') ? this.props.clubs.image : image}\r\n alt={'Club Picture'}\r\n size=\"medium\"/>\r\n <Header className=\"name\">{this.props.clubs.name}</Header>\r\n {Meteor.user() ? <Button color={Meteor.user().profile.clubs.joined.includes(this.props.clubs.name) ?\r\n 'red' : 'blue'} style={{ marginLeft: '1.5em' }}\r\n content={Meteor.user().profile.clubs.joined.includes(this.props.clubs.name) ?\r\n 'Leave Club' : 'Join'} onClick={() => this.toggleJoin(this.props.clubs.name)}/> :\r\n <Button as={NavLink} exact to={''} style={{ marginLeft: '1.5em' }} content={'Join'}/>}\r\n\r\n {Meteor.user() ? <Button color={Meteor.user().profile.clubs.favorite.includes(this.props.clubs.name) ?\r\n 'red' : 'blue'} style={{ marginLeft: '1.5em' }}\r\n content={Meteor.user().profile.clubs.favorite.includes(this.props.clubs.name) ?\r\n 'Unfavorite' : 'Favorite'} onClick={() => this.toggleFavorite(this.props.clubs.name)}/> :\r\n <Button as={NavLink} style={{ marginLeft: '1.5em' }} exact to={''} content={'Favorite'}/>}\r\n\r\n <h2 className=\"heading\">Leader</h2>\r\n <h3 style={{ marginLeft: '1.5em' }}>{this.displayLeaders()}</h3>\r\n <h4 style={{ marginLeft: '1.5em' }}>{this.props.clubs.email}</h4>\r\n <hr style={{ marginLeft: '1em' }}/>\r\n <Header className=\"heading\">Our Website</Header>\r\n <h4 style={{ marginLeft: '1.5em' }}><a target=\"_blank\" rel='noopener noreferrer'\r\n href={`//${this.props.clubs.website.toString()}`}>{this.props.clubs.website}</a></h4>\r\n <hr style={{ marginLeft: '1em' }}/>\r\n <Header className={'heading'}>Interests</Header>\r\n <List bulleted className=\"list\">\r\n {this.props.clubs.tags.map((m, index) => <List.Item key={index}>{m}</List.Item>)}\r\n </List>\r\n </Grid.Column>\r\n\r\n <Grid.Column width={12} className=\"club_info\">\r\n {Meteor.user() && this.props.clubs.leader.includes(Meteor.user().username) ?\r\n <Button as={NavLink} exact to={`/editclub/${this.props.clubs._id}`} content={'Manage Club Info'}/> : ''}\r\n <Menu pointing secondary>\r\n <Menu.Item name=\"About-Us\" active={activeItem === 'About-Us'} onClick={this.handleMenuClick}/>\r\n <Menu.Item name={'Members'} active={activeItem === 'Members'} onClick={this.handleMenuClick}/>\r\n </Menu>\r\n <Container>\r\n <Card.Group>\r\n {this.displayActiveItem(activeItem)}\r\n </Card.Group>\r\n </Container>\r\n </Grid.Column>\r\n\r\n </Grid>\r\n </div>\r\n );\r\n }", "title": "" }, { "docid": "80a37795379c9a07101999045d6913f6", "score": "0.564651", "text": "trainerAssessment(request, response) {\n let user = userstore.getUserById(request.params.id);\n let assessmentlist = assessmentStore.getAssessmentList(user.id);\n let memberStats = analytics.generateMemberStats(user);\n const viewData = {\n title: 'Member Dashboard',\n assessmentlist: assessmentlist,\n user: user,\n stats: memberStats,\n };\n logger.info('Trainer: rendering user - ', user);\n response.render('trainerassessment', viewData);\n }", "title": "" }, { "docid": "5323ed8790f9bf6a5cb9aaf05692223b", "score": "0.56443024", "text": "function serveLeaderBoard(message){\n\n\tvar username = message.user_name;\n\tconnection.query( \"SELECT username , TotalValue FROM users ORDER BY TotalValue DESC LIMIT 10\" , \n\t\tfunction (err , rows )\n\t\t{\n\t\t\tif( err)\n\t\t\t\tthrow err;\n\t\t\tsocketHandler.messageUser( username , 'leader_board' , rows);\n\t\t});\n}", "title": "" }, { "docid": "1711061d438b0b9784dc99bff9987407", "score": "0.5641754", "text": "function BlockedPageHandler(user_info) {\n\trelation_controls_div.innerHTML = user_info.username + \" has blocked you.\";\n}", "title": "" }, { "docid": "c30a5f4e857c1c879e00232b279bf911", "score": "0.5634495", "text": "function friendProfile(req, res, next){\r\n let username = req.session.username;\r\n user = model.getUser(req.params.user);\r\n if(user === -1){\r\n res.status(404).send(\"User does not exist (I might remove this as it gives away too much information)\")\r\n }\r\n res.render('friendProfile', {userObj: user});\r\n return;\r\n}", "title": "" }, { "docid": "ea6a175910e201cf2a31261dfecc110d", "score": "0.56143034", "text": "function renderLeaderboard() {\n results.removeAttribute(\"class\", \"hidden\");\n var getName = JSON.parse(localStorage.getItem(\"initials\"));\n var getScore = JSON.parse(localStorage.getItem(\"score\"));\n var finalLeaderboard = {\n Name: getName,\n Score: getScore\n };\n leaderBoard.push(finalLeaderboard);\n leaderBoard.sort((a, b) => b.finalLeaderboard.score - a.finalLeaderboard.score);\n leaderBoard.slice(0, 5);\n localStorage.setItem(\"leaderboard\", JSON.stringify(leaderBoard));\n list.innerHTML = \"\";\n for (var i =0; i < leaderBoard.length; i++) {\n var board = leaderBoard[i];\n var li = document.createElement(\"li\");\n li.textContent = board;\n list.appendChild(li);\n }\n document.querySelector(\".results-list\").innerHTML = list;\n console.log(leaderBoard)\n }", "title": "" }, { "docid": "f9bf824c04ccb4ed84dde7ad0a844a1d", "score": "0.56075615", "text": "function showMembers(data) {\n let output = \"<b><b>\"+findUserName(data.leader_id)+\"</b></b>\";\n for (i=0; i<data.members.length; i++){\n output += \"<br>\"+findUserName(data.members[i]);\n }\n return output;\n}", "title": "" }, { "docid": "339b703069462a3c1ec78ef3dfbd7caa", "score": "0.5606418", "text": "function display_profile() {}", "title": "" }, { "docid": "a32e3a94e3c5670ca59816d093da385e", "score": "0.5596893", "text": "function in_user_page() {\n return ((win.location.pathname.indexOf(\"/user\") == 0) || (win.location.pathname.indexOf(\"/channel\") == 0));\n}", "title": "" }, { "docid": "38f62cd9a2f684224a8166944ef3c350", "score": "0.55963665", "text": "function renderPage() {\r\n\t\tgetEmployeeName(employeeID);\r\n\t\tgetReviewerID();\r\n\t}", "title": "" }, { "docid": "3a2fad56f43278929597618625b73530", "score": "0.55824167", "text": "function getLeaderBoardPage() {\n\tlet newLeaderBoardPage = $('<div>', {\n\t\t'class': 'leaderBoard'\n\t});\n\tlet firstRow = $('<div>', {\n\t\t'class': 'row'\n\t});\n\tlet nameH3 = $('<h3>', {\n\t\t'class': 'col-xs-6',\n\t\t'text': 'Name'\n\t});\n\tlet statsH3 = $('<h3>', {\n\t\t'class': 'col-xs-6',\n\t\t'text': 'Stats'\n\t});\n\tlet buttonRow = $('<div>', {\n\t\t'class': 'row'\n\t});\n\tlet buttonCol = $('<div>', {\n\t\t'class': 'col-xs-12'\n\t});\n\tlet getClueButton = $('<button>', {\n\t\t'type': 'button',\n\t\t'class': 'getClue btn btn-default',\n\t\t'text': 'Get New Clue',\n\t\t'on': {\n\t\t\t'click': () => {\n\t\t\t\temptyContainer();\n\t\t\t\tif (player.name === null) {\n\t\t\t\t\tcreateLandingPage();\n\t\t\t\t\tdestroyEllipsis();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tgetRandomWordsFromNYT();\n\t\t\t}\n\t\t}\n\t});\n\n\tbuttonCol.append(getClueButton);\n\tbuttonRow.append(buttonCol);\n\tfirstRow.append(nameH3, statsH3);\n\tnewLeaderBoardPage.append(firstRow);\n\taddPlayersToLeaderBoard(totalPlayersObj, newLeaderBoardPage);\n\tnewLeaderBoardPage.append(buttonRow);\n\tdestroyEllipsis();\n\t$('.container').append(newLeaderBoardPage);\n}", "title": "" }, { "docid": "1c2f0689ebdf2e9f89049c41786f9d12", "score": "0.5576515", "text": "function showWelcomePage(data){\n $('body, html').scrollTop(0);\n\n if(mqLarge.matches){\n console.log('screen over 1000px')\n $('.js-nav-bar').removeClass('hidden');}\n\n $('.js-landing-page').addClass('hidden');\n $('.login-page').addClass('hidden');\n $('.js-welcome-page').removeClass('hidden');\n $('.js-event-page').addClass('hidden'); \n $('.js-activity-page').addClass('hidden');\n $('.js-profile-page').addClass('hidden');\n\n const welcome = renderWelcome();\n $('.welcome-page').html(welcome);\n\n handleEventButton();\n handleNewEventButton();\n}", "title": "" }, { "docid": "83284b078b4c9a010f195782db32ba75", "score": "0.55577505", "text": "function UserProfilePage() {\n return (\n <div>\n <h1>user profile</h1>\n </div>\n );\n}", "title": "" }, { "docid": "487113e999bdd1220db7f7534e78d58c", "score": "0.5551761", "text": "function setUserNav(){\r\n const userId = sessionStorage.getItem('userId');\r\n if (userId != null){\r\n document.getElementById('user').style.display = 'inline-block';\r\n document.getElementById('guest').style.display = 'none';\r\n }else{\r\n document.getElementById('user').style.display = 'none';\r\n document.getElementById('guest').style.display = 'inline-block';\r\n }\r\n}", "title": "" }, { "docid": "5b5e5a320c436dd83c5fd0d257285013", "score": "0.5551268", "text": "index(request, response) {\n logger.info('dashboard rendering');\n const loggedInUser = accounts.getCurrentUser(request);\n if (loggedInUser) {\n const viewData = {\n title: 'SuperMarket List Dashboard',\n mlists: listApp.getUserPlaylists(loggedInUser.id),\n fullname: loggedInUser.firstName + ' ' + loggedInUser.lastName,\n picture: loggedInUser.picture,\n };\n logger.info('about to render' + viewData.lists);\n response.render('dashboard', viewData);\n }\n else response.redirect('/');\n }", "title": "" }, { "docid": "c50565e874e4a781d2c42b30e186bd78", "score": "0.5548141", "text": "render() {\n const { users } = this.state;\n\n //returns the homepage\n return (\n <div>\n <h1>Home</h1>\n <p>The Home Page is accessible by every signed in user.</p>\n <FakerPage />\n\n {/* sets the userlist as the users we've got*/}\n {!!users && <UserList users={users} />}\n </div>\n );\n }", "title": "" }, { "docid": "db0d0520df35ece107a4dbe32b29cf8c", "score": "0.5540984", "text": "async function displayUser() {\n try {\n const user = await loginUser(\"stian\");\n createVisuals(user.email, \"lawngreen\");\n } catch (err) {\n createVisuals(err);\n } finally {\n createSeparator();\n }\n}", "title": "" }, { "docid": "7450c5fdc3d5517a3489a3c47c13d714", "score": "0.55400515", "text": "function putUserStoriesOnPage() {\n\tconsole.debug('putUserStoriesOnPage');\n\n\t$userStories.empty();\n\n\tif (currentUser.ownStories.length === 0) {\n\t\t$userStories.append('<h1>No stories have been submitted.</h1>');\n\t} else {\n\t\t// loop through currentUser favorited stories and generate HTML for them\n\t\tfor (let story of currentUser.ownStories) {\n\t\t\tconst $story = generateStoryMarkup(story, true);\n\t\t\t$userStories.append($story);\n\t\t}\n\t}\n\n\t$userStories.show();\n}", "title": "" }, { "docid": "635dd97bb1aaa5bdc19f9aa0d12500cf", "score": "0.5530349", "text": "function handelPages() {\n const location = window.location.hash;\n\n if (location === undefined || location !== '#Members' && location !== '#Board') {\n window.location.hash = '#Board';\n\n }\n if (location === '#Members') {\n handelMemberMaking(appData);\n selectedNavLink('member');\n }\n if (location === '#Board') {\n\n handelListMaking(appData.lists);\n selectedNavLink('board');\n\n }\n}", "title": "" }, { "docid": "753c4828d7241d6ff2d0d50953f61f49", "score": "0.55267435", "text": "render() {\n if(this.state.profile.prefAge_min ) {\n return (\n <div>\n\n\n\n <div>\n <div className=\"row\">\n <Header profile={this.state.profile} show={this.handleMatchListClick}/>\n </div>\n <div className=\"row\">\n <Link to={{pathname: '/lobby', state: {profile: this.state.profile}}}><button className=\"toVidChatLobbyButton\" type=\"button\" >Make A Connection</button></Link>\n </div>\n </div>\n\n </div>\n )\n } else {\n return (\n <div>\n <Header />\n <h1>This is the Prefs page</h1>\n <PreferencesForm user={this.state.profile} onUserChange={this.handleUserChange} />\n </div>\n )\n }\n }", "title": "" }, { "docid": "27b2066d0d386ddd0cc5d9b813ab02b1", "score": "0.552637", "text": "renderStudentInfoTab() {\n\n if (this.props.UserInfo !== null) {\n\n // Check if this user is in the neccessary role\n if (this.props.UserInfo.Role !== \"TechAcademyStudent\" &&\n this.props.UserInfo.Role !== \"UniversityStudent\") {\n\n // Return side bar with list of students online\n return <StudentInfoTab UserInfo={this.props.SelectedUserChatInfo} />\n }\n }\n }", "title": "" }, { "docid": "0b82f5a17c5f2827ee63d351f5e33374", "score": "0.55255836", "text": "function setUserNav() {\r\n const userId = sessionStorage.getItem('userId')\r\n if (userId!=null) {\r\n document.getElementById('user').style.display='inline-block'\r\n document.getElementById('guest').style.display = 'none'\r\n } else {\r\n document.getElementById('guest').style.display='inline-block'\r\n document.getElementById('user').style.display = 'none'\r\n }\r\n}", "title": "" }, { "docid": "99c7b1f69529782b69ec4df82b5f670a", "score": "0.5524967", "text": "function displayLoggedInUser(){\n \t$('.user-email').html(getUser().email).toggleClass('hidden', !getUser().email);\n }", "title": "" }, { "docid": "c30fec9fcebbf85f18dca34c801f7c70", "score": "0.5520615", "text": "viewUser(id) {\n this.userService.viewUser(id).subscribe((response) => {\n this.user = response[0];\n if (this.user.role == \"client\") {\n window.location.href = \"/home\";\n }\n });\n }", "title": "" }, { "docid": "46d670412a2460b0b2d121f20c969ca3", "score": "0.5512041", "text": "function renderPerfilCli() {\n getKey(whoIsNavigating, \"clientes\", showCli);\n}", "title": "" }, { "docid": "1b028dc49ceef38d7ff4bff8a21f33e6", "score": "0.5497765", "text": "showLeaderboard() {\n\n return (<SimpleColumnContainer width={'280px'} sideMargin={'0px'} style={{marginLeft: '10px'}}>\n <Collapse in={this.props.masterState.openWarning}>\n <AlertContainer>\n <Alert severity=\"warning\"\n action={\n <IconButton\n aria-label=\"close\"\n color=\"inherit\"\n size=\"small\"\n width={'50%'}\n\n >\n <CloseIcon fontSize=\"inherit\"/>\n </IconButton>\n }\n >\n Warning: Choose a Category or you will be kicked for being AFK!\n </Alert>\n </AlertContainer>\n <br/>\n </Collapse>\n {this.props.masterState.players.map(player => {\n return (\n <PlayerContainer>\n {player.user.id == localStorage.getItem('id') ?\n (<PlayerGame player={player} addOn = \"(Me)\"/>) :\n (<PlayerGame player={player} addOn = \"\"/>)\n }\n </PlayerContainer>\n\n );\n })}\n\n {this.stepper}\n\n\n {BerriesIconWithBadge(this.props.masterState.berries)}\n <LogOutButton\n width = \"50%\"\n disabled={this.props.masterState.amITurnPlayer}\n onClick={() => { if (window.confirm('Are you sure you want to leave the game?')) this.props.history.push('/menu') }} > Give Up\n </LogOutButton>\n\n </SimpleColumnContainer>\n );\n }", "title": "" }, { "docid": "6b141d559c773a6dd5be149ca54732fd", "score": "0.54877657", "text": "function interestShow(req, res) {\n res.render('pages/interest');\n}", "title": "" }, { "docid": "4a6968405f76bc6e841eab244af97a96", "score": "0.5483717", "text": "async displayProfile(step) {\n const user = await this.userProfile.get(step.context, {});\n if (user.age) {\n await step.context.sendActivity(`Your name is ${ user.name } and you are ${ user.age } years old.`);\n } else {\n await step.context.sendActivity(`Your name is ${ user.name } and you did not share your age.`);\n }\n return await step.endDialog();\n }", "title": "" }, { "docid": "566f074076abd1a53fd57c12a6ace7c8", "score": "0.54810345", "text": "function ShowName(message, id) {\r\n LUDZ.fetchUser(id).then(\r\n function (name) {\r\n if (UserPoints[id]) {\r\n message.channel.send(name.username + \"\\n\" + name.displayAvatarURL);\r\n } else {\r\n message.channel.send(\"you are new here, right?\");\r\n }\r\n }\r\n );\r\n}", "title": "" }, { "docid": "febd3f757774836eb7fc77f8bfa67990", "score": "0.5477204", "text": "function onDone(err, data) {\n if (err || data.length === 0) { // if there's an error or if there's no data\n // account not found\n console.log(\"Error: \", err)\n return res.status(404).render(\"error.ejs\", {\n id: 404,\n description: \"page not found\",\n map: \"../\"\n })\n } else {\n var user = data[0]\n var locals = {\n data: user,\n session: req.session\n }\n res.render(\"myprofile.ejs\", locals) // go to myprofile.ejs\n }\n }", "title": "" }, { "docid": "94ffc4897b513be53275e665313350d4", "score": "0.5476289", "text": "function showUserName(req, res, next) {\n if (!req.session.isLoggedIn) {\n next()\n } else {\n User.findOne({ _id: req.session.user._id }, function (err, user) {\n if (!user) return\n // save user to load user name\n else {\n res.locals.userInfor = mongooseToObject(user)\n next()\n }\n })\n }\n}", "title": "" }, { "docid": "57b96f96d485a8cf3501a41b824b677f", "score": "0.54745966", "text": "function dash_board() {\n\twindow.location.href = \"dashboard/profile.html\";\n}", "title": "" }, { "docid": "6138ff92661c1ee102d08852e27387ca", "score": "0.5469078", "text": "function displayLoginPage(req, res, next){\r\n res.status(200);\r\n if(req.session.loggedin){\r\n //they are already logged in include the menu\r\n res.render('login', {});\r\n }else{\r\n //if they are logged out then the menu bar will be broken so don't show\r\n res.render('loginNotAuthed', {});\r\n }\r\n}", "title": "" }, { "docid": "290d28d6c9b21626d69fd3fc49b01aa8", "score": "0.54648054", "text": "function onDone(err, data) {\n if (err || data.length === 0) {\n //account niet kunnen vinden\n //404 account not found\n return res.status(404).render('error.ejs', {\n id: 404,\n description: \"page not found\",\n map: \"../\"\n })\n } else {\n var locals = {\n data: data,\n session: req.session\n }\n res.render('matches.ejs', locals)\n }\n }", "title": "" }, { "docid": "afb82361c30ed8658bd9313ac778dac8", "score": "0.54593396", "text": "function show(req, res) {\n //get happy hour id from irl params ('req.params')\n var happyhourId = req.params.happyhourid;\n //find happy hour in db by id\n db.happyhour.findOne({ _id: happyhourId }, function(err, succ){\n if(err){return console.log(err);}\n res.render('show', {result: succ});\n });\n}", "title": "" }, { "docid": "0231995c453e2b39d989f1d116b825e8", "score": "0.5458815", "text": "function handleAccessRecordMatch(){\n var userId = localStorage.getItem(\"user\");\n if(userId != null){\n var query = firebase.database().ref('Users/' + userId);\n query.once(\"value\").then(function(snapshot) {\n var coach = snapshot.child(\"coach\").val();\n var manager = snapshot.child(\"manager\").val();\n\n if(coach == true || manager == true){\n document.getElementById('record-match-id').className = \"nav-item active\";\n }\n\n })\n }\n}", "title": "" }, { "docid": "ab53de6c6c8bdac87e25497c472725fd", "score": "0.5457955", "text": "function admin_open_users() {\n manage_users_screen()\n}", "title": "" }, { "docid": "f6f68b8fe998a3fbca5a7038909b418f", "score": "0.54575586", "text": "function loadPage(userId) {\n uid = userId;\n\n // Load data from Firebase and render all of it\n loadData(() => {\n $('title').text(draftData[draftId].name + ' | IHS Artists Console');\n\n resizeWindow();\n renderFrontData(draftData[draftId].data.frontData);\n resizeWindow();\n });\n}", "title": "" }, { "docid": "c3612cefaf42caee23229bfa6fad7778", "score": "0.54539883", "text": "show(req, res) {\n res.render('homepage/show');\n }", "title": "" }, { "docid": "d48b9373b97ecefbdf2b72cc46744a1c", "score": "0.54538524", "text": "async handler_show(cmdInfo, msg, guildDb) {\n await this.requireScope(GuildDb.SCOPES.ADMIN, cmdInfo)\n \n let output = ''\n \n if (msg.author.id == process.env.SUPERUSER_ID && cmdInfo.arguments.length > 0 && cmdInfo.arguments[0] == 'leaguebot') {\n return await msg.channel.send(this._outputJSON(this.leaguebotDb.state)) \n }\n \n if (cmdInfo.arguments[0]) {\n return msg.channel.send(this._outputJSON(guildDb.state[cmdInfo.arguments[0]]))\n } else {\n return msg.channel.send(this._outputJSON(guildDb.state)) \n }\n }", "title": "" }, { "docid": "9fdf8875ae8ebf0840065a3e4ece8177", "score": "0.54477894", "text": "function isThisTheLoggedInUser() {\n return thisUsersMpInfo.pageUrl === window.location.href;\n}", "title": "" }, { "docid": "40b2f01da915ac7c6f7a210e7330f5b5", "score": "0.54457223", "text": "function front() {\n\t\t\t$state.go('coach.frontpage',{teamId:teamId});\n\t\t}", "title": "" }, { "docid": "f45265109f13f980f532fb81520e1981", "score": "0.54390115", "text": "renderLoggedInPath() {\n return (\n <section className='header-logged-in-profile'>\n\t\t\t\t<MainPage />\n\t\t\t </section>\n )\n }", "title": "" }, { "docid": "872d8819a63059cfe2ec8799a6ffcdc7", "score": "0.5438782", "text": "leader(){\n return(\n <div className=\"pane pain-split-two\">\n <h5><i class=\"fas fa-crown\"></i> Leader Board</h5>\n <table class=\"hover\">\n <tbody>\n <tr>\n <th class=\"text-center\">Rank</th>\n <th class=\"text-center\">User</th>\n <th class=\"text-center\">Value</th>\n </tr>\n {this.state.leaderboard.map(user => (\n <tr>\n <td className=\"text-center\">{user.rank}</td>\n <td className=\"text-center\">{user.name}</td>\n <td className=\"text-center dispNUM\">${Math.round(user.value * 10000) / 10000}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </div> \n );\n }", "title": "" }, { "docid": "2a5e2b65d39387d0d081e98a8c552ec6", "score": "0.5437616", "text": "clickUser(id) {\n if (this.state.userId && this.state.userId === id) {\n // enter into current user's own view\n this.setState({ route: 'home', id });\n } else {\n // enter into other user's view\n this.setState({ route: 'user', id });\n }\n }", "title": "" }, { "docid": "2e0fd149745acc5d977ea65f47d1282a", "score": "0.5437537", "text": "function showPlayerTurnScreen() {\r\n document.getElementById(\"player_info_form\").style.display = \"none\";\r\n document.getElementById(\"opponent_screen\").style.display = \"none\";\r\n document.getElementById(\"game_screen\").style.display = \"block\";\r\n document.getElementsByTagName(\"h3\")[0].innerHTML = \"Welcome \" + username +\r\n \",<br> The \" + age + \" Year Old.\";\r\n document.getElementsByTagName(\"h3\")[1].innerHTML = \"<em>Round: \" + (current_round + 1) +\r\n \" of \" + round_amount + \" | \" +\r\n wins + \" Wins / \" + (current_round - wins) + \" Loses</em>\";\r\n }", "title": "" }, { "docid": "e152e44f88d7ecbc7f91501c92907a47", "score": "0.54162794", "text": "function showMyteams(){\n var allTopics = getTopics();\n var currentuser = getUser(window.localStorage.getItem(\"Username\"));\n\n for(index1 in currentuser.myTopics){\n var topicindex;\n for(index2 in allTopics){\n if(parseInt(allTopics[index2].topicId) == parseInt(currentuser.myTopics[index1].topicId)){\n topicindex = index2;\n break;\n }\n }\n var listitem = $(\"<ons-list-item style='margin:12px;width:94%;background-color:white;height:85px;border-radius:8px;'></ons-list-item>\");\n var listitemLeft = $(\"<div class='left'></div>\");\n listitemLeft.append(\"<img class='list-item__thumbnail' style='height:60px;width:60px;' src='\"+allTopics[parseInt(topicindex)].topicPic +\"'>\");\n var listitemCenter = $(\"<div class='center'></div>\");\n listitemCenter.append(\"<span style='display:block;float:left;font-size:18px;' class='list-item__title'>\"+allTopics[parseInt(topicindex)].topicTitle+\"</span>\");\n listitem.append(listitemLeft);\n listitem.append(listitemCenter);\n $(\"#tem\").append(listitem);\n topicslistTOtopic(listitem,allTopics[parseInt(topicindex)].topicId);\n }\n }", "title": "" }, { "docid": "ed01263599244f4343d3d44eb88151a5", "score": "0.541543", "text": "clickUser(id) {\n if (this.state.userId && this.state.userId === id) {\n //click on owne page, directlly go to home route\n this.setState({route: \"home\"});\n } else {\n //user page didn't be requested before\n if (this.state.pageId !== id) {\n fetch(\"https://thousanday.com/user/read?id=\" + id, {\n method: \"GET\",\n })\n .then((response) => {\n if (response.ok) {\n return response.json();\n } else {\n processError(response);\n }\n })\n .then((user) => {\n this.setState({route: \"user\", pageData: user, pageId: id});\n });\n } else {\n //go to user page directlly\n this.setState({route: \"user\"});\n }\n }\n }", "title": "" }, { "docid": "98d533991c03e2fa330b672a732a673f", "score": "0.54139006", "text": "function navigateToGamesPage(){\n if(isUserLoggedIn()){\n window.location = \"http://localhost:8383/Priyanka_15400_CS557A_HW3/games.html\";\n } else {\n window.location = \"http://localhost:8383/Priyanka_15400_CS557A_HW3/login.html\";\n }\n}", "title": "" }, { "docid": "a042ed958f704d4c73abb01245f8d69d", "score": "0.5413143", "text": "function showMessageFormAndEditProfileButtonIfViewingSelf() {\n fetch('/login-status')\n .then(response => response.json())\n .then((loginStatus) => {\n if (loginStatus.isLoggedIn && loginStatus.username === parameterUsername) {\n fetchBlobstoreUrlAndShowMessageForm();\n fetchBlobstoreUrlAndShowEditProfileImageLabel();\n document.getElementById('edit-profile-button').classList.remove('hidden');\n }\n });\n}", "title": "" }, { "docid": "425975b14e6071c99420016c446eed52", "score": "0.5413029", "text": "function adminPage() {\r\n\tif (sessionStorage.getItem(\"username\") === \"[email protected]\") {\r\n\t\twindow.location.replace(\"admin_master.html\");\r\n\t} else {\r\n\t\twindow.location.replace(\"admin.html\");\r\n\t}\r\n}", "title": "" }, { "docid": "4eb67d6a6fdae66c6728b2903aa721d8", "score": "0.54110765", "text": "function toFirstPage() {\n if (playerIndex == 0) { return; }\n\n playerIndex = 0;\n createTable(activeBoard);\n}", "title": "" }, { "docid": "c836251e3624f9641fd7ebda4f567aab", "score": "0.54084665", "text": "function output_boards(req, res, resultsone, results, username) {\n\tres.render(\n 'grid_boards',\n\t\t {\n pageTitle: \"Boards of \" + req.query.id,\n\t\t results: resultsone,\n\t\t results_other: results,\n\t\t userid: req.session.userid,\n\t\t queried_userid: req.query.id,\n name: username,\n search: false\n }\n\t);\n}", "title": "" }, { "docid": "32b318800286bc9b33a812f419006f1d", "score": "0.54076177", "text": "async show({ auth, params }) {\n const { id } = params;\n const user = await auth.getUser();\n if (user.id !== Number(id)) {\n return \"You cannot see someone else's profile\";\n }\n return user;\n }", "title": "" }, { "docid": "d799283a045d13665b9b1e4de16102e5", "score": "0.5407177", "text": "function viewTable() {\r\n removePage(\"passwordPage\");\r\n displayPage(\"studentTablePage\");\r\n}", "title": "" }, { "docid": "3bdb3acd8fecf9750890481cf5c7cf48", "score": "0.5405556", "text": "function showNavForLoggedInUser() {\n $navLogin.hide();\n $navLogOut.show();\n $navWelcome.text(currentUser.username);\n $navWelcome.show();\n $navControl.show();\n}", "title": "" }, { "docid": "0457d757257040c640e98ae1a7d976c0", "score": "0.54023856", "text": "function userList() {\n window.location.replace(\"user-list.html\");\n}", "title": "" }, { "docid": "63b84619c315f44518d7451c133fa2c6", "score": "0.5402212", "text": "static displayUser() {\n document.querySelector(\"#user-info-avatar\").src = `https://cdn.discordapp.com/avatars/${localStorage.getItem(\"discordUserId\")}/${localStorage.getItem(\"avatar\")}.png`;\n document.querySelector(\"#user-info-username\").textContent = `${localStorage.getItem(\"username\")}#${localStorage.getItem(\"discriminator\")}`;\n }", "title": "" }, { "docid": "2caded783b743d2447d410677257d4b7", "score": "0.5398798", "text": "function matches(req, res, users) {\n var user = users[0]\n // if logged in user likes female\n if (req.session.user.type == \"female\") {\n // show everyone with gender female\n connection.query(\"SELECT * FROM accounts WHERE gender = 'female'\", onDone)\n } else {\n // show everyone with gender male\n connection.query(\"SELECT * FROM accounts WHERE gender = 'male'\", onDone)\n }\n\n function onDone(err, data) {\n if (err) { // if there's an error\n console.log(\"Error: \", err)\n return res.status(404).render(\"error.ejs\")\n } else {\n var locals = {\n data: data,\n session: req.session\n }\n res.render(\"matches.ejs\", locals) // go to matches.ejs\n }\n }\n}", "title": "" } ]
b3c01ea7254e1cb5b408f81a10bd13de
Function reset choice background color
[ { "docid": "a834940d33e5f9e0eacbfa61f0f7ff8c", "score": "0.85575706", "text": "function resetBackground() {\n choice1El.style.backgroundColor = \"#1f5f5f\";\n choice2El.style.backgroundColor = \"#1f5f5f\";\n choice3El.style.backgroundColor = \"#1f5f5f\";\n}", "title": "" } ]
[ { "docid": "afcfb586ca66697ed89f33da5de5f952", "score": "0.7599755", "text": "function resetColour(){\n\tdocument.getElementById(\"option1\").style.background=\"#efefef\";\n\tdocument.getElementById(\"option2\").style.background=\"#efefef\";\n\tdocument.getElementById(\"option3\").style.background=\"#efefef\";\n\tdocument.getElementById(\"option4\").style.background=\"#efefef\";\n}", "title": "" }, { "docid": "ce0851381c1a98da342b7b54194f2022", "score": "0.75886947", "text": "function resetOptionBackground() {\r\nconst options = document.getElementsByName(\"option\");\r\noptions.forEach((option) => {\r\n document.getElementById(option.labels[0].id).style.backgroundColor = \"\"\r\n})\r\n}", "title": "" }, { "docid": "474e5b86899ef635d9670b6acc219a13", "score": "0.7484378", "text": "function resetOptionBackground() {\n const options = document.getElementsByName(\"option\");\n options.forEach((option) => {\n document.getElementById(option.labels[0].id).style.backgroundColor = \"\"\n })\n}", "title": "" }, { "docid": "474e5b86899ef635d9670b6acc219a13", "score": "0.7484378", "text": "function resetOptionBackground() {\n const options = document.getElementsByName(\"option\");\n options.forEach((option) => {\n document.getElementById(option.labels[0].id).style.backgroundColor = \"\"\n })\n}", "title": "" }, { "docid": "94bc8d389da169db3b19754c258506ca", "score": "0.73978245", "text": "function choicefnc()\r\n {\r\n choice=this.style.backgroundColor;\r\n if(choice===select)\r\n {\r\n result.textContent=\"! CORRECT !\";\r\n changecolor();\r\n reset.textContent=\"PLAY AGAIN\";\r\n h1.style.backgroundColor=choice;\r\n }\r\n \r\n else\r\n {\r\n this.style.backgroundColor=\"#232323\";\r\n result.textContent=\"! TRY AGAIN !\";\r\n }\r\n }", "title": "" }, { "docid": "263ed472ff2dd4883b93799be1d6a041", "score": "0.7110767", "text": "function reset() {\n clear();\n randColor();\n createColorPicker();\n }", "title": "" }, { "docid": "ae80ea967e60d396c34149563f1adb7a", "score": "0.7071273", "text": "function reset() {\n\t\t_colors = _generateRandomColors(_numSquares);\n\t\t_pickedColor = _pickColor();\n\n\t\t_colorDisplay.textContent = _pickedColor;\n\t\t_resetButton.textContent = \"New Colors\";\n\t\t_messageDisplay.textContent = \"\";\t\n\n\t\tfor(let i = 0; i < _squares.length; i++) {\n\t\t\tif (_colors[i]) {\n\t\t\t\t_squares[i].style.display = \"block\";\n\t\t\t\t_squares[i].style.backgroundColor = _colors[i];\n\t\t\t} else {\n\t\t\t\t_squares[i].style.display = \"none\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t_h1.style.backgroundColor = \"steelblue\"; // original bg color\n\t}", "title": "" }, { "docid": "c12aa4c555f8dccc8110c61681977ebf", "score": "0.6885363", "text": "function reset(){\n colors = generateRandomColors(numCircles);\n pickedColor = pickColor();\n colorDisplay.textContent = pickedColor;\n resetButton.textContent = 'New Colors';\n messageDisplay.textContent = '';\n //change colors of circles\n for(let i = 0; i < circles.length; i++){\n if(colors[i]){\n circles[i].style.display = 'block';\n circles[i].style.background = colors[i];\n } else {\n circles[i].style.display = 'none';\n }\n }\n h1.style.background = 'steelblue';\n}", "title": "" }, { "docid": "4dbdf571d49150a134ceb1a042bdb1e8", "score": "0.686897", "text": "function reset(){\n\tcolors = generateRandomColors(numCircles);\n\tpickedColor = pickColor();\n\tcolorDisplay.text(pickColor);\n\tresetButton.text(\"New Colors\");\n\tmessageDisplay.text(\"\");\n\tmessageDisplay.css({color:\"black\", fontSize:\"100%\", fontWeight:\"normal\"});\n\tfor(var i = 0; i < circles.length; i++){\n\t\tif(colors[i]){\n\t\t\tcircles[i].style.display = \"block\"\n\t\t\tcircles[i].style.background = colors[i];\n\t\t} else {\n\t\t\tcircles[i].style.display = \"none\";\n\t\t}\n\t}\n\th1.css({background: \"steelblue\"});\n}", "title": "" }, { "docid": "ab9244bf19bb69e20352f8441583912b", "score": "0.68039274", "text": "function restore_options() {\r\n var bg_color = localStorage[\"background_color\"];\r\n if (!bg_color) {\r\n bg_color = \"333333\";\r\n }\r\n var bg_color_elem = document.getElementById(\"bgcolor\");\r\n bg_color_elem.value = bg_color;\r\n \r\n var bg_pattern = localStorage[\"background_pattern\"];\r\n if (!bg_pattern) {\r\n bg_pattern = \"bg_pattern.png\";\r\n }\r\n var bg_pattern_elem = document.getElementById(\"pattern\");\r\n \r\n for (var i = 0; i < bg_pattern_elem.children.length; i++) {\r\n var child = bg_pattern_elem.children[i];\r\n if (child.value == bg_pattern) {\r\n child.selected = \"true\";\r\n break;\r\n }\r\n }\r\n update_preview();\r\n}", "title": "" }, { "docid": "b1c465a79673411f4c6662ce862adcf1", "score": "0.68019044", "text": "function resetbtn(){\n\t//Getting colors from the array\n\tcolors = addingRandomColors(numBoxes);\n\t//Picking the right color\n\tcorrectColor = pickColor();\n\t//Displaying the correct color at header\n\tcolorDisplay.textContent = correctColor;\n\t//Getting new colors for boxes \n\tfor (var i = 0; i < colors.length; i++) {\n\t\tboxes[i].style.background = colors[i];\n\t}\n\th1Color.style.background = \"#4682B4\";\n\tresultMessage.textContent = \"\";\n\treset.textContent = \"New Colors\";\n}", "title": "" }, { "docid": "e974728791d69c70d8b1e1e9f1b8b7ce", "score": "0.6736131", "text": "function resetChairColors() {\n // change the \"chosenColor\" variable\n model.changeChosenColorVar(model.defaultColor);\n // change chair object\n model.resetChairToDefault();\n // colorize chair parts based on newly changed chair object\n view.colorizeSvg();\n // highlight the default color on the color palette\n\n view.changeActiveClass(\n document.querySelector(`.colors .color[data-color=\"${model.defaultColor}\"]`)\n );\n}", "title": "" }, { "docid": "beabbd5b51c5bcc6863188d15c40026a", "score": "0.6716268", "text": "function reset(){\n colors = generateRandomColors(numSquers);\n pickedColor = pickColor();\n rgbDisplay.textContent = pickedColor;\n resetButton.textContent = \"Új színeket akarok!\";\n messageDisplay.textContent = \"\";\n for(i=0; i<squares.length; i++){\n if(colors[i]){\n squares[i].style.display = \"block\";\n squares[i].style.backgroundColor = colors[i];\n } else{\n squares[i].style.display = \"none\";\n }\n }\n head.style.backgroundColor = \"steelblue\";\n}", "title": "" }, { "docid": "ed425c2613d2923a4447b2363d37553f", "score": "0.6712759", "text": "function reset() {\n // h1.style.backgroundColor = \"transparent\";\n colors = generateRandomColors(numSquares);\n pickedColor = pickColor();\n colorDisplay.textContent = pickedColor;\n resetBtn.textContent = \"New Colors\";\n messageDisplay.textContent = \"Guess the color!\";\n\n for (let i = 0; i < squares.length; i++) {\n if (colors[i]) {\n squares[i].style.display = \"block\";\n squares[i].style.backgroundColor = colors[i];\n } else {\n squares[i].style.display = \"none\";\n }\n };\n}", "title": "" }, { "docid": "eb59109c80b93191cdfad80494b8f4a3", "score": "0.6703863", "text": "function resetOptions() {\n jettPref.classList.add('rbcontainerSelected');\n\n [].forEach.call(rbs, function(rb) {\n rb.classList.remove('rbcontainerSelected');\n });\n }", "title": "" }, { "docid": "b9d32b8f4dc954d7852b8c65a88ce179", "score": "0.66457796", "text": "function setDefaultColor() {\n colorPalette.firstElementChild.classList.add('selected');\n}", "title": "" }, { "docid": "e758a61a583fe1114745ade52f08609f", "score": "0.6599509", "text": "function ResetButton()\r\n{\r\n\t//for generating the new color on click \r\n\tcolor = generateRandomColor(NumSquare);\r\n\t//pick any color random color from the color \r\n\tpickedColor = picked_Color();\r\n\t//To show the code of the color on the Heading \r\n\tcolorDisplay.textContent=pickedColor;\r\n\t//heading background color \r\n\th1.style.background=\"steelblue\";\r\n\t//Update the New color Button \r\n\tthis.textContent=\"New Color\";\r\n\r\n\tmessageDisplay.textContent = \" \";\r\n\r\n\tfor (var i=0;i<square.length;i++)\r\n\t{\r\n\r\n\t\tsquare[i].style.background=color[i];\r\n\r\n\t}\r\n\t//remove the color class \r\n\r\n\thardbtn.classList.remove(\"selected\");\r\n\t//remove the button color class \r\n\teasybtn.classList.remove(\"selected\");\r\n\t//add color class on reset button \r\n\tresetButton.classList.add(\"selected\");\r\n}", "title": "" }, { "docid": "82ba76266f2fc4a639a63587b9c23cd3", "score": "0.6582362", "text": "function resetColor(boolean, color) {\r\n if (!boolean) {\r\n // do not change defined backgorund;\r\n document.getElementById('taskText').style.backgroundImage = color;\r\n } else {\r\n // change defined background to actual one;\r\n document.getElementById('taskText').style.backgroundImage = color;\r\n }\r\n}", "title": "" }, { "docid": "6f4bde2775b58d89ce3e7b3d552bda05", "score": "0.6569528", "text": "function randomizeColorPalette() {\n let cells = document.querySelectorAll('section.color-palette .cell')\n for(let i = 0; i < cells.length; i++) {\n cells[i].style.backgroundColor = getRandomColor()\n }\n removeSelectedBoxFromColors()\n currentColor = defaultColor\n}", "title": "" }, { "docid": "c8bd6174032d6a00fa83ecc322d20a1d", "score": "0.65615314", "text": "function reset(){\n\tresetPressed = true;\n\tcolors = generateRandomColors(numSquares);\n\t//pick a new random color from array\n\tpickedColor = pickColor();\n\t//change colorDisplay to match picked Color\n\tcolorDisplay.textContent = pickedColor;\n\tresetButton.textContent = \"New Colors\"\n\tmessageDisplay.textContent = \"\";\n\t//change colors of squares\n\tfor(var i = 0; i < squares.length; i++){\n\t\tif(colors[i]){\n\t\t\tsquares[i].style.display = \"block\"\n\t\t\tsquares[i].style.background = colors[i];\n\t\t} else {\n\t\t\tsquares[i].style.display = \"none\";\n\t\t}\n\t}\n\th1.style.background = \"steelblue\";\n}", "title": "" }, { "docid": "c8bd6174032d6a00fa83ecc322d20a1d", "score": "0.65615314", "text": "function reset(){\n\tresetPressed = true;\n\tcolors = generateRandomColors(numSquares);\n\t//pick a new random color from array\n\tpickedColor = pickColor();\n\t//change colorDisplay to match picked Color\n\tcolorDisplay.textContent = pickedColor;\n\tresetButton.textContent = \"New Colors\"\n\tmessageDisplay.textContent = \"\";\n\t//change colors of squares\n\tfor(var i = 0; i < squares.length; i++){\n\t\tif(colors[i]){\n\t\t\tsquares[i].style.display = \"block\"\n\t\t\tsquares[i].style.background = colors[i];\n\t\t} else {\n\t\t\tsquares[i].style.display = \"none\";\n\t\t}\n\t}\n\th1.style.background = \"steelblue\";\n}", "title": "" }, { "docid": "198a855948472f2c90776b351573ad09", "score": "0.65602577", "text": "function randomColorPicker(){\n\n\t\t\tvar randomColor = randomColorGenerator();\n\n\t\t\tif(randomColor !== lastColor){\n\t\t\tdocument.getElementById('body').style.background = backgroundColors[randomColor];\n\t\t\tlastColor = randomColor;\n\t\t} else {\n\t\t\trandomColorPicker();\n\t\t}\n}", "title": "" }, { "docid": "0af30d7fb77966505c8fb3a50ce627be", "score": "0.65246904", "text": "function change_background() {\n\tdocument.execCommand(\"backColor\", false, $(\"#color_select\").val());\n}", "title": "" }, { "docid": "78cc29e9efd432297a6310023aebc125", "score": "0.65125835", "text": "function reset() {\n randomAnswer = pickedColor();\n rgbDisplay.textContent = randomAnswer;\n messageCenter.textContent = \"\";\n gameTitle.style.backgroundColor = \"steelblue\";\n resetButton.textContent = \"New Colors?\"\n}", "title": "" }, { "docid": "3102c18635d8148438ce480720b890c4", "score": "0.6499018", "text": "function updateSelection(){\n let random = document.getElementById('btn-random');\n let red = document.getElementById('btn-r');\n let orange = document.getElementById('btn-o');\n let yellow = document.getElementById('btn-y');\n let green = document.getElementById('btn-g');\n let cyan = document.getElementById('btn-c');\n let blue = document.getElementById('btn-b');\n let purple = document.getElementById('btn-p');\n\n if (lastColor < 0){\n random.style.backgroundColor = \"black\";\n // red\n }else if (lastColor === 0){\n red.style.backgroundColor = \"black\";\n // orange\n }else if (lastColor === 1){\n orange.style.backgroundColor = \"black\";\n // yellow\n }else if (lastColor === 2){\n yellow.style.backgroundColor = \"black\";\n // green\n }else if (lastColor === 3){\n green.style.backgroundColor = \"black\";\n // cyan\n }else if (lastColor === 4){\n cyan.style.backgroundColor = \"black\";\n // blue\n }else if (lastColor === 5){\n blue.style.backgroundColor = \"black\";\n // purple\n }else if (lastColor === 6){\n purple.style.backgroundColor = \"black\";\n }\n\n if (currentColor < 0){\n random.style.backgroundColor = \"#262626\";\n // red\n }else if (currentColor === 0){\n red.style.backgroundColor = \"rgba(255,0,0,0.5)\";\n // orange\n }else if (currentColor === 1){\n orange.style.backgroundColor = \"rgba(255,132,0,0.5)\";\n // yellow\n }else if (currentColor === 2){\n yellow.style.backgroundColor = \"rgba(255,232,0,0.5)\";\n // green\n }else if (currentColor === 3){\n green.style.backgroundColor = \"rgba(0,255,0,0.5)\";\n // cyan\n }else if (currentColor === 4){\n cyan.style.backgroundColor = \"rgba(0,255,232,0.5)\";\n // blue\n }else if (currentColor === 5){\n blue.style.backgroundColor = \"rgba(0,0,255,0.5)\";\n // purple\n }else if (currentColor === 6){\n purple.style.backgroundColor = \"rgba(255,0,232,0.5)\";\n }\n}", "title": "" }, { "docid": "88d7cea037ddd280ed428694e346cb82", "score": "0.6498241", "text": "function changeResetButtonBGBack() {\n resetButton.style('background-color', '#2b0c91');\n}", "title": "" }, { "docid": "3194dfb44aefacb3f12987af27e02c5c", "score": "0.6496355", "text": "function reset() {\n colors = generateRandomColors(num);\n winningColor = pickRandomColor();\n rgbText.textContent = winningColor;\n for (i = 0; i < squares.length; i++) {\n if(colors[i]){\n squares[i].style.display = \"block\";\n squares[i].style.backgroundColor = colors[i]\n } else {\n squares[i].style.display = \"none\";\n }\n squares[i].style.backgroundColor = colors[i];\n }\n header.style.backgroundColor = \"steelblue\"; \n comment.textContent = '';\n}", "title": "" }, { "docid": "9c900b1530faca6d32d36de1b79a7da0", "score": "0.64864737", "text": "function showAnswer(){\r\n selectedOption.checked=false;\r\n selectedOption.parentElement.style.setProperty(\"background\",\"rgba(255, 255, 255, 0.5)\");\r\n x[index].parentElement.style.setProperty(\"background\",\"rgba(255, 255, 255, 0.5)\");\r\n\r\n loadQuestion();\r\n}", "title": "" }, { "docid": "e4b9fd8b189c6652a55f071490384cc6", "score": "0.64551413", "text": "function reset(){\n // Generate all new colors\n colors = generateRandomColors(numSquares);\n // Pick a new random color from array\n pickedColor = pickColor();\n // Change colorDisplay to match picked color\n colorDisplay.textContent = pickedColor;\n resetButton.textContent = \"New Colors\";\n messageDisplay.textContent = \"\";\n // Change colors of squares\n for (var i = 0; i < squares.length; i++){\n // Hide or show squares if value exists at this index in colors array\n if (colors[i]){\n squares[i].style.display = \"block\";\n squares[i].style.backgroundColor = colors[i];\n }\n else {\n squares[i].style.display = \"none\";\n }\n squares[i].style.backgroundColor = colors[i];\n }\n h1.style.backgroundColor = \"steelblue\";\n}", "title": "" }, { "docid": "4e571c850eb87f6ec2b892ea905b773c", "score": "0.6453736", "text": "function resetColor() {\n\n let buttonsDiv = document.getElementById('buttons');\n colorValue.value = '';\n firstLorem.style.color = 'black';\n resetColorButton.disabled = true;\n\n}", "title": "" }, { "docid": "28b3fefac58c0ee69c0f34c81c4cbef9", "score": "0.6444047", "text": "function reset() {\n //Then new colors are generated \n colors = generateColorArray(numSquares);\n //Then a new color is picked\n pickedColor = pickColor();\n //Then the picked color display is changed\n displayColor.textContent = pickedColor;\n resetButton.textContent = \"New Colors\";\n messageDisplay.textContent = \"\";\n //Then the tile colors are reset\n for(var i = 0; i < squares.length; i++){\n if(colors[i]){\n squares[i].style.display = \"block\";\n squares[i].style.backgroundColor = colors[i];\n } else {\n squares[i].style.display = \"none\";\n }\n }\n //Then the h1 background is reset\n h1.style.background = \"#232323\";\n }", "title": "" }, { "docid": "566d47ec08701b5f4345c5620183472b", "score": "0.6435978", "text": "function reset()\n{\n // generate all new colors\n colors = generateRandomColors(numSquares);\n // pick a new random color from array\n pickedColor = pickColor();\n // Change color display to match picked color\n guessDisplay.textContent = pickedColor;\n // reset contents of button to new colors\n resetButton.textContent = \"New Colors\";\n // empty out the span with \"correct!/try again\"\n msgDisplay.textContent = \"\";\n // change colors of squares\n for(var i=0;i<squares.length;i++)\n {\n if (colors[i])\n {\n squares[i].style.display = \"block\";\n squares[i].style.background = colors[i];\n }\n else\n squares[i].style.display = \"none\";\n }\n // reset the background color of h1\n h1.style.background = \"steelblue\"\n}", "title": "" }, { "docid": "65e06bc613c50d8aec8736031e3f166f", "score": "0.64305985", "text": "function changeColor(){\n showIncorrect.checked = false;\n var colors = [\"lightgray\", \"purple\", \"green\"];\n var current = this.style.backgroundColor;\n\n for (var a = 0; a< colorArray.length; a++) { // reset all incorrect squares\n for (var b = 0; b < colorArray.length; b++) {\n colorArray[a][b].incorrect.style.visibility = \"hidden\";\n }\n }\n\n if(current === colors[0]){\n current = colors[1];\n this.currentColor = current;\n this.style.backgroundColor = current;\n }\n else if(current === colors[1]){\n current = colors[2];\n this.currentColor = current;\n this.style.backgroundColor = current;\n }\n else{\n current = colors[0];\n this.currentColor = current;\n this.style.backgroundColor = current;\n }\n\n }", "title": "" }, { "docid": "e874293997a4c4fee9682998f30660b7", "score": "0.64304894", "text": "function reset() {\n for (var i = 0; i < box.length; i++) {\n // put the content of display color span to random color from pickedColor array\n displayColor.textContent = pickedColor[Math.floor(Math.random() * numBox)];\n // filling all boxes with colors from array colors\n box[i].style.backgroundColor = pickedColor[i];\n //when clicking on one of the boxes\n box[i].addEventListener('click', clicking);\n // reinit the button background color\n // hardMode.style.backgroundColor = '#232323';\n // give the h1 origin background color\n h1.style.backgroundColor = 'steelblue';\n // reinint the message span\n msg.textContent = '';\n // reinit the message background color\n msg.style.color = '#232323';\n }\n}", "title": "" }, { "docid": "247c30718c00c815b69feb9db8f408a8", "score": "0.642381", "text": "function selectBackground(e){\n if (currentSelectedItem !== undefined){\n setItemColor(currentSelectedItem, false);\n }\n currentSelectedItem = undefined;\n generateTableData();\n }", "title": "" }, { "docid": "dccce41d87c4bd41d82023c05d3b6c67", "score": "0.6421817", "text": "function reset() {\n // Generate an array of new colors\n colors = generateRandomColors(numSquares);\n // Pick a new winning color\n pickedColor = pickColor();\n // Change colorDisplay to match clicked color\n colorDisplay.textContent = pickedColor;\n // Reset H1 Color\n h1.style.background = \"\";\n messageDisplay.textContent = \"\";\n // Change the color of squares on the screen\n configureSquares();\n}", "title": "" }, { "docid": "495ee73a298a6dbe759bb06bd93e84fb", "score": "0.64130765", "text": "function undoSetSelect() {\n\thasUpdate = false;\n\tcurrSelectedList = [];\n\tfor (i = 0; i < currSelectedCells.length; i++) {\n\t\tcurrSelectedCells[i].css('background','none');\n\t}\n\t\n}", "title": "" }, { "docid": "0d692957b27aa5a76d2784bc9e330e2b", "score": "0.6409358", "text": "function revertToDefaultColors(){\n\n\tvar defaultColorSettings = [\n\t\t{value: \"#CEC7C7\", change: \"background-color\", query: \"#patient-info\"},\n\t\t{value: \"#61B56E\", change: \"background-color\", query: \"#process-info\"},\n\t\t{value: \"#78F586\", change: \"background-color\", query: \".parent-task\"},\n\t\t{value: \"#78F586\", change: \"background-color\", query: \".child-task\"},\n\t\t{value: \"#EEEEEE\", change: \"background-color\", query: \".child-task.completed\"},\n\t\t{value: \"#EEEEEE\", change: \"background-color\", query: \".child-task.terminated\"},\n\t\t{value: \"16\", change: \"font-size\", query: \"*\"}\n\t];\n\n\t//Implement each setting\n\t$.each(defaultColorSettings, function(i, setting){\n\t\t$(setting.query).css(setting.change, \"\");\n\t\t$(\"input[data-query='\" + setting.query + \"']\").val(setting.value);\n\n\t\tif(setting.change == \"background-color\"){\n\t\t\t$(\"input[data-query='\" + setting.query + \"']\").parent().colorpicker('setValue', setting.value)\n\t\t}\n\t});\n\n\t$('.colorpicker-component').colorpicker('update');\n}", "title": "" }, { "docid": "e76dd29e402f4a5bea02bb3ed201db33", "score": "0.63947886", "text": "function changeResetButtonBG() {\n resetButton.style('background-color', '#22077d');\n}", "title": "" }, { "docid": "3ee9c121216156906fea9f271f853655", "score": "0.6393952", "text": "function resetBallbg() {\n var c = document.getElementById('ballSection').children;\n var i;\n for (i = 0; i < c.length; i++) {\n c[i].style.backgroundColor = \"red\";\n }\n \trandPick = [];\n\tstore = [];\n}", "title": "" }, { "docid": "f5f2d4a3013dd53f27103a4ce70bfe75", "score": "0.63899696", "text": "function resetBackground(element, bool) {\n bool ? element.style.backgroundColor = '' : element.style.backgroundColor = '#FFD2D2';\n }", "title": "" }, { "docid": "ef76b1f501c3bed0ed9a8c8e0d2a3221", "score": "0.6384364", "text": "function restoreColorOptions() {\n var colorChildren = colorSelect.children();\n\n // If only three of the six options are left...\n if(colorChildren.length === 3) {\n // check if the first option is still a punOption...\n if($(colorChildren[0]).val() === \"cornflowerblue\") {\n colorSelect.append(heartOptions);\n } else { // else if the first option is not a punOption...\n colorSelect.append(punsOptions);\n }\n // else if all the options are gone...\n } else if (colorChildren.length === 0) {\n // add all the options back.\n colorSelect.append(punsOptions).append(heartOptions);\n }\n}", "title": "" }, { "docid": "a0488e0e786952bfae41d70e78e82fae", "score": "0.63730395", "text": "function choice0(id) {\n document.getElementById(id).style.backgroundColor = \"lightblue\";\n document.getElementById(\"check1\").style.backgroundColor = \"white\";\n document.getElementById(\"check2\").style.backgroundColor = \"white\";\n document.getElementById(\"check3\").style.backgroundColor = \"white\";\n}", "title": "" }, { "docid": "fa42870769c214b0d7a017cfb34a0f7e", "score": "0.6372679", "text": "function applyColors () {\n var choicesHTML = '';\n var index = 0;\n var state = App.State.get();\n\n state.questions[state.currentQuestion].choices.forEach(function () {\n var choiceHTML = choicesTemplate.replace('@color', state.questions[state.currentQuestion].choices[index]);\n choicesHTML += choiceHTML;\n index++;\n });\n\n $('.options').html(choicesHTML);\n }", "title": "" }, { "docid": "eb73b3decdb8ae2b410efe7a3ac196d7", "score": "0.63662094", "text": "function reset_game() {\r\n\t\t\tset_rgb_list();\r\n\t\t\tset_background_colors();\r\n\t\t\tset_random();\r\n\t\t\tnewButton.innerHTML = \"new colors\";\r\n\t\t\tmessage.innerHTML = \"\";\r\n\t\t\ttitle.style.backgroundColor = \"steelblue\";\r\n\t\t}", "title": "" }, { "docid": "a4876f4544e9840276a385888379b114", "score": "0.6365804", "text": "function resetColors() {\r\n $(month).css({\r\n \"background-color\": \"#fff\",\r\n \"color\": \"#333\",\r\n \"border-radius\": \"0\",\r\n \"border-radius\": \"0\"\r\n });\r\n }", "title": "" }, { "docid": "9c0d81077791b4e039331484d0cd582a", "score": "0.63646007", "text": "function clearColor() {\n buttonupleft.style.backgroundColor = \"#23a521\";\n buttonupright.style.backgroundColor = \"#a321a5\";\n buttondownleft.style.backgroundColor = \"#a55e21\";\n buttondownright.style.backgroundColor = \"#2144a5\";\n}", "title": "" }, { "docid": "b014454787e9f19f1d7868da15bbb406", "score": "0.6364067", "text": "function sketch() {\n if ($(this).css(\"background-color\") === 'rgb(255, 255, 255)'){\n $(this).css(\"background-color\", randomColor);\n }\n\t\telse if ($(this).css(\"background-color\") != 'rgb(255, 255, 255)') {\n\t\t\t$(this).css(\"background-color\", makeDarker);\n\t\t}\n\t}", "title": "" }, { "docid": "8f280568364100e196546289a254cfa1", "score": "0.63635796", "text": "function resetMappa(){\n $(\".postazione\").css(\"background-color\", \"white\");\n $(\".postazione\").addClass(\"free\");\n $(\".postazione\").removeClass(\"selected\");\n $(\".postazione\").css(\"cursor\", \"\");\n $(\"#conferma\").hide();\n $(\"#totale\").hide();\n}", "title": "" }, { "docid": "37a73aaaba9855801de6411500235318", "score": "0.6360248", "text": "function Manualrouge(){\n pickedColor = \"red\";\n repere.style.backgroundColor = pickedColor\n console.log(\"nouvelle couleur !\")\n}", "title": "" }, { "docid": "f1acf9c7a6610497aa5fb1e0c72e3918", "score": "0.6356843", "text": "function randomize() {\n document.getElementById('randomColor').style.backgroundColor = randomColors();\n}", "title": "" }, { "docid": "e57e138a8b2a05d3a5457a2af92f8ab3", "score": "0.6354057", "text": "function resetColor() {\r\n\tsetColorVars(\"\", \"\", \"\", \"\", 0);\r\n\t$(document.body).css({\r\n\t\t\"color\" : \"\",\r\n\t\t\"background-color\" : \"\"\r\n\t});\r\n\t$('a').css(\"color\", \"\");\r\n\t$('.container').css({\r\n\t\t\"border-bottom-color\" : \"\",\r\n\t\t\"border-right-color\" : \"\",\r\n\t\t\"border-left-color\" : \"\"\r\n\t});\r\n\t$('.nav-menu').css({\r\n\t\t\"color\" : \"\",\r\n\t\t\"background-color\" : \"\"\r\n\t});\r\n\t$('.nav-item > a').css({\r\n\t\t\"background-color\" : \"\",\r\n\t\t\"border\" : \"\",\r\n\t\t\"color\" : \"\"\r\n\t});\r\n\t$('.sub-nav').css({\r\n\t\t\"background-color\" : \"\",\r\n\t\t\"border\" : \"\",\r\n\t\t\"color\" : \"\"\r\n\t});\r\n\t$('.sub-nav > .sub-nav-group > li > a').css(\"color\", \"\");\r\n\t$('.article-container').css({\r\n\t\t\"border-top-color\" : \"\",\r\n\t\t\"border-bottom-color\" : \"\",\r\n\t\t\"border-right-color\" : \"\",\r\n\t\t\"border-left-color\" : \"\"\r\n\t});\r\n\t$('textarea').css({\r\n\t\t\"background\" : \"\",\r\n\t\t\"border\" : \"\"\r\n\t});\r\n\t$('input').css({\r\n\t\t\"background\" : \"\",\r\n\t\t\"border\" : \"\"\r\n\t});\r\n\t$('legend').css({\r\n\t\t\"color\" : \"\",\r\n\t\t\"border-bottom-color\" : \"\"\r\n\t});\r\n\t$('button').css({\r\n\t\t\"background\" : \"\",\r\n\t\t\"border\" : \"\",\r\n\t\t\"color\" : \"\",\r\n\t\t\"text-shadow\" : \"\"\r\n\t});\r\n\t$('.sp-input').css(\"color\", \"\");\r\n\t$('.sidebar').css({\r\n\t\t\"border-right-color\" : \"\",\r\n\t\t\"border-left-color\" : \"\"\r\n\t});\r\n\t$('.well').css({\r\n\t\t\"border-top-color\" : \"\",\r\n\t\t\"border-right-color\" : \"\",\r\n\t\t\"border-bottom-color\" : \"\",\r\n\t\t\"border-left-color\" : \"\",\r\n\t\t\"background-color\" : \"\"\r\n\t});\r\n\t$('#footer').css(\"border-top\", \"\");\r\n\t$('h2').css({\r\n\t\t\"border-top-color\" : \"\",\r\n\t\t\"border-bottom-color\" : \"\"\r\n\t});\r\n\t$('.footer-container').css({\r\n\t\t\"color\" : \"\",\r\n\t\t\"background-color\" : \"\"\r\n\t});\r\n}", "title": "" }, { "docid": "f0fa93125d039c91abd5cb933a20894f", "score": "0.6350876", "text": "function changeBackground() {\n\n vm.css[ \"backgroundColor\" ] = getRandomRGBA();\n\n }", "title": "" }, { "docid": "0525fcfa5172d65193bbb02d80260bf0", "score": "0.6340737", "text": "reset() {\n Object.values(this.stimuli).forEach((el) => {\n el.stim.setAutoDraw(false);\n el.stim.color = this.options.unactivatedColor;\n });\n }", "title": "" }, { "docid": "4b1cf9c247bc2dd5ab3a04ee8ffab2d3", "score": "0.6330304", "text": "function reset(){\r\n\tcolors = generateColors(numSquares);\r\n\tpickedColor = pickColor();\r\n\tcolorDisplay.textContent = pickedColor;\r\n\theading.style.backgroundColor = \"steelblue\";\r\n\tresetButton.textContent = \"New Colors\";\r\n\tmessageDisplay.textContent = \"\";\r\n\t\r\n\tfor (var i = 0; i <squares.length; i++){\r\n\t\tif(numSquares === 8){\r\n\t\t\tsquares[i].style.width = \"22.5%\";\r\n\t\t\tsquares[i].style.paddingBottom = \"22.5%\";\r\n\t\t\tsquares[i].style.margin = \"1.25%\";\r\n\t\t}else{\r\n\t\t\tsquares[i].style.width = \"30%\";\r\n\t\t\tsquares[i].style.paddingBottom = \"30%\";\r\n\t\t\tsquares[i].style.margin = \"1.66%\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\tif(colors[i]){\r\n\t\t\tsquares[i].style.backgroundColor = colors[i];\r\n\t\t\tsquares[i].style.display = \"block\";\r\n\t\t}else{\r\n\t\t\tsquares[i].style.display = \"none\";\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "f1cb1cf27706fb6510b2612f36db821a", "score": "0.632513", "text": "function changeBackgroundColor() {\n let randomColor = colors[Math.floor((Math.random() * colors.length))];\n // we really really want a new color every time\n while (lastBackgroundColor === randomColor) {\n randomColor = colors[Math.floor((Math.random() * colors.length))];\n }\n\n lastBackgroundColor = randomColor;\n document.body.style.background = randomColor;\n }", "title": "" }, { "docid": "e22ff3dca1edcf82d6ca593751c53bc3", "score": "0.6323093", "text": "function resetSelection() {\n//console.log(\"resetSelection\");\n for (i = 0; i < _chosenBtnArr.length; i++) {\n var btnObj = _secRefArr[_chosenBtnArr[i]];\n btnObj.className = 'secButton';\n }\n\n _chosenBtnArr.splice(0, _chosenBtnArr.length);\n }", "title": "" }, { "docid": "e4fa2f8422644f52c580d2aa6ff688e9", "score": "0.63205945", "text": "function fillColors() {\n\tshuffleColor();\n\tfor (var i = 0 ; i < colors.length ; i++ ){\n\t\tsquareColors[i].style.background=colors[i];\n\t\t \n\t}\n\t\n\tvar pickedColor=colors[pickingColors()];\n\t$(\"#selectedColor\").text(pickedColor);\n\t$(\"#selectedColor\").css(\"color\",pickedColor);\n\t\n}", "title": "" }, { "docid": "3a8a7ec8682e18eea9c730b09e989d7f", "score": "0.6315426", "text": "function reset() {\n var hardBtn = document.getElementById('hard');\n var easyBtn = document.getElementById('easy');\n var resetButton = document.getElementById(\"reset\");\n resetButton.addEventListener(\"click\", function() {\n var colorDisplay = document.getElementById(\"color-display\");\n if (hardBtn.classList.contains('selected')) {\n colors = generateRandomColors(6);\n } else {\n colors = generateRandomColors(3);\n }\n pickedColor = pickColor();\n colorDisplay.textContent = pickedColor;\n fillSquare();\n var h1 = document.querySelector(\"h1\");\n h1.style.backgroundColor = \"#232323\";\n var clearText = document.getElementById(\"message\");\n clearText.textContent = '';\n\n });\n}", "title": "" }, { "docid": "0a76e1dcfe42807c970e9fb728bfa2c7", "score": "0.63145155", "text": "function reset() {\n //generate new colors\n colors = pickColor(numSquares);\n\n //pick new random colors\n pickedColor = colors[randomColor()];\n\n //updating page\n changeSquares();\n messageDisplay.textContent = '';\n h1.style.background = 'steelblue';\n resetButton.textContent = 'New Colors';\n colorDisplay.textContent = pickedColor;\n}", "title": "" }, { "docid": "e4391f282c9b5018f8238e3d81cb19c8", "score": "0.6310121", "text": "function set_tolc(){\n var band6 = document.getElementById('band6');\n var tolcs = document.getElementById('tolc');\n var six = document.getElementById('six');\n colorband(band6,tolcs.value);\n six.selectedIndex=tolcs.selectedIndex;\n six.style.backgroundColor=six.options[tolcs.selectedIndex].style.backgroundColor;\n six.style.color=six.options[tolcs.selectedIndex].style.color;\n\n\n\n}", "title": "" }, { "docid": "5b53d1a91e42d2d2cbdbccde3bcac31a", "score": "0.6303228", "text": "function changeBGcolor(bgColor) {\r\n document.getElementById(\"body\").style.background = bgColor;\r\n document.getElementById(\"bg-changer__color-name\").innerHTML = bgColor;\r\n hideMenu();\r\n document.getElementById(\"bg-changer__radio--\" + bgColor).checked = true;\r\n}", "title": "" }, { "docid": "694ea109ee139ecb0d457e31f8e55f0d", "score": "0.63025856", "text": "function setRandomBackground(){\r\n\r\n\tcolor1.value = getRandomColor(); \r\n\tcolor2.value = getRandomColor(); \r\n\r\n\tupdateBackground();\r\n\r\n}", "title": "" }, { "docid": "0cee1182b5a71bdb57d838cfc8eeaf0d", "score": "0.63006413", "text": "function resetStyles() {\n selectedLayer.resetStyle(selection);\n}", "title": "" }, { "docid": "9c59c1ff44d7ade63fe007bd219eba62", "score": "0.6300225", "text": "function revertColor() {\n myElement.style.fill = staticColorValue;\n stepLable.style.fill = \"black\";\n kmLable.style.fill = \"black\";\n batLable.style.fill = \"black\";\n timeLable.style.fill = \"black\";\n}", "title": "" }, { "docid": "db136034f8ecbfc7a8398198655b3518", "score": "0.6297896", "text": "function setColorFondoSelecionado(color){\n sBgColorSelec=color;\n}", "title": "" }, { "docid": "17f4b495701aa58fae153c81cc69dcb0", "score": "0.6293939", "text": "function clearLightsGoSel() {\n document.getElementById('stopLight').style.backgroundColor = \"black\";\n document.getElementById('slowLight').style.backgroundColor = \"black\";\n}", "title": "" }, { "docid": "842df5b9caaf637493fbafc9931a17ed", "score": "0.62935495", "text": "function resetColours() {\n\tvar circles = document.getElementsByClassName('round-button-circle_1');\n\tfor (var i = 0; i < circles.length; i++) {\n\t\tcircles[i].style.background='#5AB9EA';\n\t}\n}", "title": "" }, { "docid": "ca2d206833b4c609b21e35f8d3638a9c", "score": "0.62934357", "text": "function clearcolor() {\n topL.style.backgroundColor = \"green\";\n topR.style.backgroundColor = \"red\";\n bottomR.style.backgroundColor = \"blue\";\n bottomL.style.backgroundColor = \"yellow\";\n}", "title": "" }, { "docid": "97376a02927cdf462ef0fc15ef4d13a2", "score": "0.6289596", "text": "function resetOptions() {\n localStorage.setItem(\"mainColor\", \"#4caf50\");\n localStorage.setItem(\"Background_option\", \"Yes\");\n localStorage.setItem(\"bullet_option\", \"Yes\");\n mainColorInlocalStorage();\n // OR\n // window.location.reload();\n}", "title": "" }, { "docid": "177c2e8afbb16919d174f965464f770d", "score": "0.6275539", "text": "function reset() {\n // generate a random color for the number of squares\n colors = generateRandomColors(numSquares);\n // pick a new random color from array\n pickedColor = pickColor();\n // change colorDisplay to match picked color\n colorDisplay.textContent = pickedColor;\n // resets \"Play Again?\" to \"New Colors\"\n resetButton.textContent = \"New Colors\";\n // Clears \"Try Again?\" or \"Correct\" span to empty str\n messageDisplay.textContent = \"\";\n // change colors of squares\n for (let i = 0; i < squares.length; i++) {\n if(colors[i]) {\n squares[i].style.display = \"block\";\n squares[i].style.backgroundColor = colors[i];\n } else {\n squares[i].style.display = \"none\";\n }\n }\n h1.style.backgroundColor = \"steelBlue\";\n \n}", "title": "" }, { "docid": "099ce3fd484b72f25c6c2aafe455b4f0", "score": "0.62705106", "text": "function answerWhite() {\n htmlAnswer.style.backgroundColor = \"azure\";\n}", "title": "" }, { "docid": "dfbbbe8c95c49693b7d3212e8f814d2d", "score": "0.6267595", "text": "function choice3(id) {\n document.getElementById(id).style.backgroundColor = \"lightblue\";\n document.getElementById(\"check0\").style.backgroundColor = \"white\";\n document.getElementById(\"check1\").style.backgroundColor = \"white\";\n document.getElementById(\"check2\").style.backgroundColor = \"white\";\n}", "title": "" }, { "docid": "501b27ea0818208dca82072ab4e9e70f", "score": "0.6262859", "text": "function userChooseBackground(event) {\n divColor = event.target.value;\n while (grid.firstChild) {\n grid.removeChild(grid.lastChild);\n }\n createGrid(size);\n randomBackground.style.backgroundColor = divColor;\n}", "title": "" }, { "docid": "36cb291a42e915a1e87ea143bc432bb3", "score": "0.626193", "text": "function resetHightlightDefault() {\n hightlightStyleInput.value = defaultHighlightStyle;\n}", "title": "" }, { "docid": "0d6d4f66c7cddc1ad02db5168cbec8d7", "score": "0.6249597", "text": "function resetButtonColors() {\n document.getElementById(\"pause-button\").style.backgroundColor = \"white\";\n document.getElementById(\"slow-button\").style.backgroundColor = \"white\";\n document.getElementById(\"fast-button\").style.backgroundColor = \"white\";\n\n document.getElementById(\"pause-button\").style.color = \"black\";\n document.getElementById(\"slow-button\").style.color = \"black\";\n document.getElementById(\"fast-button\").style.color = \"black\";\n }", "title": "" }, { "docid": "56baa06d1d5298c2963c1b3acff4445e", "score": "0.6242312", "text": "function resetColour() {\n // The current colour name the user is trying to guess.\n currentColour = ``;\n indexCurrentColour = null;\n\n // The colour of the word that is not necessarily the same.\n currentColourTrap = ``;\n indexTrap = null;\n\n scoreSayTheColourIncremented = false;\n}", "title": "" }, { "docid": "b59e0886a01c619b19f7493aa7fa6f4f", "score": "0.6240334", "text": "function colors(el, init) {\n el.style.backgroundColor = init\n setTimeout(function() {el.style.backgroundColor = ''}, 100)\n }", "title": "" }, { "docid": "5ad4bea17d8120f812ce06d0b31eae02", "score": "0.6237443", "text": "function setStyle1(){\n document.getElementById('header').style.backgroundColor=\"\";\n document.getElementById('button').style.background=\"\";\n document.getElementById('header').style.color=\"\";\n document.getElementById('mainDiv').style.backgroundColor=\"\";\n document.getElementById('mainDiv').style.color=\"\";\n document.getElementById('courseP').style.color=\"\";\n document.getElementById('xl').style.background=\"\";\n\n}", "title": "" }, { "docid": "994295282469fd1b6764d82a1670266c", "score": "0.6237283", "text": "function changecolor()\r\n{\r\n for(var i=0;i<square.length;i++)\r\n square[i].style.background=choice;\r\n}", "title": "" }, { "docid": "e3a65992ba4b83d43bbff54373dee2ca", "score": "0.6236501", "text": "function choice1(id) {\n document.getElementById(id).style.backgroundColor = \"lightblue\";\n document.getElementById(\"check0\").style.backgroundColor = \"white\";\n document.getElementById(\"check2\").style.backgroundColor = \"white\";\n document.getElementById(\"check3\").style.backgroundColor = \"white\";\n}", "title": "" }, { "docid": "f09b72bbea4787591e85cc890a43dddd", "score": "0.62363124", "text": "function changeColor() { \n h1.style.backgroundColor = picked\n for(var i=0;i<colors.length;i++) {\n //colors \n square[i].style.backgroundColor = picked\n }\n \n }", "title": "" }, { "docid": "f0ab49ffe1f32a377414e11ca398b350", "score": "0.62334394", "text": "function applyPickedColor(colorEntity){\n for(let i = 0; i < squares.length; i++){\n squares[i].style.backgroundColor = colorEntity;\n squares[i].innerHTML = \"\";\n }\n}", "title": "" }, { "docid": "bd3d74e7f778398ea6961057221097bc", "score": "0.6228463", "text": "function resetMedium() {\n container.innerHTML = \"\";\n message.textContent = \"\";\n setGame(7);\n\n for (var i = 0; i < squares.length; i++) {\n squares[i].style.backgroundColor = arr[i];\n }\n }", "title": "" }, { "docid": "2d2cba2835553223b745687ecf8c0507", "score": "0.62279713", "text": "function backgroundColorSwitcher() {\n if (syiro.style.Get(document.body, \"background-color\") == \"\") { // If we are currently using a light background\n syiro.style.Set(document.body, \"background-color\", \"rgba(0,0,0,0.75)\"); // Set to 75% black\n }\n else { // If we are currently using a dark background\n syiro.style.Set(document.body, \"background-color\", \"\"); // Unset\n }\n}", "title": "" }, { "docid": "cc1e4478bd5157a349badf1aab60bc7b", "score": "0.62207144", "text": "function unselectPaletteShapes()\n\t{\n\n\t for (var i = 0; i < shapes.length; i++)\n\t {\n\t if (selectedPaletteShape != shapes[i])\n\t {\n $(\"#\" + shapes[i]).css(\"fill\", \"white\");\n }\n\t }\n\n\t for (var i = 0; i < lines.length; i++)\n\t {\n\t if (selectedPaletteShape != lines[i])\n\t {\n \t $(\"#\" + lines[i]).css(\"background-color\", \"white\");\n \t }\n\t }\n\n if (selectedPaletteShape != $(\"#selShapeTemplate\").val())\n {\n\t $(\"#selShapeTemplate\").val(-1);\n\t getController().selectedShapeTemplate = {id: -1};\n\t }\n\t}", "title": "" }, { "docid": "dd4733906748397c57b6358a976785cc", "score": "0.621835", "text": "function update_color_choosen_indicator(){\n r = red_slider.value;\n g = green_slider.value;\n b = blue_slider.value;\n choosen_color_indicator.style.backgroundColor = toRGB(r,g,b); \n}", "title": "" }, { "docid": "29c4a54169fe1060fc210a3e1422d21b", "score": "0.62182516", "text": "function clearColorSettings() {\n console.log(inputFontColor);\n execCmd(\"foreColor\", false, \"#000000\");\n execCmd(\"hiliteColor\", false, \"#ffffff\");\n richTextField.contentDocument.body.focus();\n}", "title": "" }, { "docid": "89941e33248b4a6c47ee2f0077945da1", "score": "0.6217847", "text": "function changePalette(){\n if(document.getElementById('fondo').checked){\n document.body.style.backgroundImage = \"url(\\'media/fondo-noche.png\\')\";\n document.getElementById('searchDiv').style.boxShadow=\"0 2px 2px 1px #08113d\";\n document.getElementById('lupa').style.backgroundImage=\"url(\\'media/gray-search-icon.png\\')\";\n var namesNight = document.getElementsByClassName('nombrePokemon');\n for(var i = 0; i < namesNight.length; i++) {\n namesNight[i].style.color=\"whitesmoke\";\n }\n var messages = document.getElementsByClassName('message');\n for(var i = 0; i < messages.length; i++) {\n messages[i].style.color=\"whitesmoke\";\n }\n }else {\n document.body.style.backgroundImage = \"url(\\'media/fondo-hada.png\\')\";\n document.getElementById('searchDiv').style.boxShadow = \"0 2px 2px 1px #2f9b76\";\n document.getElementById('lupa').style.backgroundImage = \"url(\\'media/white-search-icon.png\\')\";\n var namesDay = document.getElementsByClassName('nombrePokemon');\n for(var i = 0; i < namesDay.length; i++) {\n namesDay[i].style.color=\"#2f9b76\";\n }\n var messages = document.getElementsByClassName('message');\n for(var i = 0; i < messages.length; i++) {\n messages[i].style.color=\"#2f9b76\";\n }\n }\n}", "title": "" }, { "docid": "6db4d23bf96de83e58dae6dc53b0d00c", "score": "0.62174785", "text": "function reset(){\r\n\t//generate new colors\r\n\tcolors = genRC(numSquares);\r\n\r\n\t//pick new color\r\n\tpickedcolor = colors[pickColorfnc()];\r\n\r\n\t//change objective message\r\n\tobjcolor.textContent = pickedcolor;\r\n\r\n\t//changing header background color\r\n\th1.style.backgroundColor = \"steelblue\";\r\n\r\n\t//setting to \"New Colors\" when clicked \"Play again\"\r\n\tresetbtn.textContent = \"New Colors\";\r\n\r\n\t//hidding out report message\r\n\tdocument.querySelector(\"#reportmessage\").textContent = \"\";\r\n\r\n\t//change color of squares\r\n\tfor (var i = 0; i<squares.length; i++){\r\n\t\tif(colors[i]){ //checking if there is a color in colors array, it will add that color to squares array\r\n\t\t\tsquares[i].style.display = \"block\";\r\n\t\t\tsquares[i].style.backgroundColor = colors[i];\t\r\n\t\t}else {\r\n\t\t\tsquares[i].style.display = \"none\";\r\n\t\t}\r\n\t\t\r\n\t}\r\n}", "title": "" }, { "docid": "66affa9ead862a993a2fd74847c98f24", "score": "0.6206341", "text": "function resetChair() {\n // color the chair with default color\n resetChairColors();\n view.renderSelectedColors();\n // remove all features\n view.renderFeatures();\n // remove highlight on all options (features)\n view.resetChosenOptions();\n // clear the selected features ul\n view.resetSelectedFeatures();\n}", "title": "" }, { "docid": "e89cffc3ce598b7db6d02418f0296316", "score": "0.62002623", "text": "function drawColorSelector(colorCode){\n switch (colorCode){\n case \"R\": \n \n // Update title \n// $(\"#question\").text(\"Click on one of the below color samples to select the best <b>RED</b>\");\n $(\"#question\").html(\"Nhấn vào ô màu dưới đây để chọn màu <b>ĐỎ</b> đẹp nhất\");\n // Load colors\n for (i=1; i<=11; i++){\n document.getElementById(\"co_cell_\"+i).style.backgroundColor = ncs2hex(Red_Colors[i-1]);\n } \n break;\n case \"B\":\n // Update title\n $(\"#question\").html(\"Nhấn vào ô màu dưới đây để chọn màu <b>XANH LAM</b> đẹp nhất\");\n // Load colors\n for (i=1; i<=11; i++){\n document.getElementById(\"co_cell_\"+i).style.backgroundColor = ncs2hex(Blue_Colors[i-1]);\n }\n break;\n case \"G\":\n // Update title\n $(\"#question\").html(\"Nhấn vào ô màu dưới đây để chọn màu <b>XANH LỤC</b> đẹp nhất\");\n // Load colors\n for (i=1; i<=11; i++){\n document.getElementById(\"co_cell_\"+i).style.backgroundColor = ncs2hex(Green_Colors[i-1]);\n }\n break;\n case \"Y\":\n \n // Update title\n $(\"#question\").html(\"Nhấn vào ô màu dưới đây để chọn màu <b>VÀNG</b> đẹp nhất\");\n // Load colors\n for (i=1; i<=11; i++){\n document.getElementById(\"co_cell_\"+i).style.backgroundColor = ncs2hex(Yellow_Colors[i-1]);\n }\n break;\n }\n}", "title": "" }, { "docid": "100605c73a527d60ea16b66716f93e48", "score": "0.61967134", "text": "function clearSelection() {\n\t\t$(\"#rootPanel\").css(\"background\",\"url('images/servergroup/commander bg.png')\");\n\t\t$(\"#rootPanel\").find(\"div\").css(\"color\", \"#000000\");\n\t\t$(\"#rootPanel\").find(\"img.focus\").hide();\n\t\t$(\".server\").css(\"background\", \"#ffffff\");\n\t\t$(\".server\").find(\"div\").css(\"color\", \"#000000\");\n\t\t$(\".server\").find(\"img.focus\").hide();\n\t\t$(\".group\").css(\"background\", \"url('images/servergroup/group bg.png')\");\n\t\t$(\".group\").find(\"div\").css(\"color\", \"#000000\");\n\t\t$(\".group\").find(\".groupIcon\").removeClass(\"groupIconFocus\");\n\t\t$(\".group\").find(\".groupToggleIconFocus\").hide();\n\t\t$(\".group\").find(\".groupToggleIcon\").show();\n\t}", "title": "" }, { "docid": "335e73e65892d4cc4c869f8adcc40af2", "score": "0.61875755", "text": "function unselCtrl(ctrl) {\r\n ctrl.style.backgroundColor = \"WHITE\";\r\n}", "title": "" }, { "docid": "d9a1916e959d916b9a52402025ca5232", "score": "0.61871", "text": "function choice2(id) {\n document.getElementById(id).style.backgroundColor = \"lightblue\";\n document.getElementById(\"check0\").style.backgroundColor = \"white\";\n document.getElementById(\"check1\").style.backgroundColor = \"white\";\n document.getElementById(\"check3\").style.backgroundColor = \"white\";\n}", "title": "" }, { "docid": "87cac291c3fbdfd044e46f55c268f389", "score": "0.61858296", "text": "function resetEasy() {\n container.innerHTML = \"\";\n message.textContent = \"\";\n setGame(3);\n\n for (var i = 0; i < squares.length; i++) {\n squares[i].style.backgroundColor = arr[i];\n }\n }", "title": "" }, { "docid": "24b854bb713a27ef71c5498360b16ddf", "score": "0.61657596", "text": "function stage() {\n for(let i = 0; i < selectedMode; i++){\n color.push(randomColorGenerator());\n } \n randomSelection = randomChoiceGenerator(selectedMode);\n choice = color[randomSelection];\n colorGuess.textContent = choice;\n colorGuess.style.color = \"white\";\n message.textContent = \" \";\n setColor();\n}", "title": "" }, { "docid": "e90c5a46946550386f36f86eccf9c9e2", "score": "0.6160221", "text": "function resetSelection() {\n s_top = 0;\n s_bottom = 0;\n selection = false;\n $(\"#clear_button\").attr(\"disabled\", \"disabled\");\n}", "title": "" }, { "docid": "e676d7be4f55353c9652fdb857d7a8df", "score": "0.6156999", "text": "function setBackground(color) {\n var $selected_cells = editor.$el.find('.fr-selected-cell'); // Set background color.\n\n if (color != 'REMOVE') {\n $selected_cells.css('background-color', editor.helpers.HEXtoRGB(color));\n } // Remove background color.\n else {\n $selected_cells.css('background-color', '');\n }\n\n _showEditPopup();\n }", "title": "" }, { "docid": "e6833d0bd497c58035994c21eb94aeb7", "score": "0.6156872", "text": "function restore_options() {\n chrome.storage.sync.get({'labels': {}}, update_labels);\n var palette = document.getElementById('palette')\n var colors = [\n \"#e7e7e7\", \"#b6cff5\", \"#98d7e4\", \"#e3d7ff\", \"#fbd3e0\", \"#f2b2a8\",\n \"#c2c2c2\", \"#4986e7\", \"#2da2bb\", \"#b99aff\", \"#f691b2\", \"#fb4c2f\",\n \"#ffc8af\", \"#ffdeb5\", \"#fbe983\", \"#fdedc1\", \"#b3efd3\", \"#a2dcc1\",\n \"#ff7537\", \"#ffad46\", \"#cca6ac\", \"#ebdbde\", \"#42d692\", \"#16a765\",\n ]\n colors.forEach(function(hex) {\n let color = document.createElement(\"div\");\n color.className = 'color';\n color.style.backgroundColor = hex\n color.style.color = textColor(hex)\n color.textContent = 'a'\n color.onclick = () => setColor(hex);\n palette.appendChild(color);\n });\n}", "title": "" } ]
655a693ad3abbcb1c26c74c38fd8c193
Creates new element for each test. Asserts it has no initial path using the element.path getter.
[ { "docid": "531daa9a948392138996358a1752bc29", "score": "0.5571243", "text": "function setUp() {\n document.body.innerHTML = '<bread-crumb></bread-crumb>';\n const path = assert(document.querySelector('bread-crumb')).path;\n assertEquals('', path);\n}", "title": "" } ]
[ { "docid": "d28a505015e351b9d9d29498176a0a3b", "score": "0.5482528", "text": "function newElem(pathElem, array) {\n var element = {\n label: pathElem.name,\n module: pathElem.module,\n identifier: pathElem.hasIdentifier() ? getIdentifierStr(pathElem) : '',\n identifiersLength: pathElem.identifiers.length,\n children: [],\n };\n\n array.push(element);\n\n // TODO: add function's description\n function getIdentifierStr(path){\n return path.identifiers.map(function (identifier){\n return '{' + identifier.label + '}';\n }).join(' ');\n }\n }", "title": "" }, { "docid": "2daa39a84d0601351fcf8f571e5c7623", "score": "0.54165006", "text": "function testBreadcrumbSetPathChangesElementPath() {\n const element = getBreadCrumb();\n\n // Set path.\n element.path = 'A/B/C/D/E/F';\n assertEquals(element.path, element.getAttribute('path'));\n\n // Change path.\n element.path = 'G/H/I';\n assertEquals(element.path, element.getAttribute('path'));\n}", "title": "" }, { "docid": "78ccd44281067642b3a01dfa1315f146", "score": "0.5367066", "text": "setupUselessElement() {}", "title": "" }, { "docid": "c788656b210aebe324f29bd075efcd02", "score": "0.53391397", "text": "itAddsTheArrayElementToTheRootDocument() {\n it('adds the new element', function() {\n expect(this.doc.elements.at(0).key).to.equal('emails');\n });\n\n it('adds the new embedded element', function() {\n expect(this.doc.elements.at(0).elements.at(0).key).to.equal(0);\n });\n\n it('sets the new embedded element value', function() {\n expect(this.doc.elements.at(0).elements.at(0).value).to.equal('[email protected]');\n });\n\n it('flags the new element as added', function() {\n expect(this.doc.elements.at(0).elements.at(0).isAdded()).to.equal(true);\n });\n }", "title": "" }, { "docid": "4b6e5438569dcefef40f91bf1545bd14", "score": "0.52429515", "text": "async function addElement() {\n this.answers = await this.prompt([\n config.PROMPTS.which_element,\n config.PROMPTS.component_name,\n config.PROMPTS.which_component_type,\n ]);\n\n const { atomic_element_name, component_name, component_type } = this.answers;\n\n if (!this.config.get(\"target_path\")) {\n this.answers = await this.prompt([config.PROMPTS.target_path]);\n }\n\n //Write to the objects\n let destination_path = `${this.config.get(\n \"target_path\"\n )}/${atomic_element_name}/${component_name}/`;\n this.fs.copyTpl(\n this.templatePath(`element/_${component_type}-component.js`),\n this.destinationPath(destination_path + \"index.js\"),\n {\n name: component_name,\n }\n );\n\n //Copy css\n this.fs.copyTpl(\n this.templatePath(\"element/_element.css\"),\n this.destinationPath(destination_path + \"index.css\")\n );\n\n //Copy test\n this.fs.copyTpl(\n this.templatePath(\"element/_test.js\"),\n this.destinationPath(destination_path + \"test.js\"),\n {\n name: component_name,\n }\n );\n this.log(\"Successfully created \" + component_name + \"!\");\n}", "title": "" }, { "docid": "3a4024a51a191a7807e10cd4461e99ff", "score": "0.52355963", "text": "function createInputs(){\n elementsData.forEach(element => {\n createEl(element);\n });\n checkStoryArrow();\n}", "title": "" }, { "docid": "e2e312549b42a97007b704453193deb3", "score": "0.5179341", "text": "function FakeElement(name) { this.name = name }", "title": "" }, { "docid": "e880123f6c836930a02981f59d1b7e4f", "score": "0.5143777", "text": "function createElementTest(count, validate) {\n var div;\n while (count--) {\n div = document.createElement(\"div\");\n }\n\n if (validate) {\n var expected = \"<div></div>\";\n var actual = div.outerHTML;\n this.api.assert(actual === expected, expected, actual);\n }\n}", "title": "" }, { "docid": "569270ebe894511d09f8b1c7c78f5192", "score": "0.5111144", "text": "function elementStart(index, name, attrs, localRefs) {\n ngDevMode && assertEqual(viewData[BINDING_INDEX], tView.bindingStartIndex, 'elements should be created before any bindings ');\n ngDevMode && ngDevMode.rendererCreateElement++;\n var native = elementCreate(name);\n ngDevMode && assertDataInRange(index - 1);\n var tNode = createNodeAtIndex(index, 3 /* Element */, native, name, attrs || null);\n if (attrs) {\n setUpAttributes(native, attrs);\n }\n appendChild(native, tNode, viewData);\n createDirectivesAndLocals(localRefs);\n // any immediate children of a component or template container must be pre-emptively\n // monkey-patched with the component view data so that the element can be inspected\n // later on using any element discovery utility methods (see `element_discovery.ts`)\n if (elementDepthCount === 0) {\n attachPatchData(native, viewData);\n }\n elementDepthCount++;\n}", "title": "" }, { "docid": "e579bf15c555646534a237344afc97a1", "score": "0.5085212", "text": "itAddsTheEmbeddedArrayElementToTheRootDocument() {\n it('adds the new element', function() {\n expect(this.doc.elements.at(0).key).to.equal('emails');\n });\n\n it('adds the new embedded element', function() {\n expect(this.doc.elements.at(0).elements.at(0).key).to.equal(0);\n });\n\n it('sets the new embedded element document key', function() {\n expect(this.doc.elements.at(0).elements.at(0).elements.at(0).key).to.equal('home');\n });\n\n it('sets the new embedded element document value', function() {\n expect(this.doc.elements.at(0).elements.at(0).elements.at(0).value).to.equal('[email protected]');\n });\n\n it('flags the new element as added', function() {\n expect(this.doc.elements.at(0).elements.at(0).elements.at(0).isAdded()).to.equal(true);\n });\n }", "title": "" }, { "docid": "34d891996aff6559c7e2e98fc97a9aaf", "score": "0.5067972", "text": "function prepareTests(tests) {\n tests.forEach(function(test) {\n var node = document.createElement('div');\n node.innerText = test.name;\n document.body.appendChild(node);\n test.node = node;\n });\n}", "title": "" }, { "docid": "55884bb033592bef4aefbf584ffa2835", "score": "0.50600845", "text": "function elementStart(index, name, attrs, localRefs) {\n var viewData = getViewData();\n var tView = getTView();\n ngDevMode && assertEqual(viewData[BINDING_INDEX], tView.bindingStartIndex, 'elements should be created before any bindings ');\n ngDevMode && ngDevMode.rendererCreateElement++;\n var native = elementCreate(name);\n ngDevMode && assertDataInRange(index - 1);\n var tNode = createNodeAtIndex(index, 3 /* Element */, native, name, attrs || null);\n if (attrs) {\n setUpAttributes(native, attrs);\n }\n appendChild(native, tNode, viewData);\n createDirectivesAndLocals(tView, viewData, localRefs);\n // any immediate children of a component or template container must be pre-emptively\n // monkey-patched with the component view data so that the element can be inspected\n // later on using any element discovery utility methods (see `element_discovery.ts`)\n if (getElementDepthCount() === 0) {\n attachPatchData(native, viewData);\n }\n increaseElementDepthCount();\n}", "title": "" }, { "docid": "9cea16eb2c996e49eaf5ab0794919087", "score": "0.5019821", "text": "_create() {\n this._createRoot();\n this.props.items.forEach(item => this._appendItem(item));\n }", "title": "" }, { "docid": "b5e1e5ddc999c50c9c82af59f046e3b8", "score": "0.49909997", "text": "build(element, attributesArray, pathList) {\n if (!element) return pathList;\n if (element.nodeType === 9) return pathList;\n\n const array = this._buildAttributes(element, attributesArray);\n pathList.push({ [`${element.tagName.toLowerCase()}`]: array });\n return this.build(element.parentNode, attributesArray, pathList);\n }", "title": "" }, { "docid": "888e8686d66f0d8f6bdd48731fa90a65", "score": "0.4981445", "text": "finalizeInitialChildren(testElement, type, props, rootContainerInstance) {\n return false;\n }", "title": "" }, { "docid": "f565559192f0c5a098056b031488b1f5", "score": "0.49748516", "text": "function verifyPathChildElement(element, attributeValue) {\n expect(element.childNodes.length).toBe(1);\n var pathElement = element.childNodes[0];\n expect(pathElement.tagName.toLowerCase()).toBe('path');\n // The testing data SVGs have the name attribute set for verification.\n expect(pathElement.getAttribute('name')).toBe(attributeValue);\n}", "title": "" }, { "docid": "74f3f92eae8471babfd0ca0f294bda4f", "score": "0.49669045", "text": "function testBreadcrumbEmptyPath() {\n const element = getBreadCrumb();\n\n // Set path.\n element.path = '';\n\n // clang-format off\n const expect = element.path +\n ' 1: display:none id=first hidden' +\n ' 2: display:none elider[aria-expanded=false,aria-haspopup,aria-label,hidden]' +\n ' 3: display:none id=second hidden' +\n ' 4: display:none id=third hidden' +\n ' 5: display:none id=fourth hidden';\n // clang-format on\n\n const path = element.parts.join('/');\n assertEquals(expect, path + ' ' + getBreadCrumbButtonState());\n}", "title": "" }, { "docid": "d9c05c4a7cd154a1f9a9f83202180c62", "score": "0.49466503", "text": "async insertElementWorkflow(activeNode = null, testOnly = false) {}", "title": "" }, { "docid": "60105f5d223acc611c6e4cb73cf81f3c", "score": "0.49376485", "text": "function createElement(test) {\n return window.customElements.whenDefined('task-page').then(() => {\n container.innerHTML = `<task-page client_id=for_test testing_offline=true></task-page>`;\n expect(container.firstElementChild).toBeTruthy();\n test(container.firstElementChild);\n });\n }", "title": "" }, { "docid": "f02835fb065d74fa95cbaa996ce1f8aa", "score": "0.49203694", "text": "function test() {\n\t\t\tvar ret = false;\n\t\t\tvar $fixture = jQuery(\"#qunit-fixture\");\n\t\t\t$fixture.on(\"DOMNodeInserted\", function () {\n\t\t\t\tret = true;\n\t\t\t\t$fixture.off(\"DOMNodeInserted\");\n\t\t\t}).append(\"<div></div>\");\n\t\t\treturn ret;\n\t\t}", "title": "" }, { "docid": "18abf9b82d940e33a4fb0fa672360b10", "score": "0.4913835", "text": "function runTests() {\n // tests for html constructing class\n var nodeman = new HtmlNodeManager();\n tassert(AssertCount == 2, \"HtmlNodeManager should assert if not given parent or construct function\");\n reset();\n var foo = new footest();\n nodeman = new HtmlNodeManager(foo, foo.construct);\n tassert(AssertCount == 0, \"HtmlNodeManager should not assert if given parameters\");\n tassert(nodeman.isDirty === false, \"HtmlNodeManager should have property 'isdirty' set to false\");\n tassert(!nodeman.dirty, \"HtmlNodeManager should not expose internal field 'dirty'\");\n tassert(!nodeman.node, \"HtmlNodeManager should not expose internal field 'node'\");\n tassert(!nodeman.owner, \"HtmlNodeManager should not expose internal field 'owner'\");\n\n }", "title": "" }, { "docid": "c6f42fa79b417293e146849db2ad6bf6", "score": "0.4909649", "text": "itAddsTheEmbeddedDocumentElementToTheRootDocument() {\n it('adds the new element', function() {\n expect(this.doc.elements.at(0).key).to.equal('email');\n });\n\n it('adds the new embedded element', function() {\n expect(this.doc.elements.at(0).elements.at(0).key).to.equal('home');\n });\n\n it('sets the new embedded element value', function() {\n expect(this.doc.elements.at(0).elements.at(0).value).to.equal('[email protected]');\n });\n\n it('flags the new element as added', function() {\n expect(this.doc.elements.at(0).elements.at(0).isAdded()).to.equal(true);\n });\n }", "title": "" }, { "docid": "5579101bc0843b5bcd397284e65f9890", "score": "0.4901873", "text": "addNewElement (Element){\n this.grid[Element.X][Element.Y] = Element;\n this.container.appendChild(Element.newElement);\n }", "title": "" }, { "docid": "6702b4b3637afddfa9add62afb5b8399", "score": "0.4867838", "text": "setupUselessElement() {\n this.uselessElement = this.document.createElement('div');\n }", "title": "" }, { "docid": "add7eb1118e59a87f83cf86cfef93f74", "score": "0.4844351", "text": "function setUpDOM() {}", "title": "" }, { "docid": "0dbde43170d9065692fca7fa2259868e", "score": "0.48197463", "text": "function createDummyElements() {\n var semanticElements = [\n \"article\", \"aside\", \"details\", \"figcaption\", \"figure\",\n \"footer\", \"header\", \"hgroup\", \"menu\", \"nav\", \"section\"\n ];\n for (var i = 0; i < semanticElements.length; i++) {\n document.createElement(semanticElements[i]);\n }\n}", "title": "" }, { "docid": "0dbde43170d9065692fca7fa2259868e", "score": "0.48197463", "text": "function createDummyElements() {\n var semanticElements = [\n \"article\", \"aside\", \"details\", \"figcaption\", \"figure\",\n \"footer\", \"header\", \"hgroup\", \"menu\", \"nav\", \"section\"\n ];\n for (var i = 0; i < semanticElements.length; i++) {\n document.createElement(semanticElements[i]);\n }\n}", "title": "" }, { "docid": "d03a8a0e14c98baf47346292ae2eb986", "score": "0.47979745", "text": "createItem (element) {\n\t\tif (!element) {\n\t\t\telement = this.templateElement.cloneNode(true);\n\t\t}\n\n\t\tvar template = this.itemTemplate || this.template?.itemTemplate || null;\n\n\t\tvar item = Mavo.Node.create(element, this.mavo, {\n\t\t\tcollection: this,\n\t\t\ttemplate,\n\t\t\tproperty: this.property,\n\t\t\ttype: this.type\n\t\t});\n\n\t\tif (!this.itemTemplate) {\n\t\t\tthis.itemTemplate = template || item;\n\t\t}\n\n\t\treturn item;\n\t}", "title": "" }, { "docid": "2bcfd40b8a134436f54745d00d75d9ff", "score": "0.4786093", "text": "function setup() {\r\n pTest = new PathTest();\r\n}", "title": "" }, { "docid": "069c2b9ce24a0baafa615fffebcbde0e", "score": "0.47694558", "text": "function addTest()\n {\n App.prototype.unitTests[template] = function ()\n {\n return {\n init : function ()\n {\n test(\"global masthead structure\", function()\n {\n ok($('#masthead_container'), \"masthead_container exists\");\n ok($('#global_masthead'), \"global_masthead exists\");\n ok($('#global_masthead h2'), \"global_masthead h2 exists\");\n ok($('#global_masthead h2 span#data_chapter_number').length > 0, \"global_masthead h2 span#data_chapter_number exists\");\n ok($('#global_masthead h2 span#data_chapter_name').length > 0, \"global_masthead h2 span#data_chapter_name exists\");\n ok($('#global_masthead h3').length > 0, \"global_masthead h3 exists\");\n ok($('#global_masthead h3 span#data_chapter_description').length > 0, \"global_masthead h3 span#data_chapter_description exists\");\n });\n \n test(\"global navigation structure\", function()\n {\n ok($('#navigation_container'), \"navigation_container exists\");\n \n $('#menu_button').trigger('click');\n ok($('#page_array_container').css('display') === 'block', \"menu showing\");\n \n $('#nav_menu_close').trigger('click');\n ok($('#page_array_container').css('display') === 'none', \"menu hiding\");\n });\n \n test(\"contextual glossary check\", function()\n {\n\n \n // Get all contextual glossary items\n var contextualGlossary = $('.contextual_glossary');\n \n if (contextualGlossary.length > 0) {\n // Get expected values\n var glossaryData = app.glossary.getData();\n \n // Click each, and check the values against expected values\n $.each(contextualGlossary, function (linkIndex, linkValue)\n {\n var expectedDefinition,\n expectedTerm,\n tempDOMHolder = $('<span>');\n \n $.each(glossaryData.terms, function (glossaryIndex, glossaryValue)\n {\n // Put glossaryValue.name in a DOM element to convert it's HTML entities\n $(tempDOMHolder).html(glossaryValue.name);\n \n if ($(tempDOMHolder).html() === $(linkValue).html()) {\n expectedDefinition = glossaryValue.description[0];\n expectedTerm = $(tempDOMHolder).html();\n \n // Click the contextual glossary link\n $(contextualGlossary[linkIndex]).trigger('click');\n }\n \n });\n \n ok($('#Glossary.contextual_view').length > 0, \"contextual glossary opened\");\n ok($('#data_glossary h3').html(), \"<h3> has data: \" + $('#data_glossary h3').html());\n ok($('#data_glossary p').html(), \"<p> has data: \" + $('#data_glossary p').html());\n ok($('#data_glossary h3').html() === expectedTerm, \"expected contextual glossary term: \" + expectedTerm + \", found: \" + $('#data_glossary h3').html());\n ok($('#data_glossary p').html() === expectedDefinition, \"expected contextual glossary definition: \" + expectedDefinition + \", found: \" + $('#data_glossary p').html());\n \n // Click the document (close the link)\n $(document).trigger('click');\n \n ok($('#Glossary.contextual_view').length === 0, \"contextual glossary closed\");\n });\n }\n });\n }\n };\n };\n }", "title": "" }, { "docid": "daad2568550f51e03825046c9dc6fbe4", "score": "0.47666103", "text": "createNewPaths(svg, broadcast){\n \n let newPaths = this.splitLine(svg.path)\n \n\n if(newPaths == true){\n return\n }\n this.deleteLine(svg.id, broadcast)\n for(let path of newPaths){\n \n let tempPath = SVGPath.stringifyPath(path)\n this.createLine(tempPath, broadcast)\n\n \n }\n\n }", "title": "" }, { "docid": "3409a50935f085cc4e93d0b662915520", "score": "0.47433436", "text": "get empty() {\n this.obj.should.have.property('length');\n this.assert(\n 0 === this.obj.length\n , function(){ return 'expected ' + this.inspect + ' to be empty' }\n , function(){ return 'expected ' + this.inspect + ' not to be empty' });\n return this;\n }", "title": "" }, { "docid": "c4c4796251f10581b3d46852793f7fc4", "score": "0.47278214", "text": "function testGetInvalidElement() {\n\t\tjsUnity.assertions.assertNull(U.$('doesNotExist'));\n\t}", "title": "" }, { "docid": "cbb168db6e4de885166d89838f2a7a43", "score": "0.4723558", "text": "function cleanupElements() {\n Object.keys(createdElements).forEach(function(hash) {\n createdElements[hash].cleanup();\n });\n\n createdElements = {};\n}", "title": "" }, { "docid": "0d5fb7eb31984d39cd22ec3dee6070aa", "score": "0.4707225", "text": "createNewPath(){\r\n this.path = aStar(this.game, this.body[0], this.game.apple);\r\n\r\n if (this.path.length <= 0) {\r\n // No path to the apple: go to an available neighbour cell\r\n this.path = this.goToAvailableNeighbour();\r\n }\r\n\r\n if (this.path.length <= 0) {\r\n // No available cell: continue forwards and crash\r\n this.path = this.continueForwards();\r\n }\r\n }", "title": "" }, { "docid": "d591753266a423c76b88cb7a383e4eb8", "score": "0.47044387", "text": "function initialCheck(elements) {\n if (isRemoved(elements)) {\n throw new Error('The element(s) given to waitForElementToBeRemoved are already removed. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal.');\n }\n }", "title": "" }, { "docid": "f5c7d2cc5698882e8b0cee64dd823eb9", "score": "0.46968612", "text": "function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = HEADER_OFFSET + index;\n ngDevMode &&\n assertEqual(getBindingIndex(), tView.bindingStartIndex, 'elements should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateElement++;\n ngDevMode && assertIndexInRange(lView, adjustedIndex);\n const renderer = lView[RENDERER];\n const native = lView[adjustedIndex] = elementCreate(name, renderer, getNamespace());\n const tNode = tView.firstCreatePass ?\n elementStartFirstCreatePass(index, tView, lView, native, name, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex];\n setCurrentTNode(tNode, true);\n const mergedAttrs = tNode.mergedAttrs;\n if (mergedAttrs !== null) {\n setUpAttributes(renderer, native, mergedAttrs);\n }\n const classes = tNode.classes;\n if (classes !== null) {\n writeDirectClass(renderer, native, classes);\n }\n const styles = tNode.styles;\n if (styles !== null) {\n writeDirectStyle(renderer, native, styles);\n }\n appendChild(tView, lView, native, tNode);\n // any immediate children of a component or template container must be pre-emptively\n // monkey-patched with the component view data so that the element can be inspected\n // later on using any element discovery utility methods (see `element_discovery.ts`)\n if (getElementDepthCount() === 0) {\n attachPatchData(native, lView);\n }\n increaseElementDepthCount();\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n executeContentQueries(tView, tNode, lView);\n }\n if (localRefsIndex !== null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n}", "title": "" }, { "docid": "fbeb3bc01883942b2323e7141e28d1e7", "score": "0.4690276", "text": "function EmptyElem(tile_wh, x, y){\n\t//create an element for the empty grid and place it on the 9th grid to manipulate as an empty grid.\n\t//emptiness is not the absence of elements but the existence of an empty element.\n\tempty_elem = document.createElement(\"DIV\");\n\tempty_elem.style.width = tile_wh + \"px\";\n\tempty_elem.style.height = tile_wh + \"px\";\n\tempty_elem.style.position = \"absolute\";\n\tempty_elem.style.left = x;\n\tempty_elem.style.top = y;\t\n\tdocument.body.appendChild(empty_elem);\n\tempty_index = 8; //realigning to the nineth grid for a new game.\n\ttile_arr[empty_index] = empty_elem; //add the empty element to the elements array.\n}", "title": "" }, { "docid": "7d9a69d07cb0e2876ae1327de2f06c7c", "score": "0.46882048", "text": "function testBreadcrumbOnePartPath() {\n const element = getBreadCrumb();\n\n // Set path.\n element.path = 'A';\n\n // clang-format off\n const expect = element.path +\n ' 1: display:block id=first text=[A]' +\n ' 2: display:none elider[aria-expanded=false,aria-haspopup,aria-label,hidden]' +\n ' 3: display:none id=second hidden' +\n ' 4: display:none id=third hidden' +\n ' 5: display:none id=fourth hidden';\n // clang-format on\n\n const path = element.parts.join('/');\n assertEquals(expect, path + ' ' + getBreadCrumbButtonState());\n}", "title": "" }, { "docid": "5a400a0f1ed0d71757f38454a25b95a1", "score": "0.46812266", "text": "function createNew() {\n testLog.logStart(\"ActionsPage: Click New Action\");\n cy.get('.cl-page').within(() => {\n cy\n .get('[data-testid=\"actions-button-create\"]')\n .should(\"be.visible\")\n .then(function (response) {\n testLog.logStep(\"Create a New Action\");\n })\n .click({ force: true });\n })\n cy.get('[data-testid=\"dropdown-action-type\"]')\n .should(\"be.visible\");\n testLog.logEnd();\n}", "title": "" }, { "docid": "afb495444a149e00484855f3635ede89", "score": "0.46718925", "text": "function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = HEADER_OFFSET + index;\n ngDevMode &&\n assertEqual(getBindingIndex(), tView.bindingStartIndex, 'elements should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateElement++;\n ngDevMode && assertDataInRange(lView, adjustedIndex);\n const renderer = lView[RENDERER];\n const native = lView[adjustedIndex] = elementCreate(name, renderer, getNamespace());\n const tNode = tView.firstCreatePass ?\n elementStartFirstCreatePass(index, tView, lView, native, name, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex];\n setPreviousOrParentTNode(tNode, true);\n const mergedAttrs = tNode.mergedAttrs;\n if (mergedAttrs !== null) {\n setUpAttributes(renderer, native, mergedAttrs);\n }\n const classes = tNode.classes;\n if (classes !== null) {\n writeDirectClass(renderer, native, classes);\n }\n const styles = tNode.styles;\n if (styles !== null) {\n writeDirectStyle(renderer, native, styles);\n }\n appendChild(tView, lView, native, tNode);\n // any immediate children of a component or template container must be pre-emptively\n // monkey-patched with the component view data so that the element can be inspected\n // later on using any element discovery utility methods (see `element_discovery.ts`)\n if (getElementDepthCount() === 0) {\n attachPatchData(native, lView);\n }\n increaseElementDepthCount();\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n executeContentQueries(tView, tNode, lView);\n }\n if (localRefsIndex !== null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n}", "title": "" }, { "docid": "f8de6588fe1f4577a102bb40dcbd35ad", "score": "0.46700826", "text": "function testEmptyObject(key) {\n describe('with open=\"0\"', function () {\n beforeEach(function () {\n element = createDirective(key);\n });\n it('should render \"Object\"', function () {\n expect(element.text()).toContain('Object');\n });\n });\n describe('with open=\"1\"', function () {\n beforeEach(function () {\n element = createDirective(key, 1);\n });\n it('should render \"Object\"', function () {\n expect(element.text()).toContain('Object');\n });\n it('should render have toggler opened', function () {\n expect(element.find('.toggler').hasClass('open')).toBe(true);\n });\n });\n }", "title": "" }, { "docid": "4c7210950c57e4d0bc9783d6f5079997", "score": "0.4667821", "text": "function elementStart(index, name, attrs, localRefs) {\n var lView = getLView();\n var tView = lView[TVIEW];\n ngDevMode && assertEqual(lView[BINDING_INDEX], tView.bindingStartIndex, 'elements should be created before any bindings ');\n ngDevMode && ngDevMode.rendererCreateElement++;\n var native = elementCreate(name);\n ngDevMode && assertDataInRange(lView, index - 1);\n var tNode = createNodeAtIndex(index, 3 /* Element */, native, name, attrs || null);\n if (attrs) {\n // it's important to only prepare styling-related datastructures once for a given\n // tNode and not each time an element is created. Also, the styling code is designed\n // to be patched and constructed at various points, but only up until the first element\n // is created. Then the styling context is locked and can only be instantiated for each\n // successive element that is created.\n if (tView.firstTemplatePass && !tNode.stylingTemplate && hasStyling(attrs)) {\n tNode.stylingTemplate = initializeStaticContext(attrs);\n }\n setUpAttributes(native, attrs);\n }\n appendChild(native, tNode, lView);\n createDirectivesAndLocals(tView, lView, localRefs);\n // any immediate children of a component or template container must be pre-emptively\n // monkey-patched with the component view data so that the element can be inspected\n // later on using any element discovery utility methods (see `element_discovery.ts`)\n if (getElementDepthCount() === 0) {\n attachPatchData(native, lView);\n }\n increaseElementDepthCount();\n // if a directive contains a host binding for \"class\" then all class-based data will\n // flow through that (except for `[class.prop]` bindings). This also includes initial\n // static class values as well. (Note that this will be fixed once map-based `[style]`\n // and `[class]` bindings work for multiple directives.)\n if (tView.firstTemplatePass) {\n var inputData = initializeTNodeInputs(tNode);\n if (inputData && inputData.hasOwnProperty('class')) {\n tNode.flags |= 8 /* hasClassInput */;\n }\n }\n // There is no point in rendering styles when a class directive is present since\n // it will take that over for us (this will be removed once #FW-882 is in).\n if (tNode.stylingTemplate && (tNode.flags & 8 /* hasClassInput */) === 0) {\n renderInitialStylesAndClasses(native, tNode.stylingTemplate, lView[RENDERER]);\n }\n}", "title": "" }, { "docid": "4c7210950c57e4d0bc9783d6f5079997", "score": "0.4667821", "text": "function elementStart(index, name, attrs, localRefs) {\n var lView = getLView();\n var tView = lView[TVIEW];\n ngDevMode && assertEqual(lView[BINDING_INDEX], tView.bindingStartIndex, 'elements should be created before any bindings ');\n ngDevMode && ngDevMode.rendererCreateElement++;\n var native = elementCreate(name);\n ngDevMode && assertDataInRange(lView, index - 1);\n var tNode = createNodeAtIndex(index, 3 /* Element */, native, name, attrs || null);\n if (attrs) {\n // it's important to only prepare styling-related datastructures once for a given\n // tNode and not each time an element is created. Also, the styling code is designed\n // to be patched and constructed at various points, but only up until the first element\n // is created. Then the styling context is locked and can only be instantiated for each\n // successive element that is created.\n if (tView.firstTemplatePass && !tNode.stylingTemplate && hasStyling(attrs)) {\n tNode.stylingTemplate = initializeStaticContext(attrs);\n }\n setUpAttributes(native, attrs);\n }\n appendChild(native, tNode, lView);\n createDirectivesAndLocals(tView, lView, localRefs);\n // any immediate children of a component or template container must be pre-emptively\n // monkey-patched with the component view data so that the element can be inspected\n // later on using any element discovery utility methods (see `element_discovery.ts`)\n if (getElementDepthCount() === 0) {\n attachPatchData(native, lView);\n }\n increaseElementDepthCount();\n // if a directive contains a host binding for \"class\" then all class-based data will\n // flow through that (except for `[class.prop]` bindings). This also includes initial\n // static class values as well. (Note that this will be fixed once map-based `[style]`\n // and `[class]` bindings work for multiple directives.)\n if (tView.firstTemplatePass) {\n var inputData = initializeTNodeInputs(tNode);\n if (inputData && inputData.hasOwnProperty('class')) {\n tNode.flags |= 8 /* hasClassInput */;\n }\n }\n // There is no point in rendering styles when a class directive is present since\n // it will take that over for us (this will be removed once #FW-882 is in).\n if (tNode.stylingTemplate && (tNode.flags & 8 /* hasClassInput */) === 0) {\n renderInitialStylesAndClasses(native, tNode.stylingTemplate, lView[RENDERER]);\n }\n}", "title": "" }, { "docid": "4c7210950c57e4d0bc9783d6f5079997", "score": "0.4667821", "text": "function elementStart(index, name, attrs, localRefs) {\n var lView = getLView();\n var tView = lView[TVIEW];\n ngDevMode && assertEqual(lView[BINDING_INDEX], tView.bindingStartIndex, 'elements should be created before any bindings ');\n ngDevMode && ngDevMode.rendererCreateElement++;\n var native = elementCreate(name);\n ngDevMode && assertDataInRange(lView, index - 1);\n var tNode = createNodeAtIndex(index, 3 /* Element */, native, name, attrs || null);\n if (attrs) {\n // it's important to only prepare styling-related datastructures once for a given\n // tNode and not each time an element is created. Also, the styling code is designed\n // to be patched and constructed at various points, but only up until the first element\n // is created. Then the styling context is locked and can only be instantiated for each\n // successive element that is created.\n if (tView.firstTemplatePass && !tNode.stylingTemplate && hasStyling(attrs)) {\n tNode.stylingTemplate = initializeStaticContext(attrs);\n }\n setUpAttributes(native, attrs);\n }\n appendChild(native, tNode, lView);\n createDirectivesAndLocals(tView, lView, localRefs);\n // any immediate children of a component or template container must be pre-emptively\n // monkey-patched with the component view data so that the element can be inspected\n // later on using any element discovery utility methods (see `element_discovery.ts`)\n if (getElementDepthCount() === 0) {\n attachPatchData(native, lView);\n }\n increaseElementDepthCount();\n // if a directive contains a host binding for \"class\" then all class-based data will\n // flow through that (except for `[class.prop]` bindings). This also includes initial\n // static class values as well. (Note that this will be fixed once map-based `[style]`\n // and `[class]` bindings work for multiple directives.)\n if (tView.firstTemplatePass) {\n var inputData = initializeTNodeInputs(tNode);\n if (inputData && inputData.hasOwnProperty('class')) {\n tNode.flags |= 8 /* hasClassInput */;\n }\n }\n // There is no point in rendering styles when a class directive is present since\n // it will take that over for us (this will be removed once #FW-882 is in).\n if (tNode.stylingTemplate && (tNode.flags & 8 /* hasClassInput */) === 0) {\n renderInitialStylesAndClasses(native, tNode.stylingTemplate, lView[RENDERER]);\n }\n}", "title": "" }, { "docid": "4c7210950c57e4d0bc9783d6f5079997", "score": "0.4667821", "text": "function elementStart(index, name, attrs, localRefs) {\n var lView = getLView();\n var tView = lView[TVIEW];\n ngDevMode && assertEqual(lView[BINDING_INDEX], tView.bindingStartIndex, 'elements should be created before any bindings ');\n ngDevMode && ngDevMode.rendererCreateElement++;\n var native = elementCreate(name);\n ngDevMode && assertDataInRange(lView, index - 1);\n var tNode = createNodeAtIndex(index, 3 /* Element */, native, name, attrs || null);\n if (attrs) {\n // it's important to only prepare styling-related datastructures once for a given\n // tNode and not each time an element is created. Also, the styling code is designed\n // to be patched and constructed at various points, but only up until the first element\n // is created. Then the styling context is locked and can only be instantiated for each\n // successive element that is created.\n if (tView.firstTemplatePass && !tNode.stylingTemplate && hasStyling(attrs)) {\n tNode.stylingTemplate = initializeStaticContext(attrs);\n }\n setUpAttributes(native, attrs);\n }\n appendChild(native, tNode, lView);\n createDirectivesAndLocals(tView, lView, localRefs);\n // any immediate children of a component or template container must be pre-emptively\n // monkey-patched with the component view data so that the element can be inspected\n // later on using any element discovery utility methods (see `element_discovery.ts`)\n if (getElementDepthCount() === 0) {\n attachPatchData(native, lView);\n }\n increaseElementDepthCount();\n // if a directive contains a host binding for \"class\" then all class-based data will\n // flow through that (except for `[class.prop]` bindings). This also includes initial\n // static class values as well. (Note that this will be fixed once map-based `[style]`\n // and `[class]` bindings work for multiple directives.)\n if (tView.firstTemplatePass) {\n var inputData = initializeTNodeInputs(tNode);\n if (inputData && inputData.hasOwnProperty('class')) {\n tNode.flags |= 8 /* hasClassInput */;\n }\n }\n // There is no point in rendering styles when a class directive is present since\n // it will take that over for us (this will be removed once #FW-882 is in).\n if (tNode.stylingTemplate && (tNode.flags & 8 /* hasClassInput */) === 0) {\n renderInitialStylesAndClasses(native, tNode.stylingTemplate, lView[RENDERER]);\n }\n}", "title": "" }, { "docid": "bed12dc4cf5f4db4114c53eb4530ba39", "score": "0.46652567", "text": "_prepareNewElements() {\n\t\tlet elems = {};\n\n\t\tlet pointStart = this.viewport.pointStart[this.name];\n\t\tlet pointEnd = this.viewport.pointEnd[this.name];\n\t\tlet step = this.viewport.step[this.name];\n\n\t\tlet childValue = null;\n\t\tlet childLine = null;\n\n\t\tif (this.name == 'x') {\n\t\t\tpointEnd = this._getRealEndX();\n\t\t}\n\t\t\n\t\tfor (let value = pointStart; value <= pointEnd; value+= step) {\n\t\t\tchildValue = document.createElement(\"div\");\n\t\t\tchildValue.className = 'value';\n\t\t\tchildValue.dataset.value = value;\n\t\t\tchildValue.textContent = this.formatValue(value);\n\n\t\t\tif (this.name == 'y') {\n\t\t\t\tchildLine = document.createElement(\"div\");\n\t\t\t\tchildLine.className = 'line';\n\t\t\t\tchildValue.style.top = this.viewport.pointToPlotY(value) + 'px';\n\t\t\t\tchildLine.style.top = this.viewport.pointToPlotY(value) + 'px';\n\t\t\t}\n\n\t\t\telems[value]= {\n\t\t\t\telemValue: childValue,\n\t\t\t\telemLine: childLine\n\t\t\t};\n\t\t}\n\n\t\treturn elems;\n\t}", "title": "" }, { "docid": "dd28ad85f584844cea13bf0e54d54441", "score": "0.4664871", "text": "function beforeEach_all_files() {\n //page.get('breadcrumb').should('not.exist')\n page.get('sync_button').should('not.exist')\n page.get('heading').invoke('text').then((text) => {\n expect(text.trim()).equal('All Files')\n })\n page.get('upload_new_file_button').should('exist')\n page.get('upload_new_file_filter').should('exist')\n page.get('files').should('exist')\n page.get('no_results').should('not.be.visible')\n\n }", "title": "" }, { "docid": "1bce68197ae2aa9f87febf52bd3e5717", "score": "0.46631795", "text": "function createComponent() {\n for (let i = 0; i < componentElementsList.length; i += 1) {\n let\n _element, _context,\n element = componentElementsList[i].element,\n context = componentElementsList[i].context,\n attributes = componentElementsList[i].attributes,\n content = componentElementsList[i].content;\n\n _element = createElement(element);\n _context = setContext(context);\n\n if (attributes) {\n setAttributes(_element, attributes);\n }\n\n\n setContent(_element, content);\n\n try {\n appendChild(_element, _context);\n } catch (error) {\n console.log(error);\n }\n\n }\n }", "title": "" }, { "docid": "12bf21efbe2bc6c888f924b462aadee6", "score": "0.46628785", "text": "_construct(element) {\n this._currentElement = element;\n }", "title": "" }, { "docid": "c9732f6a0cc3f204d2b0a8c13829dba4", "score": "0.4656786", "text": "enterEmptyElement(ctx) {\n\t}", "title": "" }, { "docid": "39d173cf543ac6cda7183550e7680bd9", "score": "0.46504322", "text": "function setUpUIElements () {\n var minBrowserDim = Math.min(window.innerWidth, window.innerHeight);\n canvas.width = minBrowserDim;\n canvas.height = minBrowserDim;\n\n gameContainer = new GameElement(0, 0, canvas.width, canvas.height, \"grass\");\n\n var startX = randomBetween(3, CONSTANTS.GRID_WIDTH - 3);\n var startY = randomBetween(3, CONSTANTS.GRID_HEIGHT - 3);\n\n var tileWidth = 1 / CONSTANTS.GRID_WIDTH;\n var tileHeight = 1 / CONSTANTS.GRID_HEIGHT;\n\n grid = [];\n for(var x = 0; x < CONSTANTS.GRID_WIDTH; x++) {\n grid[x] = [];\n for(var y = 0; y < CONSTANTS.GRID_HEIGHT; y++) {\n if(startX == x && startY == y) {\n // Spawn house\n var element = new GameElement(x * tileWidth, y * tileHeight, tileWidth, tileHeight, ELEMENT.HOUSE);\n grid[x][y] = element;\n }\n else if((startX == x - 1 || startX == x || startX == x + 1) &&\n (startY == y - 1 || startY == y || startY == y + 1)) {\n // No spawn\n } else {\n var type = ELEMENT.TREE;\n var roll = Math.random();\n if(roll < 0.2) {\n type = ELEMENT.STONE;\n }\n var element = new GameElement(x * tileWidth, y * tileHeight, tileWidth, tileHeight, type);\n element.health = 12;\n grid[x][y] = element;\n }\n }\n }\n\n for(var index in RESOURCES) {\n resources[RESOURCES[index]] = 0;\n }\n}", "title": "" }, { "docid": "2611331b2d9881b48165a85ad6713f7d", "score": "0.46475753", "text": "function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {\n var lView = getLView();\n var tView = getTView();\n var adjustedIndex = HEADER_OFFSET + index;\n ngDevMode && assertEqual(getBindingIndex(), tView.bindingStartIndex, 'elements should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateElement++;\n ngDevMode && assertDataInRange(lView, adjustedIndex);\n var renderer = lView[RENDERER];\n var native = lView[adjustedIndex] = elementCreate(name, renderer, getNamespace());\n var tNode = tView.firstCreatePass ?\n elementStartFirstCreatePass(index, tView, lView, native, name, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex];\n setPreviousOrParentTNode(tNode, true);\n var mergedAttrs = tNode.mergedAttrs;\n if (mergedAttrs !== null) {\n setUpAttributes(renderer, native, mergedAttrs);\n }\n var classes = tNode.classes;\n if (classes !== null) {\n writeDirectClass(renderer, native, classes);\n }\n var styles = tNode.styles;\n if (styles !== null) {\n writeDirectStyle(renderer, native, styles);\n }\n appendChild(tView, lView, native, tNode);\n // any immediate children of a component or template container must be pre-emptively\n // monkey-patched with the component view data so that the element can be inspected\n // later on using any element discovery utility methods (see `element_discovery.ts`)\n if (getElementDepthCount() === 0) {\n attachPatchData(native, lView);\n }\n increaseElementDepthCount();\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n executeContentQueries(tView, tNode, lView);\n }\n if (localRefsIndex !== null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n}", "title": "" }, { "docid": "484a1989017352d9acfb578f8aa036fa", "score": "0.4645726", "text": "_ensureElement() {\n if (!this._el) {\n const attrs = extend({}, result(this, \"attributes\"));\n if (this.id) {\n attrs.id = this.id;\n }\n if (this._style) {\n attrs[\"class\"] = this._style;\n }\n const el = this._createElement(this.tagName);\n const body = document.querySelector(\"body\");\n if (body) {\n //console.debug(\"creating element \" + this.tagName + \" on body.\")\n body.appendChild(el);\n }\n if (el) {\n this.setElement(el);\n }\n this._setAttributes(attrs);\n } else {\n this.setElement(this._el);\n }\n }", "title": "" }, { "docid": "818697bec7bacb5759b2d03e97e4c3f3", "score": "0.46282074", "text": "function elementCreated(element) {\n // if \"created\" hasn't been suspended: run created code\n if (!element.hasAttribute('suspend-created')) {\n \n }\n }", "title": "" }, { "docid": "48d5a46ea2fef3c045b8061e75614aed", "score": "0.46205264", "text": "newElement(node = false){\n let title = bbn._('New File');\n if ( this.isProject && bbn.fn.isObject(node) &&\n ((node.data.type !== false) || (this.typeProject !== false))\n ){\n if ( ((node !== false) && (node.data.type === 'components')) || (this.typeProject === 'components') ){\n title = bbn._('New Component') + ` <i class='nf nf-fa-vuejs'></i>`;\n }\n else if ( ((node !== false) && (node.data.type === 'lib')) || (this.typeProject === 'lib') ){\n title = bbn._('New Class');\n }\n }\n //bbn.fn.log(\"NODE\", node);\n this.openNew(title, true, node);\n }", "title": "" }, { "docid": "d9a79021321e5c39dd26b76436d61cc6", "score": "0.46192792", "text": "function elementStart(index, name, attrs, localRefs) {\n ngDevMode &&\n assertEqual(viewData[BINDING_INDEX], -1, 'elements should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateElement++;\n var native = elementCreate(name);\n ngDevMode && assertDataInRange(index - 1);\n var node = createLNode(index, 3 /* Element */, native, name, attrs || null, null);\n currentElementNode = node;\n if (attrs) {\n setUpAttributes(native, attrs);\n }\n appendChild(getParentLNode(node), native, viewData);\n createDirectivesAndLocals(localRefs);\n return native;\n }", "title": "" }, { "docid": "9ff1c4f6dd9e8ecb906becb42bb213f3", "score": "0.46104965", "text": "function initialCheck(elements) {\n if (isRemoved(elements)) {\n throw new Error('The element(s) given to waitForElementToBeRemoved are already removed. waitForElementToBeRemoved requires that the element(s) exist(s) before waiting for removal.');\n }\n}", "title": "" }, { "docid": "ecc529fc790685e4afd459a043f5e21f", "score": "0.4608387", "text": "function createItem(ele) {\n\tlet name = ele.parentNode.parentNode.querySelector(\".add-item-input\");\n\tif (name.value != \"\") {\n\t\tele.parentNode.parentNode.classList.toggle(\"invisible\");\n\t\tele.parentNode.parentNode.parentNode\n\t\t\t.querySelector(\".new-item\")\n\t\t\t.classList.toggle(\"invisible\");\n\n\t\tlet item = document.createElement(\"div\");\n\t\titem.innerHTML = NODE_ITEM.trim();\n\t\titem.querySelector(\".item-text\").innerHTML = name.value;\n\t\tname.value = \"\";\n\t\tele.parentNode.parentNode.parentNode.querySelector(\n\t\t\t\".item-list\"\n\t\t).innerHTML += item.innerHTML;\n\t\tupdateLines(ele.parentNode.parentNode.parentNode);\n\t}\n}", "title": "" }, { "docid": "6b9992c752006eb8ccc360c76c0da144", "score": "0.460192", "text": "function testBreadcrumbMoreThanFourElementPathsElide() {\n const element = getBreadCrumb();\n\n // Set path.\n element.path = 'A/B/C/D/E/F';\n\n // Elider button drop-down menu should be in the 'closed' state.\n const elider = getBreadCrumbEliderButton();\n assertEquals('false', elider.getAttribute('aria-expanded'));\n\n // clang-format off\n const expect = element.path +\n ' 1: display:block id=first text=[A]' +\n ' 2: display:flex elider[aria-expanded=false,aria-haspopup,aria-label]' +\n ' dropdown-item: display:block text=[B]' +\n ' dropdown-item: display:block text=[C]' +\n ' dropdown-item: display:block text=[D]' +\n ' 3: display:none id=second hidden' +\n ' 4: display:block id=third text=[E]' +\n ' 5: display:block id=fourth text=[F]';\n // clang-format on\n\n const path = element.parts.join('/');\n assertEquals(expect, path + ' ' + getBreadCrumbButtonState());\n}", "title": "" }, { "docid": "18443d08d4b5265966ff5a5dbbff035d", "score": "0.4600675", "text": "function createClicker(id, relativeID, xpath){\n\tlet currentClickerIDlist = []\n\tlet newClicker = { \n\t \"elemID\": id,\n\t \"name\": id? id:relativeID,\n\t \"relativeID\": relativeID,\n\t \"xpath\": xpath,\n\t \"interval\": 1,\n\t \"intervalStep\": \"s\",\n\t \"active\": false,\n\t \"mouseDown\": false,\n\t \"click\": true,\n\t \"mouseUp\": false,\n\t \"boost\": 1,\n\t}\n\n\tbrowser.storage.local.get(window.location.hostname, response => {\n\t if (response[window.location.hostname]){\n\t\tlet responseValue = JSON.parse(response[window.location.hostname])\n\t\t\n\t\t\n\t\t// If there is already an elemen with the same ID or xpath don't generate\n\t\t// a new item\n\t\tfor(let [itemNr, item] of Object.entries(responseValue)){\n\t\t\tcurrentClickerIDlist.push(itemNr)\n\t\t \tif ((item[\"elemID\"] == newClicker[\"elemID\"] && newClicker[\"elemID\"] != \"\") \n\t\t\t || ((item[\"xpath\"] == newClicker[\"xpath\"] && newClicker['xpath'] != \"\") &&\n\t\t\t item[\"relativeID\"] == newClicker[\"relativeID\"] && newClicker[\"relativeID\"] != \"\")){\n\t\t\treturn\n\t\t \t}\n\t\t}\n\n\t\t// Generate a unique ID for the clickerID\n\t\t// Used for deleting, restarting the clicker without reseting everyhting\n\t\tlet clickerID = generateNewClickerID(currentClickerIDlist, 5)\n\t // If there are no duplicates add the new item to the list\n\t responseValue[clickerID] = newClicker\n\t browser.storage.local.set({[window.location.hostname]: JSON.stringify(responseValue)})\n\t \n\t } else {\n\t\tlet clickerID = generateNewClickerID(currentClickerIDlist, 5) \n\t\tbrowser.storage.local.set({[window.location.hostname]: JSON.stringify({[clickerID]: newClicker})})\n\t } \n\t})\n}", "title": "" }, { "docid": "aec716636274dadc8ca1cc24971158d9", "score": "0.45935088", "text": "get path() {\n return [this.element];\n }", "title": "" }, { "docid": "c2640e9c2a9515c15f702274c6649595", "score": "0.4578154", "text": "createDirectory(_path) {\n // pretend everything was ok\n }", "title": "" }, { "docid": "0cd3f8104ba119b77de19f142d404af4", "score": "0.4574562", "text": "function elementStart(index, name, attrs, localRefs) {\n ngDevMode &&\n assertEqual(viewData[BINDING_INDEX], -1, 'elements should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateElement++;\n var native = elementCreate(name);\n ngDevMode && assertDataInRange(index - 1);\n var node = createLNode(index, 3 /* Element */, native, name, attrs || null, null);\n currentElementNode = node;\n if (attrs) {\n setUpAttributes(native, attrs);\n }\n appendChild(getParentLNode(node), native, viewData);\n createDirectivesAndLocals(localRefs);\n return native;\n}", "title": "" }, { "docid": "0cd3f8104ba119b77de19f142d404af4", "score": "0.4574562", "text": "function elementStart(index, name, attrs, localRefs) {\n ngDevMode &&\n assertEqual(viewData[BINDING_INDEX], -1, 'elements should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateElement++;\n var native = elementCreate(name);\n ngDevMode && assertDataInRange(index - 1);\n var node = createLNode(index, 3 /* Element */, native, name, attrs || null, null);\n currentElementNode = node;\n if (attrs) {\n setUpAttributes(native, attrs);\n }\n appendChild(getParentLNode(node), native, viewData);\n createDirectivesAndLocals(localRefs);\n return native;\n}", "title": "" }, { "docid": "0cd3f8104ba119b77de19f142d404af4", "score": "0.4574562", "text": "function elementStart(index, name, attrs, localRefs) {\n ngDevMode &&\n assertEqual(viewData[BINDING_INDEX], -1, 'elements should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateElement++;\n var native = elementCreate(name);\n ngDevMode && assertDataInRange(index - 1);\n var node = createLNode(index, 3 /* Element */, native, name, attrs || null, null);\n currentElementNode = node;\n if (attrs) {\n setUpAttributes(native, attrs);\n }\n appendChild(getParentLNode(node), native, viewData);\n createDirectivesAndLocals(localRefs);\n return native;\n}", "title": "" }, { "docid": "7e08d482715a274647cec275d92f1b74", "score": "0.4567706", "text": "function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = HEADER_OFFSET + index;\n ngDevMode &&\n assertEqual(getBindingIndex(), tView.bindingStartIndex, 'elements should be created before any bindings');\n ngDevMode && assertIndexInRange(lView, adjustedIndex);\n const renderer = lView[RENDERER];\n const native = lView[adjustedIndex] = createElementNode(renderer, name, getNamespace());\n const tNode = tView.firstCreatePass ?\n elementStartFirstCreatePass(adjustedIndex, tView, lView, native, name, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex];\n setCurrentTNode(tNode, true);\n const mergedAttrs = tNode.mergedAttrs;\n if (mergedAttrs !== null) {\n setUpAttributes(renderer, native, mergedAttrs);\n }\n const classes = tNode.classes;\n if (classes !== null) {\n writeDirectClass(renderer, native, classes);\n }\n const styles = tNode.styles;\n if (styles !== null) {\n writeDirectStyle(renderer, native, styles);\n }\n if ((tNode.flags & 64 /* isDetached */) !== 64 /* isDetached */) {\n // In the i18n case, the translation may have removed this element, so only add it if it is not\n // detached. See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.\n appendChild(tView, lView, native, tNode);\n }\n // any immediate children of a component or template container must be pre-emptively\n // monkey-patched with the component view data so that the element can be inspected\n // later on using any element discovery utility methods (see `element_discovery.ts`)\n if (getElementDepthCount() === 0) {\n attachPatchData(native, lView);\n }\n increaseElementDepthCount();\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n executeContentQueries(tView, tNode, lView);\n }\n if (localRefsIndex !== null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n}", "title": "" }, { "docid": "7e08d482715a274647cec275d92f1b74", "score": "0.4567706", "text": "function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = HEADER_OFFSET + index;\n ngDevMode &&\n assertEqual(getBindingIndex(), tView.bindingStartIndex, 'elements should be created before any bindings');\n ngDevMode && assertIndexInRange(lView, adjustedIndex);\n const renderer = lView[RENDERER];\n const native = lView[adjustedIndex] = createElementNode(renderer, name, getNamespace());\n const tNode = tView.firstCreatePass ?\n elementStartFirstCreatePass(adjustedIndex, tView, lView, native, name, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex];\n setCurrentTNode(tNode, true);\n const mergedAttrs = tNode.mergedAttrs;\n if (mergedAttrs !== null) {\n setUpAttributes(renderer, native, mergedAttrs);\n }\n const classes = tNode.classes;\n if (classes !== null) {\n writeDirectClass(renderer, native, classes);\n }\n const styles = tNode.styles;\n if (styles !== null) {\n writeDirectStyle(renderer, native, styles);\n }\n if ((tNode.flags & 64 /* isDetached */) !== 64 /* isDetached */) {\n // In the i18n case, the translation may have removed this element, so only add it if it is not\n // detached. See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.\n appendChild(tView, lView, native, tNode);\n }\n // any immediate children of a component or template container must be pre-emptively\n // monkey-patched with the component view data so that the element can be inspected\n // later on using any element discovery utility methods (see `element_discovery.ts`)\n if (getElementDepthCount() === 0) {\n attachPatchData(native, lView);\n }\n increaseElementDepthCount();\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n executeContentQueries(tView, tNode, lView);\n }\n if (localRefsIndex !== null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n}", "title": "" }, { "docid": "3c44fbf3c24e63a1a0791318d78fac19", "score": "0.45675248", "text": "function _ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {\n var lView = getLView();\n var tView = getTView();\n var adjustedIndex = HEADER_OFFSET + index;\n ngDevMode && assertEqual(getBindingIndex(), tView.bindingStartIndex, 'elements should be created before any bindings');\n ngDevMode && assertIndexInRange(lView, adjustedIndex);\n var renderer = lView[RENDERER];\n\n var _native12 = lView[adjustedIndex] = createElementNode(renderer, name, getNamespace());\n\n var tNode = tView.firstCreatePass ? elementStartFirstCreatePass(adjustedIndex, tView, lView, _native12, name, attrsIndex, localRefsIndex) : tView.data[adjustedIndex];\n setCurrentTNode(tNode, true);\n var mergedAttrs = tNode.mergedAttrs;\n\n if (mergedAttrs !== null) {\n setUpAttributes(renderer, _native12, mergedAttrs);\n }\n\n var classes = tNode.classes;\n\n if (classes !== null) {\n writeDirectClass(renderer, _native12, classes);\n }\n\n var styles = tNode.styles;\n\n if (styles !== null) {\n writeDirectStyle(renderer, _native12, styles);\n }\n\n if ((tNode.flags & 64\n /* isDetached */\n ) !== 64\n /* isDetached */\n ) {\n // In the i18n case, the translation may have removed this element, so only add it if it is not\n // detached. See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.\n appendChild(tView, lView, _native12, tNode);\n } // any immediate children of a component or template container must be pre-emptively\n // monkey-patched with the component view data so that the element can be inspected\n // later on using any element discovery utility methods (see `element_discovery.ts`)\n\n\n if (getElementDepthCount() === 0) {\n attachPatchData(_native12, lView);\n }\n\n increaseElementDepthCount();\n\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n executeContentQueries(tView, tNode, lView);\n }\n\n if (localRefsIndex !== null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n }", "title": "" }, { "docid": "0b7ff555109fd97af71bbcf3098daea4", "score": "0.4566931", "text": "function onClickAdd() {\n createNewElement();\n}", "title": "" }, { "docid": "8f72c660cf379c64d596393e24f04691", "score": "0.45456678", "text": "didInsertElement() {\n this._super(...arguments);\n\n this.createElements();\n }", "title": "" }, { "docid": "2329d55bb2065288a3a02e78d696d44e", "score": "0.45300737", "text": "CreateElement(template) {\n let element = new UIElement(template, this.screen);\n }", "title": "" }, { "docid": "951c10cbeec7f001448ed4b3155871f5", "score": "0.4528243", "text": "constructor() {\n this._elements = [];\n }", "title": "" }, { "docid": "3f9eaad18f835ed326f9e65f023b1151", "score": "0.45273143", "text": "function generateTodoElement(todo) {\n \n}", "title": "" }, { "docid": "a29ea5a3097b19024b67efc1e08c10dd", "score": "0.4521864", "text": "element(name, attributes, text) {\n var child, i, len, oldValidationFlag, ref, root;\n if (this.currentNode && this.currentNode.type === NodeType.DocType) {\n this.dtdElement(...arguments);\n } else {\n if (Array.isArray(name) || isObject(name) || isFunction(name)) {\n oldValidationFlag = this.options.noValidation;\n this.options.noValidation = true;\n root = new XMLDocument(this.options).element('TEMP_ROOT');\n root.element(name);\n this.options.noValidation = oldValidationFlag;\n ref = root.children;\n for (i = 0, len = ref.length; i < len; i++) {\n child = ref[i];\n this.createChildNode(child);\n if (child.type === NodeType.Element) {\n this.up();\n }\n }\n } else {\n this.node(name, attributes, text);\n }\n }\n return this;\n }", "title": "" }, { "docid": "837e811764a858d2c93195a8524e800a", "score": "0.4517784", "text": "function makeTable(length, size) {\n let elems = [];\n for(let i = 0; i<length;i++){\n //each property should be procedural eventually\n elems[i] = new Element((i+1)+\"idium\", i+1, i*2, shaper(size, (i+1)), charger(size, (i+1)),addProperties(size,length), size);\n console.log(\"New Element: \" + elems[i].name);\n }\n return elems;\n \n}", "title": "" }, { "docid": "1914106b26fd19f6c936b1aebb45784d", "score": "0.45150414", "text": "function testGetElement() {\n\t\tjsUnity.assertions.assertNotNull(U.$('output'));\n\t}", "title": "" }, { "docid": "648244fabbe09f82bfb8d386d1c72633", "score": "0.45111102", "text": "function FakeAttrGen(){\n var d = cy.$(\"node[type = 'complexAttribute']\");\n for (let i = 0; i < d.length; i++) {\n var ix = d[i].position('x');\n var iy = d[i].position('y');\n var iddi = d[i].data('id');\n cy.add([\n {\n group:'nodes',\n data: { id: iddi+'fake', type: 'fakeAttribute'},\n position:{ x: ix , y: iy}\n }\n ]);\n }\n}", "title": "" }, { "docid": "553f84e4aacb486d1d1ef23a0b1cb7ef", "score": "0.4507783", "text": "function init() {\n forEach(initEls, function (el) {\n create(el);\n });\n }", "title": "" }, { "docid": "553f84e4aacb486d1d1ef23a0b1cb7ef", "score": "0.4507783", "text": "function init() {\n forEach(initEls, function (el) {\n create(el);\n });\n }", "title": "" }, { "docid": "553f84e4aacb486d1d1ef23a0b1cb7ef", "score": "0.4507783", "text": "function init() {\n forEach(initEls, function (el) {\n create(el);\n });\n }", "title": "" }, { "docid": "33191c02305061c4acfd09db27b4ee47", "score": "0.44968876", "text": "function newElement() {\n\tvar li = document.createElement(\"li\");\n\tli.setAttribute(\"class\", \"collection-item\");\n\tli.setAttribute(\"style\", \"background-color: transparent; border:none\");\n\n\tvar inputValue = document.getElementById(\"str\").value;\n\tvar t = document.createTextNode(\" - \" + inputValue);\n\tli.appendChild(t);\n\tif (inputValue === \"\") {\n\t\talert(\"Steps to Reproduce cannot be empty!\");\n\t} else {\n\t\tdocument.getElementById(\"myUL\").appendChild(li);\n\t}\n\tdocument.getElementById(\"str\").value = \"\";\n\n\tvar span = document.createElement(\"SPAN\");\n\tvar txt = document.createTextNode(\" \\u00D7\");\n\tspan.className = \"close\";\n\tspan.appendChild(txt);\n\tli.appendChild(span);\n\n\tfor (i = 0; i < close.length; i++) {\n\t\tclose[i].onclick = function () {\n\t\t\tvar div = this.parentElement;\n\t\t\tdiv.remove();\n\t\t};\n\t}\n}", "title": "" }, { "docid": "cc11699a2bde5ba1b654f9fdd35c5184", "score": "0.4472737", "text": "make(e, stage){\n this.element = e;\n }", "title": "" }, { "docid": "0ae4713b8985cce4bed68289650c5731", "score": "0.44686544", "text": "function generateTests() {\n\n test('renders an empty mobiledoc', function (assert) {\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [],\n cards: [],\n markups: [],\n sections: []\n };\n\n var _renderer$render = renderer.render(mobiledoc);\n\n var rendered = _renderer$render.result;\n\n assert.ok(!!rendered, 'renders result');\n assert.equal((0, _helpersDom.childNodesLength)(rendered), 0, 'has no sections');\n });\n\n test('renders a mobiledoc without markups', function (assert) {\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [],\n cards: [],\n markups: [],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.MARKUP_SECTION_TYPE, 'P', [[_mobiledocDomRendererUtilsMarkerTypes.MARKUP_MARKER_TYPE, [], 0, 'hello world']]]]\n };\n var renderResult = renderer.render(mobiledoc);\n var rendered = renderResult.result;\n\n assert.equal((0, _helpersDom.childNodesLength)(rendered), 1, 'renders 1 section');\n assert.equal(rendered.firstChild.tagName, 'P', 'renders a P');\n assert.equal(rendered.firstChild.firstChild.nodeValue, 'hello world', 'renders the text');\n });\n\n test('renders a mobiledoc with simple (no attributes) markup', function (assert) {\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [],\n cards: [],\n markups: [['B']],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.MARKUP_SECTION_TYPE, 'P', [[_mobiledocDomRendererUtilsMarkerTypes.MARKUP_MARKER_TYPE, [0], 1, 'hello world']]]]\n };\n\n var _renderer$render2 = renderer.render(mobiledoc);\n\n var rendered = _renderer$render2.result;\n\n assert.equal((0, _helpersDom.childNodesLength)(rendered), 1, 'renders 1 section');\n var sectionEl = rendered.firstChild;\n\n assert.equal((0, _helpersDom.innerHTML)(sectionEl), '<b>hello world</b>');\n });\n\n test('renders a mobiledoc with complex (has attributes) markup', function (assert) {\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [],\n cards: [],\n markups: [['A', ['href', 'http://google.com']]],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.MARKUP_SECTION_TYPE, 'P', [[_mobiledocDomRendererUtilsMarkerTypes.MARKUP_MARKER_TYPE, [0], 1, 'hello world']]]]\n };\n\n var _renderer$render3 = renderer.render(mobiledoc);\n\n var rendered = _renderer$render3.result;\n\n assert.equal((0, _helpersDom.childNodesLength)(rendered), 1, 'renders 1 section');\n var sectionEl = rendered.firstChild;\n\n assert.equal((0, _helpersDom.innerHTML)(sectionEl), '<a href=\"http://google.com\">hello world</a>');\n });\n\n test('renders a mobiledoc with multiple markups in a section', function (assert) {\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [],\n cards: [],\n markups: [['B'], ['I']],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.MARKUP_SECTION_TYPE, 'P', [[_mobiledocDomRendererUtilsMarkerTypes.MARKUP_MARKER_TYPE, [0], 0, 'hello '], // b\n [_mobiledocDomRendererUtilsMarkerTypes.MARKUP_MARKER_TYPE, [1], 0, 'brave '], // b+i\n [_mobiledocDomRendererUtilsMarkerTypes.MARKUP_MARKER_TYPE, [], 1, 'new '], // close i\n [_mobiledocDomRendererUtilsMarkerTypes.MARKUP_MARKER_TYPE, [], 1, 'world'] // close b\n ]]]\n };\n\n var _renderer$render4 = renderer.render(mobiledoc);\n\n var rendered = _renderer$render4.result;\n\n assert.equal((0, _helpersDom.childNodesLength)(rendered), 1, 'renders 1 section');\n var sectionEl = rendered.firstChild;\n\n assert.equal((0, _helpersDom.innerHTML)(sectionEl), '<b>hello <i>brave new </i>world</b>');\n });\n\n test('renders a mobiledoc with image section', function (assert) {\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [],\n cards: [],\n markups: [],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.IMAGE_SECTION_TYPE, dataUri]]\n };\n\n var _renderer$render5 = renderer.render(mobiledoc);\n\n var rendered = _renderer$render5.result;\n\n assert.equal((0, _helpersDom.childNodesLength)(rendered), 1, 'renders 1 section');\n var sectionEl = rendered.firstChild;\n\n assert.equal(sectionEl.src, dataUri);\n });\n\n test('renders a mobiledoc with built-in image card', function (assert) {\n assert.expect(3);\n var cardName = _mobiledocDomRendererCardsImage['default'].name;\n var payload = { src: dataUri };\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [],\n cards: [[cardName, payload]],\n markups: [],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.CARD_SECTION_TYPE, 0]]\n };\n\n var _renderer$render6 = renderer.render(mobiledoc);\n\n var rendered = _renderer$render6.result;\n\n assert.equal((0, _helpersDom.childNodesLength)(rendered), 1, 'renders 1 section');\n var sectionEl = rendered.firstChild;\n\n assert.equal(sectionEl.firstChild.tagName, 'IMG');\n assert.equal(sectionEl.firstChild.src, dataUri);\n });\n\n test('render mobiledoc with list section and list items', function (assert) {\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [],\n cards: [],\n markups: [],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.LIST_SECTION_TYPE, 'ul', [[[_mobiledocDomRendererUtilsMarkerTypes.MARKUP_MARKER_TYPE, [], 0, 'first item']], [[_mobiledocDomRendererUtilsMarkerTypes.MARKUP_MARKER_TYPE, [], 0, 'second item']]]]]\n };\n\n var _renderer$render7 = renderer.render(mobiledoc, document.createElement('div'));\n\n var rendered = _renderer$render7.result;\n\n assert.equal((0, _helpersDom.childNodesLength)(rendered), 1, 'renders 1 section');\n\n var section = rendered.firstChild;\n assert.equal(section.tagName, 'UL');\n\n assert.equal((0, _helpersDom.childNodesLength)(section), 2, '2 list items');\n\n var items = section.childNodes;\n assert.equal(items.item(0).tagName, 'LI', 'correct tagName for item 1');\n assert.equal(items.item(0).firstChild.nodeValue, 'first item', 'correct text node for item 1');\n\n assert.equal(items.item(1).tagName, 'LI', 'correct tagName for item 2');\n assert.equal(items.item(1).firstChild.nodeValue, 'second item', 'correct text node for item 2');\n });\n\n test('renders a mobiledoc with card section', function (assert) {\n assert.expect(7);\n var cardName = 'title-card';\n var expectedPayload = { name: 'bob' };\n var expectedOptions = { foo: 'bar' };\n var TitleCard = {\n name: cardName,\n type: 'dom',\n render: function render(_ref) {\n var env = _ref.env;\n var payload = _ref.payload;\n var options = _ref.options;\n\n assert.deepEqual(payload, expectedPayload, 'correct payload');\n assert.deepEqual(options, expectedOptions, 'correct options');\n assert.equal(env.name, cardName, 'correct name');\n assert.ok(!env.isInEditor, 'isInEditor correct');\n assert.ok(!!env.onTeardown, 'has onTeardown hook');\n\n return document.createTextNode(payload.name);\n }\n };\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [],\n cards: [[cardName, expectedPayload]],\n markups: [],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.CARD_SECTION_TYPE, 0]]\n };\n\n renderer = new _mobiledocDomRenderer['default']({ cards: [TitleCard], cardOptions: expectedOptions });\n\n var _renderer$render8 = renderer.render(mobiledoc);\n\n var rendered = _renderer$render8.result;\n\n assert.equal((0, _helpersDom.childNodesLength)(rendered), 1, 'renders 1 section');\n var sectionEl = rendered.firstChild;\n\n assert.equal((0, _helpersDom.innerHTML)(sectionEl), expectedPayload.name);\n });\n\n test('throws when given invalid card type', function (assert) {\n var cardName = 'bad';\n var card = {\n name: cardName,\n type: 'text',\n render: function render() {}\n };\n var cards = [card];\n assert.throws(function () {\n new _mobiledocDomRenderer['default']({ cards: cards });\n }, // jshint ignore: line\n new RegExp('Card \"' + cardName + '\" must be of type \"' + _mobiledocDomRenderer.RENDER_TYPE + '\"'));\n });\n\n test('throws when given card without `render`', function (assert) {\n var cardName = 'bad';\n var card = {\n name: cardName,\n type: _mobiledocDomRenderer.RENDER_TYPE,\n render: undefined\n };\n var cards = [card];\n assert.throws(function () {\n new _mobiledocDomRenderer['default']({ cards: cards });\n }, // jshint ignore: line\n new RegExp('Card \"' + cardName + '\" must define `render`'));\n });\n\n test('throws if card render returns invalid result', function (assert) {\n var card = {\n name: 'bad',\n type: 'dom',\n render: function render() {\n return 'string';\n }\n };\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [],\n cards: [[card.name]],\n markups: [],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.CARD_SECTION_TYPE, 0]]\n };\n\n renderer = new _mobiledocDomRenderer['default']({ cards: [card] });\n assert.throws(function () {\n return renderer.render(mobiledoc);\n }, /Card \"bad\" must render dom/);\n });\n\n test('card may render nothing', function (assert) {\n var card = {\n name: 'ok',\n type: 'dom',\n render: function render() {}\n };\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [],\n cards: [[card.name]],\n markups: [],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.CARD_SECTION_TYPE, 0]]\n };\n\n renderer = new _mobiledocDomRenderer['default']({ cards: [card] });\n renderer.render(mobiledoc);\n\n assert.ok(true, 'No error thrown');\n });\n\n test('rendering nested mobiledocs in cards', function (assert) {\n var renderer = undefined;\n var cards = [{\n name: 'nested-card',\n type: 'dom',\n render: function render(_ref2) {\n var payload = _ref2.payload;\n\n var _renderer$render9 = renderer.render(payload.mobiledoc);\n\n var rendered = _renderer$render9.result;\n\n return rendered;\n }\n }];\n\n var innerMobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [],\n cards: [],\n markups: [],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.MARKUP_SECTION_TYPE, 'P', [[_mobiledocDomRendererUtilsMarkerTypes.MARKUP_MARKER_TYPE, [], 0, 'hello world']]]]\n };\n\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [],\n cards: [['nested-card', { mobiledoc: innerMobiledoc }]],\n markups: [],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.CARD_SECTION_TYPE, 0]]\n };\n\n renderer = new _mobiledocDomRenderer['default']({ cards: cards });\n\n var _renderer$render10 = renderer.render(mobiledoc);\n\n var rendered = _renderer$render10.result;\n\n assert.equal((0, _helpersDom.childNodesLength)(rendered), 1, 'renders 1 section');\n var card = rendered.firstChild;\n assert.equal((0, _helpersDom.childNodesLength)(card), 1, 'card has 1 child');\n assert.equal(card.firstChild.tagName, 'P', 'card has P child');\n assert.equal(card.firstChild.innerText, 'hello world');\n });\n\n test('rendering unknown card without unknownCardHandler throws', function (assert) {\n var cardName = 'not-known';\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [],\n cards: [[cardName]],\n markups: [],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.CARD_SECTION_TYPE, 0]]\n };\n renderer = new _mobiledocDomRenderer['default']({ cards: [], unknownCardHandler: undefined });\n assert.throws(function () {\n return renderer.render(mobiledoc);\n }, new RegExp('Card \"' + cardName + '\" not found.*no unknownCardHandler'));\n });\n\n test('rendering unknown card uses unknownCardHandler', function (assert) {\n assert.expect(5);\n\n var cardName = 'my-card';\n var expectedOptions = {};\n var expectedPayload = {};\n\n var unknownCardHandler = function unknownCardHandler(_ref3) {\n var env = _ref3.env;\n var options = _ref3.options;\n var payload = _ref3.payload;\n\n assert.equal(env.name, cardName, 'name is correct');\n assert.ok(!env.isInEditor, 'not in editor');\n assert.ok(!!env.onTeardown, 'has onTeardown');\n\n assert.deepEqual(options, expectedOptions, 'correct options');\n assert.deepEqual(payload, expectedPayload, 'correct payload');\n };\n\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [],\n cards: [[cardName, expectedPayload]],\n markups: [],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.CARD_SECTION_TYPE, 0]]\n };\n renderer = new _mobiledocDomRenderer['default']({\n cards: [], cardOptions: expectedOptions, unknownCardHandler: unknownCardHandler\n });\n renderer.render(mobiledoc);\n });\n\n test('throws if given an object of cards', function (assert) {\n var cards = {};\n assert.throws(function () {\n new _mobiledocDomRenderer['default']({ cards: cards });\n }, // jshint ignore: line\n new RegExp('`cards` must be passed as an array'));\n });\n\n test('multiple spaces should preserve whitespace with nbsps', function (assert) {\n var space = ' ';\n var repeat = function repeat(str, count) {\n var result = '';\n while (count--) {\n result += str;\n }\n return result;\n };\n var text = [repeat(space, 4), 'some', repeat(space, 5), 'text', repeat(space, 6)].join('');\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [],\n cards: [],\n markups: [],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.MARKUP_SECTION_TYPE, 'P', [[_mobiledocDomRendererUtilsMarkerTypes.MARKUP_MARKER_TYPE, [], 0, text]]]]\n };\n\n var nbsp = ' ';\n var sn = space + nbsp;\n var expectedText = [repeat(sn, 2), 'some', repeat(sn, 2), space, 'text', repeat(sn, 3)].join('');\n\n var _renderer$render11 = renderer.render(mobiledoc);\n\n var rendered = _renderer$render11.result;\n\n var textNode = rendered.firstChild.firstChild;\n assert.equal(textNode.nodeValue, expectedText, 'renders the text');\n });\n\n test('throws when given unexpected mobiledoc version', function (assert) {\n var mobiledoc = {\n version: '0.1.0',\n atoms: [],\n cards: [],\n markups: [],\n sections: []\n };\n\n assert.throws(function () {\n return renderer.render(mobiledoc);\n }, /Unexpected Mobiledoc version.*0.1.0/);\n\n mobiledoc.version = '0.2.1';\n assert.throws(function () {\n return renderer.render(mobiledoc);\n }, /Unexpected Mobiledoc version.*0.2.1/);\n });\n\n test('XSS: unexpected markup and list section tag names are not renderered', function (assert) {\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [],\n cards: [],\n markups: [],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.MARKUP_SECTION_TYPE, 'script', [[_mobiledocDomRendererUtilsMarkerTypes.MARKUP_MARKER_TYPE, [], 0, 'alert(\"markup section XSS\")']]], [_mobiledocDomRendererUtilsSectionTypes.LIST_SECTION_TYPE, 'script', [[[_mobiledocDomRendererUtilsMarkerTypes.MARKUP_MARKER_TYPE, [], 0, 'alert(\"list section XSS\")']]]]]\n };\n\n var _renderer$render12 = renderer.render(mobiledoc);\n\n var result = _renderer$render12.result;\n\n var content = (0, _helpersDom.outerHTML)(result);\n assert.ok(content.indexOf('script') === -1, 'no script tag rendered');\n });\n\n test('XSS: unexpected markup types are not rendered', function (assert) {\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [],\n cards: [],\n markups: [['b'], // valid\n ['em'], // valid\n ['script'] // invalid\n ],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.MARKUP_SECTION_TYPE, 'p', [[_mobiledocDomRendererUtilsMarkerTypes.MARKUP_MARKER_TYPE, [0], 0, 'bold text'], [_mobiledocDomRendererUtilsMarkerTypes.MARKUP_MARKER_TYPE, [1, 2], 3, 'alert(\"markup XSS\")'], [_mobiledocDomRendererUtilsMarkerTypes.MARKUP_MARKER_TYPE, [], 0, 'plain text']]]]\n };\n\n var _renderer$render13 = renderer.render(mobiledoc);\n\n var result = _renderer$render13.result;\n\n var content = (0, _helpersDom.outerHTML)(result);\n assert.ok(content.indexOf('script') === -1, 'no script tag rendered');\n });\n\n test('renders a mobiledoc with atom', function (assert) {\n var atomName = 'hello-atom';\n var atom = {\n name: atomName,\n type: 'dom',\n render: function render(_ref4) {\n var value = _ref4.value;\n\n return document.createTextNode('Hello ' + value);\n }\n };\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [['hello-atom', 'Bob', { id: 42 }]],\n cards: [],\n markups: [],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.MARKUP_SECTION_TYPE, 'P', [[_mobiledocDomRendererUtilsMarkerTypes.ATOM_MARKER_TYPE, [], 0, 0]]]]\n };\n renderer = new _mobiledocDomRenderer['default']({ atoms: [atom] });\n\n var _renderer$render14 = renderer.render(mobiledoc);\n\n var rendered = _renderer$render14.result;\n\n var sectionEl = rendered.firstChild;\n assert.equal(sectionEl.textContent, 'Hello Bob');\n });\n\n test('throws when given atom with invalid type', function (assert) {\n var atom = {\n name: 'bad',\n type: 'other',\n render: function render() {}\n };\n assert.throws(function () {\n new _mobiledocDomRenderer['default']({ atoms: [atom] });\n }, // jshint ignore:line\n /Atom \"bad\" must be type \"dom\"/);\n });\n\n test('throws when given atom without `render`', function (assert) {\n var atom = {\n name: 'bad',\n type: 'dom',\n render: undefined\n };\n assert.throws(function () {\n new _mobiledocDomRenderer['default']({ atoms: [atom] });\n }, // jshint ignore:line\n /Atom \"bad\" must define.*render/);\n });\n\n test('throws if atom render returns invalid result', function (assert) {\n var atom = {\n name: 'bad',\n type: 'dom',\n render: function render() {\n return 'string';\n }\n };\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [['bad', 'Bob', { id: 42 }]],\n cards: [],\n markups: [],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.MARKUP_SECTION_TYPE, 'P', [[_mobiledocDomRendererUtilsMarkerTypes.ATOM_MARKER_TYPE, [], 0, 0]]]]\n };\n renderer = new _mobiledocDomRenderer['default']({ atoms: [atom] });\n assert.throws(function () {\n return renderer.render(mobiledoc);\n }, /Atom \"bad\" must render dom/);\n });\n\n test('atom may render nothing', function (assert) {\n var atom = {\n name: 'ok',\n type: 'dom',\n render: function render() {}\n };\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [['ok', 'Bob', { id: 42 }]],\n cards: [],\n markups: [],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.MARKUP_SECTION_TYPE, 'P', [[_mobiledocDomRendererUtilsMarkerTypes.ATOM_MARKER_TYPE, [], 0, 0]]]]\n };\n\n renderer = new _mobiledocDomRenderer['default']({ atoms: [atom] });\n renderer.render(mobiledoc);\n\n assert.ok(true, 'No error thrown');\n });\n\n test('throws when rendering unknown atom without unknownAtomHandler', function (assert) {\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [['missing-atom', 'Bob', { id: 42 }]],\n cards: [],\n markups: [],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.MARKUP_SECTION_TYPE, 'P', [[_mobiledocDomRendererUtilsMarkerTypes.ATOM_MARKER_TYPE, [], 0, 0]]]]\n };\n renderer = new _mobiledocDomRenderer['default']({ atoms: [], unknownAtomHandler: undefined });\n assert.throws(function () {\n return renderer.render(mobiledoc);\n }, /Atom \"missing-atom\" not found.*no unknownAtomHandler/);\n });\n\n test('rendering unknown atom uses unknownAtomHandler', function (assert) {\n assert.expect(4);\n\n var atomName = 'missing-atom';\n var expectedPayload = { id: 42 };\n var cardOptions = {};\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [['missing-atom', 'Bob', { id: 42 }]],\n cards: [],\n markups: [],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.MARKUP_SECTION_TYPE, 'P', [[_mobiledocDomRendererUtilsMarkerTypes.ATOM_MARKER_TYPE, [], 0, 0]]]]\n };\n var unknownAtomHandler = function unknownAtomHandler(_ref5) {\n var env = _ref5.env;\n var payload = _ref5.payload;\n var options = _ref5.options;\n\n assert.equal(env.name, atomName, 'correct name');\n assert.ok(!!env.onTeardown, 'onTeardown hook exists');\n\n assert.deepEqual(payload, expectedPayload, 'correct payload');\n assert.deepEqual(options, cardOptions, 'correct options');\n };\n renderer = new _mobiledocDomRenderer['default']({ atoms: [], unknownAtomHandler: unknownAtomHandler, cardOptions: cardOptions });\n renderer.render(mobiledoc);\n });\n\n test('renders a mobiledoc with sectionElementRenderer', function (assert) {\n var mobiledoc = {\n version: MOBILEDOC_VERSION,\n atoms: [],\n cards: [],\n markups: [],\n sections: [[_mobiledocDomRendererUtilsSectionTypes.MARKUP_SECTION_TYPE, 'P', [[_mobiledocDomRendererUtilsMarkerTypes.MARKUP_MARKER_TYPE, [], 0, 'hello world']]], [_mobiledocDomRendererUtilsSectionTypes.MARKUP_SECTION_TYPE, 'p', [[_mobiledocDomRendererUtilsMarkerTypes.MARKUP_MARKER_TYPE, [], 0, 'hello world']]], [_mobiledocDomRendererUtilsSectionTypes.MARKUP_SECTION_TYPE, 'h1', [[_mobiledocDomRendererUtilsMarkerTypes.MARKUP_MARKER_TYPE, [], 0, 'hello world']]]]\n };\n renderer = new _mobiledocDomRenderer['default']({\n sectionElementRenderer: {\n p: function p() {\n return document.createElement('pre');\n },\n H1: function H1(tagName, dom) {\n return dom.createElement('h2');\n }\n }\n });\n var renderResult = renderer.render(mobiledoc);\n var rendered = renderResult.result;\n\n assert.equal((0, _helpersDom.childNodesLength)(rendered), 3, 'renders three sections');\n assert.equal(rendered.firstChild.tagName, 'PRE', 'renders a pre');\n assert.equal(rendered.firstChild.textContent, 'hello world', 'renders the text');\n assert.equal(rendered.childNodes.item(1).tagName, 'PRE', 'renders a pre');\n assert.equal(rendered.childNodes.item(2).tagName, 'H2', 'renders an h2');\n });\n }", "title": "" }, { "docid": "1f97d89ea8a0d1e520cac7a2b4078236", "score": "0.44671616", "text": "static createQuizElements () {\r\n // Get all the questionAnswer set\r\n let hangmans = Controller.myQuiz.myHangmans\r\n\r\n for (let i = 0; i < hangmans.length; i++) {\r\n // Create question label\r\n Controller.myView.createHangmanBoxElement(hangmans[i], i)\r\n }\r\n }", "title": "" }, { "docid": "afa0aff954d2cd6cab21bb3c80800ea9", "score": "0.4461233", "text": "function fillTime() {\n for (i = 6; i < 22; i++) {\n timeContainer.append(genElement(i));\n }\n}", "title": "" }, { "docid": "448e2e7ac6a43eeea1048ab29e2559be", "score": "0.4460931", "text": "function defineTrivialElement(domClass) {\n defineElement({domClass: domClass});\n }", "title": "" }, { "docid": "e75b5d0ef84931dfe9af3fa07552633a", "score": "0.44605783", "text": "createSimulationTree() {\n this.rootGameState = this.gameState = new GameState(this.context);\n this.rootGameState.addPlayerClones(this, this.context.players);\n this.rootGameState.decision = new Decision(\"Root\", 0); //for debugging\n }", "title": "" }, { "docid": "1cefa3b3bd0f78b55165da5543c9c63b", "score": "0.44602242", "text": "function setUpGrid(){\n for(let currRow = 0; currRow < numRows; currRow++){\n //console.log(\"Curr row is: \" + currRow);\n tableRow = document.createElement('tr');\n mainTable.appendChild(tableRow);\n \n for(let currCol = 0; currCol < numCols; currCol++){\n //console.log(\"Curr col is: \" + currCol);\n createdCell = document.createElement('td');\n createdCell.id = currRow + \"-\" + currCol;\n createdCell.className = 'empty-cell';\n // Add the path order number to the cell\n //createdCell.innerHTML = rowHolder[currRow][currCol];\n // initialize as non-path (will find the path in a later function)\n //createdCell.className = 'non-path';\n \n tableRow.appendChild(createdCell)\n }\n }\n}", "title": "" }, { "docid": "b001ea9955bc6587871d2f383ef44946", "score": "0.4457121", "text": "function CreatePathFinder() {\n\tinsertIntoPlayerSelect();\n\tinsertIntoGoalSelect();\n}", "title": "" }, { "docid": "e46e9efe7353564009f854b237a4ec05", "score": "0.44523355", "text": "function addTest() {\n\tvar arg;\n\t\n\tif ($(\"#new-test-method\").val() == \"mustUseNested\") {\n\t\targ = [];\n\t\t$(\".new-test-type-multi\").each(function() {\n\t\t\tif ($(this).val() !== \"\") {\n\t\t\t\targ.push($(this).val());\n\t\t\t}\n\t\t});\n\t\tif (arg.length == 0) {\n\t\t\talert(\"Please choose at least one type\");\n\t\t\treturn;\n\t\t}\n\t} else {\n\t\targ = $(\"#new-test-type-single\").val();\n\t}\n\t\n\ttests.push({method: $(\"#new-test-method\").val(), argument: arg});\n\tbuildTestList();\n\trunTests();\n}", "title": "" }, { "docid": "8a862e32a925d710820b19079d60bce5", "score": "0.44470486", "text": "function createElem (elem) {\n\tconsole.debug(\"elem: \" + elem);\n\tvar newelem;\n\t//line here\n\treturn newelem;\t\n}", "title": "" }, { "docid": "b190fc393449c7d51e1984c945a998d2", "score": "0.44446537", "text": "function initElement(element, i) {\r\n element.id = i;\t// id\r\n element.x = random(width); // random x position\r\n element.y = random(height); // random y postion\r\n element.s = random(100); // random size \t\r\n element.color1 = color(139, 224, 237);\r\n element.color2 = color(211, 249, 255); \r\n element.direction = 0.7;\r\n}", "title": "" }, { "docid": "1002aa7c958db39837642bf0b7cc4db9", "score": "0.4435546", "text": "constructor () {\n this.home = element(by.css('a.optionsNewTicket'))\n this.continue = element(by.id(\"button_continue\"))\n this.backToCategory = element(by.css(\"#category_step2 > div.requestCategoryTitles > div.moduleButton\"))\n this.fielCustom = element(by.css('div.requestCreateCustomField > div.requestCreateLabel'))\n\n }", "title": "" }, { "docid": "c247b395e17d49761f6b73e51bc1cf50", "score": "0.44284895", "text": "function addTreeProperties(element){\n if(element.type===\"StartingPoint\"){\n element.root=true;\n element.parent=[];\n element.child=[];\n element.leaf=false;\n }\n else{\n element.root=false;\n element.parent=[];\n element.child=[];\n element.leaf=false;\n }\n}", "title": "" }, { "docid": "60b6546e36b94c717ed5320bc0266909", "score": "0.4426716", "text": "function handleTruthTreeCreation() {\n\n // TODO: generate a new tree in the same svg element.\n if (controller.hasTree()){\n throw \"tree already started.\" \n }\n // sets some margins for the tree setup to consider. Not too sure we need this.\n var treeSetup = {\n top : 20,\n left : 200,\n right: 0,\n bottom: 0\n },\n \n rootNode = { \n props : $(\".propList\").text().split(\",\").map(p => { return { prop: p, clicked : false, used : false }})\n };\n\n controller.newTree(treeSetup, rootNode);\n\n}", "title": "" }, { "docid": "07149d074f7e9ff7863e0a9661d202ca", "score": "0.44252136", "text": "initAllElements() {\n this.elements.forEach((element) => element.init());\n }", "title": "" }, { "docid": "4f5b080e55e4caf45dd2873b17d9c403", "score": "0.4414607", "text": "setupDOM() {}", "title": "" }, { "docid": "a3e6acf8d84561bbe8349c95e902b21b", "score": "0.44136056", "text": "function FactoryDom()\n{\n this.cached = {};\n this.ids = 0;\n this.elementAttribute = 'anim8';\n this.priority = 5;\n this.attributes = {};\n}", "title": "" }, { "docid": "f463353ea8b3d0219a89283cf350ef75", "score": "0.44115683", "text": "createInstance(element) {\n\n this.instances.push(new Instance(this, element));\n\n }", "title": "" } ]
72c069c647189b4f33fd401a02c8e81b
vuex v3.1.1 (c) 2019 Evan You
[ { "docid": "cc2479e5054fceda749a48df6ea53711", "score": "0.0", "text": "function e(t){var n=Number(t.version.split(\".\")[0]);if(n>=2)t.mixin({beforeCreate:r});else{var e=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[r].concat(t.init):r,e.call(this,t)}}function r(){var t=this.$options;t.store?this.$store=\"function\"===typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}", "title": "" } ]
[ { "docid": "f5323caff0f3a89aefc4aa395f11a983", "score": "0.71877193", "text": "function vuexInit(){var options=this.$options;// store injection\nif(options.store){this.$store=typeof options.store==='function'?options.store():options.store;}else if(options.parent&&options.parent.$store){this.$store=options.parent.$store;}}", "title": "" }, { "docid": "e5ae43d0a0b29a389cc41a3a47381813", "score": "0.67134863", "text": "resetSnapshotsVm(state){this.snapshotsVm=new vue__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({data:{$$state:state||{}},computed:this.store._vm.$options.computed});}", "title": "" }, { "docid": "d6b9507e66d66e2138da85f3ce1483ff", "score": "0.662208", "text": "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "title": "" }, { "docid": "5b966b081995f5f8ca236b6355ba5196", "score": "0.6609481", "text": "function u(ee){H&&(ee._devtoolHook=H,H.emit('vuex:init',ee),H.on('vuex:travel-to-state',function(te){ee.replaceState(te)}),ee.subscribe(function(te,ne){H.emit('vuex:mutation',te,ne)}))}", "title": "" }, { "docid": "509aac8f04f01c0b31a45682f9f07cc4", "score": "0.6526561", "text": "onInspectState(index){var snapshot=this.replayMutations(index);this.bridge.send('vuex:inspected-state',{index,snapshot});}", "title": "" }, { "docid": "1261688dc56c35b6a6b0c84fe0a6199c", "score": "0.64760286", "text": "get vuex() {\n return {\n /**\n * Indicates whether this module has been configured as a _list_\n * or a _record_.\n */\n isList: this.config.isList,\n /**\n * Path to the root of the module\n */\n modulePath: this.config.isList ? this.model.plural : this.model.singular,\n /**\n * The name of the Vuex module who's state\n * is being queried\n */\n moduleName: (this.config.moduleName || this.config.isList\n ? this.about.model.plural\n : this.about.modelMeta.localModelName),\n /**\n * An optional offset to the module to store record(s)\n */\n modulePostfix: this.config.isList\n ? this._modelMeta.localPostfix || \"all\"\n : \"\",\n /**\n * The full path to where the record(s) reside\n */\n fullPath: this.config.isList\n ? pathJoin(this.model.plural, this._modelMeta.localPostfix || \"all\")\n : this.model.singular\n };\n }", "title": "" }, { "docid": "59463cf33727587ea0c605ec9b36e42a", "score": "0.63523763", "text": "function vuexInit () {\r\n var options = this.$options;\r\n // store injection\r\n if (options.store) {\r\n this.$store = typeof options.store === 'function'\r\n ? options.store()\r\n : options.store;\r\n } else if (options.parent && options.parent.$store) {\r\n this.$store = options.parent.$store;\r\n }\r\n }", "title": "" }, { "docid": "fbe846cb8f280d3c5e1137943ef83726", "score": "0.63509184", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "fbe846cb8f280d3c5e1137943ef83726", "score": "0.63509184", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "c1e262fef05c5187db3d6e4aded1fe3b", "score": "0.6339643", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "c4014b309ea84ef813eeabbc2368b3ed", "score": "0.62779725", "text": "onTravelToState(_ref7){var{index,apply}=_ref7;var snapshot=this.replayMutations(index);var state=Object(_clone__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.lastState);this.bridge.send('vuex:inspected-state',{index,snapshot});if(apply){this.ensureRegisteredModules(this.mutations[index]);this.hook.emit('vuex:travel-to-state',state);}}", "title": "" }, { "docid": "42982d79171a20cbf6788070af2a9ff5", "score": "0.6253598", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "42982d79171a20cbf6788070af2a9ff5", "score": "0.6253598", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "e33a7681d6aa8e808b612d6b426699e5", "score": "0.62445843", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ?\n options.store() :\n options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "e33a7681d6aa8e808b612d6b426699e5", "score": "0.62445843", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ?\n options.store() :\n options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "8fc60cfcc2bab31d9d8f8d579f2d0579", "score": "0.62403417", "text": "user(){\n return this.$store.getters.user\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.6232016", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" } ]
11bcf86aa27685a530aaf473863d8a5b
5. Find words that contain `is`
[ { "docid": "ef648019151bbabf608f702448c091c1", "score": "0.7167887", "text": "function containsIs (strings) {\n var newArray = [];\n for (var count = 0; count < strings.length; count++) {\n if (strings[count].includes(\"is\")) {\n newArray.push(strings[count]);\n }\n }\n return newArray;\n}", "title": "" } ]
[ { "docid": "4e4c3bd185c70ffc5a896b99adfafa36", "score": "0.78700113", "text": "function findWordsContainIs(input){\n\tvar whichElementsContainIs = [];\n\tfor(count = 0; count < input.length; count++){\n\t\tif(input[count].includes(\"is\")){\n\t\t\twhichElementsContainIs.push(count)\n\t\t}\n\t}\n\treturn whichElementsContainIs\n}", "title": "" }, { "docid": "e71b0d92bba906c75e2783a03a15c8cd", "score": "0.681757", "text": "function findThis (word) {\nvar strings = ['this','is','a','collection','of','words'];\n\nif strings.includes ('is') {\n return word\n}", "title": "" }, { "docid": "093d232ab1c7d71ef2923acab5c0e42f", "score": "0.6741149", "text": "function checkWords(st, arr) {\n let term = st.toLowerCase();\n return arr.filter(each => each.title.toLowerCase().indexOf(term) === 0);\n }", "title": "" }, { "docid": "84a1ba3d86cbb29b4c17d0bbeb7541af", "score": "0.6459407", "text": "function containIs(a) {\n newAm = '';\n for (let i=0; i < a.length; i++) {\n if(a[i].includes(\"is\")){\n newAm += a[i] + \" \"\n }else{\n //\n }\n} return newAm;\n}", "title": "" }, { "docid": "63c3be9dc586f7580238b2fb288681bc", "score": "0.6357958", "text": "function containsIs(testIs) {\n var newArray = [];\n\n for (var i = 0; i < testIs.length; i++) {\n\n if (testIs[i].includes('is')) {\n newArray.push(testIs[i]);\n }\n }\n return newArray;\n}", "title": "" }, { "docid": "2d07f50ba1038dcdb4a215738bcc3a4b", "score": "0.62797046", "text": "function isOnly(str3) {\n var onlyIs = []\n for (var i = 0; i < str3.length; i++)\n if (str3[i].includes(\"is\")) {\n onlyIs.push(str3[i])\n }\n console.log(onlyIs)\n}", "title": "" }, { "docid": "ceb20ac807b987ed065cad585e28247c", "score": "0.6253176", "text": "function wordSearch(word, text) {\n // Clean up text.\n let lowerText = text.toLowerCase();\n\n // Generate matching strings.\n let matchingStrings = [];\n matchingStrings.push(word + \"[^a-z]\");\n matchingStrings.push(word + \"s\" + \"[^a-z]\");\n matchingStrings.push(word + \"es\" + \"[^a-z]\");\n matchingStrings.push(\"[^a-z]\" + word + \"[^a-z]\");\n matchingStrings.push(\"[^a-z]\" + word + \"s\" + \"[^a-z]\");\n matchingStrings.push(\"[^a-z]\" + word + \"es\" + \"[^a-z]\");\n\n // Check if the word matches.\n let isContained = false;\n for (let matchIndex in matchingStrings) {\n let matchString = matchingStrings[matchIndex];\n // Match using regex.\n let regexMatcher = new RegExp(matchString);\n let currentResult = regexMatcher.test(lowerText);\n if (currentResult) {\n isContained = true;\n }\n }\n\n return isContained;\n}", "title": "" }, { "docid": "f9f152be97ebca24bdddfc859d5162d2", "score": "0.6176779", "text": "function GotBadWords(strAnything) {\n badWords = [\"eli\", \"manning\", \"jets\", \"giants\", \"yankees\", \"messi\", \"eli manning\", \"lakers\", \"lebron\"];\n\n //Assume the good\n results = false;\n\n //Loop thru the list of bad words and see if we find any inside the \"anything\" string\n for (val of badWords) {\n if (strAnything.toLowerCase().indexOf(val) > -1) {\n results = true;\n }\n }\n\n //Return results\n return results;\n\n}", "title": "" }, { "docid": "ab052df234bb24ec269b11f3dd5e1fab", "score": "0.6176109", "text": "function hasWord(sow,word) {\n var aow = sow.split(' ');\n return (aow.indexOf(word) > -1);\n}", "title": "" }, { "docid": "d57717d9242d0042d9dd5517a8856d5e", "score": "0.6043458", "text": "function test(str){\n\tconst patt = /is(?= all)/g;\n\tconst result = str.match(patt);\n\treturn result;\n}", "title": "" }, { "docid": "3719234417fd288b291c05f677c04011", "score": "0.6038634", "text": "async words(sUserInput) {\n let aNoiseWordData = await this.getDataFromDbByColNameAndFindQuery('noiseWords', {name: 'noise-words'});\n let sNoiseWords = aNoiseWordData[0].data;\n let aUserInputWords = sUserInput.toLowerCase().split(MY_WORD_REGEX);\n\n let aDesiredWords = [];\n aUserInputWords.forEach(function (sWord) {\n let oRegex = new RegExp(`\\\\s+(${sWord})+\\\\s+`, \"g\");\n let aResult = sNoiseWords.match(oRegex);\n if (!aResult) {\n aDesiredWords.push(normalize(stem(sWord)));\n }\n });\n\n return aDesiredWords;\n }", "title": "" }, { "docid": "573caa772a6f8c6d81cbeda58e673a89", "score": "0.6031347", "text": "function countWords (text, ParseTree, isWord) {\n isWord = isWord || {};\n function countWord (word) {\n if (word)\n isWord[word.toLowerCase()] = true;\n }\n function countWordsAtNodes (nodes) {\n if (nodes)\n nodes.forEach (countWordsAtNode);\n }\n function countWordsAtNode (node) {\n if (typeof(node) === 'object') {\n if (node.functag)\n\tcountWord (ParseTree.funcChar + node.functag);\n switch (node.type) {\n case 'lookup':\n\tcountWord (ParseTree.varChar + node.varname);\n break\n case 'assign':\n\tcountWord (ParseTree.varChar + node.varname);\n countWordsAtNodes (node.value);\n countWordsAtNodes (node.local);\n break\n case 'alt':\n node.opts.forEach (countWordsAtNodes);\n break\n case 'rep':\n countWordsAtNodes (node.unit);\n break\n case 'func':\n\tcountWord (ParseTree.funcChar + node.funcname);\n\tswitch (node.funcname) {\n\tcase 'eval':\n countWordsAtNodes (node.value);\n countWordsAtNodes (node.args);\n\t break\n\tcase 'strictquote':\n\tcase 'quote':\n\tcase 'unquote':\n default:\n countWordsAtNodes (node.args);\n break\n\t}\n break\n case 'cond':\n if (ParseTree.isTraceryExpr (node))\n\t countWord (ParseTree.traceryChar + ParseTree.traceryVarName(node) + ParseTree.traceryChar);\n countWordsAtNodes (node.test);\n countWordsAtNodes (node.t);\n countWordsAtNodes (node.f);\n break\n case 'root':\n case 'alt_sampled':\n countWordsAtNodes (node.rhs);\n break\n case 'rep_sampled':\n node.reps.forEach (countWordsAtNodes);\n break\n case 'sym':\n\tcountWord (ParseTree.symChar + ParseTree.leftBraceChar + (node.user || ParseTree.defaultUser) + '/' + node.name + ParseTree.rightBraceChar);\n countWordsAtNodes (node.rhs);\n countWordsAtNodes (node.bind);\n break\n default:\n\tbreak\n }\n } else if (typeof(node) === 'string')\n node\n .replace(/[^a-zA-Z0-9_]/g,' ') // these are the characters we keep\n .replace(/\\s+/g,' ').replace(/^ /,'').replace(/ $/,'') // collapse all runs of space & remove start/end space\n .split(' ')\n .forEach (countWord);\n }\n \n var parsed = ParseTree.parseRhs (text);\n countWordsAtNodes (parsed);\n\n return isWord;\n}", "title": "" }, { "docid": "7c424e192602eaffb48e85fcd0bd1c83", "score": "0.60236555", "text": "function hasWord(string, word) {\n \n}", "title": "" }, { "docid": "21ffcd204c8d518cfaaf2d730b92522e", "score": "0.60200477", "text": "function contain(arr){\n var a=[];\n for(let i=0; i<arr.length;i++){\n if(arr[i].includes(\"is\")){\n a.push(arr[i]);\n }\n}\nreturn a;\n}", "title": "" }, { "docid": "9834079bbda134c8e08625bcb3cdee77", "score": "0.601955", "text": "search(word) {\n let node = this.getLastNode(word);\n return node !== null && node.isWord;\n }", "title": "" }, { "docid": "d1b4aa1bfbe1d5e94f6cfbcccc423c35", "score": "0.60104406", "text": "function hasWord(string, word) {\n/**\n * input: 2 strings\n * otput: boolean\n * constraints: no punctuation?\n * edge cases: I imagine punctuaction could break this\n **/ \n //create an array of words in our string\n var eachWord = string.split(\" \");\n //search through our new array\n for (let i = 0; i < eachWord.length; i++){\n if (eachWord[i] === word){\n return true; //return true if it finds the word\n }\n } // end loop\n return false; //will never reach this statement if true is returned in loop\n}", "title": "" }, { "docid": "e617404831a157bc0217796615a723b3", "score": "0.598989", "text": "function findKeywords(w, keywords) {\n var pos = keywords.indexOf(w);\n return pos != -1 ? true : false;\n}", "title": "" }, { "docid": "506388c8aeb811254be4c104c1d29084", "score": "0.5986386", "text": "function filt(a) {\n keywords = [\"can\", \"bottle\", \"glass\", \"plastic\", \"cardboard\", \"cleaning\", \"beer\", \"book\"];\n for (i = 0; i < keywords.length; i++) {\n if (a.description.toLowerCase().includes(keywords[i])) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "95c155bba2137865635c6bd7e2e46e89", "score": "0.5978697", "text": "function searchWord(word, text) {\n // let regex = /\\sWORD\\s|^WORD\\s/gi;\n let regex = \"\\\\s\".concat(word,\"\\\\s|^\",word,\"\\\\s\");\n let re = new RegExp(regex, \"gi\");\n let matches = [...text.matchAll(re, text)];\n return matches.length; //+ matches2.length;\n }", "title": "" }, { "docid": "1dad37890c543207f2209e09d2d3e11d", "score": "0.59710175", "text": "is(s) { return this.some(o=>o.matches(s)); }", "title": "" }, { "docid": "5924ac2879063997acd19a3c4dfa8456", "score": "0.59709865", "text": "function findOccurrencesOfWordInSentence2 (sentence, word) {\n let regex = new RegExp(`\\\\b${word}\\\\b`, 'gi');\n let matches = sentence.match(regex);\n\n console.log(matches === null ? 0 : matches.length);\n}", "title": "" }, { "docid": "5e5b5d630a3b7e1dbcf9441a3b33d4e6", "score": "0.5947169", "text": "function hasWord(string, word) {\n /*hasWord() : Should take a string of words and a word and return true if <word> is in <string of words>, \n otherwise return false. (3, 0, 3)*/\n // if statement for sure\n var splitArr = string.split(' ');\n for (var i = 0; i < splitArr.length; i++){\n if (splitArr.includes(word)){\n return true;\n }else{\n return false;\n }\n }\n}", "title": "" }, { "docid": "a32437604f1a2c4a57a6ee306d535f43", "score": "0.5945207", "text": "function hasWord(string, word) {\n//using includes method and use an if statement\nif(string.includes(word)){\n return true;\n}\nreturn false;\n}", "title": "" }, { "docid": "7c915dd59677264ecd6603877527bd69", "score": "0.5945168", "text": "function message_has_words(message, words) {\r\n let text = get_message_full_text(message);\r\n for(let word of words) {\r\n if(word.trim() !== \"\") {\r\n if(text.toLowerCase().includes(word.trim().toLowerCase())) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }", "title": "" }, { "docid": "a2094b45ee3397f10db5eae2e4f1da6d", "score": "0.5933204", "text": "function findMatches(word, champions) {\n return champions.filter(champ => {\n const regex = new RegExp(word, 'gi');\n return champ.name.match(regex);\n });\n}", "title": "" }, { "docid": "5d20098fe53b6c1baf68c3476c6c6ee4", "score": "0.59053254", "text": "function hasWord(string, word) {\n //.includes method returns boolean value\n return string.includes(word);\n\n}", "title": "" }, { "docid": "2773d9b0ef0287ecb56d1981b8545ae2", "score": "0.58969116", "text": "words(content) {\n // split the content and normalize them by calling normalize function, ignore the word if its a noise word and return the remaining array\n let wordsArray = [];\n wordsArray = content.match(WORD_REGEX);\n let normalizedWordArray = [];\n\n if(wordsArray !== null) {\n for (let word of wordsArray) {\n if (!this.noiseWordsSet.has(word)) {\n let normalizedWord = normalize(word);\n normalizedWordArray.push(normalizedWord);\n }\n }\n }\n return normalizedWordArray;\n }", "title": "" }, { "docid": "3e8a23d86ed05a20f3f3aaf6037f4f37", "score": "0.58900344", "text": "function matches(s) {\n return getAllMatches(JAVASCRIPT_WORD_REGEX, s);\n }", "title": "" }, { "docid": "2e50b4beedd3936bef8c7faf341b47e5", "score": "0.58758074", "text": "function anyLemmaInStopWords(lemmas){\n for(let lemma of lemmas){\n if(stopWords_special.includes(lemma)) return true\n }\n return false\n}", "title": "" }, { "docid": "205670ac863952f9092830301b8a7204", "score": "0.5855447", "text": "function isDirtyWords(input){\n return input.match(/banana/);\n}", "title": "" }, { "docid": "d54d30ba962a38bd8a8f8b807b7ccdc0", "score": "0.58546436", "text": "function string_is_type_word(sentence, dictionary) {\n //tokenize sentence\n const tokenized_sentence = sentence.split(/[ ,\\n\\r?]+/);\n console.log(`The tokenized sentence was is ${tokenized_sentence}`);\n for (var i = 0; i < tokenized_sentence.length; i++) {\n for (var j = 0; j < dictionary.length; j++) {\n //console.log(`Checking ${tokenized_sentence[i]} against ${dictionary[j]}`);\n if (dictionary[j].constructor.name == \"Array\") {\n // do a phrase check\n if (phrase_in_string(sentence, dictionary[j])) {\n return true;\n }\n } else {\n // do a word check\n if (tokenized_sentence[i].localeCompare(dictionary[j]) == 0) {\n // found a match!\n return true;\n }\n }\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "241929d81ae17c4c16ad8e6b51e06b16", "score": "0.5846054", "text": "function checkText(parameters) {\n\n var str = document.querySelector('#input').value;\n var lookFor = document.querySelector('#lookFor').value;\n\n alert(countWords(str, lookFor) + \" times!\");\n\n function countWords(inputString, lookFor) {\n var counter = 0;\n var index = 0;\n\n while (index != -1 && index < inputString.length) {\n // Convert to lower case and search.\n index = inputString.toLowerCase().indexOf(lookFor, index);\n if (index != -1) {\n counter++;\n index += lookFor.length - 1;\n }\n }\n\n return counter;\n }\n}", "title": "" }, { "docid": "d4da33aa98d66682c0219533abd2a2b2", "score": "0.5827408", "text": "function containFortnite (userPhrase) {\n if (userPhrase.includes(\"fortnite\")) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "ea0fac03512eecd15ce7f7ba3af973a8", "score": "0.5823545", "text": "function makePredicate(words) {\n words = words.split(\" \");\n return function (str) {\n return words.indexOf(str) >= 0;\n };\n}", "title": "" }, { "docid": "ea0fac03512eecd15ce7f7ba3af973a8", "score": "0.5823545", "text": "function makePredicate(words) {\n words = words.split(\" \");\n return function (str) {\n return words.indexOf(str) >= 0;\n };\n}", "title": "" }, { "docid": "ea0fac03512eecd15ce7f7ba3af973a8", "score": "0.5823545", "text": "function makePredicate(words) {\n words = words.split(\" \");\n return function (str) {\n return words.indexOf(str) >= 0;\n };\n}", "title": "" }, { "docid": "ea0fac03512eecd15ce7f7ba3af973a8", "score": "0.5823545", "text": "function makePredicate(words) {\n words = words.split(\" \");\n return function (str) {\n return words.indexOf(str) >= 0;\n };\n}", "title": "" }, { "docid": "ea0fac03512eecd15ce7f7ba3af973a8", "score": "0.5823545", "text": "function makePredicate(words) {\n words = words.split(\" \");\n return function (str) {\n return words.indexOf(str) >= 0;\n };\n}", "title": "" }, { "docid": "ea0fac03512eecd15ce7f7ba3af973a8", "score": "0.5823545", "text": "function makePredicate(words) {\n words = words.split(\" \");\n return function (str) {\n return words.indexOf(str) >= 0;\n };\n}", "title": "" }, { "docid": "ea0fac03512eecd15ce7f7ba3af973a8", "score": "0.5823545", "text": "function makePredicate(words) {\n words = words.split(\" \");\n return function (str) {\n return words.indexOf(str) >= 0;\n };\n}", "title": "" }, { "docid": "840e098812a2600c66b79cdbd1f6b4e4", "score": "0.58210397", "text": "function is(arr){\n var a = []\n for(var i =0; i < arr.length; i ++){\n if (arr[i].includes(\"is\")){\n a.push(arr[i])\n }\n }\nreturn a;\n}", "title": "" }, { "docid": "c8ffa801e379cedcb16cac775e662a0c", "score": "0.57965386", "text": "function isMyChore(sentence) {\n if (sentence.indexOf('Do not') === 0) {\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "48699da9469039297ac69005e6dc8453", "score": "0.5794527", "text": "function spEng(sentence){\n return sentence.toLowerCase().includes(\"english\");\n}", "title": "" }, { "docid": "be856ce171370d53c9d4c4047e2b5406", "score": "0.5781137", "text": "function hasWord(string, word) {\n let iteration = string.split(\" \");\n for(let i = 0; i < iteration.length; i++){\n if(iteration[i] === word){\n return true;\n }\n }\nreturn false;\n}", "title": "" }, { "docid": "1bc554686f868b1377159cc1fc18bd20", "score": "0.57796305", "text": "function makePredicate(words) {\n\t words = words.split(\" \");\n\t return function (str) {\n\t return words.indexOf(str) >= 0;\n\t };\n\t}", "title": "" }, { "docid": "1bc554686f868b1377159cc1fc18bd20", "score": "0.57796305", "text": "function makePredicate(words) {\n\t words = words.split(\" \");\n\t return function (str) {\n\t return words.indexOf(str) >= 0;\n\t };\n\t}", "title": "" }, { "docid": "1bc554686f868b1377159cc1fc18bd20", "score": "0.57796305", "text": "function makePredicate(words) {\n\t words = words.split(\" \");\n\t return function (str) {\n\t return words.indexOf(str) >= 0;\n\t };\n\t}", "title": "" }, { "docid": "1bc554686f868b1377159cc1fc18bd20", "score": "0.57796305", "text": "function makePredicate(words) {\n\t words = words.split(\" \");\n\t return function (str) {\n\t return words.indexOf(str) >= 0;\n\t };\n\t}", "title": "" }, { "docid": "fa17cef1d74e763ec70b947cdb5c7c1e", "score": "0.577619", "text": "function hasWord(string, word) {\n if (string.search(word) === -1) {\n return false;\n } else {\n return true;\n }\n \n \n}", "title": "" }, { "docid": "da061cfd09c066dbc899c9f3435c35bd", "score": "0.57676876", "text": "isWord(inputWord) {\n const lowered = inputWord.toLowerCase();\n var temp = this.search(lowered);\n if (temp) {\n return temp.endingWord;\n }\n return false;\n }", "title": "" }, { "docid": "8a6ca712a1f0e0624064378d6d1ca8ad", "score": "0.5766286", "text": "function isAllIn(string,words)\n{\n\tvar b = true;\n\tvar l = words.length;\n\tfor(var i = 0 ; i < l ; i++)\n\t{\n\t\tb = isIn(string,words[i]);\n\t\tif(!b)\n\t\t\treturn b;\n\t}\n\treturn b;\n}", "title": "" }, { "docid": "f81ab3f4bddf5449f103aaad4667d3c3", "score": "0.5762425", "text": "function hasWord(string, word) {\n var result = false;\nvar newString = string.split(' ');\n\nfor(let i = 0; i < newString.length; i++){\n if(word === newString[i]){\n result = true;\n }\n}\nreturn result;\n}", "title": "" }, { "docid": "47ae2c3619357455fcb44452652bd08d", "score": "0.57595915", "text": "function hasWord(string, word) {\n// debugger;\n var array = string.split(\" \");\n for (let i = 0; i < array.length; i++) \n if (word === array[i]) {\n return true;\n } \n return false;\n}", "title": "" }, { "docid": "d81f8cfcb318df25a9618fd185a6f7f2", "score": "0.57580847", "text": "contains(keywords, search){\n for(var i = 0; i < keywords.length; i++){\n if(keywords[i].includes(search)){\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "2683aa08de6b6f813f89524476d8db52", "score": "0.57526356", "text": "function makePredicate(words) {\n\t\t words = words.split(\" \");\n\t\t return function (str) {\n\t\t return words.indexOf(str) >= 0;\n\t\t };\n\t\t}", "title": "" }, { "docid": "5c2840485a9e2929c1f135967fc39eba", "score": "0.57288903", "text": "function allWordsExistInSentence(element) {\n var answerWords = element.value.trim().split(\" \");\n var sentWords = document.getElementById(\"s0\").firstChild.nodeValue.split(\" \");\n for (var i = 0; i < answerWords.length; i++) {\n var found = false;\n for (var j = 0; j < sentWords.length; j++) {\n /*\n var w1 = answerWords[i].toUpperCase();\n var w2 = sentWords[j].toUpperCase();\n console.log(w1);\n console.log(w2);\n for (var k = 0; k < w1.length; k++) {\n console.log(w1.charCodeAt(k) + \", \" + w2.charCodeAt(k));\n }\n */\n if (answerWords[i].toUpperCase() === sentWords[j].toUpperCase()) {\n found = true;\n break;\n }\n }\n if (!found) {\n return [false, answerWords[i]];\n }\n }\n return [true, \"\"];\n}", "title": "" }, { "docid": "95d6216d9d594195f0a61fbac8e8c468", "score": "0.572302", "text": "function sun(word) {\n\treturn word.indexOf('sun') !== -1;\n\t\n}", "title": "" }, { "docid": "61d252a6a825733e615fafe6cb0fb01b", "score": "0.5717449", "text": "function hasWord(string, word) {\n //split string into array to better access individual values (words)\n let strings = string.split(\" \");\n //for loop to access values in array \n for (let i = 0; i < strings.length; i ++) {\n //conditional if value in array is strictly equal to word argument return true \n if (strings[i] === word) {\n return true;\n }\n //if not equal (word wasnt found) return false OUTSIDE OF LOOP\n } return false \n}", "title": "" }, { "docid": "09ed53db8060ce00e57ee2ebf9f2d687", "score": "0.5710879", "text": "function wordMatchesTerm(word, term) {\n\t// var termParts = term.word.toLowerCase().split(\" \");\n\treturn term.word.toLowerCase().match(\"\\\\b\" + word + \"\\\\b\") !== null;\n}", "title": "" }, { "docid": "4e4a5637b8d3c67f18ee270becab4f01", "score": "0.57087386", "text": "function vocabContains(word) {\n return VOCAB.indexOf(word.toLowerCase()) > -1;\n}", "title": "" }, { "docid": "1f141373dabf1e20ca2c3d5ef38728a0", "score": "0.5697886", "text": "function sentenceContains(contains) {\n if (input.indexOf(contains) > -1) {\n return true;\n }\n }", "title": "" }, { "docid": "921fe9031a90c02acf1103946962dd45", "score": "0.5696224", "text": "function findOccurrencesOfWordInSentence (sentence, word) {\n let regex = new RegExp(`\\\\b${word}\\\\b`, 'gi');\n let match = regex.exec(sentence);\n let count = 0;\n\n while (match) {\n count++;\n match = regex.exec(sentence);\n }\n\n console.log(count);\n}", "title": "" }, { "docid": "795b45d6fa454c74a2cbe724ab01d7b6", "score": "0.569569", "text": "function markWords() {\n // Gets the mathcing words for processing\n\tvar query = getQuery();\n \n\t// Get page source code\n\tvar html = document.body.innerHTML();\n\n\tRegExp re = new RegExp(query);\n\n\t// More code to come\n}", "title": "" }, { "docid": "992ae782bc22b1ef70ba104c24c79787", "score": "0.5664801", "text": "function wordFind(stringW, word) {\n var checkWord = '';\n var countW = 0;\n stringW +=' ';\n for (var i = 0; i < stringW.length; i++) {\n if (stringW[i] !== ' ') {\n checkWord += stringW[i];\n }\n else {\n if (checkWord === word) {\n countW++;\n } \n checkWord = ''\n }\n }\n return '\\'' + word + '\\' was found ' + countW + ' times';\n}", "title": "" }, { "docid": "2e13058e571f05b716098f0e77151150", "score": "0.5652948", "text": "function test_wikiwords(){\n function test( a, neg ){\n if( !De )return\n !neg && mand( SW.wikiword.test( a), \"false negative \" + a)\n neg && mand( !SW.wikiword.test( a), \"false positive \" + a)\n var match = SW.wikiwords.exec( \" \" + a + \" \")\n if( !match ){\n mand( neg, \"bad match \" + a)\n }else{\n mand( match[1] == \" \", \"bad prefix for \" + a)\n match = match[2]\n !neg && mand( match == a, \"false negative match: \" + a + \": \" + match)\n neg && mand( match != a, \"false positive match: \" + a + \": \" + match)\n match = SW.wikiwords.exec( \"~\" + a + \" \")\n if( match ){\n mand( neg, \"bad ~match \" + a)\n }\n }\n }\n function ok( a ){ test( a) }\n function ko( a ){ test( a, true) }\n ok( \"WikiWord\")\n ok( \"WiWi[jhr]\")\n ok( \"W_W_2\")\n ok( \"@jhr\")\n ko( \"@Jhr\")\n ko( \"@jhr.\")\n ok( \"@jhr@again\")\n ok( \"j-h.robert@\")\n ko( \"jhR@\")\n ok( \"#topic\")\n ko( \"#Topic\")\n ok( \"#long-topic5\")\n ko( \"Word\")\n ko( \"word\")\n ko( \" gar&badge \")\n ok( \"UserMe@myaddress_com\")\n ko( \"aWiki\")\n ko( \"aWikiWord\")\n ok( \"_word_\")\n ko( \"_two words_\")\n ok( \"[free link]\")\n ok( \"User[free]\")\n ok( \"[free]Guest\")\n ko( \"[free/link]\")\n ok( \"linkedIn\")\n ko( \"shrtIn\")\n ko( \"badLinkIn\")\n ok( \"[email protected]\")\n }", "title": "" }, { "docid": "6505bd9c4c96e0e2e18adeabf01ce414", "score": "0.5644229", "text": "function includesWords(sentence, word1, word2) {\n const words = sentence.split(' ');\n return words.includes(word1) || words.includes(word2);\n}", "title": "" }, { "docid": "b14160d94816ee1648705d93e934b358", "score": "0.5640507", "text": "function stringContainArrayWords(inputString, arr) {\n\tconsole.log(\"input string and check each array element\");\n}", "title": "" }, { "docid": "7d868b931cb4ebf5d77479f310b56094", "score": "0.5639685", "text": "function searchInSentence(searchTerm) {\n return sentence.includes(searchTerm);\n}", "title": "" }, { "docid": "e8fd2b365329dcc026ffd89fadb7555a", "score": "0.56348467", "text": "function hasWord(string, word) {\n if(string.includes(word)){\n return true;\n }\n else{\n return false;\n }\n }", "title": "" }, { "docid": "2dab5e51b0095527361f731b412a9091", "score": "0.563232", "text": "contains(text) {\n return this.search(text).length > 0;\n }", "title": "" }, { "docid": "8126574f79bd520c03de4a909ec6685c", "score": "0.5625121", "text": "function itsOneWord(text){\n let arr = text.split(' ').filter(word=>{\n return word.length>0? true:false;\n });\n return arr.length>1? false:true;\n \n}", "title": "" }, { "docid": "24d264905aedd776c62fe362c664e0a0", "score": "0.5620875", "text": "function allLemmaInStopWords(lemmas){\n for(let lemma of lemmas){\n if(!stopWords_special.includes(lemma)) return false\n }\n return true\n}", "title": "" }, { "docid": "67722a30e3c5da2c5094631413a4f06e", "score": "0.56163615", "text": "function candidates(text) {\n let query = text.toLowerCase();\n return VOCAB.filter(word => word.substring(0, query.length) == query)\n}", "title": "" }, { "docid": "c4d7a223a67daef07c256fb68e1a7bfa", "score": "0.5613468", "text": "function hasWord(string, word) {\nlet object = {string, word};\nfor(var key in object) {\n if(string.includes(word)){\n return true;\n }\n return false\n }\n}", "title": "" }, { "docid": "8f2b52f591dc589933cb1efec2f66708", "score": "0.55895704", "text": "function findOccurrencesWordInText(word, text, register) {\n\tif (register === undefined) {\n\t\tvar register = 0;\n\t}\n\tif (register === 1) {\n\t\treturn text.includes(word); \n\t}\n\telse {\n\t\treturn text.toLowerCase().includes(word.toLowerCase()); \n\t}\n\n}", "title": "" }, { "docid": "5c04e03fa2b991028a2f8b95ee67b937", "score": "0.5589558", "text": "function hasWord(string, word){\n return string.indexOf(word) !== -1;\n}", "title": "" }, { "docid": "d3c1dce4ba0d223a12150ae0412bac1e", "score": "0.55894226", "text": "getWordsFromCounterpartList(text) {\n let result = [];\n\n this.wordLists.forEach((words, index, all) => {\n const isMatch = words.some((word) => word === text);\n\n if (isMatch) {\n result = all[index ? 0 : 1];\n }\n });\n\n return result;\n }", "title": "" }, { "docid": "8d9dbade8e6318e4c6994894c2748532", "score": "0.55889815", "text": "function findMatches(wordToMatch, list){\n const studentArr = Array.from(list);\n return studentArr.filter(student => {\n const regex = new RegExp(wordToMatch, 'ig');\n return student.children[0].children[1].innerText.match(regex) || student.children[0].children[2].innerText.match(regex);\n });\n }", "title": "" }, { "docid": "88aa042c6502a438765e1296206a28a3", "score": "0.55793816", "text": "function checkTerms(term, text) {\n return text.replace(/[^\\w\\s]|_/g, \"\")\n .replace(/\\s+/g, \" \")\n .split(\" \")\n .filter(function(value) {return value === term})\n .length;\n }", "title": "" }, { "docid": "1b88c0de4c3f3f35b2d1239f7b3e5509", "score": "0.5577816", "text": "function hasWord(string, word) {\n // use the string method includes to see if word is in string\n return string.includes(word);\n\n}", "title": "" }, { "docid": "79db81477fab618f815fb892ec7fa0d4", "score": "0.557319", "text": "talkingAboutGames(message) {\n let self = this;\n let bool = false;\n let discovered = [];\n for (var i = 0; i < this.words.length; i++) {\n let value = this.words[i];\n if (message.toLowerCase().indexOf(value) > -1) {\n if (discovered.indexOf(value) == -1) {\n self.keywords.push(value);\n self.keywords.shift();\n discovered.push(value);\n bool = true;\n }\n }\n }\n return bool;\n }", "title": "" }, { "docid": "4147764a39fa41e74300633c3c2435b0", "score": "0.55726403", "text": "function search_word(text, word){\r\n\r\n var x = 0, y=0;\r\n\r\n for (i=0;i< text.length;i++)\r\n {\r\n if(text[i] == word[0])\r\n {\r\n for(j=i;j< i+word.length;j++)\r\n {\r\n if(text[j]==word[j-i])\r\n {\r\n y++;\r\n }\r\n if (y==word.length){\r\n x++;\r\n }\r\n }\r\n y=0;\r\n }\r\n }\r\n return \"'\"+word+\"' was found \"+x+\" times.\";\r\n}", "title": "" }, { "docid": "58238025dba0a4196afcf373b8e34e85", "score": "0.5537889", "text": "function countConsistentStrings(allowed, words){\n let result = [];\n for(let i = 0; i < words.length; i++){\n const word = words[i];\n for (let j = 0; j < word.legth; j++){\n const char = word[j];\n if(!alllowed.includes(char)) break;\n else if(j=== word.length - 1 )result.push(word);\n }\n }\n return result.length;\n}", "title": "" }, { "docid": "8c861bdddfc87e74f5e998b9ed56f77b", "score": "0.5536889", "text": "function multiSearch(text, searchWords) {\n const searchExp = new RegExp(`(${searchWords.join(')|(')})`, 'gi');\n return text.match(searchExp).length === searchWords.length;\n}", "title": "" }, { "docid": "fe372c8e9d45480a523c858e0f093e0a", "score": "0.5536247", "text": "function firstWordCheck(string) {\n const acceptableDev = [\"hitch\", \"thich\", \"which\", \"pitch\"];\n if (acceptableDev.includes(string)) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "0707a79e5ed653972cda05e3bfefc42c", "score": "0.55356383", "text": "function isWaldoHere(str) {\n\n if (str.includes('Waldo')) {\n console.log(true);\n } else {\n console.log(false);\n }\n\n}", "title": "" }, { "docid": "c0d6939c4a1643a76590dfc1fa464f99", "score": "0.5533212", "text": "function hasWord(string, word) {\n var array = string.split(' ');\n for (var i = 0; i < array.length; i++) {\n if (array[i] === word) {\n return true;\n }\n } return false;\n}", "title": "" }, { "docid": "af3ec1b9d0780a6daa090c8e7ae95609", "score": "0.5525045", "text": "function hasWord(string, word) {\n var arr = string.split(' ');\n for(var i = 0; i < arr.length; i++) {\n if (arr[i] == word) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "0b58156dad0ca8472fa7bed7bd731925", "score": "0.5524552", "text": "function hasWord(string, word) {\n //split the string of words into an array so we will be able to loop through it to see if words matchs\n let split = string.split(\" \");\n //search through the array to see if the word matches a word in the array. Return true if it matches\n for (let i = 0; i< split.length; i++) {\n if (word === split[i]){\n return true;\n }\n }\n //return false out of the loop if there is no match.\n return false;\n}", "title": "" }, { "docid": "a3fd2472ad0b5c50b84c837b5fcadd4b", "score": "0.5521955", "text": "function findWord(letters) {\n\t\n\t//let searchword = letters.toLowerCase();\n\tlet searchword = letters;\n\t//searchword = searchword.replace(/\\s+/g, '');\n\n\t// search for verbs\n\tvar v = verbs.includes(searchword);\t\n\tif (v==true){\n\t\tconsole.log(searchword + \" is a verb!\");\n\t\tvalid_verbs.push(searchword);\n\t}\n\n\t// search for nouns\t\n\tvar n = nouns.includes(searchword);\n\tif (n==true){\n\t\tconsole.log(searchword + \" is a noun!\");\n\t\tvalid_nouns.push(searchword);\n\t}\n\t\n\t// neither a noun or a verb\n\tif (!v){\n\t\tif(!n){\n\t\t\tconsole.log(searchword + \" is not a noun or a verb!\");\n\t\t\tnon_words.push(searchword);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6c3c064e82038e9ee727e9048fe4d770", "score": "0.55114233", "text": "function checkSpam (string, word) {\n\n//conversion of all symbols to lowercase\n string = string.toLowerCase();\n word = word.toLowerCase();\n\n//searching for spam words\n if (string.indexOf(word) == -1) {\n document.write('Not spam' + '<br/>');\n }\n else {\n document.write('SPAM' + '<br/>')\n }\n}", "title": "" }, { "docid": "e18501f545fd2e195a08301c7cb8ef1b", "score": "0.55056745", "text": "function hasWord(string, word) {\n let newString = string.split(\" \");\n for (let i = 0; i < newString.length -1; i++) {\n if (newString[i].toLowerCase() === word.toLowerCase()) {\n return true;\n }\n else {\n return false;\n }\n }\n}", "title": "" }, { "docid": "ce1ab32aad6327c70bdedf5628e3e630", "score": "0.55041564", "text": "function contentChecker(content){\n\tfor(i = 0; i < wordArray.length; i++){\n\t\tif(content.search(wordArray[i]) !== -1){\n\t\t\thighlight = wordArray[i];\n\t\t\thtmlReadyWord = \"<span class='highlight animated flash'>\"+ wordArray[i] + \"</span>\";\n\t\t\tconsole.log(\"true\");\n\t\t\treturn true\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9c819616a6f1bfae6b229f6bedb787f6", "score": "0.5499987", "text": "filteredResults(text) {\n let { pizzas } = this.state;\n let term = '(^|\\\\b)' + text\n let regex = new RegExp(term, \"gi\")\n return pizzas.filter(pizza => pizza.match(regex))\n }", "title": "" }, { "docid": "a4ae161e21a2c0663b02b2806359eda0", "score": "0.54987395", "text": "checkIfWordExist(shortString, longString, isCaseSensitive) {\n let value = longString.indexOf(shortString) > -1;\n\n if (\n !isCaseSensitive ||\n isCaseSensitive === \"false\" ||\n isCaseSensitive === 0\n ) {\n let longStringLowerCase = String(longString).toLowerCase();\n let shortStringLowerCase = String(shortString).toLowerCase();\n value = longStringLowerCase.indexOf(shortStringLowerCase) > -1;\n }\n return value;\n }", "title": "" }, { "docid": "614230b1893ddef9086edba76c138e97", "score": "0.5492082", "text": "function _match_filter(){\n\t\t var retval = false;\n\t\t var lc = jQuery(this).text().toLowerCase();\n\t\t if( lc.indexOf(stext) >= 0 ){\n\t\t\tretval = true;\n\t\t }\n\t\t return retval;\n\t\t}", "title": "" }, { "docid": "614230b1893ddef9086edba76c138e97", "score": "0.5492082", "text": "function _match_filter(){\n\t\t var retval = false;\n\t\t var lc = jQuery(this).text().toLowerCase();\n\t\t if( lc.indexOf(stext) >= 0 ){\n\t\t\tretval = true;\n\t\t }\n\t\t return retval;\n\t\t}", "title": "" }, { "docid": "eeb97341e82450472fb5b4411819a648", "score": "0.54766554", "text": "function contains(key, value)\n {\n var output = [];\n //console.log(output);\n for (var i = 0; i < lines.length; i++) // iterate through lines (56 in total) arrays\n {\n if (lines[i].words[key] === value) // every word with (key = int) that equals the string i pass to function, return\n {\n output.push(i); // add all strings that match to array \"output\"\n // console.log(i + \" true\");\n }\n else\n {\n // console.log(i + \" false\");\n }\n }\n return output;\n }", "title": "" }, { "docid": "703e861467980722854263012264c5ae", "score": "0.546709", "text": "function searchString(searchTerm) {\n return sentence.includes(searchTerm);\n}", "title": "" }, { "docid": "978483ed7f74b2c9664f0453f0e8ec00", "score": "0.5463693", "text": "function add(str1,text){\n console.log(str1.includes(text));\n}", "title": "" } ]
6117455d948858ae389aeabb16d000d9
this function updates the html in order to show the user an uptodate table
[ { "docid": "a0641651d659d3adb235d57e8bdad9dd", "score": "0.0", "text": "function updateTable(item, quantity, index, trigger) {\n \n var table = document.getElementById(\"myTable\");\n table.style.visibility = \"visible\";\n \n // trigger is a boolean variable which indicates whether the object that is to be inserted\n // is already stored or not\n \n // if it is, update the respective cell in the table, using the index given as parameter\n if(trigger){\n cells2[index].innerHTML = parseInt(cells2[index].innerHTML) + parseInt(quantity);\n }\n \n // otherwise...\n else{\n \n // get the html elements into js variables\n var row1 = document.getElementById(\"row1\");\n var row2 = document.getElementById(\"row2\");\n var form = document.getElementById(\"myForm\");\n var itemValue = form.elements[0].value;\n var quantityValue = form.elements[1].value;\n \n // insert new cells\n var cell1 = row1.insertCell();\n var cell2 = row2.insertCell();\n cells1.push(cell1);\n cells2.push(cell2);\n \n // update the new cells with the values given as parameters\n cell1.innerHTML = itemValue;\n cell2.innerHTML = quantityValue; \n }\n}", "title": "" } ]
[ { "docid": "0821e0cc9fa806385233257de2e0c75d", "score": "0.71703315", "text": "function updateTable() {\n var keys = Object.keys(tableTrack.addedTables);\n var tableView = $(\"#added_tables\");\n if (keys.length === 0) {\n tableView.html(\"\");\n return false;\n }\n\n tableView.html(\"<tr>\" +\n \"<th>Number of seats</th>\" +\n \"<th>Number of tables</th>\" +\n \"</tr>\");\n\n for (var i = 0; i < keys.length; i++) {\n var row = \"<tr><td> \" + keys[i] + \" </td>\";\n row += \"<td> \" + tableTrack.addedTables[keys[i]] + \" </td></tr>\"\n tableView.append(row);\n }\n }", "title": "" }, { "docid": "020903f04f094cbd5a70796efd2319e8", "score": "0.695327", "text": "function updateTable(){\n\n\tvar tableContent = '';\n\n\t//jQuery AJAX call for JSON from /users/userlists route\n\t$.getJSON('/users/userlist', function(data){\n\t\t//quick and dirty hack not great idea for large samples size\n\t\tuserListData = data;\n\t\t$.each(data, function(){\n\t\t\ttableContent += '<tr>';\n\t\t\ttableContent += '<td><a href=\"#\" class=\"linkshowuser\" rel=\"' + this.username + '\">' + this.username + '</a></td>';\n tableContent += '<td>' + this.email + '</td>';\n tableContent += '<td><a href=\"#\" class=\"linkdeleteuser\" rel=\"' + this._id + '\">delete</a></td>';\n tableContent += '</tr>';\n\t\t});\n\n \t//inject the entire content string into html table\n \t$('#userList table tbody').html(tableContent);\n\n\t});\n}", "title": "" }, { "docid": "d23912401000e65ad5752b50ac43dd6d", "score": "0.6865229", "text": "function updateHTML() {\n clearAllHTML();\n generateAllHTML();\n}", "title": "" }, { "docid": "89e4c1873e1f4cf2e06ca83429cd2343", "score": "0.6843851", "text": "update() {\n if (this.el) {\n while (this.el.hasChildNodes()) {\n this.el.removeChild(this.el.lastChild);\n }\n\n this.el.appendChild(this.renderTable(this.config.store.getData()));\n }\n }", "title": "" }, { "docid": "4dea570f4e139a9081eb9e0d0443abcd", "score": "0.676543", "text": "function updatenotifier_buildTable() {\n var html = \"\";\n\n html += \"<table id=\\\"Plugin_UpdateNotifierTable\\\" style=\\\"border-spacing:0;\\\">\\n\";\n html += \" <thead>\\n\";\n html += \" <tr>\\n\";\n html += \" <th>\" + genlang(2, true, \"UpdateNotifier\") + \"</th>\\n\";\n html += \" </tr>\\n\";\n html += \" </thead>\\n\";\n html += \" <tbody>\\n\";\n html += \" </tbody>\\n\";\n html += \"</table>\\n\";\n\n $(\"#Plugin_UpdateNotifier\").append(html);\n\n}", "title": "" }, { "docid": "5788ed3a4c4ec903221b6d3d4307ebb6", "score": "0.6702936", "text": "function updateTable(){\n //read the modified database\n $.ajax({\n url: 'backliftapp/teams',\n type: \"GET\",\n dataType: \"json\",\n success: function (data){\n if(data.length===0){\n //empty the table\n $('#name').html('');\n $('#wins').html('');\n $('#losses').html(''); \n $('#percent').html(''); \n $('#delete').html(''); \n $('#update-button').html('');\t\n\n }\n else{\n $('#name').html('');\n $('#wins').html('');\n $('#losses').html('');\n $('#percent').html(''); \n $('#delete').html(''); \n \t $('#update-button').html('');\t\n\n\n for(var i=0;i<data.length;i++){\n populateTable(data[i]); \n } //end for \n }\n } // end function\n }); // end ajax\n}", "title": "" }, { "docid": "536e71816c6323f9ee5c26923b39bd2c", "score": "0.6558919", "text": "function updateTable() {\n // empty table\n $(\"#table-body\").empty();\n\n // updates values in table for each object key\n for (i = 0; i < trainNames.length; i++) {\n //ensures that time is in the past\n firstTimeConverted = moment(trainTimes[i], \"hh:mm\").subtract(1, \"years\");\n trainName = trainNames[i]\n trainDes = trainDests[i];\n trainFreq = trainFreqs[i];\n showTrains();\n\n };\n }", "title": "" }, { "docid": "1c880721c720bfb10f0a17d212223aff", "score": "0.65532297", "text": "updateTable() {\n\t\tthis.manager.get(\"WWSUanimations\").add(\"djs-update-table\", () => {\n\t\t\tif (this.table) {\n\t\t\t\tthis.table.clear();\n\t\t\t\tthis.find().forEach((dj) => {\n\t\t\t\t\tlet icon = `secondary`;\n\t\t\t\t\tif (\n\t\t\t\t\t\t!dj.lastSeen ||\n\t\t\t\t\t\tmoment(dj.lastSeen)\n\t\t\t\t\t\t\t.add(30, \"days\")\n\t\t\t\t\t\t\t.isBefore(\n\t\t\t\t\t\t\t\tmoment(\n\t\t\t\t\t\t\t\t\tthis.manager.get(\"WWSUMeta\")\n\t\t\t\t\t\t\t\t\t\t? this.manager.get(\"WWSUMeta\").meta.time\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\ticon = `danger`;\n\t\t\t\t\t} else if (\n\t\t\t\t\t\tmoment(dj.lastSeen)\n\t\t\t\t\t\t\t.add(7, \"days\")\n\t\t\t\t\t\t\t.isBefore(\n\t\t\t\t\t\t\t\tmoment(\n\t\t\t\t\t\t\t\t\tthis.manager.get(\"WWSUMeta\")\n\t\t\t\t\t\t\t\t\t\t? this.manager.get(\"WWSUMeta\").meta.time\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\ticon = `warning`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ticon = `success`;\n\t\t\t\t\t}\n\t\t\t\t\tthis.table.row.add([\n\t\t\t\t\t\tdj.name || \"\",\n\t\t\t\t\t\tdj.realName || \"\",\n\t\t\t\t\t\t`<i class=\"fas fa-dot-circle text-${icon}\"></i>`,\n\t\t\t\t\t\tdj.lastSeen\n\t\t\t\t\t\t\t? moment\n\t\t\t\t\t\t\t\t\t.tz(\n\t\t\t\t\t\t\t\t\t\tdj.lastSeen,\n\t\t\t\t\t\t\t\t\t\tthis.manager.get(\"WWSUMeta\")\n\t\t\t\t\t\t\t\t\t\t\t? this.manager.get(\"WWSUMeta\").meta.timezone\n\t\t\t\t\t\t\t\t\t\t\t: moment.tz.guess()\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t.format(\"LLLL\")\n\t\t\t\t\t\t\t: \"Unknown / Long Ago\",\n\t\t\t\t\t\t`<div class=\"btn-group\"><button class=\"btn btn-sm btn-primary btn-dj-analytics\" data-id=\"${dj.ID}\" title=\"View DJ and Show Analytics\"><i class=\"fas fa-chart-line\"></i></button><button class=\"btn btn-sm btn-secondary btn-dj-logs\" data-id=\"${dj.ID}\" title=\"View Show Logs\"><i class=\"fas fa-clipboard-list\"></i></button><button class=\"btn btn-sm bg-indigo btn-dj-notes\" data-id=\"${dj.ID}\" title=\"View/Edit Notes and Remote Credits\"><i class=\"fas fa-sticky-note\"></i></button><button class=\"btn btn-sm btn-warning btn-dj-edit\" data-id=\"${dj.ID}\" title=\"Edit DJ\"><i class=\"fas fa-edit\"></i></button><button class=\"btn btn-sm btn-danger btn-dj-delete\" data-id=\"${dj.ID}\" title=\"Remove DJ\"><i class=\"fas fa-trash\"></i></button></div>`,\n\t\t\t\t\t]);\n\t\t\t\t});\n\t\t\t\tthis.table.draw();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "5258e11339824bc53a8bcff69d8ce10b", "score": "0.6521413", "text": "function notificationTable() {\n\t$.get(\"php/notificationTable.php\", { collapsed: isNotificationTableCollapsed}, function(data) { //Send request for the notfication table, passing through if the table is collapsed or not\n\t\t$(\"#notificationTable\").html(data); //Update the table with the returned repsonse\n\t\tvar updateDate = new Date(); //Update the last updated time with the current datetime\n\t\t$(\"#lastUpdatedTime\").html(\"Last updated: \" + updateDate.today() + \" \" + updateDate.timeNow());\n\t});\n}", "title": "" }, { "docid": "c659d2a63292db8b9a5ef804c7fa57cb", "score": "0.65213805", "text": "updateTable() {\n\t\tthis.manager.get(\"WWSUanimations\").add(\"underwritings-update-table\", () => {\n\t\t\tif (this.table) {\n\t\t\t\tthis.table.clear();\n\t\t\t\tthis.find().forEach((underwriting) => {\n\t\t\t\t\tthis.table.row.add([\n\t\t\t\t\t\tunderwriting.name || \"Unknown Underwriting\",\n\t\t\t\t\t\t`<div class=\"btn-group\"><button class=\"btn btn-sm btn-info btn-underwriting-info\" data-id=\"${underwriting.ID}\" title=\"Show underwriting RadioDJ track info (including when it aired so far)\"><i class=\"fas fa-eye\"></i></button><button class=\"btn btn-sm btn-warning btn-underwriting-edit\" data-id=\"${underwriting.ID}\" title=\"Edit underwriting\"><i class=\"fas fa-edit\"></i></button><button class=\"btn btn-sm btn-danger btn-underwriting-delete\" data-id=\"${underwriting.ID}\" title=\"Remove underwriting\"><i class=\"fas fa-trash\"></i></button></div>`,\n\t\t\t\t\t]);\n\t\t\t\t});\n\t\t\t\tthis.table.draw();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "96085a28c8398fd649e63ee2db7ef43f", "score": "0.651319", "text": "function showLeaderboardRefresh(){\n viewLeaderboard();\n if(leaderboard){\n document.getElementById(\"table\").innerHTML = leaderboard;\n } else {\n resetTable();\n }\n}", "title": "" }, { "docid": "482300f0284667352e3b06cb8beadbaf", "score": "0.648441", "text": "function refreshHTML() {\r\n\t\tfor( var row = 1; row <= tableSize; row++ ) {\r\n\t\t\tfor( var column = 1; column <= tableSize; column++ ) {\r\n\t\t\t\tif( isEmptyTile( row, column ) ) {\r\n\t\t\t\t\t$( '#tile' + row + column ).empty();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$( '#tile' + row + column ).empty().text( table[ row ][ column ] );\r\n\t\t\t\t}\r\n\t\t\t\taddTileColour( row, column );\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "8eaa7dfbe15e083b25140010a6ab9505", "score": "0.64799446", "text": "function showTable() {\n\t\t\tvar tmplData = {\n\t\t\t\trows: tableData, \n\t\t\t\tshowTfoot: tableData === null\t\n\t\t\t};\n\t\t\teManager.trigger('cleanManagementBox');\n\t\t\ttemplates.render('table-content', tmplData, function(html) {\n\t\t\t\tvar $boxContent = $('#management-box ._box-content');\n\t\t\t\t$boxContent.append(html);\n\t\t\t\tconfigureSortTable();\n\t\t\t});\n\t\t\teManager.trigger('showManagementBox');\n\t\t}", "title": "" }, { "docid": "6f6dd7df96404dc61fb84f479d7d9621", "score": "0.64723814", "text": "function regenerateHTML() {\n // .html() is not replacing it properly\n $el.get(0).innerHTML = html;\n $el.find('.select select').fae_chosen();\n Fae.tables.rowSorting();\n Fae.navigation.fadeNotices();\n\n if ($el.find('.js-content-header').length) {\n Fae.navigation.stickyHeaders(true);\n }\n }", "title": "" }, { "docid": "8ac86355ecbaf7028d1aa37938416830", "score": "0.64316934", "text": "function render_page()\n{\n completed_task_counter = 0;\n //For rerendering the todo list table contents\n //alert(\"Refreshing the page!\");\n\n //remove all stuff showing up on the tbody\n $(\"tbody\").remove();\n\n // First check if a <tbody> tag exists, add one if not\n if ($(\"#tasks tbody\").length == 0) \n {\n $(\"#tasks\").append(\"<tbody></tbody>\");\n }\n\n for(var i = 0; i < tasks.length; i++)\n {\n //tasks should only be displayed if they are not deleted\n if(tasks[i].deleted === false)\n {\n\n //temp variables used to store the temporary display of certain data\n var dueDate = null;\n var createdDate = null;\n var completeDate = null;\n var title = null;\n var note = tasks[i].note.replace(/<br\\s?\\/?>/g,\"\\n\");\n note = note.replace(/\\r\\n|\\r|\\n/g, \"%0D%0A\");\n var checkbox_status = null;\n var danger_or_success = null;\n\n //format title of task display whenever it is over 30 char long\n if(tasks[i].title !== null)\n {\n title = tasks[i].title;\n if(title.length >= 30)\n {\n //truncate and add ellipse...\n title = title.slice(0,30) + \"...\";\n }\n\n if(tasks[i].completed === true)\n {\n title = \"<del> \" + title + \"</del>\";\n }\n\n }\n\n else\n {\n title = \"\";\n }\n\n //If the checkbox is checked/ completed is true, then make sure we render that\n //format completed date display as long as the date is not null\n if(tasks[i].completed === true)\n {\n checkbox_status = \"checked\";\n danger_or_success = \"success\";\n completed_task_counter++;\n }\n\n else if(tasks[i].completed === false )\n { \n if(tasks[i].dueDate === null)\n {\n checkbox_status = \" \";\n danger_or_success = \"danger\";\n }\n\n else if(tasks[i].dueDate < new Date() )\n {\n checkbox_status = \" \";\n danger_or_success = \"danger\";\n }\n \n }\n\n else\n {\n checkbox_status = \" \";\n danger_or_success = \" \";\n }\n\n //format created date display as long as the date is not null\n if(tasks[i].createdDate !== null)\n {\n createdDate = tasks[i].createdDate.formatMMDDYYYY();\n // tasks[i].createdDate = createdDate;\n }\n\n else\n {\n createddate = \"\";\n }\n \n //format due date display as long as the date is not null\n if(tasks[i].dueDate !== null)\n {\n dueDate = tasks[i].dueDate.formatMMDDYYYY();\n }\n\n else\n {\n dueDate = \"\";\n }\n\n //format completed date display as long as the date is not null\n if(tasks[i].completeDate !== null)\n {\n completeDate = tasks[i].completeDate.formatMMDDYYYY();\n }\n\n else\n {\n completeDate = \"\";\n }\n\n\n // Append content from task array to the table by using a loop\n $(\"tbody\").append(\n \"<tr id = \" + tasks[i].id + \" class = \" + danger_or_success + \" >\" +\n \"<td class = 'text-center'> <input type= 'checkbox' class='form-check-input' value=\" + tasks[i].id + \" \" + checkbox_status + \" >\" + \"</td>\" +\n \"<td class = 'text-center'>\" + title + \"</td>\" +\n \"<td class = 'text-center'> <span class = 'text-right'> <button class='btn btn-xs btn-warning' data-toggle='collapse' data-target= #note-\" + tasks[i].id + \"> <span class='glyphicon glyphicon-triangle-bottom'> </span> Note</button></span> </td>\" +\n \"<td class = 'text-center'>\" + dueDate + \"</td>\" +\n \"<td class = 'text-center'>\" + completeDate + \"</td>\" +\n \"<td class = 'text-center'> <button type= 'button' class='btn btn-danger btn-xs deletetask' alt='Delete the task' value=\" + tasks[i].id + \"><span class='glyphicon glyphicon-trash'></span></button> <a target='_blank' href='mailto:?body=\" + note + \"&amp;subject=\" + tasks[i].title + \"'><button type='button' class='btn btn-danger btn-xs emailtask' alt='Send an email' value=\" + tasks[i].id + \"><span class='glyphicon glyphicon-envelope'></span></button></a> </td>\" +\n \"</tr>\" +\n \"<tr id = note-\" + tasks[i].id + \" class = \" + \"collapse\" + \">\" +\n \"<td></td>\" +\n \"<td colspan = 5>\" +\n \"<div class = 'well'>\" +\n \"<h3>\" + tasks[i].title + \"</h3>\" +\n \"<div>\" + tasks[i].note + \"</div>\" +\n \"</div>\" +\n \"</td>\" +\n \"</tr>\"\n );\n }\n }\n\n if(completed_task_counter === 0)\n {\n $(\"#deleteCompletedTasks\").prop('disabled', true);\n }\n\n else if(completed_task_counter > 0)\n {\n $(\"#deleteCompletedTasks\").prop('disabled', false);\n }\n\n page_operations();\n}", "title": "" }, { "docid": "59fca3c580a852a8df3b46619cef0454", "score": "0.63999385", "text": "function refresh_data(){\n ufo_table_body.html(\"\");\n tableData.forEach(\n (sighting) =>{\n let dataRow = ufo_table_body.append(\"tr\");\n dataRow.append(\"td\").text(sighting.datetime);\n dataRow.append(\"td\").text(sighting.city);\n dataRow.append(\"td\").text(sighting.state);\n dataRow.append(\"td\").text(sighting.country);\n dataRow.append(\"td\").text(sighting.shape);\n dataRow.append(\"td\").text(sighting.durationMinutes);\n dataRow.append(\"td\").text(sighting.comments);\n });\n}", "title": "" }, { "docid": "cd99650ea725dc5ac49219896dea3819", "score": "0.6371782", "text": "function renderTable(renderHTML) {\n $('#table-placeholder').empty().append(renderHTML);\n doSortingTable();\n }", "title": "" }, { "docid": "55dba95d689adb0cdbe728d52db31852", "score": "0.63693327", "text": "function redrawSummaryTransTable()\n {\n document.getElementById(panelName + \"_TransSummaryTableModule\").innerHTML = transSummaryTable.toHTML();\n }", "title": "" }, { "docid": "0a2bb86993dbb1bdfe5a9dfd27e209ec", "score": "0.6324272", "text": "function updateStructure(){\n var table = document.getElementById(\"structureTestFeedback\");\n table.innerHTML = \"\";\n var header = createChild(table, \"tr\");\n createChild(header, \"th\", \"Requirement\");\n createChild(header, \"th\", \"Result\");\n for( var i = 0; i < structureTestSelections.length; i++){\n var pass = checkStructure(editorCode, structureTestSelections[i]);\n var row = createChild(table, \"tr\");\n var message = structureTestText[i];\n createChild(row, \"td\", message);\n if(pass){ \n createChild(row, \"td\", \"<img src='Hopper-Jumping.png' alt= 'success' style='width:30px; height:30px;'>\");\n } else {\n createChild(row, \"td\", \"<img src='OhNoes.png' alt= 'fail' style='width:30px; height:30px;'>\");\n }\n }\n}", "title": "" }, { "docid": "ccde3937ee20d2e9c3895ce101b9997c", "score": "0.63102424", "text": "function updateStatus(){\n\t\t\t\n\t\t\trow=1;\n\t\t\t\n\t\t\t$status = $('#'+statusId).text(\"\").append(\"<p>Filled:</p><ul>\");\n\t\t\t$('#'+options.htmlId+' tr').each(function(){\n\t\t\t\t\n\t\t\t\tif($(this).find('td.filled').length > 0){\n\t\t\t\t\n\t\t\t\t\ttext = \"<li>Row #\"+row+\": \"+ $(this).find('td.filled').length+\"</li>\";\n\t\t\t\t\t\n\t\t\t\t\t$status.append(text);\n\t\t\t\t}\n\t\t\t\trow++;\n\t\t\t});\n\t\t\t$status.append('</ul>');\n\t\t}", "title": "" }, { "docid": "b618441bec8f8d346379015680091b7a", "score": "0.6302023", "text": "function renderTable() {\r\n $tbody.innerHTML = \"\";\r\n for (i = 0; i < filtered_data.length; i++) {\r\n // Get current ufo info object and its fields\r\n info = filtered_data[i];\r\n fields = Object.keys(info);\r\n // Create a new row in the tbody\r\n $row = $tbody.insertRow(i);\r\n for (j = 0; j < fields.length; j++) {\r\n // For every field in info object, create new cell and set its inner\r\n // text to be the current value at the current info field\r\n field = fields[j];\r\n $cell = $row.insertCell(j);\r\n $cell.innerText = info[field];\r\n }\r\n }\r\n}", "title": "" }, { "docid": "b8fe32c8ec5c99144c02bedf2af941f5", "score": "0.629058", "text": "function buildHtmlForUserTable()\r\n{\r\n\tif (ArrayUserData.responseText != 'noDatabase')\r\n\t{\r\n\t\tvar strHtml = '';\r\n\t\tfor (var i = 0; i < ArrayUserData.length; i++)\r\n\t\t{\r\n\t\t\tstrHtml += buildOneRow(i);\r\n\t\t}\r\n\t\tdocument.getElementById('UserTable').innerHTML = strHtml;\r\n\t\tchangeLanguage();\r\n\t}\r\n\telse\r\n\t{\r\n\t\t// DB nicht erreichbar - überleg dir was\r\n\t}\r\n}", "title": "" }, { "docid": "c1506418201ffd7f25c743dcdc8ed011", "score": "0.6287531", "text": "function updateVenuesTable() {\r\n\t$.getJSON(baseUrl + '/venues', (data) => {\r\n\t \tconsole.log(\"\\n updateVenuesTable\");\r\n\t\tconsole.log(data);\r\n\r\n\t\t//update html\r\n\t\t//delete existing table\r\n\t\t$(\"#venue_rows\").html(\"\");\r\n\t\t//rebuild venues\r\n\t\tvar venues = data.venues;\r\n\t\tfor (venue_id in venues) {\r\n\t\t\tvar venue = venues[venue_id];\r\n\t\t\taddVenueToTable(venue_id, venue);\r\n\t\t}\r\n\t});\r\n\r\n\t//scroll to venue table\r\n\t$('html, body').animate({\r\n\t\tscrollTop: $(\"#venue_table\").offset().top\r\n\t}, 700);\r\n}", "title": "" }, { "docid": "057ed1342d0194e4a8bc2e42a7546a27", "score": "0.6282369", "text": "function buildTable(data){\r\n // First, clear out any existing data\r\n tbody.html(\"\");\r\n}", "title": "" }, { "docid": "bf7691a00e3726d7c7b13ca2937a5f55", "score": "0.6255629", "text": "function updatePage(){\n updDocAttr('STR');\n updDocAttr('CON');\n updDocAttr('DEX');\n updDocAttr('SPD');\n updDocAttr('LK');\n updDocAttr('IQ');\n updDocAttr('WIZ');\n updDocAttr('CHR');\n document.getElementById(\"pa\").innerText = mychara.adds();\n document.getElementById(\"lvl\").innerText = mychara.level();\n document.getElementById(\"gold\").innerText = mychara.gold;\n document.getElementById(\"combatdamage\").innerText = mychara.damageDice() + \"d6 + \" + mychara.damageAdds();\n $('#equippedweapons').empty();\n for (var i = 0; i < mychara.equippedweapons.length; i++){\n var row = $('<tr></tr>');\n var w = mychara.equippedweapons[i];\n row.append($('<td></td>').text(w.name));\n row.append($('<td></td>').text(w.d6 + 'D6 + ' + (w.adds)));\n $('#equippedweapons').append(row);\n //alert(weapons[weapon].d6);\n }\n}", "title": "" }, { "docid": "c2a27b899031d3373d85f3579fe25612", "score": "0.6255417", "text": "function renderTable(){\n let birthdays = getModel();\n \n // clear table == delete old table body and create new\n var table = document.getElementById(\"birthdayRecords\");\n \n var old_tbody = table.getElementsByTagName(\"tbody\")[0];\n old_tbody.remove();\n \n // generate from new\n var rows_num = birthdays.length;\n var new_tbody = document.createElement('tbody');\n \n if(rows_num > 0){ \n var new_row = \"\";\n for(var i=0; i<rows_num; i++){\n new_row = generate_row(birthdays[i], new_tbody);\n new_tbody.appendChild(new_row);\n }\n table.appendChild( new_tbody );\n }else{\n var nodata_row = '<tr><td colspan=\"4\">input birthdates of your friends and loved ones &#127752;</td></tr>';\n table.insertAdjacentHTML( 'beforeend', nodata_row );\n }\n\n}", "title": "" }, { "docid": "2129341ca1cd72ce98c895ac9983c179", "score": "0.62524617", "text": "function showUpdatedRow(position , task , mentor , date){\n \t\n\t let tbody = document.getElementById(\"tableList\");\n\n\t tbody.rows[position - 1].cells[0].innerHTML = task ;\n\t tbody.rows[position - 1].cells[1].innerHTML = mentor ;\n\t tbody.rows[position - 1].cells[2].innerHTML = date ;\n\n\n }", "title": "" }, { "docid": "83a9827b127f17e63b40c6ed2701e197", "score": "0.62448615", "text": "function renderWatchTable() {\n var watchingTbodyEl = $(\"#watching tbody\");\n watchingTbodyEl.text(\"\"); // Clear watching table\n\n if (watchList.length === 0) {\n // Show message in table body saying \"You're not currently watching any currencies.\"\n watchingTbodyEl.html(\n \"<tr class='table-empty-msg'><td>You're not currently watching any currencies.</td></tr>\");\n return;\n }\n\n // Show message saying \"updating watch list\"\n watchingTbodyEl.html(\n \"<tr class='table-empty-msg'><td>Updating prices...</td></tr>\");\n\n var symList = \"\";\n for (var i = 0; i < watchList.length; i++) {\n symList += watchList[i].symbol;\n if (i !== watchList.length-1) {\n symList += \",\"\n }\n }\n\n // Submit an API request to get the most recent price for all watched currencies and draw\n // table rows with these prices\n $.ajax({\n url: `https://min-api.cryptocompare.com/data/pricemulti?fsyms=${symList}&tsyms=USD`,\n method: \"GET\"\n }).then(function(response) {\n watchingTbodyEl.html(\"\");\n for (var i = 0; i < watchList.length; i++) {\n var newTableRow = $(\"<tr>\");\n var symbol = watchList[i].symbol;\n newTableRow.attr(\"data-crypto-id\", watchList[i].id);\n newTableRow.append($(\"<td>\").text(symbol), $(\"<td>\").text(watchList[i].name),\n $(\"<td>\").text(response[symbol].USD));\n watchingTbodyEl.append(newTableRow);\n }\n });\n\n watchingTbodyEl.click(function (event) {\n var target = $(event.target);\n if (target.prop(\"tagName\").toLowerCase() === \"td\") {\n showChartArea(event);\n }\n });\n }", "title": "" }, { "docid": "7e5b2299972c2a0aaa3075cda158f65a", "score": "0.62412953", "text": "function loadTable(data, status)\n {\n \t$(\"#output\").html(data);\n }", "title": "" }, { "docid": "ce7845b0892c7b279ea60d7657a7c8a4", "score": "0.6228748", "text": "updateTable() {\n const datasets = this.beforeUpdateTable();\n if (!datasets) {\n return;\n }\n\n datasets.forEach(item => {\n this.$outputList.append(this.config.templates.tableRow(this, item));\n });\n\n // add summations to show up as the bottom row in the table\n const sum = datasets.reduce((a,b) => a + b.sum, 0);\n let totals = {\n label: $.i18n('num-projects', this.formatNumber(datasets.length), datasets.length),\n sum,\n average: Math.round(sum / (datasets[0].data.filter(el => el !== null)).length),\n };\n ['pages', 'articles', 'edits', 'images', 'users', 'activeusers', 'admins'].forEach(type => {\n totals[type] = datasets.reduce((a, b) => a + b[type], 0);\n });\n this.$outputList.append(this.config.templates.tableRow(this, totals, true));\n\n $('.table-view').show();\n }", "title": "" }, { "docid": "f3a06ddeefb825a4e3ef21048b35fd93", "score": "0.6222966", "text": "function refreshTableInfo() {\n\tvar html = '<table id=\"tableinfo\" width=\"100%\">';\n\thtml += '<thead style=\"background-color: #BBBBBB; cursor: pointer;\">';\n\thtml += '<td onclick=\"setASC_DESC(\\'0\\');sortTable(\\'tableinfo\\',\\'0\\');\">ICAO</td>';\n\thtml += '<td onclick=\"setASC_DESC(\\'1\\');sortTable(\\'tableinfo\\',\\'1\\');\">Flight</td>';\n\thtml += '<td onclick=\"setASC_DESC(\\'2\\');sortTable(\\'tableinfo\\',\\'2\\');\" ' +\n\t 'align=\"right\">Squawk</td>';\n\thtml += '<td onclick=\"setASC_DESC(\\'3\\');sortTable(\\'tableinfo\\',\\'3\\');\" ' +\n\t 'align=\"right\">Altitude</td>';\n\thtml += '<td onclick=\"setASC_DESC(\\'4\\');sortTable(\\'tableinfo\\',\\'4\\');\" ' +\n\t 'align=\"right\">Speed</td>';\n\thtml += '<td onclick=\"setASC_DESC(\\'5\\');sortTable(\\'tableinfo\\',\\'5\\');\" ' +\n\t 'align=\"right\">Track</td>';\n\thtml += '<td onclick=\"setASC_DESC(\\'6\\');sortTable(\\'tableinfo\\',\\'6\\');\" ' +\n\t 'align=\"right\">Msgs</td>';\n\thtml += '<td onclick=\"setASC_DESC(\\'7\\');sortTable(\\'tableinfo\\',\\'7\\');\" ' +\n\t 'align=\"right\">Seen</td></thead><tbody>';\n\tfor (var tablep in Planes) {\n\t\tvar tableplane = Planes[tablep]\n\t\tif (!tableplane.reapable) {\n\t\t\tvar specialStyle = \"\";\n\t\t\t// Is this the plane we selected?\n\t\t\tif (tableplane.icao == SelectedPlane) {\n\t\t\t\tspecialStyle += \" selected\";\n\t\t\t}\n\t\t\t// Lets hope we never see this... Aircraft Hijacking\n\t\t\tif (tableplane.squawk == 7500) {\n\t\t\t\tspecialStyle += \" squawk7500\";\n\t\t\t}\n\t\t\t// Radio Failure\n\t\t\tif (tableplane.squawk == 7600) {\n\t\t\t\tspecialStyle += \" squawk7600\";\n\t\t\t}\n\t\t\t// Emergancy\n\t\t\tif (tableplane.squawk == 7700) {\n\t\t\t\tspecialStyle += \" squawk7700\";\n\t\t\t}\n\t\t\t\n\t\t\tif (tableplane.vPosition == true) {\n\t\t\t\thtml += '<tr class=\"plane_table_row vPosition' + specialStyle + '\">';\n\t\t\t} else {\n\t\t\t\thtml += '<tr class=\"plane_table_row ' + specialStyle + '\">';\n\t\t }\n\t\t \n\t\t\thtml += '<td>' + tableplane.icao + '</td>';\n\t\t\thtml += '<td>' + tableplane.flight + '</td>';\n\t\t\tif (tableplane.squawk != '0000' ) {\n \t\t\thtml += '<td align=\"right\">' + tableplane.squawk + '</td>';\n \t } else {\n \t html += '<td align=\"right\">&nbsp;</td>';\n \t }\n \t \n \t if (Metric) {\n \t\t\thtml += '<td align=\"right\">' + Math.round(tableplane.altitude / 3.2828) + '</td>';\n \t\t\thtml += '<td align=\"right\">' + Math.round(tableplane.speed * 1.852) + '</td>';\n \t } else {\n \t html += '<td align=\"right\">' + tableplane.altitude + '</td>';\n \t html += '<td align=\"right\">' + tableplane.speed + '</td>';\n \t }\n\t\t\t\n\t\t\thtml += '<td align=\"right\">';\n\t\t\tif (tableplane.vTrack) {\n \t\t\t html += normalizeTrack(tableplane.track, tableplane.vTrack)[2];\n \t\t\t // html += ' (' + normalizeTrack(tableplane.track, tableplane.vTrack)[1] + ')';\n \t } else {\n \t html += '&nbsp;';\n \t }\n \t html += '</td>';\n\t\t\thtml += '<td align=\"right\">' + tableplane.messages + '</td>';\n\t\t\thtml += '<td align=\"right\">' + tableplane.seen + '</td>';\n\t\t\thtml += '</tr>';\n\t\t}\n\t}\n\thtml += '</tbody></table>';\n\n\tdocument.getElementById('planes_table').innerHTML = html;\n\n\tif (SpecialSquawk) {\n \t$('#SpecialSquawkWarning').css('display', 'inline');\n } else {\n $('#SpecialSquawkWarning').css('display', 'none');\n }\n\n\t// Click event for table\n\t$('#planes_table').find('tr').click( function(){\n\t\tvar hex = $(this).find('td:first').text();\n\t\tif (hex != \"ICAO\") {\n\t\t\tselectPlaneByHex(hex);\n\t\t\trefreshTableInfo();\n\t\t\trefreshSelected();\n\t\t}\n\t});\n\n\tsortTable(\"tableinfo\");\n}", "title": "" }, { "docid": "8bb3826eb50fe60aa4775d19fdf86f4a", "score": "0.6218486", "text": "function updateDisplay() {\n var updateEls;\n updateEls = $('[data-update]');\n updateEls.each(function() {\n $(this).html(viewData[$(this).data('update')]);\n });\n }", "title": "" }, { "docid": "2bc454ac89a4c2ddbeb3b492d487f75c", "score": "0.62121826", "text": "function updateBookedAppointmentsView() {\n // Clean the table view\n cleanUpHTMLTable(viewBookedAppointmentsTable);\n // Reload with the current values of booked appointments.\n for (var i = 0; i < bookedAppointments.length; i++) {\n // Updating the HTML view\n var row = viewBookedAppointmentsTable.insertRow(viewBookedAppointmentsTable.rows.length);\n // Creating objs cells elements in the row created above\n var idCol = row.insertCell(IDENTIFIER);\n var nameGpCol = row.insertCell(GPNAME);\n var dateCol = row.insertCell(DATEAPPOINTMENT);\n var timeCol = row.insertCell(TIMEAPPOINTMENT);\n // Inserting the inputted values into the View HTML table\n idCol.innerHTML = String(bookedAppointments[i].id);\n idCol.id = String(bookedAppointments[i].id); // define the Primary Key for the table of appointments\n nameGpCol.innerHTML = String(bookedAppointments[i].GpName);\n dateCol.innerHTML = bookedAppointments[i].dateAppointment.toLocaleDateString();\n timeCol.innerHTML = String(bookedAppointments[i].time);\n //Adding options of updating or deleting the new row added.\n addCancelOption(viewBookedAppointmentsTable, viewBookedAppointmentsTable.rows.length - 1);\n }\n}", "title": "" }, { "docid": "2aa985e97b851b1240a041691e83996e", "score": "0.6210626", "text": "function updateData(html, paginator){\n $('#mytbody').html(html);\n $('#my-paginator').html(paginator);\n}", "title": "" }, { "docid": "d6d3549638dcc16013689af9e5c6fcdb", "score": "0.6201153", "text": "updateTable() {\n\t\tthis.manager.get(\"WWSUanimations\").add(\"inventory-update-table\", () => {\n\t\t\tif (this.table) {\n\t\t\t\tthis.table.clear();\n\t\t\t\tthis.find().forEach((item) => {\n\t\t\t\t\tthis.table.row.add([\n\t\t\t\t\t\titem.ID,\n\t\t\t\t\t\titem.name,\n\t\t\t\t\t\t`${item.make ? item.make : `Unknown`} / ${\n\t\t\t\t\t\t\titem.model ? item.model : `Unknown`\n\t\t\t\t\t\t}`,\n\t\t\t\t\t\t`${item.location}${\n\t\t\t\t\t\t\titem.subLocation ? ` / ${item.subLocation}` : ``\n\t\t\t\t\t\t}`,\n\t\t\t\t\t\titem.quantity,\n\t\t\t\t\t\tthis.generateConditionProgress(item.condition),\n\t\t\t\t\t\t`<div class=\"btn-group\"><button class=\"btn btn-sm btn-primary btn-inventory-checkout\" data-id=\"${item.ID}\" title=\"Check In / Check Out, and view check-in / check-out history.\"><i class=\"fas fa-clipboard-check\"></i></button><button class=\"btn btn-sm btn-warning btn-inventory-edit\" data-id=\"${item.ID}\" title=\"Edit Inventory Item\"><i class=\"fas fa-edit\"></i></button><button class=\"btn btn-sm btn-danger btn-inventory-delete\" data-id=\"${item.ID}\" title=\"Remove Inventory Item\"><i class=\"fas fa-trash\"></i></button></div>`,\n\t\t\t\t\t]);\n\t\t\t\t});\n\t\t\t\tthis.table.draw();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "235e0f6b35382c1487ad049ef300f173", "score": "0.61950344", "text": "function update_html()\n{\n\tvar s =\n\tw3_div('id-update w3-hide',\n\t\t'<hr>' +\n\t\tw3_div('id-msg-update w3-container') +\n\n\t\t'<hr>' +\n\t\tw3_div('w3-margin-bottom',\n w3_half('w3-container', 'w3-text-teal',\n\t\t\t\tw3_div('',\n '<b>Automatically check for software updates?</b> ' +\n w3_switch('', 'Yes', 'No', 'adm.update_check', adm.update_check, 'admin_radio_YN_cb')\n ),\n\t\t\t\tw3_div('',\n '<b>Automatically install software updates?</b> ' +\n w3_switch('', 'Yes', 'No', 'adm.update_install', adm.update_install, 'admin_radio_YN_cb')\n )\n ),\n w3_half('w3-container', 'w3-text-teal',\n w3_div('',\n w3_select('w3-label-inline', 'After update', '', 'adm.update_restart', adm.update_restart, update_restart_u, 'admin_select_cb')\n ),\n ''\n )\n\t\t) +\n\n\t\t'<hr>' +\n\t\tw3_half('w3-container', 'w3-text-teal',\n\t\t\tw3_div('w3-valign',\n\t\t\t\t'<b>Check for software update </b> ' +\n\t\t\t\tw3_button('w3-aqua w3-margin', 'Check now', 'update_check_now_cb')\n\t\t\t),\n\t\t\tw3_div('w3-valign',\n\t\t\t\t'<b>Force software build </b> ' +\n\t\t\t\tw3_button('w3-aqua w3-margin', 'Build now', 'update_build_now_cb')\n\t\t\t)\n\t\t) +\n\n\t\t'<hr>' +\n\t\tw3_half('w3-margin-bottom w3-text-teal w3-restart', 'w3-container',\n w3_divs('w3-tspace-8',\n w3_div('', '<b>Disable recent changes?</b>'),\n w3_switch('', 'Yes', 'No', 'disable_recent_changes', cfg.disable_recent_changes, 'admin_radio_YN_cb'),\n w3_text('w3-text-black', 'Currently:<br><ul><li>The Firefox audio hang workaround.</li></ul>')\n ),\n ''\n ) +\n\n\t\t'<hr>' +\n\t\tw3_div('w3-container', 'TODO: alt github name') +\n\t\t'<hr>'\n\t);\n\treturn s;\n}", "title": "" }, { "docid": "bbca76580f660e010875f5f5e35e475b", "score": "0.61931705", "text": "function updateTable(selectedData){\n tbody.html(\"\");\n selectedData.forEach((ufoSightings)=>{\n var row = tbody.append(\"tr\");\n Object.entries(ufoSightings).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "2372c4ea944fe252533e1b46f6eb78de", "score": "0.61921", "text": "function update_view_staff(){\n //clear_view_staff();\n\n setStaff(modeHtmlId+staff);\n setAllTableItems();\n setTotalPriceTable();\n\n for(i = 0; i < getNumTables(); i++){\n tableNr++;\n tableid = getTableId(i);\n setTable(tableid);\n }\n\n setCheckout();\n update_view_dictionary();\n}", "title": "" }, { "docid": "487748495c6a9837e89a9e0ad70a4b6e", "score": "0.6181078", "text": "function updateTable(data) {\n let tbody = document.getElementById('tbody');\n let content = ``;\n for (let i = 0; i < data.observations.length; i++) {\n let obs = data.observations[i];\n content += `<tr><td>${obs.sensor_path}</td><td>${obs.value}</td><td>${obs.uom}</td></tr>`;\n }\n tbody.innerHTML =content;\n }", "title": "" }, { "docid": "1ec07ca6505b38b1292fba283a60938e", "score": "0.6176487", "text": "function updateTable(){\n $('table tr[class!=\"keepbits\"]').remove();\n $('#tableTrickA').text(trickA.label);\n $('#tableTrickB').text(trickB.label);\n for(var i = 0; i < diceMax; i++){\n dataTable.append(\n '<tr><th>'\n + (i+1)\n + '</th><td>'\n + Math.round(trickA.data[i] * 100) / 100\n + ' <span class=\"uncertainty\">±'\n + Math.round(trickA.stdev * Math.sqrt(i+1) * 100) / 100\n + '</span></td><td>'\n + Math.floor(trickB.data[i] * 100) / 100\n + ' <span class=\"uncertainty\">±'\n + Math.round(trickB.stdev * Math.sqrt(i+1) * 100) / 100\n + '</span></td></tr>');\n }\n }", "title": "" }, { "docid": "739d95eb11077213bd82dc514bebee79", "score": "0.6174361", "text": "function updateHTML() {\n element.innerHTML = formatter(currentValue);\n }", "title": "" }, { "docid": "d920d9a7ad1e988c40afa8f9f6c4e800", "score": "0.6173442", "text": "function updateHTML(){\n\t \t$(\".panel-body\").text(tempObject.question);\n\n\t \t$(\"#wins\").text(wins);\n\t \t$(\"#losses\").text(losses);\n\t }", "title": "" }, { "docid": "ab726195379646dd1022c24ccf9ba8fb", "score": "0.61729085", "text": "function updateTable() {\n $(\"#trashTable\").append(\"<tr><td id='date'>\" + date + \"</td><td id='time'>\" + time + \"</td><td id='point'>\" +\n point + \"</td><td id='user'>\" + user + \"</td></td>\");\n}", "title": "" }, { "docid": "657c4b59103595eed61964a2f8181b65", "score": "0.61705226", "text": "function update() {\n\tcollect_data_table();\n\tcompute_data_table();\n\tdisplay_data_table();\n\tupdate_efficiency_plot();\n\tupdate_distribution_plot();\n}", "title": "" }, { "docid": "b33d6b887d5fc3c62189d381b84ac624", "score": "0.616072", "text": "function updateTable(data) {\n\t\t\t//finding updated table and album\n\t\t\tvar $table = $('.table.' + data.userId)\n\t\t\tvar $album = $('.row.album.' + data.id)\n\t\t\t//appending the album to the new table\n\t\t\t$table.append($album);\n\t\t\t//make this album appear since we hide it to perform ajax operation\n\t\t\t$album.fadeIn();\n\t\t}", "title": "" }, { "docid": "f3dc4a2c65ab0f26f695ef3916b39c4f", "score": "0.6136329", "text": "function updateDOM() {\n // Check localStorage once\n if (!updatedOnLoad) getSavedColumns();\n\n // Backlog Column\n backlogList.textContent = \"\";\n backlogListArray.forEach((backlogItem, index) => {\n createItemElements(backlogList, 0, backlogItem, index);\n });\n backlogListArray = filterArray(backlogListArray);\n\n // Progress Column\n progressList.textContent = \"\";\n progressListArray.forEach((progressItem, index) => {\n createItemElements(progressList, 1, progressItem, index);\n });\n progressListArray = filterArray(progressListArray);\n\n // Complete Column\n completeList.textContent = \"\";\n completeListArray.forEach((completeItem, index) => {\n createItemElements(completeList, 2, completeItem, index);\n });\n completeListArray = filterArray(completeListArray);\n\n // On Hold Column\n onHoldList.textContent = \"\";\n onHoldListArray.forEach((onHoldItem, index) => {\n createItemElements(onHoldList, 3, onHoldItem, index);\n });\n onHoldListArray = filterArray(onHoldListArray);\n\n // Run getSavedColumns only once, Update Local Storage\n updatedOnLoad = true;\n updateSavedColumns();\n}", "title": "" }, { "docid": "08a21d67edf2d0d948d89b809e6a55de", "score": "0.61322325", "text": "function updateTable() {\n\t$.get(\"/EmployeeList\", function (data) {\n\t\ttable.clear();\n\t\t$.each(data, function (i, employee) {\n\t\t\ttable.row.add(createRow(employee)).draw();\n\t\t});\n\t});\n}", "title": "" }, { "docid": "4dc695153dff9d4e650a7c1294407301", "score": "0.61194265", "text": "function render(data) {\r\n\t\t\t\tvar tabela = $('#tableDiv').append(\r\n\t\t\t\t\t\t$('<table></table>').attr(\"id\", \"tabela\"));\r\n\t\t\t\tvar tHead = \"<thead id='tableHead'></thead>\";\r\n\t\t\t\t$('#tabela').append(tHead);\r\n\t\t\t\tvar rowH = \"<tr> \" + \"<th>ID</th>\" + \"<th>Cidade</th>\"\r\n\t\t\t\t\t\t+ \"<th>Estado</th>\" + \"<th>Status</th>\"\r\n\t\t\t\t\t\t+ \"<th>Actions</th>\" + \"</tr>\";\r\n\t\t\t\t$('#tableHead').append(rowH);\r\n\r\n\t\t\t\t$('#tabela').append(\r\n\t\t\t\t\t\t$('<tbody></tbody>').attr(\"id\", \"tabelaBody\"));\r\n\r\n\t\t\t\t$.each(data,\r\n\t\t\t\t\t\t\t\tfunction(index, value) {\r\n\r\n\t\t\t\t\t\t\t\t\tvar td = $(\"<tr id= 'row\" + index + \"'>\"\r\n\t\t\t\t\t\t\t\t\t\t\t+ \"</tr>\");\r\n\r\n\t\t\t\t\t\t\t\t\tvar row1 = $(\"<td>\" + value.idCidade\r\n\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\");\r\n\r\n\t\t\t\t\t\t\t\t\tvar row2 = $(\"<td>\" + value.nomeCidade\r\n\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\");\r\n\r\n\t\t\t\t\t\t\t\t\tvar row3 = $(\"<td>\"\r\n\t\t\t\t\t\t\t\t\t\t\t+ value.idEstado.siglaEstado\r\n\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\");\r\n\r\n\t\t\t\t\t\t\t\t\tvar row4 = $(\"<td>\" + value.statusCidade\r\n\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\");\r\n\r\n\t\t\t\t\t\t\t\t\t// Efetua A Funcao Ao Clicar No Botao\r\n\t\t\t\t\t\t\t\t\t// btn-update\r\n\t\t\t\t\t\t\t\t\tvar buttonUpdate = $(\r\n\t\t\t\t\t\t\t\t\t\t\t'<button>Modificar</button>').attr(\r\n\t\t\t\t\t\t\t\t\t\t\t\"id\", \"btn-update-\" + index).click(\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\tp1 : this\r\n\t\t\t\t\t\t\t\t\t\t\t}, setInputData);\r\n\r\n\t\t\t\t\t\t\t\t\tvar buttonRemove = $(\r\n\t\t\t\t\t\t\t\t\t\t\t'<button>Remover</button>').attr(\r\n\t\t\t\t\t\t\t\t\t\t\t\"id\", \"btn-remove-\" + index).click(\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\tp1 : this\r\n\t\t\t\t\t\t\t\t\t\t\t}, callRemoveServlet);\r\n\r\n\t\t\t\t\t\t\t\t\tvar row5 = $(\"<td></td>\");\r\n\t\t\t\t\t\t\t\t\trow5.append(buttonUpdate);\r\n\t\t\t\t\t\t\t\t\trow5.append(buttonRemove);\r\n\r\n\t\t\t\t\t\t\t\t\ttd.append(row1);\r\n\t\t\t\t\t\t\t\t\ttd.append(row2);\r\n\t\t\t\t\t\t\t\t\ttd.append(row3);\r\n\t\t\t\t\t\t\t\t\ttd.append(row4);\r\n\t\t\t\t\t\t\t\t\ttd.append(row5);\r\n\r\n\t\t\t\t\t\t\t\t\t$('#tabela tbody').append(td);\r\n\r\n\t\t\t\t\t\t\t\t\t$('#set').append('</tbody></table>');\r\n\t\t\t\t\t\t\t\t\t// Preenche O Select Estado\r\n\t\t\t\t\t\t\t\t\tgetEstados();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t})\r\n\r\n\t\t\t}", "title": "" }, { "docid": "da07170d869cddf6c0b3266f3ad24431", "score": "0.6118035", "text": "function show_table(){\n\n\n // *********** New Tag Creation *************\n New_Tag_Num = Creating_New_Tag();\n\n\n // *********** Table Creation *************\n var col_count = 0;\n var col = CAR_PRICE_LIST[col_count]; //price_start_value\n var Table_id = \"Comp-\" + New_Tag_Num ;\n //var tableData = \"<table id = 'comp-1'>\";\n var tableData = \"<table id = '\" + Table_id + \"'>\";\n\n // for loop for MPG price : MPG_PRICE_LIST\n for (var row_count = 0; row_count < MPG_PRICE_LIST.length; row_count++){\n row = MPG_PRICE_LIST[row_count];\n if (row == MPG_PRICE_LIST[0] && col == CAR_PRICE_LIST[0]) {\n tableData += \"<td>Price / Fuel Consumption</td>\";\n\n for (col_count; col_count < CAR_PRICE_LIST.length; col_count++) {\n col = CAR_PRICE_LIST[col_count];\n //Outputs the column values\n tableData += \"<td id = 'rowHeader'>\" + col + \"</td>\"; \n }\n tableData += \"<tr>\";\n }\n //Outputs the header row values\n tableData += \"<td id = 'colHeader'>\" + row + \"</td>\";\n for (col_count = 0; col_count < CAR_PRICE_LIST.length; col_count++) {\n col = CAR_PRICE_LIST[col_count];\n //Fills in the cells with the evaluated $/mile and $/month\n tableData += \"<td class = 'cells'>\" + calculate_cell(row , col) + \"</td>\";\n }\n tableData += \"</tr>\";\n }\n tableData += \"</table>\";\n\n //Dynamically displays the table out in the in the HTML document\n Content_Table_id = \"tab-\" + New_Tag_Num + \"-table\" ;\n //document.getElementById(\"tab-1-table\").innerHTML = tableData; \n document.getElementById(Content_Table_id).innerHTML = tableData; \n\n CAR_PRICE_LIST = []\n MPG_PRICE_LIST = []\n }", "title": "" }, { "docid": "f73597d6189fe83b6a3991b656c374eb", "score": "0.6111492", "text": "updateHtml() {\n\t\t$(this.lifesId).html(this.lifes);\n\t\t$(this.scoreId).html(this.score);\n\t}", "title": "" }, { "docid": "91a6c02700fcf48ce05929ed253c1961", "score": "0.61098707", "text": "function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < tableData.length; i++) {\n // Get get the current UFO object and its fields\n var ufo = tableData[i];\n var observations = Object.keys(ufo);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < observations.length; j++) {\n // For every observations in the ufo object, create a new cell at set its inner text to be the current value at the current ufo'sobservation\n var observation = observations[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = ufo[observation];\n }\n }\n}", "title": "" }, { "docid": "7e30a7f52329f631975a96ec26ddbabc", "score": "0.61082613", "text": "function readyTable() {\n $('#allalgstable').toggle();\n var algCount = algorithms.length;\n for(var i = 0 ; i < algCount ; i++) {\n var alg = algorithms[i];\n var img = '<img src=\"{0}\"/>'.format(alg.imgUrl);\n var text = '<b><a href=\"{0}\">{1}</a></b><br /><span>{2}</span>'.format(alg.wiki, alg.name, alg.alg);\n var row = '<tr><td>{0}</td><td>{1}</td></tr>'.format(img, text);\n $('#allalgstable').append(row);\n }\n}", "title": "" }, { "docid": "dfe5d34429dab57037cceff9b277768a", "score": "0.60885686", "text": "function updateTable(filtered_data) {\n //When the user submits, have the new information append to the table\n filtered_data.forEach(instance => {\n var row = tbody.append(\"tr\");\n Object.entries(instance).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n }); \n}", "title": "" }, { "docid": "acecd486121cbe773b3e4870ae501236", "score": "0.6084042", "text": "function table_load_html() {\n //\n if (this.async)\n this.table_load_html_ascy(this);\n else\n this.table_load_html_sync(this);\n\n }", "title": "" }, { "docid": "f2906f9330bf6f0e2bc243592d7532ee", "score": "0.60777986", "text": "function refresh() {\n\n var alertBtnText = ( listObj.is_alert == 1 ? 'Alert on' : 'Alert off');\n $('#button-toggle-alert').text(alertBtnText);\n $('#list-title').text(listObj.title); \n $('#input-max-spend').val(listObj.max_spend);\n $('#table-items').attr('data-list_id', listObj.id);\n\n // extract the items from the list object\n var items = [];\n\n // check that the listObj has an items property, if not exit.\n if (listObj.hasOwnProperty(\"items\")) {\n items = listObj.items;\n } else {\n return false;\n }\n\n // select table body element\n var tbodyEL = $('#table-items tbody');\n var tfootEL = $('#table-items tfoot');\n \n // clear table elements\n tbodyEL.html('');\n tfootEL.html('');\n\n // foreach list item, add it to the table\n $.each(items, function(i, item) {\n\n // if item is checked add class checked.\n var trClass = (item.is_checked == 1 ? 'class=\"checked\"' : '');\n \n tbodyEL.append('\\\n <tr ' + trClass + ' data-id=\"' + item.id +'\" data-position=\"'+ item.position +'\">\\\n <td><i class=\"glyphicon glyphicon-resize-vertical\"></i><input type=\"text\" class=\"name\" value=\"' + item.name + '\"></td>\\\n <td><input type=\"number\" step=\"any\" class=\"price\" value=\"' + item.price + '\"></td>\\\n <td>\\\n <button class=\"button-check\"><i class=\"glyphicon glyphicon-ok\"></i>Check</button>\\\n <button class=\"button-delete\"><i class=\"glyphicon glyphicon-trash\"></i>Delete</button>\\\n </td>\\\n </tr>\\\n '); \n });\n\n tfootEL.append('\\\n <tr>\\\n <th>Total:</th>\\\n <td><span id=\"output-total\"><span></td>\\\n </tr>\\\n ')\n\n // update the total and max_spend\n var total = calculateTotal();\n checkSpend(listObj.max_spend, total);\n}", "title": "" }, { "docid": "d767a25c55beeaf7779a6fef1046c60c", "score": "0.6064706", "text": "function updateDOM() { \n if(!updatedOnLoad){\n getSavedColumns();\n }\n\n\n // Coluna Backlog \n backlogList.textContent = '';\n backlogListArray.forEach((backlogItem, index) => {\n createItemEl(backlogList, 0, backlogItem, index);\n })\n backlogListArray = filterArray(backlogListArray);\n\n\n // Coluna Progress \n progressList.textContent = '';\n progressListArray.forEach((progressItem, index) => {\n createItemEl(progressList, 1, progressItem, index);\n })\n progressListArray = filterArray(progressListArray);\n\n\n // Coluna Complete \n completeList.textContent = '';\n completeListArray.forEach((completeItem, index) => {\n createItemEl(completeList, 2, completeItem, index);\n })\n completeListArray = filterArray(completeListArray);\n\n \n // Coluna On Hold \n onHoldList.textContent = '';\n onHoldListArray.forEach((onHoldItem, index) => {\n createItemEl(onHoldList, 3, onHoldItem, index);\n })\n onHoldListArray = filterArray(onHoldListArray);\n\n\n\n \n // Procuara por getSavedColumns apenas uma vez e atualiza o loacalStorage\n updatedOnLoad = true;\n updateSavedColumns();\n}", "title": "" }, { "docid": "eddf05c72525a7c92dbc9df978192be8", "score": "0.60495144", "text": "function appendtabledata(dbdata) {\n $(\"#showRecords\").html(' <table id=\"TableResults\" class=\"table table-bordered footable footable-1 footable-filtering footable-filtering-right footable-paging footable-paging-center breakpoint breakpoint-xs\" data-paging=\"true\" data-filtering=\"true\" data-sorting=\"true\" style=\"display: table;\"><thead><tr><th data-visible=\"true\">S/No:</th><th>SubPartner ID</th><th data-breakpoints=\"xs sm md\">Sub County Reg #</th><th data-breakpoints=\"xs\">MFL Code</th><th data-breakpoints=\"all\">Facility Name</th><th data-breakpoints=\"all\">ART Status</th><th data-breakpoints=\"all\">Sex</th><th data-breakpoints=\"all\">Age</th><th data-breakpoints=\"xs sm md\">Registration Date</th><th>Edit</th></tr></thead><tbody>' + dbdata + '</tbody></table>');\n $(document).ready(function () {\n $('.table').footable();\n });\n}", "title": "" }, { "docid": "dfa936be2db77ab7248d8d733e3af75f", "score": "0.60491914", "text": "function updateTable(value) {\n if (value) {\n $('#tableResult').removeClass('displayInvisible');\n } else {\n $('#tableResult').addClass('displayInvisible');\n $(\"#tableResult tbody tr\").remove();\n }\n}", "title": "" }, { "docid": "cf2673d8d1f078378d77cfb8166a1fe2", "score": "0.6044428", "text": "function updatePage() {\n\t// reset the drawing of the current tables\n\t$('#leftBoard').html(getBoardAsTable(leftBoard));\n\t$('#rightBoard').html(getBoardAsTable(rightBoard));\n\n\t// makes the boards display as squares\n\tvar cw = $('.board').width();\n\t$('.board').css({'height':cw+'px'});\n}", "title": "" }, { "docid": "c4b358139a03c3e0b71b5feb978d3980", "score": "0.60399204", "text": "function buildtable(data) {\n // to refresh the table, so filter data or changed data wouldn't populate on top of the older table\n tbody.html(\"\");\n data.forEach((item) => {\n // console.log(item)\n let row = tbody.append(\"tr\");\n let date = row.append(\"td\");\n let city = row.append(\"td\");\n let state = row.append(\"td\");\n let country = row.append(\"td\");\n let shape = row.append(\"td\");\n let duration = row.append(\"td\");\n let comments = row.append(\"td\");\n date.text(item.datetime);\n city.text(item.city);\n state.text(item.state);\n country.text(item.country);\n shape.text(item.shape);\n duration.text(item.durationMinutes);\n comments.text(item.comments);\n });\n}", "title": "" }, { "docid": "768fc1638655a029ec15d36a7cf351a5", "score": "0.6035118", "text": "function updateTable(artID, annID, cited) {\n\t\tvar save = '<i class=\"save-ann fa fa-floppy-o fa-lg\"></i>';\n\t\tvar del = '<i class=\"delete-annM delete-ann fa fa-times fa-lg\"></i>';\n\t\tvar savedel = '<td>' + save + '</td><td>' + del + '</td>';\n\t\tvar show = '<i class=\"show-ann fa fa-chevron-down\"></i>';\n\t\tif (cited) {\n\t\t\tvar newAnn = arrayNewResCited[artID][annID];\n\t\t\tvar oldAnn = arrayOldResCited[artID][annID];\n\t\t} else {\n\t\t\tvar newAnn = arrayNewRes[artID][annID];\n\t\t\tvar oldAnn = arrayOldRes[artID][annID];\n\t\t}\n\t\ttr = '<tr class=\"' + newAnn['type'] + '\" id=\"p' + artID + 'a' + annID + '\"></tr>';\n\t\t$(\"#modal-changes .not_annot\").hide();\n\t\t$(\"#modal-changes .table-edit-note\").show();\n\t\t$(\"#modal-changes .table-edit-note\").append(tr);\n\t\tvar row = $(\"#modal-changes .table-edit-note\").find('#p' + artID + 'a' + annID);\n\t\trow.nextUntil(\"tr.sup\").remove();\n\t\trow.addClass(\"sup\");\n\t\trow.html('<td>' + show + '</td><td>' + loadedArticles[artID - 1] + '</td><td>[' + newAnn.label + '] ' + newAnn.body.label + '</td>' + savedel + '</tr>');\n\t\trow.after('<tr class=\"sub\"><th>Campo</th><th>Valore salvato</th><th>Valore locale</th><th></th><th></th></tr>');\n\t\tvar subrow = row.next();\n\t\tsubrow.after('<tr class=\"sub\"><td>Label</td><td>' + oldAnn.body.label + '</td><td>' + newAnn.body.label + '</td><td></td><td>' + del + '</td></tr>');\n\t\tvar iterSubRow = subrow.next();\n\t\t//iterSubRow.after('<tr class=\"sub\"><td>Tipo</td><td>' + oldAnn.label + '</td><td>' + newAnn.label + '</td><td>' + del + '</td></tr>');\n\t\t//iterSubRow = iterSubRow.next();\n\t\tif (oldAnn.label == 'Autore' || oldAnn.label == 'Citazione') {\n\t\t\titerSubRow.after('<tr class=\"sub\"><td>' + oldAnn.label + '</td><td>' + oldAnn.body.resource.label + '</td><td>' + newAnn.body.resource.label + '</td><td></td><td>' + del + '</td></tr>');\n\t\t} else if (oldAnn.label == 'Retorica') {\n\t\t\titerSubRow.after('<tr class=\"sub\"><td>' + oldAnn.label + '</td><td>' + getRhetoricLabel(oldAnn.body.literal) + '</td><td>' + getRhetoricLabel(newAnn.body.literal) + '</td><td></td><td>' + del + '</td></tr>');\n\t\t} else {\n\t\t\titerSubRow.after('<tr class=\"sub\"><td>' + oldAnn.label + '</td><td>' + oldAnn.body.literal + '</td><td>' + newAnn.body.literal + '</td><td></td><td>' + del + '</td></tr>');\n\t\t}\n\t\titerSubRow = iterSubRow.next();\n\t iterSubRow.after('<tr class=\"sub\"><td>Target</td><td>' + oldAnn.target.id + '</td><td>' + newAnn.target.id + '</td><td></td><td>' + del + '</td></tr>');\n\t\titerSubRow = iterSubRow.next();\n\t\titerSubRow.after('<tr class=\"sub\"><td>Start</td><td>' + oldAnn.target.start + '</td><td>' + newAnn.target.start + '</td><td></td><td>' + del + '</td></tr>');\n\t\titerSubRow = iterSubRow.next();\n\t\titerSubRow.after('<tr class=\"sub\"><td>End</td><td>' + oldAnn.target.end + '</td><td>' + newAnn.target.end + '</td><td></td><td>' + del + '</td></tr>');\n\t\t\n\t\trow.nextUntil(\"tr.sup\").hide();\n\t\t$(\"#modal-changes .save-on-store\").removeAttr(\"disabled\");\n\t}", "title": "" }, { "docid": "a3d5f2522a0c98e5253a163d59a600cb", "score": "0.60343623", "text": "function displayInTable(datePosted, location, title, type, description, link) {\n \n if(userLoggedIn == true){\n var tablebody = $('<tr><td>' +\n \"<button class='btn btn-default btn-xs'><span class='glyphicon glyphicon-folder-open' id=\" + jobId + \" disabled></span></button>\" + '</td><td>' +\n datePosted + '</td><td>' +\n location + \"</td><td class='CellWithComment'>\" +\n title +\n \"<span class='CellComment'>\" + description + '</span></td><td>' +\n 'description </td><td>' +\n type + '</td><td>' +\n link + '</td><tr>');\n $(\"#tableBody\").append(tablebody);\n }else{\n var tablebody = $('<tr><td>'+\n datePosted + '</td><td>' +\n location + \"</td><td class='CellWithComment'>\" +\n title +\n \"<span class='CellComment'>\" + description + '</span></td><td>' +\n 'description </td><td>' +\n type + '</td><td>' +\n link + '</td><tr>');\n $(\"#tableBody-0\").append(tablebody);\n }\n}", "title": "" }, { "docid": "eecd49e907127e7d51381ca113416ce5", "score": "0.60338706", "text": "updateCalendarHTML() {\n\n\t\tif (this.month.length == 0 || this.refreshCalEvents || moment().diff(this.lastCalendarUpdateTime, 'minutes') > 120) {\n\t\t\tthis.lastCalendarUpdateTime = moment()\n\t\t\tthis.showLoader = true\n\t\t\tthis.buildCalendar(this.selectedMonth)\n\t\t\tthis.getCalendarEvents(this.month[0].date, this.month[41].date, this.monthToGet, this.month)\n\t\t\tthis.showLoader = false\n\t\t}\n\t\tconst month = this.month\n\t\tvar weekDays = moment.weekdaysMin(true)\n\n\t\tconst htmlDayNames = weekDays.map((day) => html`\n\t\t\t\t\t\t<th class=\"cal\" style = \"padding-bottom: 8px; color: ${this._config.calWeekDayColor};\" > ${day}</th> `)\n\n\t\tthis.content = html`\n\t\t\t\t\t\t\t<div class=\"calTitleContainer\">\n\t\t\t\t\t\t\t\t${ this.getCalendarHeaderHTML()}\n\t\t\t</div >\n\t\t\t\t\t\t<div class=\"calTableContainer\">\n\t\t\t\t\t\t\t<table class=\"cal\" style=\"color: ${this._config.eventTitleColor};\">\n\t\t\t\t\t\t\t\t<thead> <tr>\n\t\t\t\t\t\t\t\t\t${htmlDayNames}\n\t\t\t\t\t\t\t\t</tr> </thead>\n\t\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t\t${this.getCalendarDaysHTML(month)}\n\t\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style=\"font-size: 90%;\">\n\t\t\t\t\t\t\t${this.eventSummary}\n\t\t\t\t\t\t</div>\n\t\t\t`\n\t}", "title": "" }, { "docid": "d517394b28ce96d13be8217f199341b6", "score": "0.602987", "text": "function redrawRecentTransTable(startPage)\n {\n var transTableString = recentTransTable.toHTML(startPage);\n document.getElementById(panelName + \"_RecentTransTableModule\").innerHTML = transTableString;\n }", "title": "" }, { "docid": "8256ad650ab804dbc2ab059371ee4060", "score": "0.6023294", "text": "function updateRoomCompareTable (table_json) {\n let table = $('<table>').addClass('table table-hover sortable room-compare-table').append([\n $('<thead>').append(\n $('<tr>').append(\n $.map(['Room', 'Valve %', 'Room Temp'], function (value) {\n return $('<th>').text(value)\n }))),\n $('<tbody>').append(\n $.map(table_json, function (row) {\n return $('<tr>').append(\n $('<td headers=\"room\">').text(row.name_room),\n $('<td headers=\"valve\">').text(row.valve).addClass(row.valve_anomalous ? 'bg-warning' : ''),\n $('<td headers=\"room_temp\">').text(row.room_temp).addClass(row.room_temp_anomalous ? 'bg-warning' : ''))\n }))])\n\n $('#compare-table').html(table)\n}", "title": "" }, { "docid": "7a79ff879302c2f6c5ca1c32de1b60ec", "score": "0.6019552", "text": "function update_table(data) {\n\tif (data['outcome'] && data['outcome'] == false) {\n\t\t$('#message').text('List query error.');\n\t} else {\n\t\tconsole.log(data);\n\t\tvar $table = $('#list');\n\t\t\n\t\tif (!data || !data.genes || data.genes.length == 0) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Header\n\t\tvar sp = get_par( \"sp\" );\n\t\t$header = $('<tr />');\n\t\t\n\t\tvar heads = [\n\t\t\t{\n\t\t\t\t\"name\": \"pnum_all\",\n\t\t\t\t\"title\": \"Num\",\n\t\t\t\t\"desc\": \"Ordered position of the gene in the genome\",\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"name\": \"blast\",\n\t\t\t\t\"title\": \"BLAST against...\",\n\t\t\t\t\"desc\": \"Blast this sequence against either the whole current database, or against NCBI databases\",\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"name\": \"pid\",\n\t\t\t\t\"title\": \"Gene ID\",\n\t\t\t\t\"desc\": \"Unique gene identifier in the genome. The link leads to the sequence in fasta format.\",\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"name\": \"loc_start\",\n\t\t\t\t\"title\": \"Start\",\n\t\t\t\t\"desc\": \"Genomes coordinates of the start of the gene\",\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"name\": \"loc_end\",\n\t\t\t\t\"title\": \"End\",\n\t\t\t\t\"desc\": \"Genomes coordinates of the start of the gene\",\n\t\t\t},\n {\n \"name\": \"strand\",\n \"title\": \"Strand\",\n \"desc\": \"Strand of the gene: sense = +, antisense = -\"\n },\n\t\t\t{\n\t\t\t\t\"name\": \"loc_length\",\n\t\t\t\t\"title\": \"Length\",\n\t\t\t\t\"desc\": \"Length of the gene, in base pairs\",\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"name\": \"product\",\n\t\t\t\t\"title\": \"Predicted product\",\n\t\t\t\t\"desc\": \"Product predicted for this gene\",\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"name\": \"delta_GC\",\n\t\t\t\t\"title\": \"Diff GC ratio\",\n\t\t\t\t\"desc\": \"Difference between the GC ratio of the whole genome with the GC of each gene\",\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"name\": \"breaks\",\n\t\t\t\t\"title\": \"Breaks that include this gene\",\n\t\t\t\t\"desc\": \"List the breaks where the gene can be found\",\n\t\t\t},\n\t\t];\n\t\tfor (i in heads) {\n\t\t\t$header.append( $('<th />').html( \"<abbr title='\" + heads[i].desc + \"'>\" + heads[i].title + \"</abbr>\" ) );\n\t\t}\n\t\t$head_tag = $('<thead />');\n\t\t$head_tag.append($header);\n\t\t$table.append($head_tag);\n\t\t\n\t\t$body_tag = $('<tbody />');\n\t\t// Add 1 row = 1 break\n\t\tvar rank = 0;\n\t\tfor (b in data.genes) {\n\t\t\tbdata = data.genes[b];\n\t\t\trank++;\n\t\t\tbdata.rank = rank;\n\t\t\t$row = $('<tr />');\n\n\t\t\tfor (h in heads) {\n\t\t\t\tvar name = heads[h].name;\n\t\t\t\tvar $cell = $('<td />');\n\t\t\t\tvar val = bdata[ name ];\n\t\t\t\tif (name == \"breaks\" && val) {\n\t\t\t\t\tvar breaks = [];\n\t\t\t\t\tfor (sp2 in val) {\n\t\t\t\t\t\tbreaks.push(make_break_link(val[sp2], sp2, get_par(\"version\")));\n\t\t\t\t\t}\n\t\t\t\t\tval = breaks.join(\", \");\n\t\t\t\t}\n\t\t\t\telse if (name == \"blast\") {\n\t\t\t\t\tval = make_blast_link({\"pid\": bdata.pid }, true);\n\t\t\t\t}\n\t\t\t\telse if (name == \"pid\") {\n\t\t\t\t\tval = make_seq_link(bdata.pid);\n\t\t\t\t\tval = val + \"<span id='\" + bdata.pid + \"' />\";\n\t\t\t\t}\n\t\t\t\telse if (name == \"delta_GC\") {\n\t\t\t\t\tval = format_GC(val);\n\t\t\t\t}\n\t\t\t\telse if (name == \"loc_start\" || name == \"loc_end\") {\n\t\t\t\t\tval = format_number(val);\n\t\t\t\t}\n\t\t\t\telse if (name == \"strand\") {\n val = format_strand(val);\n\t\t\t\t}\n\t\t\t\telse if (name == \"loc_length\") {\n val = format_length(bdata[\"feat\"], val);\n\t\t\t\t}\n\t\t\t\t$cell.html(val);\n\t\t\t\t$row.append($cell);\n\t\t\t}\n\t\t\t\n\t\t\t$body_tag.append($row);\n\t\t}\n\t\t$table.append($body_tag);\n\t\t$table.show();\n\t\t\n\t\t$('tr').hover(function(e) {\n\t\t\t$(this).css('background', '#FFA');\n\t\t}, function(e) {\n\t\t\t$(this).css('background', '');\n\t\t});\n\t}\n}", "title": "" }, { "docid": "87739ae01c2faf5744cbd408aafe0e92", "score": "0.6010104", "text": "function buildHtmlTable(myJson,selector) {\n var columns = getAllColumnHeaders(myJson);\n columns.push('modify')\n columns.push('delete')\n columns.push('borrow')\n $(selector).append('<th scope=\"col\">Titre</th><th scope=\"col\">Date de publication</th><th scope=\"col\">Description</th><th scope=\"col\">État</th><th scope=\"col\">Éditeur</th><th scope=\"col\">Auteur(s)</th><th scope=\"col\">Modifier</th><th scope=\"col\">Supprimer</th><th scope=\"col\">Emprunter</th>')\n for (var i = 0; i<myJson.length; i++){\n var row$ = $('<tr/>');\n for (var j = 0; j<columns.length+2; j++){\n var cellValue = myJson[i][columns[j]];\n if(cellValue == null) {\n if(columns[j] == 'modify'){\n if(sessionStorage.getItem('roles').includes('contributor') || sessionStorage.getItem('roles').includes('administrator'))\n row$.append($('<td/>').html('<button class=\"btn btn-primary\" onclick=\"storeUpdateId(event);\">Modifier</button>'))\n else\n row$.append($('<td/>').html('<button class=\"btn btn-primary\" disabled>Modifier</button>'))\n }\n if(columns[j] == 'delete'){\n if(sessionStorage.getItem('roles').includes('contributor') || sessionStorage.getItem('roles').includes('administrator'))\n row$.append($('<td/>').html('<button class=\"btn btn-danger\" onclick=\"deleteBook(event);\">Supprimer</button>'))\n else\n row$.append($('<td/>').html('<button class=\"btn btn-danger\" disabled>Supprimer</button>'))\n }\n if(columns[j] == 'borrow'){\n if(sessionStorage.getItem('roles').includes('contributor') || sessionStorage.getItem('roles').includes('administrator') || sessionStorage.getItem('roles').includes('borrow'))\n if(myJson[i]['state']==0){\n row$.append($('<td/>').html('<button class=\"btn btn-warning\" onclick=\"storeBorrowId(event);\">Emprunter</button>'))\n }\n else\n row$.append($('<td/>').html('<button class=\"btn btn-warning\" disabled>Emprunter</button>'))\n }\n }\n\n else if(columns[j] == 'idBook'){\n row$.append('<input value=\"'+cellValue+'\" hidden></input>')\n }\n\n else if(columns[j] == 'state'){\n if(cellValue == 0)\n row$.append($('<td/>').html('Disponible'));\n else if(cellValue == 1)\n row$.append($('<td/>').html('Emprunté'));\n else\n row$.append($('<td/>').html('Indisponible'));\n }\n\n else if(columns[j] == 'publisher') {\n row$.append($('<td/>').html(cellValue['name']));\n }\n\n else if(columns[j] == 'authors'){\n let res = ''\n for(var k = 0; k < cellValue.length; k++){\n res += cellValue[k]['name'];\n if(k!=cellValue.length-1)\n res+=', '\n }\n row$.append($('<td/>').html(res));\n }\n\n else{\n row$.append($('<td/>').html(cellValue));\n }\n\n }\n $(selector).append(row$);\n }\n}", "title": "" }, { "docid": "552ace11984419a7ecbcb0106679f9a0", "score": "0.59935945", "text": "function updateTable() {\n let arr = Object.values(forexPairs);\n arr = arr.sort(function(a,b){\n return a.lastChangeBid - b.lastChangeBid;\n });\n let tableBody = document.getElementById('forex-pairs');\n let tableContent = \"\";\n for (pair of arr) {\n tableContent += createRow(pair);\n }\n tableBody.innerHTML = tableContent;\n updateSparkLine();\n return true;\n}", "title": "" }, { "docid": "29cd3dc59dbccb6b75a391f5835c2427", "score": "0.5990954", "text": "function updateTable(){\n\t\t\t$('#table').bootstrapTable({\n\t\t\t\tdata:filteredCD,\n\t\t\t\tshowExport: true,\n\t\t\t\texportOptions: {\n\t\t\t\t\tfileName: 'AsinyTableFilter'\n\t\t\t\t},\n\t\t\t\tonClickRow: function (row,$element){\n\n\t\t\t\t\tif(typeof(shapeActive) == \"object\" && typeof(neigMarkActive) == \"object\"){\n\t\t\t\t\t\tshapeActive.setVisible(false);\n\t\t\t\t\t\tfor(var i = 0 ;i < neigMarkActive.length ; i++){\n\t\t\t\t\t\t\tneigMarkActive[i].setVisible(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t$element.css({backgroundColor: row.color});\n\t\t\t\t\tshapeActive = row.draw(row.color);\n\t\t\t\t\tneigMarkActive = row.drawNB();\n\t\t\t\t\t$('#nameBoro').html(row.borough);\n\t\t\t\t\t$('#numberCD').html(\"Community District : \"+row.numberCD);\n\t\t\t\t\tdrawChart(row.incomeUnits);\n\t\t\t\t\tdrawPie(row.bedroomUnits);\n\t\t\t\t\tdirectionsRenderer.setMap(null);\n\t\t\t\t\tmap.setCenter(row.neighborhoods[0].coorCenter);\n\t\t\t\t\tmap.setZoom(13);\n\t\t\t\t},\n\t\t\t});\n\t\t\t/*Update text in button to export table*/\n\t\t\t$('.export .caret').html(\"Export To\");\n\t\t\t$('.keep-open .caret').html(\"Columns\");\n\n\t\t}", "title": "" }, { "docid": "e85142dd718e148b1b3f804c4b9c5128", "score": "0.5986941", "text": "function refreshPeripheriquesTable(){\n $.post( \"../php/ajax/utilisateur/refreshPeripheriques.php\")\n .done(function( data ) {\n $('tbody').html(data);\n });\n }", "title": "" }, { "docid": "013ab1003c30bbc5ce020fc94a79366e", "score": "0.5979612", "text": "function updateViewDailog()\n{\n\tif (dailogModel.error != undefined){}\n\telse if(dailogModel.notFound != undefined){}\n\telse\n\t{\n\t\tvar t = 0;\n\t\t$(\"#dailogTableBody\").empty();\n\t\tfor (var i in dailogModel)\n\t\t{\n\t\t\tvar row = dailogModel[i];\n\t\t\tt = t + parseInt(row.TmSp);\n\t\t\t$(\"#dailogTableBody\").append(\"<tr>\"+\n\t\t\t\t\"<td>\"+row.Dts+\"</td>\"+\n\t\t\t\t\"<td>\"+row.Ttl + \"</td>\" +\n\t\t\t\t\"<td>\"+secondsConvert(row.TmSp) +\"</td>\" +\n\t\t\t\t\"</tr>\");\n\t\t}\n\t\t$(\"#mTitle\").text(tit + \" transaction(s)\");\n\t\t$(\"#dMessage\").html(\"Total:\" + secondsConvertRP(t));\n\t\t\n\t}\n}", "title": "" }, { "docid": "2f008363cffe7119a81a30ed50018f48", "score": "0.5977888", "text": "function refresh_query_table(data,element){\n var request = $.ajax({\n url:'../BackEnd-controller/BackEnd-controller.php',\n type: \"POST\",\n cache: false,\n dataType: \"html\",\n data:data\n });\n\n request.done(function(data){\n $(element).fadeOut(500,function(){$(this).empty().append(data).fadeIn(500);});\n\n });\n }", "title": "" }, { "docid": "020d215966af76e3116abcc4112b48d2", "score": "0.5973326", "text": "function updateDOM(){\n if (!updatedOnLoad){\n getSavedColumns();\n }\n //Fill All the Column\n //Backlog\n backlogList.textContent = '';\n backlogListArray.forEach((backlogItem, index)=>{\n createItemEl(backlogList, 0, backlogItem, index);\n });\n backlogListArray = filterArray(backlogListArray)\n\n //Progress\n progressList.textContent = '';\n progressListArray.forEach((backlogItem, index)=>{\n createItemEl(progressList, 1, backlogItem, index);\n });\n progressListArray = filterArray(progressListArray)\n\n //Complete\n completeList.textContent = '';\n completeListArray.forEach((completeItem, index)=>{\n createItemEl(completeList, 2, completeItem, index);\n });\n completeListArray = filterArray(completeListArray)\n\n // On Hold\n onHoldList.textContent = '';\n onHoldListArray.forEach((onHoldItem, index)=>{\n createItemEl(onHoldList, 3, onHoldItem, index);\n });\nonHoldListArray = filterArray(onHoldListArray)\n\n//Run getSavedColumns only once, Update local Storage\nupdatedOnLoad = true;\nupdateSavedColumns()\n}", "title": "" }, { "docid": "32361e1a0f4964e360da75d664348083", "score": "0.59729147", "text": "function tableUpdated() {\n\t\t\t\t\tvar orderBy = tableController.getOrderByFilters();\n\t\t\t\t\torder = getOrder(orderBy);\n\n\t\t\t\t\tupdateStyle();\n\t\t\t\t}", "title": "" }, { "docid": "32361e1a0f4964e360da75d664348083", "score": "0.59729147", "text": "function tableUpdated() {\n\t\t\t\t\tvar orderBy = tableController.getOrderByFilters();\n\t\t\t\t\torder = getOrder(orderBy);\n\n\t\t\t\t\tupdateStyle();\n\t\t\t\t}", "title": "" }, { "docid": "c9f3ac91f8cf83dd88d4c592b00f2f78", "score": "0.59685844", "text": "function refreshTable() {\n\n\t//clear table\n\tdocument.getElementById(\"tableBody\").innerHTML = \"\";\n\n\t//create query by creation date\n\tvar q = new StackMob.Collection.Query();\n\tq.orderAsc('createddate');\n\t\n\t//execute query\n\tvar list = new Datas();\n\tlist.query(q, {\n\t\tsuccess: function(collection) {\n\t\t\n\t\tvar array = collection.toJSON();\n\n\t \tfor (var i = 0; i < list.length; i++)\n\t \t\tdocument.getElementById(\"tableBody\").innerHTML += createRow(array[i]);\n\t\t},\n\t\terror: function() {\n \t\t\tdocument.getElementById(\"tableBody\").innerHTML = \"<h2 class='text-error'>Failed to refresh..</h2>\"\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3569ca977e4e2b3298fb99110f5216a4", "score": "0.5967014", "text": "function renderTable() {\n $('.request-item').remove();\n\n requests.forEach(function writeToTable(request) {\n if (matchFilter(request))\n $('#request-table').append(request.rowHtml);\n })\n}", "title": "" }, { "docid": "44a31f61cbf82e9921e3d1807ceb6833", "score": "0.5961077", "text": "generateTable() {\n // begin of the HTML table string including header cells\n var topTenTable = '<table><tbody><tr><th class=\"width-5p\">Platz</th><th>Kunde (Vorname, Name, Email)</th><th class=\"width-15p\">Gesamtumsatz in ' + this.state.currencySymbol + '</th><th class=\"width-10p\">Bestellungen</th><th class=\"width-15p\">Datum letzter Bestellung</th>';\n\n for (var i = 0; i < this.state.columns.length; i++) {\n // specify the rank for the list (1 means best)\n var rank = i + 1;\n\n // add a row with corresponding cells\n topTenTable += \"<tr>\" +\n \"<td class='color'\" + rank + \" >\" + rank + '.' + \"</td>\" +\n \"<td>\" + this.state.columns[i][0] + \" \" + this.state.columns[i][1] + \": \" + this.state.columns[i][2] + \"</td>\" +\n \"<td>\" + this.state.columns[i][3] + \"</td>\" +\n \"<td>\" + this.state.columns[i][4] + \"</td>\" +\n \"<td>\" + this.state.columns[i][5] + \"</td>\" +\n \"</tr>\";\n }\n\n // end the table string\n topTenTable += \"</tbody></table>\";\n\n // attach table string to component\n $('#topTenTable').append(topTenTable);\n\n }", "title": "" }, { "docid": "a85ea0e4301fbda9ee311d49c19a3975", "score": "0.59599036", "text": "function update_table(random_table_list) {\n $.ajax({\n url:'/tablecheck/',\n type: 'POST',\n data: random_table_list,\n async: false,\n }).done(function (data) {\n var all_data = data['tables'];\n var all_status = data['status'];\n var all_space = data['space'];\n\n var list_group = document.getElementById(\"list_group\");\n\n while(list_group.hasChildNodes()) {\n list_group.removeChild(list_group.firstChild);\n }\n if (all_data.length > 0) {\n for (var table in all_data) {\n var li = document.createElement(\"li\");\n var a = document.createElement(\"a\");\n a.innerText = all_data[table];\n li.setAttribute(\"class\", \"list-group-item\");\n li.setAttribute(\"style\", \"font-weight: bolder; font-size: small; padding: 10px;\");\n li.id = all_data[table];\n var link = \"/ba/dataset/\" + all_data[table]\n\n var span = document.createElement(\"span\");\n\n // Set no link for disk full\n if (all_status[table] === \"Out of Space\") {\n a.setAttribute(\"href\", \"#\");\n span.setAttribute(\"class\", \"home-description left disk-full\")\n }\n else {\n a.setAttribute(\"href\", link);\n span.setAttribute(\"class\", \"home-description left\")\n }\n span.append(a);\n li.appendChild(span);\n\n var a = document.createElement(\"a\");\n if (all_status[table] === \"Uploaded\") {\n a.setAttribute(\"style\", \"color: blue\");\n }\n else if (all_status[table] === \"Processing\") {\n a.setAttribute(\"style\", \"color: orangered\");\n processing_count += 1;\n }\n else if (all_status[table] === \"Error\") {\n a.setAttribute(\"style\", \"color: red\");\n }\n else if (all_status[table] === \"Out of Space\") {\n a.setAttribute(\"style\", \"color: red\");\n }\n else {\n a.setAttribute(\"style\", \"color: seagreen\");\n }\n a.innerText = all_status[table];\n a.setAttribute(\"class\", \"right\");\n var span = document.createElement(\"span\");\n\n // Set no link for disk full\n if (all_status[table] === \"Out of Space\") {\n a.setAttribute(\"href\", \"#\");\n span.setAttribute(\"class\", \"left disk-full\");\n }\n else {\n a.setAttribute(\"href\", link);\n span.setAttribute(\"class\", \"left\");\n }\n\n span.setAttribute(\"style\", \"padding-left: inherit; margin-left: inherit;\")\n span.append(a);\n li.appendChild(span);\n\n // Add the space left\n var span = document.createElement(\"span\");\n span.setAttribute(\"class\", \"left\");\n var a = document.createElement(\"a\");\n a.innerText = all_space[table];\n span.setAttribute(\"style\", \"padding-left: inherit; margin-left: inherit;\")\n span.append(a);\n li.appendChild(span);\n\n // Add the delete button\n var button = document.createElement(\"button\");\n button.setAttribute(\"type\", \"button\");\n // button.setAttribute(\"@click\", \"deleteItem(index)\");\n button.setAttribute(\"class\", \"right delete\");\n button.id = all_data[table];\n button.innerText = \"X\";\n li.append(button);\n\n list_group.appendChild(li);\n }\n }\n });\n}", "title": "" }, { "docid": "3fcb0f04841faa2ec9c8bd0de508ee95", "score": "0.59599036", "text": "function update_table(random_table_list) {\n $.ajax({\n url:'/tablecheck/',\n type: 'POST',\n data: random_table_list,\n async: false,\n }).done(function (data) {\n var all_data = data['tables'];\n var all_status = data['status'];\n var all_space = data['space'];\n\n var list_group = document.getElementById(\"list_group\");\n\n while(list_group.hasChildNodes()) {\n list_group.removeChild(list_group.firstChild);\n }\n if (all_data.length > 0) {\n for (var table in all_data) {\n var li = document.createElement(\"li\");\n var a = document.createElement(\"a\");\n a.innerText = all_data[table];\n li.setAttribute(\"class\", \"list-group-item\");\n li.setAttribute(\"style\", \"font-weight: bolder; font-size: small; padding: 10px;\");\n li.id = all_data[table];\n var link = \"/ba/dataset/\" + all_data[table]\n\n var span = document.createElement(\"span\");\n\n // Set no link for disk full\n if (all_status[table] === \"Out of Space\") {\n a.setAttribute(\"href\", \"#\");\n span.setAttribute(\"class\", \"home-description left disk-full\")\n }\n else {\n a.setAttribute(\"href\", link);\n span.setAttribute(\"class\", \"home-description left\")\n }\n span.append(a);\n li.appendChild(span);\n\n var a = document.createElement(\"a\");\n if (all_status[table] === \"Uploaded\") {\n a.setAttribute(\"style\", \"color: blue\");\n }\n else if (all_status[table] === \"Processing\") {\n a.setAttribute(\"style\", \"color: orangered\");\n processing_count += 1;\n }\n else if (all_status[table] === \"Error\") {\n a.setAttribute(\"style\", \"color: red\");\n }\n else if (all_status[table] === \"Out of Space\") {\n a.setAttribute(\"style\", \"color: red\");\n }\n else {\n a.setAttribute(\"style\", \"color: seagreen\");\n }\n a.innerText = all_status[table];\n a.setAttribute(\"class\", \"right\");\n var span = document.createElement(\"span\");\n\n // Set no link for disk full\n if (all_status[table] === \"Out of Space\") {\n a.setAttribute(\"href\", \"#\");\n span.setAttribute(\"class\", \"left disk-full\");\n }\n else {\n a.setAttribute(\"href\", link);\n span.setAttribute(\"class\", \"left\");\n }\n\n span.setAttribute(\"style\", \"padding-left: inherit; margin-left: inherit;\")\n span.append(a);\n li.appendChild(span);\n\n // Add the space left\n var span = document.createElement(\"span\");\n span.setAttribute(\"class\", \"left\");\n var a = document.createElement(\"a\");\n a.innerText = all_space[table];\n span.setAttribute(\"style\", \"padding-left: inherit; margin-left: inherit;\")\n span.append(a);\n li.appendChild(span);\n\n // Add the delete button\n var button = document.createElement(\"button\");\n button.setAttribute(\"type\", \"button\");\n // button.setAttribute(\"@click\", \"deleteItem(index)\");\n button.setAttribute(\"class\", \"right delete\");\n button.id = all_data[table];\n button.innerText = \"X\";\n li.append(button);\n\n list_group.appendChild(li);\n }\n }\n }).fail(function(xhr) {\n try {\n var msg = $.parseJSON(xhr.responseText)\n $(\"#error_msg\").text(msg.message);\n $(\"#error_dialog\").css(\"display\", \"block\");\n } catch(e) {\n $(\"#error_msg\").text(\"Unexpected error occurred. Please check system logs. \" + e);\n $(\"#error_dialog\").css(\"display\", \"block\");\n }\n });\n}", "title": "" }, { "docid": "96569682257daf0495ce8d7f3dae7699", "score": "0.5958457", "text": "function updateStats() {\n // Target view updated\n $('#todays').html(\"<li>Todays</li><li>\" + Math.round(vapeStats.cigarettesToday) + \" <z>Cigarettes </z></li><li>\" + Math.round(vapeStats.nicotineToday, 1) + \" <z>ug/mg Nicotine</z> </li><li>\" + Math.round(vapeStats.puffsToday) + \" <z>Puffs</z> </li>\");\n $('#target').html(\"<li>Target</li><li>\" + Math.round(vapeStats.targetCigarettesPerDay) + \" <z>Cigarettes</z> </li><li>\" + Math.round(vapeStats.targetNicotineAllowance, 1) + \" <z>ug/mg Nicotine</z> </li><li>\" + Math.round(vapeStats.targetPuffs) + \" <z>Puffs</z> </li>\");\n}", "title": "" }, { "docid": "c5b4623835b452dfd83a8d20e7b9aeef", "score": "0.5958145", "text": "function renderTable() {\n\t// clear the previous table\n\t$tbody.innerHTML = \"\";\n\n\t// loop loads up to (tableData.length) times\n\tfor (var i = 0; i < tableData.length; i++) {\n\n\t\t// info for the current sighting onto the i'th index\n\t\tvar currentSighting = tableData[i];\n\t\tvar infos = Object.keys(currentSighting);\n\t\t// new row in tbody and set index to be i\n\t\tvar $row = $tbody.insertRow(i);\n\n\t\t// loop loads the info into the table\n\t\t// name the plural form or something similar\n\t\tfor (var j = 0; j < infos.length; j++) {\n\t\t\tvar info = infos[j];\n\t\t\t// every address gets a cell\n\t\t\tvar $cell = $row.insertCell(j);\n\t\t\t// set the text content of a node\n\t\t\t$cell.innerText = currentSighting[info];\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ac84b8cea2718bfa6a421df0128a06a1", "score": "0.59571177", "text": "function commitTable(collapseData){\n\t$('#mark-table').html(collapseData);\n}", "title": "" }, { "docid": "2077aba918f13f3526c67a9ec79d7424", "score": "0.5957059", "text": "doTable() {\n var self = this;\n\n var update = function (arr, key, newval) {\n var match = (0, _find3.default)(arr, key);\n\n if (match) {\n (0, _merge3.default)(match, newval);\n } else {\n arr.push(newval);\n }\n };\n\n // add the team badges\n (0, _each3.default)(this.data.standings.standing, function (entry) {\n var teamInfo = _teamcodes2.default[entry.teamName];\n\n update(self.data.standings.standing, { 'teamName': entry.teamName }, { 'style': teamInfo.style });\n update(self.data.standings.standing, { 'teamName': entry.teamName }, { 'teamName': teamInfo.teamName });\n });\n\n this.data.sidebar = this.__replaceText({\n 'old': this.data.sidebar,\n //# [](#pt-NOS) Primeira Liga 2016/17 - Current Table\n 'begin': '# \\\\[\\\\]\\\\(\\\\#pt-NOS\\\\) ' + this.data.standings.leagueCaption + ' - Current Table',\n 'end': '******',\n 'replacement': this.templateEngine.table(this.data)\n });\n\n return this;\n }", "title": "" }, { "docid": "0334c1d145993c71a3f49b144c6619cb", "score": "0.59549826", "text": "function populateDetailedView(jsonStr, emailId){\r\n\tvar tableContents = \"\";\r\n\tvar tableDtlHdr = document.getElementById(\"detailedHdr\");\r\n\ttableDtlHdr.innerHTML = \"<table width='100%'><tr><td><b>Displaying records: </b>\"+emailId+\"</td><td align='right'><input type='button' class='go_back_btn' value='Go Back' onclick='goBack()' /></td></tr></table>\";\r\n\tvar tableDiv = document.getElementById(\"detailedDivContent\");\r\n\tvar headingString = \"<table border='1' bordercolor='#78C0D3' id='myTable2' class='table'><thead class='tab_header'><tr><th>Sl No.</th><th>Start date/time</th><th>End date/time</th></tr></thead><tbody>\";\r\n\tvar obj = jQuery.parseJSON(jsonStr);\r\n\tvar dispTable = obj.reportList.split(\"$$$\");\r\n\t\r\n\tfor(var index=0; index<dispTable.length-1; index++){\r\n\t\tvar content = \"<tr bgcolor='#D2EAF0'>\";\r\n\t\tvar headerNonRepetingData = dispTable[index].split(\"#\");\r\n\t\tcontent = content + \"<td align='center'>\"+parseInt(index+1)+\"</td>\";\r\n\t\tcontent = content + \"<td align='center'>\"+headerNonRepetingData[0]+\"</td>\";\r\n\t\tif (headerNonRepetingData[0] == headerNonRepetingData[1]) {\r\n\t\t\tcontent = content + \"<td align='center'>Currently Logged In</td>\";\r\n\t\t} else {\r\n\t\t\tcontent = content + \"<td align='center'>\"+headerNonRepetingData[1]+\"</td>\";\r\n\t\t}\r\n\t\t//content = content + \"<td align='center'>\"+headerNonRepetingData[1]+\"</td>\";\r\n\t\tcontent = content + \"</tr>\";\r\n\t\ttableContents = tableContents + content;\r\n\t}\r\n\tvar mainContent = headingString + tableContents+\"</tbody></table>\";\r\n\ttableDiv.innerHTML = mainContent;\r\n\tnew SortableTable(document.getElementById('myTable2'), 1);\r\n}", "title": "" }, { "docid": "66777d5b6dc6063fef82faa4ffb118fa", "score": "0.5953168", "text": "function refreshManagerTable() {\n // Gets the manager status\n var status = JSON.parse(sessionStorage.status).managerStatus;\n\n // Hide the banner and the manager table\n $('#managerBanner').hide();\n clearTableBody('managerStatus');\n $('#managerStatus').hide();\n\n // If manager status is error, show banner, otherwise, create manager table\n if (status === 'ERROR') {\n $('#managerBanner').show();\n } else {\n $('#managerStatus').show();\n var data = JSON.parse(sessionStorage.manager);\n var items = [];\n items.push(createFirstCell(data.manager, data.manager));\n\n items.push(createRightCell(data.onlineTabletServers,\n data.onlineTabletServers));\n\n items.push(createRightCell(data.totalTabletServers,\n data.totalTabletServers));\n var date = data.lastGC;\n //this will be a finish time or a status of Running, Waiting, or down\n if (!isNaN(date))\n date = new Date(parseInt(data.lastGC)).toLocaleString().split(' ').join('&nbsp;');\n\n items.push(createLeftCell(data.lastGC, '<a href=\"/gc\">' + date + '</a>'));\n\n items.push(createRightCell(data.tablets,\n bigNumberForQuantity(data.tablets)));\n\n items.push(createRightCell(data.unassignedTablets,\n bigNumberForQuantity(data.unassignedTablets)));\n\n items.push(createRightCell(data.numentries,\n bigNumberForQuantity(data.numentries)));\n\n items.push(createRightCell(data.ingestrate,\n bigNumberForQuantity(Math.round(data.ingestrate))));\n\n items.push(createRightCell(data.entriesRead,\n bigNumberForQuantity(Math.round(data.entriesRead))));\n\n items.push(createRightCell(data.queryrate,\n bigNumberForQuantity(Math.round(data.queryrate))));\n\n items.push(createRightCell(data.holdTime, timeDuration(data.holdTime)));\n\n items.push(createRightCell(data.osload, bigNumberForQuantity(data.osload)));\n\n $('<tr/>', {\n html: items.join('')\n }).appendTo('#managerStatus tbody');\n }\n}", "title": "" }, { "docid": "1782937e8ecbd673f9d20b1b3a21f29a", "score": "0.59525967", "text": "function updateHtml() {\n $('#crystal-value').html(`Count: ${count}`);\n $('#wins').html(`Wins: ${wins}`);\n $('#loses').html(`Loses: ${loses}`);\n}", "title": "" }, { "docid": "8e2b820a008b891ea9fa2eea6d1bcca9", "score": "0.5945693", "text": "function renderTable() {\n $tbody.innerHTML = '';\n for (var i = 0; i < tableLimit; i++) {\n // Get get the current data object and its fields\n var data = filteredData[i];\n var fields = Object.keys(data);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the data object, create a new cell at set its inner text to be the current value at the current address's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = data[field];\n }\n }\n }", "title": "" }, { "docid": "3a4bc7cf3c628c094d6fb82cc55df9b2", "score": "0.59445393", "text": "function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < UFOdata.length; i++) {\n // Get get the sightings object and its fields\n var CurrentSighting = UFOdata[i];\n var fields = Object.keys(CurrentSighting);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the CurrentSighting object, create a new cell at set its inner text to be the current value at the current sightings field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = CurrentSighting[field];\n }\n }\n}", "title": "" }, { "docid": "ef98b04bf5e2f8f87d04588d6f1ec1a6", "score": "0.593652", "text": "function renderTable() {\n $tbody.innerHTML = \"\";\n\n //iter through list of dictionaries in data.js\n for (var i = 0; i < filteredData.length; i++) {\n\n //get dictionary and keys\n var dict = filteredData[i];\n var keys = Object.keys(dict);\n\n //new row\n var $row = $tbody.insertRow(i);\n\n //iter through keys and insert each value to a cell\n for (var j = 0; j < keys.length; j++) {\n var key = keys[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = dict[key];\n }\n }\n}", "title": "" }, { "docid": "0b077a3c24a91f9d343f539df0cca966", "score": "0.5931265", "text": "function displaySoarianOverviewTable() { \n document.getElementById('soarian-table-div').classList.toggle('hide');\n document.getElementsByClassName('soarian-failure-message')[0].classList.toggle('hide');\n fetchData(soarianConfig.dstu2.metadataUrl, soarianConfig.dstu2.metadataHeaders, true, function(dstu2Response) {\n fetchData(soarianConfig.r4.metadataUrl, soarianConfig.r4.metadataHeaders, true, function(r4Response) {\n let tableResources = sortMatchedResources(matchResources(dstu2Response, r4Response));\n\n generateTable(tableResources);\n document.getElementById('soarian-diff-table-spinner').classList.toggle('hide')\n document.getElementById('soarian-table-div').classList.toggle('hide');\n }, showTableFailureMessage);\n }, showTableFailureMessage);\n}", "title": "" }, { "docid": "f4d23afe271911c5f2a6948d21ac71b0", "score": "0.5930589", "text": "function updateHTML() {\n\t\t$(\"#listOfStreams\").append('<li class=\"well' + transmission + '\"><img class=\"img-rounded\" src=' + logo + ' alt=\"Smiley face\" height=\"50\" width=\"50\"><span> ' + status + '</span></li>');\n\t}", "title": "" }, { "docid": "9bae97397c052036010b1a61a2606fa3", "score": "0.5929677", "text": "doTable() {\n let self = this;\n\n const update = function(arr, key, newval) {\n let match = find(arr, key);\n\n if(match) {\n merge( match, newval );\n } else {\n arr.push( newval );\n }\n };\n\n // add the team badges\n each(this.data.standings.standing, function(entry) {\n let teamInfo = TeamCodes[entry.teamName];\n\n update(\n self.data.standings.standing,\n { 'teamName': entry.teamName },\n { 'style' : teamInfo.style }\n );\n update(\n self.data.standings.standing,\n { 'teamName': entry.teamName },\n { 'teamName': teamInfo.teamName }\n );\n });\n\n this.data.sidebar = this.__replaceText( {\n 'old': this.data.sidebar,\n //# [](#pt-NOS) Primeira Liga 2016/17 - Current Table\n 'begin': '# \\\\[\\\\]\\\\(\\\\#pt-NOS\\\\) ' + this.data.standings.leagueCaption + ' - Current Table',\n 'end': '******',\n 'replacement': this.templateEngine.table( this.data )\n } );\n\n return this;\n }", "title": "" }, { "docid": "d54ab2a9af9e6192ccec69e23fea17e3", "score": "0.5928956", "text": "function renderTable(arrayUsers) {\n\n let tbody = document.createElement(\"tbody\");\n table.appendChild(tbody);\n let numberUser = 0;\n for (let i = 0; i < arrayUsers.length; i++) {\n numberUser++;\n let trTbody = document.createElement(\"tr\");\n let td = document.createElement(\"td\");\n let text = document.createTextNode(numberUser); // don't sort\n td.appendChild(text);\n trTbody.appendChild(td);\n for (let j = 1; j < config.columns.length - 1; j++) {\n let text;\n let key = config.columns[j].value;\n let td = document.createElement(\"td\");\n if (typeof config.columns[j].value === \"function\") { // for calculate age from format Data\n text = document.createTextNode(config.columns[j].value(arrayUsers[i]));\n } else {\n text = document.createTextNode(arrayUsers[i][key]);\n }\n if (config.columns[j].type === \"number\") {\n td.setAttribute(\"class\", \"align-right\");\n }\n td.appendChild(text);\n trTbody.appendChild(td);\n }\n td = document.createElement(\"td\");\n let buttonDelete = createButton(td, \"Delete\", \"btn2-danger\");\n buttonDelete.onclick = function () {\n deleteUser(arrayUsers[i].id).then(() => update(config.apiUrl).then((data) => {\n removeBodyTable();\n renderTable(data);\n dataUpdate=data.slice();\n }));\n }\n let buttonEdit = createButton(td, \"Edit\", \"btn2-warning table-modal-trigger\");\n buttonEdit.setAttribute(\"data-target\", \"user\" + arrayUsers[i].id);\n trTbody.appendChild(td);\n tbody.appendChild(trTbody);\n }\n initListenerModal(); // add listener for buttons \"table-modal-trigger\"\n }", "title": "" }, { "docid": "e6661cb302e0891e668148d44bf73ed8", "score": "0.5928878", "text": "function updatePCBDisplay(params)\r\n{\r\n var head = '<table class=\"pcbTable\"><tr><td>PID</td> <td>PC</td><td>ACC'+\r\n '</td><td>X</td><td>Y</td><td>Z</td><td>BASE</td><td>LIMIT</td> </tr>';\r\n \r\n // Tab 1\r\n var html = 'Executing<br/>' + head;\r\n if(params[3])\r\n {\r\n html += params[3].toString();\r\n }\r\n html += \"</table>\";\r\n \r\n html +='<br/>Ready<br/>' + head + params[1].toString() + \"</table>\";\r\n \r\n $(\"#Active\").html(html);\r\n html = \"\";\r\n \r\n // Tab 0\r\n $(\"#Residents\").html(head + params[0].toString() + \"</table>\");\r\n \r\n // Tab 2 \r\n $(\"#Terminated\").html(head + params[2].toString() + \"</table>\");\r\n}", "title": "" }, { "docid": "12641840dd8b41bc8412a0eb31829cdc", "score": "0.5922934", "text": "function updateTableContent(tableBodyId){\n $(tableBodyId).empty();\n var queryString = \"/cars/ownerRest/\" +\n \"?name=\" + $(\"#name\").val() +\n \"&lastName=\" + $(\"#lastName\").val() +\n \"&nationality=\" + $(\"#nationality\").val() +\n \"&dni=\" + $(\"#dni\").val() + \"&offset=\" + $(\"#offset\").val()\n\n $.getJSON(queryString, function(data){\n var tableBody = $(tableBodyId);\n var totalRows = data.content.cantItems;\n for (var i = 0, len = data.content.owner.length; i < len; i++) {\n //alert(tableElement);\n var item=data.content.owner[i];\n tableBody.append($('<tr>')\n .attr('attr-id',item.id)\n .append($('<td>')\n .text(item.id)\n .attr('class','active'))\n .append($('<td>')\n .text(item.name)\n .attr('class','success'))\n .append($('<td>')\n .text(item.lastName)\n .attr('class','success'))\n .append($('<td>')\n .text(item.dni)\n .attr('class','success'))\n .append($('<td>')\n .text(item.nationality)\n .attr('class','success'))\n );\n };\n\n //After appending\n addRowHandlers(\"#ownersTable\", '#myModal',loadOwnerInModal);\n updateTableHeader(\"#ownersTable\",'#ownerTableHead');\n updatePaginateButtons(\"#ownersTable\",'#paginateButtons',totalRows);\n });\n}", "title": "" }, { "docid": "b7e39b58e47c736d08c6bf12e219db0e", "score": "0.5918679", "text": "function renderTheTable(){\n newTable.innerHTML = '';\n for (var i = 0; i < allStore.length; i++){\n allStore[i].render();\n }\n\n makeTheFooterRow();\n}", "title": "" }, { "docid": "2a47061c199c20559faa83435558a662", "score": "0.59175086", "text": "function update() {\n\t\t\t\t\tvar page = tableController.getCurrentPage();\n\t\t\t\t\tvar rowsPerPage = tableController.getRowsPerPage();\n\t\t\t\t\tvar rows = tableController.getFilteredRows();\n\n\t\t\t\t\tvar rowFrom = ((page - 1) * rowsPerPage) + 1;\n\t\t\t\t\tvar rowTo = Math.min(rowFrom - 1 + rowsPerPage, rows);\n\n\t\t\t\t\tvar infoText = angular.isDefined(scope.text) ? scope.text : config.textDefault\n\t\t\t\t\tvar txt = infoText.replace('{0}', rowFrom);\n\t\t\t\t\ttxt = txt.replace('{1}', rowTo);\n\t\t\t\t\ttxt = txt.replace('{2}', rows);\n\n\t\t\t\t\tscope.infoText = txt;\n\t\t\t\t\tscope.isVisible = rows > 0;\n\t\t\t\t}", "title": "" }, { "docid": "2a47061c199c20559faa83435558a662", "score": "0.59175086", "text": "function update() {\n\t\t\t\t\tvar page = tableController.getCurrentPage();\n\t\t\t\t\tvar rowsPerPage = tableController.getRowsPerPage();\n\t\t\t\t\tvar rows = tableController.getFilteredRows();\n\n\t\t\t\t\tvar rowFrom = ((page - 1) * rowsPerPage) + 1;\n\t\t\t\t\tvar rowTo = Math.min(rowFrom - 1 + rowsPerPage, rows);\n\n\t\t\t\t\tvar infoText = angular.isDefined(scope.text) ? scope.text : config.textDefault\n\t\t\t\t\tvar txt = infoText.replace('{0}', rowFrom);\n\t\t\t\t\ttxt = txt.replace('{1}', rowTo);\n\t\t\t\t\ttxt = txt.replace('{2}', rows);\n\n\t\t\t\t\tscope.infoText = txt;\n\t\t\t\t\tscope.isVisible = rows > 0;\n\t\t\t\t}", "title": "" }, { "docid": "0d8eefe8ac7cda7014004f66e7884eb9", "score": "0.5915693", "text": "function createElementTable() {\r\n\r\n\tvar data = [];\r\n\r\n\tloadElements();\r\n\r\n\tfor(var i in studyElements) {\r\n\r\n\t\tfor(var j=0; j < studyElements[i].length; j++){\r\n\t\t\tdata.push({\r\n\t\t\t\tname: studyElements[i][j].label,\r\n\t\t\t\ttype: studyElements[i][j].type,\r\n\t\t\t\tuuid: studyElements[i][j].uuid,\r\n\t\t\t\tstudy: studyElements[i][j].study\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t};\r\n\r\n\t$('#element-display-table').bootstrapTable({\r\n\t\tcolumns: [{\r\n\t\t\tcheckbox: true\r\n\t\t}, {\r\n\t\t\tfield: 'name',\r\n\t\t\ttitle: 'Item Label',\r\n\t\t\tsortable: true,\r\n\t\t\t// formatter: createEditLink\r\n\t\t}, {\r\n\t\t\tfield: 'type',\r\n\t\t\ttitle: 'Element Type',\r\n\t\t\tsortable: true\r\n\t\t}, {\r\n\t\t\tfield: 'uuid',\r\n\t\t\ttitle: 'UUID',\r\n\t\t\tsortable: false,\r\n\t\t\tvisible: false\r\n\t\t}, {\r\n\t\t\tfield: 'study',\r\n\t\t\ttitle: 'Original Study',\r\n\t\t\tsortable: true,\r\n\t\t\tvisible: true\r\n\t\t}],\r\n\t\tsearch: true,\r\n\t\tpagination: true,\r\n\t\tshowToggle: true,\r\n\t\tshowRefresh: true,\r\n\t\tshowColumns: true,\r\n\t\tpageSize: 25,\r\n\t\tmaintainSelected: true,\r\n\t\ticonsPrefix: 'fa',\r\n\t\ticons: {\r\n\t\t\tpaginationSwitchDown: 'fa-collapse-down icon-chevron-down',\r\n\t\t\tpaginationSwitchUp: 'fa-collapse-up icon-chevron-up',\r\n\t\t\trefresh: 'fa-refresh icon-refresh',\r\n\t\t\ttoggle: 'fa-list-alt icon-list-alt',\r\n\t\t\tcolumns: 'fa-th icon-th',\r\n\t\t\tdetailOpen: 'fa-plus icon-plus',\r\n\t\t\tdetailClose: 'fa-minus icon-minus'\r\n\t\t},\r\n\t\tdata\r\n\t});\r\n\r\n\t$('#element-display-page [title=\"Refresh\"]').on('click', (event) => {\r\n\t\tevent.preventDefault()\r\n\t\tupdateElementTable()\r\n\t});\r\n}", "title": "" }, { "docid": "5e9816976ca40dcd4ebfa0e43d1a5232", "score": "0.5915586", "text": "function refreshtable() {\r\n let table = \"<ul id='contactstable' border='1'>\";\r\n if (arrayofcontacts.length > 0) {\r\n for (let i = 0; i < arrayofcontacts.length; i++) {\r\n table +=\r\n `<li id=\"a\"><a onclick=\"showdetails(${i})\">` +\r\n arrayofcontacts[i].name +\r\n `</a><a id=\"a\" onclick=\"showdetails(${i})\">` +\r\n arrayofcontacts[i].phone +\r\n `</a><a><button onclick=\"editdetails(${i})\"><svg height=\"13pt\" viewBox=\"0 -1 401.52289 401\" width=\"12.5pt\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m370.589844 250.972656c-5.523438 0-10 4.476563-10 10v88.789063c-.019532 16.5625-13.4375 29.984375-30 30h-280.589844c-16.5625-.015625-29.980469-13.4375-30-30v-260.589844c.019531-16.558594 13.4375-29.980469 30-30h88.789062c5.523438 0 10-4.476563 10-10 0-5.519531-4.476562-10-10-10h-88.789062c-27.601562.03125-49.96875 22.398437-50 50v260.59375c.03125 27.601563 22.398438 49.96875 50 50h280.589844c27.601562-.03125 49.96875-22.398437 50-50v-88.792969c0-5.523437-4.476563-10-10-10zm0 0\"/><path d=\"m376.628906 13.441406c-17.574218-17.574218-46.066406-17.574218-63.640625 0l-178.40625 178.40625c-1.222656 1.222656-2.105469 2.738282-2.566406 4.402344l-23.460937 84.699219c-.964844 3.472656.015624 7.191406 2.5625 9.742187 2.550781 2.546875 6.269531 3.527344 9.742187 2.566406l84.699219-23.464843c1.664062-.460938 3.179687-1.34375 4.402344-2.566407l178.402343-178.410156c17.546875-17.585937 17.546875-46.054687 0-63.640625zm-220.257812 184.90625 146.011718-146.015625 47.089844 47.089844-146.015625 146.015625zm-9.40625 18.875 37.621094 37.625-52.039063 14.417969zm227.257812-142.546875-10.605468 10.605469-47.09375-47.09375 10.609374-10.605469c9.761719-9.761719 25.589844-9.761719 35.351563 0l11.738281 11.734375c9.746094 9.773438 9.746094 25.589844 0 35.359375zm0 0\"/></svg></button></a><a><button onclick=\"deltecontact(${i})\"><svg xmlns=\"http://www.w3.org/2000/svg\" height=\"20\" viewBox=\"0 0 24 24\" width=\"20\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5l-1-1h-5l-1 1H5v2h14V4z\"/></svg></button></a></li>`;\r\n }\r\n } else {\r\n table += `<p class=\"nocontacts\"> No Entries Found</p>`;\r\n }\r\n table += \"</ul>\";\r\n\r\n selected.innerHTML = table;\r\n}", "title": "" } ]
45c81250e43eeea4df041f8d1e30fb69
Gets list of validatable types.
[ { "docid": "d38e3fa1f0cae986b39348d8b0f39533", "score": "0.58496225", "text": "function getNativeValidatorTypes(element) {\n return ['email', 'url', 'tel', 'date', 'time']\n .filter(k => utils_1.isTruthy(element.type === k));\n}", "title": "" } ]
[ { "docid": "ae490b6175a63ab5f8ac6aeec8590337", "score": "0.69117385", "text": "static get ALLOWED_TYPES() {\n\t\treturn [];\n\t}", "title": "" }, { "docid": "ea93c400c6eb6e86d5eaeb9b4a222ac4", "score": "0.6031206", "text": "types() {\r\n return Object.keys(this.getInstance()._types);\r\n }", "title": "" }, { "docid": "a1211e500f4efffcbd4eeada7a13df57", "score": "0.60254073", "text": "static getAllTypes () {\n return [].concat(\n FeatureType.getMeTypes(),\n FeatureType.getOrganizationTypes(),\n FeatureType.getProjectTypes())\n }", "title": "" }, { "docid": "c88b8fe122716327d95adbe013097582", "score": "0.60253865", "text": "get types() {\n return this.getListAttribute('types');\n }", "title": "" }, { "docid": "12f995aec15ae5685a85336ad920ea4f", "score": "0.59381366", "text": "getTypes() {\n return this.getParameter(QueryParameters.FOR_TYPES);\n }", "title": "" }, { "docid": "887bf1b6da0299e2d07b1dc3ff3d8ec8", "score": "0.5926374", "text": "function getAllTypes(){\n var types = [];\n\n cmdObj.forEach( (thisCmd) => {\n types.push(thisCmd.type);\n });\n return types.filter(onlyUnique).sort();\n }", "title": "" }, { "docid": "db3f26626d2497e7c11f2e09a52df1cd", "score": "0.5816281", "text": "static getAvailableTypes() {\n return availableTypes;\n }", "title": "" }, { "docid": "cf9e72ffd0bb370fb4353bb3decba988", "score": "0.55721194", "text": "getTypes() {\n return types;\n }", "title": "" }, { "docid": "95bb96d00237f576e05067a57df1d588", "score": "0.5561401", "text": "get types() {\r\n return [];\r\n }", "title": "" }, { "docid": "a8e4d983cb16d582c442b34693b2eb7a", "score": "0.53954417", "text": "static get supportedTypes() {\n return [\n this.STRING,\n this.TEXT,\n this.NUMBER,\n this.INTEGER,\n this.INT,\n this.SMALLINT,\n this.BIGINT,\n this.FLOAT,\n this.DOUBLE,\n this.DECIMAL,\n this.DATE,\n this.TIME,\n this.DATETIME,\n this.BOOLEAN,\n this.JSON,\n this.SIMPLE_ARRAY\n ];\n }", "title": "" }, { "docid": "24ab0f7a520c460b06733b44f0a7e300", "score": "0.5312645", "text": "_getValidators() {\n return [this._parseValidator, this._minValidator, this._maxValidator, this._filterValidator];\n }", "title": "" }, { "docid": "24ab0f7a520c460b06733b44f0a7e300", "score": "0.5312645", "text": "_getValidators() {\n return [this._parseValidator, this._minValidator, this._maxValidator, this._filterValidator];\n }", "title": "" }, { "docid": "2b2ab70bbfa9c580533ba470768482a4", "score": "0.5275634", "text": "listTypes() {\n this._assumeAvailable();\n return new Promise((resolve, reject) => {\n var filter = {};\n this.JardiDoc.distinct('type', filter)\n .then(resolve).catch(reject);\n });\n }", "title": "" }, { "docid": "dbcb0193610da0814dbc6e9513466d11", "score": "0.525824", "text": "function mandatoryStatsTypes() {\n const mandatoryTypes = new Set();\n for (let allowlistedStats of gStatsAllowlist.values()) {\n if (allowlistedStats.presence() == Presence.MANDATORY)\n mandatoryTypes.add(allowlistedStats.type());\n }\n return mandatoryTypes;\n}", "title": "" }, { "docid": "823a6f1e4eb7bbe3f6f0846bfdfd214a", "score": "0.51611316", "text": "function plottableTypes () {\n\tvar types = [].map.call (document.querySelectorAll (\"#crater-types input:checked\"), function (checkbox) { return checkbox.value;} );\n\treturn types;\n}", "title": "" }, { "docid": "42f2d463afe74ccece96c4b0612b94fa", "score": "0.5130034", "text": "function getTypes(resource) {\n if (jQuery.isArray(resource['@type'])) {\n return resource['@type'];\n } else {\n return [resource['@type']];\n }\n }", "title": "" }, { "docid": "84639ec93f4cb38883694a50744bb137", "score": "0.5121886", "text": "_getTypes(data) {\n let types = []\n for (let item of data.types) {\n types.push(item.type.name);\n }\n return types;\n }", "title": "" }, { "docid": "7b12233eaff5b11420e166d5377b4ca8", "score": "0.50955224", "text": "getBaseTypes() {\r\n return this.getType().getBaseTypes();\r\n }", "title": "" }, { "docid": "21731eef9112b9e6913a680962db8277", "score": "0.5055573", "text": "function handleGetTypes(req, res) {\n //sends hardcorded validtypes as json\n res.json(validTypes);\n}", "title": "" }, { "docid": "5af4593a4e33ebcaf5bbae88e5c1c63d", "score": "0.4997623", "text": "function getSuggestedTypeNames(schema, type, fieldName) {\n if (Object(__WEBPACK_IMPORTED_MODULE_3__type_definition__[\"z\" /* isAbstractType */])(type)) {\n var suggestedObjectTypes = [];\n var interfaceUsageCount = Object.create(null);\n schema.getPossibleTypes(type).forEach(function (possibleType) {\n if (!possibleType.getFields()[fieldName]) {\n return;\n }\n // This object type defines this field.\n suggestedObjectTypes.push(possibleType.name);\n possibleType.getInterfaces().forEach(function (possibleInterface) {\n if (!possibleInterface.getFields()[fieldName]) {\n return;\n }\n // This interface type defines this field.\n interfaceUsageCount[possibleInterface.name] = (interfaceUsageCount[possibleInterface.name] || 0) + 1;\n });\n });\n\n // Suggest interface types based on how common they are.\n var suggestedInterfaceTypes = Object.keys(interfaceUsageCount).sort(function (a, b) {\n return interfaceUsageCount[b] - interfaceUsageCount[a];\n });\n\n // Suggest both interface and object types.\n return suggestedInterfaceTypes.concat(suggestedObjectTypes);\n }\n\n // Otherwise, must be an Object type, which does not have possible fields.\n return [];\n}", "title": "" }, { "docid": "48c2d75dbea3d2d56cfdddf3038b1bab", "score": "0.49841726", "text": "function getItemTypes() {\n\tvar itemTypes;\n\n\ttry {\n\t\titemTypes = com.ibm.team.workitem.web.cache.internal.Cache.getItem('workitems/itemTypes');\n\t} catch (e) {\n\t\titemTypes = null;\n\t}\n\n\treturn itemTypes;\n}", "title": "" }, { "docid": "e48d8a5889f37f0b9692dc250fbf2fdf", "score": "0.4983622", "text": "getDeclarativeTypes(_resourceExplorer) {\n return this.services.mustMakeInstance('declarativeTypes');\n }", "title": "" }, { "docid": "9ceaa60607bb0a244a385dddb0e216e5", "score": "0.49774638", "text": "get typesInput() {\n return this._types;\n }", "title": "" }, { "docid": "93417091c018535f6cf9a43291ed6d41", "score": "0.49640048", "text": "function getTypes(icons) {\n let types = [];\n icons.forEach((element) => {\n if (! types.includes(element.type)) {\n types.push(element.type);\n }\n })\n return types;\n}", "title": "" }, { "docid": "d113a35439309950904732261c5e35a0", "score": "0.49422264", "text": "function getUserTypesFromSchema(schema) {\n const allTypesMap = schema.getTypeMap();\n // tslint:disable-next-line: no-unnecessary-local-variable\n const modelTypes = Object.values(allTypesMap).filter((graphqlType) => {\n if (graphql.isObjectType(graphqlType)) {\n // Filter out private types\n if (graphqlType.name.startsWith('__')) {\n return false;\n }\n if (schema.getMutationType() && graphqlType.name === schema.getMutationType().name) {\n return false;\n }\n if (schema.getQueryType() && graphqlType.name === schema.getQueryType().name) {\n return false;\n }\n if (schema.getSubscriptionType() && graphqlType.name === schema.getSubscriptionType().name) {\n return false;\n }\n return true;\n }\n return false;\n });\n return modelTypes;\n}", "title": "" }, { "docid": "03c7aff7f3a2c025f770359a4bd3e751", "score": "0.49338743", "text": "getIntegrationsCredentialsTypes() { \n\n\t\t\treturn this.apiClient.callApi(\n\t\t\t\t'/api/v2/integrations/credentials/types', \n\t\t\t\t'GET', \n\t\t\t\t{ },\n\t\t\t\t{ },\n\t\t\t\t{ },\n\t\t\t\t{ },\n\t\t\t\tnull, \n\t\t\t\t['PureCloud OAuth'], \n\t\t\t\t['application/json'],\n\t\t\t\t['application/json']\n\t\t\t);\n\t\t}", "title": "" }, { "docid": "446006c127eada79face97e9dbad6b31", "score": "0.49334547", "text": "static getChecks(type) {\n return type._checks.slice();\n }", "title": "" }, { "docid": "2f2a8ae105ea007628fdc55be91e8fac", "score": "0.49224076", "text": "getInvalidNodeTypes() {\n return Array.from(\n new Set(\n this.getAllErrors()\n .filter(err => err instanceof UnknownNodeTypeError)\n .map(err => err.getNode().getFirstWord())\n )\n )\n }", "title": "" }, { "docid": "2e22b5e870071a0f401959a6c6510374", "score": "0.4913836", "text": "function includableTypes() {\n if (!config.graphite || !config.graphite.events) return [];\n var c = config.graphite.events;\n\n return c.types || [];\n }", "title": "" }, { "docid": "5dc286c3e359781935c51903a3b130e3", "score": "0.49066222", "text": "get draftVisibilityTypeMap() {\n const result = [];\n for (let draftType in DraftVisibilityType_1.DraftVisibilityType) {\n if (typeof DraftVisibilityType_1.DraftVisibilityType[draftType] === 'number') {\n result.push(draftType);\n }\n }\n return result;\n }", "title": "" }, { "docid": "cbaea251c42e8337d861a0bb69f1a0f4", "score": "0.49006885", "text": "function getClassList(type) {\n\t\t\t\t\tvar classList = Metadata.queryDescriptor(type, 'class');\n\t\t\t\t\tif (classList) {\n\t\t\t\t\t\treturn classList.split(/\\s+/).push(type);\n\t\t\t\t\t}\n\t\t\t\t\treturn [type];\n\t\t\t\t}", "title": "" }, { "docid": "ae1aa267d1ac7fbbb323f297e24e8a09", "score": "0.48728696", "text": "function getSuggestedTypeNames(schema, type, fieldName) {\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isAbstractType\"])(type)) {\n var suggestedObjectTypes = [];\n var interfaceUsageCount = Object.create(null);\n\n for (var _i2 = 0, _schema$getPossibleTy2 = schema.getPossibleTypes(type); _i2 < _schema$getPossibleTy2.length; _i2++) {\n var possibleType = _schema$getPossibleTy2[_i2];\n\n if (!possibleType.getFields()[fieldName]) {\n continue;\n } // This object type defines this field.\n\n\n suggestedObjectTypes.push(possibleType.name);\n\n for (var _i4 = 0, _possibleType$getInte2 = possibleType.getInterfaces(); _i4 < _possibleType$getInte2.length; _i4++) {\n var possibleInterface = _possibleType$getInte2[_i4];\n\n if (!possibleInterface.getFields()[fieldName]) {\n continue;\n } // This interface type defines this field.\n\n\n interfaceUsageCount[possibleInterface.name] = (interfaceUsageCount[possibleInterface.name] || 0) + 1;\n }\n } // Suggest interface types based on how common they are.\n\n\n var suggestedInterfaceTypes = Object.keys(interfaceUsageCount).sort(function (a, b) {\n return interfaceUsageCount[b] - interfaceUsageCount[a];\n }); // Suggest both interface and object types.\n\n return suggestedInterfaceTypes.concat(suggestedObjectTypes);\n } // Otherwise, must be an Object type, which does not have possible fields.\n\n\n return [];\n}", "title": "" }, { "docid": "3248e3bca4fb12651d8eb8963ed9ed1c", "score": "0.4849163", "text": "function getype(icons) { \n const types = [];\n\n icons.forEach((element) => {\n if(!types.includes(element.type)) {\n types.push(element.type);\n }\n });\n return types ; \n \n}", "title": "" }, { "docid": "4f385ad0f03d588984171961cbe7edd9", "score": "0.47994116", "text": "function getClassList(type) {\r\n\t\t\tvar classList = Metadata.queryDescriptor(type, 'class');\r\n\t\t\tif (classList) {\r\n\t\t\t\tclassList = classList.split(/\\s+/);\r\n\t\t\t\tclassList.push(type);\r\n\t\t\t\treturn classList;\r\n\t\t\t}\r\n\t\t\treturn [type];\r\n\t\t}", "title": "" }, { "docid": "1e6d01a31bb982316b609b88b2c82204", "score": "0.47816887", "text": "function parseTypeExpressionList() {\n var elements = [];\n elements.push(parseTop());\n\n while (token === Token.COMMA) {\n consume(Token.COMMA);\n elements.push(parseTop());\n }\n\n return elements;\n } // TypeName :=", "title": "" }, { "docid": "e80dc046b022f1ebaf39e312ac18177c", "score": "0.4766885", "text": "getAllTypes() {\n let typemap = this.get('typemap');\n let enums = this.get('enums');\n let fbtypes = this.get('fbtypes');\n let ret = A();\n let retStrings = A();\n\n for (let type of typemap) {\n let obj = {};\n obj.type = type.name;\n if (type.name.indexOf('null') !== -1 || type.name.indexOf('Null') !== -1) {\n obj.nullable = true;\n } else {\n obj.nullable = false;\n }\n\n obj.userString = this.getTranslationString(obj.type);\n retStrings.push(obj.userString);\n ret.push(obj);\n }\n\n for (let sEnum of enums.content) {\n let obj = {};\n obj.type = sEnum._data.nameStr;\n if (obj.type.indexOf('null') !== -1 || obj.type.indexOf('Null') !== -1) {\n obj.nullable = true;\n } else {\n obj.nullable = false;\n }\n\n obj.userString = this.getTranslationString(obj.type);\n retStrings.push(obj.userString);\n ret.push(obj);\n }\n\n for (let type of fbtypes.content) {\n let obj = {};\n obj.type = type._data.caption;\n if (obj.type.indexOf('null') !== -1 || obj.type.indexOf('Null') !== -1) {\n obj.nullable = true;\n } else {\n obj.nullable = false;\n }\n\n obj.userString = this.getTranslationString(obj.type);\n retStrings.push(obj.userString);\n ret.push(obj);\n }\n\n if (ret.length !== 0) {\n this.set('types', ret);\n this.set('typesAsStrings', retStrings);\n } else {\n this.set('types', [\n {\n nullable: false,\n type: 'bool',\n userString: 'components.fd-visual-control.typeName.boolControlType'\n },\n {\n nullable: false,\n type: 'int',\n userString: 'components.fd-visual-control.typeName.boolintControlType'\n },\n {\n nullable: false,\n type: 'string',\n userString: 'components.fd-visual-control.typeName.dateControlType'\n }\n ]);\n this.set('typesAsStrings', [\n 'components.fd-visual-control.typeName.stringControlType',\n 'components.fd-visual-control.typeName.boolControlType',\n 'components.fd-visual-control.typeName.intControlType',\n 'components.fd-visual-control.typeName.dateControlType'\n ]);\n }\n\n }", "title": "" }, { "docid": "87f232a37763c86118a42711ac56fee4", "score": "0.47571734", "text": "getAllDecorators(clazz) {\n const record = this.recordFor(clazz);\n if (record === null) {\n return null;\n }\n return record.traits.map(trait => trait.detected.decorator).filter(isDefined);\n }", "title": "" }, { "docid": "176fdc3a461c33959138789565a3dedd", "score": "0.47522792", "text": "function typeIds() {\n return typeMappingArray.slice();\n }", "title": "" }, { "docid": "27240b4f5715dcc5f118ff9a72408a71", "score": "0.47364601", "text": "function getDeviceTypes() {\n \n}", "title": "" }, { "docid": "742523687e1a6e1f0f0bcfc7559a341f", "score": "0.47327024", "text": "function getNativeValidators(element) {\n return ['required', 'min', 'max', 'maxLength', 'minLength', 'pattern']\n .filter(k => utils_1.isTruthy(element[k]));\n}", "title": "" }, { "docid": "25a9e81ffd24b413c12b811fbad2ee14", "score": "0.47308332", "text": "function getTypes(data) {\n // Create array of unique types.\n let types = new Set();\n data.forEach((row) => {\n types.add(row.type);\n });\n return [...types];\n}", "title": "" }, { "docid": "6fbd5b9e1c95c3fd40c4aee900f4eefb", "score": "0.4716795", "text": "async fetchExistingQualificationTypes(): Promise<Array<QualificationType>> {\n const res = await this.client\n .listQualificationTypes({\n MustBeRequestable: false /* required */,\n MaxResults: 100,\n MustBeOwnedByCaller: true\n })\n .promise();\n return res['QualificationTypes'];\n }", "title": "" }, { "docid": "6d1fb9e070286d9ecf5b80d2537c3859", "score": "0.47102037", "text": "function AlertTypes() {\n\tvar alertTypes = [];\n\talertTypes.push(DangerAlertType);\n\talertTypes.push(InfoAlertType);\n\talertTypes.push(SuccessAlertType);\n\talertTypes.push(WarnAlertType);\n\treturn alertTypes;\n}", "title": "" }, { "docid": "3810e5ce53c4c0fb62aa4c54c2a1a485", "score": "0.47078687", "text": "static getAvailableTypes(){\n\t\tlet kparams = {};\n\t\treturn new kaltura.RequestBuilder('uiconf', 'getAvailableTypes', kparams);\n\t}", "title": "" }, { "docid": "5dca84f956f0d6e624a20697c196b47f", "score": "0.46801266", "text": "function getAllTypes(){\n let types = []; \n for (let i = 0; i < originalData.length; i++) {\n if (types.includes(originalData[i].type)){\n types = types;\n } else {\n types.push(originalData[i].type)\n }\n }\n return types;\n }", "title": "" }, { "docid": "1cbdb31ce3a505bc7ada722debfb76f3", "score": "0.46678498", "text": "function taskTypeKeys() { return Object.keys(TASK_TYPES); }", "title": "" }, { "docid": "2141ab36d9923189d4e5fbac9fed11db", "score": "0.46624997", "text": "function getErrors() {\n var errors = [];\n\n angular.forEach(attrs, function (attrValue, attrKey) {\n var key = attrKey;\n\n if (attrKey.indexOf('ng') === 0) {\n key = attrKey.substring(2).toLowerCase();\n } else if (attrKey.toLowerCase() === 'type') {\n key = attrValue.toLowerCase();\n }\n if (key in defaultErrors) {\n var error = {\n key: key,\n message: getErrorMessageForKey(key)\n };\n errors.push(error);\n }\n });\n return errors;\n }", "title": "" }, { "docid": "ede6ca830552eaa98371c9f100fcc386", "score": "0.46348634", "text": "function getValidators() {\n\n // Object to pass with validation rules\n return {\n \n 'name': {\n 'size': {\n 'min': 2,\n 'max': 10,\n 'message': 'name must be between 2 and 10 characters.'\n },\n 'required': {\n 'message': 'name is required.'\n }\n }\n \n };\n\n }", "title": "" }, { "docid": "100fda70fcb2b628204f54987fd15b5b", "score": "0.46321583", "text": "getModelTypes() {\n\t\tconst container = this.get('container');\n\n\t\treturn window.getAllModuleNames().\n\t\t\tfilter((name) => {\n\t\t\t\treturn (name.startsWith('models/') && this.detect(window.require(name).default));\n\t\t\t}).\n\t\t\tmap((name) => {\n\t\t\t\tconst className = name.substring('models/'.length);\n\n\t\t\t\treturn {\n\t\t\t\t\tklass: container.lookupFactory(`model:${className}`),\n\t\t\t\t\tname: className.underscore().split(/_/g).map((w) => w.capitalize()).join(' ')\n\t\t\t\t};\n\t\t\t});\n\t}", "title": "" }, { "docid": "d141c8805006249340e004aed7f5b529", "score": "0.4627358", "text": "function parseTypeExpressionList() {\n var elements = [];\n\n elements.push(parseTop());\n while (token === Token.COMMA) {\n consume(Token.COMMA);\n elements.push(parseTop());\n }\n return elements;\n }", "title": "" }, { "docid": "1b4c38415c7affdba64f071d4e639e87", "score": "0.4622557", "text": "function getRawTypes(raw) {\n // JSON Schema's `type` field is either an array or a string -- standardize it into an array.\n const rawTypes = new Set();\n if (typeof raw.type === 'string') {\n rawTypes.add(raw.type);\n }\n else if (raw.type instanceof Array) {\n raw.type.forEach(t => rawTypes.add(t));\n }\n return rawTypes;\n}", "title": "" }, { "docid": "3cdacb61b38805d41352a18780732f13", "score": "0.46132913", "text": "function getSuggestedTypeNames(schema, type, fieldName) {\n if (!(0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isAbstractType)(type)) {\n // Must be an Object type, which does not have possible fields.\n return [];\n }\n\n var suggestedTypes = new Set();\n var usageCount = Object.create(null);\n\n for (var _i2 = 0, _schema$getPossibleTy2 = schema.getPossibleTypes(type); _i2 < _schema$getPossibleTy2.length; _i2++) {\n var possibleType = _schema$getPossibleTy2[_i2];\n\n if (!possibleType.getFields()[fieldName]) {\n continue;\n } // This object type defines this field.\n\n\n suggestedTypes.add(possibleType);\n usageCount[possibleType.name] = 1;\n\n for (var _i4 = 0, _possibleType$getInte2 = possibleType.getInterfaces(); _i4 < _possibleType$getInte2.length; _i4++) {\n var _usageCount$possibleI;\n\n var possibleInterface = _possibleType$getInte2[_i4];\n\n if (!possibleInterface.getFields()[fieldName]) {\n continue;\n } // This interface type defines this field.\n\n\n suggestedTypes.add(possibleInterface);\n usageCount[possibleInterface.name] = ((_usageCount$possibleI = usageCount[possibleInterface.name]) !== null && _usageCount$possibleI !== void 0 ? _usageCount$possibleI : 0) + 1;\n }\n }\n\n return (0,_polyfills_arrayFrom_mjs__WEBPACK_IMPORTED_MODULE_3__.default)(suggestedTypes).sort(function (typeA, typeB) {\n // Suggest both interface and object types based on how common they are.\n var usageCountDiff = usageCount[typeB.name] - usageCount[typeA.name];\n\n if (usageCountDiff !== 0) {\n return usageCountDiff;\n } // Suggest super types first followed by subtypes\n\n\n if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isInterfaceType)(typeA) && schema.isSubType(typeA, typeB)) {\n return -1;\n }\n\n if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isInterfaceType)(typeB) && schema.isSubType(typeB, typeA)) {\n return 1;\n }\n\n return (0,_jsutils_naturalCompare_mjs__WEBPACK_IMPORTED_MODULE_4__.default)(typeA.name, typeB.name);\n }).map(function (x) {\n return x.name;\n });\n}", "title": "" }, { "docid": "bda4faf05ed000659f379c3b94ab6159", "score": "0.46112934", "text": "function parseTypeExpressionList() {\n var elements = [];\n\n elements.push(parseTop());\n while (token === Token.COMMA) {\n consume(Token.COMMA);\n elements.push(parseTop());\n }\n return elements;\n }", "title": "" }, { "docid": "bda4faf05ed000659f379c3b94ab6159", "score": "0.46112934", "text": "function parseTypeExpressionList() {\n var elements = [];\n\n elements.push(parseTop());\n while (token === Token.COMMA) {\n consume(Token.COMMA);\n elements.push(parseTop());\n }\n return elements;\n }", "title": "" }, { "docid": "bda4faf05ed000659f379c3b94ab6159", "score": "0.46112934", "text": "function parseTypeExpressionList() {\n var elements = [];\n\n elements.push(parseTop());\n while (token === Token.COMMA) {\n consume(Token.COMMA);\n elements.push(parseTop());\n }\n return elements;\n }", "title": "" }, { "docid": "bda4faf05ed000659f379c3b94ab6159", "score": "0.46112934", "text": "function parseTypeExpressionList() {\n var elements = [];\n\n elements.push(parseTop());\n while (token === Token.COMMA) {\n consume(Token.COMMA);\n elements.push(parseTop());\n }\n return elements;\n }", "title": "" }, { "docid": "bda4faf05ed000659f379c3b94ab6159", "score": "0.46112934", "text": "function parseTypeExpressionList() {\n var elements = [];\n\n elements.push(parseTop());\n while (token === Token.COMMA) {\n consume(Token.COMMA);\n elements.push(parseTop());\n }\n return elements;\n }", "title": "" }, { "docid": "bda4faf05ed000659f379c3b94ab6159", "score": "0.46112934", "text": "function parseTypeExpressionList() {\n var elements = [];\n\n elements.push(parseTop());\n while (token === Token.COMMA) {\n consume(Token.COMMA);\n elements.push(parseTop());\n }\n return elements;\n }", "title": "" }, { "docid": "3a09e3ea9b7920f23baead9072dba797", "score": "0.4606242", "text": "function ctGetBasicTypes()\n{\n\tvar ret = {};\n\tvar key;\n\tfor (key in deftypes)\n\t\tret[key] = deftypes[key];\n\n\treturn (ret);\n}", "title": "" }, { "docid": "3a09e3ea9b7920f23baead9072dba797", "score": "0.4606242", "text": "function ctGetBasicTypes()\n{\n\tvar ret = {};\n\tvar key;\n\tfor (key in deftypes)\n\t\tret[key] = deftypes[key];\n\n\treturn (ret);\n}", "title": "" }, { "docid": "3a09e3ea9b7920f23baead9072dba797", "score": "0.4606242", "text": "function ctGetBasicTypes()\n{\n\tvar ret = {};\n\tvar key;\n\tfor (key in deftypes)\n\t\tret[key] = deftypes[key];\n\n\treturn (ret);\n}", "title": "" }, { "docid": "36cc1d68fcb39b94670363acc9fccd2f", "score": "0.4581497", "text": "async getTypes(parent,args,ctx,info){\n return await ctx.db.query.types({},info);\n }", "title": "" }, { "docid": "6b52fcb64043bb6ddf951f80112b99e3", "score": "0.4564405", "text": "function _getTypes(doc, ret) {\n if (!ret) {ret = [];}\n if (doc.type && $.inArray(doc.type, ret)==-1) {ret.push(doc.type);}\n var c = doc.contents;\n if (c==null ||c.length==0) \n {return ret;}\n for (var i in c) {\n var t = c[i];\n _getTypes(t, ret);\n }\n return ret;\n }", "title": "" }, { "docid": "c1e81c805368e1369f894789c215b92a", "score": "0.4552011", "text": "function generateTypesList (data) {\n\tvar i = data.length,\n\t\ttypeNames = {},\n\t\tselect = document.getElementById(\"crater-types\"),\n\t\tlist = \"\";\n\n\t// loop though each coaster and check it's type's name. If we haven't seen\n\t// it before, add it to an object so that we can use it to build the list\n\twhile (i--) {\n\t\tif (typeof typeNames[data[i].grade.name] == \"undefined\") {\n\t\t\ttypeNames[data[i].grade.name] = data[i].type.className;\n\t\t}\n\t}\n\t// loop through the array to generate the list of types\n\tfor (var key in typeNames) {\n\t\tif (typeNames.hasOwnProperty(key)) {\n\t\t\tlist += '<li class=\"' + typeNames[key] + '\"><label><input type=\"checkbox\" checked=\"checked\" value=\"' + slugify(key) + '\">' + key + '</label></li>';\n\t\t}\n\t}\n\t// update the form\n\tselect.innerHTML = list;\n}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.45472556", "text": "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}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.45472556", "text": "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}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.45472556", "text": "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}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.45472556", "text": "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}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.45472556", "text": "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}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.45472556", "text": "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}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.45472556", "text": "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}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.45472556", "text": "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}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.45472556", "text": "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}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.45472556", "text": "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}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.45472556", "text": "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}", "title": "" }, { "docid": "09c3ae5c991acb467e3ebdcdf6cc1f6c", "score": "0.45458496", "text": "function computeTypes() {\n scope.types = scope.disableTypes ? [] : scope.columns.filter(scope.filterFn).map(function(column){ return column.type});\n }", "title": "" }, { "docid": "e20d88d54746b0a80d8215a821131ebb", "score": "0.45425195", "text": "function parseTypeExpressionList() {\n\t var elements = [];\n\t\n\t elements.push(parseTop());\n\t while (token === Token.COMMA) {\n\t consume(Token.COMMA);\n\t elements.push(parseTop());\n\t }\n\t return elements;\n\t }", "title": "" }, { "docid": "e9fc1b497d994a4280ed1de2e5dcdc64", "score": "0.45417914", "text": "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}", "title": "" }, { "docid": "e9fc1b497d994a4280ed1de2e5dcdc64", "score": "0.45417914", "text": "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}", "title": "" }, { "docid": "e9fc1b497d994a4280ed1de2e5dcdc64", "score": "0.45417914", "text": "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}", "title": "" }, { "docid": "e9fc1b497d994a4280ed1de2e5dcdc64", "score": "0.45417914", "text": "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}", "title": "" }, { "docid": "e9fc1b497d994a4280ed1de2e5dcdc64", "score": "0.45417914", "text": "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}", "title": "" }, { "docid": "e9fc1b497d994a4280ed1de2e5dcdc64", "score": "0.45417914", "text": "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}", "title": "" }, { "docid": "e9fc1b497d994a4280ed1de2e5dcdc64", "score": "0.45417914", "text": "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}", "title": "" }, { "docid": "54e59f41851c69649de3d93c26f33800", "score": "0.4539413", "text": "get names() {\n var _names = this._store.getTypeNames();\n var len = _names.length;\n var names = new Array(len);\n for (var i=0; i<len; ++i) {\n names[i] = String(_names[i]);\n }\n return names;\n }", "title": "" }, { "docid": "2b47006952515d55bc5a1b96741a4ca3", "score": "0.4533674", "text": "refine(type) {\n if (!TYPES.some(t => t === type))\n throw new Error(`Unknown type: ${type}`);\n let precise = TYPES.filter(t => t !== type).every(t => this.checkBot(t));\n return [this[type], precise];\n }", "title": "" }, { "docid": "91db3ba45212dfc3611235ccfaea5c7e", "score": "0.45252782", "text": "getBriefEvaluationTypesForUpload() {\n let types = []\n if (this.props.brief && this.props.brief.evaluationType) {\n types = this.props.brief.evaluationType.filter(evaluationType =>\n ['Written proposal', 'Response template'].includes(evaluationType)\n )\n }\n return types\n }", "title": "" }, { "docid": "f0dafa4621d0f3300cd1411962bafdda", "score": "0.45248854", "text": "static RegisteredClasses() {\n return this.registeredObjectClasses.values();\n }", "title": "" }, { "docid": "e9604a3b78d3711935aeee9abf8943e3", "score": "0.45180008", "text": "function getSuggestedFieldNames(type, fieldName) {\n if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isObjectType)(type) || (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isInterfaceType)(type)) {\n var possibleFieldNames = Object.keys(type.getFields());\n return (0,_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_5__.default)(fieldName, possibleFieldNames);\n } // Otherwise, must be a Union type, which does not define fields.\n\n\n return [];\n}", "title": "" }, { "docid": "cdf43b7adba27c9c3af57b3b7006dd42", "score": "0.45135638", "text": "function getRoomTypes() {\n const results = hotel.getRoomTypes();\n domUpdates.populateRoomTypeSelector(results);\n}", "title": "" }, { "docid": "21ace64dbe5f16b46ea3b1137db90ab3", "score": "0.45062512", "text": "function getSuggestedTypeNames(schema, type, fieldName) {\n if (!(0, _definition.isAbstractType)(type)) {\n // Must be an Object type, which does not have possible fields.\n return [];\n }\n\n var suggestedTypes = new Set();\n var usageCount = Object.create(null);\n\n for (var _i2 = 0, _schema$getPossibleTy2 = schema.getPossibleTypes(type); _i2 < _schema$getPossibleTy2.length; _i2++) {\n var possibleType = _schema$getPossibleTy2[_i2];\n\n if (!possibleType.getFields()[fieldName]) {\n continue;\n } // This object type defines this field.\n\n\n suggestedTypes.add(possibleType);\n usageCount[possibleType.name] = 1;\n\n for (var _i4 = 0, _possibleType$getInte2 = possibleType.getInterfaces(); _i4 < _possibleType$getInte2.length; _i4++) {\n var _usageCount$possibleI;\n\n var possibleInterface = _possibleType$getInte2[_i4];\n\n if (!possibleInterface.getFields()[fieldName]) {\n continue;\n } // This interface type defines this field.\n\n\n suggestedTypes.add(possibleInterface);\n usageCount[possibleInterface.name] = ((_usageCount$possibleI = usageCount[possibleInterface.name]) !== null && _usageCount$possibleI !== void 0 ? _usageCount$possibleI : 0) + 1;\n }\n }\n\n return (0, _arrayFrom.default)(suggestedTypes).sort(function (typeA, typeB) {\n // Suggest both interface and object types based on how common they are.\n var usageCountDiff = usageCount[typeB.name] - usageCount[typeA.name];\n\n if (usageCountDiff !== 0) {\n return usageCountDiff;\n } // Suggest super types first followed by subtypes\n\n\n if ((0, _definition.isInterfaceType)(typeA) && schema.isSubType(typeA, typeB)) {\n return -1;\n }\n\n if ((0, _definition.isInterfaceType)(typeB) && schema.isSubType(typeB, typeA)) {\n return 1;\n }\n\n return typeA.name.localeCompare(typeB.name);\n }).map(function (x) {\n return x.name;\n });\n}", "title": "" }, { "docid": "3e9719fcdc388394100e326a530b1b72", "score": "0.45014653", "text": "static getTypeValidator (typeName) {\n const ajv = Schema.createAjv()\n const validator = ajv.compile(SCHEMA.typeDefs[typeName])\n return validator\n }", "title": "" }, { "docid": "c2c13d6ea4a2f4d2e6fc9c70274c4823", "score": "0.44950163", "text": "function discoverTypes () {\n // rdf:type properties of subjects, indexed by URI for the type.\n\n const types = {}\n\n // Get a list of statements that match: ? rdfs:type ?\n // From this we can get a list of subjects and types.\n\n const subjectList = kb.statementsMatching(\n undefined,\n UI.ns.rdf('type'),\n tableClass, // can be undefined OR\n sourceDocument\n ) // can be undefined\n\n // Subjects for later lookup. This is a mapping of type URIs to\n // lists of subjects (it is necessary to record the type of\n // a subject).\n\n const subjects = {}\n\n for (let i = 0; i < subjectList.length; ++i) {\n const type = subjectList[i].object\n\n if (type.termType !== 'NamedNode') {\n // @@ no bnodes?\n continue\n }\n\n const typeObj = getTypeForObject(types, type)\n\n if (!(type.uri in subjects)) {\n subjects[type.uri] = []\n }\n\n subjects[type.uri].push(subjectList[i].subject)\n typeObj.addUse()\n }\n\n return [subjects, types]\n }", "title": "" }, { "docid": "1ec79f99c51e14f01411b51156e1d537", "score": "0.44946063", "text": "getScimResourcetypes() { \n\n\t\t\treturn this.apiClient.callApi(\n\t\t\t\t'/api/v2/scim/resourcetypes', \n\t\t\t\t'GET', \n\t\t\t\t{ },\n\t\t\t\t{ },\n\t\t\t\t{ },\n\t\t\t\t{ },\n\t\t\t\tnull, \n\t\t\t\t['PureCloud OAuth'], \n\t\t\t\t['application/json'],\n\t\t\t\t['application/scim+json', 'application/json']\n\t\t\t);\n\t\t}", "title": "" }, { "docid": "38b3ab4bfdfe5cfb86eca1112128729a", "score": "0.44944388", "text": "function getType(icons) {\n\n const type = [];\n icons.forEach((icon) => {\n if (! type.includes(icon.type)) {\n type.push(icon.type);\n }\n })\n\n return type;\n}", "title": "" }, { "docid": "1daa276a8f4cbede12cdb9bf397ed13b", "score": "0.4494149", "text": "function getSuggestedTypeNames(schema, type, fieldName) {\n\t if (type instanceof _definition.GraphQLInterfaceType || type instanceof _definition.GraphQLUnionType) {\n\t var _ret = function () {\n\t var suggestedObjectTypes = [];\n\t var interfaceUsageCount = Object.create(null);\n\t schema.getPossibleTypes(type).forEach(function (possibleType) {\n\t if (!possibleType.getFields()[fieldName]) {\n\t return;\n\t }\n\t // This object type defines this field.\n\t suggestedObjectTypes.push(possibleType.name);\n\t possibleType.getInterfaces().forEach(function (possibleInterface) {\n\t if (!possibleInterface.getFields()[fieldName]) {\n\t return;\n\t }\n\t // This interface type defines this field.\n\t interfaceUsageCount[possibleInterface.name] = (interfaceUsageCount[possibleInterface.name] || 0) + 1;\n\t });\n\t });\n\n\t // Suggest interface types based on how common they are.\n\t var suggestedInterfaceTypes = Object.keys(interfaceUsageCount).sort(function (a, b) {\n\t return interfaceUsageCount[b] - interfaceUsageCount[a];\n\t });\n\n\t // Suggest both interface and object types.\n\t return {\n\t v: suggestedInterfaceTypes.concat(suggestedObjectTypes)\n\t };\n\t }();\n\n\t if (typeof _ret === \"object\") return _ret.v;\n\t }\n\n\t // Otherwise, must be an Object type, which does not have possible fields.\n\t return [];\n\t}", "title": "" }, { "docid": "07a436f8d38e8100122d4098f608eadc", "score": "0.4490172", "text": "function checkType(type,value){\n\t\t\t\tif(type){\n\t\t\t\t\tif(typeof type == 'string' && type != 'any' &&\n\t\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\n\t\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\n\t\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\n\t\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\n\t\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\n\t\t\t\t\t}\n\t\t\t\t\tif(type instanceof Array){\n\t\t\t\t\t\tvar unionErrors=[];\n\t\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\n\t\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(unionErrors.length){\n\t\t\t\t\t\t\treturn unionErrors;\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(typeof type == 'object'){\n\t\t\t\t\t\tvar priorErrors = errors;\n\t\t\t\t\t\terrors = [];\n\t\t\t\t\t\tcheckProp(value,type,path);\n\t\t\t\t\t\tvar theseErrors = errors;\n\t\t\t\t\t\terrors = priorErrors;\n\t\t\t\t\t\treturn theseErrors;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn [];\n\t\t\t}", "title": "" }, { "docid": "cadd1a10610e1f2027a7e581464ad927", "score": "0.44894138", "text": "function gatherTypes2(root) {\n var dict = {};\n var types = [];\n gatherTypes(root, dict);\n Object.keys(dict).forEach(function (k) { return types.push(dict[k]); });\n return types;\n}", "title": "" }, { "docid": "7c3b8f219c015c1a929bf086515f11c2", "score": "0.44864342", "text": "typesList(types) {\n this.snippet.appendText(\" [\");\n this.textOrPlaceholder(types, \"<Type>\");\n this.snippet.appendText(\"]\");\n }", "title": "" }, { "docid": "715d2732dd98fca20d594a0b91fc7909", "score": "0.44854215", "text": "getTypes(pokemon) {\n let types = [];\n for(let i = 0; i < pokemon.types.length; i++) {\n const type = pokemon.types[i].type.name;\n types.push(\n <span\n className={\"b-outline type type-\" + type}\n key={type}\n >\n {type}\n </span>\n );\n }\n return types;\n }", "title": "" } ]
4f2ac9ba4f40fa10003c3dfd0c033144
Reset cursor to start. Requires series.sonify or chart.sonify to have been played at some point earlier.
[ { "docid": "5e1571b7fc53ffa0eafc1d533df3e049", "score": "0.7529587", "text": "function resetCursor() {\n if (this.sonification.timeline) {\n this.sonification.timeline.resetCursor();\n }\n}", "title": "" } ]
[ { "docid": "235318008b78b511525677ae54bb2492", "score": "0.6777993", "text": "function resetCursorEnd() {\n if (this.sonification.timeline) {\n this.sonification.timeline.resetCursorEnd();\n }\n}", "title": "" }, { "docid": "5de904c29a33159b17e2998d8cbbbcc7", "score": "0.65305734", "text": "cursorReset() {\n this.cursorX = this.dimension - 1;\n this.cursorY = this.dimension - 1;\n }", "title": "" }, { "docid": "e2ebd430107b68b64eb9374c4125aaa5", "score": "0.608147", "text": "function resetSyncCursors() {\n for (var i = 0; i < MAP_CURSORS.length; i++) {\n MAP_CURSORS[i] = 1 /* ValuesStartPosition */;\n }\n}", "title": "" }, { "docid": "e2ebd430107b68b64eb9374c4125aaa5", "score": "0.608147", "text": "function resetSyncCursors() {\n for (var i = 0; i < MAP_CURSORS.length; i++) {\n MAP_CURSORS[i] = 1 /* ValuesStartPosition */;\n }\n}", "title": "" }, { "docid": "2277e88c43ab1ae39666374736e3e7c2", "score": "0.59581536", "text": "function resetSeries() {\n chart.series[0].setData([], true);\n searchChart.series[0].setData([], true);\n searchChart.series[1].setData([], true);\n }", "title": "" }, { "docid": "aab3d82735843b04f48e4519f5e15306", "score": "0.59543365", "text": "_refreshCursor() {\n this.svgText.removeCursor();\n this.cursorState = true;\n this._serviceCursor();\n }", "title": "" }, { "docid": "50874105dee4a4351770c3bc113ade20", "score": "0.5901135", "text": "moveCursorToStart() {\n this.getEditor().moveCursorToStart();\n this.scrollTop(0);\n }", "title": "" }, { "docid": "7effefe8640f104c76e61bc5e6a15064", "score": "0.5843356", "text": "function resetCanvas() {\n clearSelections();\n index = 1;\n draw();\n}", "title": "" }, { "docid": "4894e7c522745b9db470380fd3830ffd", "score": "0.57728726", "text": "resetCanvasCursor() {\n\t\tconst selector = \".d3-svg-background[data-pipeline-id='\" + this.activePipeline.id + \"']\";\n\t\tthis.canvasSVG.select(selector).style(\"cursor\", this.isDragActivated() && this.dispUtils.isDisplayingFullPage() ? \"grab\" : \"default\");\n\t}", "title": "" }, { "docid": "e257468bec15e1c69efa1c955d9bae7f", "score": "0.57470423", "text": "reset() {\n // resets the gem's position\n gem.resetGem();\n // resets the star's position\n star.resetStar();\n this.y = 400;\n this.x = 200;\n\n }", "title": "" }, { "docid": "ecf7d74f9c85067f503b8137508b169f", "score": "0.5745438", "text": "reset() {\n if (this.drawingParameters.drawCursors && this.cursor) {\n this.cursor.hide();\n }\n this.sheet = undefined;\n this.graphic = undefined;\n this.zoom = 1.0;\n }", "title": "" }, { "docid": "23613e6a526da8d2886c5a234f54b0ab", "score": "0.5744692", "text": "reset() {\n this.x = -200;\n this.win = false;\n }", "title": "" }, { "docid": "5eb40654bacd999a5ee73da2b2bd3180", "score": "0.57418627", "text": "function reset() {\n\n // Activate start button.\n controls.start.enabled(fx != 0 && fy != 0);\n controls.randomize.enabled(fx != 0 && fy != 0);\n\n // Clear plot.\n plot.clear();\n\n // Reset time.\n t = 0;\n started = false;\n\n}", "title": "" }, { "docid": "e77b23370e549b017adeb87abbb5166f", "score": "0.5728849", "text": "removeFromBeginningToCursor() {\n for (let i = this.getCursorY(); i < this.getColNumber(); i++) {\n this.setChar(this.getCursorX(), i, '')\n this.setStyleData(this.getCursorX(), i, undefined)\n }\n for (let i = this.getCursorX(); i > -1; i--) {\n for (let j = 0; j < this.getColNumber(); j++) {\n this.setChar(i, j, '')\n this.setStyleData(i, j, undefined)\n }\n }\n }", "title": "" }, { "docid": "28bad4c9238be46e2edc233e44f9b496", "score": "0.5692921", "text": "removeFromLineBeginningToCursor() {\n for (let i = 0; i < this.getCursorY() + 1; i++) {\n this.setChar(this.getCursorX(), i, '')\n this.setStyleData(this.getCursorX(), i, undefined)\n }\n }", "title": "" }, { "docid": "c0309c4b67ee1c7563e98d226d8c3c62", "score": "0.56875926", "text": "reset () {\n this.naturalSelection();\n this.restart();\n this.gen++;\n }", "title": "" }, { "docid": "892006440cae0db53c10f02fb61df7d7", "score": "0.5668778", "text": "function reset() {\n role_stack = [];\n on = false;\n nextNoteTime = 0;\n position = 0;\n context.close()\n context = new(window.AudioContext || window.webkitAudioContext)()\n context.suspend();\n instr_changed = true;\n generateSong();\n}", "title": "" }, { "docid": "785f8005b3800df89d080ff0b088635e", "score": "0.56681347", "text": "function resetAnimationPoint() {\n drawn_to = -1;\n }", "title": "" }, { "docid": "1bbe9ce7f87a098ffde93e1437a5884b", "score": "0.5656626", "text": "setCursorX(x) {\n this._cur[0] = x\n }", "title": "" }, { "docid": "92e033e32607faf365a716df13ee960d", "score": "0.5648437", "text": "setFront(){\n\t\tthis.cursor = this.front;\n\t}", "title": "" }, { "docid": "c466c62ea20e0052e82d5e91de793543", "score": "0.5641698", "text": "function reset() {\n\t\tcurChars = [];\n\t\tcharIndex = -1;\n\t\ttick = 0;\n\t\tpreview = true;\n\t}", "title": "" }, { "docid": "74f95930086ab08a89d6c74f38430ec8", "score": "0.56313235", "text": "reset() {\n this.x = this.startX; // OR this.x = 200;\n this.y = this.startY; // OR this.y = 400;\n }", "title": "" }, { "docid": "7737395281b3fda9300e0a9616d8e08b", "score": "0.56260884", "text": "function reset() {\n restoreAndExit();\n ticker_go();\n }", "title": "" }, { "docid": "b392b245146ffb69f243a7ab34462de4", "score": "0.5617307", "text": "reset() {\n this.x = this.startX;\n this.y = this.startY;\n }", "title": "" }, { "docid": "11289b88204cba8cbefdbb8008bd3506", "score": "0.56101584", "text": "function clear_particlecursor(){\n\tbool_clear_particlecursor = true;\n}", "title": "" }, { "docid": "53ce4ca87c36b42a9d12bef22229ae53", "score": "0.56017756", "text": "reset() {\n this.xCoord = this.startXCoord;\n this.yCoord = this.startYCoord;\n }", "title": "" }, { "docid": "a246cc3c1b2e17fef0914ca9d5864ef4", "score": "0.55913526", "text": "_setSelectionToSugggestion() {\n this.selectionStart = this.suggestionIndex;\n this.selectionLength = 1;\n this.suggestionIndex = -1;\n this._updateSelections();\n }", "title": "" }, { "docid": "568dc0b20d3892cd2c85151d6bbf4728", "score": "0.5588014", "text": "function ResetPosition(){\r\n\twhile(cursorPosition>0){\r\n \tLeftArrow();\r\n \tconsole.log(cursorPosition+\" \"+sCounter);\r\n }\r\n tModifier=1;\r\n while(cursorPosition<t.length){\r\n \tRightArrow();\r\n \tconsole.log(cursorPosition+\" \"+sCounter);\r\n }\r\n \r\n}", "title": "" }, { "docid": "1769fd5355c449cf9b34def0e23cba8f", "score": "0.55800104", "text": "function resetSongPlot() {\r\n updateSongPlot(songDataGlobal, plots['song-chart']);\r\n}", "title": "" }, { "docid": "8f512948c60c11855a25860c8fa105d7", "score": "0.55654216", "text": "reset(){\n this.lastPosition = this.position\n this.position = this.startPosition\n }", "title": "" }, { "docid": "a6fa2017719979615379ef09cd3a60b3", "score": "0.55613685", "text": "function resetObject() {\n var startValue = (script.type == 2) ? {\n x: 0\n } : {\n x: script.api.start.x,\n y: script.api.start.y\n };\n // Initialize to start value\n updateValue(startValue);\n}", "title": "" }, { "docid": "4fb08858e7c964cd3fbffea35b9bdf3b", "score": "0.5549418", "text": "function setMode() {\n\tmode = 1 - mode;\n\tif(mode) {\n\t\td3.select('body').style(\"cursor\", \"crosshair\");\n\t}\n\telse {\n\t\td3.select('body').style(\"cursor\", \"default\");\n\t\tresetToModeOne();\n\t}\n\ttoolBoxClear();\n}", "title": "" }, { "docid": "7181107f64ac5c5773ad43ad49990251", "score": "0.5532718", "text": "reset() {\n // Set x and y to starting x and y\n this.y = this.startY;\n this.x = this.startX;\n }", "title": "" }, { "docid": "69de14aca1627fe66b1ffaa86666b314", "score": "0.55318224", "text": "reset() {\r\n\t\tthis.current = 'normal';\r\n\t}", "title": "" }, { "docid": "f55574d65ddb57574f17bee55e5258b5", "score": "0.55201024", "text": "function reset() {\n player.x = 0;\n player.y = 0;\n }", "title": "" }, { "docid": "ca61ea4c5093f6dd04b10283b2aab822", "score": "0.5513039", "text": "reset() {\n this.x = this.xStart;\n this.y = this.yStart;\n }", "title": "" }, { "docid": "012e8eb4a9b1ac340deda1373e0fe8fe", "score": "0.5498676", "text": "function reset() {\n stop();\n itick = 0;\n bot.reset();\n draw();\n}", "title": "" }, { "docid": "280d4ef56577bae25d07e9a3bec9f3bd", "score": "0.5491464", "text": "restart() {\n this.state = 0 /* Running */;\n this.pointerOnePosition = this.startingPosition;\n this.pointerTwoPosition = this.startingPosition;\n this.evenMove = false;\n }", "title": "" }, { "docid": "aa0ad14c10ee90af6b2765172a039b50", "score": "0.54848", "text": "reset() {\n player.y = 315;\n player.x = 200;\n }", "title": "" }, { "docid": "3b65532e9c5f01b28461ce5d60fee620", "score": "0.5482731", "text": "reset() {\n this._cursor = this._history.length;\n this._hasSession = false;\n this._placeholder = '';\n }", "title": "" }, { "docid": "8c35549cd2123e4e897ab7387c86564c", "score": "0.54804397", "text": "function resetState() {\n // Set the user drawing to false\n isUserDrawing = false;\n\n // Reset the starting coordinates to -1\n startMouseX = -1;\n startMouseY = -1;\n }", "title": "" }, { "docid": "8fba9b9ddc07f21eb0201e920c3ed745", "score": "0.5474911", "text": "_regenCursor() {\n var size = this._getRealBrushSize();\n\n var color = this.getSetting('fillColor').hex;\n this.cachedCursor = this.createDynamicCursor(color, size, this.getSetting('pressureEnabled'));\n this.setCursor(this.cachedCursor);\n }", "title": "" }, { "docid": "7afee7093b02d21aa07efa378cf19765", "score": "0.54686445", "text": "_resetCursor() {\n this.setState({\n finalDriverMoveObj: {\n directions: {\n xDir: 'left',\n yDir: 'bottom'\n },\n pixels: {\n moveX: 0,\n moveY: 0\n }\n }\n })\n }", "title": "" }, { "docid": "a640cb89b7c50d902fdf74e4e35cb1a0", "score": "0.54657286", "text": "resetpos() {\n this.x = 202;\n this.y = 387;\n }", "title": "" }, { "docid": "1b630dfbac8bfc1e23acec9c78d471d5", "score": "0.5440181", "text": "resetPosition () {\n this.x = 202;\n this.y = 404;\n }", "title": "" }, { "docid": "2a5dc55b10fcb35552ce5b5cf8b75343", "score": "0.54391474", "text": "function setcursor(self, position) {\n return setRange(self, position, 0);\n }", "title": "" }, { "docid": "45ac42b3f103fa192464ee15944c3703", "score": "0.54388624", "text": "function resetSelection() {\n selection = {\n isMisspelled: false,\n spellingSuggestions: []\n };\n}", "title": "" }, { "docid": "3f38db156ee2103c9e0f9dfab59d238b", "score": "0.5435958", "text": "function reset() {\n resetShapes();\n resetGrid();\n document.getElementById(\"start\").value = \" Start \";\n paused=true;\n elapsedTime=0;\n updateShapes();\n}", "title": "" }, { "docid": "7e559b14f6e452c6dc135add704f1d9a", "score": "0.5424773", "text": "function resetPos() {\r\n posX = 100;\r\n posY = 100;\r\n sliderX.value = \"100\";\r\n sliderY.value = \"100\";\r\n}", "title": "" }, { "docid": "73bc843438064650123c1d165c434111", "score": "0.5420444", "text": "function resetGame() {\n count = 0;\n points = 0;\n star1.x = 350;\n star2.x = 400;\n star3.x = 450;\n}", "title": "" }, { "docid": "de2c398cfad9d5fb8a2ee2f580c4294e", "score": "0.542034", "text": "function cursorFirst() {\n setCursorToFirstTask(checkIsAgendaMode(), 'scroll');\n }", "title": "" }, { "docid": "2df57a33a394a91d402e2f77d9ee4de5", "score": "0.5388166", "text": "reset() {\n this.display = false;\n this.win = false;\n this.x = -100;\n this.y = -100;\n }", "title": "" }, { "docid": "9fc19638749b3b2863b53e4d68848bb2", "score": "0.5385846", "text": "rewind() {\n this.cursor = this.entries.length;\n }", "title": "" }, { "docid": "7cd5633283cf1a04be5e7b88ec62b3b8", "score": "0.53851527", "text": "function resetSelection() {\n highlight = [];\n cal = cal.destroy();\n generate_heatmap();\n\n document.getElementById(\"range-select\").checked = false;\n rangeSelect();\n\n var chart = $('#scatterplot').highcharts();\n var points = chart.getSelectedPoints();\n if (points.length > 0) {\n Highcharts.each(points, function (point) {\n point.select(false);\n });\n }\n}", "title": "" }, { "docid": "0ac1defe98585560f1f7c40bc485fd93", "score": "0.5382229", "text": "restoreCursor(params) {\n this._terminal.x = this._terminal.savedX || 0;\n this._terminal.y = this._terminal.savedY || 0;\n }", "title": "" }, { "docid": "38d0afdf1a5d67153f99d697cce18959", "score": "0.5381072", "text": "function reset() {\n Tone.Transport.stop();\n path = [];\n scorePos = 0;\n}", "title": "" }, { "docid": "4f279e4345abf5acff3bfadffc76f7ee", "score": "0.5379621", "text": "moveToStart() {\n this.#player.moveToStartPos();\n }", "title": "" }, { "docid": "c72b4ed421bd40e8becde173b775643d", "score": "0.53769624", "text": "function resetStartIndex() {\n setStartIndex(0);\n }", "title": "" }, { "docid": "3b8e5e7dbf3aad9b1904a239e3b58c92", "score": "0.5374002", "text": "reset() {\n this.startpoint = [];\n this.endpoint = [];\n this.previouspoint = [];\n this.firstClick = true;\n this.clickCP = { startpoint: false, endpoint: false };\n this.clickLine = false;\n this.contextReal.lineWidth = this.contextDraft.lineWidth = slider.noUiSlider.get();\n }", "title": "" }, { "docid": "79168c260d1d6e825ad8b7685537823b", "score": "0.53688765", "text": "function resetPlayer() {\n player.x = PLAYER_STARTING_X_COOR; //player's starting x coordinate\n player.y = PLAYER_STARTING_Y_COOR; //player's starting y coordinate\n}", "title": "" }, { "docid": "e7e680fd9e7d7c020e06c1eb22ea8903", "score": "0.53646135", "text": "resetLineSelection() {\n\t\tthis.setState({ selection: null });\n\t}", "title": "" }, { "docid": "825698712c9b194e1b29637df2869123", "score": "0.5363184", "text": "function setCursor(x, y) {\n cursor.x = x || 0;\n cursor.y = y || 0;\n}", "title": "" }, { "docid": "a215b8089e94498b0591a0e99af67ba7", "score": "0.5354898", "text": "reset() { this.x = 0; }", "title": "" }, { "docid": "0eeedcf2a6ac5e8f64026af329ace16e", "score": "0.5349165", "text": "function resetted() {\n // Going back to origin position function\n d3.select(\"#xtypeSVG\") // Selecting the relevant svg element in webpage\n .transition()\n .duration(2000) // Resetting takes some time\n .call(zoom.transform, d3.zoomIdentity); // Using \"zoomIdentity\", go back to initial position\n ipcRenderer.send(\n \"console-logs\",\n \"Resetting chronotype to initial position.\"\n ); // Send message in the \"console\"\n }", "title": "" }, { "docid": "7b460cae757a701c7be443217abc5931", "score": "0.5340106", "text": "function startPosition(e) {\r\n mousedown = true;\r\n dots.push('none');\r\n dots.push('none');\r\n }", "title": "" }, { "docid": "aca169599a0839b6b3b58e51d6b3a5f8", "score": "0.53360564", "text": "skipToStart() {\r\n this.state.temp.cycler.step = Constants.CYCLE_STATES.START;\r\n this._parseRandomScriptInDir('Stroke/Start');\r\n }", "title": "" }, { "docid": "312d4cd929a95e074f2bb22ae28989b7", "score": "0.5326444", "text": "function reset() {\n\n chart.selectAll('*').remove();\n }", "title": "" }, { "docid": "0541887abeeff77437f700abc5f40dce", "score": "0.53255767", "text": "function reset15(){\r\n levTwo.y =0;\r\n}", "title": "" }, { "docid": "a996366adc8c2dce41e04eb5dd0c8aa5", "score": "0.53070885", "text": "setCursorY(y) {\n this._cur[1] = y\n }", "title": "" }, { "docid": "05e36643388dc9fd8ab1248df821901d", "score": "0.5298793", "text": "resetPosition() {\n this.x = 202;\n this.y = 405;\n }", "title": "" }, { "docid": "bf648ddb7d5893f36f57c42cac6f092a", "score": "0.52739614", "text": "function resetSlider(){\r\n seekRange.value = 0;\r\n }", "title": "" }, { "docid": "9139722d6cba6f6cd425b1c0e0baee1d", "score": "0.52634674", "text": "function reset(){\r\n player.x = 202;\r\n player.y = 373;\r\n\r\n}", "title": "" }, { "docid": "2d65f630ccda2750ed1bb1b302f9916c", "score": "0.5256061", "text": "function reset() {\n if (play) {\n playOrPause(years);\n }\n selected = null;\n compSelected = [];\n d3.select('path.state').style('opacity', 1);\n d3.select('#screen_select').style('display', 'flex');\n d3.select('#screen_single').style('display', 'none');\n d3.select('#screen_double').style('display', 'none');\n d3.select('#slider_wrapper').style('display', 'none');\n }", "title": "" }, { "docid": "aa640c773c2facbcea284a9afb820cbd", "score": "0.5255065", "text": "function reset() {\n count = 0;\n song.pause();\n song.load();\n clearInterval(groupOneInterval, groupTwoInterval, groupThreeInterval);\n dotsContainer.classList.remove('darkTheme');\n intro.forEach(item => {\n item.classList.remove('hidden');\n });\n dotsContainer.classList.add('hidden');\n dots.forEach(dot => {\n dot.classList.add('hidden');\n dot.style.color = 'black';\n });\n fireworksContainer.classList.add('hidden');\n fireworks.stop();\n}", "title": "" }, { "docid": "e02a0e559c1fab707badf2c472596118", "score": "0.52525496", "text": "resetStyles () {\n\t\tsuper.resetStyles()\n\t\tthis.selection.attr('marker-end', '')\n\t}", "title": "" }, { "docid": "581a06404c8c17719e42b0d50870d361", "score": "0.5246081", "text": "reset() {\n this.x = this.INITIAL_X_POSITION;\n this.y = this.INITIAL_Y_POSITION;\n }", "title": "" }, { "docid": "cf539696a92710a5e151ef100c8f374a", "score": "0.52389693", "text": "function sliderReset() {\n sliderSeek.value = 0;\n }", "title": "" }, { "docid": "9beade99e24e070488be2d51b6eb28ca", "score": "0.52363855", "text": "reset() {\n this._x = this.initialPosX;\n this._y = this.initialPosY;\n }", "title": "" }, { "docid": "f8723d533219b4f29f31b115dcdbc512", "score": "0.5233465", "text": "start() {\n this._updateSelection();\n }", "title": "" }, { "docid": "1d47f244084703d3b67713aeba3f5115", "score": "0.5227433", "text": "reset() {\n this.x = this.startX;\n this.y = this.startY;\n this.isActive = true;\n for (const timer in this.timers) {\n this.timers[timer] = 0;\n }\n this.effects.length = 0; // clear all effects\n }", "title": "" }, { "docid": "a52047200a9cbf98f728e610cb0467f3", "score": "0.5223005", "text": "function toggleCursor() {\n bubbleCursor = bubbleCursor ? false : true;\n }", "title": "" }, { "docid": "748acfe464fb405273bdac24f553b63a", "score": "0.5215916", "text": "function resetTracker() {\n // hide the tooltip\n if (tooltip) tooltip.hide();\n \n // hide the hovered series and point\n if (chart.hoverSeries) {\n chart.hoverSeries.setState();\n chart.hoverSeries = null;\n activePoint = null;\n }\n }", "title": "" }, { "docid": "8f006712124525fd301ed0cb5a08d725", "score": "0.5209791", "text": "reset() {\n this._forward = true;\n this._steps = 100;\n this._index = 0;\n }", "title": "" }, { "docid": "83f157a1fd5b755ae28af60a717c696e", "score": "0.52084965", "text": "function setCursor(digit, unset) {\n digitalWrite(P_CUE, 1);\n selectDigit(digit);\n digitalWrite(P_D0, !unset);\n digitalWrite(P_CU, 0);\n digitalWrite(P_WR, 0);\n digitalWrite(P_WR, 1);\n digitalWrite(P_CU, 1);\n }", "title": "" }, { "docid": "5138b3755b931e184d177d540d97f275", "score": "0.51973844", "text": "resetIncrement() {\n this.uptimeSettings.mouseDown = false;\n this.uptimeSettings.iteration = 1;\n }", "title": "" }, { "docid": "40dca63b858098b8a9c74fe564c8ef24", "score": "0.51950765", "text": "function FlyoverCursorsOff(){\n\t\tfriendCursor.renderer.enabled = false;\n\t\tenemyCursor.renderer.enabled = false;\n}", "title": "" }, { "docid": "ecfd09b996b59853e255a656aa36cb09", "score": "0.51886433", "text": "reset() {// Set x and y to starting x and y \n this.x = this.startX; //intial value of x\n this.y = this.startY; //intial value of y\n }", "title": "" }, { "docid": "cb9e3ba2dc117c880da6a7c717f9b9bd", "score": "0.5178095", "text": "function resetDemo() {\n resetSeries();\n showProgressBars();\n \n configureDemo();\n oneStep(++runId);\n }", "title": "" }, { "docid": "f8a20b3e98fe882f9c99dc3a78895282", "score": "0.51766485", "text": "clearEnergyDataSeries() {\n this.kineticEnergyDataSeries.clear();\n this.potentialEnergyDataSeries.clear();\n this.thermalEnergyDataSeries.clear();\n this.totalEnergyDataSeries.clear();\n\n this.setCursorValue( 0 );\n }", "title": "" }, { "docid": "65e477db81001268111cc5e2918c91f8", "score": "0.5175804", "text": "reset() {\n this.x = 205;\n this.y = 405;\n }", "title": "" }, { "docid": "41e6a0713ea67bafede5cdb6f4b7b913", "score": "0.51745", "text": "function reset(){\n // reveal word\n io.emit('revealWord', game.currentWord);\n\n game.emergencytimestatus = false;\n game.currentRoundTime = game.roundTime;\n game.firstGuess = 0;\n game.isHere = false;\n game.eraserStatus = false;\n game.pointsDecay = false;\n game.assignPoints = game.startPoints;\n game.hintnumber = -1;\n game.hintstatus = true;\n // refresh to remove inactive players\n\n // if the person drawing didnt disconnect\n // shift everyone up a spot\n //if(!game.disconnect){\n game.namestaken.push(game.namestaken.shift());\n game.clients.push(game.clients.shift());\n //}\n\n game.disconnect = false;\n\n dictionary_words.push(dictionary_words.shift());\n game.currentWord = dictionary_words[Math.floor((Math.random() * dictionary_words.length))];\n pushToHintArray();\n\n console.log(\"CW: \" + game.currentWord);\n\n io.emit('resetCanvas');\n // reset things that need to be reset\n}", "title": "" }, { "docid": "bf6e009d30a256aaddfc567a1f994c8e", "score": "0.51692474", "text": "reset() {\n\t\tthis.loop = true;\n\t\tif (restartMusic.paused) {\n\t\t\trestartMusic.play();\n\t\t}\n\t\tthis.x = 303;\n\t\tthis.y = 990;\n\t\tclearTimeout(oTimer.elapsedTimer);\n\t\toTimer.startTimer();\n\t\toGame.moviments = 0;\n\t\t/**deleting the items*/\n\t\tallItems.forEach(function(item) {\n\t\t\tallItems.pop();\n\t\t});\n\t\t/**throwing items on canvas again*/\n\t\toGame.throwItems();\n\t\t/*reactivate the keyboard!*/\n\t\tdocument.addEventListener('keyup', gKeys, true);\n\t}", "title": "" }, { "docid": "ce1ae70ecffb2570da05d0b5e8c2b857", "score": "0.51648164", "text": "reset () {\n this.y = this.gameHeight / 2;\n this.x = this.gameWidth + 20;\n this.rhinoAsset = ASSET_ARRAY[0];\n this.rhinoMode = RHINO_MODE.SLEEP;\n }", "title": "" }, { "docid": "ff23b72d2bf0331f4be6ec44aadbf926", "score": "0.51640934", "text": "function resumeWithCursor(newCursor) {\n changeStream.cursor = newCursor;\n processResumeQueue(changeStream);\n }", "title": "" }, { "docid": "ff23b72d2bf0331f4be6ec44aadbf926", "score": "0.51640934", "text": "function resumeWithCursor(newCursor) {\n changeStream.cursor = newCursor;\n processResumeQueue(changeStream);\n }", "title": "" }, { "docid": "ff23b72d2bf0331f4be6ec44aadbf926", "score": "0.51640934", "text": "function resumeWithCursor(newCursor) {\n changeStream.cursor = newCursor;\n processResumeQueue(changeStream);\n }", "title": "" }, { "docid": "ff23b72d2bf0331f4be6ec44aadbf926", "score": "0.51640934", "text": "function resumeWithCursor(newCursor) {\n changeStream.cursor = newCursor;\n processResumeQueue(changeStream);\n }", "title": "" }, { "docid": "9c53971c72f8388791de4b912f902e23", "score": "0.51574695", "text": "function resetPlayer() {\r\n\r\n\t//Setting player initial position\r\n\tplayer.x = 200;\r\n\tplayer.y = 430;\r\n\r\n}", "title": "" }, { "docid": "aeccf47e2f44887f90a841ef8574d6cb", "score": "0.5155243", "text": "onResetEvent(x, y) {\n this.pos.set(x, y);\n }", "title": "" }, { "docid": "f80e6fe06a5286036f7a3c1ad0f68c3a", "score": "0.515009", "text": "function reset(){\n vehicles.length=0;\n\tnoStroke();\n\t if(song.isPlaying()){\n\t song.stop();\n\t\t input.value('');\n\t }\n\t click=1;\n}", "title": "" } ]
b99f63ce2980a96d61c2a4902d62e845
creo la funzione per la stampa in pagina con handlebars;
[ { "docid": "a1e00a982a0d84a403768e5cb74cd569", "score": "0.5575457", "text": "function stampa_generale(info) {\r\n\r\n // dichiaro le variabili per integrare handlebars;\r\n var source = $('#disk-template').html();\r\n var template = Handlebars.compile(source);\r\n\r\n var context = {\r\n 'title': info.title,\r\n 'author': info.author,\r\n 'year': info.year,\r\n 'poster': info.poster,\r\n 'genre': info.genre\r\n }\r\n\r\n var html = template(context);\r\n\r\n // appendo il tutto nel contenitore con classe playlist;\r\n $('.playlist').append(html);\r\n }", "title": "" } ]
[ { "docid": "06928894a9092e84c163c9e122230cef", "score": "0.62280935", "text": "function callData() {\n\n //questo controllo mi dice che se il body ha la classe indice (ovvero, se il relativo oggetto jquery ha lunghezza maggiore di 1)\n //allora faccio la chiamata, in alternativa, ovvero se per esempio siamo in un altra pagina , per esempio form, la chiamata non viene neppure fatta,\n //cosi si evita di fare una chiamata ajax inutilmente.\n if ($('body.indice').length > 0) {\n\n $.ajax({\n url: 'http://localhost/crud_hotel_ajax/server/server_indice.php',\n method: 'GET',\n success: function (data) {\n // console.log(data);\n var data_hosts = JSON.parse(data);\n console.log(data_hosts);\n handlebarsPrintData(data_hosts);\n },\n });\n }\n\n }", "title": "" }, { "docid": "9ae8e0150160894d98a67c276afa464d", "score": "0.6021589", "text": "function print(data) {\n var source = $(\"#student-template\").html();\n var template = Handlebars.compile(source);\n\n\n // genero contenuto per l handlebars\n data.forEach(function(item) {\n var context = {\n nome: item.nome,\n cognome: item.cognome,\n voto: item.voto,\n descrizione_alunno: item.descrizione_alunno,\n };\n\n\n var html = template(context);\n $(\"#contenuto\").append(html);\n });\n}", "title": "" }, { "docid": "283fc900d4ee62ad55df4541f6f84afd", "score": "0.5848842", "text": "static get handlebars() {\n return handlebars;\n }", "title": "" }, { "docid": "093e4de44c300f2e515c502a5adea03b", "score": "0.5782014", "text": "function myReturnsTemplate(data) {\n // handle bar helper, check if a value equals another value\n Handlebars.registerHelper('if_eq', function (a, b, opts) {\n if (a == b)\n return opts.fn(this);\n else\n return opts.inverse(this);\n });\n //takes template and populate it with passed array\n var rawTemplate = document.getElementById(\"myReturnsTemplate\").innerHTML;\n var compiledTemplate = Handlebars.compile(rawTemplate);\n var mySalesnGeneratedHTML = compiledTemplate(data);\n // display template in choosen ID tag\n var myReturnsContainer = document.getElementById(\"myReturnsContainer\");\n myReturnsContainer.innerHTML = mySalesnGeneratedHTML;\n\n}", "title": "" }, { "docid": "230b18a386ede704579aeece522d9dc5", "score": "0.5768361", "text": "render() {\n /** code snippets */\n }", "title": "" }, { "docid": "2d348534b2d9395aa22d826b4e5ff35c", "score": "0.5718153", "text": "function renderPage(hbsObjects) {\n res.render(\"index\", hbsObjects);\n }", "title": "" }, { "docid": "0d11419045d66f8bb929962575334dcd", "score": "0.5690117", "text": "render(){}", "title": "" }, { "docid": "0a5cebaed32c1b1a47a2a15f6f7e4fc4", "score": "0.56844115", "text": "function maakTemplate(maakNavigatieKnop, idNavigatieKnop) {\n $('#container').empty()\n $('#container').append('<h3 id=\"titel\" class=\"col l6 offset-l3 center\"></h3>')\n if (maakNavigatieKnop) {\n $('#container').append('<button id=\"' + idNavigatieKnop + '\" class=\"col l2 offset-l1 btn-large navigatieKnop\">Terug</button>')\n }\n $('#container').append('<div class=\"col l12\" id=\"content\"></div>')\n }", "title": "" }, { "docid": "d9e23262f33a465903390e42c969dbc4", "score": "0.5672717", "text": "renderPage() {\n }", "title": "" }, { "docid": "9fffe433ebf09bd779054d5fb4177f01", "score": "0.5656295", "text": "function printSidebar(){\n templates.searchSidebar = Handlebars.compile(`{{#each this}} \n <li class=\"sidebar-list\">\n <a href=index.html#{{workid}}>{{titleshort}}</a>\n <hr>\n </li>\n {{/each}}`)\n let temp = templates.searchSidebar(works)\n\n let div = document.getElementById(\"sidebar-list\")\n div.innerHTML = temp\n}", "title": "" }, { "docid": "057b77b97f1a997bfb0058ca450926ba", "score": "0.563913", "text": "function searchInicialMO(URL, args, templateHandlebars, selector,currentPage) {\n\n\tvar count = 0;\n\tvar recordPerPage = 0;\n\n\tfunction callbackSuccess(data) {\n\t\tif (data.jsonList !== \"[]\" && data.jsonList !== null) {\n\t\t\ttemplate(data, templateHandlebars, selector);\n\t\t\tcount = data.count;\n\t\t\trecordPerPage = data.recordPerPage;\n\t\t\tvaloresGraficos(JSON.parse(data.graph));\n\t\t} else {\n\t\t\t$(\"#cthead\").css(\"display\", \"none\");\n\t\t\t$(\"#tabela\").html(\n\t\t\t\t\t\"<div align='center'><h4>\" + data.message + \"</h4></div>\");\n\t\t}\n\t};\n\tfunction callbackError() {\n\t};\n\tfunction callbackComplete(URL, args, templateHandlebars, selector, count,\n\t\t\trecordPerPage,currentPage) {\n\t\t\n\t\tvar items = $(\"#ctbody tr\");\n\t\t // only show the first 2 (or \"first per_page\") items initially\n items.slice(recordPerPage).hide();\n\t\t$(\"#pagination\").pagination({\n\t\t\titems : count,\n\t\t\titemsOnPage : recordPerPage,\n\t\t\tcssStyle : \"light-theme\",\n\t\t currentPage: currentPage,\n\t\t\tonInit : function() {\n\t\t\tif (count < recordPerPage + 1)\n\t\t\t\t$(\"#pagination\").hide();\n\t\t\telse\n\t\t\t\t$(\"#pagination\").show();\n\t\t\t\t$(\".prev\").hide();\n\t\t\t},\n\t\t\tonPageClick : function(pageNumber) { \n\t\t\t\n\t\t\t\tvar showFrom = recordPerPage * (pageNumber - 1);\n\t\t\t\tvar showTo = showFrom + recordPerPage;\n\t\t\t\t items.hide() // first hide everything, then show for the new page\n .slice(showFrom, showTo).show();\n\t\t\t\tif (pageNumber * recordPerPage > count - recordPerPage)\n\t\t\t\t\t$(\".next\").hide();\n\t\t\t\telse\n\t\t\t\t\t$(\".next\").show();\n\t\t\t\t$(\".prev\").show();\n\t\t\t\t$(\"#pagination\").show();\n\t\t\t\t}\n\t\t});\n\t};\n\n\t$.ajax({\n\t\ttype : 'GET',\n\t\turl : URL + args,\n\t\tdataType : \"json\", \n\t\tcontentType : \"application/json\",\n\t\tsuccess : function(data) {\n\n\t\t\tcallbackSuccess(data);\n\t\t},\n\t\terror : function(jqxhr, status, errorMsg) { \n\t\t\tcallbackError();\n\t\t},\n\t\tcomplete : function(jqXHR, status) {\n\t\t\tcallbackComplete(URL, args, templateHandlebars, selector, count,\n\t\t\t\t\trecordPerPage,currentPage);\n\n\t\t}\n\t});\n}", "title": "" }, { "docid": "6302e9c5985a259b79ff48c68b68ce79", "score": "0.56240934", "text": "function loadAddBookPage(request, response){\n response.render(\"Add_Book\");\n}", "title": "" }, { "docid": "626d3f27caf72a126c119124d1736e1a", "score": "0.55943894", "text": "function s(e){this.content=t.fillTemplate(this.template,e),i.callback&&i.callback.call(i.context,i.data)}", "title": "" }, { "docid": "458510ee8f384f1329a7077400b8c884", "score": "0.5584704", "text": "function editReturnsTemplate(data) {\n //takes template and populate it with passed array\n var rawTemplate = document.getElementById(\"editReturnTemplate\").innerHTML;\n var compiledTemplate = Handlebars.compile(rawTemplate);\n var editReturnGeneratedHTML = compiledTemplate(data);\n // display template in choosen ID tag\n var returnContainer = document.getElementById(\"editReturnContainer\");\n returnContainer.innerHTML = editReturnGeneratedHTML;\n}", "title": "" }, { "docid": "2280a5c391e44bd0bd515a6b2eaa9fed", "score": "0.5571975", "text": "index(request, response, next) {\n response.render('index');\n }", "title": "" }, { "docid": "e5fcee975ff920d6c1ee9a8e93284f63", "score": "0.55485195", "text": "function displayData(data) {\n const divUsers = document.getElementById(\"divUsers\");\n const usersData = `<ul> \n {{#each dataRows}} \n <li>\n <div> \n <p> Name : {{this.name}} </p> \n <img src={{this.avatar}} alt= 'No Avatar'>\n <button type=button onclick='moreDetails({{this.id}})'>More details...</button>\n <p id={{this.id}} style = 'display: none'> ID : {{this.id}} <br /> Created At :{{this.createdAt}}</p>\n </div>\n </li>\n {{/each}} \n </ul>`;\n const template = Handlebars.compile(usersData);\n divUsers.innerHTML = template({ dataRows: data });\n}", "title": "" }, { "docid": "1b9cd0bfe573448924112a866d29511f", "score": "0.55464476", "text": "function handlebarsPrintData(data) {\n\n var source = $('#row-ospite').html();\n var template = Handlebars.compile(source);\n\n for (var i = 0; i < data.length; i++) {\n\n var my_template = {\n id_: data[i]['id'],\n name_: data[i]['name'],\n last_name: data[i]['lastname'],\n };\n var html = template(my_template);\n\n $('tbody').append(html);\n // console.log(html);\n }\n\n }", "title": "" }, { "docid": "9c31989f6ef864565c99fa19977a1f13", "score": "0.55423665", "text": "bindHandlebarsTemplateToDom() {\n $(this.container).html(template());\n }", "title": "" }, { "docid": "c1633bfd0ba5d94f788ed7ecef08eb26", "score": "0.5535895", "text": "function printAuthors(){\n $.ajax(\n {\n 'url': 'http://localhost/php-ajax-dischi/dischi-author-filtered.php',\n 'method': 'GET',\n 'success': function(risposta){\n var source = $(\"#author-template\").html();\n var template = Handlebars.compile(source);\n for (var i = 0; i < risposta.length; i++) {\n var context = {\n author : risposta[i]\n };\n var html = template(context);\n $('.authors-list').append(html);\n }\n },\n 'error': function(){\n alert('Errore');\n }\n }\n );\n}", "title": "" }, { "docid": "e302c7a9db0b72a72e26c776125f9f98", "score": "0.5534422", "text": "function getData(){\n var source = $(\"#template\").html();\n var template = Handlebars.compile(source);\n $.ajax(\n {\n url: \"http://157.230.17.132:3016/todos\",\n method: \"GET\",\n success: function(risposta){\n for (var i = 0; i < risposta.length; i++) {\n var todo = {\n id: risposta[i].id,\n text: risposta[i].text,\n }\n var html = template(todo);\n $(\"#list\").append(html);\n }\n }\n }\n )\n}", "title": "" }, { "docid": "6900f274face910b6a89b8f8fc55e20c", "score": "0.55214447", "text": "setRoute() {\n var content = this.content;\n this.router.get(\"/\" + this.url, function(req, res, next) {\n res.render(\"userPageTemplate\", { content: content });\n });\n }", "title": "" }, { "docid": "66ad595dd4ac3401177064acd889f802", "score": "0.55054384", "text": "_registerPartial() {\n this.handlebars.registerPartial(...arguments);\n }", "title": "" }, { "docid": "24d8d85db0f06e300d41b846f466011b", "score": "0.5501551", "text": "render (self) { return html``; }", "title": "" }, { "docid": "9dc0084c80dd87b878bc7b2712590fbe", "score": "0.5453562", "text": "function displayOverview(profile){\n var source = $('#overview-template').html();\n var template = Handlebars.compile(source);\n console.log('overview', profile);\n $('#menu-list').append(template(profile));\n}", "title": "" }, { "docid": "03a2eff4ce532bb8a55f1b790829525b", "score": "0.54517984", "text": "function openAddSupplierPage() {\n emptyContainer();\n $(\".homePage\").append(supplierRegistrationHtml(\"Tedarikçi Hesabı\"));\n}", "title": "" }, { "docid": "a8860d757bbf2c48b055cf35814e8fce", "score": "0.54472405", "text": "handleCreate(req, res) {\n res.render('blogs/blogs-single', {\n\n });\n }", "title": "" }, { "docid": "bc46164be107fc4a1cafb9184b0f3c96", "score": "0.543895", "text": "function GenerateCustomPage(request, response, i, id) { // id is for the template\n t.GenerateCustomPage(request, response, i, id);\n}", "title": "" }, { "docid": "55fe62ad622b0629df806d2551213bc2", "score": "0.54376423", "text": "function handleRender(req, res) { /* ... */ }", "title": "" }, { "docid": "c6b55900819207b319f7eb0256f6a464", "score": "0.5432905", "text": "bindHandlebarsTemplateToDom() {\n $(this.container).html(template(this.brands));\n }", "title": "" }, { "docid": "9342fc33c33006610c80b9d5b416b875", "score": "0.54262", "text": "function OServiceList(bCode) {\r\n if (bCode != emptyId()) {\r\n //edit mode\r\n if (id != emptyId()) {\r\n $.ajax({\r\n url: '/Order/ServiceList',\r\n type: 'POST',\r\n data: { id: id, bCode: bCode },\r\n success: function (Resualt) {\r\n var source = $('#OServiceSource').html();\r\n var template = Handlebars.compile(source);\r\n var list = template({ serviceList: Resualt });\r\n oServiceList = Resualt;\r\n $('#oService tbody').html(list);\r\n },\r\n error: function () {\r\n notifiction(3, 'عدم فراخوانی رکورد ها');\r\n }\r\n });\r\n }\r\n //add mode\r\n else {\r\n $.ajax({\r\n url: '/Order/ServiceList',\r\n type: 'POST',\r\n data: { bCode: bCode },\r\n success: function (Resualt) {\r\n var source = $('#OServiceSource').html();\r\n var template = Handlebars.compile(source);\r\n var list = template({ serviceList: Resualt });\r\n $('#oService tbody').html(list);\r\n },\r\n error: function () {\r\n notifiction(3, 'عدم فراخوانی رکورد ها');\r\n }\r\n });\r\n }\r\n }\r\n else {\r\n $('#oService tbody').html(\"\");\r\n }\r\n}", "title": "" }, { "docid": "79efa46d71fb88503e686ffe4db998ec", "score": "0.5413143", "text": "function DocPage()\n{\n templatePage(\"dashboard\");\n}", "title": "" }, { "docid": "6c4c585f1efc036088085406903c5246", "score": "0.5404081", "text": "function handleRender(req, res) { /* ... */\n}", "title": "" }, { "docid": "95fb943f50a103b5a764a314a36d9b58", "score": "0.54013926", "text": "adminSummaryPage() {\n return <h2>Admin</h2>;\n }", "title": "" }, { "docid": "9122c4c88e407db4741bf8be92bd3d76", "score": "0.53754693", "text": "getTemplate(response) {\n let voices = response.voices\n let template = ''\n template += '<!DOCTYPE html>'\n template += '<html lang=\"en\">'\n template += '<head>'\n template += '<meta charset=\"utf-8\">'\n template +=\n '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">'\n template += '<meta name=\"description\" content=\"\">'\n template += '<meta name=\"author\" content=\"\">'\n template += '<title>Speedy</title>'\n template +=\n '<link href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css\" rel=\"stylesheet\">'\n template += '<style type=\"text/css\">'\n template += 'body {'\n template += 'padding-top: 54px;'\n template += '}'\n template += '@media (min-width: 992px) {'\n template += 'body {'\n template += 'padding-top: 56px;'\n template += '}'\n template += '}'\n template += '.portfolio-item {'\n template += 'margin-bottom: 30px;'\n template += '}'\n template += '.pagination {'\n template += 'margin-bottom: 30px;'\n template += '}'\n template += '.font-datetime { font-size: 12px; color: #999999; }'\n template +=\n '.font-datetime-jumbotron { font-size: 15px; font-weight: 300; color: #999999; margin-bottom: 10px; }'\n template += '</style>'\n template += '</head>'\n template += '<body>'\n template +=\n '<nav class=\"navbar navbar-expand-lg navbar-dark bg-dark fixed-top\">'\n template += '<div class=\"container\">'\n template += '<a class=\"navbar-brand\" href=\"#\">&nbsp;</a>'\n template +=\n '<button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarResponsive\" aria-controls=\"navbarResponsive\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">'\n template += '<span class=\"navbar-toggler-icon\"></span>'\n template += '</button>'\n template += '<div class=\"collapse navbar-collapse\" id=\"navbarResponsive\">'\n\n template += '</div>'\n template += '</div>'\n template += '</nav>'\n template += '<div class=\"container\">'\n\n voices.map((voice, index) => {\n if (index < 1) {\n template += '<header class=\"jumbotron my-4\">'\n template += '<h1 class=\"display-3\">' + voice.author + '</h1>'\n template += '<p class=\"lead\">' + voice.script + '</p>'\n template +=\n '<p class=\"font-datetime-jumbotron\"> Received at: ' +\n moment(voice.createdAt).format('MMM DD, HH:mm:ss a') +\n '</p>'\n template += '<audio controls>'\n template += '<source src=\"' + voice.voice + '\" type=\"audio/mpeg\">'\n template += '</audio>'\n template += '</header>'\n\n template += '<div class=\"row text-center\">'\n }\n\n if (index > 0) {\n template += '<div class=\"col-lg-4 col-md-6 mb-4\">'\n template += '<div class=\"card\">'\n template += '<div class=\"card-body\">'\n template += '<h4 class=\"card-title\">' + voice.author + '</h4>'\n template += '<p class=\"card-text\">' + voice.script + '</p>'\n template +=\n '<p class=\"font-datetime\"> Received at: ' +\n moment(voice.createdAt).format('MMM DD, HH:mm:ss a') +\n '</p>'\n template += '</div>'\n template += '<div class=\"card-footer\">'\n template += '<audio controls>'\n template += '<source src=\"' + voice.voice + '\" type=\"audio/mpeg\">'\n template += '</audio>'\n template += '</div>'\n template += '</div>'\n template += '</div>'\n }\n })\n\n template += '</div>'\n template += '</div>'\n template += '<footer class=\"py-5 bg-dark\">'\n template += '<div class=\"container\">'\n template +=\n '<p class=\"m-0 text-center text-white\">Copyright &copy; Your Website 2018</p>'\n template += '</div>'\n template += '</footer>'\n template += '</body>'\n template += '</html>'\n\n return template\n }", "title": "" }, { "docid": "f59ffdc13005f51fc4759e02a30c7a25", "score": "0.5371285", "text": "showHome(req, res) {\n console.log('in showHome function');\n res.render('blogs/blogs-homepage', {\n blog: res.locals.blogs,\n });\n }", "title": "" }, { "docid": "78067fff274621ba13a6e10829f422de", "score": "0.5370063", "text": "function printItems(list){\n\n var source = $(\"#template\").html();\n var template = Handlebars.compile(source);\n\n for (var i = 0; i < list.length; i++) {\n var base = list[i];\n\n var daInserire = {\n text : base.text,\n id : base.id,\n date : base.date,\n check : base.spunta,\n\n }\n\n var html = template(daInserire);\n $(\".listItems\").append(html);\n\n }//fine ciclo\n\n\n\n}", "title": "" }, { "docid": "35abd2019b7ec907e6cbe0746b7c56b5", "score": "0.53670543", "text": "function sendPOSTRender(page){\n $.ajax({\n type: \"POST\",\n url : \"render\",\n data: {page : page},\n success:(res)=>{\n $(\"#content\").html(res);\n },\n error:(res)=>{\n $(\"#content\").html(res);\n }\n })\n}", "title": "" }, { "docid": "bb96112ebe23f425ffd8ce982d994e26", "score": "0.5366857", "text": "get Template(){\n return /*html*/`\n <div class=\"card\">\n <img class=\"img-fluid\" src=\"${this.img}\" alt=\"\"/>\n <h1>${this.name}</h1>\n <h3>${this.types}</h3>\n <button class=\"btn btn-danger\" onclick=\"app.wildPokemonController.catchPokemon(${this.Pokemon})\">Catch Pokemon</button>\n </div>\n `\n }", "title": "" }, { "docid": "7b1f42d1ce162b03c3b51380d1d885a6", "score": "0.53657967", "text": "render() {\n return _tmpl$b;\n }", "title": "" }, { "docid": "43af77df91a86121ba89a920650eb33b", "score": "0.53644794", "text": "renderPage(num){\n return `\n <h3>Page - ${num}</h3>\n <h3>By: ${this.author}</h3>\n <p>${this.content}</p>\n <hr>\n `\n }", "title": "" }, { "docid": "591c002b8bed81e6cf7e60282d1429a5", "score": "0.5355135", "text": "function render(){\n $.ajax({\n type:'get',\n url:'/product/queryProductDetailList',\n data:{\n page:page,\n pageSize:pageSize\n },\n success: function (re) {\n //console.log(re);\n $('tbody').html(template('tabTpl',re));\n $('#paginator').bootstrapPaginator({\n bootstrapMajorVersion:3,\n currentPage:page,\n size:'small',\n useBootstrapTooltip: true,\n tooltipTitles: function (type, page, current) {\n switch (type){\n case 'first':\n return '首页';\n case 'prev':\n return '上一页';\n case 'next':\n return '下一页';\n case 'last':\n return '尾页';\n case 'page':\n return page;\n }\n },\n itemTexts: function (type, page, current) {\n //console.log(type);\n //console.log(page);\n switch (type){\n case 'first':\n return '首页';\n case 'prev':\n return '上一页';\n case 'next':\n return '下一页';\n case 'last':\n return '尾页';\n case 'page':\n return page;\n }\n },\n totalPages:Math.ceil(re.total/re.size),\n onPageClicked: function (a,b,c,p) {\n page = p;\n render();\n }\n })\n }\n })\n }", "title": "" }, { "docid": "bf8beb4596e9a8608db9920b7d95ff24", "score": "0.53512216", "text": "function _page1_page() {\n}", "title": "" }, { "docid": "39d3aff992b8fd55813e82ae22cdea1f", "score": "0.53506607", "text": "function template() {}", "title": "" }, { "docid": "a8c241c28db67bf291b2060e12206845", "score": "0.534594", "text": "render() {\n return _tmpl$4;\n }", "title": "" }, { "docid": "abc5fe21b93fd0c6f73452c5106fcf8a", "score": "0.53433514", "text": "function initMain(){\n var forMainTemplate = document.getElementById(\"for-main\").innerHTML;\n var forMainBuilder = Handlebars.compile(forMainTemplate);\n var forMainHTML = forMainBuilder(this);\n\n document.getElementById(\"main-content\").innerHTML = forMainHTML;\n}", "title": "" }, { "docid": "6b3d7c643da722bb6e6e810d841590da", "score": "0.53428996", "text": "showPage($page, callback) {\n // $from.fadeOut();\n // $to.fadeIn();\n this.$app.find('section').addClass('hide');\n $page.removeClass('hide');\n\n if (typeof callback === 'function') {\n callback();\n }\n }", "title": "" }, { "docid": "2f05acf5601642781fd89fd7749bc526", "score": "0.5340839", "text": "ofertasDominio(idDominio,nomeDominio,logoDominio){\n \n \n $(\".sidemenu nav ul li\").removeClass(\"ativo\");\n $(\"#menuImoveis\").addClass(\"ativo\");\n\n this._content.html(`\n \n <div class=\"container\">\n \n <div class=\"row view-principal\" view-name=\"view-principal\">\n <div class=\"col-12 wow fadeInUp\">\n <h1>Ofertas do domínio: <b>${nomeDominio}</b></h1>\n <p>\n <img src=\"${app.urlCdn}/${logoDominio}\" style=\"width:200px;\" />\n </p>\n \n\n <div class=\"row\">\n <div class=\"col-xl-7 col-lg-7 col-md-7 col-sm-7 col-12 offset-xl-5 offset-lg-5 offset-md-5 offset-sm-5\" style=\"padding-right:0px;\">\n \n \n\n <a href=\"javascript:void(0)\" style=\"float: right;\" onclick=\"app.adicionarOfertas()\" class=\"btn btn-primary\" title=\"Adicionar nova oferta\">\n <i class=\"fa fa-plus\"></i> Adicionar\n </a>\n\n\n\n <!-- BUSCA AVULSA -->\n <div class=\"busca-avulsa\">\n <div class=\"input-group mb-3\">\n <div class=\"input-group-prepend\">\n <span class=\"input-group-text\">\n <i class=\"fa fa-search\" aria-hidden=\"true\"></i>\n </span>\n </div>\n <input type=\"text\" class=\"form-control\" placeholder=\"Faça uma pesquisa\" onkeyup=\"app.filtrotabela();\" id=\"filtroTabela\">\n </div>\n </div>\n <!-- BUSCA AVULSA -->\n \n </div>\n </div>\n <div class=\"table-responsive\">\n \n <table class=\"table table-striped\">\n\n <thead>\n <th>#</th>\n <th></th>\n\n <th>Views</th>\n <th>Cliques</th>\n <th>Compras</th>\n\n <th>Nome</th>\n <th>Tipo</th>\n <th><i class=\"fa fa-calendar\"></i> Início</th>\n <th>Valor</th>\n <th>CashBack</th>\n <th>Origem</th>\n <th style=\"width:190px;\">Ações</th>\n </thead>\n\n <tbody id=\"conteudoTabela\">\n ${this.carregandoTabela}\n </tbody>\n\n </table>\n\n </div>\n \n <div class=\"text-right\">\n <a href=\"javascript:void(0)\" onclick=\"app.adicionarOfertas()\" class=\"btn btn-primary\" title=\"Adicionar nova oferta\">\n <i class=\"fa fa-plus\"></i> Adicionar\n </a>\n\n \n \n </div>\n\n\n </div>\n </div>\n\n </div>\n\n `);\n\n this.animarTransicao();\n\n\n }", "title": "" }, { "docid": "1202860013d2586d44ab80308af06575", "score": "0.5340368", "text": "pageTrackerTemplate(to) {\n return {\n page_title: window.location.pathname\n // page_path: to.path\n }\n }", "title": "" }, { "docid": "869b8b67fd6fbddff631f28ba36dbe93", "score": "0.53377616", "text": "function tmpl(data) {\n var _tmpl = _.template('' +\n '<div id=\"dialog-global-pin\">' +\n '<div class=\"global-pin-bd\">' +\n '<div id=\"pin-wrap\" class=\"bd-wrap\">' +\n '<h4>把本帖推荐到粉丝首页第一条位置</h4>' +\n '<% if (discount > 0) { %>' +\n '<p><del class=\"original-price\">原价:<%= amount %> 雪球币</del><span class=\"discount-price\"><%= resultPrice %> 雪球币</span><span class=\"discount\">限时优惠 <%= discount %>%</span></p>' +\n '<% } %>' +\n '<% if (balance >= resultPrice) { %>' +\n '<p class=\"tip\">' +\n '应付:<%= resultPrice %> 雪球币,' +\n '<span class=\"balance\">帐号余额:<%= balance %> 雪球币</p>' +\n '</p>' +\n '<% } else { %>' +\n '<p class=\"tip warn\">' +\n '应付:<%= resultPrice %> 雪球币,' +\n '<span class=\"balance\">帐号余额:<%= balance %> 雪球币,请先购买雪球币</p>' +\n '</p>' +\n '<% } %>' +\n '<div class=\"global-pin-ft\">' +\n '<% if (balance > resultPrice) { %>' +\n '<a href=\"#\" class=\"btns btn-confirm\" data-amount=\"<%= amount %>\">购买粉丝头条</a>' +\n '<% } else { %>' +\n '<a href=\"#\" class=\"btns btn-confirm disable\" data-amount=\"<%= amount %>\">购买粉丝头条</a>' +\n '<% } %>' +\n '<a href=\"/c/deposit\" target=\"_blank\" class=\"btn-recharge\">购买雪球币</a>' +\n '</div>' +\n '</div>' +\n '<div id=\"recharge-wrap\" class=\"bd-wrap\" style=\"display:none;\">' +\n '<p>请在新窗口购买雪球币,完成之前请不要关闭此窗口</p>' +\n '<div class=\"recharge-ft\">' +\n '<a href=\"#\" class=\"btns btn-done\">已完成</a>' +\n '<a href=\"/c/deposit\" target=\"_blank\" class=\"btns btn-redo\">重新购买</a>' +\n '</div>' +\n '</div>' +\n '</div>' +\n '</div>');\n\n return $(_tmpl(data));\n }", "title": "" }, { "docid": "21c8c95c86dd6aa893174203ffbb09bb", "score": "0.5331919", "text": "function router(nav)\n{\n\n ////if get a route request this router will exicute\n search_route.route('/').\n get((req,res)=>{\n ////showing view all ejs file\n res.render('search.ejs',{nav})\n\n });\n return search_route;\n}", "title": "" }, { "docid": "5c467e5feeccd6ae47c60eec9bb72d6a", "score": "0.5326751", "text": "get Template() {\n return /*html*/ `\n <div class=\"col-3 card shadow-light-sm m-3\">\n <h1>${this.title}<button class=\"text-danger close mt-2\"\n onclick=\"app.taskController.delete('${this.id}')\"><span>&times;</span></button></h1>\n <h5>New To Do</h5>\n <p>Choose your Todo's colors:</p>\n\n \n \n <form onsubmit=\"app.todosController.create(event, '${this.id}',)\">\n <div class=\"form-group\">\n \n <div>\n <input type=\"color\" id=\"head\" name=\"color\" value=\"#e66465\">\n </div>\n <input type=\"text\" name=\"title\" minlength=\"3char\" maxlength=\"50char\"\n placeholder=\"Enter To Do Here...\">\n <button class=\"btn btn-success btn-sm\" type=\"submit\"> <i class=\"fa fa-plus\"\n aria-hidden=\"true\"></i></button>\n <div class=\"row\">\n <div class=\"col\">\n <h4><span>${this.Todo}</span></h4>\n </div>\n </div>\n </div>\n </form>\n </div>\n \n `\n }", "title": "" }, { "docid": "53bdc7cee64ac33be79a9c0619a87ec1", "score": "0.53241026", "text": "function renderElement(data) {\r\n\r\n // Compilo handlebars, il context e aggiungo alla lista.\r\n var source = $(\"#list-template\").html();\r\n var template = Handlebars.compile(source);\r\n\r\n var context = {\r\n \"id\": data.id,\r\n \"text\": data.text\r\n };\r\n\r\n var html = template(context);\r\n $(\"#to-do-list\").append(html);\r\n }", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.53214693", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.53214693", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.53214693", "text": "render() {}", "title": "" }, { "docid": "e21e38b62b6899150dd6b1f9db4d4cec", "score": "0.5309136", "text": "function cargarProcesos()\n {\n var url = \"layouts/procesos/index.php\";\n\n $.post(url, function(data){\n $(\"#page-wrapper\").html(data);\n });\n \n }", "title": "" }, { "docid": "6d910fa09e6c5b987390d53e6e9e5e46", "score": "0.5307072", "text": "function stampaRisultato(dataResults) {\n var source = $(\"#template\").html();\n var template = Handlebars.compile(source);\n\n for ( var i = 0; i < dataResults.length; i++) {\n\n var arrayDataResutls = dataResults[i];\n console.log(arrayDataResutls);\n\n if (dataResults <= 0) {\n\n console.log( \"non ci sono risultati\");\n\n }\n\n // dichiaro le variabili\n\n // titolo serie tv\n var titoloSerie = arrayDataResutls.name;\n var voto = arrayDataResutls.vote_average;\n //converto i numeri da decimali a interi\n var star =convertoVoto(voto);\n\n // SCHEDA\n\n var scheda = ( {\n title: arrayDataResutls.title,\n name: titoloSerie,\n original_title: arrayDataResutls.original_title,\n original_language: linguaBandiera(arrayDataResutls.original_language), // --- > #bandiere\n poster_path: arrayDataResutls.poster_path,\n overview: arrayDataResutls.overview,\n vote_average: star,\n });\n\n\n\n // inserisco il template all'interno del contenitore\n var html = template(scheda);\n $(\"#container\").append(html);\n }\n\n }", "title": "" }, { "docid": "63513123c2117e82278a2ba8770d6ad4", "score": "0.5303376", "text": "showBlogs(req, res) {\n console.log('in showBlogs function');\n res.render('blogs/blogs-index', {\n blog: res.locals.blogs,\n });\n }", "title": "" }, { "docid": "d2411e98e490b63f13f7a514fe221024", "score": "0.53006876", "text": "function renderPage() {\n context.renderContent(loggedPageTemplate({ notesData, addNote, onEdit, onDelete, onSave }));\n }", "title": "" }, { "docid": "8ed63e53753709d12c0aad7b4ab8ac5d", "score": "0.5299351", "text": "bindPage() {\n this.$app.find('#header').on('click', '.main-menu', (e)=>{\n let $ele = $(e.target);\n let triggerValue = $ele.data('menu');\n let $triggerSection = this.$app.find('#' + triggerValue);\n\n if($ele.hasClass('active')){\n return;\n }\n\n this.showPage($triggerSection);\n\n // history push\n if(!history.state || history.state.page !== triggerValue)\n history.pushState({ 'page': triggerValue }, '', triggerValue);\n\n this.afterPage(triggerValue);\n\n // if (typeof callback === 'function') {\n // callback();\n // }\n });\n }", "title": "" }, { "docid": "4e6343945c11f535a2a72ca7012525e1", "score": "0.5294419", "text": "configure(R,Events){\n\t\tEvents.register({\n\t\t\t'before:middleware':function(){\n\t\t\t\tR.app.get('/raptor/home',function(req,res,next){\n\t\t\t\t\treq.viewPlugin.set('raptorpanel_sidebar_main','<li class=\"nav-item\"><a class=\"nav-link ngPortal-embedded\" target=\"_blank\" href=\"/public/'+R.bundles['apidoc'].vendor+'/apidoc/base.html\"> Documentación v'+R.bundles['apidoc'].manifest.version+'</a></li>')\n\t\t\t\t\tnext()\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "702ef0244ac27a4b6cedb8f7d06ab899", "score": "0.5292297", "text": "function display(){\r\n\r\n\t\t// $(\"#conteudo\").load(\"/ripe/pages/aniversariante/listaAniversariante.jsf\");\r\n\r\n}", "title": "" }, { "docid": "01d6364fa74255b3956c0443d2a6997d", "score": "0.52875125", "text": "function openAddCustomerPage() {\n emptyContainer();\n $(\".homePage\").append(customerRegistrationHtml(\"Müşteri Hesabı\"));\n}", "title": "" }, { "docid": "1f7a24ac41f2058e05274265a72bfd67", "score": "0.52825034", "text": "function ObtenerFormaSucursales(IdCliente) {\n TMPL(\"tmplSucursales.html\", function (Template) {\n $(\"body\").append(Template);\n $(\"#modalSucursales\").modal();\n $(\"#modalSucursales\").attr(\"idCliente\", IdCliente)\n $(\"#modalSucursales\").on(\"hidden.bs.modal\", function () { $(\"#modalSucursales\").remove(); /*ListarSucursales();*/ });\n\n $(\"#PaginadorSucursales #btnAnteriorPagina\").click(function () {\n var Pagina = parseInt($(\"#PaginadorSucursales #txtPagina\").val()) - 1;\n Pagina = (Pagina < 1) ? 1 : Pagina;\n $(\"#PaginadorSucursales #txtPagina\").val(Pagina).change();\n });\n\n $(\"#PaginadorSucursales #btnSiguientePagina\").click(function () {\n var Paginas = parseInt($(\"#PaginadorSucursales #lblPaginas\").text());\n var Pagina = parseInt($(\"#PaginadorSucursales #txtPagina\").val()) + 1;\n Pagina = (Pagina > Paginas) ? Paginas : Pagina;\n $(\"#PaginadorSucursales #txtPagina\").val(Pagina).change();\n });\n\n $(\"#PaginadorSucursales #txtPagina\").change(function () {\n ListarSucursales(IdCliente);\n }).change();\n\n $(\"#btnObtenerFormaAgregarSucursal\").click(ObtenerFormaAgregarSucursal);\n\n ListarSucursales(IdCliente)\n });\n}", "title": "" }, { "docid": "74f59057f0dd81df94bdad973a3e1684", "score": "0.5273509", "text": "function ajax_search(services,lon,lat,number_of_rooms,number_of_beds,km,app_in_page) {\n //effettuo una chiamata ajax per recuperare eventuali appartamenti sponsorizzati\n $.ajax({\n \"url\": \"http://localhost:8000/api/advanced/sponsorships\",\n \"method\": \"GET\",\n \"data\": {\n 'services': services,\n \"lon\": lon,\n \"lat\": lat,\n \"number_of_rooms\": number_of_rooms,\n \"number_of_beds\": number_of_beds,\n \"range\": km\n },\n \"success\": function(data) {\n //svuoto il contenuto della pagina\n $(\".marked\").html(\"\");\n $(\".normal\").html(\"\");\n $(\".no-result\").remove();\n // se i risultati sono maggiori di 0 inserisco gli appartamenti in pagina\n if (data.length > 0) {\n //ciclo gli appartamenti\n for (var i = 0; i < data.length; i++) {\n //creo una variabile contenente l'appartamento corrente\n var appartamento_corrente = data.results[i];\n //inserisco l'id nell array per tenerne traccia\n app_in_page.push(appartamento_corrente.apartment_id);\n //creo l'oggetto da restituire ad handlebars\n var context = {\n \"slug\": appartamento_corrente.slug,\n \"id\" : appartamento_corrente.apartment_id,\n \"image\": appartamento_corrente.cover_image,\n \"title\": appartamento_corrente.description_title,\n \"description\" : appartamento_corrente.description,\n \"beds\": appartamento_corrente.number_of_beds,\n \"rooms\": appartamento_corrente.number_of_rooms,\n \"bathrooms\": appartamento_corrente.number_of_bathrooms,\n \"square_meters\":appartamento_corrente.square_meters,\n \"lon\": appartamento_corrente.lon,\n \"lat\": appartamento_corrente.lat\n }\n var html_finale = template(context);\n $(\".marked\").append(html_finale);\n }\n\n //invoco la funzione per convertire gli indirizzi\n reverseGeocode(\"#index\", \".box\", \"#address\");\n };\n //effettuo una chiamata ajax per recuperare eventuali appartamenti non sponsorizzati\n $.ajax({\n \"url\": \"http://localhost:8000/api/advanced/apartments\",\n \"method\": \"GET\",\n \"data\": {\n 'services': services,\n \"lon\": lon,\n \"lat\": lat,\n \"number_of_rooms\": number_of_rooms,\n \"number_of_beds\": number_of_beds,\n \"range\": km\n },\n \"success\": function(data) {\n // se i risultati sono maggiori di 0 inserisco gli appartamenti in pagina\n if (data.length > 0) {\n //ciclo gli appartamenti\n for (var i = 0; i < data.length; i++) {\n //creo una variabile contenente l'appartamento corrente\n var appartamento_corrente = data.results[i];\n //verifico se l'appartamentoè già presente in pagina\n if (!app_in_page.includes(appartamento_corrente.id)) {\n //inserisco l'id nell array per tenerne traccia\n app_in_page.push(appartamento_corrente.id);\n //creo l'oggetto da restituire ad handlebars\n var context = {\n \"slug\": appartamento_corrente.slug,\n \"id\" : appartamento_corrente.id,\n \"image\": appartamento_corrente.cover_image,\n \"title\": appartamento_corrente.description_title,\n \"description\" : appartamento_corrente.description,\n \"beds\": appartamento_corrente.number_of_beds,\n \"rooms\": appartamento_corrente.number_of_rooms,\n \"bathrooms\": appartamento_corrente.number_of_bathrooms,\n \"square_meters\":appartamento_corrente.square_meters,\n \"lon\": appartamento_corrente.lon,\n \"lat\": appartamento_corrente.lat\n }\n var html_finale = template(context);\n $(\".normal\").append(html_finale);\n }\n }\n //invoco la funzione per convertire gli indirizzi\n reverseGeocode(\"#index\", \".box\", \"#address\");\n } else if($(\".marked a\").length == 0 && $(\".normal a\").length == 0) {\n //se non sono presenti appartamenti in pagina inserisco un messaggio\n $(\".appartamenti .container\").append(\"<h3 class='text-center no-result mt-3'>Nessun appartamento trovato</h3>\");\n }\n },\n \"error\": function() {\n }\n })\n },\n \"error\": function() {\n }\n })\n }", "title": "" }, { "docid": "1bcc5dfed2151c317c640206dcb12ca0", "score": "0.52721", "text": "function getAllCurrentUserPins() {\n\n $.ajax({\n url: \"/api/current_user\",\n type: \"GET\",\n data: \"JSON\"\n }).success(function(data){\n // console.log(data);\n var guidePinsHTML = HandlebarsTemplates['pins/index'](data);\n // console.log(guidePinsHTML);\n\n $('.popin').html(guidePinsHTML).fadeIn();\n\n });\n\n}", "title": "" }, { "docid": "02fbdfac073b76f2a81502ed7a7bcac3", "score": "0.52684855", "text": "function RenderPartialGenericFotografia($idPartial, $id_catalogo_fotografia,$id_usuario_servicio,$id_auxiliar) {\n\n \ncallModal('cls');\n var url = \"/IguanaTrip/public/render/\" + $idPartial;\n $.ajax({\n type: \"GET\",\n url: url,\n data: {\n }}).done(function (newHtml) {\n\n /* output the javascript object to HTML */\n $('#basic-modal-content').html(newHtml.newHtml);\n $('#basic-modal-content').find('#id_catalogo_fotografia').val($id_catalogo_fotografia);\n $('#basic-modal-content').find('#id_usuario_servicio').val($id_usuario_servicio);\n $('#basic-modal-content').find('#id_auxiliar').val($id_auxiliar);\n $(\".simplemodal-wrap\").LoadingOverlay(\"hide\", true);\n });\n}", "title": "" }, { "docid": "f52319a51bd180d1ca15fad07394f552", "score": "0.5265674", "text": "function createHTML(data) {\n var rawTemplate = documument.getElementById(\"myTemplate\").innerHTML;\n var compiledTemplate = Handlebars.compile(rawTemplate);\n var myGeneratedHTML = compiledTemplate(data);\n\n var myContainer = documument.getElementById(\"myContainer\");\n myContainer.innerHTML = myGeneratedHTML;\n}", "title": "" }, { "docid": "0db4e77893a3cc2ea6fc2338cfe4df39", "score": "0.52542067", "text": "function displayTodos() {\n $.post('php/todos.php', '{ \"action\" : \"get\" }',\n function(answer) {\n todosJSON = answer;\n // console.log(answer);\n processedTodosJSON = $.processData(todosJSON, options.dataprocessing);\n // Create pagination element with options from var\n $(\"div.for-pagination\").pagination(processedTodosJSON, options.pagination);\n }, 'json');\n\n }", "title": "" }, { "docid": "86c99c6dd6da1fc1b02c544b819d3d75", "score": "0.52492666", "text": "function indexEjsHandler(req, res) {\n res.status(200).render('pages/index');\n}", "title": "" }, { "docid": "21d1f49b41d29a41997bdfc9be70ca99", "score": "0.5246035", "text": "function displayProf(profile){\n var source = $('#prof-template').html();\n var template = Handlebars.compile(source);\n $('.bio').append(template(profile));\n}", "title": "" }, { "docid": "be67878af553b54259bc610ed165409a", "score": "0.5243005", "text": "function todos(){\n alertFormaPago();\n pago();\n}", "title": "" }, { "docid": "5da837d5cb8dfc78f14c58466ee30c55", "score": "0.52395344", "text": "function adaptationTemplate(){\n\tstopEdit();\n\tvar objectParent = constructObject(pageAdaptation);\n\t//runPage(objectParent);\n\t$(\"head\").html(\"\");\n\t$(\"body\").html(\"\");\n\trunPage(objectParent, $(\"body\"), $(\"head\"));\n}", "title": "" }, { "docid": "a3ca055617c59bdd1c9d3d6258c21ef3", "score": "0.52387995", "text": "function outputData(object, type) {\n\n var source = $(\"#li\").html();\n var template = Handlebars.compile(source);\n\n var numberResults = object.total_results;\n var results = object.results;\n\n var container = $(\"ul\");\n var countElement = $(\"#counter\");\n var counter = Number(countElement.text());\n countElement.text(counter + numberResults);\n\n for (var i = 0; i < results.length; i++) {\n\n var result = results[i];\n var titleLangue = result.original_language;\n var iconLangue = getIcon(titleLangue);\n\n if (result.poster_path == null) {\n var poster = \"https://zadroweb.com/wp-content/uploads/2013/07/page-not-found-300x270.jpg\"\n } else {\n var poster = \"https://image.tmdb.org/t/p/w300\" + result.poster_path;\n }\n\n if (type === \"film\") {\n\n var data = {\n titolo : result.title,\n titolo_originale : result.original_title,\n lingua : \"<span class='flag-icon flag-icon-\" + iconLangue + \"' title='\" + titleLangue + \"'></span>\",\n voto : result.vote_average,\n urlimg : poster\n };\n } else if (type === \"serie\") {\n\n var data = {\n titolo : result.name,\n titolo_originale : result.original_name,\n lingua : \"<span class='flag-icon flag-icon-\" + iconLangue + \"' title='\" + titleLangue + \"'></span>\",\n voto : result.vote_average,\n urlimg : poster\n };\n }\n\n var fullHtml = template(data);\n container.append(fullHtml);\n\n fillStars(data.voto); //UNA VOLTA CARICATO NEL DOM LANCIO FILLSTARS CHE CAMBIA\n } //LE CLASSI (STELLA PIENA STELLA VUOTA) GRAZIE ALLA CLASSE DI CONTROLLO .CHECK\n}", "title": "" }, { "docid": "484a573c58f48bf4f00fdd0d2213b9ac", "score": "0.5236034", "text": "index(request, response) {\n return response.render(`${this.viewsDirectory}`, {parentPageTitle: this.parentPageTitle});\n }", "title": "" }, { "docid": "9f88fe9781630eb77b8ec688ffb412bb", "score": "0.5232173", "text": "function listDetailPage(hasPhoto, isJob, viewBagMessage) {\n $(document).ready(function () {\n var venoOptions = {\n numeratio: true,\n infinigall: true,\n spinner: 'wave',\n border: '20px',\n titleattr: 'data-title'\n };\n if (hasPhoto) {\n $('.venobox').venobox(venoOptions);\n }\n\n $(\".owl-carousel\").owlCarousel({\n nav: true,\n dots: false,\n autoWidth: true\n });\n\n if (viewBagMessage) {\n $('#myModalMessage').modal('show');\n }\n\n if (isJob) {\n $(\"#applyto\").click(function (event) {\n var divtag = document.getElementById(\"applyarea\");\n if (divtag.hidden) {\n divtag.removeAttribute(\"hidden\");\n document.getElementById(\"applyto\").innerHTML = \"Close<br/>Application Form\";\n document.getElementById(\"Message\").focus();\n }\n else {\n divtag.setAttribute(\"hidden\", \"hidden\");\n document.getElementById(\"applyto\").innerHTML = \"Open<br/>Application Form\";\n }\n });\n }\n });\n FetchRegion();\n}", "title": "" }, { "docid": "5d6c527cadcf9c60bb89c6a3c3c1ccf2", "score": "0.5231687", "text": "function renderPage(res, template, data) {\n logger.debug(\"Framework: renderPage Called\");\n data.lang = this.getLang();\n this.compileDustTemplate(template, data, function (response) {\n var assets = fillAssets();\n var page = '<!DOCTYPE HTML><html><head><title>Pensieve</title><link type=\"text/css\" rel=\"stylesheet\" href=\"https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css\" /><link type=\"text/css\" rel=\"stylesheet\" href=\"https://fonts.googleapis.com/css?family=Open+Sans:300\"><link href=\"//fonts.googleapis.com/css?family=Roboto\" rel=\"stylesheet\" type=\"text/css\"><link href=\"//netdna.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css\" rel=\"stylesheet\"><link rel=\"stylesheet\" href=\"http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css\"><script src=\"https://code.jquery.com/jquery-2.2.4.min.js\" integrity=\"sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=\" crossorigin=\"anonymous\"></script><script src=\"http://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js\" type=\"application/javascript\"></script><script src=\"http://maps.googleapis.com/maps/api/js\"></script>' + assets.css + \"</head><body>\" + response + assets.js + \"</body></html>\";\n res.send(page);\n });\n}", "title": "" }, { "docid": "b05d4e7ce0a1b81c6d84ea47459df6a7", "score": "0.5230099", "text": "static renderListOrders() {\n GestionPages.gestionPages(\"yourOrders\");\n let contenu = `<form id=\"nbOrder\">\n <div class=\"form-group\">\n <label for=\"nbOrder\">Order number</label>\n <input type=\"text\" class=\"form-control\" id=\"nbOrderInput\" aria-describedby=\"number help\" placeholder=\"Enter order number\" data-toggle=\"popover\" data-content=\"Error number order\" required>\n </div>\n <button type=\"submit\" class=\"btn btn-primary\">Submit</button>\n </form>`;\n document.querySelector(\"#orders\").innerHTML = contenu;\n\n //when customer clikcs on the button \"submit\"\n $(\"#nbOrder\").submit(event => {\n event.preventDefault();\n let valOrder = document.querySelector(\"#nbOrderInput\").value;\n fetch(`http://localhost:9091/api/chargen/${valOrder}`).then((reponse) => {\n if (reponse.ok) {\n window.location.replace(`http://localhost:9091/command/${valOrder}`);\n } else {\n $(\"#nbOrderInput\").popover(\"show\");\n throw new Error(\"connection problem\");\n }\n });\n }\n );\n }", "title": "" }, { "docid": "db2f1d266833446096742db2e6f70ac8", "score": "0.5229918", "text": "showAddForm(req, res) {\n res.render('blogs/blogs-add');\n\n }", "title": "" }, { "docid": "89c96fed883849440742c7a94452f661", "score": "0.5229766", "text": "renderizaFavoritos(){ \n\n //Adiciona efeito de loading\n //Trata o erro caso o usuário não exista\n this.load(this.classHTMLRepos,\n //Realiza requisição\n //Passa dados para função que monta a view\n //Trata o erro caso o usuário não exista\n requestRepo(this.inputSearch.value)\n .then(res =>{ \n this.classHTMLRepos.innerHTML= this.renderFavoritosContent(res);\n })\n );\n \n }", "title": "" }, { "docid": "e3b8514508a53fbe6d4a51ca1b63cda5", "score": "0.5226854", "text": "render() {\n return html``;\n }", "title": "" }, { "docid": "4ac8d5f661e4e8ad7465c27f0e3d6d62", "score": "0.52242786", "text": "function getAndBindTemplate(data,div) {\n $.ajax({\n url: 'js/templates/sweetCarousel.html',\n cache: true,\n success: function(result) {\n // Bind Data to template\n var template = Handlebars.compile(result);\n $(div).html(template(data));\n },\n dataType: \"text\"\n }).done(function() {\n initCarousel(data);\n\t\t});\n }", "title": "" }, { "docid": "2580eb6fd90cec1cb8d1f20f88148ced", "score": "0.5218243", "text": "prepare(){\n $(this.container).children().remove();\n $(this.container).append(\n $(\"<content></content>\")\n ).append(\n $(\"<controls></controls>\").append(\n $(`<first data-page=\"0\"><<</first>`).click(e=>{\n this.changePage($(e.currentTarget).data(\"page\"))\n })\n ).append(\n $(`<prev data-page=\"1\"><</prev>`).click(e=>{\n let aux = this.actualPage - parseInt($(e.currentTarget).data(\"page\"));\n this.changePage(aux)\n })\n ).append(\n $(`<next data-page=\"1\">></next>`).click(e=>{\n let aux = this.actualPage + parseInt($(e.currentTarget).data(\"page\"));\n this.changePage(aux)\n })\n ).append(\n $(`<last data-page=\"${this.index.length-1}\">>></last>`).click(e=>{\n this.changePage($(e.currentTarget).data(\"page\"))\n })\n )\n );\n }", "title": "" }, { "docid": "9474716e132faa33d6d5b14acc0ab48f", "score": "0.52125806", "text": "function pagar_servicio (id)\n {\n \n \n $.ajax({\n type: \"GET\",\n url: \"./busquedas/buscar_venta_servicio.php\",\n data: \"id_pagar=\"+id,\n \n success: function(datos){\n $(\"#servicio_venta\").html(datos);\n }\n });\n\n }", "title": "" }, { "docid": "5b554888057e07d783f40bb9cd33250d", "score": "0.521217", "text": "register(req,res,next){\n res.render('userRegister',{layout:'backend'});\n }", "title": "" }, { "docid": "83efa58296846806a62da291da111d54", "score": "0.5203644", "text": "function renderHandlebarsTemplate(withTemplate,inElement,withData){\n getTemplateAjax(withTemplate, function(template) {\n handlebarsFormatDateForDisplay();\n jqueryNoConflict(inElement).html(template(withData));\n })\n}", "title": "" }, { "docid": "3b51393887f9ba3300f3b99b531b117d", "score": "0.5201496", "text": "frontend() {\n\n }", "title": "" }, { "docid": "bae2c1b729da56a0ba0bcf0172249e1f", "score": "0.5201392", "text": "function routeHandler() {\n routie({\n '': function () {\n sectionToggler('combo-generator');\n },\n favourites: function () {\n sectionToggler('favourites');\n },\n 'favourites/:id': function () {\n sectionToggler('fav-item');\n },\n // 'favourites/:id': function (id) {\n // console.log(id);\n // sectionToggler(id)\n // addSection(id);\n // toggle(id);\n // const filtered = filterPlayers(playerData, id);\n // renderPlayerData(filtered);\n // },\n });\n}", "title": "" }, { "docid": "a7a4747b34818f5cb39faec96a4beef2", "score": "0.51995504", "text": "static handleDataChange() {\n const viewData = controller.view.get()\n const templateData = viewData.templates[viewData.viewName]\n const pageData = pageDataMap(viewData.viewName)\n\n controller.view.render(templateData.template, {\n styles : templateData.styles,\n data : pageData\n })\n\n if (domEvent[viewData.viewName] && domEvent[viewData.viewName].addEvents) {\n domEvent[viewData.viewName].addEvents()\n }\n }", "title": "" }, { "docid": "abedf7c939d5df4ea5420eb583c5aa9f", "score": "0.5196096", "text": "initPage() {\n if (model.loggedIn) { // Wenn der Nutzer eingeloggt ist\n // Nutzer abfragen und Anzeigenamen als owner setzen\n console.log(\"EINGELOGGT\");\n model.getSelf((result) => {\n this.owner = result.displayName;\n console.log(`Nutzer ${this.owner} hat sich angemeldet.`);\n });\n // Lade alle Blogs in die blogMap vom Model und übergebe die ID des aktuellsten Blogs zu this.blogId\n model.getAllBlogs((result) => {\n this.blogId = result[0].id;\n let lastUpdate = result[0].updated;\n for(let i in result){\n if(result[i].updated > lastUpdate){\n this.blogId = result[i].id;\n }\n }\n // Routing zur Übersicht, zusätzlich wird der Header erstellt\n router.navigateToPage('/overview/' + this.blogId);\n this.showNavbar(model.blogMap, model.getBlog(this.blogId));\n });\n }\n if(!model.loggedIn && this.blogId != -1) { // Wenn der Nuzter eingelogged war und sich abgemeldet hat\n console.log(`Nutzer ${this.owner} hat sich abgemeldet.`);\n this.blogId = -1;\n this.owner = undefined;\n // Entferne den Header und navigiere zurück zur Startseite\n let header = document.getElementById(\"mainheader\");\n header.firstElementChild.remove();\n router.navigateToPage(\"/\");\n }\n else if(!model.loggedIn && this.blogId === -1){ // Wenn der Nutzer auf die Seite kommt und nicht eingeloggt war\n this.showLogin();\n }\n }", "title": "" }, { "docid": "ccc03fa56a80f0b788ffcbff729bb24d", "score": "0.5195971", "text": "function mostrarPagina(datos)\r\n{\r\n espereshow();\r\n $(\".sidebar ul.navi li\").css(\"background\", \"\");\r\n $(\".sidebar ul.navi li > a\").css(\"color\", \"\");\r\n $(this).parent(\"li\").css(\"background\", \"none repeat scroll 0 0 rgb(126, 126, 126)\");\r\n $(this).css(\"color\", \"#E6E6E6\");\r\n var pag = $(this).attr(\"name\");\r\n if(pag.length){\r\n if((pag !== 'solic')&&(pag !== 'rrhh')&&(pag !== 'ingreso')){$(\"#rrhh\").hide();}\r\n else{\r\n $(this).parent(\"li\").parent(\"ul\").parent(\"li\").css(\"background\", \"none repeat scroll 0 0 rgb(126, 126, 126)\");\r\n $(this).parent(\"li\").parent(\"ul\").parent(\"li\").children(\"a\").css(\"color\", \"#E6E6E6\");\r\n }\r\n $(\"#col-md-12\").load(\"./\" + pag + \".php\");\r\n }\r\n else{\r\n $(\"#rrhh\").toggle();\r\n setTimeout(esperehide, 300);\r\n }\r\n \r\n // $(\"#article_right\").load(\"./\" + pag + \".php\");\r\n \r\n}", "title": "" }, { "docid": "fa30d7bfb4e01e03d952e4d18b941c70", "score": "0.5193307", "text": "function processDataForTemplate(data){\n renderHandlebarsTemplate('static-files/templates/content-action-bar.handlebars', '#content-action-bar', data);\n renderHandlebarsTemplate('static-files/templates/data-visuals.handlebars', '#data-visuals', data);\n}", "title": "" }, { "docid": "a2d431feb32bbc812b24e8e659478856", "score": "0.51877874", "text": "data(){\n\t\treturn {\n\t\t\tpagePath : null \n\t\t}\n\t}", "title": "" }, { "docid": "6d4df95456371956f5332d377753401a", "score": "0.51835966", "text": "function cargar_datos_cod_bar(page){\n var id_usuario = $(\"#id_usuario_sesion\").val();\n var parametros = {'action':'ajax','page':page,id_usuario:id_usuario};\n \n $.ajax({\n type : 'POST',\n url:'../modelo/modelo_listar_tikeo_cliente.php',\n data: parametros,\n beforeSend: function(objeto){\n $('#panel_listado_prendas_cliente').html('cargando .... ');\n },\n success:function(data){\n\n $('#panel_listado_prendas_cliente').html(data).fadeIn('slow'); \n }\n });\n }", "title": "" }, { "docid": "4492bdb8cc33ec2246c24d00efb64a95", "score": "0.51735455", "text": "get Template() {\n return /*html*/`\n <div class=\"card col-md-3 m-3 p-0\">\n <div class=\"card-header m-0 p-0\" style=\"background-color:${this.color}\">\n <button class=\"btn float-right\" onclick=\"app.tasksController.deleteTask('${this.id}')\">X</button>\n <h4 class=\"card-title text-center text-white pt-5\">${this.title}</h4>\n <p class=\"task-num text-center text-white\" id=\"${this.id}-count\" >${this.calcItems()}/${this.calcTotal()}</p>\n </div>\n <div class=\"card-body text-center pt-3\">\n <form id=\"${this.id}-items\">\n ${this.Items}\n </form>\n </div>\n <div class=\"card-footer\" style=\"background-color:${this.color}\">\n <div class=\"row\">\n <div class=\"input-group mb-2\">\n <form onsubmit=\"app.itemsController.createItem(event, '${this.id}' )\" class=\"d-flex flex-row\">\n <input type=\"text\" class=\"form-control\" placeholder=\"Add Task\" name=\"itemName\" pattern=\".{3,50}\" required>\n <button type=\"submit\" class=\"btn\" ><b>+</b></button>\n </form>\n </div>\n </div>\n </div>\n </div>\n `\n }", "title": "" }, { "docid": "493950387d60999a78419e58780916aa", "score": "0.5172117", "text": "function fnOotro(req, res) {\nres.send(\"Vino pa otro lado\")\n}", "title": "" }, { "docid": "0ca12f15453275aa04e1c093c59052fb", "score": "0.5168365", "text": "function renderList(data) {\r\n\r\n // Compilo handlebars.\r\n var source = $(\"#list-template\").html();\r\n var template = Handlebars.compile(source);\r\n\r\n // Ciclo l'array e aggiungo le cose da fare alla lista.\r\n for (var i = 0; i < data.length; i++) {\r\n\r\n var context = {\r\n \"id\": data[i].id,\r\n \"text\": data[i].text\r\n };\r\n\r\n var html = template(context);\r\n $(\"#to-do-list\").append(html);\r\n }\r\n }", "title": "" }, { "docid": "5200c8e22c0995365eb6cd6129aad052", "score": "0.5168101", "text": "function ControllerSetviewListe(data) {\n\tdocument.getElementById(\"ControllerContent\").innerHTML = TemplateControllerListe(data);\n}", "title": "" }, { "docid": "e6ee55d04c1709dcba2f84eced4fbe20", "score": "0.5164551", "text": "get Template() {\n\n let template = `\n <div class=\"col-4 border mt-4 shadow bg-card text-center \">\n <h3><u> ${this.name}</u></h3>\n <form onsubmit=\"app.listController.addChore(event, '${this.id}')\">\n <div class=\"form-group\">\n <label for=\"choreName\"></label>\n <input type=\"text\" name=\"choreName\" id=\"\" class=\"form-control\" placeholder=\"Enter Chore Here...\">\n </div>\n <button type=\"submit\" class=\"btn btn-primary mb-2\">Add Chore</button>\n </form>\n <button class=\"btn btn-outline-danger mb-2\" onclick=\"app.listController.deleteList('${this.id}')\">Delete Task</button>\n `\n this.chores.forEach((chore, index) => template += `<p id=\"'${this.id}-${index}'\" class=\"\">${chore}<i class=\"fa fa-trash-o fa-2x text-danger\" onclick=\"app.listController.deleteChore('${this.id}','${index}')\"></i><i class=\"fa fa-check-circle fa-2x fa-check text-dark\" onclick=\"app.listController.changeText('${this.id}','${index}')\"></i></p>`)\n\n template += '</div>'\n\n return template\n }", "title": "" }, { "docid": "4b9414842340cbd3d7315672a8362e47", "score": "0.516424", "text": "init () {\n\t\tconst html = Handlebars.templates[this.data.template](this.data);\n\t\tthis.container.innerHTML = html;\n\t\treturn this;\n\t}", "title": "" } ]
0f6a81246a015fc1235f4a6d00235edf
This creates all the cars in 1 lane
[ { "docid": "10f3de8e890c2722d255c715bd62fee7", "score": "0.73150486", "text": "function create() {\n bufferSize = spec.size.width / 2;\n let rotation = (spec.startLoc.x == 0) ? Math.PI : 0;\n let spaceBetween = (spec.canvasWidth + spec.size.width) / spec.numCars;\n\n for(let i = 0; i < spec.numCars; i++){\n let buffer = spaceBetween * i * spec.direction;\n let c = {\n center: { x: spec.startLoc.x + buffer, y: spec.startLoc.y },\n size: { x: spec.size.width, y: spec.size.height},\n direction: {x: spec.direction, y: 0},\n speed: spec.speed, // gridlengths per second\n rotation: rotation,\n level: spec.level,\n };\n cars[i] = c;\n }\n }", "title": "" } ]
[ { "docid": "9f80df267ca24ec62e120e4bac8b2e78", "score": "0.74284583", "text": "function createVehicleRows(lanes) {\n // Variables that change for each car lane\n let carSpeed = 1; // Speed of the cars\n let carLane = 10; // The position in z of the lane\n let carDirection = true; // True for going from left to right.\n\n for(let i=0; i<lanes; i++) {\n createVehicles(carLane, carSpeed, carDirection);\n\n // Increase speed\n carSpeed += 0.25;\n\n // Next lane position in z\n carLane -= 15;\n\n // Alternate direction\n carDirection = !carDirection;\n } \n}", "title": "" }, { "docid": "a18f9e4f13e16013272ae7d1751c0d91", "score": "0.72874445", "text": "function initiateCars() {\n\n\tcars = game.add.group();\n\tcars.enableBody = true;\n\n\tfor (i = 0; i < slots; i++) {\n\n\t\tcarType = carSlotType[i];\n\t\thCar = carTypes[carType].h;\n\t\tinterval = carTypes[carType].interval;\n\t\tvelocity = carTypes[carType].velocity;\n\t\tspacing = interval * velocity;\n\n\t\tif (carSlotVector[i] == 1) {\n\t\t\ty = -hCar;\n\t\t\twhile(y < h) {\n\t\t\t\tcreateCar(i, y);\n\t\t\t\ty += spacing;\n\t\t\t} \n\t\t} else {\n\t\t\ty = h + hCar;\n\t\t\twhile(y > 0) {\n\t\t\t\tcreateCar(i, y);\n\t\t\t\ty -= spacing;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b97f1e58b974459868b244bc87449456", "score": "0.7003707", "text": "function createVehicles(lane, speed, right) {\n let geometry = new THREE.BoxGeometry(3, 1, 2);\n let material = new THREE.MeshBasicMaterial({color: 0x159305});\n\n // Relative initial and ending positions\n x = [0, 15, 35, 45, 55, 75];\n for(let i=0; i<x.length; i++) {\n // Create car object\n let car = new THREE.Mesh(geometry, material);\n car.position.z = lane; \n\n // Create car animator depending on the direction\n car.animator = new KF.KeyFrameAnimator;\n if(right) {\n car.min = -25-x[i];\n car.max = 110-x[i];\n } else {\n car.min = 110-x[i];\n car.max = -25-x[i];\n }\n\n car.animator.init({ \n interps: [\n {\n keys: [0, 1],\n values:[\n { x : car.min },\n { x : car.max}\n ],\n target: car.position\n },\n ],\n loop: true,\n duration: 10000/speed\n });\n\n cars.push(car);\n car.animator.start();\n scene.add(car);\n }\n}", "title": "" }, { "docid": "deeb3977eb566dd1b424d08bbc991a6e", "score": "0.68518376", "text": "function placeCars()\n\t\t\t{\n\t\t\t\tconstructors = constructors.concat(constructors.slice(0, 8));\n\t\t\t\trandom(constructors);\n\t\t\t\t\n\t\t\t\tvar count = 0;\n\t\t\t\tvar car;\n\t\t\t\tfor (var i = 0; i < constructors.length; i++)\n\t\t\t\t{\n\t\t\t\t\tcount = count >= 10 ? 1 : count + 1;\n\t\t\t\t\t\n\t\t\t\t\tcar = new constructors[i]();\n\t\t\t\t\tvar str = i < 10 ? \"car0\" : \"car\";\n\t\t\t\t\tcar.name = str + i;\n\t\t\t\t\tcar.on(\"mousedown\", carHandler);\n\t\t\t\t\tcar.rotation = count <= 5 ? 0 : 180;\n\t\t\t\t\t\n\t\t\t\t\tstr = i < 10 ? \"spot_0\" : \"spot_\";\n\t\t\t\t\te[str + i].name = str + i;\n\t\t\t\t\te[str + i].addChild(car);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "9bbbe4c7134ba73a4b593b5984a71266", "score": "0.6420538", "text": "function generateCars(numberOfCars) {\n const cars = [];\n\n const carMakes = ['Honda', 'BMW','Fiat','Skoda','Volvo'];\n const carColors = ['lightgrey', 'lightcyan','lightyellow','lightgreen','lightcoral','lightpink'];\n \n for (let i = 0; i < numberOfCars; i++) {\n const car = {};\n const randomMakeIndex = randomIntFromInterval(0, carMakes.length - 1);\n const randomColorIndex = randomIntFromInterval(0, carColors.length - 1);\n\n car.make = carMakes[randomMakeIndex];\n car.color = carColors[randomColorIndex];\n car.speed = randomIntFromInterval(0, 100);\n\n cars.push(car);\n }\n\n return cars;\n}", "title": "" }, { "docid": "0cd6611cc2dc592ebd53c53e89410fdd", "score": "0.62259614", "text": "function draw() {\n background(0);\n\n //Go through all the cars and move, wrap, and display them.\n for (let i = 0; i < vehicles.length; i++) {\n let vehicle = vehicles[i];\n vehicle.move();\n vehicle.wrap();\n vehicle.display();\n }\n\n // // Go through all the motorcycles and move, wrap, and display them\n // for (let i = 0; i < motorcycles.length; i++) {\n // let motorcycle = motorcycles[i];\n // motorcycle.move();\n // motorcycle.wrap();\n // motorcycle.display();\n // }\n}", "title": "" }, { "docid": "70025b2408cabcba16af122faf387900", "score": "0.6204427", "text": "function creatAllLocations() {\n $(\".cont1\").html(\"\");\n $(\".cont0\").html(\"\");\n $(\".cont1\").append(\"<div class =\\\"row all\\\"></div>\");\n for (var i = 0; i < allPlanetArr.length; i++) {\n var universe = allPlanetArr[i];\n $(\".all\").append(\"<h2 class =\\\"col-12\\\">\" + universeNames[i].universeName + \"</h2>\");\n for (var j = 0; j < universe.length; j++) {\n var planet = universe[j];\n for (var k = 0; k < planet.length; k++) {\n planet[k].creatItem();\n }\n }\n }\n xy();\n }", "title": "" }, { "docid": "09d0bf0f8288202816edf0e5002dce1c", "score": "0.6199103", "text": "appendCar(vehicle, lane){\n\n // add to the vehicle storage array\n Vehicle.tags.push(vehicle)\n\n let y_coord = this.BOTTOM_EDGE - lane.height*40 - 20\n let x_coord\n\n this.tag.appendChild(vehicle)\n\n if(lane.direction === \"east\"){\n x_coord = -60\n vehicle.style.transform = 'rotate(180deg)';\n }else{\n x_coord = this.WIDTH + 5\n }\n\n vehicle.style.left = `${x_coord}px`\n vehicle.style.top = `${y_coord}px`\n\n }", "title": "" }, { "docid": "b3beb1fa7c3ce9ec98d215e7489959aa", "score": "0.6116888", "text": "function addRoadCrosswalks() {\r\n const tex = new THREE.TextureLoader().load(\"src/textures/street_crosswalks.png\");\r\n tex.anisotropy = renderer.capabilities.getMaxAnisotropy();\r\n tex.repeat.set(3, 1);\r\n tex.wrapT = THREE.RepeatWrapping;\r\n tex.wrapS = THREE.RepeatWrapping;\r\n const geo = new THREE.PlaneBufferGeometry(48, 11);\r\n const mat = new THREE.MeshLambertMaterial({ map: tex });\r\n\r\n for (let i = 0; i < 2; i++) {\r\n const mesh = new THREE.Mesh(geo, mat);\r\n mesh.position.set(0, 0.2, -23 - (276 * i)); // 276 = 23 * 12\r\n mesh.rotation.set(-Math.PI / 2, 0, 0);\r\n scene.add(mesh);\r\n staticModels[\"crosswalks\" + i] = { gltf: { scene: mesh } };\r\n }\r\n }", "title": "" }, { "docid": "add87b657528818034842c773b46b31f", "score": "0.6083185", "text": "function newCar(make, model, color, type, tires, mode, gasoline) {\n this.make = make;\n this.model = model;\n this.color = color;\n this.type = type;\n this.tires = tires;\n this.mode = mode;\n this.gasoline = gasoline;\n }", "title": "" }, { "docid": "1f828fab2f9af49e783f8439c504cb17", "score": "0.6043709", "text": "function getVehicles() {\n const vehicles = [];\n\n for (let index = 0; index < 30000; index += 1) {\n vehicles.push({ id: index, name: `Car ${index}`, });\n }\n\n return vehicles;\n}", "title": "" }, { "docid": "aeabbaf9b95873c0a24d87fea99b9037", "score": "0.6040456", "text": "function create(y){\n //The funktion values if the command is true. The command is x < lane1[y].length.\n //If the command is true, the function create(y,x) will run.\n //x++ is also autoincrement. It means x will increase with 1 for every loop.\nfor(x = 0; x < lane4[y].length; x++){\n createlane(y,x);\n}\n}", "title": "" }, { "docid": "1cad54c82b302fd8889dad577a90a745", "score": "0.6035213", "text": "function createCar(){\n c = new Car({x: 0,y: 150,windowsColour: \"red\",colour:\"yellow\",directionX:200});\n}", "title": "" }, { "docid": "859114fcce235a969cafe85075b7abbd", "score": "0.6031325", "text": "function buildModel(cars, capacity, chargeRate, iterations){\n var count;\n var carCount;\n carCount = 0;\n var timeCount;\n var carsList = [];\n var carsTimeList = [];\n //populates the carsTimeList with a 0 for each time period\n for (timeCount = 0; timeCount < numberOfPeriods; timeCount++){\n carsTimeList.push(0);\n }\n //increments values in the array. E.g. a value of 3 at index 25 means 3 cars will spawn during time period 25.\n for(carCount = 0; carCount < cars; carCount++){\n period = createStartTime();\n carsTimeList[period]++;\n }\n //Creates a set of cars with electricity needs and maximum waiting time, based on charge rate and the time at which they arrive.\n for(carCount = 0; carCount < carsTimeList.length; carCount++){\n for (temp = 0; temp < carsTimeList[carCount]; temp++){\n var car = createCar(chargeRate, carCount);\n carsList.push(car);\n }\n }\n\n //for each algorithm, runs a number of simulations based on the number of iterations required.\n var algorithmType;\n for(algorithmType = 0; algorithmType < 3; algorithmType++){\n tempResultsLine = [];\n tempResultsPie = [];\n for (count = 0; count < iterations; count++){\n var carsListClone = JSON.parse(JSON.stringify(carsList)); //Performs a deep clone of the cars list so each simulation gets an independent list.\n runModel(carsTimeList, capacity, chargeRate, carsListClone, algorithmType);\n }\n averageResults(algorithmType);\n }\n\n}", "title": "" }, { "docid": "e35f8344565328c8dc662d029b95e16b", "score": "0.60306114", "text": "function createCards() {\n cardsData.forEach((data, index) => createCard(data, index));\n }", "title": "" }, { "docid": "a7e882c4a85a59a7d99e0ba6b466dcc6", "score": "0.5989626", "text": "createCarPark(n, entryPoints) {\n this.maxSlots = n;\n for (let i = 0; i < n; i++) {\n this.slots.push(null);\n }\n this.entryPoints = entryPoints;\n\n // Prevent entry points from being available slots\n entryPoints.forEach((entryPoint) => {\n this.slots[entryPoint - 1] = 'Entry point';\n });\n }", "title": "" }, { "docid": "21c792543aa54777c41ff3ce10ebc56a", "score": "0.5983933", "text": "function createCar (model, year, color) { //takes in arguments\n var speed = 0; //starting speed\n return {\n model: model, ///input for argument\n year: year, //input for argument\n color: color, //input for argument\n\n getSpeed: function() { return speed}, //when called it returns the current speed\n accelerate: function() {speed += 10}, //when called it increases speed by 10\n brake: function() { speed -= 7}, //when called this decreases speed by 7\n getNewCar: function() {\n return this.model + \" \" + this.year + \" \" + this.color // this creates string of elements of object\n },\n gas: function() {\n while (speed < 80) { ///Loops speed increment until it reaches 80\n this.accelerate();\n };\n if (speed = 80 ){\n speed += 5 //////once speed is 80 speed increases by 5\n\n };\n },\n emergencyBrake: function() {\n while(speed <= 85 && speed > 1) { /////Loops (decreased)speed until speed reaches 1\n this.brake();\n };\n if (speed = 1 ){\n speed-- //////once speed is 1 this decreases speed by 1\n };\n }\n }\n}", "title": "" }, { "docid": "9465922458a3c448e4fa327e2d192a59", "score": "0.5952135", "text": "function createCar (model, year, color) { //takes in arguments\n var speed = 0; //starting speed\n return {\n model: model, ///input for argument\n year: year, //input for argument\n color: color, //input for argument\n\n getSpeed: function() { return speed}, //when called it returns the current speed\n accelerate: function() {speed += 10}, //when called it increases speed by 10\n brake: function() { speed -= Math.floor(Math.random()* (speed/2)) + 1; }, // This will call random number to be decrease per brake\n getNewCar: function() {\n return this.model + \" \" + this.year + \" \" + this.color // this creates string of elements of object\n },\n gas: function() {\n while (speed < 80) { ///Loops speed increment until it reaches 80\n this.accelerate();\n };\n if (speed = 80 ){\n speed += 5 //////once speed is 80 speed increases by 5\n\n };\n },\n emergencyBrake: function() {\n var counter = 0\n while(speed <= 85 && speed > 0) { /////Loops (decreased)speed until speed reaches 0\n this.brake(); // this will call brake fucntion\n counter ++ // increase 1 per cycle of loop\n console.log(counter) // print the number of counter value\n };\n }\n}\n}", "title": "" }, { "docid": "f7e35e7229d5fd857a63c572f90e932d", "score": "0.5847712", "text": "function CarMaker(){}", "title": "" }, { "docid": "fb2aabbf0927e63f36b8aaf3229eb195", "score": "0.5818455", "text": "function creatLocations(arr) {\n for (var i = 0; i < arr.length; i++) {\n var planet = arr[i];\n console.log(planet);\n $(\"#card-body\" + i).append(\"<div class=\\\"accordion col-12\\\" id=\\\"accordionExample\" + i + \"\\\"></div>\");\n for (var j = 1; j < planet.length; j++) {\n var location_1 = planet[j];\n location_1.creatAccordionCard(i);\n }\n }\n ;\n }", "title": "" }, { "docid": "1c589c30b3daf21c81c52d93d2df5d63", "score": "0.5815274", "text": "function showAll(){\n for (car of vehicles){\n garage.appendChild(makeCard(car));\n }\n inputElement.value = '';\n}", "title": "" }, { "docid": "83fecc5efabd8122593996ae6691cb03", "score": "0.58010143", "text": "getCarsInfo(cars, slots) {\n const carsInfo = [];\n this.slotsInfo = slotsStack(Math.min(slots, 30));\n if (cars > slots) {\n return carsInfo;\n }\n for (let index = 0; index < Math.min(cars, 30); index++) {\n // const element = array[index];\n carsInfo.push({\n count: index + 1,\n car_no:\n \"ka by \" +\n randomIntInRange(cars) +\n \"38\" +\n randomIntInRange(cars) +\n \"3\",\n color: getColor(),\n slot_no: this.slotsInfo.pop(),\n date_time: format(new Date(), \"PPpp\"),\n id: \"some-cars-num-\" + index\n });\n }\n\n return carsInfo;\n }", "title": "" }, { "docid": "c062ea9161c407419c8042b4776f5a9e", "score": "0.5799613", "text": "function showCars(){\n for(let i = 0; i < carImage.length; i++){\n image(carImage[i],xCars[i], yCars[i],carWidth,carHeigth); \n print(yCars[i], xCars[i]);\n }\n}", "title": "" }, { "docid": "f85f36384d5b859f85429a11d8394bd4", "score": "0.57971996", "text": "function createCar (model, year, color) { //takes in arguments\n var speed = 0; //starting speed\n return {\n model: model, ///input for argument\n year: year, //input for argument\n color: color, //input for argument\n\n getSpeed: function() { return speed}, //when called it returns the current speed\n accelerate: function() {speed += 10}, //when called it increases speed by 10\n brake: function() { speed -= 7}, //when called this decreases speed by 7\n getNewCar: function() {\n return this.model + \" \" + this.year + \" \" + this.color // this creates string of elements of object\n },\n gas: function() {\n while (speed < 70) { ///Loops speed increment until it reaches 70\n this.accelerate();\n };\n },\n emergencyBrake: function() {\n while(speed <= 70 && speed > 0) { /////loops decrement until it reaches 0\n this.brake();\n };\n }\n }\n}", "title": "" }, { "docid": "7a21e607141f38c2fdbd395b3c552ca3", "score": "0.5772665", "text": "function createCar (model, year, color) { //takes in arguments\n var speed = 0; //starting speed\n return {\n model: model, ///input for argument\n year: year, //input for argument\n color: color, //input for argument\n\n getSpeed: function() { return speed}, //when called it returns the current speed\n accelerate: function() {speed += 10}, //when called it increases speed by 10\n brake: function() { speed -= Math.floor(Math.random()* (speed/2)) + 1; }, //when called this decreases speed by 7\n getNewCar: function() {\n return this.model + \" \" + this.year + \" \" + this.color // this creates string of elements of object\n },\n gas: function() {\n while (speed < 80) { ///Loops speed increment until it reaches 80\n this.accelerate();\n };\n if (speed = 80 ){\n speed += 5 //////once speed is 80 speed increases by 5\n\n };\n },\n emergencyBrake: function() {\n this.brake(); ///we are directly using the brake function\n // };\n\n }\n }\n}", "title": "" }, { "docid": "23bb618d59e587284e2bdea82c2f9747", "score": "0.5760536", "text": "function createMany(){\n for(var i = 0; i < 50; i++){\n array_brand.push(\"MARQUE_\"+i);\n array_year.push(\"ANNEE\"+i);\n array_model.push(\"MODEL\"+i);\n array_fuel.push(\"CARBURANT\"+i);\n array_price.push(0000);\n }\n\n $('#create_car').hide();\n $('#show_cars').show();\n\n tabIncrement()\n $('.mydatatable').DataTable();\n}", "title": "" }, { "docid": "0f6dd1896b36cfad3311ea10016d096d", "score": "0.5757521", "text": "function setup() {\n createCanvas(600, 600);\n //Create the correct number of cars and put them in our array\n for (let i = 0; i < numCars; i++) {\n let x = random(0, width);\n let y = random(0, height);\n let car = new Car(x, y);\n vehicles.push(car);\n }\n\n //create the correct number of sports cars and put them in our vehicles array\n for (let i = 0; i < numSportsCars; i++) {\n let x = random(0, width);\n let y = random(0, height);\n let sportscar = new SportsCar(x, y);\n vehicles.push(sportscar);\n }\n\n //Create correct number of motorcycles and put them in our array\n for (let i = 0; i < numMotorcycles; i++) {\n let x = random(0, width);\n let y = random(0, height);\n let motorcycle = new Motorcycle(x, y);\n vehicles.push(motorcycle);\n }\n}", "title": "" }, { "docid": "54e0672daa8d0e0b3b1a1ddeef94d9b7", "score": "0.57551414", "text": "function createCar() {\n car = game.add.sprite(startingX, startingY, 'car');\n car.anchor.setTo(.3, .5);\n car.scale.setTo(carScale);\n\n game.physics.p2.enable(car);\n car.body.setRectangle(10, 10);\n car.body.collideWorldBounds = true;\n car.body.angle = startingAngle;\n }", "title": "" }, { "docid": "5e10551925fd7569d9dae655da1c6278", "score": "0.57523274", "text": "makeCar(playerId, team) {\n console.log(`adding car of player`, playerId);\n\n let existingCar = this.world.queryObject({ playerId });\n if (existingCar) {\n // this.log.push(`player[${playerId}] already has car[${existingCar.id}]`);\n return existingCar;\n }\n\n // create a car for this client\n let x = Math.random() * 20 - 10;\n let z = Math.random() * 20 - 10;\n let position = new ThreeVector(x, 10, z);\n let car = new Car(this, position);\n car.playerId = playerId;\n car.team = team;\n this.addObjectToWorld(car);\n this.numCars++;\n // this.log.push(`new car [${car.id}] for player[${playerId}]`);\n if (this.numCars === 1)\n this.makeBall();\n\n return car;\n }", "title": "" }, { "docid": "cdca8d1385c06a6bc452965e3d87ab6f", "score": "0.57405925", "text": "function createBuildings() {\n for (let i = 0; i < 4; i++) {\n buildings.push(\n CreateGameElement(\n SHIP.width * 1.5,\n SHIP.height * 1.2,\n 65 + 175 * i,\n C_HEIGHT - 130,\n 0,\n BUILDING_IMG,\n 0\n )\n );\n }\n}", "title": "" }, { "docid": "037a9b7795286b6ed157333a940f8730", "score": "0.57282144", "text": "function createCar() {\n car = new Car();\n scene.add(car.mesh);\n}", "title": "" }, { "docid": "1325e30a9b54f13c485c18ce36ef1735", "score": "0.5721642", "text": "function addCar() {\n let app = document.app,\n cars = app.cars;\n\n if (app.flags.stop) {\n return;\n }\n\n if (cars.length < MAX_CARS_NUM) {\n cars.push(new Car());\n } else {\n showMessage(`Достигнуто максимальное количество машин: ${MAX_CARS_NUM}`);\n }\n}", "title": "" }, { "docid": "ad8e25a685859f77f794a53264eaa6ff", "score": "0.57029665", "text": "function creatPlanets(arr) {\n $(\".cont1\").append(\"<div class=\\\"accordion-inner\\\"><div class=\\\"accordion\\\" id=\\\"accordionExample\\\"></div></div>\");\n for (var i = 0; i < arr.length; i++) {\n var planet = arr[i];\n planet[0].creatAccordionCard(i);\n }\n ;\n }", "title": "" }, { "docid": "e3337f3f792e392fe869447243b8aecb", "score": "0.5699122", "text": "function moveCars(zPosPlayer, setOfModels) {\r\n for (const model of Object.values(setOfModels)) {\r\n if (model != playerModel) {\r\n const carPosition = model.gltf.scene.position,\r\n currentCar = model.car;\r\n\r\n if (model == policeSelModel) {\r\n if ( Math.abs(zPosPlayer - carPosition.z) > 60 ) {\r\n let ms = policeModel.getPhysicsBody().getMotionState();\r\n if (ms) {\r\n ms.getWorldTransform(TRANSFORM_AUX);\r\n TRANSFORM_AUX.setOrigin(new Ammo.btVector3(\r\n playerModel.getPosition().x,\r\n policeModel.getPosition().y,\r\n zPosPlayer + cameraOffset + 5));\r\n policeModel.get3DModel().lookAt(\r\n policeModel.getPosition().x,\r\n policeModel.getPosition().y,\r\n policeModel.getPosition().z - 30);\r\n const quaternion = policeModel.get3DModel().quaternion;\r\n //console.log(\"quaternion:\");\r\n //console.log(quaternion);\r\n TRANSFORM_AUX.setRotation(new Ammo.btQuaternion(\r\n quaternion.x,\r\n quaternion.y,\r\n quaternion.z,\r\n quaternion.w));\r\n ms = new Ammo.btDefaultMotionState(TRANSFORM_AUX);\r\n policeModel.getPhysicsBody().setMotionState(ms);\r\n }\r\n }\r\n continue;\r\n }\r\n\r\n if (currentCar) {\r\n // Check if currentCar is near to the player and move it\r\n if (Math.abs(zPosPlayer > carPosition.z - 200) || model.gltf.scene.visible == false) { // 200\r\n model.gltf.scene.visible = true;\r\n // Move car forward according to its orientation\r\n\r\n // Dodge Viper and low poly car have Z axis opposite than the other cars\r\n if (model == dynamicModels.dodgeViper || model == dynamicModels.lowpolyCar)\r\n currentCar.move(0, 0, 1);\r\n else\r\n currentCar.move(0, 0, -1);\r\n }\r\n // Otherwise translate it far away resetting orientation and picking at random the lane\r\n else {\r\n /*console.log(\"============ TRANSLATE CAR ============\");\r\n console.log(\"car name: \" + currentCar.getName());\r\n console.log(\"BEFORE carPosition.z:\" + carPosition.z);\r\n const orientation = new THREE.Vector3();\r\n console.log(\"BEFORE car orientation:\");\r\n console.log(currentCar.get3DModel().getWorldDirection(orientation));*/\r\n const random = placeCar(model, false, carPosition.z - 600);\r\n /*console.log(\"AFTER carPosition.z:\" + carPosition.z);\r\n console.log(\"AFTER car orientation:\");\r\n console.log(currentCar.get3DModel().getWorldDirection(orientation));*/\r\n\r\n currentCar.getPhysicsBody().setLinearVelocity(new Ammo.btVector3(0, 0, 0));\r\n\r\n let ms = currentCar.getPhysicsBody().getMotionState();\r\n if (ms) {\r\n ms.getWorldTransform(TRANSFORM_AUX);\r\n TRANSFORM_AUX.setOrigin(new Ammo.btVector3(\r\n random,\r\n carPosition.y,\r\n carPosition.z));\r\n const quaternion = currentCar.get3DModel().quaternion;\r\n console.log(\"quaternion:\");\r\n console.log(quaternion);\r\n TRANSFORM_AUX.setRotation(new Ammo.btQuaternion(\r\n quaternion.x,\r\n quaternion.y,\r\n quaternion.z,\r\n quaternion.w));\r\n ms = new Ammo.btDefaultMotionState(TRANSFORM_AUX);\r\n currentCar.getPhysicsBody().setMotionState(ms);\r\n }\r\n\r\n model.gltf.scene.visible = false;\r\n //console.log(\"============ END TRANSLATE CAR ============\");\r\n }\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "e7f651aa714b4ba70c8ccf951b6c79b4", "score": "0.56947094", "text": "start(){\r\n if(gameState === 0){\r\n player = new Player()\r\n player.getCount()\r\n form = new Form()\r\n form.display()\r\n }\r\n\r\n car1 = createSprite(100, 200)\r\n car2 = createSprite(300, 200)\r\n car3 = createSprite(500, 200)\r\n car4 = createSprite(700, 200)\r\n\r\n cars = [car1, car2, car3, car4]\r\n }", "title": "" }, { "docid": "b6bbdd3ed4ea79c71ccbd1a9bdf4842b", "score": "0.5688389", "text": "function CarLoader() {\n let count = 0;\n renter.getCarsList().forEach((car) => {\n AddCartoTable(car, count);\n count++;\n });\n}", "title": "" }, { "docid": "a0b6536ce3b234ffccef78720d9abfcd", "score": "0.56849337", "text": "function addVehicle(vehicleType,name,distance,i,delta) {\n\n let vehicle;\n\n if (vehicleType == \"car\") {\n vehicle = createCar();\n }\n\n else if (vehicleType == \"truck\") {\n vehicle = createTruck();\n }\n\n else {\n return;\n }\n \n sceneGraph.add(vehicle);\n\n vehicle_list.push(vehicle);\n \n vehicle.scale.x = 0.05;\n vehicle.scale.y = 0.05;\n vehicle.scale.z = 0.05;\n \n vehicle.rotation.y = Math.PI/2;\n \n vehicle.name = name;\n\n var computeFrame = () => {computeFrame3(i,delta,name,distance)}\n\n requestAnimationFrame(computeFrame);\n }", "title": "" }, { "docid": "cafe5ac55bb432609e2de5759dc4fc4b", "score": "0.5670969", "text": "function createClouds(nbCloud) {\n\tfor( i=0;i<=nbCloud;i++) {\n\t\t$('#clouds').append('<div id=\"cloudx'+(i+1)+'\" class=\"cloud x'+(i+1)+'\"></div>');\n\t}\n}", "title": "" }, { "docid": "3a31960ccf0cba8e49a83aa9d74bd977", "score": "0.5669312", "text": "function createBoard(){\n for(let i=0; i<carPic.length;i++){\n let card = document.createElement('img')\n // creating an image tage for each item of carpic array\n card.setAttribute('src','img/bbs.png')\n // adding the src of the image associated with each image\n card.setAttribute('data-id',i)\n // giving an ID to each item of the array\n card.addEventListener('click',cardFlip)\n // each card will flip on click\n table.appendChild(card)\n // adding an image associated with the attributes added to each item of the array\n card.classList.add(\"wheel\")\n // adding a css class of wheel to make it spin\n }\n }", "title": "" }, { "docid": "8981a523b9a3e9aa4bd874c5ba938238", "score": "0.5651445", "text": "function carsComing() {\n // This will work only when game is not paused or over.\n if (checkGamePause === false) {\n\n containerG.append(\"<div id='car\" + carCount + \"' class='otherCar car'> <div class='f_glass'></div> <div class='b_glass'></div> <div class='f_light_l'></div> <div class='f_light_r'></div> <div class='f_tyre_l'></div> <div class='f_tyre_r'></div> <div class='b_tyre_l'></div> <div class='b_tyre_r'></div> </div>\");\n var carCreated = $(\"#car\" + carCount);\n // moving car from top of scrren\n carCreated.moveTo(180).speed(otherCarsspeed).css(\"top\", \"0px\");\n scale =1;\n if(availableHeight<1000)\n {\n scale = 0.7;\n }\n carCreated.css(\"transform\",\"scale(\"+scale+\")\");\n // left position of cars is set by random function.\n carCreated.css(\"left\", random(carCreated.width(), containerG.width() - carCreated.width()) + \"px\");\n carCount++;\n\n scoreValue++;\n // score displayed\n $(\"#scoreValue\").html(scoreValue);\n }\n }", "title": "" }, { "docid": "95c9ad05cb877da9fee2950245e1ce3d", "score": "0.5649253", "text": "function MakeCarObjects(brand, model, year) {\n this.brand = brand;\n this.model = model;\n this.year = year;\n this.move = 0;\n\n this.moveCar = function () {\n this.move += 10;\n };\n}", "title": "" }, { "docid": "00ddb895541e42d0c59a88acde65bc04", "score": "0.56421113", "text": "function generateSetPlanets() {\n zeroPlanetArrays();\n for (var index = 0; index < M; index++) {\n planet_masses.push(Number(planet_input_masses[index].value()));\n planet_positions.push(createVector(Number(planet_input_initial_x_pos[index].value()), Number(planet_input_initial_y_pos[index].value()), 0));\n planet_velocities.push(createVector(Number(planet_input_initial_x_vel[index].value()), Number(planet_input_initial_y_vel[index].value()), 0));\n planet_accelerations.push(createVector(0, 0, 0));\n planet_flag = 1;\n planet = new Star(planet_masses[index], 'white', planet_flag);\n planets.push(planet);\n }\n //removes menu buttons\n if (show_menu == 1) {\n deleteMenu();\n generateButtons(windowWidth);\n }\n show_menu = 0;\n paused = 0;\n textSize(15);\n}", "title": "" }, { "docid": "6eb8f49ec054c9458c9f4fea535ea9e5", "score": "0.5629077", "text": "constructor(carColor, carEngine, carKm, model, price) {\n // in momentul in care creeam obiectul se apeleaza\n this.color = carColor;\n this.engine = carEngine;\n this.km = carKm;\n this.model = model;\n // this.runEngine = false;\n this.nrOfDoors = 4;\n this.price = price;\n }", "title": "" }, { "docid": "3a8abfbe7f6d19811aadc4f96ac5db93", "score": "0.5628274", "text": "function init_car(){\n\tscenario.set_normals(computeVertexNormals(scenario.get_vertices()));\n\troad.set_normals(computeVertexNormals(road.get_vertices()));\n\tcar.set_normals(computeVertexNormals(car.get_vertices()));\n\twheels.set_normals(computeVertexNormals(wheels.get_vertices()));\n\n\tdrawObjects();\n}", "title": "" }, { "docid": "a66430929520ef2dbadaaa6668113367", "score": "0.5622695", "text": "async function saveCars() {\n let arr = []\n for (let i = 0; i < result.length; i++) {\n let item = await scrape3Cars.create({\n title: result[i].title,\n year: result[i].year,\n kilometraje: result[i].kilometraje,\n ubicacion: result[i].ubicacion,\n price: result[i].price,\n link: result[i].link,\n img: result[i].img,\n date: result[i].date\n })\n arr.push(item)\n }\n return arr\n }", "title": "" }, { "docid": "be25feb809fe8ebe45cf049f8b1045f6", "score": "0.5621613", "text": "function objectSwitchCreator(amount, room) {\n for(var idx = 0; idx < amount; idx++) {\n var objectSwitch = new Location(-1, -1);\n objectSwitch.canMove = false;\n objectSwitch.description = \"A stone pillar about chest-high, topped with a stone bowl that shows signs of intense heat\";\n objectSwitch.terrainType = \"objectSwitch\";\n objectSwitch.symbol = \"/\";\n objectSwitch.color = \"red\";\n objectSwitch.searchable = false;\n objectSwitch.drops = [];\n objectSwitch.inside = \"\";\n\n room.switches.push(objectSwitch);\n }\n}", "title": "" }, { "docid": "b4fad2448f4890616152d39284b4dbc2", "score": "0.5617934", "text": "function createDucks(amount, callback) {\n\n\tvar allDucks = [];\n\t\n\tfor( var i=0; i<amount; i++) {\n\t\tvar duck = new Duck({\n\t\t\tposition: i*10,\n\t\t\tclickHandler: duckOnClick\n\t\t});\n\n\t\tallDucks.push(duck);\n\t}\n\n\n\tfor( var i=0; i<allDucks.length; i++) {\n\t\tstage.append(allDucks[i]);\n\t}\n\n\tcallback(allDucks);\n\n}", "title": "" }, { "docid": "d14da37ceec9f811041cc9eb7d3d3770", "score": "0.5616763", "text": "function CarMaker() {}", "title": "" }, { "docid": "7fb464b7064e05fd2a4de19b473c00e4", "score": "0.56082374", "text": "function generateVehicles(numberOfVehicles){\n\t\t$('#tableContent').html(\"\");\n\t\t//for loop that will run for the number that comes from the drop down list\n\t\tfor(var i=1; i <= numberOfVehicles; i++){\n\t\t\t$.get(\"http://swapi.co/api/vehicles/\"+i+\"/\", {//gets the specific specie\n\t\t\t}).done(function(vehicle) {\t\n\t\t\t\tdrawTableVehicles(vehicle);//draws the row of info\n\t\t\t}).fail(function() {\n\t\t\t\t// $spanInfo.append(\"<br><b>Failed loading some of the content</b>\");\n\t\t\t\terrorMessagePullingDataFromAPI();\n\t\t\t\t// console.log('something went wrong in the ajaxForVehicles()! SECOND');\n\t\t\t});\n\t\t}\n\t\tinfoVehicles=\"\";\n\t\t// $panInfo.html(\"\");\n\t}", "title": "" }, { "docid": "1ffa4be6eb1841d0c9cd1188f493f51f", "score": "0.5602651", "text": "function setup() {\n createCanvas(600, 600);\n\n// INHERITANCE ////////////////////////////////////////////////////////////////\n for (let i = 0; i < numCars; i++) {\n let x = random(0, width);\n let y = random(0, height);\n let car = new Car(x,y);\n // cars.push(car);\n// POLYMORPHISM ////////////////////////////////////////////////////////////////\n vehicles.push(car);\n }\n\n for (let i = 0; i < numMotorcycles; i++) {\n let x = random(0, width);\n let y = random(0, height);\n let motorcycle = new Motorcycle(x,y);\n // motorcycles.push(motorcycle);\n// POLYMORPHISM ////////////////////////////////////////////////////////////////\n vehicles.push(motorcycle);\n }\n\n for (let i = 0; i < numSportsCars; i++) {\n let x = random(0, width);\n let y = random(0, height);\n let sportscar = new SportsCar(x,y);\n vehicles.push(sportscar);\n }\n}", "title": "" }, { "docid": "e6842fe1ea5cb33312807d0032be1797", "score": "0.56019825", "text": "function placeClues() {\n\tvar game;\n \tgame = Game.instance;\n \t //get available clue data\n \t var currentClueDataArray = [];\n currentClueDataArray = getAvailableClues();\n //create array of objects and add to screen\n var clueLabelArray = [];\n for (var i = 0; i < currentClueDataArray.length; i++) {\n \tclueLabelArray[i] = new clueType(currentClueDataArray[i]);\n \tclueLabelArray[i].x = (i * 60) + 20 - (Math.floor(i/6) * 360);\n \tclueLabelArray[i].y = (Math.floor(i/6) * 60) + 80;\n \tif (clueLabelArray[i].available == 1) {\n \t\tgame.currentScene.addChild(clueLabelArray[i]);\n \t}\n }\n}", "title": "" }, { "docid": "1a10e0a9959e0f1a4309530bd0ad5ee8", "score": "0.5594361", "text": "function createCar(newCarMake, newCarYear, newCarColor) {\n let speed = 0;\n return {\n // car looks\n make: newCarMake,\n year: newCarYear,\n color: newCarColor,\n carInfo: function () {return this.color+\" \"+this.year+\" \"+this.make},\n // driving functionality\n getSpeed: function () {return speed},\n accelerate: function() {speed += 10;},\n brake: function () {\n let brakeSpeed = Math.floor(Math.random() * (speed/2))+1;\n speed -= brakeSpeed;\n },\n stopCar: function() {speed = Math.max(0, speed);},\n // speedLimit: function() {speed = Math.min(85, speed);},\n }\n}", "title": "" }, { "docid": "c3793c578525ba285882d4fa552a4401", "score": "0.5571194", "text": "function lavaCreator(amount, room) {\n for(var idx = 0; idx < amount; idx++) {\n var lava = new Location(-1, -1);\n lava.canMove = true;\n lava.description = \"Fiery hot lava\";\n lava.terrainType = \"lava\";\n lava.symbol = \"w\";\n lava.color = \"bright-red\";\n lava.searchable = false;\n lava.drops = [];\n\n room.lavas.push(lava);\n }\n}", "title": "" }, { "docid": "a753a0ac07245b92e3e272581d9e0011", "score": "0.5568167", "text": "function moveCars() {\n var isVictory = false;\n for (var i = 0; i < gCars.length; i++) {\n var car = gCars[i];\n var elCar = gElCars[i];\n\n if (gIntervalRace) {\n car.distance += car.speed;\n elCar.style.marginLeft = car.distance + 'px';\n\n if (car.distance > gElRoad.offsetWidth) isVictory = true;\n } else {\n // when game is not on, we just go to starting point\n elCar.style.marginLeft = '5px';\n }\n\n\n }\n if (isVictory) informVictory();\n}", "title": "" }, { "docid": "66f603164b4c938885cd807c5a8b2972", "score": "0.55582654", "text": "function submitWheels() {\r\n if (validateWheels() == true) {\r\n for (var i = 0; i < 4; i++) {\r\n var brandWheel = document.getElementById(\"brandWheel\" + i);\r\n var diameterWheel = document.getElementById(\"diameterWheel\" + i);\r\n car.addWheel(new Wheel(diameterWheel.value, brandWheel.value));\r\n }\r\n var wheelsInputs = document.getElementById(\"wheelsInputs\");\r\n var newCarInfo = document.getElementById(\"carInfo\");\r\n var successText = document.getElementById(\"Title\");\r\n successText.innerHTML = \"New car created\";\r\n displayContent(newCarInfo, wheelsInputs);\r\n showCarInfo(car.plate, car.brand, car.color);\r\n showWheels();\r\n }\r\n} //end submitWheels()", "title": "" }, { "docid": "21e57e5a5d141574b92e4e71d9d29181", "score": "0.5557633", "text": "setupCrates() {\n const crateSize = 10.0;\n const EPS = 4.0;\n const crates = [];\n for (let i = 1; i < 14; i++) {\n const crate = new Crate(crateSize);\n const xPosition =\n this.terrain.terrainWidth / 2 + EPS - i * crateSize;\n const yPosition = crateSize / 2.0;\n const zPosition = this.terrain.terrainHeight / 2 - 55.0;\n\n crate.position.set(xPosition, yPosition, zPosition);\n this.add(crate);\n crates.push(crate);\n }\n\n for (let i = 1; i < 14; i++) {\n const crate = new Crate(crateSize);\n const xPosition =\n i * crateSize - (this.terrain.terrainWidth / 2 + EPS);\n const yPosition = crateSize / 2.0;\n const zPosition = 0;\n\n crate.position.set(xPosition, yPosition, zPosition);\n this.add(crate);\n crates.push(crate);\n }\n\n for (let i = 1; i < 14; i++) {\n const crate = new Crate(crateSize);\n const xPosition =\n this.terrain.terrainWidth / 2 + EPS - i * crateSize;\n const yPosition = crateSize / 2.0;\n const zPosition = -(this.terrain.terrainHeight / 2) + 55.0;\n\n crate.position.set(xPosition, yPosition, zPosition);\n this.add(crate);\n crates.push(crate);\n }\n\n // Add a cannon body to each crate\n crates.forEach((crate) => {\n const mass = 0;\n const crateShape = new Box(\n new Vec3(crateSize / 2, crateSize / 2, crateSize / 2)\n );\n const crateBody = new Body({ mass: mass, shape: crateShape });\n crateBody.position.set(\n crate.position.x,\n crate.position.y,\n crate.position.z\n );\n this.world.addBody(crateBody);\n });\n }", "title": "" }, { "docid": "f57e5e7dcebd8a7404c96a0b77873413", "score": "0.555711", "text": "function race() {\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n for (let j = 0; j < 1; j++) {\r\n for (let i = 0; i < myCars.length; i++) {\r\n myCars[i].draw();\r\n myCars[i].move();\r\n }\r\n }\r\n\r\n requestAnimationFrame(race);\r\n}", "title": "" }, { "docid": "07794a36949a8d7b323e153825096dcf", "score": "0.5551909", "text": "function cottage_road(numberCottages) {\n if(typeof numberCottages == 'undefined') {\n numberCottages = 6;\n }\n var i = 0,\n distanceBetweenTrees = 11;\n //\n // step 1 build the road.\n //\n var cottagesPerSide = Math.floor(numberCottages / 2);\n this\n // make sure the drone's state is saved.\n .chkpt('cottage_road')\n // build the road\n .box(blocks.double_slab.stone, 3, 1, cottagesPerSide * (distanceBetweenTrees + 1)).up()\n // now centered in middle of road\n .right()\n // will be returning to this position later\n .chkpt('cottage_road_cr');\n //\n // step 2 line the road with trees\n //\n for(; i < cottagesPerSide + 1; i++) {\n this.left(5).oak().right(10).oak().left(5) // return to middle of road\n .fwd(distanceBetweenTrees + 1); // move forward.\n }\n this.move('cottage_road_cr').back(6); // move back 1/2 the distance between trees\n // this function builds a path leading to a cottage.\n function pathAndCottage(drone) {\n drone.down().box(blocks.double_slab.stone, 1, 1, 5).fwd(5).left(3).up().cottage();\n return drone;\n };\n //\n // step 3 build cottages on each side\n //\n for(i = 0; i < cottagesPerSide; i++) {\n this.fwd(distanceBetweenTrees + 1).chkpt('r' + i);\n // build cottage on left\n pathAndCottage(this.turn(3)).move('r' + i);\n // build cottage on right\n pathAndCottage(this.turn()).move('r' + i);\n }\n // return drone to where it was at start of function\n this.move('cottage_road');\n}", "title": "" }, { "docid": "53954db3e5b20a53543d7e29e8816c0d", "score": "0.554648", "text": "drawCars() {\n let g = this,\n cxt = g.context,\n cars = window._main.cars;\n cars.forEach(function (car, idx) {\n if (car.x > 950) {\n // Remove used cars\n cars.splice(idx, 1);\n }\n car.draw(g, cxt);\n });\n }", "title": "" }, { "docid": "fde07e009ee13722ffeb2f3b25ea7678", "score": "0.55397046", "text": "function initCarMaps() {\n\t \tvar locations = carmarkers;\n\t \tvar wrappers = document.getElementsByClassName('map-container');\n\t\tvar marker, i;\n\t \tvar infowindow = new google.maps.InfoWindow();\n\t \tvar image = {\n\t \t\turl: \"img/carmarker.png\",\n\t \t\tscaledSize: new google.maps.Size(30, 30), // scaled size\n\t \t};\n\t \t//append map to each car element\n\t \tfor (i = 0; i < wrappers.length; i++) {\n\t \t\tlatlng = {lat: parseFloat(locations[i][0]), lng: parseFloat(locations[i][1])};\n\t \t\t//console.log(latlng);\n\t \t\tvar mapOptions = {\n\t center: latlng,\n\t scrollwheel: true,\n\t zoom: 15\n\t };\n\t map = new google.maps.Map(document.getElementById('map-' + (i + 1)), mapOptions);\n \t var marker = new google.maps.Marker({\n\t map: map,\n\t position: latlng,\n\t icon: image\n\t });\n\t google.maps.event.addListener(marker, 'click', (function(marker, i) {\n\t\t return function() {\n\t\t infowindow.setContent(locations[i][2] || \"On the road\");\n\t\t infowindow.open(map, marker);\n\t\t }\n\t })(marker, i));\n\t \t}\n }", "title": "" }, { "docid": "50fc2def5f35e6e4dece6b3889b46e04", "score": "0.5538091", "text": "function createClues(){\n for (var i = 1; i <= numberOfClues; i++){\n $('<div></div>', {\n \"class\": 'create-input',\n id: 'clue-' + i\n }).insertBefore('#create-clues-form').after('<br/>');\n $('<label></label', {\n for: 'clue' + i,\n text: 'Clue ' + i + ' Text:'\n }).appendTo('#clue-' + i).after('<br/>');\n $('<textarea></textarea', {\n \"class\": 'clue-info',\n id: 'clueInfo' + i,\n name: 'clue' + i \n }).appendTo('#clue-' + i).after('<br/>', '<br/>');\n $('<label></label', {\n for: 'clue' + i + '-loc',\n text: 'Clue ' + i + ' Location:'\n }).appendTo('#clue-' + i).after('<br/>');\n $('<input/>', {\n type: 'text',\n \"class\": 'clue-loc',\n id: 'clue' + i + '-loc',\n name: 'clue' + i + '-loc',\n css: {\n 'margin-right': '5px'\n },\n prop: {\n 'readonly': 'true'\n }\n }).appendTo('#clue-' + i);\n $('<button/>', {\n type: 'button',\n \"class\": 'button alt-gradient-button',\n id: 'clue' + i,\n onclick: 'createClueMap(this.id)',\n text: 'map'\n }).appendTo('#clue-' + i);\n }\n $('#c2-2').css('display', 'block');\n}", "title": "" }, { "docid": "0476d42b0cee93d71c1a2ab0e7c365d6", "score": "0.553485", "text": "function initiateCar(x,y,width, height, velocity, health, color='blue') {\n var car = {\n velocity:velocity, //represents horizontal velcoity for player and vertical velocity for opponents\n color: color,\n x: x,\n y: y,\n width: width,\n height: height,\n health: health,\n };\n\n return car;\n}", "title": "" }, { "docid": "bee605b735497a4862a5deb58654c8df", "score": "0.5519486", "text": "function maze(){\n //The funktion values if the command is true. The command is y < lane1.length.\n //If the command is true, the function create(y) will run.\n //y++ is autoincrement. It means y increases with 1 for every loop.\nfor(y = 0; y < lane4.length; y++){\n create(y);\n}\n}", "title": "" }, { "docid": "eb1f3a031a423951e8661c29bb9e1356", "score": "0.5517706", "text": "function addCarsToResult(result) {\n \n //console.log('available Cars: ' + JSON.stringify(result));\n carInfo.style.display = \"none\";\n\n let carTable = document.getElementById(\"t01\");\n\n //create car row\n result.forEach((car) => {\n \n let tr = createElm(\"tr\");\n tr.className = \"row\";\n\n let imgTd = createElm(\"td\");\n let img = createElm(\"img\");\n img.src=result.imgLink;\n img.alt =\"Image\";\n imgTd.appendChild(img);\n tr.appendChild(imgTd);\n\n let type = createElm(\"td\");\n type.className=\"fordonstyp\";\n type.textContent = car.fordonstyp;\n tr.appendChild(type);\n\n let brand = createElm(\"td\");\n brand.className=\"brand\";\n brand.textContent = car.brand;\n tr.appendChild(brand);\n\n let model = createElm(\"td\");\n model.className=\"brand\";\n model.textContent = car.model;\n tr.appendChild(model);\n\n let year = createElm(\"td\");\n year.className=\"year\";\n year.textContent = car.year;\n tr.appendChild(year);\n\n let fuel = createElm(\"td\");\n fuel.className=\"fuel\";\n fuel.textContent = car.fuel;\n tr.appendChild(fuel);\n\n let gearbox = createElm(\"td\");\n gearbox.className=\"gearbox\";\n gearbox.textContent = car.gearbox;\n tr.appendChild(gearbox);\n\n let requiredDrivingLicense = createElm(\"td\");\n requiredDrivingLicense.className=\"reqLicense\";\n requiredDrivingLicense.textContent = car.requiredDrivingLicense;\n tr.appendChild(requiredDrivingLicense);\n\n let dagshyra = createElm(\"td\");\n dagshyra.className=\"dagshyra\";\n dagshyra.textContent = car.dagshyra;\n tr.appendChild(dagshyra);\n\n let bookBtn = createElm(\"button\");\n bookBtn.textContent = \"BOOK\";\n bookBtn.className = \"bookBtn\";\n bookBtn.attributes[\"data-id\"]=car._id;\n tr.appendChild(bookBtn);\n\n let kommentarer = createElm(\"td\");\n kommentarer.className=\"comments\";\n try{\n kommentarer.textContent = car.kommentarer.skador;\n }catch(e){/*IGNORE*/}\n tr.appendChild(kommentarer);\n\n carTable.appendChild(tr);\n\n });\n //add cars to result\n vehicleContainer.appendChild(carTable);\n\n //when all cars are added add listeners\n addClickListenerForCars();\n\n}", "title": "" }, { "docid": "5a0337470cc85ad5388d6eb1e248a272", "score": "0.5505439", "text": "function makeVehicleList(data) {\n self.dataArray([]);\n data.forEach((datum) => {\n self.dataArray.push(datum);\n });\n }", "title": "" }, { "docid": "9fcffe8e3397c556be33bdfd0be1c91b", "score": "0.5488454", "text": "function lanzarCaramelos () {\n\t\tfor (var i = 1; i<=7; i++ ){\n\t\t\tfor (var j = 1; j<=7; j++ ){\n\t\t\t\ttipoImagen=Math.floor(Math.random() * 4) + 1 \n\t\t\t\tcrearCaramelo(i,tipoImagen,j,);\n\t\t\t}\n\t\t}\n\t\t$('.elemento').draggable({\n\t\t\trevert: true\n\t\t});\n\t\n\t}", "title": "" }, { "docid": "145f89deae8bba4e36bc446913b5bbb7", "score": "0.5488091", "text": "function mostraCarro(){\n for (let i = 0; i < imagemDoCarros.length; i ++ ){\n image(imagemDoCarros[i], xCarros[i], yCarros[i], compc, altc)\n }\n \n}", "title": "" }, { "docid": "54dc63571f503de3afc16184def33d09", "score": "0.54814637", "text": "function mostraCarro(){\n for (let i = 0; i < imagemCarros.length; i++){\n image(imagemCarros[i], xCarros[i], yCarros[i], comprimentoCarro, alturaCarro);\n }\n}", "title": "" }, { "docid": "1fea542c2da10c1b80ab10a4ab0f4711", "score": "0.5478274", "text": "function addRoadMarkers() {\n for (let k = 0; k < 50; k++) {\n var geometry = new THREE.PlaneGeometry( 10, 50, 32 );\n var material = new THREE.MeshStandardMaterial( {color: 0xfffff0 , side: THREE.DoubleSide} );\n var marker = new THREE.Mesh( geometry, material );\n marker.rotation.x = (Math.PI / 180) * 90;\n marker.position.set(0, 77, -4000 + k * 100)\n roadMarkers.push(marker);\n scene.add(roadMarkers[k])\n }\n\n}", "title": "" }, { "docid": "2dbecbd565f31273f3171e9a2459433d", "score": "0.5475862", "text": "function addCarModel(model) {\r\n if (!model) return;\r\n\r\n\r\n const modelScene = model.gltf.scene;\r\n //console.log(Utils.dumpObject(modelScene).join('\\n'));\r\n\r\n let wheels = [],\r\n roofLights = [];\r\n\r\n modelScene.traverse(o => {\r\n if (o.isMesh) {\r\n o.castShadow = true;\r\n o.receiveShadow = true;\r\n }\r\n\r\n // Check if the 3D car model has references to the wheels\r\n if (model.wheelsNames && model.wheelsNames.length == 4) {\r\n // Reference the four wheels\r\n if (o.name === model.wheelsNames[0]) wheels[0] = o;\r\n else if (o.name === model.wheelsNames[1]) wheels[1] = o;\r\n else if (o.name === model.wheelsNames[2]) wheels[2] = o;\r\n else if (o.name === model.wheelsNames[3]) wheels[3] = o;\r\n }\r\n\r\n // Check if the 3D car model has references to the wheels\r\n if (model.roofLightsNames) {\r\n for (let i = 0; i < model.roofLightsNames.length; i++)\r\n if (o.name === model.roofLightsNames[i]) {\r\n roofLights.push(o);\r\n break;\r\n }\r\n }\r\n\r\n });\r\n\r\n const components = {\r\n wheels: model.wheelsNames ? wheels : null\r\n };\r\n\r\n if (model != dynamicModels.bmwE30 && model.wheelsNames && model.wheelsNames.length == 4) {\r\n // Adjust front wheels orientation before to animate them (steering)\r\n wheels[0].rotation.z = 0;\r\n wheels[1].rotation.z = 0;\r\n }\r\n\r\n\r\n //scene.add(modelScene);\r\n\r\n if (model == selectedModel) {\r\n // Create the PositionalAudio object (passing in the listener)\r\n audioObjects.car = new THREE.PositionalAudio(listener);\r\n applySound(modelScene, 'src/sounds/Car acceleration.mp3', audioObjects.car);\r\n\r\n // Set the directionalLight target in order to track the player model\r\n sunlight.target = modelScene;\r\n\r\n // Set fixed initial position for the player model\r\n modelScene.position.set(...model.position);\r\n modelScene.scale.set(...model.scale);\r\n modelScene.lookAt(modelScene.position.x, modelScene.position.y, modelScene.position.z - 30);\r\n\r\n // Create the car, store its reference and set the player model\r\n playerModel = new Car(modelScene, model.carInfo, game, components);\r\n player.setModel(playerModel);\r\n }\r\n else if (model == policeSelModel) {\r\n // Create the PositionalAudio object (passing in the listener)\r\n audioObjects.policeCar = new THREE.PositionalAudio(listener);\r\n applySound(modelScene, 'src/sounds/Police siren.mp3', audioObjects.policeCar);\r\n\r\n components.roofLights = model.roofLightsNames ? roofLights : null;\r\n\r\n // Set fixed initial position for the police model\r\n modelScene.position.set(...model.position);\r\n modelScene.scale.set(...model.scale);\r\n modelScene.lookAt(modelScene.position.x, modelScene.position.y, modelScene.position.z - 30);\r\n\r\n // Create the car, store its reference and set the police model\r\n policeModel = new PoliceCar(modelScene, model.carInfo, game, components, scene, gui);\r\n police.setModel(policeModel);\r\n }\r\n else {\r\n // Place car on the lanes randomly\r\n placeCar(model, true);\r\n\r\n modelScene.scale.set(...model.scale);\r\n\r\n // Set max speed IA cars\r\n //model.carInfo.maxSpeed = 300;\r\n\r\n // Create the car and store its reference\r\n model.car = new Car(modelScene, model.carInfo, game, components);\r\n }\r\n }", "title": "" }, { "docid": "cde2e625aff2aa5b9c9f265c45f54685", "score": "0.54751754", "text": "function createShips(){\n ships.forEach(function(element){\n let divContainer = document.createElement(\"div\");\n divContainer.id = element.name;\n divContainer.classList.add(\"ship\");\n shipContainer.appendChild(divContainer)\n for (let i=0; i<element.size; i++){\n let div = document.createElement(\"div\");\n div.classList.add(element.name);\n divContainer.appendChild(div);\n }\n })\n}", "title": "" }, { "docid": "1063aca08478406c1cae3d706d5fecad", "score": "0.54751277", "text": "createCar(){\n this.app.post(this.baseUrl + '/create', function (req, res) {\n var car = new Car(0, req.body.name, req.body.color);\n console.log(\"CarAPI: car to create \" + car.name);\n CarData.create(car).then(function (result) {\n res = ResponseBuilder.createResponse(res, HttpStatus.CREATED);\n res.end(JSON.stringify(result));\n }).catch(function(result){\n res.end(\"car could not be created\");\n })\n })\n }", "title": "" }, { "docid": "6d0a2fb6d0c0f7b6202d2ac32750f3ef", "score": "0.54694533", "text": "function buildCarView(car) {\n const carView = document.createElement('div');\n carView.id = 'js-car-container';\n\n const image = document.createElement('img');\n image.src = car.path;\n image.classList.add('car-image');\n\n const name = document.createElement('div');\n name.textContent = `Name: ${car.name}`;\n\n const power = document.createElement('div');\n power.textContent = `Power: ${car.power}`;\n\n const country = document.createElement('div');\n country.textContent = `Country: ${car.country}`;\n\n const funFact = document.createElement('div');\n funFact.textContent = `Why I like this car? ${car.funFact}`;\n\n carView.appendChild(image);\n carView.appendChild(name);\n carView.appendChild(power);\n carView.appendChild(country);\n carView.appendChild(funFact);\n\n return carView;\n}", "title": "" }, { "docid": "3fd16a855e1750b9c6923f095fad4046", "score": "0.5456538", "text": "function add_car(brand,year,model,fuel,price){\n array_brand.push(brand);\n array_year.push(year);\n array_model.push(model);\n array_fuel.push(fuel);\n array_price.push(price);\n }", "title": "" }, { "docid": "283d9ae3ea8adec36249fb9bef50f25c", "score": "0.54564136", "text": "function createListOfCards() {\n const cards = createListOfCardsUrl();\n let listOfCards = [];\n for (let i = 0; i < 4; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 11))\n }\n\n for (let i = 4; i < 8; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 2))\n }\n\n for (let i = 8; i < 12; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 3))\n }\n\n for (let i = 12; i < 16; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 4))\n }\n\n for (let i = 16; i < 20; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 5))\n }\n\n for (let i = 20; i < 24; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 6))\n }\n\n for (let i = 24; i < 28; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 7))\n }\n\n for (let i = 28; i < 32; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 8))\n }\n\n for (let i = 32; i < 36; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 9))\n }\n\n for (let i = 36; i < 52; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 10))\n }\n\n listOfCards.push(new CreateNewCard(cards[52], 0))\n\n return listOfCards;\n}", "title": "" }, { "docid": "919b7eba50277bfd40657e6293472cee", "score": "0.5447553", "text": "function showCars(cars) {\n for (var index = 0; index < cars.cars.length; index++) {\n var id = (index + 1).toString();\n var carId = \"#car_\" + id;\n var carInfoId = \"#car_info_\" + id;\n \n $(carId).text(cars.cars[index].brand + \"-\" + cars.cars[index].model + \"-\" + (cars.cars[index].model_year).toString());\n \n var availability;\n // Add the car into the availability array if it is available\n if (cars.cars[index].availability == true) {\n availability = \"Yes\";\n availableCars.push(index);\n } else {\n availability = \"No\";\n }\n var carInfo = \"<b>Mileage: </b>\" + cars.cars[index].mileage + \" kms<br/><b>Fuel type: </b>\" + cars.cars[index].fuel_type + \"<br /><b>Price per day: </b>$\" + cars.cars[index].price_per_day + \"<br /><b>Availability: </b>\" + availability + \"<br /><b>Description: </b>\" + cars.cars[index].description;\n // Write carInfo on the home page\n $(carInfoId).html(carInfo);\n }\n}", "title": "" }, { "docid": "00dfa01bd4f35c955e41c8449bd34d7d", "score": "0.5441512", "text": "function drawCars(){\n//eight cars total\n// create arrays for the variables that will need to be specified for each separate car\n\tvar carsSX = [carSX1, carSX2, carSX3, carSX4, carSX5, carSX6, carSX7, carSX8];\n\tvar carsX = [carX1, carX2, carX3, carX4, carX5, carX6, carX7, carX8];\n\tvar carsY = [carY1, carY2, carY3, carY4, carY5, carY6, carY7, carY8];\n//We want to make the car move across the canvas in a continuous loop, so we will need to vary the x position of the car.\n\tfor (i = 0; i < carsX.length; i++){\n\t\tctx.drawImage(car, carsSX[i], 0, 60, 35, carsX[i], carsY[i], carWidth, carHeight);\n\t}\n}", "title": "" }, { "docid": "93ad573249d5c78ff231ea889aefe3e0", "score": "0.54365224", "text": "function deviceShaken() {\n // re-spawn cars\n cars2 = []; // clear the array first\n for (var i = 0; i < maxCars2; i++) {\n cars2.push(new Car2());\n }\n}", "title": "" }, { "docid": "0ac1370dce66949d7ea61332dbbc32bc", "score": "0.5432226", "text": "function createWaterLane(lanes) {\n // Variables that change for each water lane\n let logSpeed = 1; // Speed of the logs\n let lane = 0; // The position in z of the lane\n let logDirection = true; // Direction of the logs\n\n // Create water object\n let geometry = new THREE.BoxGeometry(1000, 0.1, 2);\n let material = new THREE.MeshBasicMaterial({color: 0x18288f});\n for(let i=0; i<lanes; i++) {\n // Create lane\n let waterLane = new THREE.Mesh(geometry, material);\n waterLane.position.z = lane;\n\n // Get box for collision (it is fixed for water)\n waterLane.box = new THREE.Box3().setFromObject(waterLane);\n\n // Add lane to scene\n scene.add(waterLane);\n\n // Create the logs\n createLogs(lane, logSpeed, logDirection);\n\n // Increase speed\n logSpeed += 0.25;\n\n // Update position in z\n lane -= 15;\n\n // Alternate direction of lanes\n logDirection = !logDirection;\n \n waterLanes.push(waterLane);\n \n }\n}", "title": "" }, { "docid": "1de5be36cd6c3db836ab150682199de3", "score": "0.54142714", "text": "function createCity(buildingCount, rangeX, rangeY, scale, startingX) {\n\n var startingZ = -4000;\n // create the basic buildingblock\n var buildingBlock = new THREE.BoxGeometry(30,30,100);\n buildingBlock.applyMatrix( new THREE.Matrix4().makeTranslation( 0, 0.5, 0 ) );\n // setup the texture for the roof\n var uvPixel = 0.0;\n buildingBlock.faceVertexUvs[0][4][0]=new THREE.Vector2(uvPixel,uvPixel);\n buildingBlock.faceVertexUvs[0][4][1]=new THREE.Vector2(uvPixel,uvPixel);\n buildingBlock.faceVertexUvs[0][4][2]=new THREE.Vector2(uvPixel,uvPixel);\n buildingBlock.faceVertexUvs[0][5][0]=new THREE.Vector2(uvPixel,uvPixel);\n buildingBlock.faceVertexUvs[0][5][1]=new THREE.Vector2(uvPixel,uvPixel);\n buildingBlock.faceVertexUvs[0][5][2]=new THREE.Vector2(uvPixel,uvPixel);\n\n var baseScaleY = 35;\n\n // create buildings\n for (var i = 0 ; i < buildingCount ; i++) {\n // create a custom material for each building\n var material = new THREE.MeshLambertMaterial();\n material.color = new THREE.Color(0xffffff);\n material.map = new THREE.Texture(generateBuildingTexture());\n material.map.anisotropy = renderer.getMaxAnisotropy();\n material.map.needsUpdate = true;\n // create the mesh\n var building = new THREE.Mesh(buildingBlock, material);\n //var scale =((Math.random()/1.2)+0.5) * scale;\n //var scale = 1.2 * scale;\n // scale the buildings\n building.scale.x = scale * 2;\n building.scale.z = scale;\n building.scale.y = baseScaleY + Math.random() * 15;\n building.rotation.y = Math.PI / 180 * 90;\n // position the buildings\n building.position.x= startingX;\n building.position.z= startingZ;\n building.position.y = 150;\n console.log(buildingBlock.parameters.height);\n // add to scene\n\n scene.add(building);\n buildingArr.push(building);\n\n\n if (startingX < 0) {\n startingX += 375;\n }\n else {\n startingX -= 375;\n }\n\n\n if (i === (buildingCount/2) - 1){\n\n if (startingX < 0) {\n startingX = -3900;\n }\n else {\n startingX = 3900;\n }\n\n startingZ -= 300;\n baseScaleY += 15;\n }\n\n\n\n }\n}", "title": "" }, { "docid": "a1a39ea1667eec78dc461236c396fd24", "score": "0.5411645", "text": "function Car(params) {\n this.make = params.make;\n this.model = params.model;\n this.year = params.year;\n this.color = params.color;\n this.passengers = params.passengers;\n this.convertible = params.convertible;\n this.mileage = params.mileage;\n this.started = false;\n this.start = function() {\n this.started = true;\n };\n this.stop = function() {\n this.started = false;\n };\n this.drive = function() {\n if (this.started) {\n console.log(this.make + ' ' + this.model + ' goes zoom zoom!');\n } else {\n console.log('Start the engine first.');\n }\n };\n}", "title": "" }, { "docid": "3f85c742f4b9e537bacd246763da0546", "score": "0.54074347", "text": "function createSystemWindow() {\n planets = [];\n createSystemBG();\n for (let i = 0; i < 8; i++) {\n planetGenerator();\n }\n}", "title": "" }, { "docid": "d1aaa7568c8251d5cadd5d44db74d486", "score": "0.5393266", "text": "init(totalPairs) {\n numberOfPairs = totalPairs;\n cardNames = this.createCardNamesArray();\n cardNames.forEach((cardName) => {\n const title = cardName.split('-').join(' of ');\n const src = this.createCardFilenames(cardName);\n const temporaryCard = this.createCard(cardName, title, src);\n\n deck.push(temporaryCard);\n });\n }", "title": "" }, { "docid": "cc87d4c2b9e43783deee03a109aae152", "score": "0.5389186", "text": "function createNewCar(){\n\n var licensePlate = document.getElementById('license-plate').value;\n var manufacturer = document.getElementById('manufacturer').value;\n var model = document.getElementById('model').value;\n\t var price = parseInt(document.getElementById('price').value); //User input is by default in text format, parseInt changes it to number format.\n var paint = document.getElementById('paint').value;\n\n //Create a new car object with the user input.\n var usercar = new Car(licensePlate, manufacturer, model, paint, price);\n console.log(usercar);\n listOfCars.push(usercar); //Add the new car to the list\n console.table(listOfCars);\n\n }", "title": "" }, { "docid": "db72048397a8abdd846affffaf51711d", "score": "0.53846043", "text": "function createInitialBalls() {\r\n 'use strict';\r\n var colors = [0xff0000, 0x00fff0, 0x0000ff, 0xe05a00, 0x800080, 0xffff00];\r\n for (let i = 0; i < 15; i++) {\r\n\r\n var x = ((i % 3) - 1) * 30;\r\n var z = (Math.floor(i / 3) - 2) * 30;\r\n\r\n //Random angle\r\n var angle = Math.floor(Math.random()*(Math.PI*2));\r\n\r\n // Random velocity\r\n var vel = Math.floor(Math.random()*(150 - 100) + 100);\r\n ball = createBall(x, 2, z, colors[i % colors.length]);\r\n giveMovement(ball, angle, vel);\r\n balls.push(ball);\r\n }\r\n}", "title": "" }, { "docid": "b6612fa1720b745ba8fe3a103993748b", "score": "0.5382653", "text": "function createCircles() {\n \n \tconst dTheta = 0.5*2.43;\n \n \tlet c1 = new OrthoganalCircle(0,dTheta);\n \tlet c2 = new OrthoganalCircle(TWO_PI/3,dTheta);\n \tlet c3 = new OrthoganalCircle(2*TWO_PI/3,dTheta);\n\n \tcircles = [c1,c2,c3]; \n \n}", "title": "" }, { "docid": "af165bdb34ab2d1f7e4afc8d7e69f04b", "score": "0.5378075", "text": "park_vehicle(vehicle) {\n //Initial Loop through the list of parking slots\n for(var i=0 ; i<this.sizes.length; i++) {\n //check if the slot is occupied and if the vehicle size is SMALL\n //Small vehicles can park either of the three, Small, Medium, Large Parking Slot\n if(vehicle.vehicle_size === 'S' && !this.sizes[i].occupied) {\n //check if where would be the vehicle coming from entry point 1;\n if(vehicle.entry_point === 1) {\n // calculate for the closest distance from where the vehicle is coming from\n var currDistance = Math.abs(1 - this.map[0].entry_point1);\n var newDistance = Math.abs(1 - this.map[i].entry_point1);\n // check if the new distance is less than the curr distance if so park the vehicle\n // else park the vehicle with the lowest distance from the entry point of the vehicle\n if(newDistance < currDistance) {\n currDistance = newDistance;\n this.sizes[i].occupied = true;\n this.sizes[i].charge = 40;\n this.sizes[i].time_in = new Date()\n this.sizes[i].vehicle = vehicle;\n return [this.map[i], this.sizes[i]]\n } else {\n this.sizes[i].occupied = true;\n this.sizes[i].charge = 40;\n this.sizes[i].time_in = new Date()\n this.sizes[i].vehicle = vehicle;\n return [this.map[i], this.sizes[i]]\n }\n }\n //check if where would be the vehicle coming from entry point 2;\n else if(vehicle.entry_point == 2) {\n // calculate for the closest distance from where the vehicle is coming from\n var currDistance = Math.abs(1 - this.map[0].entry_point2);\n var newDistance = Math.abs(1 - this.map[i].entry_point2);\n // check if the new distance is less than the curr distance if so park the vehicle\n // else park the vehicle with the lowest distance from the entry point of the vehicle\n if(newDistance < currDistance) {\n currDistance = newDistance;\n this.sizes[i].occupied = true;\n this.sizes[i].charge = 40;\n this.sizes[i].time_in = new Date()\n this.sizes[i].vehicle = vehicle;\n return [this.map[i], this.sizes[i]]\n } else {\n this.sizes[i].occupied = true;\n this.sizes[i].charge = 40;\n this.sizes[i].time_in = new Date()\n this.sizes[i].vehicle = vehicle;\n return [this.map[i], this.sizes[i]]\n }\n }\n //check if where would be the vehicle coming from entry point 3;\n else if(vehicle.entry_point == 3) {\n // calculate for the closest distance from where the vehicle is coming from\n var currDistance = Math.abs(1 - this.map[0].entry_point3);\n var newDistance = Math.abs(1 - this.map[i].entry_point3);\n // check if the new distance is less than the curr distance if so park the vehicle\n // else park the vehicle with the lowest distance from the entry point of the vehicle\n if(newDistance < currDistance) {\n currDistance = newDistance;\n this.sizes[i].occupied = true;\n this.sizes[i].charge = 40;\n this.sizes[i].time_in = new Date()\n this.sizes[i].vehicle = vehicle;\n return [this.map[i], this.sizes[i]]\n } else {\n this.sizes[i].occupied = true;\n this.sizes[i].charge = 40;\n this.sizes[i].time_in = new Date()\n this.sizes[i].vehicle = vehicle;\n return [this.map[i], this.sizes[i]]\n }\n }\n }\n //check the size of the vehicle and if the parking slot is occupied\n else if (vehicle.vehicle_size === 'M' && !this.sizes[i].occupied) {\n //if the vehicle size is medium it can only be parked at medium slot and large slot\n if(this.sizes[i].slot_size === MEDIUM_SLOT || this.sizes[i].slot_size === LARGE_SLOT) {\n if(vehicle.entry_point === 1) {\n var currDistance = Math.abs(1 - this.map[0].entry_point1);\n var newDistance = Math.abs(1 - this.map[i].entry_point1);\n if(newDistance < currDistance) {\n currDistance = newDistance;\n this.sizes[i].occupied = true;\n this.sizes[i].charge = 40;\n this.sizes[i].time_in = new Date()\n this.sizes[i].vehicle = vehicle;\n return [this.map[i], this.sizes[i]]\n } else {\n this.sizes[i].occupied = true;\n this.sizes[i].charge = 40;\n this.sizes[i].time_in = new Date()\n this.sizes[i].vehicle = vehicle;\n return [this.map[i], this.sizes[i]]\n }\n }\n else if(vehicle.entry_point == 2) {\n var currDistance = Math.abs(1 - this.map[0].entry_point2);\n var newDistance = Math.abs(1 - this.map[i].entry_point2);\n if(newDistance < currDistance) {\n currDistance = newDistance;\n this.sizes[i].occupied = true;\n this.sizes[i].charge = 40;\n this.sizes[i].time_in = new Date()\n this.sizes[i].vehicle = vehicle;\n return [this.map[i], this.sizes[i]]\n } else {\n this.sizes[i].occupied = true;\n this.sizes[i].charge = 40;\n this.sizes[i].time_in = new Date()\n this.sizes[i].vehicle = vehicle;\n return [this.map[i], this.sizes[i]]\n }\n }\n else if(vehicle.entry_point == 3) {\n var currDistance = Math.abs(1 - this.map[0].entry_point3);\n var newDistance = Math.abs(1 - this.map[i].entry_point3);\n if(newDistance < currDistance) {\n currDistance = newDistance;\n this.sizes[i].occupied = true;\n this.sizes[i].charge = 40;\n this.sizes[i].time_in = new Date()\n this.sizes[i].vehicle = vehicle;\n return [this.map[i], this.sizes[i]]\n } else {\n this.sizes[i].occupied = true;\n this.sizes[i].charge = 40;\n this.sizes[i].time_in = new Date()\n return [this.map[i], this.sizes[i]]\n }\n }\n // if there is no more available slot for the vehicle to parked\n // return no avaialable parking slot\n } else {\n return 'No available Parking Slot'\n }\n }\n //checks if the vehicle size is Large and if the parking slot is occupied\n //Large vehicles can only be parked at Large Parking Slot\n else if (vehicle.vehicle_size === 'L' && !this.sizes[i].occupied) {\n if(this.sizes[i].slot_size === LARGE_SLOT) {\n if(vehicle.entry_point === 1) {\n var currDistance = Math.abs(1 - this.map[0].entry_point1);\n var newDistance = Math.abs(1 - this.map[i].entry_point1);\n if(newDistance < currDistance) {\n currDistance = newDistance;\n this.sizes[i].occupied = true;\n this.sizes[i].charge = 40;\n this.sizes[i].time_in = new Date()\n this.sizes[i].vehicle = vehicle;\n return [this.map[i], this.sizes[i]]\n } else {\n this.sizes[i].occupied = true;\n this.sizes[i].charge = 40;\n this.sizes[i].time_in = new Date()\n this.sizes[i].vehicle = vehicle;\n return [this.map[i], this.sizes[i]]\n }\n }\n else if(vehicle.entry_point == 2) {\n var currDistance = Math.abs(1 - this.map[0].entry_point2);\n var newDistance = Math.abs(1 - this.map[i].entry_point2);\n if(newDistance < currDistance) {\n currDistance = newDistance;\n this.sizes[i].occupied = true;\n this.sizes[i].charge = 40;\n this.sizes[i].time_in = new Date()\n this.sizes[i].vehicle = vehicle;\n return [this.map[i], this.sizes[i]]\n } else {\n this.sizes[i].occupied = true;\n this.sizes[i].charge = 40;\n this.sizes[i].time_in = new Date()\n this.sizes[i].vehicle = vehicle;\n return [this.map[i], this.sizes[i]]\n }\n }\n else if(vehicle.entry_point == 3) {\n var currDistance = Math.abs(1 - this.map[0].entry_point3);\n var newDistance = Math.abs(1 - this.map[i].entry_point3);\n if(newDistance < currDistance) {\n currDistance = newDistance;\n this.sizes[i].occupied = true;\n this.sizes[i].charge = 40;\n this.sizes[i].time_in = new Date()\n this.sizes[i].vehicle = vehicle;\n return [this.map[i], this.sizes[i]]\n } else {\n this.sizes[i].occupied = true;\n this.sizes[i].charge = 40;\n this.sizes[i].time_in = new Date()\n this.sizes[i].vehicle = vehicle;\n return [this.map[i], this.sizes[i]]\n }\n }\n } else {\n return 'No available Parking Slot'\n }\n } \n }\n }", "title": "" }, { "docid": "b1ab09cef5869050d446296275ba4885", "score": "0.537771", "text": "function createCircles(number){\n //Generate number of circles told\n for (let i = 0; i < number; i++){\n let x = 0;\n let y = 0;\n \n switch(Math.floor(getRandom(0,4))){\n //left side of screen\n case 0:\n x = -10;\n y = Math.floor(getRandom(5,710));\n break;\n //right side of screen\n case 1:\n x = 1290;\n y = Math.floor(getRandom(5,710));\n break;\n //top of screen\n case 2:\n y = -10;\n x = Math.floor(getRandom(5,1270));\n break;\n //bottom of screen\n case 3:\n y = 730;\n x = Math.floor(getRandom(5,1270));\n break;\n }\n\n let circle = new Circle(Math.floor(getRandom(20,60)),0x0000FF,x,y,Math.floor(getRandom(20,80)),time);\n circles.push(circle);\n gameScene.addChild(circle);\n }\n}", "title": "" }, { "docid": "0a521999d2ffc994f38d0bcf1709e323", "score": "0.536742", "text": "function createRunway(con, type, x, y, rotation, n){\n\tvar newRunwayContainer = new createjs.Container();\n\tnewRunwayContainer.x = x;\n\tnewRunwayContainer.y = y;\n\tnewRunwayContainer.rotation = rotation;\n\tnewRunwayContainer.runwayType = type;\n\t\n\tif(type == 0){\n\t\tvar landingGuide = itemRunwayGuide.clone();\n\t\tvar landingGuideStart = itemRunwayHit.clone();\n\t\tvar landingGuideMiddle = itemRunwayHit.clone();\n\t\tvar landingGuideAlpha = itemRunwayHit.clone();\n\t\tvar landingGuideEnd = itemRunwayHit.clone();\n\t\tvar landingGuideAnimate = itemRunwayAnimate.clone();\n\t\tlandingGuide.x = 0;\n\t\t\n\t\tlandingGuideStart.x = 10;\n\t\tlandingGuideMiddle.x = 50;\n\t\tlandingGuideAlpha.x = 90;\n\t\tlandingGuideEnd.x = 130;\n\t\tlandingGuideAnimate.x = 30;\n\t\tnewRunwayContainer.addChild(landingGuide, landingGuideAnimate, landingGuideStart, landingGuideMiddle, landingGuideAlpha, landingGuideEnd);\n\t}else{\n\t\tvar landingGuide = itemHelipadGuide.clone();\n\t\tvar landingGuideStart = itemHelipadHit.clone();\n\t\tvar landingGuideAnimate = itemHelipadAnimate.clone();\n\t\tlandingGuideAnimate.x = 0;\n\t\tlandingGuideStart.x = 0;\n\t\tlandingGuide.x = 0;\n\t\tnewRunwayContainer.addChild(landingGuide, landingGuideAnimate, landingGuideStart);\t\t\n\t}\n\t\n\tif(!con){\n\t\tif(type == 0){\n\t\t\tlandingGuide.alpha = 0;\n\t\t\tlandingGuideStart.alpha = 0;\n\t\t\tlandingGuideMiddle.alpha = 0;\n\t\t\tlandingGuideAlpha.alpha = 0;\n\t\t\tlandingGuideEnd.alpha = 0;\n\t\t\tlandingGuideAnimate.alpha = 0;\n\t\t\tgameData.runway.push({container:newRunwayContainer, guideStart:landingGuideStart, guideMiddle:landingGuideMiddle, guideAlpha:landingGuideAlpha, guideEnd:landingGuideEnd, guideAnimate:landingGuideAnimate});\n\t\t}else{\n\t\t\tlandingGuide.alpha = 0;\n\t\t\tlandingGuideStart.alpha = 0;\n\t\t\tlandingGuideAnimate.alpha = 0;\n\t\t\tgameData.runway.push({container:newRunwayContainer, guideStart:landingGuideStart, guideMiddle:null, guideAlpha:null, guideEnd:null, guideAnimate:landingGuideAnimate});\t\n\t\t}\n\t\trunwayContainer.addChild(newRunwayContainer);\n\t}else{\n\t\t$.editObj[n] = newRunwayContainer;\n\t\teditRunwayContainer.addChild(newRunwayContainer);\n\t\tbuildDragAndDrop(newRunwayContainer);\t\n\t}\n}", "title": "" }, { "docid": "aba42c5bc1ce333c18a29685cf9b4169", "score": "0.5360742", "text": "function createCarSale(sale){\n \n //create car image data\n var imgUrl=\"assets/images/\"+sale.Image; \n var imgDiv=$(\"<img>\").attr(\"src\",imgUrl).addClass(\"img-fluid\");\n var carImg= $(\"<div>\").addClass(\".carImg col-lg-5 col-md-5 col-sm-10 col-10\");\n var carSale=$(\"<div>\").addClass(\".carSale col-lg-5 col-md-5 col-sm-10 col-10\");\n carImg.append(imgDiv); \n \n //create car sales data\n var priceConv=Number(parseFloat(sale.Price)).toLocaleString(\"en\");\n var title=$(\"<div>\").text(sale.Make+\" \"+sale.Year+\" \"+sale.Model);\n var price=$(\"<div>\").text(\"Price: $\"+priceConv).addClass(\"carPrice\");\n var extColor=$(\"<div>\").text(\"Ext. Color: \"+sale.Exterior);\n var intColor=$(\"<div>\").text(\"Int. Color: \"+sale.Interior);\n var drive=$(\"<div>\").text(\"Drive : \"+sale.Drive);\n var engine=$(\"<div>\").text(\"Engine : \"+sale.Engine);\n var trans=$(\"<div>\").text(\"Transmission : \"+sale.Transmission);\n var type=$(\"<div>\").text(\"Type : \"+sale.Type);\n \n //if gets favorite function, don't add favorate icon.\n if (favoriteFlg === false) {\n var favoriteDiv=$(\"<i>\").addClass(\"fa fa-heart addFavorite\");\n favoriteDiv.attr(\"fav-status\",\"no\"); \n carSale.append(title,favoriteDiv,price,extColor,intColor,drive,engine,trans,type);\n } else{\n carSale.append(title,price, extColor,intColor,drive,engine,trans,type);\n } \n \n $(\".searchResult\").append(carImg,carSale);\n\n}", "title": "" }, { "docid": "0f41a0303b9c95b7d414a0081c113857", "score": "0.5358456", "text": "function createForestRows(lanes) {\n // Variables that change for each forest lane\n let lane = 5; // Position in z\n let treeCount = 3 // Number of trees in the lane\n\n // Create tree object\n let geometry = new THREE.BoxGeometry(2, 4, 2);\n let material = new THREE.MeshBasicMaterial({color: 0x633e1d});\n \n for(let i=0; i<lanes; i++) {\n let treePositions = availablePositions.slice();\n for(let j=0; j<treeCount; j++) {\n // Create tree object\n let tree = new THREE.Mesh(geometry, material);\n tree.position.z = lane; \n tree.position.x = treePositions[Math.floor(Math.random()*(8-j))];\n tree.position.y = 0;\n tree.box = new THREE.Box3().setFromObject(tree);\n\n // Remove element from available positions for this lane\n treePositions.splice(treePositions.indexOf(tree.position.x), 1);\n\n scene.add(tree);\n trees.push(tree);\n }\n // Next lane position in z\n lane -= 15;\n\n // Increase difficulty as game advances\n if(i == 1) {\n treeCount = 4;\n }\n else if(i == 3) {\n treeCount = 5;\n }\n } \n}", "title": "" }, { "docid": "f51cb74126147ec8c5b513d1de30fade", "score": "0.53555095", "text": "function generatePipes(context) {\n while (activePipes.length < 10) {\n // bitwise 0 to get the actual integer not floating\n var height = context.canvas.height - floorHeight;\n var pipeOneHeight = Math.random() * (height - 250) + 100 | 0; // 350\n var pipeTwoHeight = height - HoleSize - pipeOneHeight;\n if (activePipes.length === 0) {\n pipeOne = new Pipes(new aabb(800, 0, PipeWidth, pipeOneHeight), PipeVelocity, true);\n pipeTwo = new Pipes(new aabb(800, pipeOneHeight + HoleSize, PipeWidth, pipeTwoHeight), PipeVelocity, false);\n }\n else {\n var index = activePipes.length - 1;\n var comparePipe = activePipes[index];\n if(deadPipes.length >= 2){\n var temp = deadPipes.splice(0,2);\n pipeOne = temp[0];\n pipeTwo = temp[1];\n pipeOne.scored = false;\n pipeTwo.scored = false;\n pipeOne.aabb.x = comparePipe.aabb.x + Distance;\n pipeTwo.aabb.x = comparePipe.aabb.x + Distance;\n pipeTwo.aabb.y = pipeOneHeight + HoleSize;\n pipeOne.aabb.h = pipeOneHeight;\n pipeTwo.aabb.h = pipeTwoHeight;\n pipeOne.hVelocity = comparePipe.hVelocity;\n pipeTwo.hVelocity = comparePipe.hVelocity;\n }\n else{\n pipeOne = new Pipes(new aabb(comparePipe.aabb.x + Distance, 0, PipeWidth, pipeOneHeight), comparePipe.hVelocity, true)\n pipeTwo = new Pipes(new aabb(comparePipe.aabb.x + Distance, pipeOneHeight + HoleSize, PipeWidth, pipeTwoHeight), comparePipe.hVelocity, false)\n }\n }\n activePipes.push(pipeOne);\n activePipes.push(pipeTwo);\n\n }\n }", "title": "" }, { "docid": "65182104b44b2292a91f00010683dd19", "score": "0.53516626", "text": "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 }", "title": "" }, { "docid": "a195adb3d62fa10c7d9a93f18c05f2ed", "score": "0.53504676", "text": "function generatePipes () {\n pipeY = game.rnd.integerInRange(-100, 100);\n pipeGroup = pipes.getFirstExists(false);\n if (!pipeGroup) {\n pipeGroup = game.add.group(pipes);\n\n topPipe = pipeGroup.create(0, 0, 'pipe');\n topPipe.frame = 0;\n\n topPipe.anchor.setTo(0.5, 0.5);\n game.physics.arcade.enableBody(topPipe);\n\n topPipe.body.allowGravity = false;\n topPipe.body.immovable = true;\n\n bottomPipe = pipeGroup.create(0, 0, 'pipe');\n bottomPipe.frame = 1;\n\n bottomPipe.anchor.setTo(0.5, 0.5);\n game.physics.arcade.enableBody(bottomPipe);\n\n bottomPipe.body.allowGravity = false;\n bottomPipe.body.immovable = true;\n\n pipeGroup.setAll('body.velocity.x', -200);\n }\n resetPipeGroup(game.width, pipeY);\n}", "title": "" }, { "docid": "8a2244a5b89457ef040211e47ebf4f02", "score": "0.5349073", "text": "function draw() {\n background(0);\n\n// POLYMORPHISM ////////////////////////////////////////////////////////////////\n for (let i = 0; i < vehicles.length; i++) {\n let vehicle = vehicles[i];\n vehicle.move();\n vehicle.wrap();\n vehicle.display();\n }\n\n// INHERITANCE ////////////////////////////////////////////////////////////////\n // for (let i = 0; i < cars.length; i++) {\n // let car = cars[i];\n // car.move();\n // car.wrap();\n // car.display();\n // }\n //\n // for (let i = 0; i < motorcycles.length; i++) {\n // let motorcycle = motorcycles[i];\n // motorcycle.move();\n // motorcycle.wrap();\n // motorcycle.display();\n // }\n}", "title": "" }, { "docid": "c892f1d577dad59afca621513c6b22a3", "score": "0.5348738", "text": "function Car(nr, c, ms) {\n this.numberOfDoors = nr; //this kadangi construktor viduje, tai jis neislipa uz funkcijos\n this.color = c;\n this.maxSpeed = ms;\n}", "title": "" }, { "docid": "fb6cee8cd6e4f8f8d4bcfe972fa71b33", "score": "0.5341711", "text": "function createMeteors(){\n for (var i = 0; i < numberOfMeteors; i++) {\n ArrayOfMeteors[i] = new Meteor();\n newX = Math.floor(Math.random()* c.width);\n if (newX < 30){\n ArrayOfMeteors[i].updateX(30);\n }\n else if (newX > c.width) {\n ArrayOfMeteors[i].updateX(c.width - 30);\n }\n else{\n ArrayOfMeteors[i].updateX(newX);\n }\n }\n}", "title": "" }, { "docid": "224ca7c908d4544f21943f8d0acbbac4", "score": "0.5341697", "text": "function populatePage (inventory) {\t\t\n\t\t// create cardBuilder\n\t\tvar cardBuilder = \"\";\n\t\tcardBuilder += `<div class=\"row\">`\n\t// Loop over the inventory and populate the page\t\n\tfor (var i = 0; i < inventory.length; i++) {\n\t\tcardBuilder += `<div class=\"col-md-4\">`\n\t\tcardBuilder += `<div class=\"car-card\" id=${i}>`\n\t\tcardBuilder += `<div class=\"table-responsive\">`\n\t\tcardBuilder += `<table class=\"table\">`\n\t\tcardBuilder += `<tr>`\n\t\tcardBuilder += `<th colspan=\"2\"><h1>${inventory[i].year} ${inventory[i].make}<br>${inventory[i].model}`\n\t\tcardBuilder += `</th></tr>`\n\t\tcardBuilder += `<tr>`\n\t\tcardBuilder += `<td><h3>Price: $<span class=\"price\">${inventory[i].price}</h3></td>`\n\t\tcardBuilder += `</tr>`\n\t\tcardBuilder += `<tr>`\n\t\tcardBuilder += `<td><img src =\"${inventory[i].photo}\" class=\"img-responsive\"></td>`\n\t\tcardBuilder += `</tr>`\n\t\tcardBuilder += `<tr>`\n\t\tcardBuilder += `<td><h3>${inventory[i].description}</h3></td>`\n\t\tcardBuilder += `</tr>`\n\t\tcardBuilder += `</table>`\n\t\tcardBuilder += `</div></div></div>`\n\t\t//execute this code after every third loop of the inventory array to make 3 cards per row\n\t\tif (((i + 1) % 3) === 0) {\n\t\t\tcardBuilder += `</div>`\n\t\t\t//write cards to DOM\n\t\t\tcardContainer.innerHTML += cardBuilder;\n\t\t\t//clear cardBuilder and get ready to make next row of cards\n\t\t\tcardBuilder = \"\";\n\t\t\tcardBuilder += `<div class=\"row\">`\t\t\t\n\t\t}\n\t}\n \n // Now that the DOM is loaded, establish all the event listeners needed\n CarLot.activateEvents();\n}", "title": "" }, { "docid": "ab4583688f2c784d8bc1b46809d8d767", "score": "0.5341594", "text": "function createCar(sprite) { \r\n //set the body to a slightly smaller rectangle, so there is no padding around the outside of the sprite that cause you to hit walls even when visually the car sprite isn't touching the wall\r\n sprite.body.setRectangle(18, 28, 0, 0, 0);\r\n \r\n //movement variables. power for speed/acceleration, turnspeed for handling, and damping to decrease sliding/driftyness\r\n sprite.body.linearDamping = 1.6;\r\n sprite.power = 450;\r\n sprite.turnSpeed = 140;\r\n \r\n \r\n //accelerate function\r\n sprite.accelerate = function() {\r\n sprite.body.thrust(sprite.power);\r\n }\r\n \r\n \r\n //left and right turning functions\r\n sprite.turnLeft = function() {\r\n sprite.body.rotateLeft(sprite.turnSpeed);\r\n }\r\n \r\n sprite.turnRight = function() {\r\n sprite.body.rotateRight(sprite.turnSpeed);\r\n }\r\n \r\n}", "title": "" }, { "docid": "83b39dd19dcb0a1624004f2745c05748", "score": "0.5339763", "text": "function startCar1() {\n\t// carRunning();\n\tintervalId = setInterval(moveCar1East, roadSpeed);\n}", "title": "" } ]
18cc11ced2d3f1bf0e5abf27db57ba74
Gets if the provided structure is a BindingNamedNodeStructure.
[ { "docid": "4ea35153be2b7f60318f5ad58855fabb", "score": "0.79787093", "text": "static isBindingNamedNode(structure) {\n switch (structure.kind) {\n case StructureKind_1.StructureKind.Parameter:\n case StructureKind_1.StructureKind.VariableDeclaration:\n return true;\n default:\n return false;\n }\n }", "title": "" } ]
[ { "docid": "5257ce6c679b0978d647adfc4d51c14b", "score": "0.67218256", "text": "static isNamedNode(structure) {\n switch (structure.kind) {\n case StructureKind_1.StructureKind.Enum:\n case StructureKind_1.StructureKind.Interface:\n case StructureKind_1.StructureKind.JsxAttribute:\n case StructureKind_1.StructureKind.Namespace:\n case StructureKind_1.StructureKind.TypeAlias:\n case StructureKind_1.StructureKind.TypeParameter:\n case StructureKind_1.StructureKind.ShorthandPropertyAssignment:\n return true;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "4674f812d8a313988ee80170780d14bb", "score": "0.632762", "text": "static isNameableNode(structure) {\n switch (structure.kind) {\n case StructureKind_1.StructureKind.Class:\n case StructureKind_1.StructureKind.Function:\n return true;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "6ddf919a97b4853f9b0fb3d96b08730f", "score": "0.6296209", "text": "static hasName(structure) {\n return typeof structure.name === \"string\";\n }", "title": "" }, { "docid": "bebdd1a0aec57cec40e6e302f063e899", "score": "0.6102647", "text": "static isPropertyNamedNode(structure) {\n switch (structure.kind) {\n case StructureKind_1.StructureKind.GetAccessor:\n case StructureKind_1.StructureKind.Method:\n case StructureKind_1.StructureKind.Property:\n case StructureKind_1.StructureKind.SetAccessor:\n case StructureKind_1.StructureKind.EnumMember:\n case StructureKind_1.StructureKind.MethodSignature:\n case StructureKind_1.StructureKind.PropertySignature:\n case StructureKind_1.StructureKind.PropertyAssignment:\n return true;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "f8c83b611049c6ad5cea363a660b55f4", "score": "0.60213745", "text": "static isJsxTagNamedNode(structure) {\n return structure.kind === StructureKind_1.StructureKind.JsxSelfClosingElement;\n }", "title": "" }, { "docid": "da38edb3de1656d113c41e3e95b2f4c2", "score": "0.57946366", "text": "function isNamedNode(obj) {\n return isTerm(obj) && obj.termType === 'NamedNode';\n}", "title": "" }, { "docid": "afdb914944ea8902367843fa32e9b32d", "score": "0.57580394", "text": "static isScopedNode(structure) {\n switch (structure.kind) {\n case StructureKind_1.StructureKind.Constructor:\n case StructureKind_1.StructureKind.ConstructorOverload:\n case StructureKind_1.StructureKind.GetAccessor:\n case StructureKind_1.StructureKind.Method:\n case StructureKind_1.StructureKind.MethodOverload:\n case StructureKind_1.StructureKind.Property:\n case StructureKind_1.StructureKind.SetAccessor:\n return true;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "ca94f873f83aa2ce7de0f038c2a4ba38", "score": "0.5738987", "text": "static isTypedNode(structure) {\n switch (structure.kind) {\n case StructureKind_1.StructureKind.Property:\n case StructureKind_1.StructureKind.Parameter:\n case StructureKind_1.StructureKind.PropertySignature:\n case StructureKind_1.StructureKind.VariableDeclaration:\n case StructureKind_1.StructureKind.TypeAlias:\n return true;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "626c6faa3ea70f5ff238c2a91e59a37f", "score": "0.5662203", "text": "function checkBindingCompatibility(binding, exportedBinding) {\n if ((binding instanceof plt.compiler.provideBindingStructId) && (!(exportedBinding instanceof structBinding))) {\n throwError({\n errMsg: \"provide structure \" + exportedBinding.symbl + \" is not a structure\"\n });\n } else {\n return exportedBinding;\n }\n }", "title": "" }, { "docid": "ceaa32e838b150bef937fb205ce2e72c", "score": "0.56237185", "text": "static isExportableNode(structure) {\n switch (structure.kind) {\n case StructureKind_1.StructureKind.Class:\n case StructureKind_1.StructureKind.Enum:\n case StructureKind_1.StructureKind.Function:\n case StructureKind_1.StructureKind.FunctionOverload:\n case StructureKind_1.StructureKind.Interface:\n case StructureKind_1.StructureKind.Namespace:\n case StructureKind_1.StructureKind.VariableStatement:\n case StructureKind_1.StructureKind.TypeAlias:\n return true;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "e0b800bb76e587e731101b4cd20da30c", "score": "0.5526678", "text": "function isDeclarationBindingElement(bindingElement){switch(bindingElement.kind){case 242/* VariableDeclaration */:case 156/* Parameter */:case 191/* BindingElement */:return true;}return false;}", "title": "" }, { "docid": "9e7a8dab5a42cac24601227d1faecfa6", "score": "0.5483717", "text": "function isBinding(node, parent) {\n\t\t var keys = _retrievers.getBindingIdentifiers.keys[parent.type];\n\t\t if (keys) {\n\t\t for (var i = 0; i < keys.length; i++) {\n\t\t var key = keys[i];\n\t\t var val = parent[key];\n\t\t if (Array.isArray(val)) {\n\t\t if (val.indexOf(node) >= 0) return true;\n\t\t } else {\n\t\t if (val === node) return true;\n\t\t }\n\t\t }\n\t\t }\n\n\t\t return false;\n\t\t}", "title": "" }, { "docid": "b8e9cf6b549a6ed1eeb99293f9f0a681", "score": "0.5425934", "text": "static isScopeableNode(structure) {\n return structure.kind === StructureKind_1.StructureKind.Parameter;\n }", "title": "" }, { "docid": "b39419a5ae79ff44c367b958f80cde6a", "score": "0.53680956", "text": "function isBinding(node, parent) {\n\t\t var keys = /*istanbul ignore next*/_retrievers.getBindingIdentifiers.keys[parent.type];\n\t\t if (keys) {\n\t\t for (var i = 0; i < keys.length; i++) {\n\t\t var key = keys[i];\n\t\t var val = parent[key];\n\t\t if (Array.isArray(val)) {\n\t\t if (val.indexOf(node) >= 0) return true;\n\t\t } else {\n\t\t if (val === node) return true;\n\t\t }\n\t\t }\n\t\t }\n\n\t\t return false;\n\t\t}", "title": "" }, { "docid": "782d2364ea78a6707c901bd694f2c6e0", "score": "0.5363123", "text": "function isBinding(node, parent) {\n\t var keys = /*istanbul ignore next*/_retrievers.getBindingIdentifiers.keys[parent.type];\n\t if (keys) {\n\t for (var i = 0; i < keys.length; i++) {\n\t var key = keys[i];\n\t var val = parent[key];\n\t if (Array.isArray(val)) {\n\t if (val.indexOf(node) >= 0) return true;\n\t } else {\n\t if (val === node) return true;\n\t }\n\t }\n\t }\n\n\t return false;\n\t}", "title": "" }, { "docid": "234a836a26cb562bc4fe580dcea86d23", "score": "0.5267656", "text": "static isTypeElementMemberedNode(structure) {\n return structure.kind === StructureKind_1.StructureKind.Interface;\n }", "title": "" }, { "docid": "fab77265c098a7113488e37340997f64", "score": "0.5199239", "text": "function isNamedNode(term) {\n return !!term && term.termType === 'NamedNode';\n}", "title": "" }, { "docid": "fab77265c098a7113488e37340997f64", "score": "0.5199239", "text": "function isNamedNode(term) {\n return !!term && term.termType === 'NamedNode';\n}", "title": "" }, { "docid": "b62ab54592ffd6cdaa14d06e90543768", "score": "0.51899064", "text": "function isBound () {\n\t\tvar ref = getBindingModel( this ), model = ref.model;\n\t\treturn !!model;\n\t}", "title": "" }, { "docid": "6c52d77822be811a01769026025c0503", "score": "0.51469743", "text": "static isJsxElement(structure) {\n return structure.kind === StructureKind_1.StructureKind.JsxElement;\n }", "title": "" }, { "docid": "34470b0e4ae13aebb66e5ea1711e7fd9", "score": "0.51368827", "text": "static isParameteredNode(structure) {\n switch (structure.kind) {\n case StructureKind_1.StructureKind.Constructor:\n case StructureKind_1.StructureKind.ConstructorOverload:\n case StructureKind_1.StructureKind.GetAccessor:\n case StructureKind_1.StructureKind.Method:\n case StructureKind_1.StructureKind.MethodOverload:\n case StructureKind_1.StructureKind.SetAccessor:\n case StructureKind_1.StructureKind.Function:\n case StructureKind_1.StructureKind.FunctionOverload:\n case StructureKind_1.StructureKind.CallSignature:\n case StructureKind_1.StructureKind.ConstructSignature:\n case StructureKind_1.StructureKind.MethodSignature:\n return true;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "ded1064d616e28687760c98beab85459", "score": "0.5126636", "text": "static isSuperBindingNode(d) {\n\t\treturn d.isSupernodeInputBinding || d.isSupernodeOutputBinding;\n\t}", "title": "" }, { "docid": "387717bd047b61c3ed11f88dae34b157", "score": "0.5100127", "text": "static isStaticableNode(structure) {\n switch (structure.kind) {\n case StructureKind_1.StructureKind.GetAccessor:\n case StructureKind_1.StructureKind.Method:\n case StructureKind_1.StructureKind.MethodOverload:\n case StructureKind_1.StructureKind.Property:\n case StructureKind_1.StructureKind.SetAccessor:\n return true;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "798ff1905a2aa4fb0389ccbc0dbad62d", "score": "0.49763662", "text": "static isNamespaceDeclaration(structure) {\n return structure.kind === StructureKind_1.StructureKind.Namespace;\n }", "title": "" }, { "docid": "49070290a55f049fba18cfc2875d4990", "score": "0.4972657", "text": "static isExportSpecifier(structure) {\n return structure.kind === StructureKind_1.StructureKind.ExportSpecifier;\n }", "title": "" }, { "docid": "b649b943708f93163055f8dbbb5dfeb8", "score": "0.49671268", "text": "function isContainerBinding(moduleIdentifier) {\n return !!moduleIdentifier && moduleIdentifier.startsWith('@ioc:');\n}", "title": "" }, { "docid": "4746afc9f85f035040dea55725740065", "score": "0.49568444", "text": "static isTypeParameteredNode(structure) {\n switch (structure.kind) {\n case StructureKind_1.StructureKind.Class:\n case StructureKind_1.StructureKind.Constructor:\n case StructureKind_1.StructureKind.ConstructorOverload:\n case StructureKind_1.StructureKind.GetAccessor:\n case StructureKind_1.StructureKind.Method:\n case StructureKind_1.StructureKind.MethodOverload:\n case StructureKind_1.StructureKind.SetAccessor:\n case StructureKind_1.StructureKind.Function:\n case StructureKind_1.StructureKind.FunctionOverload:\n case StructureKind_1.StructureKind.CallSignature:\n case StructureKind_1.StructureKind.ConstructSignature:\n case StructureKind_1.StructureKind.Interface:\n case StructureKind_1.StructureKind.MethodSignature:\n case StructureKind_1.StructureKind.TypeAlias:\n return true;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "d731d5af2a6618796a12f3514e459788", "score": "0.49465224", "text": "static isDecoratableNode(structure) {\n switch (structure.kind) {\n case StructureKind_1.StructureKind.Class:\n case StructureKind_1.StructureKind.GetAccessor:\n case StructureKind_1.StructureKind.Method:\n case StructureKind_1.StructureKind.Property:\n case StructureKind_1.StructureKind.SetAccessor:\n case StructureKind_1.StructureKind.Parameter:\n return true;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "5f5c7887d341a9bf663c44f44ee50fdf", "score": "0.49460062", "text": "static isExportDeclaration(structure) {\n return structure.kind === StructureKind_1.StructureKind.ExportDeclaration;\n }", "title": "" }, { "docid": "2549f7b3be6488f790fc0b709357afdd", "score": "0.4922118", "text": "function hasName(obj) {\n return !!obj &&\n typeof obj == 'object' &&\n 'name' in obj;\n}", "title": "" }, { "docid": "32ba8230fe44c663cd2e2ccf033941c3", "score": "0.48980615", "text": "static isJSDocableNode(structure) {\n switch (structure.kind) {\n case StructureKind_1.StructureKind.Class:\n case StructureKind_1.StructureKind.Constructor:\n case StructureKind_1.StructureKind.ConstructorOverload:\n case StructureKind_1.StructureKind.GetAccessor:\n case StructureKind_1.StructureKind.Method:\n case StructureKind_1.StructureKind.MethodOverload:\n case StructureKind_1.StructureKind.Property:\n case StructureKind_1.StructureKind.SetAccessor:\n case StructureKind_1.StructureKind.Enum:\n case StructureKind_1.StructureKind.EnumMember:\n case StructureKind_1.StructureKind.Function:\n case StructureKind_1.StructureKind.FunctionOverload:\n case StructureKind_1.StructureKind.CallSignature:\n case StructureKind_1.StructureKind.ConstructSignature:\n case StructureKind_1.StructureKind.IndexSignature:\n case StructureKind_1.StructureKind.Interface:\n case StructureKind_1.StructureKind.MethodSignature:\n case StructureKind_1.StructureKind.PropertySignature:\n case StructureKind_1.StructureKind.Namespace:\n case StructureKind_1.StructureKind.VariableStatement:\n case StructureKind_1.StructureKind.TypeAlias:\n return true;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "209628cd7544b26da5062885aef34479", "score": "0.48951918", "text": "function isType(structure) {\n return [\n undefined,\n \"class\",\n \"enum\",\n \"protocol\",\n \"struct\",\n \"typealias\",\n \"extension\"\n ].includes(structure.kind);\n}", "title": "" }, { "docid": "143e7bebcb1a0ec6f90a6929938fd6ce", "score": "0.48727205", "text": "static isVariableDeclaration(structure) {\n return structure.kind === StructureKind_1.StructureKind.VariableDeclaration;\n }", "title": "" }, { "docid": "704384bb7fc159a7faa2619337068072", "score": "0.48675767", "text": "static isParameterDeclaration(structure) {\n return structure.kind === StructureKind_1.StructureKind.Parameter;\n }", "title": "" }, { "docid": "d6fd7cf857a60bd0e69f680c14c86d91", "score": "0.48565233", "text": "static isStatementedNode(structure) {\n switch (structure.kind) {\n case StructureKind_1.StructureKind.Constructor:\n case StructureKind_1.StructureKind.GetAccessor:\n case StructureKind_1.StructureKind.Method:\n case StructureKind_1.StructureKind.SetAccessor:\n case StructureKind_1.StructureKind.Function:\n case StructureKind_1.StructureKind.Namespace:\n case StructureKind_1.StructureKind.SourceFile:\n return true;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "878e8639bd6c3a17b90f17f28552102a", "score": "0.4855831", "text": "function lookupProvideBindingInDefinitionBindings(provideBinding) {\n // if it's not defined, throw an error\n if (!that.definedNames.containsKey(provideBinding.symbl)) {\n throwError({\n errMsg: \"provided name \" + provideBinding.symbl + \" not defined\"\n });\n }\n // if it IS defined, let's examine it and make sure it is what it claims to be\n var binding = checkBindingCompatibility(binding, that.definedNames.get(provideBinding.symbl));\n\n // ref: symbol -> binding\n // Lookup the binding, given the symbolic identifier.\n function ref(id) {\n return that.definedNames.get(id);\n }\n\n // if it's a struct provide, return a list containing the constructor and predicate,\n // along with all the accessor and mutator functions\n if (provideBinding instanceof plt.compiler.provideBindingStructId) {\n return [ref(binding.constructor), ref(binding.predicate)].concat(\n binding.accessors.map(ref), binding.mutators.map(ref));\n } else {\n return [binding];\n }\n }", "title": "" }, { "docid": "a01e237d59d177c3fd4fe78409af544a", "score": "0.484479", "text": "function getTypeForBindingElement(declaration){var pattern=declaration.parent;var parentType=getTypeForBindingElementParent(pattern.parent);// If no type or an any type was inferred for parent, infer that for the binding element\nif(!parentType||isTypeAny(parentType)){return parentType;}// Relax null check on ambient destructuring parameters, since the parameters have no implementation and are just documentation\nif(strictNullChecks&&declaration.flags&8388608/* Ambient */&&ts.isParameterDeclaration(declaration)){parentType=getNonNullableType(parentType);}// Filter `undefined` from the type we check against if the parent has an initializer and that initializer is not possibly `undefined`\nelse if(strictNullChecks&&pattern.parent.initializer&&!(getTypeFacts(getTypeOfInitializer(pattern.parent.initializer))&65536/* EQUndefined */)){parentType=getTypeWithFacts(parentType,524288/* NEUndefined */);}var type;if(pattern.kind===189/* ObjectBindingPattern */){if(declaration.dotDotDotToken){parentType=getReducedType(parentType);if(parentType.flags&2/* Unknown */||!isValidSpreadType(parentType)){error(declaration,ts.Diagnostics.Rest_types_may_only_be_created_from_object_types);return errorType;}var literalMembers=[];for(var _i=0,_a=pattern.elements;_i<_a.length;_i++){var element=_a[_i];if(!element.dotDotDotToken){literalMembers.push(element.propertyName||element.name);}}type=getRestType(parentType,literalMembers,declaration.symbol);}else{// Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form)\nvar name=declaration.propertyName||declaration.name;var indexType=getLiteralTypeFromPropertyName(name);var declaredType=getConstraintForLocation(getIndexedAccessType(parentType,indexType,name),declaration.name);type=getFlowTypeOfDestructuring(declaration,declaredType);}}else{// This elementType will be used if the specific property corresponding to this index is not\n// present (aka the tuple element property). This call also checks that the parentType is in\n// fact an iterable or array (depending on target language).\nvar elementType=checkIteratedTypeOrElementType(65/* Destructuring */,parentType,undefinedType,pattern);var index_1=pattern.elements.indexOf(declaration);if(declaration.dotDotDotToken){// If the parent is a tuple type, the rest element has a tuple type of the\n// remaining tuple element types. Otherwise, the rest element has an array type with same\n// element type as the parent type.\ntype=everyType(parentType,isTupleType)?mapType(parentType,function(t){return sliceTupleType(t,index_1);}):createArrayType(elementType);}else if(isArrayLikeType(parentType)){var indexType=getLiteralType(index_1);var accessFlags=hasDefaultValue(declaration)?8/* NoTupleBoundsCheck */:0;var declaredType=getConstraintForLocation(getIndexedAccessTypeOrUndefined(parentType,indexType,declaration.name,accessFlags)||errorType,declaration.name);type=getFlowTypeOfDestructuring(declaration,declaredType);}else{type=elementType;}}if(!declaration.initializer){return type;}if(ts.getEffectiveTypeAnnotationNode(ts.walkUpBindingElementsAndPatterns(declaration))){// In strict null checking mode, if a default value of a non-undefined type is specified, remove\n// undefined from the final type.\nreturn strictNullChecks&&!(getFalsyFlags(checkDeclarationInitializer(declaration))&32768/* Undefined */)?getTypeWithFacts(type,524288/* NEUndefined */):type;}return widenTypeInferredFromInitializer(declaration,getUnionType([getTypeWithFacts(type,524288/* NEUndefined */),checkDeclarationInitializer(declaration)],2/* Subtype */));}", "title": "" }, { "docid": "76f4336e23b53d243a3c4187df485720", "score": "0.4830401", "text": "is(name) {\n if (typeof name == 'string') {\n if (this.name == name)\n return true;\n let group = this.prop(NodeProp.group);\n return group ? group.indexOf(name) > -1 : false;\n }\n return this.id == name;\n }", "title": "" }, { "docid": "c9abd91bbf0f752d787aed42e949af0f", "score": "0.48187107", "text": "is(name) {\n if (typeof name == 'string') {\n if (this.name == name)\n return true;\n let group = this.prop(NodeProp.group);\n return group ? group.indexOf(name) > -1 : false;\n }\n return this.id == name;\n }", "title": "" }, { "docid": "c9abd91bbf0f752d787aed42e949af0f", "score": "0.48187107", "text": "is(name) {\n if (typeof name == 'string') {\n if (this.name == name)\n return true;\n let group = this.prop(NodeProp.group);\n return group ? group.indexOf(name) > -1 : false;\n }\n return this.id == name;\n }", "title": "" }, { "docid": "5f571ceb0d25fce01024d134fb162c1e", "score": "0.47995633", "text": "function getTypeFromBindingElement(element,includePatternInType,reportErrors){if(element.initializer){// The type implied by a binding pattern is independent of context, so we check the initializer with no\n// contextual type or, if the element itself is a binding pattern, with the type implied by that binding\n// pattern.\nvar contextualType=ts.isBindingPattern(element.name)?getTypeFromBindingPattern(element.name,/*includePatternInType*/true,/*reportErrors*/false):unknownType;return addOptionality(widenTypeInferredFromInitializer(element,checkDeclarationInitializer(element,contextualType)));}if(ts.isBindingPattern(element.name)){return getTypeFromBindingPattern(element.name,includePatternInType,reportErrors);}if(reportErrors&&!declarationBelongsToPrivateAmbientMember(element)){reportImplicitAny(element,anyType);}// When we're including the pattern in the type (an indication we're obtaining a contextual type), we\n// use the non-inferrable any type. Inference will never directly infer this type, but it is possible\n// to infer a type that contains it, e.g. for a binding pattern like [foo] or { foo }. In such cases,\n// widening of the binding pattern type substitutes a regular any for the non-inferrable any.\nreturn includePatternInType?nonInferrableAnyType:anyType;}// Return the type implied by an object binding pattern", "title": "" }, { "docid": "1c2bc5e83bd42220690a8562e86ca714", "score": "0.4779566", "text": "function hasDynamicName(declaration){var name=ts.getNameOfDeclaration(declaration);return!!name&&isDynamicName(name);}", "title": "" }, { "docid": "0f7117a03da981de33d887f46e7b291a", "score": "0.47734618", "text": "function isBindingOrAssignmentPattern(node){return isObjectBindingOrAssignmentPattern(node)||isArrayBindingOrAssignmentPattern(node);}", "title": "" }, { "docid": "99ee11fc98e86a156e9e4e2f8a1e03b8", "score": "0.47615162", "text": "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "title": "" }, { "docid": "99ee11fc98e86a156e9e4e2f8a1e03b8", "score": "0.47615162", "text": "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "title": "" }, { "docid": "99ee11fc98e86a156e9e4e2f8a1e03b8", "score": "0.47615162", "text": "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "title": "" }, { "docid": "99ee11fc98e86a156e9e4e2f8a1e03b8", "score": "0.47615162", "text": "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "title": "" }, { "docid": "99ee11fc98e86a156e9e4e2f8a1e03b8", "score": "0.47615162", "text": "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "title": "" }, { "docid": "99ee11fc98e86a156e9e4e2f8a1e03b8", "score": "0.47615162", "text": "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "title": "" }, { "docid": "99ee11fc98e86a156e9e4e2f8a1e03b8", "score": "0.47615162", "text": "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "title": "" }, { "docid": "99ee11fc98e86a156e9e4e2f8a1e03b8", "score": "0.47615162", "text": "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "title": "" }, { "docid": "99ee11fc98e86a156e9e4e2f8a1e03b8", "score": "0.47615162", "text": "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "title": "" }, { "docid": "99ee11fc98e86a156e9e4e2f8a1e03b8", "score": "0.47615162", "text": "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "title": "" }, { "docid": "99ee11fc98e86a156e9e4e2f8a1e03b8", "score": "0.47615162", "text": "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "title": "" }, { "docid": "99ee11fc98e86a156e9e4e2f8a1e03b8", "score": "0.47615162", "text": "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "title": "" }, { "docid": "99ee11fc98e86a156e9e4e2f8a1e03b8", "score": "0.47615162", "text": "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "title": "" }, { "docid": "99ee11fc98e86a156e9e4e2f8a1e03b8", "score": "0.47615162", "text": "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "title": "" }, { "docid": "7095400c6d8e58eada0a61ec7258cb8c", "score": "0.4759923", "text": "function isNamedType(type) {\n return (\n isScalarType(type) ||\n isObjectType(type) ||\n isInterfaceType(type) ||\n isUnionType(type) ||\n isEnumType(type) ||\n isInputObjectType(type)\n );\n}", "title": "" }, { "docid": "b863df9576bbea3d501490f4d1f29d73", "score": "0.47412097", "text": "static isReturnTypedNode(structure) {\n switch (structure.kind) {\n case StructureKind_1.StructureKind.Constructor:\n case StructureKind_1.StructureKind.ConstructorOverload:\n case StructureKind_1.StructureKind.GetAccessor:\n case StructureKind_1.StructureKind.Method:\n case StructureKind_1.StructureKind.MethodOverload:\n case StructureKind_1.StructureKind.SetAccessor:\n case StructureKind_1.StructureKind.Function:\n case StructureKind_1.StructureKind.FunctionOverload:\n case StructureKind_1.StructureKind.CallSignature:\n case StructureKind_1.StructureKind.ConstructSignature:\n case StructureKind_1.StructureKind.IndexSignature:\n case StructureKind_1.StructureKind.MethodSignature:\n return true;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "5a40cccb448eb7ede73d674587a675a9", "score": "0.47104207", "text": "static isName(addr) {\n if (!Multiaddr.isMultiaddr(addr)) {\n return false;\n }\n // if a part of the multiaddr is resolvable, then return true\n return addr.protos().some((proto) => proto.resolvable);\n }", "title": "" }, { "docid": "9afad7b06cee3bfbe0068074ef917dbb", "score": "0.46905646", "text": "static isTypeAliasDeclaration(structure) {\n return structure.kind === StructureKind_1.StructureKind.TypeAlias;\n }", "title": "" }, { "docid": "c7faf4ece330a6455168af9e9e1e3a39", "score": "0.46847278", "text": "function matchesBinding$static(keyDescriptor/*:String*/, binding/*:Object*/)/*:Boolean*/ {\n var items/*:Array*/ = keyDescriptor.split(\"+\");\n var key/*:String*/ = getKey$static(keyDescriptor);\n if(binding['name'] !== key) {\n return false;\n }\n\n if(binding['altKey'] && items.indexOf('alt') === -1) {\n return false;\n }\n if(binding['ctrlKey'] && items.indexOf('ctrl') === -1) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "8a4f66f08e533aa3ef7277b2c8a16805", "score": "0.46819568", "text": "function hasNamedImport(declaration, symbolName) {\n const namedImports = getNamedImports(declaration);\n if (namedImports) {\n return namedImports.elements.some(element => {\n const { name, propertyName } = element;\n return propertyName ? propertyName.text === symbolName : name.text === symbolName;\n });\n }\n return false;\n }", "title": "" }, { "docid": "5c90758af47bf4034c6a2d68f80400ac", "score": "0.46483275", "text": "static isSignaturedDeclaration(structure) {\n switch (structure.kind) {\n case StructureKind_1.StructureKind.Constructor:\n case StructureKind_1.StructureKind.ConstructorOverload:\n case StructureKind_1.StructureKind.GetAccessor:\n case StructureKind_1.StructureKind.Method:\n case StructureKind_1.StructureKind.MethodOverload:\n case StructureKind_1.StructureKind.SetAccessor:\n case StructureKind_1.StructureKind.Function:\n case StructureKind_1.StructureKind.FunctionOverload:\n case StructureKind_1.StructureKind.CallSignature:\n case StructureKind_1.StructureKind.ConstructSignature:\n case StructureKind_1.StructureKind.MethodSignature:\n return true;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "f5fa3b90ee584bfa524a60f123bcbafc", "score": "0.46429962", "text": "function hasNonBindableDynamicName(node){return ts.hasDynamicName(node)&&!hasLateBindableName(node);}", "title": "" }, { "docid": "98e9df15dfdf8c00b725bea74d9fc359", "score": "0.46359596", "text": "function hasName(obj) {\n // making a check to see if name property exists in object or not\n return !!obj &&\n typeof obj === \"object\" &&\n \"name\" in obj;\n}", "title": "" }, { "docid": "16cc1c02debb77ac04583c9ba4b4039c", "score": "0.46336886", "text": "function binding(name) {\n if (arguments.length > 0)\n bindingName = name;\n\n return bindingName;\n }", "title": "" }, { "docid": "3ff91401774d80c30ab4848d397b59b0", "score": "0.46071836", "text": "function customElement_isValidShadowHostName(name) {\n return (ShadowHostNames.has(name));\n}", "title": "" }, { "docid": "3ff91401774d80c30ab4848d397b59b0", "score": "0.46071836", "text": "function customElement_isValidShadowHostName(name) {\n return (ShadowHostNames.has(name));\n}", "title": "" }, { "docid": "8377aa482a4b25b8c15d21ba51b25d36", "score": "0.45966896", "text": "function hasLateBindableName(node){var name=ts.getNameOfDeclaration(node);return!!name&&isLateBindableName(name);}", "title": "" }, { "docid": "c29e3871615e859f945495929f9b26b6", "score": "0.45858693", "text": "static isAsyncableNode(structure) {\n switch (structure.kind) {\n case StructureKind_1.StructureKind.Method:\n case StructureKind_1.StructureKind.MethodOverload:\n case StructureKind_1.StructureKind.Function:\n case StructureKind_1.StructureKind.FunctionOverload:\n return true;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "ac2f4978cb46f22c1c8f21cf9078a34f", "score": "0.45683685", "text": "function isSVGComponent(Component) {\n return typeof Component === \"string\" && svgTagNames.has(Component);\n}", "title": "" }, { "docid": "682079c73af594159dd3707d0c2c564a", "score": "0.4566615", "text": "_isAttachedToDOM() {\n const element = this._elementRef.nativeElement;\n if (element.getRootNode) {\n const rootNode = element.getRootNode();\n // If the element is inside the DOM the root node will be either the document\n // or the closest shadow root, otherwise it'll be the element itself.\n return rootNode && rootNode !== element;\n }\n // Otherwise fall back to checking if it's in the document. This doesn't account for\n // shadow DOM, however browser that support shadow DOM should support `getRootNode` as well.\n return document.documentElement.contains(element);\n }", "title": "" }, { "docid": "682079c73af594159dd3707d0c2c564a", "score": "0.4566615", "text": "_isAttachedToDOM() {\n const element = this._elementRef.nativeElement;\n if (element.getRootNode) {\n const rootNode = element.getRootNode();\n // If the element is inside the DOM the root node will be either the document\n // or the closest shadow root, otherwise it'll be the element itself.\n return rootNode && rootNode !== element;\n }\n // Otherwise fall back to checking if it's in the document. This doesn't account for\n // shadow DOM, however browser that support shadow DOM should support `getRootNode` as well.\n return document.documentElement.contains(element);\n }", "title": "" }, { "docid": "682079c73af594159dd3707d0c2c564a", "score": "0.4566615", "text": "_isAttachedToDOM() {\n const element = this._elementRef.nativeElement;\n if (element.getRootNode) {\n const rootNode = element.getRootNode();\n // If the element is inside the DOM the root node will be either the document\n // or the closest shadow root, otherwise it'll be the element itself.\n return rootNode && rootNode !== element;\n }\n // Otherwise fall back to checking if it's in the document. This doesn't account for\n // shadow DOM, however browser that support shadow DOM should support `getRootNode` as well.\n return document.documentElement.contains(element);\n }", "title": "" }, { "docid": "682079c73af594159dd3707d0c2c564a", "score": "0.4566615", "text": "_isAttachedToDOM() {\n const element = this._elementRef.nativeElement;\n if (element.getRootNode) {\n const rootNode = element.getRootNode();\n // If the element is inside the DOM the root node will be either the document\n // or the closest shadow root, otherwise it'll be the element itself.\n return rootNode && rootNode !== element;\n }\n // Otherwise fall back to checking if it's in the document. This doesn't account for\n // shadow DOM, however browser that support shadow DOM should support `getRootNode` as well.\n return document.documentElement.contains(element);\n }", "title": "" }, { "docid": "682079c73af594159dd3707d0c2c564a", "score": "0.4566615", "text": "_isAttachedToDOM() {\n const element = this._elementRef.nativeElement;\n if (element.getRootNode) {\n const rootNode = element.getRootNode();\n // If the element is inside the DOM the root node will be either the document\n // or the closest shadow root, otherwise it'll be the element itself.\n return rootNode && rootNode !== element;\n }\n // Otherwise fall back to checking if it's in the document. This doesn't account for\n // shadow DOM, however browser that support shadow DOM should support `getRootNode` as well.\n return document.documentElement.contains(element);\n }", "title": "" }, { "docid": "682079c73af594159dd3707d0c2c564a", "score": "0.4566615", "text": "_isAttachedToDOM() {\n const element = this._elementRef.nativeElement;\n if (element.getRootNode) {\n const rootNode = element.getRootNode();\n // If the element is inside the DOM the root node will be either the document\n // or the closest shadow root, otherwise it'll be the element itself.\n return rootNode && rootNode !== element;\n }\n // Otherwise fall back to checking if it's in the document. This doesn't account for\n // shadow DOM, however browser that support shadow DOM should support `getRootNode` as well.\n return document.documentElement.contains(element);\n }", "title": "" }, { "docid": "f4825e1d5e4021b86f3808ec30fd5fc1", "score": "0.45418897", "text": "static isSlot(a) {\n return (!!a && a._name !== undefined && a._assignedNodes !== undefined &&\n Guard.isElementNode(a));\n }", "title": "" }, { "docid": "e197b4da2ef40d7ab177f4d839bd5a87", "score": "0.45385846", "text": "function isBound(options) {\n if(typeof options === \"undefined\") {\n throw new ExceptionService.Exception.IllegalArgumentException(\"regula.isBound expects options\");\n }\n\n var element = options.element;\n var elementId = options.elementId;\n\n if(typeof element === \"undefined\" && typeof elementId === \"undefined\") {\n throw new ExceptionService.Exception.IllegalArgumentException(\"regula.isBound expects at the very least, either an element or elementId attribute\");\n }\n\n if(options.hasOwnProperty(\"constraint\") && typeof options.constraint === \"undefined\") {\n throw new ExceptionService.Exception.IllegalArgumentException(\"Undefined constraint was supplied as a parameter\")\n }\n\n if(options.hasOwnProperty(\"group\") && typeof options.group === \"undefined\") {\n throw new ExceptionService.Exception.IllegalArgumentException(\"Undefined group was supplied as a parameter\");\n }\n\n if(typeof element !== \"undefined\") {\n elementId = element.id;\n }\n\n return BindingService.isBound({\n elementId: elementId,\n group: options.group,\n constraint: options.constraint\n });\n }", "title": "" }, { "docid": "c813aae2b068a622d4fff8e35abd87b2", "score": "0.45331186", "text": "static isGeneratorableNode(structure) {\n switch (structure.kind) {\n case StructureKind_1.StructureKind.Method:\n case StructureKind_1.StructureKind.MethodOverload:\n case StructureKind_1.StructureKind.Function:\n case StructureKind_1.StructureKind.FunctionOverload:\n return true;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "adaf3d3c7b11e63b6b35e4af1750e56d", "score": "0.4526477", "text": "function isStructDefinition(sexp) {\n return (\n isCons(sexp) &&\n isSymbol(sexp[0]) &&\n isSymbolEqualTo(\"define-struct\", sexp[0])\n );\n }", "title": "" }, { "docid": "b3021d6d2acc9d69624fce59dbebe228", "score": "0.452598", "text": "function typeIs(obj, typeName) {\n return toString.call(obj).slice(8, -1) == typeName;\n }", "title": "" }, { "docid": "11d78a1019f6e54a39120a91dd2f141d", "score": "0.4522216", "text": "function isLocalName(node){return(ts.getEmitFlags(node)&16384/* LocalName */)!==0;}", "title": "" }, { "docid": "3cf54253f452b17204a9abf2532df489", "score": "0.45215836", "text": "static isCallSignatureDeclaration(structure) {\n return structure.kind === StructureKind_1.StructureKind.CallSignature;\n }", "title": "" }, { "docid": "d340163683b25e63269568b6f044efad", "score": "0.4515162", "text": "function isStructDefinition(sexp) {\n return ((isCons(sexp)) && (isSymbol(sexp[0])) && (isSymbolEqualTo(\"define-struct\", sexp[0])));\n }", "title": "" }, { "docid": "4b5408025e8503fdf0ac0b2a0d2a7af0", "score": "0.45009968", "text": "function isNamedExpression(node){return(ts.isFunctionExpression(node)||ts.isClassExpression(node))&&ts.isNamedDeclaration(node);}", "title": "" }, { "docid": "983f08776025bd1cf5343acc7ce2420f", "score": "0.44893944", "text": "function isNameOfDeclarationWithCollidingName(node){switch(node.parent.kind){case 191/* BindingElement */:case 245/* ClassDeclaration */:case 248/* EnumDeclaration */:case 242/* VariableDeclaration */:return node.parent.name===node&&resolver.isDeclarationWithCollidingName(node.parent);}return false;}", "title": "" }, { "docid": "9394c5d45287d4dad574431b731170a4", "score": "0.44881803", "text": "IsName() {}", "title": "" }, { "docid": "97db1dce3733e70cf9892bc6ab2f90dc", "score": "0.44841483", "text": "static hasInputAndOutputPorts(obj) {\n\t\treturn (this.isNode(obj) && obj.inputs && obj.inputs.length > 0 && obj.outputs && obj.outputs.length > 0);\n\t}", "title": "" }, { "docid": "3cfa4a5881b7a1a836fd0c347a198241", "score": "0.44715336", "text": "static isJsxAttributedNode(structure) {\n return structure.kind === StructureKind_1.StructureKind.JsxSelfClosingElement;\n }", "title": "" }, { "docid": "c6e857f02a6bfc0ed55fa89afe3a2738", "score": "0.447111", "text": "mayBeUnboundReference() {\n return !this.node.scope.hasBinding(this.node.data);\n }", "title": "" }, { "docid": "1e5422a8be4616f75508d87000c6afd7", "score": "0.44664568", "text": "function isReference(ref) {\n return isObject(ref) && typeof ref._ref === 'string';\n}", "title": "" }, { "docid": "02aeff3f4c929a3796259fec7326b444", "score": "0.44565442", "text": "function isNamedBranch(branch) {\n return typeof branch === 'string' && NAMED_BRANCHES.includes(branch);\n}", "title": "" }, { "docid": "74b1a5fa729780435992696b356f1841", "score": "0.44531465", "text": "function cd_isBlankStructure(objName, selection) {\n return cd_getSpecificObject(objName).isBlankStructure();\n}", "title": "" }, { "docid": "59ccf2f918dde30ef904a254715ac460", "score": "0.44460633", "text": "function isNonBindableDynamicName(node){return ts.isDynamicName(node)&&!isLateBindableName(node);}", "title": "" }, { "docid": "ee0cd1226db640f716e3d8466e32d805", "score": "0.44436282", "text": "function isNamedType(type) {\n return type instanceof GraphQLScalarType || type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType || type instanceof GraphQLUnionType || type instanceof GraphQLEnumType || type instanceof GraphQLInputObjectType;\n }", "title": "" }, { "docid": "ea4ee82bfb55427b3fcee03a695b13ae", "score": "0.44355735", "text": "static isEnumMember(structure) {\n return structure.kind === StructureKind_1.StructureKind.EnumMember;\n }", "title": "" }, { "docid": "f23d193ee9fe352c721cd9b72167fa2b", "score": "0.4429701", "text": "function is_name(stmt) {\n return is_tagged_list(stmt, \"name\");\n}", "title": "" }, { "docid": "7faa54820c11cb7cd785dea4e7d2bfc0", "score": "0.4420808", "text": "function isNamedType(type) {\n return type instanceof GraphQLScalarType || type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType || type instanceof GraphQLUnionType || type instanceof GraphQLEnumType || type instanceof GraphQLInputObjectType;\n}", "title": "" } ]
0a0e9257fe8729db1a8b35f30da77622
Conditionals Create a function that takes in a month. If it is a summer month alert "YAY". If another other month, alert "Booo"
[ { "docid": "88e8e6e9f2d0357b0d1c0a8a1581d008", "score": "0.7360189", "text": "function summer(month){\n case\n}", "title": "" } ]
[ { "docid": "a6eb17d5716fcf81a10a8862fa44ac9a", "score": "0.70042276", "text": "function birthday(month, day){\n if (month = 'Jan'){\n if (day === 30){\n console.log('How did you know?')\n } \n else {\n console.log('Just another day...')\n }\n }\n else {\n console.log('Just another day...')\n }\n}", "title": "" }, { "docid": "06bd0605a24fd738109228e5459ff8ee", "score": "0.69575363", "text": "function getMonth(a){\n\n\nif(a===1){return\"January\";}\nif(a===2){return\"February\";}\nif(a===3){return\"March\";}\nif(a===4){return\"April\";}\nif(a===5){return\"May\";}\nif(a===6){return\"June\";}\nelse if(a===7){return\"July\";}\nelse if(a===8){return\"August\";}\nelse if(a===9){return\"September\";}\nelse if(a===10){return\"October\";}\nelse if(a===11){return\"November\";}\nelse if(a===12){return\"December\";}\nelse {throw \"Invalid Input\";}\n}", "title": "" }, { "docid": "ab82243f29d572bd3d595bae20fc34ce", "score": "0.6949736", "text": "function checkSeason(month){\n switch(month){\n case 'january':\n case 'feburary':\n case 'march':\n return('spring')\n break;\n case 'april':\n case 'may':\n case 'june': \n return('summer');\n break;\n case 'july':\n case 'august':\n case 'september':\n return('autumn');\n break;\n case 'october':\n case 'november':\n case 'december':\n return('winter');\n break;\n }\n}", "title": "" }, { "docid": "e07a04794c3ef5552671ac1ae52243e2", "score": "0.6876243", "text": "function isMonth(s) {\n return s === 'months' || s === 'month' || s === 'mon' || s === 'mons';\n}", "title": "" }, { "docid": "2bcccf8a1ca245bcdfeb111fbe303397", "score": "0.6848749", "text": "function calmonth() {\n switch (month) {\n case 1:\n mon = \"January\";\n d = 31;\n break;\n case 2:\n mon = \"February\";\n if (leap(y)) d = 29;\n else d = 28;\n break;\n case 3:\n mon = \"March\";\n d = 31;\n break;\n case 4:\n mon = \"April\";\n d = 30;\n break;\n case 5:\n mon = \"May\";\n d = 31;\n break;\n case 6:\n mon = \"June\";\n d = 30;\n break;\n case 7:\n mon = \"July\";\n d = 31;\n break;\n case 8:\n mon = \"August\";\n d = 31;\n break;\n case 9:\n mon = \"September\";\n d = 30;\n break;\n case 10:\n mon = \"October\";\n d = 31;\n break;\n case 11:\n mon = \"November\";\n d = 30;\n break;\n case 12:\n mon = \"December\";\n d = 31;\n break;\n default:\n console.log(\"Invalid month!\")\n return;\n break;\n }\n}", "title": "" }, { "docid": "39f0e526ff5cb24fd9cf1346ff6eb351", "score": "0.6821273", "text": "function monthName(monthNum){\n switch(monthNum){\n case 1:\n return \"January\"\n case 2:\n return \"February\"\n case 3:\n return \"March\"\n case 4:\n return \"April\"\n case 5:\n return \"May\"\n case 6:\n return \"June\"\n case 7:\n return \"July\"\n case 8:\n return \"August\"\n case 9:\n return \"September\"\n case 10:\n return \"October\"\n case 11:\n return \"November\"\n case 12:\n return \"December\"\n default:\n console.log(\"invalid input\")\n return false\n }\n}", "title": "" }, { "docid": "0d936886f3896024a0fdbe2dce9f60b1", "score": "0.6738132", "text": "function checkSeason(month) {\n if (month === 'September' || month === 'October' || month === 'November') {\n console.log('season is Autumn');\n }else if (month === 'December' || month === 'january' || month === 'February') {\n console.log('season is Winter');\n }else if (month === 'March' || month === 'April' || month === 'May') {\n console.log('season is Spring');\n }else if (month === 'June' || month === 'July' || month === 'August') {\n console.log('season is Summer');\n }else{\n console.log('NonOFthe above');\n }\n}", "title": "" }, { "docid": "2bd0a42c307c913d72b2cee15edb51f9", "score": "0.6736761", "text": "function isMonth (s)\n{ if (isEmpty(s)) \n if (isMonth.arguments.length == 1) return defaultEmptyOK;\n else return (isMonth.arguments[1] == true);\n return isIntegerInRange (stripInitialCeros (s), 1, 12);\n}", "title": "" }, { "docid": "c8ec9e92c74c60c20889270210af6dea", "score": "0.67258793", "text": "_getMonth(month){\n var returnmonth;\n if(month==\"01\"){\n returnmonth=\"January\";\n }\n else if(month==\"02\"){\n returnmonth=\"February\";\n }\n else if(month==\"03\"){\n returnmonth=\"March\";\n }\n else if(month==\"04\"){\n returnmonth=\"April\";\n }\n else if(month==\"05\"){\n returnmonth=\"May\";\n }\n else if(month==\"06\"){\n returnmonth=\"June\";\n }\n else if(month==\"07\"){\n returnmonth=\"July\";\n }\n else if(month==\"08\"){\n returnmonth=\"August\";\n }\n else if(month==\"09\"){\n returnmonth=\"September\";\n }\n else if(month==\"10\"){\n returnmonth=\"October\";\n }\n else if(month==\"11\"){\n returnmonth=\"November\";\n }\n else if(month==\"12\"){\n returnmonth=\"December\";\n }\n return(returnmonth);\n }", "title": "" }, { "docid": "61504ebf1b8c5c1823db221b0a4e2740", "score": "0.6682836", "text": "function month(n) {\n switch (n) {\n\n case 1:\n return \"31 days\";\n break;\n case 2:\n return \"28/29 days\";\n break;\n\n case 3:\n return \"31 days\";\n break;\n\n case 4:\n return \"30 days\";\n break;\n\n case 5:\n return \"31 days\";\n break;\n\n case 6:\n return \"30 days\";\n break;\n\n case 7:\n return \"31 days\";\n break;\n case 8:\n return \"31 days\";\n break;\n\n case 9:\n return \"30 days\";\n break;\n\n case 10:\n return \"31 days\";\n break;\n\n case 11:\n return \"30 days\";\n break;\n\n case 12:\n return \"31 days\";\n break;\n\n default:\n return \"invalid\";\n break;\n\n }\n}", "title": "" }, { "docid": "a186100759ca9d7a912826c685c99b3a", "score": "0.66710573", "text": "function myFunction(){\n var fecha = new Date();\n fecha.setMonth(0);\n var dia = fecha.getDate();\n var mes = fecha.getMonth();\n console.log(dia);\n console.log(mes);\n\n var estacio=\"\";\n \n if((mes==2 && dia>=21) || mes==3 || mes==4 || (mes==5 && dia<21)){\n estacio = \"primavera\";\n }else if((mes==5 && dia>=21) || mes==6 || mes==7 || (mes==8 && dia<21)){\n estacio = \"estiu\";\n }else if((mes==8 && dia>=21) || mes==9 || mes==10 || (mes==11 && dia<21)){\n estacio = \"tardor\";\n }else{\n estacio = \"hivern\";\n }\n console.log(estacio);\n document.getElementById(\"demo\").innerHTML = estacio;\n}", "title": "" }, { "docid": "8df34c9998a2bf58d652a0ff5c9145e4", "score": "0.66612434", "text": "function youSayItsYourBirthday(num1,num2,bmonth,bday){\n if(num1 == bmonth && num2 == bday || num1 == bday && num2 == bmonth){\n console.log(\"How did you know?\");\n }\n else{\n console.log(\"Just another day\");\n }\n}", "title": "" }, { "docid": "d168089c47564830a7e0c5287fde9208", "score": "0.66263866", "text": "function getMonth(month){\n switch(month){\n case '01' :\n return 'Januari';\n break;\n case '02' : \n return 'Februari';\n break;\n case '03' :\n return 'Maret';\n break;\n case '04' :\n return 'April';\n break;\n case '05' :\n return 'Mei';\n break;\n case '06' :\n return 'Juni';\n break;\n case '07' :\n return 'Juli';\n break;\n case '08' : \n return 'Agustus';\n break;\n case '09' :\n return 'September';\n break;\n case '10' :\n return 'Oktober';\n break;\n case '11' :\n return 'November';\n break;\n case '12' :\n return 'Desember';\n break;\n default:\n return 0;\n break;\n }\n}", "title": "" }, { "docid": "fce4bc8714ef1806a0a9b9a715dd64c0", "score": "0.6543525", "text": "function checkSeason(month) {\n const now = new Date()\n month = now.getMonth()\n if ((month.length >= 0) && (month.length <= 2)) {\n console.log('Autumn')\n }\n \n }", "title": "" }, { "docid": "dbdd1632746a31fe26b89b0a643f8c2b", "score": "0.6538142", "text": "function MonthNum(month){\nif(month===\"January\"){\n return 1;\n}else if(month===\"February\"){\n return 2;\n}else if(month===\"March\"){\n return 3;\n}else if(month===\"April\"){\n return 4;\n}else if(month===\"May\"){\n return 5;\n}else if(month===\"June\"){\n return 6;\n } else if(month===\"July\"){\n return 7;\n }else if(month===\"August\"){\n return 8;\n }else if(month===\"September\"){\n return 9;\n }else if(month===\"October\"){\n return 10;\n }else if(month===\"November\"){\n return 11;\n }else if(month===\"December\"){\n return 12;\n }\n}", "title": "" }, { "docid": "7329ad57c64117e6e207618ed2847cf1", "score": "0.65230465", "text": "function displayMonth(input) {\n if (input == 'Jan'){\n return \"January\";\n }\n else if (input == 'Feb'){\n return \"February\";\n }\n else if (input == 'Feb'){\n return \"February\";\n }\n else if (input == 'Mar'){\n return \"March\";\n }\n else if (input == 'Apr'){\n return \"April\";\n }\n else if (input == 'Jun'){\n return \"June\";\n }\n else if (input == 'Jul'){\n return \"July\";\n }\n else if (input == 'Aug'){\n return \"August\";\n }\n else if (input == 'Sep'){\n return \"September\";\n }\n else if (input == 'Oct'){\n return \"October\";\n }\n else if (input == 'Nov'){\n return \"November\";\n }\n else {\n return \"December\";\n }\n}", "title": "" }, { "docid": "186f4bb5af44c5b41137dc773c0919b6", "score": "0.6468812", "text": "function showMonth() {\n\n switch (getMonth) {\n case 0:\n getMonth = \"January\";\n break;\n case 1:\n getMonth = \"February\";\n break;\n case 2:\n getMonth = \"March\";\n break;\n case 3:\n getMonth = \"April\";\n break;\n case 4:\n getMonth = \"May\";\n break;\n case 5:\n getMonth = \"June\";\n break;\n case 6:\n getMonth = \"July\";\n break;\n case 7:\n getMonth = \"August\";\n break;\n case 8:\n getMonth = \"September\";\n break;\n case 9:\n getMonth = \"October\";\n break;\n case 10:\n getMonth = \"November\";\n break;\n case 11:\n getMonth = \"December\";\n break;\n\n default:\n //console.log(\"Check code.\");\n }\n}", "title": "" }, { "docid": "717781212ee0d07ac7374e06b79f77ca", "score": "0.6452789", "text": "function checkMonth (theField, s, emptyOK)\n{ if (checkMonth.arguments.length == 2) emptyOK = defaultEmptyOK;\n if ((emptyOK == true) && (isEmpty(theField.value))) return true;\n if (!isMonth(theField.value, false)) \n return warnInvalid (theField, s);\n else return true;\n}", "title": "" }, { "docid": "056cf5a4a70fdfaeb69b4ca5c2b3ed8d", "score": "0.6412216", "text": "function monthSwitch() {\n switch (month) {\n case 1:\n month = \"January\";\n break;\n case 2:\n month = \"February\";\n break;\n case 3:\n month = \"March\";\n break;\n case 4:\n month = \"April\";\n break;\n case 5:\n month = \"May\";\n break;\n case 6:\n month = \"June\";\n break;\n case 7:\n month = \"July\";\n break;\n case 8:\n month = \"August\";\n break;\n case 9:\n month = \"September\";\n break;\n case 10:\n month = \"October\";\n break;\n case 11:\n month = \"November\";\n break;\n case 12:\n month = \"December\";\n break;\n default:\n console.log(\"month switch didn't work\");\n break;\n }\n }", "title": "" }, { "docid": "27ea14e0beea5d70accdadc3c2887468", "score": "0.6409214", "text": "function monthName(text) {\n let array = [];\n let smallLetterText = text.toLowerCase();\n let months = [\n January,\n February,\n March,\n April,\n May,\n June,\n July,\n August,\n September,\n October,\n November,\n December\n ];\n array.push(months[i]);\n let smallLetterMonths = months.toLowerCase();\n let winter = [winter, spring, summer, autumn];\n\n if (smallLetterText == smallLetterMonths) {\n return `${text} is a month in the winter season`;\n } else {\n }\n}", "title": "" }, { "docid": "286d6d1b2719b0d9a15a04f646436233", "score": "0.6197846", "text": "function date_range_filter(date_input,strf){\n if (date_input){\n this_month = moment().format(strf) //01\n\n completed_date_moment = new moment(date_input)\n completed_month = completed_date_moment.format(strf)\n\n\n return completed_month === this_month\n }\n}", "title": "" }, { "docid": "2b391418da329866016ec2d2fd91e423", "score": "0.619176", "text": "function checkDate() {\n if (date === 1) {\n return \"st\";\n } else if (date === 2) {\n return \"nd\";\n } else if (date === 3) {\n return \"rd\";\n } else {\n return \"th\";\n }\n}", "title": "" }, { "docid": "98bee8ed682bb34b471e5049a564895d", "score": "0.6190319", "text": "function checkSeason(value) {\n if ([\"december\", \"january\", \"february\"].includes(value.toLowerCase())) {\n return \"Winter\";\n } else if ([\"march\", \"april\", \"may\"].includes(value.toLowerCase())) {\n return \"Spring\";\n } else if ([\"june\", \"july\", \"august\"].includes(value.toLowerCase())) {\n return \"Summer\";\n } else if (\n [\"september\", \"october\", \"november\"].includes(value.toLowerCase())\n ) {\n return \"Autumn\";\n } else {\n return \"Wrong month!\";\n }\n}", "title": "" }, { "docid": "57fc3aa9bb2319f8746e212cbef05302", "score": "0.6173342", "text": "function daysOfMonth(month) {\n switch (month.toLowerCase()) {\n case \"january\":\n case \"march\":\n case \"may\":\n case \"july\":\n case \"august\":\n case \"october\":\n case \"december\":\n return true;\n default:\n return false;\n }\n}", "title": "" }, { "docid": "a3137005507ecc6f2365d2f11ac6aa89", "score": "0.6156733", "text": "function getSeason(month) {\r\n\r\n if (3 <= month <= 5) {\r\n return 'autumn';\r\n }\r\n\r\n if (6 <= month <= 8) {\r\n return 'winter';\r\n }\r\n\r\n if (9 <= month <= 11) {\r\n return 'spring';\r\n }\r\n\r\n // Months 12, 01, 02\r\n return 'summer';\r\n}", "title": "" }, { "docid": "63b03f01eeb5c960c7c4d276d4c1f7ec", "score": "0.61428285", "text": "function validateMonth(month){\n if (+month > 12 || +month < 1 || !Number.isInteger(+month)) {\n return new Error(\"Month must be an integer between 1 and 12.\");\n }\n\n else {\n return leftpad(month, 2);\n }\n}", "title": "" }, { "docid": "1e5aa555be47f6871ffcef1f698757a9", "score": "0.6125827", "text": "function daysInMonth(month) {\n switch(month) {\n case 'January':\n console.log('January has 31 days');\n break;\n case 'February':\n console.log('February has 28 days');\n break;\n case 'March':\n console.log('March has 31 days');\n break;\n case 'April':\n console.log('April has 30 days');\n break;\n case 'May':\n console.log('May has 31 days');\n break;\n case 'June':\n console.log('June has 30 days');\n break;\n case 'July':\n console.log('July has 31 days');\n break;\n case 'August':\n console.log('August has 31 days');\n break;\n case 'September':\n console.log('September has 30 days');\n break;\n case 'October':\n console.log('October has 31 days');\n break;\n case 'November':\n console.log('November has 30 days');\n break;\n case 'December':\n console.log('December has 31 days');\n break;\n\n }\n}", "title": "" }, { "docid": "043caa18a7e0ff59d946cd08e9033716", "score": "0.60801494", "text": "function getMonthString(month) {\n switch (month) {\n case 1: return \"January\";\n case 2: return \"February\";\n case 3: return \"March\";\n case 4: return \"April\";\n case 5: return \"May\";\n case 6: return \"June\";\n case 7: return \"July\";\n case 8: return \"August\";\n case 9: return \"September\";\n case 10: return \"October\";\n case 11: return \"November\";\n default: return 'December';\n }\n }", "title": "" }, { "docid": "f978085e88b47885f42e9372bf46471e", "score": "0.6079802", "text": "function _checkMonth(inputmonth) {\n\t\tif (inputmonth == 1)\n\t\t{\n\t\t\t$(\".previous_Container div\").css({\"opacity\": \"0.4\", \"cursor\": \"not-allowed\"});\n\t\t\t$(\".next_Container div\").css({\"opacity\": \"1\", \"cursor\": \"pointer\"});\n\t\t}\n\t\telse if (inputmonth == 12)\n\t\t{\n\t\t\t$(\".previous_Container div\").css({\"opacity\": \"1\", \"cursor\": \"pointer\"});\n\t\t\t$(\".next_Container div\").css({\"opacity\": \"0.4\", \"cursor\": \"not-allowed\"});\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$(\".previous_Container div\").css({\"opacity\": \"1\", \"cursor\": \"pointer\"});\n\t\t\t$(\".next_Container div\").css({\"opacity\": \"1\", \"cursor\": \"pointer\"});\n\t\t}\n\t} //end function", "title": "" }, { "docid": "c8e3d154611d86599a95de31e1853edd", "score": "0.607772", "text": "function getSign(month, day) {\n var sign = \"nan\";\n if (((month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) && day > 31) ||\n ((month == 4 || month == 6 || month == 9 || month == 11) && day > 30) || (month == 2 && day > 29) || (day < 1)) {\n sign=\"oph\"; // If the user entered a day that doesn't exist, *easteregg* return Ophiuchus.\n }\n else if ((month == 12 && day >= 22) || (month == 1 && day <= 19)) {\n sign = \"cap\";\n }\n else if ((month == 11 && day >= 22) || (month == 12 && day <= 21)) {\n sign = \"sag\";\n }\n else if ((month == 10 && day >= 24) || (month == 11 && day <= 21)) {\n sign = \"sco\";\n }\n else if ((month == 9 && day >= 23) || (month == 10 && day <= 23)) {\n sign = \"lib\";\n }\n else if ((month == 8 && day >= 23) || (month == 9 && day <= 22)) {\n sign = \"vir\";\n }\n else if ((month == 7 && day >= 23) || (month == 8 && day <= 22)) {\n sign = \"leo\";\n }\n else if ((month == 6 && day >= 22) || (month == 7 && day <= 22)) {\n sign = \"can\";\n }\n else if ((month == 5 && day >= 21) || (month == 6 && day <= 21)) {\n sign = \"gem\";\n }\n else if ((month == 4 && day >= 20) || (month == 5 && day <= 20)) {\n sign = \"tau\";\n }\n else if ((month == 3 && day >= 21) || (month == 4 && day <= 19)) {\n sign = \"ari\";\n }\n else if ((month == 2 && day >= 19) || (month == 3 && day <= 20)) {\n sign = \"pis\";\n }\n else if ((month == 1 && day >= 20) || (month == 2 && day <= 18)) {\n sign = \"aqu\";\n }\n else {\n sign = \"oph\";\n }\n return sign;\n}", "title": "" }, { "docid": "d9df871f29a54b7dada0cb7488f07867", "score": "0.6076362", "text": "function getNameOfMonth(month) {\n switch (month) {\n case 1: return \"januari\";\n case 2: return \"februari\";\n case 3: return \"mars\";\n case 4: return \"april\";\n case 5: return \"maj\";\n case 6: return \"juni\";\n case 7: return \"juli\";\n case 8: return \"augusti\";\n case 9: return \"september\";\n case 10: return \"oktober\";\n case 11: return \"november\";\n case 12: return \"december\";\n }\n}", "title": "" }, { "docid": "85328c7ba30fc40e8ca2eac157d0edf2", "score": "0.60739595", "text": "function check_bymonth(rules, dt) {\n if(!rules || !rules.length) return true;\n return rules.indexOf(m(dt)) !== -1;\n}", "title": "" }, { "docid": "0061840fc59f87df23c1856e686a75b1", "score": "0.6056444", "text": "function standard_month(date) {\n return date[1];\n}", "title": "" }, { "docid": "1acc4ad0bed0ad33427a97482ea77e99", "score": "0.60539496", "text": "function checkMonth(m){\n\t if (m<=0 || m>12){\n\t alert(\"Please correct your month number.\");\n\t\t} \n\t\t\treturn false\n\t\t}", "title": "" }, { "docid": "abec3b907a4a86c34456b99269132a12", "score": "0.6053898", "text": "function getEnglishMonth(eventMonth){\n\tif (eventMonth == 0){\n\t\treturn \"January \";\n\t}\n\tif (eventMonth == 1){\n\t\treturn \"February\";\n\t}\n\tif (eventMonth == 2){\n\t\treturn \"March \";\n\t}\n\tif (eventMonth == 3){\n\t\treturn \"April\";\n\t}\n\tif (eventMonth == 4){\n\t\treturn \"May\";\n\t}\n\tif (eventMonth == 5){\n\t\treturn \"June\";\n\t}\n\tif (eventMonth == 6){\n\t\treturn \"July\";\n\t}\n\tif (eventMonth == 7){\n\t\treturn \"August\";\n\t}\n\tif (eventMonth == 8){\n\t\treturn \"September\";\n\t}\n\tif (eventMonth == 9){\n\t\treturn \"October\";\n\t}\n\tif (eventMonth == 10){\n\t\treturn \"November\";\n\t}\n\telse {\n\t\treturn \"December\";\n\t}\n}", "title": "" }, { "docid": "25d53c87a44fe2a09e9fa808b6078a0e", "score": "0.6052563", "text": "function dayToMonth(time){\r\n\tvar day = time;\r\n\t\r\n\tswitch (true){\r\n case (day <= 31):\r\n return \"Janurary \" + day + numberSuffix(day);\r\n break;\r\n\tcase (day <= 59):\r\n\t\treturn \"Feburary \" + (day - 31) + numberSuffix(day - 31);\r\n\t\tbreak;\r\n\tcase (day <= 90):\r\n\t\treturn \"March \" + (day - 59) + numberSuffix(day - 59);\r\n\t\tbreak;\r\n\tcase (day <= 120):\r\n\t\treturn \"April \" + (day - 90) + numberSuffix(day - 90);\r\n\t\tbreak;\r\n case (day <= 151):\r\n\t\treturn \"May \" + (day - 120) + numberSuffix(day - 120);\r\n\t\tbreak;\r\n\tcase (day <= 181):\r\n\t\treturn \"June \" + (day - 151) + numberSuffix(day - 151);\r\n\t\tbreak;\r\n\tcase (day <= 212):\r\n\t\treturn \"July \" + (day - 181) + numberSuffix(day - 181);\r\n\t\tbreak;\r\n\tcase (day <= 243):\r\n\t\treturn \"August \" + (day - 212) + numberSuffix(day - 212);\r\n\t\tbreak;\r\n\tcase (day <= 273):\r\n\t\treturn \"September \" + (day - 243) + numberSuffix(day - 243);\r\n\t\tbreak;\r\n\tcase (day <= 304):\r\n\t\treturn \"October \" + (day - 273) + numberSuffix(day - 273);\r\n\t\tbreak;\r\n\tcase (day <= 334):\r\n\t\treturn \"November \" + (day - 304) + numberSuffix(day - 304);\r\n\t\tbreak;\r\n\tcase (day <= 365):\r\n\t\treturn \"December \" + (day - 334) + numberSuffix(day - 334);\r\n\t\tbreak;\r\n\tdefault:\r\n return \"Undefineds\";\r\n break;\r\n\t}\r\n}", "title": "" }, { "docid": "8eb362b4c79ae800b3380142d6c266ee", "score": "0.6051477", "text": "function getMonthString(month) {\n var monthStrings = [\n 'January',\n 'Feburaury',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December'\n ];\n \n if (month < 0 || month > 12) {\n return undefined;\n } else {\n return monthStrings[month];\n }\n}", "title": "" }, { "docid": "278a9c4f5dfc9b78e7a3664b84ddc9a5", "score": "0.60494536", "text": "function getMonth(month) {\n const mlist = [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ];\n return mlist[month];\n }", "title": "" }, { "docid": "d70f7afabc735b2c1b753c60d40c05b8", "score": "0.60381883", "text": "function date_range_filter_moment(date_input,strf){\n if (date_input){\n this_month = moment().format(strf) //01\n completed_date_moment = new moment(date_input)\n completed_month = completed_date_moment.format(strf)\n return completed_month === this_month\n }\n}", "title": "" }, { "docid": "3fbc794afaa8c1696da18da643ee6421", "score": "0.6033102", "text": "function getMonthDate(numberMonth){\n\tif(numberMonth == 0) return 'January';\n\telse if (numberMonth == 1) return 'February';\n\telse if (numberMonth == 2) return 'March';\n\telse if (numberMonth == 3) return 'April';\n\telse if (numberMonth == 4) return 'May';\n\telse if (numberMonth == 5) return 'June';\n\telse if (numberMonth == 6) return 'July';\n\telse if (numberMonth == 7) return 'August';\n\telse if (numberMonth == 8) return 'September';\n\telse if (numberMonth == 9) return 'October';\n\telse if (numberMonth == 10) return 'November';\n\telse if (numberMonth == 11) return 'December';\n}", "title": "" }, { "docid": "4a173922ca68ab3edd75bbb6327bfc0d", "score": "0.60142183", "text": "function change_month_format(month) {\r\n var monthString;\r\n switch (month) {\r\n case \"01\":\r\n monthString = \"January\";\r\n break;\r\n case \"02\":\r\n monthString = \"February\";\r\n break;\r\n case \"03\":\r\n monthString = \"March\";\r\n break;\r\n case \"04\":\r\n monthString = \"April\";\r\n break;\r\n case \"05\":\r\n monthString = \"May\";\r\n break;\r\n case \"06\":\r\n monthString = \"June\";\r\n break;\r\n case \"07\":\r\n monthString = \"July\";\r\n break;\r\n case \"08\":\r\n monthString = \"August\";\r\n break;\r\n case \"09\":\r\n monthString = \"September\";\r\n break;\r\n case \"10\":\r\n monthString = \"October\";\r\n break;\r\n case \"11\":\r\n monthString = \"November\";\r\n break;\r\n case \"12\":\r\n monthString = \"December\";\r\n break;\r\n }\r\n return monthString;\r\n}", "title": "" }, { "docid": "b215ad76bad6c7b401c496020b5e56fd", "score": "0.6011612", "text": "function getMonthName(month) {\r\n let name\r\n switch (month) {\r\n case 1:\r\n name = 'Jan'\r\n break;\r\n case 2:\r\n name = 'Feb'\r\n break;\r\n case 3:\r\n name = 'March'\r\n break;\r\n case 4: \r\n name = 'April'\r\n break; \r\n case 5:\r\n name = 'May'\r\n break;\r\n case 6:\r\n name = 'June'\r\n break;\r\n case 7:\r\n name = 'July'\r\n break;\r\n case 8:\r\n name = 'Aug'\r\n break;\r\n case 9 :\r\n name = 'Sept'\r\n break;\r\n case 10:\r\n name = 'Oct'\r\n break;\r\n case 11:\r\n name = 'Nov'\r\n break;\r\n case 12:\r\n name = 'Dec'\r\n break;\r\n }\r\n return name\r\n}", "title": "" }, { "docid": "de6a76ac661eb055968b764c6a6d328a", "score": "0.60065615", "text": "function validateMonth(month){\n \tif(!util.isNumber(month) || month < 1 || month > 12){\n \t\tvar err = new diError.DiError(diMess.ERR.MONTH_IS_INVALID.Code,\n \t\t\t\tdicUtilString.stringFormat(diMess.ERR.MONTH_IS_INVALID.Message, startDate, endDate));\n \t\tthrow err;\n \t}\n \treturn true;\n }", "title": "" }, { "docid": "4e5f02f5e5bc156043e8cc65c5e65af5", "score": "0.6001871", "text": "function monthName(monthNum){\n if(monthNum < 13 && monthNum > 0){\n var months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n // console.log(months[monthNum - 1]);\n return(months[monthNum - 1]);\n }\n}", "title": "" }, { "docid": "e8ec8c4b45accf48efde4d1e7f099f8a", "score": "0.6000002", "text": "function nextMonth(month) {\n\tvar lower = month.toLowerCase();\n\tif (lower == 'sep') {\n\t\treturn 'dec';\n\t}\n\telse if (lower == 'dec') {\n\t\treturn 'mar';\n\t}\n\telse if (lower == 'mar') {\n\t\treturn 'jun';\n\t}\n\telse {\n\t\treturn 'sep';\n\t}\n}", "title": "" }, { "docid": "df3e87bf9c685f2597c202ea87938627", "score": "0.59995466", "text": "function monthFormat(monthStr){\n var monthName = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"Novement\", \"December\"];\n return monthName[parseInt(monthStr) - 1];\n\n}", "title": "" }, { "docid": "dc46be719204654ebf1b678765886927", "score": "0.5973502", "text": "function monthString(num) {\n if (num === \"01\") { return \"JAN\"; } \n else if (num === \"02\") { return \"FEB\"; } \n else if (num === \"03\") { return \"MAR\"; } \n else if (num === \"04\") { return \"APR\"; } \n else if (num === \"05\") { return \"MAJ\"; } \n else if (num === \"06\") { return \"JUN\"; } \n else if (num === \"07\") { return \"JUL\"; } \n else if (num === \"08\") { return \"AUG\"; } \n else if (num === \"09\") { return \"SEP\"; } \n else if (num === \"10\") { return \"OCT\"; } \n else if (num === \"11\") { return \"NOV\"; } \n else if (num === \"12\") { return \"DEC\"; }\n}", "title": "" }, { "docid": "7fe855dd5ba25425820a993fb00d6393", "score": "0.59703285", "text": "getMonthString(month) {\n const months = [ \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\" ];\n return months[month];\n }", "title": "" }, { "docid": "9d22c34cfb9502779acb0c3365b11003", "score": "0.59692353", "text": "function seasons(inputA) {\n inputA = inputA.toLowerCase();\n if (inputA === \"spring\") {\n alert(\"Spring contains: March, April, May\");\n var month = prompt(\"enter month!\");\n month = month.toLowerCase();\n if (month === \"march\" || month === \"mar\") {\n return (\"March is cool...!\")\n } else if (month === \"april\" || month === \"apr\") {\n return (\"Luna was born in April!\")\n } else if (month === \"may\") {\n return (\"Ariana's birthday is May 6th!\");\n } else {\n return \"Spring months only!\"\n }\n } else if (inputA === \"summer\") {\n alert(\"Summer has June, July, and August\");\n var month = prompt(\"enter month!\");\n month = month.toLowerCase();\n if (month === \"june\" || month === \"jun\") {\n return (\"Luca birthday is June 13!\");\n } else if (month === \"july\" || month === \"jul\") {\n return (\"Fourth of July - fireworks!\")\n } else if (month === \"august\" || month === \"aug\") {\n return \"August - Back to school!\"\n } else {\n return \"Summer months only!\";\n }\n } else if (inputA === \"fall\" || inputA === \"autumn\") {\n alert(\"Fall has September, October, November\");\n var month = prompt(\"enter month!\");\n month = month.toLowerCase();\n if (month === \"september\" || month === \"Sep\") {\n return \"September - boring!\";\n } else if (month === \"october\" || month === \"oct\") {\n return \"October - Halloween!!!!\"\n } else if (month === \"november\" || month === \"nov\") {\n return \"November - Turkey, baby!!\";\n } else {\n return \"Fall months only!\";\n }\n } else if (inputA === \"winter\") {\n alert(\"Winter has December, January, and February\");\n var month = prompt(\"enter month!\");\n month = month.toLowerCase();\n if (month === \"december\" || month === \"dec\") {\n return \"December - Ho Ho Ho!!!!\"\n } else if (month === \"january\" || month === \"jan\") {\n return \"January - Happy New Year!!\";\n } else if (month === \"february\" || month === \"feb\") {\n return \"February - Will you be my valentine?\";\n } else {\n return \"Winter only!!\"\n }\n } else {\n return \"Not a real season!!\";\n }\n}", "title": "" }, { "docid": "7df26a573446b19344ce5ca99ac36f5e", "score": "0.59658563", "text": "function youSayItsYourBirthday(a, b) {\n myBirthDay = 2;\n myBirthMonth = 7;\n if (a === myBirthDay || a === myBirthMonth || b === myBirthDay || b === myBirthMonth ) {\n console.log('How did you know?');\n } else {\n console.log('Just another day....');\n }\n return;\n}", "title": "" }, { "docid": "dcaf2a24be378203f56471bc221c8d41", "score": "0.5948152", "text": "function toMonth(m) {\n switch(m) {\n case 0:\n return \"січня\";\n break;\n case 1:\n return \"лютого\";\n break;\n case 2:\n return \"березня\";\n break;\n case 3:\n return \"квітня\";\n break;\n case 4:\n return \"травня\";\n break;\n case 5:\n return \"червня\";\n break;\n case 6:\n return \"липня\";\n break;\n case 7:\n return \"серпня\";\n break;\n case 8:\n return \"вересня\";\n break;\n case 9:\n return \"жовтня\";\n break;\n case 10:\n return \"листопада\";\n break;\n case 11:\n return \"грудня\";\n break;\n }\n}", "title": "" }, { "docid": "4bc1c2677e82811ef402ecf44be80cda", "score": "0.59183145", "text": "function monthName(month,abbr_mode)\n{\n if(arguments.length==1) { var mon_str = [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"]; }\n if(abbr_mode=='abbrev') { var mon_str = [\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"June\",\"July\",\"Aug\",\"Sept\",\"Oct\",\"Nov\",\"Dec\"]; } //--purge\n if(abbr_mode=='abbr') { var mon_str = [\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"June\",\"July\",\"Aug\",\"Sept\",\"Oct\",\"Nov\",\"Dec\"]; }\n if(abbr_mode=='abbrev3') { var mon_str = [\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"]; } //--change to 'abbr3'\n if(abbr_mode=='full') { var mon_str = [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"]; } //-purge\n return mon_str[month-1];\n}", "title": "" }, { "docid": "4bc1c2677e82811ef402ecf44be80cda", "score": "0.59183145", "text": "function monthName(month,abbr_mode)\n{\n if(arguments.length==1) { var mon_str = [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"]; }\n if(abbr_mode=='abbrev') { var mon_str = [\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"June\",\"July\",\"Aug\",\"Sept\",\"Oct\",\"Nov\",\"Dec\"]; } //--purge\n if(abbr_mode=='abbr') { var mon_str = [\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"June\",\"July\",\"Aug\",\"Sept\",\"Oct\",\"Nov\",\"Dec\"]; }\n if(abbr_mode=='abbrev3') { var mon_str = [\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"]; } //--change to 'abbr3'\n if(abbr_mode=='full') { var mon_str = [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"]; } //-purge\n return mon_str[month-1];\n}", "title": "" }, { "docid": "1a0d07e91abf6c23cf93b509fa697acc", "score": "0.5915675", "text": "function getMonth(number) {\n switch (number) {\n case 1:\n return \"January\";\n break;\n case 2:\n return \"February\";\n break;\n case 3:\n return \"March\";\n break;\n case 4:\n return \"April\";\n break;\n case 5:\n return \"May\";\n break;\n case 6:\n return \"June\";\n break;\n case 7:\n return \"July\";\n break;\n case 8:\n return \"August\";\n break;\n case 9:\n return \"September\";\n break;\n case 10:\n return \"October\";\n break;\n case 11:\n return \"November\";\n break;\n case 12:\n return \"December\";\n break;\n default:\n return \"\";\n break;\n }\n }", "title": "" }, { "docid": "d978221bff2dbad739dbc1e69dae8e1a", "score": "0.5913345", "text": "function wordMonth() {\n var a = new Date();\n var b = a.getMonth();\n var months = [\"January\", \"February\", \"March\", \n \"April\", \"May\", \"June\", \"July\", \"August\", \n \"September\", \"October\", \"November\", \"December\"];\n return months[b];\n}", "title": "" }, { "docid": "d0ca904552759a7bc001a8a1034573b4", "score": "0.5901462", "text": "function abbrevMonth(day) {\r\n let day_array = [\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];\r\n return day_array[day-1];\r\n }", "title": "" }, { "docid": "7b29fe8bec540acd261b3579b5b83ea9", "score": "0.5863864", "text": "nextMonthFlag(fill){\n if(this.month == 11 && fill.month == 0){\n return true; \n }\n else if(fill.month == this.month + 1){\n return true;\n }\n return false; \n \n }", "title": "" }, { "docid": "61e87925ec94e801f9ca1124fd7a75e6", "score": "0.58529145", "text": "function month(date) {\n return format(date, false);\n}", "title": "" }, { "docid": "f9c26e349c15d1f8ec81998c8914b31c", "score": "0.58512324", "text": "function getMonthTranslation(monthName) {\n //todo: convert into some kind of JSON. Potentially this JSON can be fetched from api/i18n/calendar\n\n switch ( monthName ) {\n case 'January':\n return typeof i18n_month_january !== 'undefined' ? i18n_month_january : monthName;\n break;\n case 'February':\n return typeof i18n_month_february !== 'undefined' ? i18n_month_february : monthName;\n break;\n case 'March':\n return typeof i18n_month_march !== 'undefined' ? i18n_month_march : monthName;\n break;\n case 'April':\n return typeof i18n_month_april !== 'undefined' ? i18n_month_april : monthName;\n break;\n case 'May':\n return typeof i18n_month_may !== 'undefined' ? i18n_month_may : monthName;\n break;\n case 'June':\n return typeof i18n_month_june !== 'undefined' ? i18n_month_june : monthName;\n break;\n case 'July':\n return typeof i18n_month_july !== 'undefined' ? i18n_month_july : monthName;\n break;\n case 'August':\n return typeof i18n_month_august !== 'undefined' ? i18n_month_august : monthName;\n break;\n case 'September':\n return typeof i18n_month_september !== 'undefined' ? i18n_month_september : monthName;\n break;\n case 'October':\n return typeof i18n_month_october !== 'undefined' ? i18n_month_october : monthName;\n break;\n case 'November':\n return typeof i18n_month_november !== 'undefined' ? i18n_month_november : monthName;\n break;\n case 'December':\n return typeof i18n_month_december !== 'undefined' ? i18n_month_december : monthName;\n break;\n default:\n return monthName;\n }\n}", "title": "" }, { "docid": "3520623ee4d89da3ce6f06dee50d661e", "score": "0.5845802", "text": "function dayToMonth(dayNum){\n if(dayNum < 1 || dayNum > 365){\n console.log(\"invalid input\");\n return false;\n }\n else if(dayNum < 32){return \"January \" + dayNum}\n else if(dayNum < 60){return \"February \" + (dayNum-31)}\n else if(dayNum < 91){return \"March \" + (dayNum-59)}\n else if(dayNum < 121){return \"April \" + (dayNum-90)}\n else if(dayNum < 152){return \"May \" + (dayNum-120)}\n else if(dayNum < 182){return \"June \" + (dayNum-151)}\n else if(dayNum < 213){return \"July \" + (dayNum-181)}\n else if(dayNum < 244){return \"August \" + (dayNum-212)}\n else if(dayNum < 274){return \"September \" + (dayNum-243)}\n else if(dayNum < 305){return \"October \" + (dayNum-273)}\n else if(dayNum < 335){return \"November \" + (dayNum-304)}\n else if(dayNum < 366){return \"December \" + (dayNum-334)}\n}", "title": "" }, { "docid": "7cfb61edc0909409d146335f9473788c", "score": "0.58450747", "text": "function calendarShortMonth() {\n calShortMonthStart = monthShortNames.indexOf($('#calendar').fullCalendar('getView').title.split(' ')[0]) + 1;\n calShortMonthStart = calShortMonthStart.toString();\n\n // Checking if it is a two digit month if not, add the zero in front\n if (calShortMonthStart.length === 1) {\n calShortMonthStart = \"0\" + calShortMonthStart;\n };\n\n // Checking to see if it is a split week and get the second month information\n if ($('#calendar').fullCalendar('getView').title.split(' ').length === 6) {\n calShortMonthEnd = monthShortNames.indexOf($('#calendar').fullCalendar('getView').title.split(' ')[3]) + 1;\n calShortMonthEnd = calShortMonthEnd.toString();\n\n // Checking if it is a two digit month if not, add the zero in front\n if (calShortMonthEnd.length === 1) {\n calShortMonthEnd = \"0\" + calShortMonthEnd;\n };\n };\n}", "title": "" }, { "docid": "c04db15f756a93642f3895f5b78ca1a0", "score": "0.5834512", "text": "function isMMDate(s) \r\n{\r\n // alert(\"7:\" + s +\" int :\" + parseInt(s));\r\n if (s.length > 1) {\r\n if (s.charAt(0) == 0) { s = s.substring(1, 2) }\r\n }\r\n // alert(\"7-1:\" + s +\" int :\" + parseInt(s));\r\n \r\n return ((parseInt(s) > 0) && (parseInt(s) <= 12))\r\n}", "title": "" }, { "docid": "930d628663b7b4d81611eb6455bf74b0", "score": "0.58237594", "text": "function monthToString(month){\n switch(month){\n case 0:\n return \"January\";\n break;\n case 1:\n return \"February\";\n break;\n case 2:\n return \"March\";\n break;\n case 3:\n return \"April\";\n break;\n case 4:\n return \"May\";\n break;\n case 5:\n return \"June\";\n break;\n case 6:\n return \"July\";\n break;\n case 7:\n return \"August\";\n break;\n case 8:\n return \"September\";\n break;\n case 9:\n return \"October\";\n break;\n case 10:\n return \"November\";\n break;\n case 11:\n return \"December\";\n break;\n default:\n return \"Error in month conversion, number=\"+month;\n }\n}", "title": "" }, { "docid": "6f62edea3ea7acd3fa6ac190aceee905", "score": "0.58223855", "text": "function validationDateExpire(month,year){\n\n const actuallyYear = new Date().getFullYear() % 2000\n const actuallyMonth = new Date().getMonth() + 1\n \n const cardMonth = parseInt(month,10)\n\n const cardYear = parseInt(year,10)\n\n if(cardYear - actuallyYear == 0 && cardMonth >= actuallyMonth){\n return true\n }\n else if(cardYear - actuallyYear >= 0\n && cardYear - actuallyYear <= 10\n && cardMonth >= 0 && cardMonth <= 12){\n\n return true\n }\n else{\n return false\n }\n\n}", "title": "" }, { "docid": "7b0de9f32c78b893112a2abc7a0e7103", "score": "0.58170885", "text": "month(mom) {\n\n return {\n month: mom.format('MMMM'),\n year: mom.format('YYYY'),\n yearMonth: mom.format('YYYYMM'),\n }\n\n }", "title": "" }, { "docid": "ccfb7b71e4bc8a1caa8826b4ffcaf2dd", "score": "0.5812586", "text": "function fromMonthAbbr(fn) {\n return function(match) {\n var abbr = fn(match);\n return $scope.get('ABBR_MONTHNAMES').indexOf(abbr) + 1;\n }\n }", "title": "" }, { "docid": "2719a870d32ede0d4186836ff2198d3d", "score": "0.58041346", "text": "function checkDates(year, month, day) {\n var date = year+'-'+('0' + (month + 1)).slice(-2)+'-'+('0' + day).slice(-2);\n if(opts.date_at != '' && opts.date_at == date) {\n return ' start';\n }\n if(opts.date_to != '' && opts.date_to == date) {\n return ' end';\n }\n\n var date_at_ = new Date(opts.date_at),\n date_to_ = new Date(opts.date_to),\n date_ = new Date(date);\n if(date_at_ < date_ && date_to_ > date_) {\n return ' intermediate';\n }\n\n return '';\n }", "title": "" }, { "docid": "4e17122ee1051a322d1b216a273733f3", "score": "0.57883185", "text": "function onCurrentMonth() {\n\n\treturn dateTracker.getMonth() == currentMonth && dateTracker.getFullYear() == currentYear;\n\n}", "title": "" }, { "docid": "bc6f7d2cca3c2cde54a5daabb2c153eb", "score": "0.5784566", "text": "function fromFullMonthName(fn) {\n return function(match) {\n var month_name = fn(match);\n return ($a = ($c = $scope.get('MONTHNAMES').$compact()).$map, $a.$$p = \"downcase\".$to_proc(), $a).call($c).indexOf((month_name).$downcase()) + 1;\n }\n }", "title": "" }, { "docid": "ac27399c82ece7a21559eabbda417a92", "score": "0.5780862", "text": "function monthYear(d) {\n if (d === 1) {\n return `${d} mes`;\n } else {\n return `${d} meses`;\n }\n }", "title": "" }, { "docid": "dced64297554740f41cc9f2a4ed64a50", "score": "0.5771057", "text": "function getMonthNumber (month)\n{\n switch(month)\n {\n case 'January': return '01';\n case 'February': return '02';\n case 'March': return '03';\n case 'April': return '04';\n case 'May': return '05';\n case 'June': return '06';\n case 'July': return '07';\n case 'August': return '08';\n case 'September': return '09';\n case 'October': return '10';\n case 'November': return '11';\n case 'December': return '12';\n }\n}", "title": "" }, { "docid": "9a485d705b3656331f2b7c8120b9ab3e", "score": "0.5768661", "text": "function monthVal(monthInput) {\n let month;\n switch (monthInput) {\n default:\n return -1;\n case 'January':\n month = 0;\n break;\n case 'February':\n month = 1;\n break;\n case 'March':\n month = 2;\n break;\n case 'April':\n month = 3;\n break;\n case 'May':\n month = 4;\n break;\n case 'June':\n month = 5;\n break;\n case 'July':\n month = 6;\n break;\n case 'August':\n month = 7;\n break;\n case 'September':\n month = 8;\n break;\n case 'October':\n month = 9;\n break;\n case 'November':\n month = 10;\n break;\n case 'December':\n month = 11;\n break;\n }\n return month;\n}", "title": "" }, { "docid": "9a6de83af244eef0bb9766ce86653cf2", "score": "0.5767861", "text": "function validateDate(month, day) {\n let zero = '0'\n warn.innerText = ''\n if (month.length > 2 || day.length > 2 || month === NaN || day === NaN) {\n warn.innerText = \"Please format numbers correctly (2 or 22, for example)\"\n return\n }\n else if (month.length < 2 && day.length < 2) {\n month = zero.concat(month)\n day = zero.concat(day)\n date = '2020-' + month + \"-\" + day\n }\n else if (month.length < 2) {\n month = zero.concat(month)\n date = '2020-' + month + \"-\" + day\n }\n else if (day.length < 2) {\n day = zero.concat(day)\n date = '2020-' + month + \"-\" + day\n }\n else {\n date = '2020-' + month + \"-\" + day\n }\n\n }", "title": "" }, { "docid": "162351f71e8c1440aafa27f0e85acde8", "score": "0.5765552", "text": "function monthFormat(mon){\n switch(mon){\n case 1:return 'Jan';break;\n case 2:return 'Feb';break;\n case 3:return 'Mar';break;\n case 4:return 'Apr';break;\n case 5:return 'May';break;\n case 6:return 'Jun';break;\n case 7:return 'Jul';break;\n case 8:return 'Aug';break;\n case 9:return 'Sep';break;\n case 10:return 'Oct';break;\n case 11:return 'Nov';break;\n case 12:return 'Dec';break;\n }\n }", "title": "" }, { "docid": "a842294257649ad76c1fe7b6cf9a6ef1", "score": "0.5755256", "text": "function analyizMonth(month, year) {\n\tconst testDays = 31;\n\tlet counter = 0;\n\n\tconst monthObj = {\n\t\tyear: year,\n\t\tmonth: month,\n\t\tmonth_idx: monthsIndex[month],\n\t\tfirst_day: \"\",\n\t\tfirst_day_index: null,\n\t\tdays_length: 0,\n\t\tlast_day_index: null\n\t};\n\n\twhile (counter < testDays) {\n\t\tcounter++;\n\t\tconst dateTest = `${counter} ${month} ${year}`;\n\t\tconst dateArr = new Date(dateTest).toDateString().split(\" \");\n\t\tif (dateArr[1] === month) {\n\t\t\tif (counter === 1) {\n\t\t\t\tmonthObj.first_day = dateArr[0];\n\t\t\t\tmonthObj.first_day_index = daysIndex[dateArr[0]];\n\t\t\t}\n\t\t\tmonthObj.days_length++;\n\t\t\tmonthObj.last_day = dateArr[0];\n\t\t\tmonthObj.last_day_index = daysIndex[dateArr[0]];\n\t\t} else {\n\t\t\treturn monthObj;\n\t\t}\n\t}\n\treturn monthObj;\n}", "title": "" }, { "docid": "ba40adb13887b4fa27fea4d0f806c5cb", "score": "0.57488024", "text": "IsLeapMonth() {\n\n }", "title": "" }, { "docid": "48c6a8f7c254b2b48b59d24a8ef240e6", "score": "0.5748747", "text": "function calendarMonth() {\n\n // Pulling the name of the month on the calendar title, comparing it with the monthNames array to get the index and add 1 to have the numerical value of the month\n var calMonth = monthNames.indexOf($('#calendar').fullCalendar('getView').title.split(' ')[0]) + 1;\n calMonth = calMonth.toString();\n if (calMonth.length === 1) {\n calMonth = \"0\" + calMonth;\n };\n return calMonth;\n}", "title": "" }, { "docid": "2d9da39cfdcc8fdde1dabe60a9e9f247", "score": "0.57371163", "text": "GetLeapMonth() {\n\n }", "title": "" }, { "docid": "b9cf7465bb217c42cc1272f68b231362", "score": "0.57331616", "text": "function dayToMonth(dayNum){\n var count = 0;\n if(dayNum > 0 && dayNum < 366){\n for(var i = 1; i <=dayNum; i++){\n count = count + monthToDays(i);\n if(count >= dayNum){\n // console.log(monthName(i));\n return(monthName(i));\n }\n }\n }\n}", "title": "" }, { "docid": "12fee0aaebc02e5ffb9f0b4f00cf755a", "score": "0.57226676", "text": "function getMonthName(mo) {\r\n mo = mo - 1; // Adjust month number for array index (1 = Jan, 12 = Dec)\r\n let months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul',\r\n 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\r\n if (months[mo]) {\r\n return months[mo];\r\n } else {\r\n throw 'InvalidMonthNo'; // throw keyword is used here\r\n }\r\n }", "title": "" }, { "docid": "44daf925b53592670b44a650b9c74a42", "score": "0.57175547", "text": "function daysInAMonth(month, leapYear) {\n\tlet result;\n\tswitch(month) {\n\tcase 'October':\n\tcase 'December':\n\tcase 'January':\n\tcase 'March':\n\tcase 'May':\n\tcase 'July':\n\tcase 'August':\n\t\tresult = 31;\n\t\tbreak;\n\tcase 'September':\n\tcase 'November':\n\tcase 'April':\n\tcase 'June':\n\t\tresult = 30;\n\t\tbreak;\n\tcase 'Febuary':\n\t\tresult = leapYear ? 29: 28;\n\t\tbreak;\n\tdefault:\n\t\treturn 'Must provide a valid Month';\n\t}\n\treturn `There are ${result} days in ${month}`;\n}", "title": "" }, { "docid": "3c6a561a76f996314c98afea85a3ca69", "score": "0.5715181", "text": "function getFrenchMonth(eventMonth){\n\tif (eventMonth == 0){\n\t\treturn \"Janvier\";\n\t}\n\tif (eventMonth == 1){\n\t\treturn \"Fevrier\";\n\t}\n\tif (eventMonth == 2){\n\t\treturn \"Mars\";\n\t}\n\tif (eventMonth == 3){\n\t\treturn \"Avril\";\n\t}\n\tif (eventMonth == 4){\n\t\treturn \"Mai\";\n\t}\n\tif (eventMonth == 5){\n\t\treturn \"Juin\";\n\t}\n\tif (eventMonth == 6){\n\t\treturn \"Juillet\";\n\t}\n\tif (eventMonth == 7){\n\t\treturn \"Aout\";\n\t}\n\tif (eventMonth == 8){\n\t\treturn \"Septembre\";\n\t}\n\tif (eventMonth == 9){\n\t\treturn \"Octobre\";\n\t}\n\tif (eventMonth == 10){\n\t\treturn \"Novembre\";\n\t}\n\telse {\n\t\treturn \"Decembre\";\n\t}\n}", "title": "" }, { "docid": "48fd8a00b7e31222d38edd34e44f2287", "score": "0.5712284", "text": "function isMonthly(){\n\troomQty = document.getElementById(\"roomQty\");\n\tdisableRadios(roomQty);\n\tdisableButton(roomQty);\n\tfor (var i = 0, length = monthlys.length; i < length; i++) {\n \tif (monthlys[i].checked) {\n \trentMonthly = monthlys[i].value;\n \t}\n\t}\n\n\tif (rentMonthly){\n\t\tcalendar.setAttribute(\"style\", \"display: block;\");\n\t\tmonthlyCost(rooms);\n\t}else {\n\t\tdocument.getElementById(\"actualCost\").setAttribute(\"style\", \"display: none;\");\n\t\tcalendar.setAttribute(\"style\", \"display: none;\");\n\t\tdailyCost(rooms);\n\n\t}\n}", "title": "" }, { "docid": "dabde7b78358b3272f8a9055b46910c1", "score": "0.57069224", "text": "function getMonthName(month = 1) {\n var date = new Date(month + '/1/2000');\n return date.toLocaleString(settings.locale, { month: 'long' });\n }", "title": "" }, { "docid": "7b9bdf54ca474f64e71eecefb64385f5", "score": "0.5696791", "text": "GetMonthsInYear() {\n\n }", "title": "" }, { "docid": "88c455a5521dc70f8ef8d57236bc144e", "score": "0.5687952", "text": "function monthReport(month) {\n var monthlyIncome = daysOfTheMonth[month] * selling_price * totalMilkLiters;\n console.log(\"Your income for the month of \" + month + \" is \" + monthlyIncome);\n}", "title": "" }, { "docid": "21d2e7112a04ceeea9ccc09312047342", "score": "0.56849205", "text": "function monthToDays(monthNum){\n switch(monthNum){\n case 1:\n return \"January - 31 days\"\n case 2:\n return \"February - 28 days\"\n case 3:\n return \"March - 31 days\"\n case 4:\n return \"April - 30 days\"\n case 5:\n return \"May - 31 days\"\n case 6:\n return \"June - 30 days\"\n case 7:\n return \"July - 31 days\"\n case 8:\n return \"August - 31 days\"\n case 9:\n return \"September - 30 days\"\n case 10:\n return \"October - 31 days\"\n case 11:\n return \"November - 30 days\"\n case 12:\n return \"December - 31 days\"\n default:\n console.log(\"invalid input\")\n return false\n }\n}", "title": "" }, { "docid": "59a4c7f53b8a6cede80e96a3aaf87b95", "score": "0.567952", "text": "function fecha_mayor(fecha, fecha2){\n var xMes=fecha.substring(5, 7);\n var xDia=fecha.substring(8, 10);\n var xAnio=fecha.substring(0,4);\n var yMes=fecha2.substring(5, 7);\n var yDia=fecha2.substring(8, 10);\n var yAnio=fecha2.substring(0,4);\n \n if (xAnio > yAnio){\n return(true);\n }else{\n if (xAnio == yAnio){\n if (xMes > yMes){\n return(true);\n }\n if (xMes == yMes){\n if (xDia > yDia){\n return(true);\n }else{\n return(false);\n }\n }else{\n return(false);\n }\n }else{\n return(false);\n }\n }\n\t}", "title": "" }, { "docid": "9e9416c316e776651298370bb663681f", "score": "0.56760514", "text": "function formatMonth(numericMonth){\n // returns a formatted string for months\n var months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n return months[numericMonth];\n}", "title": "" }, { "docid": "a84563fa8db1d7d1f79df0a3a784580b", "score": "0.5663375", "text": "function YearandMonth(month1,year1) {\n //var month1 = new Date(date.getMonth()+1+\" \"+date.getDay()+\" \"+date.getFullYear());\n var month2 = new Date(year1,month1+1,date.getDay());\n var mm = month2.getMonth();\n var monthName = month[mm];\n document.getElementById(\"Mname\").innerHTML = monthName;\n var yy = month2.getFullYear();\n document.getElementById(\"Yname\").innerHTML = yy;\n return month2;\n }", "title": "" }, { "docid": "6c7712bdfea133728cb3dce974ea334a", "score": "0.56604713", "text": "function getMonth(month) {\n\treturn months[month - 1];\n}", "title": "" }, { "docid": "f8f80995ba73641cb1fe921fa59c5008", "score": "0.5655967", "text": "function daysInMonth(month, leapYear){\n\n let result;\n\n switch (month) {\n case 'January':\n case 'March':\n case 'May':\n case 'July':\n case 'August':\n case 'October':\n case 'December':\n result = 31;\n break;\n case 'February':\n if(leapYear === true){\n result = 28;\n } else{\n result = 29;\n }\n break;\n case 'April':\n case 'June':\n case 'September':\n case 'November':\n result = 30;\n break;\n default:\n throw new Error('Must provide a valid month.');\n \n }\n return `${month} has ${result} days.`;\n}", "title": "" }, { "docid": "76aa73ace63a608983fbbe46f4943201", "score": "0.56537557", "text": "getDaysLimit(month, year) {\n //check if year is bisiesto\n const yearbase = 2020;\n let isBisisto = false;\n let Month = Number(month);\n let limit = 0;\n for (let i = 0; i < 21; i++) {\n let a = yearbase + i * 4;\n if (a === Number(year)) {\n isBisisto = true;\n }\n }\n //check limit month\n if (Month === 4 || Month === 6 || Month === 9 || month === 11) {\n limit = 30;\n } else if (\n Month === 1 ||\n Month === 3 ||\n Month === 5 ||\n month === 7 ||\n Month === 8 ||\n Month === 10 ||\n Month === 12\n ) {\n limit = 31;\n } else if (Month === 2 && isBisisto === true) {\n limit = 29;\n } else {\n limit = 28;\n }\n\n return limit;\n }", "title": "" }, { "docid": "db8d5b6b823074c9c0111c5e91cd8533", "score": "0.56397", "text": "formatMonth(d) {\n return `${MONTHS[d.getMonth()]}`\n }", "title": "" }, { "docid": "31ee9c8c455bb2d98d4bdca1b948a26d", "score": "0.56368214", "text": "function getMonthName(number)\n{\n switch(number)\n {\n case 0: return 'January';\n case 1: return 'February';\n case 2: return 'March';\n case 3: return 'April';\n case 4: return 'May';\n case 5: return 'June';\n case 6: return 'July';\n case 7: return 'August';\n case 8: return 'September';\n case 9: return 'October';\n case 10: return 'November';\n case 11: return 'December';\n }\n}", "title": "" }, { "docid": "f209ff4845e8609644aa93baa143e318", "score": "0.56251115", "text": "function getShortMonth(number) {\n switch (number) {\n case 1:\n return \"Jan.\";\n break;\n case 2:\n return \"Feb.\";\n break;\n case 3:\n return \"Mar.\";\n break;\n case 4:\n return \"Apr.\";\n break;\n case 5:\n return \"May\";\n break;\n case 6:\n return \"June\";\n break;\n case 7:\n return \"July\";\n break;\n case 8:\n return \"Aug.\";\n break;\n case 9:\n return \"Sept.\";\n break;\n case 10:\n return \"Oct.\";\n break;\n case 11:\n return \"Nov.\";\n break;\n case 12:\n return \"Dec.\";\n break;\n default:\n return \"\";\n break;\n }\n }", "title": "" }, { "docid": "a377097c729d0ccdeff803f49b41c7bb", "score": "0.5621263", "text": "$month (obj, expr) {\n let d = computeValue(obj, expr, null)\n return isDate(d) ? d.getMonth() + 1 : undefined\n }", "title": "" }, { "docid": "28d7336de7b6102e2df1039073a9edd0", "score": "0.5613343", "text": "function yourBirthday(first,second)\n{\n if ((first >=1 && first <= 31) && (second >=1 && second <= 12))\n console.log(\"How did you know?\");\n else if ((second >=1 && second <= 31) && (first >=1 && first <= 12))\n console.log(\"How did you know?\");\n else\n console.log(\"Just Another day ...\");\n}", "title": "" }, { "docid": "db267a49161c3b69f78fda38ace07a60", "score": "0.5611443", "text": "function ka__monthsCaseReplace(m, format) {\n var months = {\n 'nominative': 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'),\n 'accusative': 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_')\n },\n nounCase = (/D[oD] *MMMM?/).test(format) ?\n 'accusative' :\n 'nominative';\n return months[nounCase][m.month()];\n }", "title": "" }, { "docid": "e2b68354b9c6b3d6033d6d59e7d07d8d", "score": "0.56114286", "text": "function toShortMonthName(month) {\n\t switch (parseInt(month)) {\n\t case 1:\n\t return 'JAN';\n\t case 2:\n\t return 'FEB';\n\t case 3:\n\t return 'MAR';\n\t case 4:\n\t return 'APR';\n\t case 5:\n\t return 'MAY';\n\t case 6:\n\t return 'JUN';\n\t case 7:\n\t return 'JULY';\n\t case 8:\n\t return 'AUG';\n\t case 9:\n\t return 'SEPT';\n\t case 10:\n\t return 'OCT';\n\t case 11:\n\t return 'NOV';\n\t case 12:\n\t return 'DEC';\n\t default:\n\t return '';\n\t }\n\t}", "title": "" } ]
ad2ec03bb87e8d4ef579db6faa040c38
determine if the label should be displayed inline
[ { "docid": "e723778f0efba773af21f127f86f6232", "score": "0.77655774", "text": "get _inline() {\n return this.label !== undefined;\n }", "title": "" } ]
[ { "docid": "dbd9f61942bf95c4d8bed96812e3a452", "score": "0.66200835", "text": "isInline() {\n return this._isInline\n }", "title": "" }, { "docid": "6888a980c2189296a629c84e3085cdb9", "score": "0.6574952", "text": "render() {\n return this.variant === VARIANT$2.LABEL_HIDDEN ? labelHidden : standard;\n }", "title": "" }, { "docid": "10b2e7530dfea5101cf6c74be0d851bd", "score": "0.6342485", "text": "get labelTemplate() {\n return this.label && this.isSlotEmpty ? html `${this.label}` : undefined;\n }", "title": "" }, { "docid": "082c9e29357a4b470d125a45a886004a", "score": "0.6244601", "text": "function isLabelBefore() {\n if (options.hash.labelAfter) {\n return false;\n } else if (inputType == RADIO || inputType == CHECKBOX) {\n return false;\n } else {\n return true;\n }\n }", "title": "" }, { "docid": "c45640ea0043e501911a905a4b9dce67", "score": "0.6116405", "text": "getLabelVisible(render, temp, i, label, length, highPos, lowPos) {\n const labelVisible = label.visible.join().toLowerCase();\n if (temp.markerPosition > this.axisHeight) {\n render = render || (labelVisible.indexOf('negative') > -1);\n }\n if (i === 0) {\n render = render || (labelVisible.indexOf('start') > -1);\n }\n else if ((i === (length - 1))) {\n render = render || (labelVisible.indexOf('end') > -1);\n }\n if (temp.markerPosition === highPos) {\n render = render || (labelVisible.indexOf('high') > -1);\n }\n else if (temp.markerPosition === lowPos) {\n render = render || (labelVisible.indexOf('low') > -1);\n }\n if (label.visible.join().toLowerCase().indexOf('none') > -1) {\n render = false;\n }\n return render;\n }", "title": "" }, { "docid": "f5e0a75415ca8436337533c075fcb159", "score": "0.6109974", "text": "get shouldLabelFloat() {\n return this._panelOpen || !this.empty;\n }", "title": "" }, { "docid": "bc4143c3e2201236e76b531d31d51fb2", "score": "0.6098434", "text": "get shouldLabelFloat() {\n return this._panelOpen || !this.empty;\n }", "title": "" }, { "docid": "f7ffb8ba02724ce99c135bc021660db7", "score": "0.60741603", "text": "function displayLabel(d) {\n if (d.active === false) return 'none';\n if (typeof d.fisheye === typeof undefined) return 'none';\n\n if (transform.k > minZoomLevelLabel)\n return 'block';\n else\n return 'none';\n }", "title": "" }, { "docid": "39a95a17e39306a3ea0e4eeaf966b66a", "score": "0.60721827", "text": "function toggleLabelVisibility(displayAs)\r\n{\r\n var labelFieldIsVisible = !( _ElementLabel.disabled == \"true\");\r\n\r\n if (displayAs != HIDDENFIELD && !labelFieldIsVisible)\r\n { // if non-hidden field & non-visible label field\r\n _ElementLabel.setAttribute(\"disabled\",\"false\") // then make label field visible\r\n _ElementLabel.setAttribute(\"value\",_ColumnNames.getRowValue().label); // and set value of it \r\n\r\n }\r\n else if (displayAs == HIDDENFIELD && labelFieldIsVisible)\r\n { // if hidden field\r\n _ElementLabel.setAttribute(\"value\",\"\"); // then set value field to empty string\r\n _ElementLabel.setAttribute(\"disabled\",\"true\"); // and make it non-editable\r\n }\r\n}", "title": "" }, { "docid": "25dd08aa6bed8e31ef3380b3f9177a40", "score": "0.6038326", "text": "get shouldLabelFloat() {\n return this.focused || !this.empty;\n }", "title": "" }, { "docid": "015789a97ed4f32bf7633d67f551a9f7", "score": "0.60293764", "text": "getLabel() {\n return '';\n }", "title": "" }, { "docid": "bce5b7bc700727cb84038f0b0ea784ee", "score": "0.6020939", "text": "get shouldLabelFloat() {\n if (this._isNativeSelect) {\n // For a single-selection `<select>`, the label should float when the selected option has\n // a non-empty display value. For a `<select multiple>`, the label *always* floats to avoid\n // overlapping the label with the options.\n const selectElement = this._elementRef.nativeElement;\n const firstOption = selectElement.options[0];\n // On most browsers the `selectedIndex` will always be 0, however on IE and Edge it'll be\n // -1 if the `value` is set to something, that isn't in the list of options, at a later point.\n return this.focused || selectElement.multiple || !this.empty ||\n !!(selectElement.selectedIndex > -1 && firstOption && firstOption.label);\n }\n else {\n return this.focused || !this.empty;\n }\n }", "title": "" }, { "docid": "6da83d20949f8cc1429b14b877d305f5", "score": "0.59961045", "text": "get shouldLabelFloat() {\n if (this._isNativeSelect) {\n // For a single-selection `<select>`, the label should float when the selected option has\n // a non-empty display value. For a `<select multiple>`, the label *always* floats to avoid\n // overlapping the label with the options.\n const selectElement = this._elementRef.nativeElement;\n const firstOption = selectElement.options[0];\n // On most browsers the `selectedIndex` will always be 0, however on IE and Edge it'll be\n // -1 if the `value` is set to something, that isn't in the list of options, at a later point.\n return this.focused || selectElement.multiple || !this.empty ||\n !!(selectElement.selectedIndex > -1 && firstOption && firstOption.label);\n }\n else {\n return this.focused || !this.empty;\n }\n }", "title": "" }, { "docid": "b000cdb64b574a30e51101703566ca0f", "score": "0.590387", "text": "renderLabel(selective, data) {\n return ''\n }", "title": "" }, { "docid": "f796feff73afb5ada37ce1ff29117698", "score": "0.58968115", "text": "async hasFieldLabel(label) {\n let labelText = await this.getLabel();\n return labelText.indexOf(label) !== -1;\n }", "title": "" }, { "docid": "6b8cb9805f2f6a3c2ed46e709c9280b1", "score": "0.5887654", "text": "function getLabel(){\n return _data.TEXT ? _data.TEXT : \"\";\n }", "title": "" }, { "docid": "05d2b9b3cf98748635525966c1a11278", "score": "0.5801144", "text": "function showLinkLabel(e) {\n var label = e.subject.findObject(\"LABEL\");\n if (label !== null) label.visible = (e.subject.fromNode.data.figure === \"Diamond\");\n }", "title": "" }, { "docid": "4d681884ee98d93f321fd4c6eea40372", "score": "0.5793295", "text": "function showLinkLabel(e) {\n var label = e.subject.findObject(\"LABEL\");\n //console.log(e.subject.fromNode.data);\n // if (label !== null) label.visible = (e.subject.fromNode.data.figure ===\n // \"Diamond\");\n if (label !== null) {\n label.visible = true;\n }\n }", "title": "" }, { "docid": "81ac5521f57030992ca99a5e6f0f92d2", "score": "0.57880086", "text": "function displayRender(label) {\n return label[label.length - 1];\n}", "title": "" }, { "docid": "afcf8199459e262c7e4e95345c0c24d5", "score": "0.57873476", "text": "get _canLabelFloat() { return this.floatLabel !== 'never'; }", "title": "" }, { "docid": "afcf8199459e262c7e4e95345c0c24d5", "score": "0.57873476", "text": "get _canLabelFloat() { return this.floatLabel !== 'never'; }", "title": "" }, { "docid": "8017e05833188c9d1ff1929c6db9f7c3", "score": "0.57761097", "text": "get subLabelTemplate() {\n return this.subLabel && this.isSlotEmpty ? html `<div part=\"sub-label\">${this.subLabel}</div>` : undefined;\n }", "title": "" }, { "docid": "5634855cc274d796e665372b791eaa32", "score": "0.5762998", "text": "function check_for_label() {\n var label_id = $('.mark-added').data('label'),\n label_name = $('.mark-added').data('label-name');\n $('#currLabel').addClass('label-'+label_id).text(label_name);\n }", "title": "" }, { "docid": "2cd4c6d1307878a8398477ee31157628", "score": "0.575855", "text": "_showLabelForProperty (prop) {\n return true\n }", "title": "" }, { "docid": "ea36f713fcf741b1966d97aa66362402", "score": "0.5743935", "text": "function price_label(price) {\n\t\tif (!price_texts[ price ] || !price_texts[ price ].label)\n\t\t\treturn false;\n\t\t\n\t\treturn price_texts[ price ].label;\n\t}", "title": "" }, { "docid": "c7039e9c97e7f55fc1ea12bc736571da", "score": "0.5735258", "text": "function showLinkLabel(e) {\n var label = e.subject.findObject(\"LABEL\");\n if (label !== null) label.visible = (e.subject.fromNode.data.figure === \"Diamond\");\n }", "title": "" }, { "docid": "f175812048ceedfaf267f53a97125a58", "score": "0.5722687", "text": "function visLabelSameWidth() {\n var ylabel_width = $(\"#timeline .vis-labelset .vis-label\").width() + \"px\";\n //$(\"#confidence\")[0].childNodes[0].childNodes[2].style.left = ylabel_width;\n //$(\"#confidence .vis-content\")[1].style.width = ylabel_width;\n //$(\"#confidence .vis-content.vis-data-axis\").style.width = ylabel_width;\n\n var w1 = $(\"#confidence .vis-content .vis-data-axis\").width();\n var w2 = $(\"#timeline .vis-labelset .vis-label\").width();\n\n $(\"#confidence\")[0].childNodes[0].childNodes[2].style.display = 'none';\n\n if (w2 > w1) {\n $(\"#confidence .vis-content\")[1].style.width = ylabel_width;\n }\n else {\n $(\"#timeline .vis-labelset .vis-label\").width(w1 + \"px\");\n }\n}", "title": "" }, { "docid": "505a0520da917c00ca86864d7c1ded2d", "score": "0.56900644", "text": "function showLinkLabel(e) {\n var label = e.subject.findObject(\"LABEL\");\n if (label !== null) label.visible = (e.subject.fromNode.data.figure === \"Diamond\");\n}", "title": "" }, { "docid": "08c5aaecf9d34420c607b252bdd66cb2", "score": "0.5672854", "text": "function isLabelWithInternallyDisabledControl(element) {\n if (!(0, isElementType_1.isElementType)(element, 'label')) {\n return false;\n }\n\n const control = element.control;\n return Boolean(control && element.contains(control) && (0, isDisabled_1.isDisabled)(control));\n }", "title": "" }, { "docid": "8e3c2a3da7e0bb0a187a0768efeee387", "score": "0.5671488", "text": "renderLabel() {\n if (this.props.label === undefined) {\n return '';\n } else {\n return <Label id={ this.props.id }>{ this.props.label }</Label>;\n }\n }", "title": "" }, { "docid": "9cc26fe4625dd59c140ec0ab7adb1b8f", "score": "0.56459665", "text": "showMainLabel() {\n this.linkLabel.show();\n // Redraw the Link to make sure that the label ends up in the correct spot\n this.draw();\n }", "title": "" }, { "docid": "bf7edfc2dcc87c4413f10d0cd28c387c", "score": "0.56339467", "text": "function logicalRemoveLabel () {\n if (typeof this.removeLabel === 'boolean') {\n return 'Remove'\n }\n return this.removeLabel\n}", "title": "" }, { "docid": "dee57c29acfb722f737de3ff5d88da96", "score": "0.5597031", "text": "function onInline(val) {\r var itm = document.getElementById(val);\r var txt = document.getElementById(val+\"text\");\r txt.style.display=\"inline\";\r}", "title": "" }, { "docid": "685ccd35337bea8797aa93f29bba32d3", "score": "0.55744725", "text": "async hasFieldLabels(labelArray){\n let labelText = await this.getLabel();\n return labelText === labelArray[0];\n }", "title": "" }, { "docid": "32bfa3b2dfcf22aaefb06c1b424e8fc9", "score": "0.55727977", "text": "function ShowInlineElement(el, show) {\n el.style.display = show ? \"inline\" : \"none\";\n}", "title": "" }, { "docid": "d6b24eac184976c0057a6deb9ddf98a5", "score": "0.555316", "text": "function labelVisible(d) {\n return d.y1 <= (width/2) && d.y0 >= 0 && d.x1 - d.x0 > 16;\n }", "title": "" }, { "docid": "b25b14bc41dbf64b076ce1d279571500", "score": "0.5550077", "text": "renderInline() {\n const { yLabel, yValue, labelFill, valueFill, fontSize, fontFamily } = this.props;\n return (React.createElement(\"tspan\", { onClick: this.handleClick, fontFamily: fontFamily, fontSize: fontSize },\n React.createElement(ToolTipTSpanLabel, { fill: labelFill },\n yLabel,\n \":\\u00A0\"),\n React.createElement(\"tspan\", { fill: valueFill },\n yValue,\n \"\\u00A0\\u00A0\")));\n }", "title": "" }, { "docid": "c34398ec153b358f1e1fc5c57c688dd7", "score": "0.5549078", "text": "function showTextLabel(id)\n{\n\tdocument.getElementById(id).parentElement.parentElement.style.display = '';\n}", "title": "" }, { "docid": "7aaf8b2ccb446bba812840cb57dc6a6c", "score": "0.55434734", "text": "findDatalabelVisibility() {\n for (const series of this.series) {\n if (series.dataLabel.visible) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "90367c01dc90b249b2ce81b2c81b790e", "score": "0.5528345", "text": "function isLabelExplicit(label) {\n return label != null && label !== \"auto\";\n }", "title": "" }, { "docid": "18e22f393f23a94e59aadba4fa35ff86", "score": "0.5526707", "text": "function _detect_lbl(item) {\n var res_lbl = \"None\";\n if (\"data_property\" in item) {\n //the att which represent a lbl\n var arr_lbls = [\"name\",\"title\",\"value\"];\n for (var i = 0; i < arr_lbls.length; i++) {\n if (arr_lbls[i] in item[\"data_property\"]) {\n res_lbl = item[\"data_property\"][arr_lbls[i]];\n }\n }\n }\n return res_lbl;\n }", "title": "" }, { "docid": "a61778ba5df7c708043a498194eff170", "score": "0.551555", "text": "@readOnly\n @computed('cellConfig.renderer.label', 'value')\n linkLabel (label, value) {\n return label || value\n }", "title": "" }, { "docid": "26aaf7a435dd0bedbe3743d095246ca9", "score": "0.5505897", "text": "getLabel() {\n return this._text ? (this._text.nativeElement.textContent || '') : '';\n }", "title": "" }, { "docid": "26aaf7a435dd0bedbe3743d095246ca9", "score": "0.5505897", "text": "getLabel() {\n return this._text ? (this._text.nativeElement.textContent || '') : '';\n }", "title": "" }, { "docid": "c6bef726aa7dc7230a97d0c51b936a92", "score": "0.55041057", "text": "get labelTemplate() {\n return this.__labelTemplate.get();\n }", "title": "" }, { "docid": "c6bef726aa7dc7230a97d0c51b936a92", "score": "0.55041057", "text": "get labelTemplate() {\n return this.__labelTemplate.get();\n }", "title": "" }, { "docid": "e47c8ab3f1205ad5192cad2ed4009c14", "score": "0.55001837", "text": "onLabelsShowHideBtnClick() {\n if (this.config.showLabels = !this.config.showLabels) {\n this.labelGroup.classed('display_none', false);\n } else { // show labels\n this.labelGroup.classed('display_none', true);\n }\n }", "title": "" }, { "docid": "a01357f26085d3f0f9bf3cb0f5d93c37", "score": "0.5496403", "text": "get inline() {\n return this._inline;\n }", "title": "" }, { "docid": "d6af6e5b0f34e9fb0562713f27869300", "score": "0.5488696", "text": "getLabel() {\n return this._text ? (this._text.nativeElement.textContent || '') : '';\n }", "title": "" }, { "docid": "d6af6e5b0f34e9fb0562713f27869300", "score": "0.5488696", "text": "getLabel() {\n return this._text ? (this._text.nativeElement.textContent || '') : '';\n }", "title": "" }, { "docid": "323d14cc533fd730ac21d75fb3ffed81", "score": "0.5476601", "text": "function logicalAddLabel () {\n if (this.classification === 'file') {\n return this.addLabel === true ? `+ Add ${cap(this.type)}` : this.addLabel\n }\n if (typeof this.addLabel === 'boolean') {\n const label = this.label || this.name\n return `+ ${typeof label === 'string' ? label + ' ' : ''} Add`\n }\n return this.addLabel\n}", "title": "" }, { "docid": "e464d718b5d89c250aea44427b0d813a", "score": "0.5447283", "text": "get label() {\n\t\treturn this.nativeElement ? this.nativeElement.label : undefined;\n\t}", "title": "" }, { "docid": "e464d718b5d89c250aea44427b0d813a", "score": "0.5447283", "text": "get label() {\n\t\treturn this.nativeElement ? this.nativeElement.label : undefined;\n\t}", "title": "" }, { "docid": "321b87adeab4859fa34d9d806330b83b", "score": "0.54421633", "text": "function canIUseLabel(s) {\n \tif(s === \"y\") return \"Yes\";\n \tif(s === \"p\") return \"No (Polyfill exits)\";\n \tif(s === \"a\") return \"Partially\";\n \tif(s === \"n\") return \"No\";\n \tif(s === \"u\") return \"Unknown\";\n \tif(s === \"x\") return \"Requires prefix\";\n \treturn \"\";\n }", "title": "" }, { "docid": "10cbf86e36a4183b7ab8ab79e0b45682", "score": "0.5438959", "text": "get label() {\n return this.getAttribute(\"label\")\n }", "title": "" }, { "docid": "27a98c54618ee1774f4dca9313041262", "score": "0.54353285", "text": "function showLabel(btn, field) {\n if (btn.toggle === 1) {\n if (!field.input) {\n field.CreateInput();\n }\n field.label.className = \"hidden\";\n field.input.className = \"field_input\";\n field.input.focus();\n } else {\n field.input.className = \"hidden\";\n field.label.className = \"field_label\";\n }\n}", "title": "" }, { "docid": "906a84953fab3a3a8b02f6b11d327b2e", "score": "0.5412287", "text": "get label() {}", "title": "" }, { "docid": "3acfe24bc0947b21632ad199b54aae8c", "score": "0.54106724", "text": "hideMainLabel() {\n this.linkLabel.hide();\n }", "title": "" }, { "docid": "10df7e1cb1f1daf325ca3475c2cd0544", "score": "0.54019475", "text": "getLabelText(optionsLabel) {\n return defined(optionsLabel.formatter) ?\n optionsLabel.formatter\n .call(this) :\n optionsLabel.text;\n }", "title": "" }, { "docid": "4ad85e235b408fe70f142683b3e3fb37", "score": "0.5391491", "text": "get inline() {\n return this._inline;\n }", "title": "" }, { "docid": "4ad85e235b408fe70f142683b3e3fb37", "score": "0.5391491", "text": "get inline() {\n return this._inline;\n }", "title": "" }, { "docid": "c294db2ae392e3fd391316487fad79a7", "score": "0.5372156", "text": "get floatLabel() {\n return this.appearance !== 'legacy' && this._floatLabel === 'never' ? 'auto' : this._floatLabel;\n }", "title": "" }, { "docid": "5b8873195d633fa076e1e608567ac8b8", "score": "0.5365061", "text": "getLabelSuffix() {\n if (this.props.showRequiredMark) {\n return '\\u00a0*';\n } else if (this.props.showRequiredText) {\n return '\\u00a0(required)';\n } else if (this.props.showOptionalText) {\n return '\\u00a0(optional)';\n } else {\n return '';\n }\n }", "title": "" }, { "docid": "ebc3d4127a54f5f6cf951fc8a83d1d6f", "score": "0.5360887", "text": "function toggleDisplayInline(action, name){\r\n\r\n var style = (action == \"show\") ? \"inline\" : \"none\";\r\n var span;\r\n\r\n try {\r\n\tspan = document.getElementById(name);\r\n\tspan.style.display = style;\r\n\r\n\tspan = document.getElementById(name + \"_hide\");\r\n\tspan.style.display = style;\r\n\r\n\tspan = document.getElementById(name + \"_show\");\r\n\t/* Bug# 2945 Fix: style changes to \"block\" previously it is \"inline\". -->*/\r\n\tspan.style.display = (style == \"none\") ? \"inline\" : \"none\";\r\n } catch ( errMsg ) {\r\n\talert( \"toggleDisplay: failure! -- \" + errMsg );\r\n\treturn false;\r\n }\r\n}", "title": "" }, { "docid": "88cffb416fad99fab8d833381d6c6e49", "score": "0.5356876", "text": "function eppLabelify() {\n jQuery('html.js #respond #commentform input[type=\"text\"], html.js #respond #commentform textarea').each(function(){\n if (jQuery(this).attr('value') == '') {\n jQuery(this).labelify({\n text: \"label\"\n });\n }\n });\n jQuery('html.js #respond #commentform label').remove();\n}", "title": "" }, { "docid": "b31d550c5118bce4d21a6698fe423b9f", "score": "0.53329104", "text": "displayTitle(){this.domTitle.setAttribute('display','inline');}", "title": "" }, { "docid": "e39293cc63e6801af8cf378dc120b735", "score": "0.53275335", "text": "isDataLabelVisible() {\n let isVisible = false;\n for (let i = 0; i < this.layers.length; i++) {\n if (this.layers[i].dataLabelSettings.visible) {\n isVisible = true;\n break;\n }\n }\n return isVisible;\n }", "title": "" }, { "docid": "5ad915a1e326e3c4ddd84f0da43a3bdb", "score": "0.5324483", "text": "getLabel() {\n var _a, _b;\n const clone = this._elementRef.nativeElement.cloneNode(true);\n const icons = clone.querySelectorAll('mat-icon, .material-icons');\n // Strip away icons so they don't show up in the text.\n for (let i = 0; i < icons.length; i++) {\n const icon = icons[i];\n (_a = icon.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(icon);\n }\n return ((_b = clone.textContent) === null || _b === void 0 ? void 0 : _b.trim()) || '';\n }", "title": "" }, { "docid": "82b5654103fe3b4958d4ef0b119a5974", "score": "0.53242296", "text": "function isLabeledBy(node, labelName) {\n return !!ts.findAncestor(node.parent, function (owner) { return !ts.isLabeledStatement(owner) ? \"quit\" : owner.label.escapedText === labelName; });\n }", "title": "" }, { "docid": "7d6ff08b99b0694e93de2fbe8534cb61", "score": "0.532099", "text": "getLabel() {\n var _a;\n // TODO cloning the tree may be expensive; implement a better method\n // we know that the current node is an element type\n const clone = this._elementRef.nativeElement.cloneNode(true);\n removeIcons(clone);\n return ((_a = clone.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || '';\n }", "title": "" }, { "docid": "c152888be2f69e0779f60817241f9df8", "score": "0.531885", "text": "generateLabel() {\n if (this.props.labelId || this.props.children) {\n return (React.createElement(\"label\", { className: classNames(this.props.managedClasses.toggle_label), id: this.props.labelId, htmlFor: this.props.inputId }, this.props.children));\n }\n }", "title": "" }, { "docid": "72b12836d3d1ffd52af580af206346ec", "score": "0.5316021", "text": "get labelPosition() {\n return this._labelPosition || (this.radioGroup && this.radioGroup.labelPosition) || 'after';\n }", "title": "" }, { "docid": "7b7dddfab244b7aadb507bac8b92567d", "score": "0.53159535", "text": "get floatLabel() {\n return this.appearance !== 'legacy' && this._floatLabel === 'never' ? 'auto' : this._floatLabel;\n }", "title": "" }, { "docid": "866a7014768b73caa42bd7a1c8c7ab1d", "score": "0.53127295", "text": "function set_label_visibility() {\n var x = $old_div.offset().left + get_target_width($old_div);\n\n // Use css visibility instead of show()/hide() because the latter will\n // make offset() return 0.\n if (x < $old_label.offset().left + $old_label.width() + 50) {\n $old_label.css(\"visibility\", \"hidden\");\n } else {\n $old_label.css(\"visibility\", \"visible\");\n }\n\n // Can't use $new_label.offset().left because during transitions, it\n // gives the current value instead of target value. We need to compute\n // the target left position.\n var new_label_left = $new_div.offset().left + get_target_width($new_div) -\n $new_label.width();\n if (x > new_label_left - 50) {\n $new_label.css(\"visibility\", \"hidden\");\n } else {\n $new_label.css(\"visibility\", \"visible\");\n }\n }", "title": "" }, { "docid": "40150c48bf2d425ae83f3902abdc1271", "score": "0.5306866", "text": "getLabel() {\n if (this.schema.title) {\n return this.schema.title;\n }\n if (this.label) {\n return this.label;\n }\n return \"\";\n }", "title": "" }, { "docid": "ccfeafacb2b45b89ede2a0992cb5ea5e", "score": "0.52842087", "text": "function setLabel(){\n if( this.$label.length > 0 && $listBtn.length > 0 ){\n this.$label.html( $listBtn.html() );\n }\n }", "title": "" }, { "docid": "b3c535b428074fc08847b514c2ebf0df", "score": "0.5280794", "text": "_setLabelSize() {\n\t\t// if no value in input\n\t\tif ( ! this._input.value) {\n\t\t\t// reset the label size\n\t\t\t__style(this._label, {\n\t\t\t\topacity : 1,\n\t\t\t\twidth : ''\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\t// get the content width\n\t\tconst width = __textWidth(this._input);\n\t\t// calculate the difference\n\t\tlet diff = this._input.offsetWidth - width - this._labelPaddingLeft;\n\n\t\t// add the padding right if is a background\n\t\tif (this._labelBackground) {\n\t\t\tdiff -= this._inputPaddingRight;\n\t\t}\n\n\t\t// set the label size\n\t\tif (diff <= this._labelPaddingLeft + this._labelPaddingRight + 12) {\n\t\t\t// hide the label\n\t\t\t__style(this._label, {\n\t\t\t\topacity : 0\n\t\t\t});\n\t\t\t// this._label.style.opacity = 0;\n\t\t} else if (diff < this._labelWidth) {\n\t\t\t__style(this._label, {\n\t\t\t\topacity : 1,\n\t\t\t\twidth : diff + 'px'\n\t\t\t});\n\t\t} else {\n\t\t\t__style(this._label, {\n\t\t\t\twidth : null\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "fc10a0f67353dba2ecbfbf63c52aed8a", "score": "0.5280369", "text": "function check(v,label){\r\n\tif(v){\r\n\t\tstr = \":=========:\"+label+\"::1\";\r\n\t} else {\r\n\t\tstr = \":=========:\"+label+\"::0\";\r\n\t}\r\n\treturn str;\r\n}", "title": "" }, { "docid": "1f436cb7f5c600d5d013ae23e0ec48cc", "score": "0.5280175", "text": "get labelHorizontalAlignment() {\n return this.i.ax;\n }", "title": "" }, { "docid": "8f23d248864f34c5b404bf82a4188e15", "score": "0.52740943", "text": "get showDataLabels() {\n return this._bu(32);\n }", "title": "" }, { "docid": "f518e16d7fa6706ce6d8ad90226fb221", "score": "0.52732784", "text": "function getInlineBlock()\n\t\t{\n\t\t\tif(isIE7prev())\n\t\t\t{\n\t\t\t\treturn \"inline\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \"inline-block\";\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "e0a6afed1f89fef7bec148785de18459", "score": "0.5269698", "text": "function labelVisible(d) {\n return d.y1 <= 3 && d.y0 >= 1 && (d.y1 - d.y0) * (d.x1 - d.x0) > 0.03;\n }", "title": "" }, { "docid": "4d454b7a3107b63332def44d046d306b", "score": "0.52694815", "text": "static createInInputWidgetUnderLabel(container) {\n internal.createInVersionCheck(container.model, Text.structureTypeName, { end: \"7.17.0\" });\n return internal.instancehelpers.createElement(container, Text, \"label\", false);\n }", "title": "" }, { "docid": "026d5a5572abe625d284416d8bd92147", "score": "0.5267809", "text": "get labeled() {\n return this.__labeled.get();\n }", "title": "" }, { "docid": "b5a833c7175925526e7046f434b98fb2", "score": "0.5264807", "text": "function labelTest() {\n var testedItem = new Item('Test one plus one')\n if ( assert.isTrue(testedItem.name === 'Test one plus one')) {\n return `${testedItem.name} passes`\n }\n}", "title": "" }, { "docid": "a190d727b4643a204ad4954306dca7a0", "score": "0.52602434", "text": "static showInlineBlockStuffs(){\n\t\tstuff.style.display = \"inline-block\";\n\t}", "title": "" }, { "docid": "ba8b83bc83f88a79a59238932a4c6865", "score": "0.5259206", "text": "_stringLabel() {\n return this.label instanceof MatStepLabel ? null : this.label;\n }", "title": "" }, { "docid": "7cfea9298259b4217bbcd52f1f2a0d9a", "score": "0.5249317", "text": "function isLabeledBy(node, labelName) {\n for (var owner = node.parent; owner.kind === 210 /* LabeledStatement */; owner = owner.parent) {\n if (owner.label.text === labelName) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "0630a80cf96d34614209213f3a4647a6", "score": "0.52486926", "text": "function isLabeledBy(node, labelName) {\n for (var owner = node.parent; owner.kind === 221 /* LabeledStatement */; owner = owner.parent) {\n if (owner.label.text === labelName) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "dd25c697de64af44c5aa7b086fcf77df", "score": "0.5231037", "text": "get labelHorizontalAlignment() {\n return this.i.hm;\n }", "title": "" }, { "docid": "3221b2c53984059c67d826130e9b11ab", "score": "0.52151656", "text": "@readOnly\n @computed('renderLabel')\n addLabel (renderLabel) {\n return `Add ${Ember.String.singularize(renderLabel).toLowerCase()}`\n }", "title": "" }, { "docid": "90e1bd2e42f1a24e8830664ae025d236", "score": "0.52079266", "text": "label() {\n if (_.has(this.labelMap, this.properties.capture.textValue)) {\n return this.labelMap[this.properties.capture.textValue];\n } else {\n return `group #${this.state.groupCounter++}`;\n }\n }", "title": "" }, { "docid": "a4678673486902f3c5ffc6ed946f5169", "score": "0.5206113", "text": "getLabel() {\n return this.label;\n }", "title": "" }, { "docid": "63d3a0f62601e840fe2625eb5b83bfd7", "score": "0.51942366", "text": "get label() {\n return this.getLabel();\n }", "title": "" }, { "docid": "135351abfc56d83063d6e8450140e418", "score": "0.5188791", "text": "_handleLabelOnlyNoValue() {\n if (this.labelOnly) {\n if (isEmpty(this.internalSelectedList)) {\n this.set('inputValue', this.noValueLabel);\n }\n }\n }", "title": "" }, { "docid": "9a737560af9ccd40ad4b3a9ab40a572d", "score": "0.5184268", "text": "function label(caption,y) {\n return first(function(x){return LABEL(SPAN(caption),x);}, y);\n}", "title": "" }, { "docid": "e4b8150d465492421fca84840be50ce0", "score": "0.5174161", "text": "_setFieldAttributes() {\n const defaultLabel = StorageGetter(this.field, ['children', 'value', 'model', 'label'], '');\n const entryLabel = this.field.entries[0].name;\n if (this.field && this.field.items) {\n Object.keys(this.field.items).map((dataKey, index) => {\n const item = this.field.items[dataKey];\n if (this.field.multiple) {\n item.config.value.label = this.dom.session[dataKey].display.label;\n }\n else {\n item.config.value.label = entryLabel ? entryLabel : defaultLabel;\n }\n });\n }\n return true;\n }", "title": "" }, { "docid": "32d138400d037bc50cfe25a78c279148", "score": "0.51726204", "text": "function Label(props) {\r\n return <div className=\"input-group-prepend\">\r\n <label className=\"input-group-text\" htmlFor={props.htmlForProp}>{props.labelText}</label>\r\n</div>\r\n}", "title": "" }, { "docid": "ad00b8dfdb8ba6cd85a73836244b3252", "score": "0.5172349", "text": "function valueIsEmpty(label) {\r\n return label && label !== \"\";\r\n}", "title": "" }, { "docid": "ea4220834b5f18afe699869934f40674", "score": "0.517063", "text": "function getErrorLabel(errorMsg) {\n return '<label class=\"error\" style=\"display: block;\">' + errorMsg + '</label>';\n}", "title": "" } ]
7bc8178c8a37051bcb72ed5df0cab35e
Converts a decimal to a hex value
[ { "docid": "179125b7bc5bdedcb8b69bdc030d4755", "score": "0.7454385", "text": "function convertDecimalToHex(d) {\n\t return Math.round(parseFloat(d) * 255).toString(16);\n\t}", "title": "" } ]
[ { "docid": "b023ab123e2993173c14d4852316a1dc", "score": "0.773405", "text": "function decimalToHex(value) {\r\n value = parseInt(value).toString(16);\r\n if (value == null) {\r\n return null;\r\n }\r\n if (value.length == 1) {\r\n value = '0' + '' + value;\r\n }\r\n return value;\r\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "a912bc1ac3b3190610b6eae7dd5a9ccb", "score": "0.75647104", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "8916ece030536b796ac9a19e0a8e5ce6", "score": "0.75614345", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }", "title": "" }, { "docid": "bae2507efa718b007b69722d50e8fe48", "score": "0.75526536", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "89b3e639ab5b2370c65c976ae538f208", "score": "0.75447905", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }", "title": "" }, { "docid": "919a3aacd5b9755a019ff648c8f1f814", "score": "0.7538809", "text": "function convertDecimalToHex(d) {\n\t return Math.round(parseFloat(d) * 255).toString(16);\n\t }", "title": "" }, { "docid": "dc7747fe350af39023f4255403631731", "score": "0.75338763", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }", "title": "" }, { "docid": "dc7747fe350af39023f4255403631731", "score": "0.75338763", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }", "title": "" }, { "docid": "b3b7e6aeb39e9c0c0405a693f728aeed", "score": "0.7517652", "text": "function convertDecimalToHex(d) {\n\t\treturn Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "b3b7e6aeb39e9c0c0405a693f728aeed", "score": "0.7517652", "text": "function convertDecimalToHex(d) {\n\t\treturn Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "b3b7e6aeb39e9c0c0405a693f728aeed", "score": "0.7517652", "text": "function convertDecimalToHex(d) {\n\t\treturn Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "b3b7e6aeb39e9c0c0405a693f728aeed", "score": "0.7517652", "text": "function convertDecimalToHex(d) {\n\t\treturn Math.round(parseFloat(d) * 255).toString(16);\n}", "title": "" }, { "docid": "0517c3ea43bbb4cbbb9bb96cf49db83a", "score": "0.7512696", "text": "function convertDecimalToHex(d) {\n\t return Math.round(parseFloat(d) * 255).toString(16);\n\t }", "title": "" }, { "docid": "95c647e5f2b44c9ea5ed4f35fe52524a", "score": "0.75077146", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }", "title": "" }, { "docid": "95c647e5f2b44c9ea5ed4f35fe52524a", "score": "0.75077146", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }", "title": "" }, { "docid": "95c647e5f2b44c9ea5ed4f35fe52524a", "score": "0.75077146", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }", "title": "" }, { "docid": "0efeec41dc525e5890bb3e6c3a959a7b", "score": "0.7507165", "text": "function gethex(decimal) {\n\treturn \"%\" + hexchars.charAt(decimal >> 4) + hexchars.charAt(decimal & 15);\n}", "title": "" }, { "docid": "7bfac733fb59843f82e46671da2b3167", "score": "0.75023335", "text": "function to_hex(dec) {\n var hexadecimal = new Array(\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\"),\n hexaDec = Math.floor(dec / 16),\n hexaUni = dec - (hexaDec * 16);\n return (hexadecimal[hexaDec] + hexadecimal[hexaUni]);\n }", "title": "" }, { "docid": "b2b8dadbbe8150821449d2097adaa4d3", "score": "0.7474675", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }", "title": "" }, { "docid": "b2b8dadbbe8150821449d2097adaa4d3", "score": "0.7474675", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }", "title": "" }, { "docid": "b2b8dadbbe8150821449d2097adaa4d3", "score": "0.7474675", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }", "title": "" }, { "docid": "b2b8dadbbe8150821449d2097adaa4d3", "score": "0.7474675", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }", "title": "" }, { "docid": "b2b8dadbbe8150821449d2097adaa4d3", "score": "0.7474675", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }", "title": "" }, { "docid": "b2b8dadbbe8150821449d2097adaa4d3", "score": "0.7474675", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }", "title": "" }, { "docid": "b2b8dadbbe8150821449d2097adaa4d3", "score": "0.7474675", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }", "title": "" }, { "docid": "b2b8dadbbe8150821449d2097adaa4d3", "score": "0.7474675", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }", "title": "" }, { "docid": "b2b8dadbbe8150821449d2097adaa4d3", "score": "0.7474675", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }", "title": "" }, { "docid": "d5983de88794de8030bc96a2ff98df27", "score": "0.7463847", "text": "function gethex(decimal) {\n return \"%\" + hexchars.charAt(decimal >> 4) + hexchars.charAt(decimal & 0xF);\n }", "title": "" }, { "docid": "e684d5d1527ef0f63393bae80eae62a6", "score": "0.7462596", "text": "function convertDecimalToHex(d) {\n\t\t\treturn Math.round(parseFloat(d) * 255).toString(16);\n\t}", "title": "" }, { "docid": "f0c60e39a27e893d239b173df43e789c", "score": "0.7386131", "text": "myhex(value) {\n if (value < 16)\n return '0' + value.toString(16);\n return value.toString(16);\n }", "title": "" }, { "docid": "98214fb8d7d483d6adc89fecc8fe2cd9", "score": "0.7383119", "text": "function decimalToHexadecimalConverter(decimalNum){\n\n let hexadecimalNum = \"\";\n let quotient = 0;\n let remainder = 0;\n\n while (decimalNum > 0) {\n remainder = decimalNum % 16;\n quotient = (decimalNum - remainder) / 16;\n\n hexadecimalNum += decimalToHexArray[remainder];\n decimalNum = quotient;\n }\n\n hexadecimalNum = hexadecimalNum.split(\"\").reverse().join(\"\");\n\n return hexadecimalNum;\n\n}", "title": "" }, { "docid": "258264b043177fc9ecb1f3a8e7c2b703", "score": "0.7369011", "text": "function dec2hex(num) {\n return (num+0x10000).toString(16).substr(-2).toUpperCase();\n}", "title": "" }, { "docid": "ed1c8bf80c9d5cbf5deacacadf727d83", "score": "0.7278766", "text": "function dec2hex(t){return(t<15.5?\"0\":\"\")+Math.round(t).toString(16)}", "title": "" }, { "docid": "65d6b37ad010b14b436121a5286bc673", "score": "0.72548836", "text": "function decimalToHexadecimal(number) {\n var result = new Array()\n let i = 0\n while (number > 0) {\n result[i++] = number % 16\n number = Math.floor(number / 16)\n }\n hexValue = \"\"\n for (let j = result.length - 1; j >= 0; j--) {\n hexValue += (result[j] < 10) ? String.fromCharCode(result[j] + 48) : String.fromCharCode(result[j] + 55)\n }\n return hexValue\n}", "title": "" }, { "docid": "71448b77262e516017727f409a52e3ea", "score": "0.72463423", "text": "function hex(dec) {\r\n\t return parseInt(dec, 10).toString(16);\r\n\t }", "title": "" }, { "docid": "b5b97362e7c23b902eb51bca457542ab", "score": "0.7244884", "text": "function decimalToHexString(number)\n{\n if (number < 0)\n {\n \tnumber = 0xFFFFFFFF + number + 1;\n }\n\n return number.toString(16).toUpperCase();\n}", "title": "" }, { "docid": "7aad16d4cfbe7b03dce3a2eb470bab23", "score": "0.71842194", "text": "function hex(dec) {\n return parseInt(dec, 10).toString(16);\n }", "title": "" }, { "docid": "7aad16d4cfbe7b03dce3a2eb470bab23", "score": "0.71842194", "text": "function hex(dec) {\n return parseInt(dec, 10).toString(16);\n }", "title": "" }, { "docid": "21a085815d4a45bce762d626f7b613cf", "score": "0.7176933", "text": "function number2hex(value,digits) {\n\treturn padBeginning(digits, \"0\", value.toString(16));\n}", "title": "" }, { "docid": "4763adf0e7dd6ea463407fd382d87d4b", "score": "0.71751446", "text": "function hex(dec) {\r\n return parseInt(dec, 10).toString(16);\r\n }", "title": "" }, { "docid": "4763adf0e7dd6ea463407fd382d87d4b", "score": "0.71751446", "text": "function hex(dec) {\r\n return parseInt(dec, 10).toString(16);\r\n }", "title": "" }, { "docid": "4763adf0e7dd6ea463407fd382d87d4b", "score": "0.71751446", "text": "function hex(dec) {\r\n return parseInt(dec, 10).toString(16);\r\n }", "title": "" }, { "docid": "4763adf0e7dd6ea463407fd382d87d4b", "score": "0.71751446", "text": "function hex(dec) {\r\n return parseInt(dec, 10).toString(16);\r\n }", "title": "" }, { "docid": "4763adf0e7dd6ea463407fd382d87d4b", "score": "0.71751446", "text": "function hex(dec) {\r\n return parseInt(dec, 10).toString(16);\r\n }", "title": "" }, { "docid": "f7e944f526b9907fc50d4682d2e25389", "score": "0.7088947", "text": "function hex(d) {\n return Number(d).toString(16).padStart(2, '0')\n}", "title": "" }, { "docid": "6ffc28eda402034c6c26827cab8809a9", "score": "0.7064289", "text": "function dec2hex(dec)\n{\n return ('0' + dec.toString(16)).substr(-2)\n}", "title": "" }, { "docid": "cbb5b55d920e7906d23613b88550f5ce", "score": "0.7057967", "text": "function dec_to_hex(str_dec) {\n var H = 0, L = 0;\n var S = \"\";\n var dec = 0;\n\n dec = eval(str_dec);\n H = Math.floor(dec / 16);\n L = dec % 16;\n S += valore_hex(H);\n S += valore_hex(L);\n return S;\n}", "title": "" }, { "docid": "1d6a5c8b564eecf320215aa871949b73", "score": "0.7040599", "text": "function dec2hex(d)\n{\n\t//conversion table\n\thex = \"0123456789abcdef\";\n\n\t//output hex value\n\th = \"\";\n\n\t//parse as integer\n\ti = parseInt(d);\n\n\t//convert to HEX if it is a decimal value\n\tif (isNaN(i))\n\t{\n\t\th = null;\n\t}\n\telse\n\t{\n\t\twhile(i != 0)\n\t\t{\n\t\t\th = hex.charAt(i%16) + h;\n\t\t\t//shift 4 bits\n\t\t\ti = i >> 4;\n\t\t}\n\t}\n\treturn h;\n}", "title": "" }, { "docid": "40365816a239b252f9f3379ff5941c85", "score": "0.70213187", "text": "function dec2hex (dec) {\n return ('0' + dec.toString(16)).substr(-2)\n}", "title": "" }, { "docid": "34a310b5efb5cc5b19263d3ba39896ae", "score": "0.7017067", "text": "function hex(x) {\n\t\t\thexDigits = new Array(\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\");\n\t\t\treturn isNaN(x) ? \"00\" : hexDigits[(x - x % 16) / 16] + hexDigits[x % 16];\n\t\t}", "title": "" }, { "docid": "c4c899571212696a5049bf9010aafb0f", "score": "0.70076734", "text": "function dec2hex (dec) {\n return ('0' + dec.toString(16)).substr(-2);\n}", "title": "" }, { "docid": "d5d7502fd5e6ce55b98ddcc29d55dd2f", "score": "0.7000563", "text": "function dec2hex (dec) {\n return dec.toString(16).padStart(2, \"0\")\n }", "title": "" }, { "docid": "631131c6d743e5751dd3e933dffa6a21", "score": "0.6999437", "text": "function dec2hex(cval) {\r\n\t if (cval > 255) cval = 255;\r\n\t var hexascii = \"0123456789ABCDEF\";\r\n\t var cval0 = Math.floor(cval/16);\r\n\t var cval1 = cval-(cval0*16);\r\n\t var c1 = hexascii.charAt(cval0);\r\n\t var c2 = hexascii.charAt(cval1);\r\n\t return (c1+c2);\r\n\t}", "title": "" }, { "docid": "5ae39c66de819118655cea6012201c1f", "score": "0.6986978", "text": "function hex(x) {\n\treturn isNaN(x) ? \"00\" : hexDigits[(x - x % 16) / 16] + hexDigits[x % 16];\n}", "title": "" } ]
c40e2cd71e57a2d6d81f3bf805e30e94
stack to avoiding loops from circular referencing Call the o related callback with the given arguments.
[ { "docid": "60f42cdb59d678fdb94f019ec9075d2e", "score": "0.55102986", "text": "function bindCallbacks(o, callbacks, args) {\n var prop = QUnit.objectType(o);\n if (prop) {\n if (QUnit.objectType(callbacks[prop]) === \"function\") {\n return callbacks[prop].apply(callbacks, args);\n } else {\n return callbacks[prop]; // or undefined\n }\n }\n }", "title": "" } ]
[ { "docid": "9913a103bb9f8880fae281846b8fba05", "score": "0.6151141", "text": "detail(...args) {\n callback(...args);\n }", "title": "" }, { "docid": "887abf92999d81aea6c3b88c33ab2331", "score": "0.6016803", "text": "call(callback, ...names) {\n const {\n stack\n } = this;\n const {\n length\n } = stack;\n let value = getLast(stack);\n\n for (const name of names) {\n value = value[name];\n stack.push(name, value);\n }\n\n const result = callback(this);\n stack.length = length;\n return result;\n }", "title": "" }, { "docid": "9b70344b6e3da7fc3641fd185a4ade9d", "score": "0.57246983", "text": "static performCallbacks(callbacks) {\n // This is my method of getting all the arguments except for the list of callbacks\n const args = Array.prototype.slice.call(arguments, 1);\n callbacks.forEach((callback) => {\n // To use the arguments I have to use the apply method of the function\n callback(...args);\n });\n }", "title": "" }, { "docid": "f1680a05103b2e7f42a693c6b987dab2", "score": "0.5700363", "text": "adoptedCallback() { }", "title": "" }, { "docid": "a1f32972a55eea65f5eab9ea82b68cf6", "score": "0.5602306", "text": "call( callback, ...names ) {\n\t\tconst { stack } = this;\n\t\tconst { length } = stack;\n\t\tlet value = getLast( stack );\n\n\t\tfor ( const name of names ) {\n\t\t\tvalue = value[ name ];\n\t\t\tstack.push( name, value );\n\t\t}\n\n\t\tconst result = callback( this );\n\t\tstack.length = length;\n\t\treturn result;\n\t}", "title": "" }, { "docid": "136e2e2938f352502c0031b715257a5c", "score": "0.55900764", "text": "function callbackified(...args) {\n const maybeCb = args.pop();\n if (typeof maybeCb !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('last argument', 'Function', maybeCb);\n }\n const cb = (...args) => { Reflect.apply(maybeCb, this, args); };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n Reflect.apply(original, this, args)\n .then((ret) => process.nextTick(cb, null, ret),\n (rej) => process.nextTick(callbackifyOnRejected, rej, cb));\n }", "title": "" }, { "docid": "24e72b1f873d584065cccb4cc7fc10c1", "score": "0.5589768", "text": "function AckCallStack() {}", "title": "" }, { "docid": "fc79f32aea57aafc0308fd9c3ba1a96e", "score": "0.5587611", "text": "function onRej(arg) {\n if (self.trace) {\n self.resolvedStackTrace = stack(1);\n }\n onTick();\n completed = true;\n rej(arg);\n }", "title": "" }, { "docid": "fb7324a8dbb5484a1de48a6a0453f6d4", "score": "0.5572122", "text": "function sc_jsCall(o, fun) {\n var args = new Array();\n for (var i = 2; i < arguments.length; i++)\n\targs[i-2] = arguments[i];\n return fun.apply(o, args);\n}", "title": "" }, { "docid": "3769f6c86666cfb99087c6c4e1d5ec37", "score": "0.55470407", "text": "function pushOpArgs(args)\n {\n opFuncArgsStack.push(args);\n }", "title": "" }, { "docid": "8552898cf159b9da049956b9384d06d6", "score": "0.5535641", "text": "runCallbacks(callbacks, args) {\r\n for (let i = 0; i < callbacks.length; i++) {\r\n if (typeof callbacks[i] !== 'function') continue;\r\n callbacks[i].apply(null, args);\r\n }\r\n }", "title": "" }, { "docid": "3ba0947cb8a911d817e9a243ce8f27bd", "score": "0.5521688", "text": "adoptedCallback() {\n\n }", "title": "" }, { "docid": "b1b45c0af1910861a79a7b0d8d656bdc", "score": "0.5478867", "text": "function Call({\n handle,\n params,\n hash\n}) {\n return [op(0\n /* PushFrame */\n ), op('SimpleArgs', {\n params,\n hash,\n atNames: false\n }), op(16\n /* Helper */\n , handle), op(1\n /* PopFrame */\n ), op(35\n /* Fetch */\n , $v0)];\n}", "title": "" }, { "docid": "027b78c3050906e42dba34206f7fe7c9", "score": "0.5468258", "text": "adoptedCallback() {}", "title": "" }, { "docid": "027b78c3050906e42dba34206f7fe7c9", "score": "0.5468258", "text": "adoptedCallback() {}", "title": "" }, { "docid": "ca48b8d1e55447542a797f347b23df3a", "score": "0.5448612", "text": "function createCurrentCallObject() {\n\n}", "title": "" }, { "docid": "b09ae4a809015c7eeaee08c6d51f920a", "score": "0.5448032", "text": "function bindCallbacks(o, callbacks, args) {\n\t\tvar prop = hoozit(o);\n\t\tif (prop) {\n\t\t\tif (hoozit(callbacks[prop]) === \"function\") {\n\t\t\t\treturn callbacks[prop].apply(callbacks, args);\n\t\t\t} else {\n\t\t\t\treturn callbacks[prop]; // or undefined\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "8e70018e0f3f714d6e8fd395e3a5ebcd", "score": "0.54171836", "text": "function Call({\n handle,\n params,\n hash\n}) {\n return [Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])(0\n /* PushFrame */\n ), Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])('SimpleArgs', {\n params,\n hash,\n atNames: false\n }), Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])(16\n /* Helper */\n , handle), Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])(1\n /* PopFrame */\n ), Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])(36\n /* Fetch */\n , _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$v0\"])];\n}", "title": "" }, { "docid": "8e70018e0f3f714d6e8fd395e3a5ebcd", "score": "0.54171836", "text": "function Call({\n handle,\n params,\n hash\n}) {\n return [Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])(0\n /* PushFrame */\n ), Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])('SimpleArgs', {\n params,\n hash,\n atNames: false\n }), Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])(16\n /* Helper */\n , handle), Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])(1\n /* PopFrame */\n ), Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])(36\n /* Fetch */\n , _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$v0\"])];\n}", "title": "" }, { "docid": "ff8dfd41d477f09b6d57f5462a0e4020", "score": "0.54130816", "text": "function resolve() {\n $apply(a.shift() || function () {}, arguments);\n }", "title": "" }, { "docid": "d550b826b3954c76d29310681633632c", "score": "0.5403996", "text": "function callHooks(currentView,arr){for(var i=0;i<arr.length;i+=2){arr[i+1].call(currentView[arr[i]]);}}", "title": "" }, { "docid": "b4c0675b9169bff521678f83b442c121", "score": "0.53965604", "text": "function bindCallbacks(o, callbacks, args) {\n var prop = getType(o);\n if (prop) {\n if (getType(callbacks[prop]) === \"function\") {\n return callbacks[prop].apply(callbacks, args);\n } else {\n return callbacks[prop]; // or undefined\n }\n }\n }", "title": "" }, { "docid": "7fd4b723623a408187be89f098deec28", "score": "0.5370214", "text": "static InvokeCallback(cb, ...args)\n\t{\n\t\tif (Boolean(cb) && typeof cb === 'function')\n\t\t{\n\t\t\tconst arg = Array.from ? Array.from(args) : [].slice.call(args);\n\t\t\tcb(...arg);\n\t\t}\n\t}", "title": "" }, { "docid": "03d758ed83237db3c6fc84918119d0e4", "score": "0.5367044", "text": "function getCallbackFromArgs( argumentList ) {\n var callbackObject = [];\n\n if ( argumentList && argumentList.length ) {\n for ( var i in argumentList ) {\n switch( typeof argumentList[i] ) {\n case \"function\":\n throw new Error()\n case \"object\": \n case \"number\":\n case \"array\":\n default:\n // this does not check for other functions within objects...\n callbackObject.push(JSON.parse(JSON.stringify(argumentList[i])));\n break;\n }\n }\n \n }\n return callbackObject;\n }", "title": "" }, { "docid": "0750571b8bd637765efb497e8a1a4cf4", "score": "0.5361182", "text": "function $callFromDirect(f, thisObj, args)\n{\n var argArray = new Array;\n for(var idx = 0; idx < args.length; idx++)\n argArray[idx] = args[idx];\n return $trampoline(function() {\n return f.apply(thisObj, [$id].concat(argArray));\n });\n}", "title": "" }, { "docid": "53ca98d006439e95e4881926c36ea359", "score": "0.5339787", "text": "function main(param1,param2,callBack){ \n console.log(param1, param2) \n callBack() \n }", "title": "" }, { "docid": "8e5ea5c6534225fddd303b97867aa205", "score": "0.53327876", "text": "then(...args){\n utils.attachToPrevious(this.previous).then(x=>{\n var f = args[0];\n this.rl.close();\n f(x);\n })\n }", "title": "" }, { "docid": "15359f1bf5242ae1ee8bf64e111d4495", "score": "0.5321807", "text": "function callbackified(...args) {\n const maybeCb = args.pop();\n if (typeof maybeCb !== 'function') {\n // original\n // throw new errors.TypeError(\n // 'ERR_INVALID_ARG_TYPE',\n // 'last argument',\n // 'function');\n // modified\n throw makeNodeError(TypeError, 'ERR_INVALID_ARG_TYPE');\n }\n // @ts-ignore\n const cb = (...args) => { Reflect.apply(maybeCb, this, args); };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n // @ts-ignore\n Reflect.apply(original, this, args)\n .then((ret) => process.nextTick(cb, null, ret), \n // @ts-ignore\n (rej) => process.nextTick(callbackifyOnRejected, rej, cb));\n }", "title": "" }, { "docid": "d115696726f40a4f22f9f0180788ee7a", "score": "0.53034663", "text": "function makeCaller(ko, callback) {\n return function() {\n return callback.apply(this, [ko].concat(Array.prototype.slice.call(arguments, 0)));\n };\n }", "title": "" }, { "docid": "4616c6eddacd5ea0c5131f1dbcaa6d0f", "score": "0.53011245", "text": "function bindCallbacks( o, callbacks, args ) {\n\t\tvar prop = QUnit.objectType( o );\n\t\tif ( prop ) {\n\t\t\tif ( QUnit.objectType( callbacks[ prop ] ) === \"function\" ) {\n\t\t\t\treturn callbacks[ prop ].apply( callbacks, args );\n\t\t\t} else {\n\t\t\t\treturn callbacks[ prop ]; // or undefined\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "8fc61f980383ce38aadee18c7c0683e6", "score": "0.5287235", "text": "callCustom(userFn) {\n let sliced;\n\n sliced = Array.prototype.slice.call(arguments, 1);\n\n if (this.options.callbacks !== undefined && this.options.callbacks[userFn] !== undefined && typeof this.options.callbacks[userFn] === 'function'\n ) {\n this.options.callbacks[userFn].apply(this, sliced);\n }\n }", "title": "" }, { "docid": "fc0cc96e534bd33bd1a5702768cc759f", "score": "0.52813697", "text": "function wrapper() {\n\t\tclbk.apply( null, args );\n\t}", "title": "" }, { "docid": "5fa478a6fd84154a2993a69deea0f5f0", "score": "0.52799124", "text": "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}", "title": "" }, { "docid": "0b42bf34bf17c621a5246c43952e55f6", "score": "0.52642626", "text": "function PopArg() {\r\n}", "title": "" }, { "docid": "d2957fe35168931f06d4a2db3f4b4c66", "score": "0.52490646", "text": "adoptedCallback () {\n //! Not sure what to do.\n }", "title": "" }, { "docid": "bb678f97ff8d62cc002fb2e34455d8d3", "score": "0.52112526", "text": "function exec_callback(args) {\n if (callback_func && (callback_force || !con || !con.log)) {\n callback_func.apply(window, args);\n }\n }", "title": "" }, { "docid": "9f573a18bf20aa91ba8949c195f07a08", "score": "0.52094364", "text": "function __applyUp(self, func, args)\r\n{\r\n func.apply(self, args);\r\n if (self.__parent) {\r\n __applyUp(self.__parent, func, args);\r\n }\r\n}", "title": "" }, { "docid": "d485ed86569f276b0014ee212f88c493", "score": "0.52068865", "text": "function Stack() {\n var handle = function(req, res, next) { next() }\n ;[].slice.call(arguments).reverse().forEach(function(layer) {\n var child = handle\n handle = function (req, res, next) {\n layer(req, res, function () {\n child(req, res, next)\n })\n }\n })\n return handle\n}", "title": "" }, { "docid": "64b06adae5266113342df2e5f66f9ee3", "score": "0.5202017", "text": "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "title": "" }, { "docid": "64b06adae5266113342df2e5f66f9ee3", "score": "0.5202017", "text": "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "title": "" }, { "docid": "64b06adae5266113342df2e5f66f9ee3", "score": "0.5202017", "text": "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "title": "" }, { "docid": "64b06adae5266113342df2e5f66f9ee3", "score": "0.5202017", "text": "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "title": "" }, { "docid": "64b06adae5266113342df2e5f66f9ee3", "score": "0.5202017", "text": "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "title": "" }, { "docid": "64b06adae5266113342df2e5f66f9ee3", "score": "0.5202017", "text": "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "title": "" }, { "docid": "50e3d549f44a967e0da6b76191e2b7d4", "score": "0.5199551", "text": "function myPush(arr, ...args){\n//function myPush(arr, element){\n\n // could try to create a finction with just ...args\n // as the parameters\n // maybe then would work better\n\n // tried allowing multiple parameters\n\n\n // trying to allow for multiple arguments gets a little weird\n\n // the output says circular\n\n //var index = arr.length ;\n\n // maybe remove element\n\n\n\n //arr[index] = element;\n\n\n // attempt to try and accept multiple elements\n\n // fro some reason seems to create a circular array when I do this\n\n // will try and make better latter\n\n //\n\n\n\n\n\n for (var i=1; i < arguments.length; i++) {\n// need to ignore the first element\n// as that is the array\n// it now works properly\n var index = arr.length ;\n\n // maybe better way to do this to make more clear\n\n arr[index] = arguments[i];\n // I prefer this method\n // as I think it is more clear\n\n }\n\n\n\n\n\n\n return arr.length;\n\n\n // does not need to return anything\n // the premade function does return though\n // so I also return the length\n\n\n\n \n\n\n}", "title": "" }, { "docid": "097e9b12d4dad79b7ef3757eb325cfa8", "score": "0.51933223", "text": "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i=void 0;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "title": "" }, { "docid": "097e9b12d4dad79b7ef3757eb325cfa8", "score": "0.51933223", "text": "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i=void 0;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "title": "" }, { "docid": "097e9b12d4dad79b7ef3757eb325cfa8", "score": "0.51933223", "text": "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i=void 0;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "title": "" }, { "docid": "097e9b12d4dad79b7ef3757eb325cfa8", "score": "0.51933223", "text": "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i=void 0;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "title": "" }, { "docid": "4846f7442387d0797edb680641658aba", "score": "0.51929414", "text": "function callback(){}", "title": "" }, { "docid": "9115e0524a4f272e96a517d8741cc14a", "score": "0.51850206", "text": "function l(a,b,c){var d=Array.prototype.slice.call(arguments,2);return function(){var c=d.slice();c.push.apply(c,arguments);return a.apply(b,c)}}", "title": "" }, { "docid": "9115e0524a4f272e96a517d8741cc14a", "score": "0.51850206", "text": "function l(a,b,c){var d=Array.prototype.slice.call(arguments,2);return function(){var c=d.slice();c.push.apply(c,arguments);return a.apply(b,c)}}", "title": "" }, { "docid": "56b617586f770a04535bd74b42987069", "score": "0.51552606", "text": "function foo() {\n\tconsole.log(arguments);\n\targuments.callee;\n\targuments.callee.caller;\n}", "title": "" }, { "docid": "179eb5c6c7db21182c4a7576dd6868f7", "score": "0.51532155", "text": "function e(a,b){return function(){return a.apply(b,arguments)}}", "title": "" }, { "docid": "05105327796442111276b874357233cb", "score": "0.51293766", "text": "function guess_callback(argsi, array) {\n var callback = argsi[0], args = slice.call(argsi, 1), scope = array, attr;\n\n if (typeof(callback) === 'string') {\n attr = callback;\n if (array.length !== 0 && typeof(array[0][attr]) === 'function') {\n callback = function(object) { return object[attr].apply(object, args); };\n } else {\n callback = function(object) { return object[attr]; };\n }\n } else {\n scope = args[0];\n }\n\n return [callback, scope];\n}", "title": "" }, { "docid": "c4b946a146f61df68e983c6097e6beea", "score": "0.51270604", "text": "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0; ) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "title": "" }, { "docid": "3dc415c81a3ea6d191a8ac5a88c9d8f0", "score": "0.5125206", "text": "function GlobalCallInfo ()\n{\n this.top_down_view = call_info.CallInfo ();\n\n\n this.process_call_stack = function (call_list_obj)\n {\n var clo = call_list_obj;\n\n for (var key in clo)\n {\n if (clo.hasOwnProperty (key))\n {\n this.top_down_view.add_call (clo[key]);\n }\n }\n };\n}", "title": "" }, { "docid": "d3ab7b366222283dbad8ce0e8e06e265", "score": "0.5120532", "text": "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i = void 0;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "title": "" }, { "docid": "1d3ed2c5fd4e975f86fd84852c6462b8", "score": "0.51143646", "text": "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "title": "" }, { "docid": "1d3ed2c5fd4e975f86fd84852c6462b8", "score": "0.51143646", "text": "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "title": "" }, { "docid": "b352a586feb13255eecbe89d9a589da0", "score": "0.5113211", "text": "function tiCalls(content, tmpl, data, options) {\n if (!content) {\n return stack.pop();\n }\n stack.push({ _:content, tmpl:tmpl, item:this, data:data, options:options });\n }", "title": "" }, { "docid": "36802bb3fac087ada6fb7a42fd9d9b02", "score": "0.51107204", "text": "callParent (result) {\n this.parent.insertArgumentResult(this.position, result)\n if (this.parent.readyToBeInvoked()) {\n this.parent.call()\n }\n }", "title": "" }, { "docid": "c5d5debdb32180c6a86928b3974558ee", "score": "0.51092577", "text": "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i = void 0;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "title": "" }, { "docid": "4c57e8fc543e921521152d868ff3017c", "score": "0.5105443", "text": "function prepCallBack(func) {\n game.callBack.push(func);\n }", "title": "" }, { "docid": "c405df70bef7805d7d08999ca422529e", "score": "0.5102885", "text": "function Call(args, caller, index) {\n this.args = args; // the arguments\n this.caller = caller;\n this.index = index;\n}", "title": "" }, { "docid": "132d1e618732daf9c20a246ad90750ac", "score": "0.5101073", "text": "function exec_callback( args ) {\n if ( callback_func && (callback_force || !con || !con.log) ) {\n callback_func.apply( window, args );\n }\n }", "title": "" }, { "docid": "491a0b893e6f3335594db44fa8648cc4", "score": "0.5096365", "text": "function args(original) {\n var result = {length: 0};\n pushMethod.apply(result, original);\n result.CLASS___ = 'Arguments';\n useGetHandler(result, 'callee', poisonArgsCallee);\n useSetHandler(result, 'callee', poisonArgsCallee);\n useGetHandler(result, 'caller', poisonArgsCaller);\n useSetHandler(result, 'caller', poisonArgsCaller);\n return result;\n }", "title": "" }, { "docid": "1562d95c6e973db60958eebf67ad9c2d", "score": "0.50962293", "text": "function callbackified() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n \n var maybeCb = args.pop();\n if (typeof maybeCb !== 'function') {\n throw new TypeError('The last argument must be of type Function');\n }\n var self = this;\n var cb = function() {\n return maybeCb.apply(self, arguments);\n };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n original.apply(this, args)\n .then(function(ret) { process.nextTick(cb, null, ret) },\n function(rej) { process.nextTick(callbackifyOnRejected, rej, cb) });\n }", "title": "" }, { "docid": "f33ac540a7066b4ac28b7a868af924ca", "score": "0.5087936", "text": "function async_call(){\n\tvar args = Array.prototype.slice.call(arguments);\n\tif(args.length==1){\n\t\t// Promise\n\t\tvar p = args[0];\n\t\treturn new Promise(function(resolve, reject){\n\t\t\tp.then(function(record) {\n\t\t\t\tresolve({\n\t\t\t\t result : record\n\t\t\t\t});\n\t\t\t}).catch(function(error) {\n\t\t\t\tresolve({\n\t\t\t\t err : error\n\t\t\t\t});\n\t\t\t});\n\t\t});\t\t\n\t}\n\tvar obj = args.shift();\n\t\n\tvar func = obj instanceof Function ? obj : obj[args.shift()];\n\t//console.log('async_call',func);\n\treturn new Promise(function(resolve, reject){\n\t\ttry{\n\t\t\tif(func){\n\t\t\t\targs.push(function (err, replay){\n\t\t\t\t\tif (replay) {\n\t\t\t\t\t resolve({\n\t\t\t\t\t\t result : replay\n\t\t\t\t\t });\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresolve({\n\t\t\t\t\t\t\terr: err\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tfunc.apply(obj, args);\n\t\t\t}\n\t\t\telse\n\t\t\t\tresolve({\n\t\t\t\t\terr : 'Not defined '+func\n\t\t\t\t});\n\t\t}catch(e){\n\t\t\tresolve({\n\t\t\t\terr:e\n\t\t\t});\n\t\t}\n\t\t\n\t});\n}", "title": "" }, { "docid": "a4a23e559c9ca32bf76a3cbf32f28408", "score": "0.50816286", "text": "function tiCalls( content, tmpl, data, options ) {\n\t\tif ( !content ) {\n\t\t\treturn stack.pop();\n\t\t}\n\t\tstack.push({ _: content, tmpl: tmpl, item:this, data: data, options: options });\n\t}", "title": "" }, { "docid": "a4a23e559c9ca32bf76a3cbf32f28408", "score": "0.50816286", "text": "function tiCalls( content, tmpl, data, options ) {\n\t\tif ( !content ) {\n\t\t\treturn stack.pop();\n\t\t}\n\t\tstack.push({ _: content, tmpl: tmpl, item:this, data: data, options: options });\n\t}", "title": "" }, { "docid": "d2232538b1157595a47218fb5eafb56e", "score": "0.5077962", "text": "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "title": "" }, { "docid": "d2232538b1157595a47218fb5eafb56e", "score": "0.5077962", "text": "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "title": "" }, { "docid": "d2232538b1157595a47218fb5eafb56e", "score": "0.5077962", "text": "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "title": "" }, { "docid": "d2232538b1157595a47218fb5eafb56e", "score": "0.5077962", "text": "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "title": "" }, { "docid": "d2232538b1157595a47218fb5eafb56e", "score": "0.5077962", "text": "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "title": "" }, { "docid": "d2232538b1157595a47218fb5eafb56e", "score": "0.5077962", "text": "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "title": "" }, { "docid": "dc9afdc32473832b82f76cbb570169bf", "score": "0.5074477", "text": "function callback(ix, elem, obj, parents) {\n\t\tconsole.log(\" \" + ix + \" => \" + elem + \" : \" + (typeof obj == \"undefined\" ? \"undefined\"\n\t\t\t: (obj instanceof Array ? \"Array\" : \"Object\")) + \" (\" + parents.length + \")\");\n\t}", "title": "" }, { "docid": "b0fe4204ad4f33aeded7f4414a81a1d0", "score": "0.5073779", "text": "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i = void 0;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "title": "" }, { "docid": "b0fe4204ad4f33aeded7f4414a81a1d0", "score": "0.5073779", "text": "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i = void 0;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "title": "" }, { "docid": "b0fe4204ad4f33aeded7f4414a81a1d0", "score": "0.5073779", "text": "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i = void 0;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "title": "" }, { "docid": "c816b15b8eb5a57e34e9702938e6cd00", "score": "0.5073319", "text": "function hooks(){return hookCallback.apply(null,arguments)}", "title": "" }, { "docid": "c816b15b8eb5a57e34e9702938e6cd00", "score": "0.5073319", "text": "function hooks(){return hookCallback.apply(null,arguments)}", "title": "" }, { "docid": "80f4de208bfabe4065a0076ac2c32d5f", "score": "0.5067612", "text": "function greet(who) {\n //2. call stack here and runs console.log\n console.log(`Hello ${who}`)\n}", "title": "" }, { "docid": "fc846bf93989489b90a960556e3ff4ae", "score": "0.50627315", "text": "adoptedCallback() {\n console.log('inside adoptedCallback');\n }", "title": "" }, { "docid": "7e53c51aac4ecce7f9172bd65b521da1", "score": "0.505803", "text": "call (name, ...args) {\n return new Promise((f, r)=> {\n let id = genUID();\n this.calls.push({ id, f, r });\n this.socket.emit(`__${this.namespace}_call__`, { id, name, args })\n });\n }", "title": "" }, { "docid": "5fee51b39e9e89d0cd310cea95867350", "score": "0.50439346", "text": "function r(e,t,a){f(function(){e(t,a)})}", "title": "" }, { "docid": "ac607ac4a8026ebb690f6cac434d4905", "score": "0.50415516", "text": "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = getParent(inst);\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], 'captured', arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], 'bubbled', arg);\n\t }\n\t}", "title": "" }, { "docid": "0a857ff317e81c73961c8f5cee5f6733", "score": "0.5026898", "text": "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=inst._nativeParent;}var i;for(i=path.length;i-->0;){fn(path[i],false,arg);}for(i=0;i<path.length;i++){fn(path[i],true,arg);}}", "title": "" }, { "docid": "0a857ff317e81c73961c8f5cee5f6733", "score": "0.5026898", "text": "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=inst._nativeParent;}var i;for(i=path.length;i-->0;){fn(path[i],false,arg);}for(i=0;i<path.length;i++){fn(path[i],true,arg);}}", "title": "" }, { "docid": "a36e996f9db306785de793dc9ae56367", "score": "0.5018541", "text": "function executeInOrder() {\n var funcs = Array.prototype.concat.apply([], arguments);\n var func = function(callback) {\n funcs.shift();\n callback();\n };\n func(function() {\n if (funcs.length > 0) {\n executeInOrder.apply(this, funcs);\n }\n });\n}", "title": "" }, { "docid": "105be54ac0d8f727d8e7c2e0dfdcbc69", "score": "0.501505", "text": "function xg(){for(var t,e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return\"object\"!==Object(Ei[\"a\"])(r[r.length-1])&&(e=r.pop()),xp()(t=bg()(r).call(r,1)).call(t,(function(t,n,r){return wg()(t,n,e)}),r[0])}", "title": "" }, { "docid": "a2bab3f2150499bee5d67d40f902d746", "score": "0.501353", "text": "fire(...args) {\n for (var sub in this.subscribers) {\n var subscriber = this.subscribers[sub];\n subscriber.handler.apply(subscriber.subref, args);\n }\n }", "title": "" }, { "docid": "eeeb7523236b479bf4739cdc1c0ac03e", "score": "0.50134486", "text": "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=inst._hostParent;}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "title": "" }, { "docid": "68edb256ca710c3dcf8af8c444ec5c59", "score": "0.50121313", "text": "function Stack_R() {\r\n}", "title": "" }, { "docid": "498122d1a6e1018fb98da17ab278f5b5", "score": "0.5010382", "text": "function StackFunctionSupport() {\r\n}", "title": "" }, { "docid": "acdd45d9b0d8d1fd6cd0f057f5037a4c", "score": "0.50006855", "text": "adoptedCallback () {\n console.log('adopted')\n }", "title": "" }, { "docid": "1352b208452fc0bbb934c77756502f49", "score": "0.5000425", "text": "function callbackified() {\n var args = [];\n\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n var maybeCb = args.pop();\n\n if (typeof maybeCb !== 'function') {\n throw new TypeError('The last argument must be of type Function');\n }\n\n var self = this;\n\n var cb = function cb() {\n return maybeCb.apply(self, arguments);\n }; // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n\n\n original.apply(this, args).then(function (ret) {\n process.nextTick(cb, null, ret);\n }, function (rej) {\n process.nextTick(callbackifyOnRejected, rej, cb);\n });\n }", "title": "" }, { "docid": "84a9dafdb138bc89c253954bf07e38ca", "score": "0.49950597", "text": "function traverseTwoPhase(inst, fn, arg) {\n for (var path = []; inst; ) path.push(inst), inst = getParent(inst);\n var i;\n for (i = path.length; i-- > 0; ) fn(path[i], \"captured\", arg);\n for (i = 0; i < path.length; i++) fn(path[i], \"bubbled\", arg);\n}", "title": "" } ]
66f4e5011905eb371f4b6ff895a2849a
Deleting all rows in the contact list
[ { "docid": "6f20a64575cd384c96de7e35fb9e804c", "score": "0.7597576", "text": "function deleteRows() {\n\tvar table = document.getElementById(\"contactsBody\");\n\tvar contactItemNumb = table.getElementsByTagName(\"tr\").length;\n\tfor (var i = 0; i < contactItemNumb; i++) {\n\t\ttable.deleteRow(0);\n\t}\n}", "title": "" } ]
[ { "docid": "ea788f01902bd674a1a55e3e4ea1bc49", "score": "0.72646594", "text": "function delAllContact(e){\r\n contactList.remove();\r\n e.stopImmediatePropagation();\r\n savebtn.addEventListener('click',saveChanges);\r\n }", "title": "" }, { "docid": "e2e3e429207dbfc521bd04d03ecb9834", "score": "0.70886654", "text": "function clearContactTable()\n{\n\tvar table = document.getElementById(\"contactTable\");\n\tvar rows = table.rows;\n\twhile (rows.length > 1)\n\t\ttable.deleteRow(1);\n}", "title": "" }, { "docid": "c85b3d2a118cfb046316f393c07ca184", "score": "0.70383567", "text": "function delContact() {\n console.log(\"delete working\");\n var index = $(this).index();\n names.splice(index,1);\n numbers.splice(index, 1)\n\n updateList();\n saveToStorage();\n}", "title": "" }, { "docid": "ad47424d213ea8212a362ce13ec1e30e", "score": "0.6949444", "text": "async function removeDeletedContacts() {for (var i = 0; i < contacts.length && contacts[i]; i++) { \n //console.log(contact._id)\n if (contacts[i]._id == null){\n //console.log(contacts.indexOf(contact))\n contacts.splice(i, 1)\n i--\n }\n }}", "title": "" }, { "docid": "a0d8997c5790a92a2f81a54e7601173e", "score": "0.68679255", "text": "function deleteEntries() {\n dbShell.transaction(function(tx) {\n tx.executeSql(\"delete from entregappusers\",[],returnDelete,dbErrorHandler);\n }, dbErrorHandler);\n }", "title": "" }, { "docid": "8fdcf22006bea17a01f6cd241678b1f3", "score": "0.67908275", "text": "function deleteContactSearchTablet()\n{\n\tvar findContacts = kony.contact.find(frmContact.txtSearchFind.text,true); \n\tkony.print(\"******************************************\\n\"+JSON.stringify(findContacts)+\"\\n************\")\t\n\tvar dataCollection = [];\n\tif (findContacts == null ||findContacts ==\"\" )\n\t{\t\n\t\tdataCollection = [];\n\t\tfrmContact.segDeleteContact.setData(dataCollection);\t\n\t}\n\telse\n\t{\n\t\tfor(var i in findContacts){\n\t\t\tdataCollection.push({\"lblDeleteContact\" : findContacts[i][\"firstname\"],\n\t\t\t\t\t\t\t\t\"imgRemove\" : \"remove.png\"\t});\n\t\t}\n\t\tfrmContact.segDeleteContact.setData(dataCollection);\n\t}\n}", "title": "" }, { "docid": "1b9952ab8e885f8232efa618d26552bb", "score": "0.6686133", "text": "function deleteAllRows(value) {\n \n uploads.clearAllRows(\"dataTable\"); \n \n }", "title": "" }, { "docid": "39f1da4ba611027b6e82f8c897726f2d", "score": "0.65152776", "text": "function deleteContacts() {\n vm.disableYes = true;\n vm.deletingContacts = true;\n\n\n var deletingContacts = vm.deleteContact.filter(function(contact) {\n return contact.is_contact == '1';\n });\n\n var deletingIds = {\n \"contact_ids\": _.pluck(deletingContacts, \"contact_id\")\n };\n\n contactService.deleteSelectedContacts(deletingIds)\n .then(function(reply) {\n if (reply.code == 200) {\n vm.deleteContact = {};\n vm.deleteModal.close();\n vm.deletingContacts = false;\n vm.disableYes = false;\n // reloadCurrentIndex();\n for (var x = 0; x < deletingIds.contact_ids.length; x++) {\n vm.gridOptions.data = _.without(vm.gridOptions.data, _.findWhere(vm.gridOptions.data, {\n contact_id: deletingIds.contact_ids[x]\n }));\n }\n vm.gridApi.selection.clearSelectedRows();\n $timeout(function() {\n vm.count = vm.gridApi.grid.renderContainers.body.renderedRows.length;\n vm.totalNetworkCount = totalNetworkCount - deletingIds.contact_ids.length;\n totalNetworkCount = vm.totalNetworkCount;\n /*If all the contacts are deleted in current page it calls for the rest of the contacts.*/\n if (vm.gridApi.grid.renderContainers.body.renderedRows.length == 0)\n resetToFirstIndex();\n })\n }\n\n }, function(error) {\n vm.disableYes = false;\n if (error.code == 667 || error.code == 623) { /* Cannot delete connection updates */\n // ActivityModal.errorPopup(error);\n vm.deleteModal.close();\n reloadCurrentIndex();\n } else {\n ActivityModal.errorPopup(error);\n }\n vm.deletingContacts = false;\n })\n }", "title": "" }, { "docid": "6dadafafbd9024e185958c749226bee3", "score": "0.6470797", "text": "function removeContact(contactList) {\r\n for (let i = 0; i < contactList.length; i++) {\r\n let contact = contactList[i];\r\n console.log(i + \" Nom : \" + contact.lName + \" prénom : \" + contact.fName);\r\n }\r\n let del = Number(prompt(\"Choisissez le numéro du contact a supprimer :\"));\r\n contacts.splice(del, 1);\r\n}", "title": "" }, { "docid": "767bf0dc5ec046cdc202317cdad17367", "score": "0.6464424", "text": "function deleteContact(phone) {\r\n let tmpTable = {};\r\n let tableKeys = Object.keys(cntTable);\r\n for (let i = 0; i < tableKeys.length; i++) {\r\n if (phone !== tableKeys[i]) {\r\n tmpTable[tableKeys[i]] = cntTable[tableKeys[i]];\r\n }\r\n }\r\n cntTable = tmpTable;\r\n localStorage.setItem(tableK, JSON.stringify(cntTable));\r\n updateTable();\r\n}", "title": "" }, { "docid": "5c8ea6edfd0f0d15ba78fc553a4e4162", "score": "0.6457019", "text": "function deleteContactSearch()\n{\n\tvar findContacts = kony.contact.find(frmDeleteContact.txtSearch.text,true); \n\tkony.print(\"******************************************\\n\"+JSON.stringify(findContacts)+\"\\n************\")\t\n\tvar dataCollection = [];\n\tif (findContacts == null ||findContacts ==\"\" )\n\t{\t\n\t\tdataCollection = [];\n\t\tfrmDeleteContact.segContact.setData(dataCollection);\t\n\t}\n\telse\n\t{\n\t\tfor(var i in findContacts){\n\t\t\tdataCollection.push({\"lblContact\" : findContacts[i][\"firstname\"],\n\t\t\t\t\t\t\t\t\"imgRemove\" :{src:\"remove.png\"}});\n\t\t}\n\t\tfrmDeleteContact.segContact.setData(dataCollection);\n\t}\n}", "title": "" }, { "docid": "575df87b7f58c9889c74bea1ba152e2b", "score": "0.6371346", "text": "deleteAllTableEntries () {\n this.db.prepare('DELETE FROM users;').run()\n }", "title": "" }, { "docid": "022448eed4bf81c88b57239deec22bda", "score": "0.6344313", "text": "function deleteRowsDB()\n{\n\tdb.run('DELETE FROM Comments',function(err)\n\t{\n\t\tcheckError();\n\t});\n}", "title": "" }, { "docid": "19a0521775d70725c942163ccdbc40a9", "score": "0.6344148", "text": "function deleteRow() {\n \n uploads.clearSingleRow(\"dataTable\");\n }", "title": "" }, { "docid": "a32aac1bd742082918562512ea4a52d4", "score": "0.6324888", "text": "function deletePersonsGroup() {\n //capture row value from button input\n rowNumber = $(this).val();\n var rowValue = '#tr' + rowNumber;\n individualsId = library_personGroups_persons[rowNumber];\n\n //delete rowValue from array\n library_personGroups_groups.splice(rowNumber, 1);\n library_personGroups_persons.splice(rowNumber, 1);\n\n //if person no longer is any groups, put them in uassigned\n assignNAtoPersonsGroups();\n\n //update local storage\n window.localStorage.setItem('library_personGroups_groups_local', JSON.stringify(library_personGroups_groups));\n window.localStorage.setItem('library_personGroups_persons_local', JSON.stringify(library_personGroups_persons));\n\n // delete all rows with persons in them\n for (i = 0; i < library_personGroups_groups.length + 1; i++) {\n var rowValue = '#tr' + i;\n $(rowValue).remove();\n }\n // delete all table group headers\n for (j = 0; j < library_groups.length; j++) {\n var classGroup = '.table' + library_groups[j];\n $(classGroup).remove();\n $('#trAdd').remove();\n }\n\n //then reload all rows and persons\n loadPersons();\n }", "title": "" }, { "docid": "b15c1d7df61c6e643fda660aef6d79d9", "score": "0.63228416", "text": "function emptyTable() {\n $('#dump-contacts').empty();\n}", "title": "" }, { "docid": "880a3fea9960c2aff8291b42d8a01a47", "score": "0.6302162", "text": "removeFromTable(key) {\n const filteredContacts = this.state.filteredContacts;\n var index = filteredContacts.indexOf(key);\n if(index>-1){\n filteredContacts.splice(index,1);\n }\n this.setState({filteredContacts});\n }", "title": "" }, { "docid": "fa076050f64d495539004018e9a56b56", "score": "0.62921554", "text": "clearList() {\n const table = document.querySelector(\"tbody\");\n\n while(table.firstChild) {\n table.removeChild(table.firstChild);\n }\n }", "title": "" }, { "docid": "061a312f8d786177631dca26ca21caea", "score": "0.62894666", "text": "function deleteContact(id) {}", "title": "" }, { "docid": "67fc602737692be4d94984bab3034a16", "score": "0.62761146", "text": "function deleteAllContacts() {\n var modalInstance = $uibModal.open({\n animation: true,\n backdrop: 'static',\n keyboard: false,\n size: 'sm',\n scope: $scope,\n templateUrl: \"app/relationships/delete-contacts.html\",\n controller: 'ModalController',\n controllerAs: 'vmM',\n windowClass: 'evy_confirm-post-delete_popup',\n bindToController: true\n });\n modalInstance.result.then(function(value) {\n vm.alldlt = false;\n if (value == \"ok\") {\n resetToFirstIndex();\n }\n });\n }", "title": "" }, { "docid": "474a3cfbb77bd086659bf541bf5a5125", "score": "0.6267454", "text": "function delete_members() {\n var members = document.getElementById(\"members\");\n var unchecked = [];\n \n last_deleted_members = [];\n checked_unchecked(last_deleted_members, unchecked); \n \n for(var m = members.rows.length; m > 0; m--)\n members.deleteRow(m-1);\n \n for(var m in unchecked)\n add_member(unchecked[m]); \n}", "title": "" }, { "docid": "aeb10f20d28291d6d0816ba092b123c7", "score": "0.6244718", "text": "function deleteRow(r) {\n var i = r.parentNode.parentNode.rowIndex;\n document.getElementById(\"list_of_people\").deleteRow(i);\n}", "title": "" }, { "docid": "4b9fdd6101b8c3fbb23a8eac2c3ff275", "score": "0.6231711", "text": "deleteAll(){\n for(var i = 0;i<this.array.length;i++){\n this.array[i].body.remove();\n }\n this.array = [];\n }", "title": "" }, { "docid": "60d014b1436ff4e199298d44c18feebe", "score": "0.619516", "text": "function deleteAllData() {\n getCompleteBlocksDBData().then(function(data) {\n for(var i = 0; i < data.length; i++) {\n db.del(i);\n }\n })\n}", "title": "" }, { "docid": "80ca6d895d42c658cabd33b37367fbff", "score": "0.61945546", "text": "function clearOldRecords() {\r\n // db.remove({}, {multi: true}, function(err,numRecords) {\r\n // console.log(\"Removed \" + numRecords + \" records.\");\r\n // });\r\n console.log(\"Cleared records\");\r\n}", "title": "" }, { "docid": "c9d501c77f625c5eba43a31a9718c1af", "score": "0.619271", "text": "function unpopulateTable() {\r\n\r\n\r\n\tvar table = document.getElementById(\"attendeeTable\");\r\n\tconsole.log(table);\r\n\tfor(var i = table.rows.length - 1; i > 0; i--)\r\n\t{\r\n\t\ttable.deleteRow(i);\r\n\t}\r\n}", "title": "" }, { "docid": "ae605c49551c4bf83c62a485f05d3e84", "score": "0.6190828", "text": "resetSection(){\n while (this.table.rows.length > 1){\n this.table.deleteRow(1);\n }\n }", "title": "" }, { "docid": "64a1c0d15bee5086d63f942693714c1a", "score": "0.61844605", "text": "function deleteRow(contactID)\n{\n\tvar payload = {ContactID: contactID};\n\tvar errorField = document.getElementById(\"tableResponse\");\n\tapiRequest(\"DeleteContact\", payload, errorField, function() {\n\t\tvar responseField = document.getElementById(\"tableResponse\");\n\t\tresponseField.innerHTML = \"Your contact has been removed.\";\n\t\tvar row = document.getElementById(\"row\"+contactID);\n\t\trow.parentNode.removeChild(row);\n\t});\n}", "title": "" }, { "docid": "96b746471de31aed8c2b128367f910ed", "score": "0.61800104", "text": "function deleteRows() {\n let tableLength = document.querySelector(\".result-table\").rows.length;\n // console.log(tableLength);\n for (var i = tableLength - 1; i > 0; i--) {\n document.querySelector(\".result-table\").deleteRow(i);\n }\n}", "title": "" }, { "docid": "f540eb19d5492bd4631b054a62ee7b70", "score": "0.6147073", "text": "function removeContactRow(contact_name) {\n\t\t$('#contacts').find('div.contactRow').each(function() {\n\t\t\tif (this.id == contact_name) {\n\t\t\t\t$(this).hide('slow', function(){\n\t\t\t\t\t$(this).remove();\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "d26090be29e72be27cec1bab5127f347", "score": "0.6140321", "text": "deleteRow(contact) {\n this.httpRequestService.delete(contact._id).subscribe(() => {\n this.downloadData();\n });\n }", "title": "" }, { "docid": "585e6993a89e279c3005ec4596551778", "score": "0.61359704", "text": "function cleartoDoList() {\n let table = document.querySelector('tbody');\n while (table.rows.length > 0) {\n table.deleteRow(0);\n }\n}", "title": "" }, { "docid": "4647a7fa075628f76a8bcbf4b19480a9", "score": "0.6121994", "text": "function deleteAllRecords() {\r\n firebase.database().ref(userID).remove();\r\n var orderList = document.getElementById('orderList');\r\n orderList.innerHTML = '';\r\n scrolling();\r\n}", "title": "" }, { "docid": "14fea3995364863bba97bc20c57d5cf4", "score": "0.6105892", "text": "function clearTable()\n {\n Utils.confirmDialog(i18next.t('draft:delete_all_confirm'), 'warning').then(function(confirmed)\n {\n if (confirmed)\n {\n $('#draftTable tr.draftItem').remove();\n createDraftItem();\n }\n });\n }", "title": "" }, { "docid": "ef97ac8e1b5dd532e2d2d71d90c2c723", "score": "0.6081093", "text": "function deleteContact(ev){\n\tvar elem = ev.target;\n\tvar i = elem.dataset.index;\n\tconsole.log(elem);\n\tconsole.log(i);\n\tcm.removeByIndex(i);\n\tcm.save();\n\tshowAllSect();\n}", "title": "" }, { "docid": "72362f50c65b23384d808235c671b825", "score": "0.6061382", "text": "function deleteRecords() {\n // alert('ahora si a eliminar');\n var delete_path = $('#inline_edit_data').attr('delete-path');\n delete_path += '/1'\n var token = $('#inline_edit_data').attr('token');\n var ids = [];\n\n $('table tbody tr').each(function() {\n var this_item = $(this);\n if (this_item.attr('check') == 'yes') {\n ids.push(this_item.attr('data-id'));\n this_item.remove();\n }\n });\n\n $.post(delete_path, { _token: token, _method: 'DELETE', ids: ids }, function(response) {\n let del = '';\n let cantd = 0;\n let inact = '';\n let canti = 0;\n $.each(response, function(i, data) {\n if (i == 'deletes' && data.length > 0) {\n cantd = data.length;\n del += '<ul>'\n $.each(data, function(i, val) {\n del += '<li>' + val.nombre + '</li>';\n })\n del += '</ul>';\n } else if (i == 'disabled' && data.length > 0) {\n canti = data.length;\n inact += '<ul>'\n $.each(data, function(i, val) {\n inact += '<li>' + val.nombre + '</li>';\n })\n inact += '</ul>';\n }\n })\n let msg = '';\n if (del != '' && inact == '')\n msg = 'Eliminación satisfactoria';\n else if (del == '' && inact != '')\n msg = 'Información inactivada';\n else if (del != '' && inact != '') {\n msg += 'Eliminación satisfactoria:<br>' + del;\n msg += 'Elementos desactivados:<br>' + inact;\n } else {\n msg = \"No se eliminó ninguna información\";\n }\n customModal('success', msg, false, '');\n refreshData();\n\n });\n }", "title": "" }, { "docid": "0bb9c7c795ec7da547374ed7a0a72a49", "score": "0.6056128", "text": "function btnRemove_OnTouch() \r\n{ \r\n //Remove data. \r\n db.ExecuteSql( \"DELETE FROM test_table WHERE id > 3\" ); \r\n\r\n //Get all the table rows. \r\n DisplayAllRows(); \r\n}", "title": "" }, { "docid": "d3941e3d3d5bd81bc1b2bb26a2e74bca", "score": "0.6055388", "text": "function removeContact(contact, list) {\n\tfor (var i = 0; i < list.length; i++) {\n\t\tif (list[i].nodeID === contact.nodeID) list.splice(i, 1);\n\t}\n}", "title": "" }, { "docid": "7febf5b8fd3793207c42c5b34eff04c1", "score": "0.60485595", "text": "function removeAll() {\n var tBodyId = document.getElementById('TableBody');\n while (tBodyId.rows.length > 0) {\n tBodyId.removeChild(tBodyId.rows[0]);\n }\n}", "title": "" }, { "docid": "7f61da77085368462f2f8778e2f855dc", "score": "0.6045332", "text": "function deleteRows() {\n var checkbox, checkboxes, i, row;\n\n checkboxes = getChecked();\n for (i = 0; i < checkboxes.length; i++) {\n checkbox = checkboxes[i];\n // TODO: Set row to the grandparent (tr) of checkbox\n // TODO: (the parent is a td).\n // TODO: Remove the row from its parent.\n }\n\n // TODO: Disable deleteBtn since no remaining checkboxes are checked.\n}", "title": "" }, { "docid": "a0f5af047c70dbc216e4f41df4ed58c8", "score": "0.6039171", "text": "function deleteGrid(){\n for (var n=table_grid.rows.length ; n>=2; n--){\n table_grid.removeChild(table_grid.childNodes[n]);\n }\n }", "title": "" }, { "docid": "f1f9865dee05199e83f1d03f629800a0", "score": "0.60343224", "text": "function removeContact()\n{\n\tvar findContacts = kony.contact.find(\"John\"); \n\tif (findContacts == null || findContacts == \"\" )\n\t{\n\t\t//frmContact.lblDevContact.text = \"No contact found with the first name as 'John' \";\n\t}\n\telse\n\t{\n\t\tfor (var i in findContacts )\n\t\t\tkony.contact.remove(findContacts[i]);\n\t\t//frmContact.lblDevContact.text = \"Removed all contacts with the first name as 'John' . Please Check the device contacts.\";\n\t}\n}", "title": "" }, { "docid": "927990059e50159a5b0da4b3f4771912", "score": "0.6030516", "text": "function deleteTable() {\n var table1 = document.getElementById(\"myTableClubs\");\n while (1 < table1.rows.length) {\n table1.deleteRow(1)\n }\n}", "title": "" }, { "docid": "82f960a7f4e414dfabe77d02c90b359e", "score": "0.6028712", "text": "function DeleteRecords() {\n CurrIds = TableMain.cells(\".ui-selected\", \"Id:name\", { page: \"current\" }).data().toArray();\n deleteRecordsGeneric(CurrIds, \"/ComponentTypeSrv/Delete\", refreshMainView);\n}", "title": "" }, { "docid": "c0bee8040707593002fc2905d9c139e4", "score": "0.60128665", "text": "function clearInvoicesTable() {\n $('#invoices-lines tr').each(function() {\n $(this).remove();\n })\n}", "title": "" }, { "docid": "2a429bf5eccab0d358cba6ffc6171eb3", "score": "0.59977436", "text": "function deleteContactoRendicion(btn) {\n var row = btn.parentNode.parentNode;\n row.parentNode.removeChild(row);\n}", "title": "" }, { "docid": "41a1588c9e52c0cb89f1af49a869a8c9", "score": "0.5994313", "text": "function flush()\r\n{\r\n let id,flag=0;\r\n let len=document.getElementById(\"list\").rows.length;\r\n\r\n // console.log(\"len : \"+len);\r\n\r\n\r\n for(let i=len-1;i>=1;i--)\r\n {\r\n //console.log(\"i :\"+i);\r\n let savingd=document.getElementById(\"list\").rows[i].cells;\r\n save1[sv]=savingd[0].innerHTML;\r\n save2[sv]=savingd[1].innerHTML;\r\n save3[sv]=savingd[2].innerHTML;\r\n save4[sv]=savingd[3].innerHTML;\r\n sv++;\r\n //console.log(\"sv : \"+sv);\r\n document.getElementById(\"list\").deleteRow(i);\r\n }\r\n\r\n}", "title": "" }, { "docid": "3103690f9a1c80fc1dae32c464af6e13", "score": "0.5994204", "text": "deleteMessage(i) {\n this.contacts = this.contacts.map((contact, index) => {\n if (index === this.activeContact) {\n contact.messages.splice(i, 1);\n }\n return contact;\n });\n }", "title": "" }, { "docid": "46bb916d7b75cd8d76a7c6a0c09c3005", "score": "0.5967824", "text": "function eliminarFilas(){\n tabla=document.getElementById(\"tabla\").getElementsByTagName('tbody')[0];\n var j=5;\n while(j--){\n tabla.deleteRow(j);\n }\n}", "title": "" }, { "docid": "0fe9962259380a634863993f3ca21d1d", "score": "0.59616786", "text": "_deleteData() {\n console.log('Deleting all data');\n var msg = this._buildMessage(WS_METHOD.DELETE_ALL, null);\n \n this._send(JSON.stringify(msg));\n }", "title": "" }, { "docid": "6242da22b7d6a60326b999073d19efde", "score": "0.59575856", "text": "function removeContact(evt) {\n var $tr = $(evt.target).closest('tr');\n $tr.remove();\n var uuid = $tr.data('uuid');\n var url = FIREBASE_URL + '/users/' + fb.getAuth().uid + '/profile/' + uuid + '.json';\n $.ajax(url, {type: \"DELETE\"});\n}", "title": "" }, { "docid": "3a0bb11134fc79d6bac2f3edf2b4aac3", "score": "0.5957196", "text": "function delete_table() {\n var table = document.getElementById(\"table-data\");\n while(table.rows.length > 0) {\n table.deleteRow(0);\n };\n}", "title": "" }, { "docid": "b172eb0a22b5ddfb416fe3514925ecce", "score": "0.5956281", "text": "function searchPerson() {\n\n var table2 = document.getElementById(\"myTableLeader2\")\n while(table2.rows.length>1){\n table2.deleteRow(1)\n }\n\n num = 0\n persons.forEach(findPerson)\n\n\n}", "title": "" }, { "docid": "2f43c291007d7b16205e24dbe082c6dc", "score": "0.5956221", "text": "deleteAll() {\n const arr = this.superhero;\n const $mdToast = this.$mdToast;\n if (arr.length > 1) {\n const confirm = this.$mdDialog.confirm()\n .title('Are you sure to delete this records ?')\n .ariaLabel('Confirmation')\n .ok('Delete')\n .cancel('Cancel');\n\n this.$mdDialog.show(confirm).then(() => {\n const contactIds = arr;\n this.ContactServices.delete(contactIds)\n .then((res) => {\n if (res.status === 200) {\n $mdToast.show(\n $mdToast.simple()\n .textContent('Successfully deleted')\n .position(this.position)\n .hideDelay(1000)\n );\n }\n return 'reload';\n })\n .then(this.$state.reload())\n .finally(() => (this.superhero = []));\n });\n }\n }", "title": "" }, { "docid": "e797f723992bdb0b9d7b0df0073313d3", "score": "0.59475315", "text": "function clearTable(){\n\tvar table = document.getElementById(\"tabelleRooms\");\n for(var i = table.rows.length - 1; i > 0; i--)\n {\n table.deleteRow(i);\n }\n}", "title": "" }, { "docid": "e5be111ebf08b615a1c77e7edd16249b", "score": "0.5945073", "text": "function DeleteVillagerRows() {\n var rowCount = villagerTable.rows.length;\n for (var i = rowCount - 1; i > 0; i--) {\n villagerTable.deleteRow(i);\n }\n}", "title": "" }, { "docid": "dbecaa5193f7e4d2d340753949ed4a25", "score": "0.59448564", "text": "async function deleteContacts(contactIds) {\n try {\n contactIds.forEach(async (contactId) => {\n let deletedContact = await contactSchema.findByIdAndDelete({ _id: contactId });\n console.log(deletedContact);\n });\n } catch (error) {\n console.log(\"[ERROR] While trying to delete the Contacts, error msg: \" + error);\n }\n}", "title": "" }, { "docid": "cafe0008b04af41be89594dc78f4b5cd", "score": "0.59419805", "text": "function deleteDataAll(db) {\n if (dbType === \"IDB\") {\n idbObjectStore = db.transaction(DB_TABLE_NAME, \"readwrite\").objectStore(DB_TABLE_NAME);\n idbObjectStore.clear();\n } else if (dbType === \"SQL\") {\n db.transaction(function(t) {\n t.executeSql(\"DELETE FROM \" + DB_TABLE_NAME + \" WHERE id > 0\", []);\n });\n }\n}", "title": "" }, { "docid": "73ea4f0ef78fbb742a54cf00ce74fa3a", "score": "0.59394205", "text": "function supContact() {\n console.log('supContact');\n if ($(this).data('id') != null) {\n contactId = $(this).data('id');\n console.log(contact[contactId]);\n for (var info in contact) {\n console.log(contact[info][contactId]);\n contact[info].splice(contactId,1);\n }\n console.log('suppress done');\n } else {\n console.log('Erreur. Choisissez un contact à supprimer.');\n }\n console.log(contact);\n saveWebstorage();\n}", "title": "" }, { "docid": "3118dbafe207b7a24d0f2eafe43ec977", "score": "0.5932521", "text": "cleanRows() {\n const $table = this.getTable();\n\n $table.find('tbody').html('');\n }", "title": "" }, { "docid": "8b06426f1e145baaeb890f96036094b7", "score": "0.5929501", "text": "function clear_rows() {\n $('#history_data').empty();\n }", "title": "" }, { "docid": "71af38797b2178116074f4b225f237f0", "score": "0.5924356", "text": "function deleteGrid(){\n var tableId = document.querySelector('table');\n for (var i=tableId.rows.length; i>0; i--){\n tableId.deleteRow(i-1);\n };\n}", "title": "" }, { "docid": "e5d3524deabb0fdf129e7114bf8c80c9", "score": "0.5919669", "text": "function DeleteRow(row) {\n row.remove();\n}", "title": "" }, { "docid": "7c99aaf15f95452e34d7bac26e6dcc9e", "score": "0.5917734", "text": "function clearForm() {\r\n while (tbody.firstChild) {\r\n tbody.removeChild(tbody.firstChild);\r\n }\r\n}", "title": "" }, { "docid": "52846dc3f495cf64ef09c38f0f4f8ed3", "score": "0.59142256", "text": "function deleteContactByUser(eventobject){\n\t\tvar contact = kony.contact.find(eventobject[\"selectedItems\"][0][\"lblContact\"],true);\n\t\tkony.contact.remove(contact[0]);\n\t\tdeleteContactSearch();\n}", "title": "" }, { "docid": "42adc0098e6a4900d999c5de8896a713", "score": "0.5911904", "text": "deleteMultiple(){ /** todo */ }", "title": "" }, { "docid": "165308a8fe7219b08d30f2d996ee5cbc", "score": "0.5905972", "text": "function clearDataTable(){\n \tvar quantity_rows=$(\"#table1 tr\").length;\n //se borrar la tabla si tiene contenido\n if(quantity_rows>1){\n \tfor(var i=quantity_rows ;i>1 ;i--){\n \t\t$(\"#table1 tr:last\").remove();\n \t}\n }\n }", "title": "" }, { "docid": "7bdb14ae8284509406d0050c304785fe", "score": "0.5902282", "text": "function deleteall(){\n var Table = document.getElementById(\"demo\");\n Table.innerHTML = \"\";\n}", "title": "" }, { "docid": "0533803f72d6be277b2763a28906e64c", "score": "0.5883157", "text": "function remove_del(){\n\tconst tbody = document.getElementsByTagName('tbody')[0];\n\ttbody.deleteRow(-1);\n}", "title": "" }, { "docid": "c7af3e7690a004c7ccf4d6ee52abe1b9", "score": "0.58801055", "text": "function removeAllTasks() {\n var list = table.rows;\n var checkedRows = checkList.getRows();\n\n if (checkedRows.length == 0) {\n // remove all rows\n for (var i = list.length-1; i > 0; i--) {\n table.deleteRow(list[i].rowIndex);\n }\n } else {\n // remove only checked rows\n var reverseRows = checkedRows.slice(0).reverse();\n for (var i in reverseRows) {\n table.deleteRow(reverseRows[i]);\n // clear list from deleted row indexes\n checkList.processRowIndex(reverseRows[i], false);\n }\n }\n}", "title": "" }, { "docid": "c3fd2a5f9d3d66f10cf565c374f364f9", "score": "0.586698", "text": "function SeeAllContactManager() {\n\tconsole.log('seeAllContacts');\n\t$.ajax({\n\t\ttype: 'GET',\n\t\turl: rootURL+ '/contacts',\n\t\tdataType: \"json\", // data type of response\n\t\tsuccess: function(data){\n\t\t\t$(\"#AllContactManager td\").parent().remove();\n\t\t\tvar trHTML = '';\n\t\t\t$.each(data, function (i, item) {\n\t\t\t\ttrHTML += '<tr><td>' + item.id + '</td><td>' + item.name + '</td><td>' + item.family + '</td><td>'+ item.homephone + '</td><td>'+ item.cellphone + '</td><td>'+ item.email +'</td><td><a href=\"#\" onclick=\"DeleteContact('+item.id+');\">'+\"Delete\"+'</a></td></tr>';\n\t\t\t});\n\t\t\t$('#AllContactManager').append(trHTML);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "c23fa0c7a67d24cc5e1e9f9f5e03e19a", "score": "0.586681", "text": "function deleteTable(){\n var rowsTable = $('tbody tr').length;\n for(var r=rowsTable; r>=0; r--)\n {\n $(\"tbody tr:eq('\"+ r +\"')\").remove(); \n };\n}", "title": "" }, { "docid": "11327bca973cdfc03f9c38cb1e1e9897", "score": "0.5866371", "text": "function doRemoveDeletedHints () {\n $('#hintTable').find('tr').each(function () {\n var row = $(this);\n if (row.find('input[type=\"checkbox\"]').is(':checked') ) {\n var rid = row.attr('id');\n theProblem.numHints--;\n row.remove();\n\n }\n });\n}", "title": "" }, { "docid": "49603e693e14537d6b988994126c39bb", "score": "0.5863001", "text": "function delete_row_act(data_table_id, row_no){\n row_no -= 1;\n $(\"#\"+data_table_id+\" tr[id=\"+row_no+\"]\").remove();\n if(act_sec_list[row_no]['from_db'] == 'Yes'){\n act_sec_list[row_no]['soft_delete'] = \"Yes\";\n }else{\n act_sec_list.splice(row_no, 1);\n }\n $(\"#chargesheet_act_sec\").html(build_rows_act(act_sec_list));\n}", "title": "" }, { "docid": "ae689da34124d3f14c39ca4d218bafd0", "score": "0.5861412", "text": "deleteAt(index) {\n this.contact.splice(index, 1);\n console.log(this.contact);\n }", "title": "" }, { "docid": "1267751530d649607cbe952dce7c4fcf", "score": "0.58544654", "text": "resetTable(){\n let table = this.getTableBody();\n //clear existing rows\n while(table.children.length > 1){\n table.deleteRow(1);\n }//clear\n }", "title": "" }, { "docid": "1267751530d649607cbe952dce7c4fcf", "score": "0.58544654", "text": "resetTable(){\n let table = this.getTableBody();\n //clear existing rows\n while(table.children.length > 1){\n table.deleteRow(1);\n }//clear\n }", "title": "" }, { "docid": "8be1411b941147ec431bf6b23235c14b", "score": "0.5851076", "text": "function deleteRows()\n{\n var x = table.rows.length; \n if(x>11){\n document.getElementById(\"myTable\").deleteRow(table.rows.length-1); \n }\n calc();\n}", "title": "" }, { "docid": "377ecf5caefb674970dfd21507a674da", "score": "0.5846275", "text": "function deleteList() {\n\n\t\t// Save the array to localStorage\n\t\tsaveObject();\n\n\t\t// Clear the array\n\t\tcriterionPanelObject.subCriteria = [];\n\n\t\t// Render the UI list\n\t\trenderList();\n\n\t\t// Reveal the undo link\n\t\t$undoLink.removeClass( 'hidden' );\n\n\t}", "title": "" }, { "docid": "8173a9e66294bdb8268b7e05912fdb85", "score": "0.58441585", "text": "function DELETEALL() {\n\t\tdb.connect(function(client) {\n\t\t\tclient.query(\"DELETE FROM tumblr_posts\", function(err, res) {\n\t\t\t\tif(err) {\n\t\t\t\t\tconsole.log(\"could not delete tumblr_posts: \" + err);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"DELETED tumblr_posts\");\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "cea24aa75791f68e2061624b3afd868d", "score": "0.58304024", "text": "function deleteContact(i) {\n\t\t\n\tvar success = true;\n\t\t\t\t\n\tvar xhr = new XMLHttpRequest();\n\txhr.open('POST', 'delete_contact.py', true);\n\txhr.onreadystatechange = function() {\n\t\t//Call a function when the state changes.\n\t if(xhr.readyState == 4 && xhr.status == 200) {\n\t var res = xhr.responseText;\n\t try { \n\t\t var json = JSON.parse(xhr.responseText);\n\t\t if(json[\"success\"]) {\n\t\t \tcontacts.splice(i, 1);\n\t\t \tshowContacts();\n\t\t }\n\t\t else {\n\t\t \tmessage = json[\"message\"];\n\t\t \tprompMessage(message);\n\t\t }\n\t\t }\n\t\t catch(e) {\n\t\t \tconsole.log(e);\n\t\t \tsuccess = false;\n\t\t }\n\t }\n\t}\n\tvar data = new FormData();\n\tdata.append('id', i);\n\txhr.send(data); \t\t\n\t\n\t//This is added as a place holder, since actual call to backend won't complete during testing\n //this step is added to test the delete functionality from UI perspective\n\tif(success) {\n\t\t\tcontacts.splice(i, 1);\n\t\t\tshowContacts();\n\t}\n}", "title": "" }, { "docid": "2c5c4a508cde88825456ee6d0d30eb26", "score": "0.5825727", "text": "function removeAllRows(table){\n\twhile(table.rows.length > 1){\n\t\ttable.deleteRow(1);\n\t}\n}", "title": "" }, { "docid": "6a841ae916edfc09d56b978e6251864f", "score": "0.5821038", "text": "function deleteFromBook(){\n\t\tvar table = document.getElementById('address-book');\n\t\tvar chekbox = document.getElementsByName('checkboxAddressList');\n\t\taddressBookData = JSON.parse(localStorage['addbook']);\n\t\tfor(var n = chekbox.length - 1; n >= 0; n--){\n\t\t\tif(null != chekbox[n] && true == chekbox[n].checked) {\n\t\t\t\ttable.deleteRow(n);\n\t\t\t\taddressBookData.splice(n,1);\n\t\t\t}\t\n\t\t}\n\t\tlocalStorage['addbook'] = JSON.stringify(addressBookData);\n\t}", "title": "" }, { "docid": "57e8e9bcb58ada9cbbfe76d1241fd185", "score": "0.5810951", "text": "deleteAll() {\n\t\tvar copyList = Array.from(this.project.todoList);\n\t\tfor (let index in copyList) {\n\t\t\tlet todo = copyList[index];\n\n\t\t\tthis.delete(todo.title);\n\t\t}\n\n\t\tDisplay.updateMessage(`Project: '${this.project.name}' todo list cleared`);\n\t}", "title": "" }, { "docid": "9ecca38580322af6515d16331315a61f", "score": "0.5801955", "text": "function delListData(modulo){\r\r var dados = new Array();\r\r $('#listGrid :checkbox:checked').each(function(e,grid){\r\r dados.unshift($(grid).parent().parent().attr('id'));\r\r });\r\r \r\r if(confirm('Deseja realmente excluir os dados selecionados ?')){\r\r $.post('../_ax/axRequest.php',{\r\r modulo:modulo,\r\r method:'excluir',\r\r args:[dados]\r\r },function(data){\r\r $('#listGrid').trigger(\"reloadGrid\");\r\r });\r\r }\r}", "title": "" }, { "docid": "33630de58f2b8cec5a3edd38d799c4ca", "score": "0.5789344", "text": "function deleteSelectedClientContact(){\n\tvar client_id = jQuery('#client_id').val();\n\tvar contact_id = $('#contactsgrid').yiiGridView('getSelectedRows');\n\tif(contact_id=='')\n\t\t\talert(\"Please select a record to perform this action.\");\n\t\n\tvar newkeys = contact_id.toString().split(\",\");\n\tvar str = [];var str_val;\n\tfor(var i=0;i<newkeys.length;i++){\n\t\tvar val = JSON.parse(decodeURIComponent($( '.chk_contact_type_'+newkeys[i] ).val()));\n\t\tstr_val = \" \"+val['contact_type'];\n\t\tstr.push(str_val);\n\t}\n\tvar str_length = str.length;\n\tif (client_id == '' || client_id == 0 || client_id == 'undefined') {\n\t\talert('Client is not identified, please try again.');\n\t\treturn false;\n\t} else if(contact_id == '' || contact_id == 'undefined' || contact_id.length == 0){\n\t\talert('Please select a record to perform this action.');\n\t\treturn false;\t\t\n\t} else {\n\t\tif(confirm('Are you sure you want to Remove the selected '+str_length+' record(s):'+str+'?')){\n\t\t\tjQuery.ajax({\n\t\t\t\turl: baseUrl +'/client/delete-selected-client-contacts',\n\t\t\t\tdata:{client_id: client_id,contact_id:contact_id},\n\t\t\t\ttype: 'post',\n\t\t\t\tbeforeSend:function (data) {showLoader();},\n\t\t\t\tsuccess: function (data) {\n\t\t\t\t\thideLoader();\n\t\t\t\t\tif(data == 'OK'){\n\t\t\t\t\t\tloadClientContactList();\n\t\t\t\t\t} else {\n\t\t\t\t\t\talert('Something is wrong, please try again.');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e01b1b3453c41a5bd80e797f8d38d704", "score": "0.5784732", "text": "function purgeAllRecordsOfCrime(crime)\n{\n let output = document.getElementById('affected-rows');\n $.ajax({\n url: '/query/all/' + crime,\n type: 'DELETE',\n cache: false,\n dataType: 'json',\n success: function (data)\n {\n deleteCrimeType(crime)\n },\n error: function (jqXHR, textStatus, errorThrown)\n {\n $(\"#affected-rows\").fadeIn();\n output.innerHTML = \"An error occurred\";\n }\n });\n}", "title": "" }, { "docid": "0269ea444144b239bc7975bc14537dc1", "score": "0.5784245", "text": "function del(){\nvar table = document.getElementById(\"tables\");\ntable.deleteRow(-1);\n}", "title": "" }, { "docid": "5819f6f32e32f265a52facc0b81415dc", "score": "0.57833433", "text": "empty() {\n\t\tthis.listOfContacts = [];\n\t}", "title": "" }, { "docid": "53803e4b8a7e609cd0d2bc0eef29770c", "score": "0.5782385", "text": "function deleteAll() {\n database\n .collection(\"messages\")\n .get()\n .then((res) => {\n res.forEach((element) => {\n element.ref.delete()\n })\n })\n}", "title": "" }, { "docid": "de869ff51687253ac8b5b42713cfa02e", "score": "0.57784086", "text": "function clearCart() {\n var rowCount = table.rows.length;\nfor (var x=rowCount-1; x>0; x--) {\n myTable.deleteRow(x);\n}\n}", "title": "" }, { "docid": "bc32a1db22f5772c003d4402a16d8ade", "score": "0.57783914", "text": "function deleteRecord() {\n // give user a change to abort\n let confirmMsg = `About to delete 1 employee record!`;\n if ( !confirm(confirmMsg) ) return false // abort\n // move forward with delete\n let eq = $(this).eq();\n let rowIndex = eq.prevObject[0].parentElement.parentNode.rowIndex;\n employeeTable.splice(rowIndex, 1);\n displayRecords();\n return;\n} // end of deleteRecord fn", "title": "" }, { "docid": "916783bb6c25db1ed3d8495f5a779577", "score": "0.5777711", "text": "function dele(r)\n{ \n\tvar i=r.parentNode.parentNode.rowIndex;\n \tdocument.getElementById(\"list\").deleteRow(i);\t\t\n}", "title": "" }, { "docid": "a8353c35f97819ea54dbd64e28aee185", "score": "0.5777132", "text": "removeMoreItem(contoLName, index) {\n const contactsFormArray = this.submitUser.get(contoLName);\n contactsFormArray.removeAt(index);\n contactsFormArray.markAsDirty();\n contactsFormArray.markAsTouched();\n // this.contactList.removeAt(index);\n }", "title": "" }, { "docid": "a8353c35f97819ea54dbd64e28aee185", "score": "0.5777132", "text": "removeMoreItem(contoLName, index) {\n const contactsFormArray = this.submitUser.get(contoLName);\n contactsFormArray.removeAt(index);\n contactsFormArray.markAsDirty();\n contactsFormArray.markAsTouched();\n // this.contactList.removeAt(index);\n }", "title": "" }, { "docid": "a00b902bde5e9b502b86a382b6a934e5", "score": "0.57738066", "text": "function deleteAllRows(value) {\n \n farechart.clearAllRows(\"dataTable\"); \n if(value == 2)\n { \n farechart.optionEnable(\"stopname\");\n }\n }", "title": "" }, { "docid": "0674f0fb5083accc9ed951d280b16606", "score": "0.5768358", "text": "function removeAll(){\n\tvar prompts = Components.classes[\"@mozilla.org/embedcomp/prompt-service;1\"]\n\t\t.getService(Components.interfaces.nsIPromptService);\n\tvar result = prompts.confirm(null, \"Remove All Records\", \"Are you sure you wish to remove all login records?\");\n\tif (result) {\n\t\tpiigeon.dbController.deleteLoginItemAll();\n\t\tvar rlb = document.getElementById(\"id-rlb\");\n\t\twhile (rlb.firstChild){\n\t\t\trlb.removeChild(rlb.firstChild);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ae1e0f779d9ae0ab85cd10349f675af2", "score": "0.5767553", "text": "deleteALL(){\n for (var i = 0; i < this.row; i++) {\n for (var j = 0; j < this.col; j++) {\n var tdCell = this.getId( i + \" \" + j);\n tdCell.onmousedown = null;\n }\n }\n }", "title": "" }, { "docid": "dc5d5e3d83f342d7a456a33d78a3b225", "score": "0.5764523", "text": "deleteInit() {\n //console.log('delete me!!');\n db.result(`delete from init_reminders\n where phone = $1`,\n [this.phone]\n )}", "title": "" }, { "docid": "3076ca56573e1150967c20404852ff0c", "score": "0.575562", "text": "function deleteAll() {\n list.innerHTML = \"\";\n}", "title": "" } ]
37610fb450a7e3659a7852bdc95fa568
helpers Augment an target Object or Array by intercepting the prototype chain using __proto__
[ { "docid": "ade5cabb231dae920e53cde318ed8e33", "score": "0.7543528", "text": "function protoAugment(target, src) {\n\t /* eslint-disable no-proto */\n\t target.__proto__ = src;\n\t /* eslint-enable no-proto */\n\t}", "title": "" } ]
[ { "docid": "71ff768ea0aa25922e1234c9f6598087", "score": "0.7685415", "text": "function protoAugment(target,src){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "title": "" }, { "docid": "71ff768ea0aa25922e1234c9f6598087", "score": "0.7685415", "text": "function protoAugment(target,src){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "title": "" }, { "docid": "7cf6849c2d9473df5f4058b85da35522", "score": "0.75344694", "text": "function protoAugment (target, src) {\n\t /* eslint-disable no-proto */\n\t target.__proto__ = src;\n\t /* eslint-enable no-proto */\n\t}", "title": "" }, { "docid": "7cf6849c2d9473df5f4058b85da35522", "score": "0.75344694", "text": "function protoAugment (target, src) {\n\t /* eslint-disable no-proto */\n\t target.__proto__ = src;\n\t /* eslint-enable no-proto */\n\t}", "title": "" }, { "docid": "7cf6849c2d9473df5f4058b85da35522", "score": "0.75344694", "text": "function protoAugment (target, src) {\n\t /* eslint-disable no-proto */\n\t target.__proto__ = src;\n\t /* eslint-enable no-proto */\n\t}", "title": "" }, { "docid": "e93532f88964af348e3543b49c931c33", "score": "0.7532065", "text": "function protoAugment(target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n }", "title": "" }, { "docid": "34dc74edbdb3992098beec136041a45a", "score": "0.7530782", "text": "function protoAugment(target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n }", "title": "" }, { "docid": "1a4b17827687e40e4ff23f33790fe4a5", "score": "0.7529574", "text": "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "title": "" }, { "docid": "1a4b17827687e40e4ff23f33790fe4a5", "score": "0.7529574", "text": "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "title": "" }, { "docid": "d49642d2aef1fa6c7e5c9849e629a1b1", "score": "0.75247", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n }", "title": "" }, { "docid": "d49642d2aef1fa6c7e5c9849e629a1b1", "score": "0.75247", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n }", "title": "" }, { "docid": "d49642d2aef1fa6c7e5c9849e629a1b1", "score": "0.75247", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n }", "title": "" }, { "docid": "d49642d2aef1fa6c7e5c9849e629a1b1", "score": "0.75247", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n }", "title": "" }, { "docid": "d49642d2aef1fa6c7e5c9849e629a1b1", "score": "0.75247", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n }", "title": "" }, { "docid": "d49642d2aef1fa6c7e5c9849e629a1b1", "score": "0.75247", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n }", "title": "" }, { "docid": "d49642d2aef1fa6c7e5c9849e629a1b1", "score": "0.75247", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n }", "title": "" }, { "docid": "d49642d2aef1fa6c7e5c9849e629a1b1", "score": "0.75247", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n }", "title": "" }, { "docid": "d49642d2aef1fa6c7e5c9849e629a1b1", "score": "0.75247", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n }", "title": "" }, { "docid": "d49642d2aef1fa6c7e5c9849e629a1b1", "score": "0.75247", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n }", "title": "" }, { "docid": "27d1e6b7882f1e77b44135bb50846da3", "score": "0.74997914", "text": "function protoAugment(target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n}", "title": "" }, { "docid": "ff975fa9ba9bd207757215e0c6ead2fd", "score": "0.74965245", "text": "function protoAugment(target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "ff975fa9ba9bd207757215e0c6ead2fd", "score": "0.74965245", "text": "function protoAugment(target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "ff975fa9ba9bd207757215e0c6ead2fd", "score": "0.74965245", "text": "function protoAugment(target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "ff975fa9ba9bd207757215e0c6ead2fd", "score": "0.74965245", "text": "function protoAugment(target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "ff975fa9ba9bd207757215e0c6ead2fd", "score": "0.74965245", "text": "function protoAugment(target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "ff975fa9ba9bd207757215e0c6ead2fd", "score": "0.74965245", "text": "function protoAugment(target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "ff975fa9ba9bd207757215e0c6ead2fd", "score": "0.74965245", "text": "function protoAugment(target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "ff975fa9ba9bd207757215e0c6ead2fd", "score": "0.74965245", "text": "function protoAugment(target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "ff975fa9ba9bd207757215e0c6ead2fd", "score": "0.74965245", "text": "function protoAugment(target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "ff975fa9ba9bd207757215e0c6ead2fd", "score": "0.74965245", "text": "function protoAugment(target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" }, { "docid": "909db7ceb4d00121f3170a61c8e7e697", "score": "0.74941826", "text": "function protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}", "title": "" } ]
2df26bd62fbfffed2b324564bbd13a96
Root Wizard Current Tab
[ { "docid": "673b3a0de1c9184907ede7fa4240d3f5", "score": "0.0", "text": "function setCurrentProgressTab($rootwizard, $nav, $tab, $progress, index)\n {\n $tab.prevAll().addClass('completed');\n $tab.nextAll().removeClass('completed');\n\n var items \t = $nav.children().length,\n pct = parseInt((index+1) / items * 100, 10),\n $first_tab = $nav.find('li:first-child'),\n margin = (1/(items*2) * 100) + '%';//$first_tab.find('span').position().left + 'px';\n\n if( $first_tab.hasClass('active'))\n {\n $progress.width(0);\n }\n else\n {\n if(rtl())\n {\n $progress.width( $progress.parent().outerWidth(true) - $tab.prev().position().left - $tab.find('span').width()/2 );\n }\n else\n {\n $progress.width( ((index-1) /(items-1)) * 100 + '%' ); //$progress.width( $tab.prev().position().left - $tab.find('span').width()/2 );\n }\n }\n\n\n $progress.parent().css({\n marginLeft: margin,\n marginRight: margin\n });\n\n /*var m = $first_tab.find('span').position().left - $first_tab.find('span').width() / 2;\n\n $rootwizard.find('.tab-content').css({\n marginLeft: m,\n marginRight: m\n });*/\n }", "title": "" } ]
[ { "docid": "e011a4e302d27409310938eeceed5993", "score": "0.66830575", "text": "getCurrentTab()\n {\n return this.currentTab;\n }", "title": "" }, { "docid": "464037eac74ce9ab0b3144c9fc5d5680", "score": "0.6620657", "text": "function getCurrentTab() {\n return currentTab;\n}", "title": "" }, { "docid": "464037eac74ce9ab0b3144c9fc5d5680", "score": "0.6620657", "text": "function getCurrentTab() {\n return currentTab;\n}", "title": "" }, { "docid": "ac57eeee20f9deae919e9f23501ad96b", "score": "0.6597868", "text": "function _defaultTab() {\n home.classList.add('choiceButton');\n tabArray.push('Home');\n }", "title": "" }, { "docid": "b2313edf3fdcc5d356f3dc27f87eb232", "score": "0.6451329", "text": "_firstTab() {\n const tabs = this._allTabs();\n return tabs[0];\n }", "title": "" }, { "docid": "c01c51914b9e169845e742f5b3476c68", "score": "0.63249904", "text": "function getCurrentTabId(){\r\n return app.layerCurrent.graphics[0].attributes.tab_id;\r\n }", "title": "" }, { "docid": "2f1878a613fcf4c8b4f2c731ebeb8a8b", "score": "0.61875117", "text": "auto () {\n\t\tlet self = this;\n\t\tjQuery(document).ready(function () {\n\t\t\tvenus.get('tabs').children('a').each(function () {\n\t\t\t\tlet id = venus.get(this).attr('id');\n\t\t\t\tlet tab_id = id.replace('tab-', '');\n\n\t\t\t\tif (tab_id == self.current_tab_id) {\n\t\t\t\t\tvenus.get('tab-' + tab_id).addClass('current');\n\t\t\t\t\tvenus.get('tab-content-' + tab_id).show();\n\t\t\t\t} else {\n\t\t\t\t\tvenus.get('tab-content-' + tab_id).hide();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "7aac1cbfde91defef8aaea51a935c5a1", "score": "0.60955983", "text": "function ShowCurrentVisibleTab(){\r\n\ttry{\r\n\t\tsetNestedApplicationVisible(getTab(), true);\r\n\t}catch(e){\r\n\t\t//just continue\r\n\t}\r\n}", "title": "" }, { "docid": "b61d44176e52fd1ebaf4945bee1e8a85", "score": "0.6000836", "text": "function getSelectedImbaGameTabIndex(){\n return $('#imbaGameNav').tabs('option', 'selected');\n}", "title": "" }, { "docid": "4191af5df73eb81f14a76c250d078783", "score": "0.599454", "text": "get loginTab() {return browser.element(\"~Go to Log in\");}", "title": "" }, { "docid": "8866ebe66db03bfc3db016131f8f2d16", "score": "0.59300566", "text": "function tab(){\n\tvar tabWin = Alloy.createController('tabWin').getView();\n}", "title": "" }, { "docid": "582713f4d8836207619936e61991add0", "score": "0.5832157", "text": "function getSelectedTabIndex(){\n return $(\"#tabs\").tabs('option', 'active');\n}", "title": "" }, { "docid": "f619f28a45529049d0a1c6870a49659c", "score": "0.5830571", "text": "focusFirstTab() {\n\t\tthis.buttons[0].focus();\n\t}", "title": "" }, { "docid": "ad2bfaf21f29e82ddf791377f0ab08cb", "score": "0.5811609", "text": "focusSelectedTab() {\n this.preferencesTabs.focusSelectedTab();\n }", "title": "" }, { "docid": "5551747a6d8145930948fdcc9ae4db51", "score": "0.57901484", "text": "function Root() {\n return (\n\n <Tab.Navigator>\n <Tab.Screen name=\"Map\" component={Map} />\n <Tab.Screen name=\"Create Group\" component={CreatGroup} />\n <Tab.Screen name=\"Chat Window\" component={Chat} />\n </Tab.Navigator>\n );\n}", "title": "" }, { "docid": "d9482a1d78a4a34c14289334a3b5a0e1", "score": "0.57778853", "text": "function onAfterRender() {\n Ext.History.on('change', function (token) {\n var parts, tabPanel, length, i;\n if (token) {\n parts = token.split(\":\");\n Ext.getCmp('tabpanel').setActiveTab(Ext.getCmp(parts[0]));\n length = parts.length;\n // setActiveTab in all nested tabs\n //for (i = 0; i < length - 1; i++) {\n // Ext.getCmp(parts[i]).setActiveTab(Ext.getCmp(parts[i + 1]));\n //}\n }\n });\n\n //打开上一次操作Tab(此方法耦合性较强,大量直接应用Default页面的变量)\n var token = Ext.History.getToken();\n if (token != null) {\n window.setTimeout(function () {\n var value = document.getElementById(\"__PAGESTATE\").value\n var moduleObj = Ext.decode(value);\n var moduleArr = Ext.decode(moduleObj[0].Value);\n var tab = Ext.getCmp(token.split(\":\")[0]); //key:Value split\n\n if (moduleArr != null && tab == null && Ext.isArray(moduleArr)) {\n var tabCmp = Ext.getCmp('tabpanel');\n for (var i = 0; i < moduleArr.length; i++) {\n var item = moduleArr[i], url = item.Url;\n if (item.ID == token.split(\":\")[0]) {\n //添加tab\n tabCmp.add(new Ext.Panel({\n id: item.ID,\n closable: true,\n title: item.Name,\n tabTip: item.Name,\n html: '<iframe width=\"100%\" height=\"100%\" id=\"defaultPgFrame\" src=\"' + url + '\" name=\"frameContent\" frameborder=\"0\"></iframe>'\n }));\n tabCmp.setActiveTab(item.ID);\n break;\n }\n }\n }\n }, 200);\n } else {\n // This is the initial default state. Necessary if you navigate starting from the\n // page without any existing history token params and go back to the start state.\n var activeTab1 = Ext.getCmp('tabpanel').getActiveTab();\n onTabChange(Ext.getCmp('tabpanel'), activeTab1);\n }\n}", "title": "" }, { "docid": "c7b894646fa48b5c3ced7bbd602a9d6a", "score": "0.5756512", "text": "setCurrentTab(newValue)\n {\n this.currentTab = newValue;\n }", "title": "" }, { "docid": "1c5e7fdaf7b41c79945ee7ab1eea06f6", "score": "0.5755076", "text": "function tabShowRepo(event, ui) {\n// var idx = document.getElementById(\"EMP_ID\").value;\n if (ui.newTab.index() == 3) {\n llenaSelectTipo();\n }\n if (ui.newTab.index() == 4) {\n loadSeminarioScreen();\n }\n if (ui.newTab.index() == 5) {\n loadDiplomadoScreen();\n }\n}", "title": "" }, { "docid": "f5997b773e31f4192ee76b53db5ce26c", "score": "0.57296044", "text": "setUpWizard() {\n $(document).ready(() => {\n this.generateModal();\n\n console.log('Document ready');\n $('#rootwizard').bootstrapWizard({\n onTabShow: (tab, navigation, index) => {\n const $total = navigation.find('li').length;\n console.log('total', $total);\n const $current = index + 1;\n console.log('current', $current);\n const $percent = ($current / $total) * 100;\n console.log('percent', $percent);\n $('#rootwizard .progress-bar').css({ width: $percent + '%' });\n\n const penultimateTab = this.tabsAmount - 1;\n console.log('penultimateTab', penultimateTab);\n\n console.log('$current === penultimateTab', $current === penultimateTab);\n if ($current == penultimateTab) {\n $('#next-submit').text('Submit');\n } else {\n $('#next-submit').text('Next');\n }\n },\n onNext: (tab, navigation, index) => {\n const $valid = $(\"#formWizard\").valid();\n if (!$valid) {\n return false;\n }\n },\n onPrevious: (tab, navigation, index) => {\n $('#request-loading').show();\n $('#request-success').hide();\n $('#request-error').hide();\n },\n });\n });\n }", "title": "" }, { "docid": "35bb1cfd972c858bee9cca80e989e0b8", "score": "0.5715378", "text": "asRootNode() {\n return this.tabAsRoot_;\n }", "title": "" }, { "docid": "6e3470369ceed2123e9698a76780bafc", "score": "0.5714053", "text": "back() {\n if (!this.panels.findActive() || !this.panels.findActive().parent) {\n this.close();\n return;\n }\n\n this.backTo(this.panels.findActive().parent.id, true);\n }", "title": "" }, { "docid": "7d7ed4075044dac409a9a2be5edd9ccb", "score": "0.5712111", "text": "function TabsPage() {\n this.tab1Root = __WEBPACK_IMPORTED_MODULE_1__home_home__[\"a\" /* HomePage */];\n this.tab2Root = __WEBPACK_IMPORTED_MODULE_2__login_login__[\"a\" /* LoginPage */];\n this.tab3Root = __WEBPACK_IMPORTED_MODULE_3__register_register__[\"a\" /* RegisterPage */];\n this.tab4Root = __WEBPACK_IMPORTED_MODULE_4__findpassword_findpassword__[\"a\" /* FindpasswordPage */];\n // this.nav.setRoot(TabsPage);\n // this.tabRef.select(2);\n }", "title": "" }, { "docid": "3d25bfb4e9baaec11d5d901b3b6462cc", "score": "0.57067335", "text": "function setActiveTab() {\n\n}", "title": "" }, { "docid": "8eaeee153c72791fa0c8a460fa2ab237", "score": "0.5703638", "text": "function getActiveTab() {\n return $('#steps li.active a').attr('href').replace('#', '');\n}", "title": "" }, { "docid": "da6bcd3083fbf22f67f28eb0c4f00c06", "score": "0.5690142", "text": "reset() {\n this.selectTab(0);\n }", "title": "" }, { "docid": "909924c866cff04f523a20a41dd0cd4e", "score": "0.56855273", "text": "function getDefaultTabIndex(tabGroup)\n\t{\n\t\tvar defaultTab = tabGroup.data('defaultTab');\n\t\tif (defaultTab === null || defaultTab === '' || defaultTab === undefined)\n\t\t{\n\t\t\tvar firstTab = tabGroup.children('.current:first');\n\t\t\tdefaultTab = (firstTab.length > 0) ? firstTab.index() : 0;\n\t\t\ttabGroup.data('defaultTab', defaultTab);\n\t\t}\n\t\t\n\t\treturn defaultTab;\n\t}", "title": "" }, { "docid": "c14424bd99c6eaa61a5c7466f514756c", "score": "0.56793636", "text": "function RootCtrl() {\n }", "title": "" }, { "docid": "68c08d466f96df90112ed691e6f4f86d", "score": "0.5670295", "text": "function openTabHome(tabName,elmnt) {\n\t\tvar i, tabcontent, tablinks;\n\n\t tabcontent = document.getElementsByClassName(\"tabcontent\");\n\t for (i = 0; i < tabcontent.length; i++) {\n\t tabcontent[i].style.display = \"none\";\n\t }\n\t document.getElementById(tabName).style.display = \"block\";\n\n\t tablinks = document.getElementsByClassName(\"tablink\");\n\t for (i = 0; i < tablinks.length; i++) {\n\t tablinks[i].classList.remove(\"p4-active\");\n\t }\n\n\t elmnt.classList.add(\"p4-active\");\n\t}", "title": "" }, { "docid": "f133f70998fdbe9c2e4c913cd9b4f6d8", "score": "0.5666085", "text": "get formTab() {return browser.element(\"~Form\");}", "title": "" }, { "docid": "0f6146b2645045fc7894c8aead468819", "score": "0.56570584", "text": "focusLastTab() {\n\t\tthis.buttons[this.buttons.length - 1].focus();\n\t}", "title": "" }, { "docid": "52d92470f5676101dac7b3c38014e1e0", "score": "0.56428367", "text": "_nextTab() {\n const tabs = this._allTabs();\n let newIdx = tabs.findIndex(tab => tab.selected) + 1;\n return tabs[newIdx % tabs.length];\n }", "title": "" }, { "docid": "427296228a1fd2b04c0515b9669c2e01", "score": "0.56346685", "text": "function goToMainContent() {\r\n\r\n\t\t var roleMain = $(\"[role='main']\");\r\n\r\n\t\t if (!roleMain.length) {\r\n\t\t return;\r\n\t\t }\r\n\r\n if (!roleMain.filter(\"[tabindex]\").length) {\r\n roleMain.first().attr(\"tabindex\", \"-1\");\r\n }\r\n\r\n\t\t roleMain.filter(\"[tabindex]\").first().focus();\r\n\t\t}", "title": "" }, { "docid": "697e6a0a46c2772fb997721f5b199ffd", "score": "0.5632692", "text": "get overviewTab() {return browser.element(\"~Overview\");}", "title": "" }, { "docid": "4650cf541728bdd613dbbec22f285cbc", "score": "0.56242293", "text": "showFirstTab() {\n this.allModules.first().show();\n this.unorderedList.find('.module_heading:first').addClass(this.currentClass);\n }", "title": "" }, { "docid": "e237ec126a03741c40aa072ab65f0e94", "score": "0.5621501", "text": "function expandWizardHomepage( accordionId ) {\nvar $accordion = window.top.$(accordionId);\nwindow.top.OpenWizardTab('homepageTab',true);\nif ( $accordion.hasClass('in') ) {\n$accordion.closest('.panel').addClass('p-m-b-wizard-accordion-flash');\nsetTimeout(function() {\n$accordion.closest('.panel').removeClass('p-m-b-wizard-accordion-flash');\n},500);\nreturn;\n}\nwindow.top.$('[href=\"'+accordionId+'\"]').trigger('click');\n}", "title": "" }, { "docid": "89f587d796830544e1c2555a49a4516a", "score": "0.5606192", "text": "function current_couche(){\n return top.document.getElementById(\"tab-couche-travail\").selectedItem.value;\n}", "title": "" }, { "docid": "9cfcf33d32b8e57870a2d93ec8f3f2ee", "score": "0.5595516", "text": "getCurrentTabUrl({ tab }) {\n return tab.url;\n }", "title": "" }, { "docid": "2655dcaba7adfaf934d351cb8db38a74", "score": "0.55934465", "text": "_currentTabBar() {\n const current = this._tracker.currentWidget;\n if (!current) {\n return null;\n }\n const title = current.title;\n const bars = this._dockPanel.tabBars();\n return algorithm_1.find(bars, bar => bar.titles.indexOf(title) > -1) || null;\n }", "title": "" }, { "docid": "38f8e9dd0498cc0b7c1dd4fa23c23f91", "score": "0.5584738", "text": "function init_tabs () {\n var tabs = $ ('#tabs');\n tabs.tabs ({\n /*\n * Display a Wordpress spinner.\n *\n * See: https://make.wordpress.org/core/2015/04/23/spinners-and-dismissible-admin-notices-in-4-2/\n */\n 'beforeLoad' : function (event, ui) {\n ui.panel.html ('<div class=\"spinner-div\"><span class=\"spinner is-active\" /></div>');\n },\n 'load' : function (event, ui) {\n make_cb_select_all (event, ui);\n },\n });\n /*\n * Remove lots of troublesome jQuery-ui styles that we would otherwise have\n * to undo in css because they clash with Wordpress style.\n */\n tabs.parent ().find ('*').removeClass (\n 'ui-widget-content ui-widget-header ui-tabs-panel ui-corner-all ui-corner-top ui-corner-bottom'\n );\n\n /* open the right tab */\n var section = get_url_parameter ('section');\n if (section) {\n var index = tabs.find ('a[data-section=\"' + section + '\"]').parent ().index ();\n tabs.tabs ('option', 'active', index);\n }\n}", "title": "" }, { "docid": "112ebd53aed5d4dc5ad2b3c6c3c8e6ac", "score": "0.5566438", "text": "getUrlTab() {\n var tab = location.href.substr(location.href.lastIndexOf('#') + 1);\n return tab;\n }", "title": "" }, { "docid": "62d8a3f956c307ec4bfa8b5802fe1685", "score": "0.55614585", "text": "renderCurrentTabContent() {\n\t const { children } = this.props;\n\t const { currentTabIndex } = this.state;\n\t if (children[currentTabIndex]) {\n\t // render the content inside the instances of <Tab />\n\t return children[currentTabIndex].props.children;\n\t }\n\t}", "title": "" }, { "docid": "06f02656fe2353272a219c580036d9dd", "score": "0.55566496", "text": "_lastTab() {\n const tabs = this._allTabs();\n return tabs[tabs.length - 1];\n }", "title": "" }, { "docid": "c4915fd971587c4b4438de9227930c76", "score": "0.5555122", "text": "function onload() {\n\tload();\n\topenTab(\"home\");\n}", "title": "" }, { "docid": "82e868e5730591c00950d2958008117c", "score": "0.5551897", "text": "function firstTabVisable() {\n hideTabContent();\n if (firstTabId != '') {\n var firstTabCore = firstTabId.replace(preListVal, \"\");\n makeTabVisable(firstTabCore);\n }\n}", "title": "" }, { "docid": "1d026fb28f9589bc164cc2f7191c32bd", "score": "0.55440295", "text": "get selectedTab() {\n\t\treturn this.nativeElement ? this.nativeElement.selectedTab : undefined;\n\t}", "title": "" }, { "docid": "78f37fc260dc05e955fd6668c79425c1", "score": "0.5540227", "text": "function offerWizardToMain() {\n $('#profileMain').show();\n //$('#newOfferingWizard').hide();\n $('#wizardWell').hide();\n //$('#newOfferingWizard').wizard();\n\n }", "title": "" }, { "docid": "6b36de6987a2dd074c1d6f8ccb22743d", "score": "0.5512523", "text": "tabSwitcher() {\n return this.tabSwitcher_;\n }", "title": "" }, { "docid": "e97d32dc970fdee5e22a041526897c5b", "score": "0.55103266", "text": "function handleCurrentStepLocation(){\r\n\t\t\tif($cookieStore.get('logged')==='true'){\r\n\t\t\t\t\r\n\t\t\t\t// Se l'utente non è un amministratore lo faccio accedere\r\n\t\t\t\tif($cookieStore.get('isAdmin') === 'false'){\r\n\t\t\t\t\t$location.path( \"/currentstep\" );\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$location.path( \"/welcome\" );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$location.path( \"/login\" );\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "a8497ecbc584ea4c72ed7e140d51ddb5", "score": "0.5506555", "text": "getTabInfoForCurrentOrFirstModeInstance(aTabMode) {\n // If we're in the middle of opening a new tab\n // (this._mostRecentTabInfo is non-null), we shouldn't consider the\n // current tab\n let tabToConsider = this._mostRecentTabInfo || this.currentTabInfo;\n if (tabToConsider && tabToConsider.mode == aTabMode) {\n return tabToConsider;\n } else if (aTabMode.tabs.length) {\n return aTabMode.tabs[0];\n }\n\n return null;\n }", "title": "" }, { "docid": "72055513a36bfc85d9aa087c21821843", "score": "0.5493805", "text": "function displayPage() {\n\t\tvar tabIndex = this.parentNode.getAttribute(\"data-current\");\n\t\t\n\t\t// Remove active class and hide old contents\n\t\tdocument.getElementById(\"tabHeader_\" + tabIndex).removeAttribute(\"class\");\n\t\tdocument.getElementById(\"tabPage_\" + tabIndex).style.display=\"none\";\n\n\t\tvar currentTab = this.id.split(\"_\")[1];\n\n\t\t// Add active class of active header to new active tab and show contents\n\t\tthis.setAttribute(\"class\",\"activeTab\");\n\t\tdocument.getElementById(\"tabPage_\" + currentTab).style.display = \"block\";\n\t\tthis.parentNode.setAttribute(\"data-current\", currentTab);\n\t}", "title": "" }, { "docid": "254240c525e2181fc9ca4b329f1f8200", "score": "0.54882747", "text": "function setCurrentTab(t) {\n if (currentTab) {\n // Reset color of the tab before switching\n currentTab.firstChild.style.color = 'rgb(134, 140, 144)';\n currentTab.firstChild.style.fontWeight = '400';\n }\n\n currentTab = t;\n currentTab.firstChild.style.color = 'rgb(75, 81, 85)';\n currentTab.firstChild.style.fontWeight = '600';\n }", "title": "" }, { "docid": "ec0b86f7cdc0d14855ec30db6af94de9", "score": "0.5486133", "text": "function Tab() {\n _classCallCheck(this, Tab);\n\n // Set name of Parent tab if not already defined\n window.name = window.name || 'PARENT_TAB';\n }", "title": "" }, { "docid": "7cf7b44128ab8e345e617f5cdfc17e41", "score": "0.5473594", "text": "function firstStep()\n {\n vm.selectedIndex = 0;\n }", "title": "" }, { "docid": "3414781f3646b0d3dab4303ffa04befa", "score": "0.5469464", "text": "function firstTabVisable() {\n hideTabContent();\n // style the tab\n document.getElementById(firstTabId).classList.add('hcSelectedTab');\n //document.getElementById(firstTabId).classList.add('colorBgGrey');\n\n var firstTabCore = firstTabId.replace(preListVal, \"\");\n makeTabVisable(firstTabCore);\n\n}", "title": "" }, { "docid": "1caf1f8d268a2c53cd9a8422dbe14a80", "score": "0.5469019", "text": "tabSwitcher() {\n return this.tabSwitcher_;\n }", "title": "" }, { "docid": "6dbc2ee24b3a1eb7dc02d07a4a0049b7", "score": "0.5465321", "text": "function CurrentTab(func){ \n chrome.tabs.query({'active': true, 'windowId': chrome.windows.WINDOW_ID_CURRENT},\n function(tabs){\n if(tabs[0]){\n func(tabs[0]);\n }\n });\n}", "title": "" }, { "docid": "cf83d3221dcd3d53d4c6ab03edf25077", "score": "0.5459014", "text": "function displayPage() {\n var current = this.parentNode.getAttribute(\"data-current\");\n //remove class of activetabheader and hide old contents\n document.getElementById(\"tabHeader_\" + current).removeAttribute(\"class\");\n document.getElementById(\"tabpage_\" + current).style.display=\"none\";\n\n var ident = this.id.split(\"_\")[1];\n //add class of activetabheader to new active tab and show contents\n this.setAttribute(\"class\",\"tabActiveHeader\");\n document.getElementById(\"tabpage_\" + ident).style.display=\"block\";\n this.parentNode.setAttribute(\"data-current\",ident);\n}", "title": "" }, { "docid": "f50a74e4ba345215cee705eeb69b2847", "score": "0.5457716", "text": "current() {\r\n return this.page(this.currentFilePath);\r\n }", "title": "" }, { "docid": "2d70471662b9fed33a1ca1a1ca6cc534", "score": "0.54533845", "text": "tabFocus() {\n this.getFocusElement().focus();\n }", "title": "" }, { "docid": "f60a991707d3818846ccdf7602790533", "score": "0.5452702", "text": "function tabChangeCurrent(_t) {\r\n\t\t\tconsole.debug(\"tabChangeCurrent\");\r\n\t\t\t_p.tabObj.find('li').eq(_t).toggleClass('current');\r\n\t\t\tconsole.debug(_p.tabObj.find('li'));\r\n\t\t\tconsole.debug(_p.tabObj);\r\n\t\t}", "title": "" }, { "docid": "f34fafb08256692c4163f29539c68397", "score": "0.5451335", "text": "function HideCurrentVisibleTab(){\r\n\ttry{\r\n\t\tsetNestedApplicationVisible(getTab(), false);\r\n\t}catch(e){\r\n\t\t//just continue\r\n\t}\r\n}", "title": "" }, { "docid": "606fa413a211282ff1e3ff5ab8b99276", "score": "0.54503584", "text": "function getDefaultPage() {\n var frame = frame_1.topmost();\n return getRootPage() || (frame && frame.currentPage);\n}", "title": "" }, { "docid": "56a39cd2f63bd8d8e31d5547d4353241", "score": "0.5446641", "text": "function proceedHome()\n{\n\tvar tabGroup = Titanium.UI.createTabGroup();\n\t\n\tvar homeWin = Titanium.UI.createWindow\n\t({\n\t\turl:'home.js',\n\t\ttitle:'Home',\n\t\tnavBarHidden:true\n\t});\n\t\n\tvar tab = Titanium.UI.createTab\n\t({\n\t window:homeWin,\n\t title:'Home',\n\t icon:'KS_nav_ui.png'\n\t});\n\ttabGroup.addTab(tab);\n\t\n\tloginWin.close();\n\ttabGroup.open({animated:true});\n\n}", "title": "" }, { "docid": "431c012d1fcc691fae062021017499a9", "score": "0.543733", "text": "function displayPage() {\n var current = this.parentNode.getAttribute(\"data-current\");\n //alert(current)\n //remove class of activetabheader and hide old contents\n document.getElementById(\"tabHeader_\" + current).removeAttribute(\"class\");\n document.getElementById(\"tabpage_\" + current).style.display=\"none\";\n\n var ident = this.id.split(\"_\")[1];\n //add class of activetabheader to new active tab and show contents\n this.setAttribute(\"class\",\"tabActiveHeader\");\n document.getElementById(\"tabpage_\" + ident).style.display=\"block\";\n this.parentNode.setAttribute(\"data-current\",ident);\n tabAjaxLoadData(ident);\n}", "title": "" }, { "docid": "32b0037db4027ca0fed39a304af43603", "score": "0.5436889", "text": "function createCurrentButton () {\n const currentTabButton = document.createElement('button')\n const currentTabButtonText = document.createTextNode('Save Current Tab')\n currentTabButton.id = 'current-tab'\n currentTabButton.appendChild(currentTabButtonText)\n container.appendChild(currentTabButton)\n\n currentTabButton.addEventListener('click', storeTab, false)\n}", "title": "" }, { "docid": "58091665575e1ec1926ced4d734498be", "score": "0.5432823", "text": "get runnerTab() {return browser.element(\"~Runners\");}", "title": "" }, { "docid": "86c6b44a6c9439394b453473ec88a0a9", "score": "0.54176116", "text": "function previousPage(){var i,tab,elements=getElements();for(i=0;i<elements.tabs.length;i++){tab=elements.tabs[i];if(tab.offsetLeft+tab.offsetWidth>=ctrl.offsetLeft)break;}ctrl.offsetLeft=fixOffset(tab.offsetLeft+tab.offsetWidth-elements.canvas.clientWidth);}", "title": "" }, { "docid": "ba859f78783146496f027d3cef91a3e7", "score": "0.5416853", "text": "_prevTab() {\n const tabs = this._allTabs();\n const newIdx =\n tabs.findIndex(tab => tab.selected) - 1;\n return tabs[(newIdx + tabs.length) % tabs.length];\n }", "title": "" }, { "docid": "cc1581b07676098341957b6875e5fa9f", "score": "0.5403524", "text": "function handleShiftTab(e, active, tagName) {\r\n var firstPager = $(\"table.rgMasterTable>tfoot div.rgWrap.rgArrPart1 input.rgPageFirst\");\r\n if (firstPager != null && firstPager.length > 0 && active == firstPager[0]) {\r\n // Active item is the first pager item of the main pager bar, need to tab back to last item of the last detail table.\r\n if ($(\"table.rgMasterTable>tbody>tr:last\").hasClass(\"rgRow\") || $(\"table.rgMasterTable>tbody>tr:last\").hasClass(\"rgAltRow\")) { // last detail table not expanded.\r\n var lastItem = $(\"table.rgMasterTable>tbody>tr:last td a\");\r\n if (lastItem != null && lastItem.length > 0) { // Tab to pdf link if there is one\r\n lastItem[0].focus();\r\n e.preventDefault();\r\n }\r\n else {\r\n lastItem = $(\"table.rgMasterTable>tbody>tr:last>td.rgExpandCol>input\");\r\n if (lastItem != null && lastItem.length > 0) { // Tab to the expand button if there is one\r\n lastItem[0].focus();\r\n e.preventDefault();\r\n }\r\n }\r\n }\r\n else { // last detail table expanded.\r\n lastItem = $(\"table.rgMasterTable>tbody>tr:last table.rgDetailTable>tfoot div.RadComboBox.RadComboBox_CRASkin table\");\r\n if (lastItem != null && lastItem.length > 0) { // Tab to the pager if any\r\n $(lastItem).addClass(\"rcbFocused\");\r\n var input = $(lastItem).find(\"input\");\r\n if (input != null && input.length > 0) {\r\n input.focus();\r\n e.preventDefault();\r\n }\r\n }\r\n else {\r\n lastItem = $(\"table.rgMasterTable>tbody>tr:last table.rgDetailTable tbody a:last\");\r\n if (lastItem != null && lastItem.length > 0) { // Tab to pdf link if there is one\r\n lastItem[0].focus();\r\n e.preventDefault();\r\n }\r\n else {\r\n lastItem = $(\"table.rgMasterTable>tbody>tr:last table.rgDetailTable th:last.rgHeader a\");\r\n if (lastItem != null && lastItem.length > 0) { // tab to the header\r\n lastItem[0].focus();\r\n e.preventDefault();\r\n }\r\n }\r\n }\r\n }\r\n }\r\n else { // Active item is the first pager item of a detail table pager, tab to previous pdf if any\r\n if ($(active).hasClass(\"rgPageFirst\")) {\r\n var detailTable = $(active).parents(\"table.rgDetailTable\");\r\n if (detailTable != null && detailTable.length > 0) {\r\n var lastItem = $(detailTable).find('tbody a[href$=\"pdf\"]:last');\r\n if (lastItem != null && lastItem.length > 0) {\r\n lastItem[0].focus();\r\n e.preventDefault();\r\n }\r\n else {\r\n lastItem = $(detailTable).find('tbody a[href$=\"PDF\"]:last');\r\n if (lastItem != null && lastItem.length > 0) {\r\n lastItem[0].focus();\r\n e.preventDefault();\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n var btn = $(\"table.rgMasterTable>tbody>tr:first input\")\r\n if (btn.length > 0 && btn[0] == active) { // Focused is the first expand button, tab to last col of main header\r\n var header = $(\"table.rgMasterTable>thead th:last.rgHeader a\");\r\n if (header.length > 0) {\r\n header.focus();\r\n e.preventDefault();\r\n }\r\n }\r\n else {\r\n if ($(active).hasClass(\"rgCollapse\") || $(active).hasClass(\"rgExpand\")) { // is the expand btn of a detailed view. Need to tab to prev pager if any.\r\n var preTR = $(active).closest(\"tr\").prev();\r\n if (preTR != null && preTR.length > 0) {\r\n if (!($(preTR).hasClass(\"rgRow\") || $(preTR).hasClass(\"rgAltRow\"))) { // Prev detailed view is also expanded.\r\n var lastItem = $(preTR).find(\"table.rgDetailTable>tfoot div.RadComboBox.RadComboBox_CRASkin table\");\r\n if (lastItem != null && lastItem.length > 0) { // Tab to the pager if any\r\n $(lastItem).addClass(\"rcbFocused\");\r\n var input = $(lastItem).find(\"input\");\r\n if (input != null && input.length > 0) {\r\n input.focus();\r\n e.preventDefault();\r\n }\r\n }\r\n }\r\n }\r\n }\r\n else { // if the first pdf link, tab back to the last col of header\r\n if ($(active).is(\"a\") && active.href.indexOf(\"pdf\") != -1) { // is an anchor\r\n var prev = $(active).closest(\"tr\").prev();\r\n if (prev != null && prev.length == 0) { // no previous row\r\n var table = $(active).closest(\"table.rgDetailTable\");\r\n var pager = table.find(\"tfoot div.RadComboBox.RadComboBox_CRASkin table\");\r\n if (pager.length > 0) {\r\n var header = table.find(\"thead th:last.rgHeader a\");\r\n if (header.length > 0) {\r\n header.focus();\r\n e.preventDefault();\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "3ee099ece1c5f54a12a52910b69cf8b7", "score": "0.5389214", "text": "function lastStep()\n {\n vm.selectedIndex = totalSteps() - 1;\n }", "title": "" }, { "docid": "c072b778434c9db8ab7cffe56ce28033", "score": "0.5388654", "text": "function openTabWindow(tabType) {\r\n\t\t// var url = '`request.SCRIPT_NAME`?func=ll&objId=`request.objId`&objAction=' + tabType + '&nexturl=`Web.Escape(nextURL)`';\r\n\t\t// var url = $.LL.cgiPath() + '?func=ll&objId=' + $.getURLParam('objid') + '&objAction=' + tabType; // + '&nexturl=`Web.Escape(nextURL)`';\r\n\t\t/*\r\n\t\tvar url = $.tmpl(\"#{cgi}?func=ll&objId=#{objid}&objAction=#{objaction}&nexturl=#{nexturl}\", {\r\n\t\t\tcgi: $.LL.cgiPath(),\r\n\t\t\tobjid: $.getURLParam('objid'),\r\n\t\t\tobjaction: tabType,\r\n\t\t\tnexturl: escape( $('input[NAME=\"nextURL\"]').val() )\r\n\t\t});\r\n\t\t*/\r\n\t\t\r\n\t\thandle = undo.windowopen(tabLink(tabType), tabType, \"width=1200, height=600, resizable=yes, menubar=yes, scrollbars=yes, toolbar=yes, location=yes\");\r\n\t\thandle.focus();\r\n\t}", "title": "" }, { "docid": "64b2312513dc96f65714084032c64e88", "score": "0.53837067", "text": "function tabsForm(){\n\tvar num = gup(\"tab\");\n\tvar forms = $(\"div.tabBox > div\");\n\tvar tabs= $(\"div.listBox a\");\n\tif(num!=\"\" && num<=tabs.length && num>0){\n\t\t//forms.hide();\n\t\tforms.eq(num-1).show().siblings().hide();\n\t\t//tabs.removeClass(\"current\");\n\t\ttabs.eq(num-1).addClass(\"current\").siblings().removeClass(\"current\");\n\t}else{\n\t\tforms.eq(0).show();\n\t\ttabs.eq(0).addClass(\"current\").siblings().removeClass(\"current\");\n\t} \n}", "title": "" }, { "docid": "7c02b4311fe1c8ba36202a0397f04628", "score": "0.5381648", "text": "getStartingIndex() {\n // 1. look for url #hash\n const urlHash = this.hashes.indexOf(window.location.hash);\n if (urlHash > -1) return urlHash;\n\n // 2. look for active nav item\n const navIndex = this.tabs.findIndex(\n tab => tab && tab.classList.contains(Tabs.options.classActive),\n );\n if (navIndex > -1) return navIndex;\n\n // 3. look for active pane\n const paneIndex = this.panes.findIndex(\n pane => pane && pane.classList.contains(Tabs.options.classActive),\n );\n if (paneIndex > -1) return paneIndex;\n\n // 4. default to first tab\n return 0;\n }", "title": "" }, { "docid": "3a192c4c8501bfc6d1c09e5637ff348c", "score": "0.53766143", "text": "function migwizLastPage_LoadMe()\r\n{\r\n InitFrameRef('External');\r\n g_FirstFocusElement = g.btnNext;\r\n InitButtons(\"SimpleBack\");\r\n g_FirstFocusElement.focus();\r\n}", "title": "" }, { "docid": "ab3b54e6753654a47c23850437148207", "score": "0.53666633", "text": "function getNextTab() {\n try {\n var callList = Object.keys(window.top.calls);\n if (callList.length > 0) {\n var tabID = '';\n if (activeTab && activeTab.length > 0 && callList[activeTab])\n tabID = activeTab;\n else {\n activeTab = tabID = callList[0];\n }\n refreshView(tabID);\n } else {\n showHideContact();\n $j('#commentData').val(\"\");\n showSection('showDialpad');\n }\n doCleanUp();\n if (callList.length.length < 2) {\n var tabs = $j(\"#multiTab\");\n tabs.hide();\n }\n } catch (ex) {\n jslog(errorLogPrefix + \" getNextTab: \" + ex.message);\n }\n}", "title": "" }, { "docid": "a74d1322f58986265be8f0022016b882", "score": "0.5364665", "text": "function prevTab(currentTab) {\n \"use strict\";\n switch (currentTab) {\n //SE E' LA SECONDA TAB NASCONDILA E MOSTRA LA PRIMA\n case 0:\n tab_1.className = \"container hidden\";\n tab_0.className = \"container\";\n break;\n //SE E' LA TERZA TAB, NASCONDILA E MOSTRA LA SECONDA\n case 1:\n tab_2.className = \"container hidden\";\n tab_1.className = \"container\";\n break;\n //SE E' LA QUARTA TAB, NASCONDILA E MOSTRA LA TERZA\n case \"2\":\n tab_3.className = \"container hidden\";\n tab_2.className = \"container\";\n break;\n }\n}", "title": "" }, { "docid": "239dfeb29c4c7ef54f84a201981fe604", "score": "0.53631455", "text": "function goToTab(id) {\n var tabs = $(document).find('div[timeline-tab=' + id + ']').data('slick-index');\n if(tabs || tabs == 0){\n $(document).find('.history-timeline-content-slider .slick-slider').slick('slickGoTo', tabs);\n }\n}", "title": "" }, { "docid": "0644a1ee504255a2309abfdc03639074", "score": "0.536063", "text": "function getCurrentTabConsole() {\n return currentTabConsole;\n}", "title": "" }, { "docid": "28728ce999f257006e74012bb5cec076", "score": "0.5360238", "text": "function nextPage(){var elements=getElements();var viewportWidth=elements.canvas.clientWidth,totalWidth=viewportWidth+ctrl.offsetLeft,i,tab;for(i=0;i<elements.tabs.length;i++){tab=elements.tabs[i];if(tab.offsetLeft+tab.offsetWidth>totalWidth)break;}ctrl.offsetLeft=fixOffset(tab.offsetLeft);}", "title": "" }, { "docid": "8bbfcf04d85fd3f162acd53fd1dcad34", "score": "0.53600216", "text": "function nextonWizard(){\n \n if(settings.wizard.length > 0){\n // get the title attribute and remove it from tag to prevent disaplying the default title tag\n var cname = settings.wizard[settings.startWizardFrom];\n popupBubble($(cname).attr('title'),cname) ;\n $(cname).removeAttr('title')\n settings.startWizardFrom++;\n if( settings.startWizardFrom == settings.wizard.length) { \n settings.startWizardFrom= -1;//has reached end;\n }\n }\n\n }", "title": "" }, { "docid": "ac52121cd11b16e0f9cb7137259779f9", "score": "0.53587145", "text": "function doInCurrentTab(tabCallback) {\r\n\t\t\tchrome.tabs.query({ 'url': pattern }, function (tabArray) { tabCallback(tabArray[0]); });\r\n\t\t}", "title": "" }, { "docid": "01c23f67254b213b368723f4e67113ad", "score": "0.5355317", "text": "function showTab(activeTab) {\n // This function will display the specified tab of the form and name the Previous/Next buttons as required\n formTabs[activeTab].style.display = \"block\";\n nextButton.style.background = \"var(--cool-grey)\"\n\n if (activeTab == 0) {\n prevButton.style.display = \"none\";\n skipButton.style.display = \"none\";\n nextButton.style.background = \"var(--slate-blue)\";\n nextButton.innerHTML = \"Yes\";\n setSliderIndicator(activeTab);\n stepTracer[currentTab].classList.add(\"finish\");\n return;\n\n } else if (activeTab == (formTabs.length - 1)) {\n\n nextButton.innerHTML = \"Submit\";\n nextButton.style.background = \"var(--slate-blue)\";\n // nextButton.type = \"submit\";\n skipButton.style.display = \"none\";\n proceed = true;\n setSliderIndicator(activeTab);\n\n return;\n\n } else {\n if (activeTab == 1 && form.elements.star.value) {\n proceed = true;\n nextButton.style.background = \"var(--slate-blue)\";\n }\n if (activeTab == 2 && form.elements.finalDate.value) {\n proceed = true;\n nextButton.style.background = \"var(--slate-blue)\";\n }\n if (activeTab == 3 && document.getElementById(\"comment\").value) {\n proceed = true;\n nextButton.style.background = \"var(--slate-blue)\";\n }\n if (activeTab == 4) {\n proceed = true;\n nextButton.style.background = \"var(--slate-blue)\";\n }\n if (activeTab == 5 && document.getElementById(\"videolink\").value) {\n proceed = true;\n nextButton.style.background = \"var(--slate-blue)\";\n }\n if (activeTab == 6 && document.getElementById(\"name\").value) {\n proceed = true;\n nextButton.style.background = \"var(--slate-blue)\";\n }\n if (activeTab == 7 && document.getElementById(\"email\").value) {\n proceed = true;\n nextButton.style.background = \"var(--slate-blue)\";\n }\n\n prevButton.style.display = \"inline\";\n skipButton.style.display = \"inline\";\n nextButton.innerHTML = \"Next\";\n nextButton.type = \"button\";\n }\n\n setSliderIndicator(activeTab);\n}", "title": "" }, { "docid": "3fa42bece34ffeeab621b83317c4a635", "score": "0.53506637", "text": "get tabpage() {\n return this.request(`${this.prefix}get_tabpage`, []);\n }", "title": "" }, { "docid": "68a07d5effd850539b0d7ad96ce70c4b", "score": "0.53397036", "text": "static getCurrentTab() {\n return new Promise((resolve, reject) => {\n chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {\n if (chrome.runtime.lastError) {\n reject(chrome.runtime.lastError);\n } else {\n resolve(tabs[0]);\n }\n });\n });\n }", "title": "" }, { "docid": "57a7d233bc3cdfb9072922eeb1ee341c", "score": "0.53333104", "text": "_onTabActivateRequested(sender, args) {\n args.title.owner.activate();\n }", "title": "" }, { "docid": "5de398684e1c13163485657b014b330e", "score": "0.5331044", "text": "function getAllTabs() {\n\n}", "title": "" }, { "docid": "94637b573396c0b378220a3fc775d535", "score": "0.53254753", "text": "function tab_switchHome(){\n\t\t\t\tget('body_right_home_section').style.display = \"block\";\n\t\t\t\tget('page-information').style.display = \"block\";\n\t\t\t\tget('body_right_job_section').style.display = \"none\";\n\t\t\t\tget('body_right_house_section').style.display = \"none\";\n\t\t\t\tget('body_right_setting_section').style.display = \"none\";\n\t\t\t\tget('body_right_inbox_section').style.display = \"none\";\n\t\t\t\tget('body_right_help_section').style.display = \"none\";\n\t\t\t\tget('fix_position').style.display = \"block\";\n\t\t\t\tget('body_right_photo_section').style.display = \"none\";\n\t\t\t\tget('body_right_service_section').style.display = \"none\";\n\t\t\t\tget('body_right_review_section').style.display = \"none\";\n\t\t\t}", "title": "" }, { "docid": "f0c83f1630677706a76a1aa4ca982b3d", "score": "0.53123486", "text": "function setCurrentProgressTab($rootwizard, $nav, $tab, $progress, index)\n{\n\t$tab.prevAll().addClass('completed');\n\t$tab.nextAll().removeClass('completed');\n\n var items \t = $nav.children().length,\n\t\tpct = parseInt((index+1) / items * 100, 10),\n\t\t$first_tab = $nav.find('li:first-child'),\n\t\tmargin = (1/(items*2) * 100) + '%';//$first_tab.find('span').position().left + 'px';\n\n if( $first_tab.hasClass('active'))\n\t{\n\t\t$progress.width(0);\n\t}\n\telse\n\t{\n\t\tif(rtl())\n\t\t{\n\t\t\t$progress.width( $progress.parent().outerWidth(true) - $tab.prev().position().left - $tab.find('span').width()/2 );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$progress.width( ((index-1) /(items-1)) * 100 + '%' ); //$progress.width( $tab.prev().position().left - $tab.find('span').width()/2 );\n\t\t}\n\t}\n\n\n $progress.parent().css({\n\t\tmarginLeft: margin,\n\t\tmarginRight: margin\n\t});\n\n /*var m = $first_tab.find('span').position().left - $first_tab.find('span').width() / 2;\n\n $rootwizard.find('.tab-content').css({\n\t\tmarginLeft: m,\n\t\tmarginRight: m\n\t});*/\n}", "title": "" }, { "docid": "a15a94896e40111b51f041c2c7607aa2", "score": "0.53098184", "text": "toMain(){\n \t\tthis.props.navigator.push({\n\t\t\t title: 'Root',\n\t\t\t component: Root,\n id: 'root'\n\t\t })\n }", "title": "" }, { "docid": "afdb64ad3cae5fb22c5df2f755979d66", "score": "0.53082985", "text": "switchTab( delta ){\n this._selectTab({ delta: delta });\n }", "title": "" }, { "docid": "aa012e3f1ac6c9a1cd9ac39760f9d536", "score": "0.53051937", "text": "function EpSelectTab(/**string*/ tab)\r\n{\r\n\tif (!tab)\r\n\t{\r\n\t\tLogAssert(\"EpSelectTab: tab is not set\");\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tvar xpath = \"//li[@role='tab']/a/span[text()='\" + tab + \"']\";\r\n\tvar obj = Navigator.DoWaitFor(xpath);\r\n\tif (!obj)\r\n\t{\r\n\t\tLogAssert(\"EpSelectTab: tab not found: \" + tab);\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tobj.DoClick(); \r\n\t\r\n\tGlobal.DoSleep(1000);\t\r\n}", "title": "" }, { "docid": "987622a697e9b1372ace7a3aa39f546a", "score": "0.5305023", "text": "focusFirst(){this._focusIndex=0;this._tabs[this._focusIndex].triggerFocus()}", "title": "" }, { "docid": "e3b6163f909e7c0d511dbb2f801fc6a5", "score": "0.52976215", "text": "function fnShowMainPaneAll() {\n\t\t_stat.navList = [];\n\t\t_stat.tabAllFileIndex = 0;\n\t\t_stat.currentTabId = \"main-pane-all\";\n\t\t_stat.currentFolderId = 'root';\n\n\t\tACTION.fnNavIntoFolder(LANG.pane_name_all, \"pane-all\");\n\n\t\t$(\"#main-pane-all-list-body\").empty();\n\t\t$(\"#main-pane-all-thumb-wrapper\").empty();\n\n\t\tfnLoadTabAllFiles(\"root\");\n\n\t}", "title": "" }, { "docid": "dfe709a5ed54d38aaad647f154177231", "score": "0.52929157", "text": "function init(){\n\n if(_.isUndefined(controller.viewModel.id)){\n uitkExceptionService.throwException(\"IdNotFoundException\", \"id should be provided with the model\");\n }\n\n controller.viewModel.currentStep = controller.viewModel.currentStep || 1; //defaults to first step of the wizard\n controller.enableTabIndex = true;\n controller.loadInit = false;\n controller.selectedStepIndex = controller.viewModel.currentStep -1;\n controller.isWizardContentToBeFocussed = false;\n controller.isWizardCompleted = false;\n controller.wizardDescriptionId = controller.viewModel.wizardDescriptionId;\n\n /* Initialize the buttons (next,previous and final) and cancel link objects*/\n controller.viewModel.nextButton=controller.viewModel.nextButton || {};\n controller.viewModel.previousButton=controller.viewModel.previousButton || {};\n controller.viewModel.finishButton=controller.viewModel.finishButton || {};\n controller.viewModel.cancelLink=controller.viewModel.cancelLink || {};\n\n /* Initialize buttons' and link's labels*/\n controller.viewModel.nextButton.label = controller.viewModel.nextButton.label || \"Next\";\n controller.viewModel.previousButton.label=controller.viewModel.previousButton.label || \"Previous\";\n controller.viewModel.finishButton.label=controller.viewModel.finishButton.label || \"Finish\";\n controller.viewModel.cancelLink.label=controller.viewModel.cancelLink.label || \"Cancel\";\n\n\n controller.viewModel.hasCompletedAllSteps=controller.viewModel.hasCompletedAllSteps || false;\n\n /* Render the buttons and cancel link by default*/\n controller.viewModel.nextButton.render = controller.viewModel.nextButton.render || true;\n controller.viewModel.previousButton.render=controller.viewModel.previousButton.render || true;\n controller.viewModel.finishButton.render=controller.viewModel.finishButton.render || true;\n controller.viewModel.cancelLink.render=controller.viewModel.cancelLink.render || true;\n\n /* disabled flag for the buttons and cancel link by default*/\n controller.viewModel.nextButton.disabled = controller.viewModel.nextButton.disabled || false;\n controller.viewModel.previousButton.disabled=controller.viewModel.previousButton.disabled || false;\n controller.viewModel.finishButton.disabled=controller.viewModel.finishButton.disabled || false;\n controller.viewModel.cancelLink.disabled=controller.viewModel.cancelLink.disabled || false;\n\n }", "title": "" }, { "docid": "27dac40fac5c7f546b92f14017d0f01f", "score": "0.52911276", "text": "updateCurrentTab() {\n if (\n this.currentTabInfo != this.tabInfo[this.tabContainer.selectedIndex]\n ) {\n if (this.currentTabInfo) {\n this.saveCurrentTabState();\n }\n\n let oldTab = this.currentTabInfo;\n let oldPanel = [...this.panelContainer.children].find(p =>\n p.hasAttribute(\"selected\")\n );\n let tab = (this.currentTabInfo = this.tabInfo[\n this.tabContainer.selectedIndex\n ]);\n // Update the selected attribute on the current and old tab panel.\n if (oldPanel) {\n // Remember what has focus for when we return to this tab. Check for\n // anything inside tabmail-container rather than the panel because\n // focus could be in the Today Pane.\n let container = document.getElementById(\"tabmail-container\");\n if (\n container.compareDocumentPosition(document.activeElement) &\n Node.DOCUMENT_POSITION_CONTAINED_BY\n ) {\n oldTab.lastActiveElement = document.activeElement;\n document.activeElement.blur();\n } else {\n delete oldTab.lastActiveElement;\n }\n oldPanel.removeAttribute(\"selected\");\n }\n\n this.panelContainer.selectedPanel.setAttribute(\"selected\", \"true\");\n let showTabFunc = tab.mode.showTab || tab.mode.tabType.showTab;\n showTabFunc.call(tab.mode.tabType, tab);\n\n let browser = this.getBrowserForTab(tab);\n if (browser && !tab.browser) {\n tab.browser = browser;\n if (!tab.linkedBrowser) {\n tab.linkedBrowser = browser;\n }\n }\n if (tab.browser) {\n tab.browser._activeTabId = tab.tabId;\n }\n\n for (let tabMonitor of this.tabMonitors) {\n try {\n tabMonitor.onTabSwitched(tab, oldTab);\n } catch (ex) {\n console.error(ex);\n }\n }\n\n // always update the cursor status when we switch tabs\n SetBusyCursor(window, tab.busy);\n // active tabs should not have the wasBusy attribute\n this.tabContainer.selectedItem.removeAttribute(\"wasBusy\");\n // update the thinking status when we switch tabs\n this._setActiveThinkingState(tab.thinking);\n // active tabs should not have the wasThinking attribute\n this.tabContainer.selectedItem.removeAttribute(\"wasThinking\");\n this.setDocumentTitle(tab);\n\n // Update the toolbar status - we don't need to do menus as they\n // do themselves when we open them.\n UpdateMailToolbar(\"tabmail\");\n\n // We switched tabs, so we don't need to know the last tab\n // opener anymore.\n this.mLastTabOpener = null;\n\n // Try to set focus where it was when the tab was last selected.\n this.panelContainer.selectedPanel.focus();\n if (tab.lastActiveElement) {\n tab.lastActiveElement.focus();\n delete tab.lastActiveElement;\n }\n\n let evt = new CustomEvent(\"TabSelect\", {\n bubbles: true,\n detail: { tabInfo: tab },\n });\n this.tabContainer.selectedItem.dispatchEvent(evt);\n }\n }", "title": "" }, { "docid": "885686881ca871d87045920f275bcf63", "score": "0.5290304", "text": "function IniciarTabers()\n{\n $(\".tab_content\").hide();\n $(\"ul.tabs li:first\").addClass(\"active\").show();\n $(\".tab_content:first\").show();\n\n $(\"ul.tabs li\").click(function()\n {\n $(\"ul.tabs li\").removeClass(\"active\");\n $(this).addClass(\"active\");\n $(\".tab_content\").hide();\n\n var activeTab = $(this).find(\"a\").attr(\"href\");\n $(activeTab).show();\n\n return false;\n });\n}", "title": "" }, { "docid": "fed7645ab9c94de8644ef202442efd27", "score": "0.5286861", "text": "controlPrevPosTabsDisplay() { \n this.getPreviousPositionInfo();\n this.showFromQuestionBank = false;\n this.showNewQuestion = false;\n this.showExistingTemplate = false;\n this.showPrevPositionTemplate = true;\n \n }", "title": "" }, { "docid": "952d79a845fa3cd4c6cb227bc5c6701b", "score": "0.52837324", "text": "function LeechBlock_setOuterTab(index) {\r\n\tdocument.getElementById(\"lb-options-tabbox\").selectedIndex = index;\r\n}", "title": "" }, { "docid": "5fa5d7f7e35c42acbbefe2bad6435cde", "score": "0.52807283", "text": "function gotoFirstStep()\n {\n vm.setCurrentStep(1);\n }", "title": "" }, { "docid": "a8876b699a597a50a1423af4322fe86a", "score": "0.52796793", "text": "controlExistingTemplateTabsDisplay() { \n this.getExistingTemplateInfo();\n this.showFromQuestionBank = false;\n this.showNewQuestion = false;\n this.showExistingTemplate = true;\n }", "title": "" }, { "docid": "d3a20d6e782bc00a2c38b159aa6d66b6", "score": "0.5279116", "text": "function setDefaultPage() {\n defaultParentPage = top;\n}", "title": "" } ]
aa55776d4aed04ed45f336b3488da9fc
Returns the 'constructor' property of obj's prototype. By "obj's prototype", we mean the prototypical object that obj most directly inherits from, not the value of its 'prototype' property. We memoize the apparent prototype into 'Prototype___' to speed up future queries. If obj is a function or not an object, return undefined. If the object is determined to be directly constructed by the 'Object' function in some frame, we return distinguished marker value BASE_OBJECT_CONSTRUCTOR.
[ { "docid": "101d78d233c73ada4f25b884f3c91ecf", "score": "0.6914505", "text": "function directConstructor(obj) {\n if (obj === null) { return void 0; }\n if (obj === void 0) { return void 0; }\n if ((typeof obj) !== 'object') {\n // Regarding functions, since functions return undefined,\n // directConstructor() doesn't provide access to the\n // forbidden Function constructor.\n // Otherwise, we don't support finding the direct constructor\n // of a primitive.\n return void 0;\n }\n var result;\n if (obj.hasOwnProperty('Prototype___')) {\n var proto = obj.Prototype___;\n // At this point we know that (typeOf(proto) === 'object')\n if (proto === null) { return void 0; }\n result = proto.constructor;\n // rest of: if (!isPrototypical(result))\n if (result.prototype !== proto || (typeof result) !== 'function') {\n result = directConstructor(proto);\n }\n } else {\n if (!obj.hasOwnProperty('constructor')) {\n // TODO(erights): Detect whether this is a valid constructor\n // property in the sense that result is a proper answer. If\n // not, at least give a sensible error, which will be hard to\n // phrase.\n result = obj.constructor;\n } else {\n var oldConstr = obj.constructor;\n // TODO(erights): This code assumes that any 'constructor' property\n // revealed by deleting the own 'constructor' must be the constructor\n // we're interested in.\n if (delete obj.constructor) {\n result = obj.constructor;\n obj.constructor = oldConstr;\n } else if (isPrototypical(obj)) {\n log('Guessing the directConstructor of : ' + obj);\n return BASE_OBJECT_CONSTRUCTOR;\n } else {\n throw new TypeError('Discovery of direct constructors unsupported '\n + 'when the constructor property is not deletable: '\n + obj + '.constructor === ' + oldConstr);\n }\n }\n\n if ((typeof result) !== 'function' || !(obj instanceof result)) {\n if (obj === obj.baseProto___) {\n return void 0;\n }\n throw new TypeError('Discovery of direct constructors for foreign '\n + 'begotten objects not implemented on this platform');\n }\n if (result.prototype.constructor === result) {\n // Memoize, so it'll be faster next time.\n obj.Prototype___ = result.prototype;\n }\n }\n // If the result is marked as the 'Object' constructor from some feral\n // frame, return the distinguished marker value.\n if (result === result.FERAL_FRAME_OBJECT___) {\n return BASE_OBJECT_CONSTRUCTOR;\n }\n // If the result is the 'Object' constructor from some Caja frame,\n // return the distinguished marker value.\n if (result === obj.CAJA_FRAME_OBJECT___) {\n return BASE_OBJECT_CONSTRUCTOR;\n }\n return result;\n }", "title": "" } ]
[ { "docid": "e21de3309fb57a215d9c46434e8afdc5", "score": "0.6377444", "text": "function getConstructorName(obj) {\n\t var receiver = obj.receiver\n\t return (receiver.constructor && receiver.constructor.name) || null\n\t}", "title": "" }, { "docid": "af840a4a8d5fd53122e685e544c27e09", "score": "0.63550544", "text": "function getConstructorName(obj) {\n var receiver = obj.receiver;\n return receiver.constructor && receiver.constructor.name || null;\n}", "title": "" }, { "docid": "ee27223c0b1cdf92e1ed7bf6e068798e", "score": "0.6347915", "text": "function getConstructorName(obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "ee27223c0b1cdf92e1ed7bf6e068798e", "score": "0.6347915", "text": "function getConstructorName(obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "ee27223c0b1cdf92e1ed7bf6e068798e", "score": "0.6347915", "text": "function getConstructorName(obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "ee27223c0b1cdf92e1ed7bf6e068798e", "score": "0.6347915", "text": "function getConstructorName(obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "2eb8eeeaeef9c45982c49aa943c70e98", "score": "0.6338285", "text": "function getConstructorName(obj) {\n var receiver = obj.receiver;\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.6324908", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "3c8978882a399c565b81dc9e7fed516e", "score": "0.62951726", "text": "getConstructorName(obj) {\n\t\treturn utils.getConstructorName(obj);\n\t}", "title": "" }, { "docid": "cb7bdbffc31410ac9f3955e88bd62ec1", "score": "0.62853146", "text": "function newObect_find_next_constructor(obj, cur_constructor){\n let obj_of_cur_cons = obj.inheritsPropertyFrom(\"constructor\")\n let next_ans_above_cur_cons = Object.getPrototypeOf(obj_of_cur_cons)\n if(next_ans_above_cur_cons) { return next_ans_above_cur_cons.constructor } //might be nothing\n else { return null }\n //if(!cur_constructor) { cur_constructor = obj.constructor }\n //let obj_cons = obj.constructor\n //if (!obj_constructor) { return null } //there is no next constructor\n //else if (obj_cons != cur_constructor) { return obj_cons }\n //else { return newObject_find_next_constructor(Object.getPrototypeOf(obj), cur_constructor) }\n}", "title": "" }, { "docid": "68b0759a46b5a994389f987077df0998", "score": "0.6079769", "text": "static get getObjectConstructorProperties() {\n return Object.keys({}.constructor.prototype);\n }", "title": "" }, { "docid": "d6a1ac28e7b53be82987d13728c803e9", "score": "0.6036517", "text": "function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }", "title": "" }, { "docid": "d6a1ac28e7b53be82987d13728c803e9", "score": "0.6036517", "text": "function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }", "title": "" }, { "docid": "d6a1ac28e7b53be82987d13728c803e9", "score": "0.6036517", "text": "function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }", "title": "" }, { "docid": "d6a1ac28e7b53be82987d13728c803e9", "score": "0.6036517", "text": "function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }", "title": "" }, { "docid": "d6a1ac28e7b53be82987d13728c803e9", "score": "0.6036517", "text": "function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }", "title": "" }, { "docid": "1225646e835f9e96fdc723e3a1feecf2", "score": "0.6027931", "text": "function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype) return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype) return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype) return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\") return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O) return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }", "title": "" }, { "docid": "a2213371e297b62e8b6a5d91885867cd", "score": "0.6000908", "text": "function getTypeName(obj)\n {\n switch (typeof obj)\n {\n case \"undefined\":\n return undefined;\n\n case \"object\":\n if (obj === null)\n return undefined;\n break;\n\n case \"boolean\":\n return undefined;\n\n case \"number\":\n return undefined;\n\n case \"string\":\n return undefined;\n\n case \"function\":\n return undefined;\n\n default:\n return undefined;\n }\n\n var prototype = Object.getPrototypeOf(obj);\n\n if (prototype === Object.prototype)\n return Object.prototype;\n\n if (prototype === Array.prototype)\n return undefined;\n\n var name = allConstructors.getNameByPrototype(prototype);\n\n if (name !== undefined)\n return name;\n\n throw new TypeError(\"JSS.stringify can not find a constructor\"\n + \" for an object: \" + obj);\n }", "title": "" }, { "docid": "6dfa906281ba16f47ecbc699bd16653c", "score": "0.6000015", "text": "function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }", "title": "" }, { "docid": "6dfa906281ba16f47ecbc699bd16653c", "score": "0.6000015", "text": "function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }", "title": "" }, { "docid": "6dfa906281ba16f47ecbc699bd16653c", "score": "0.6000015", "text": "function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }", "title": "" }, { "docid": "6dfa906281ba16f47ecbc699bd16653c", "score": "0.6000015", "text": "function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }", "title": "" }, { "docid": "6dfa906281ba16f47ecbc699bd16653c", "score": "0.6000015", "text": "function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }", "title": "" }, { "docid": "6dfa906281ba16f47ecbc699bd16653c", "score": "0.6000015", "text": "function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }", "title": "" }, { "docid": "6dfa906281ba16f47ecbc699bd16653c", "score": "0.6000015", "text": "function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }", "title": "" }, { "docid": "6dfa906281ba16f47ecbc699bd16653c", "score": "0.6000015", "text": "function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }", "title": "" }, { "docid": "6dfa906281ba16f47ecbc699bd16653c", "score": "0.6000015", "text": "function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }", "title": "" }, { "docid": "6dfa906281ba16f47ecbc699bd16653c", "score": "0.6000015", "text": "function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }", "title": "" }, { "docid": "6dfa906281ba16f47ecbc699bd16653c", "score": "0.6000015", "text": "function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }", "title": "" }, { "docid": "6dfa906281ba16f47ecbc699bd16653c", "score": "0.6000015", "text": "function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }", "title": "" }, { "docid": "6dfa906281ba16f47ecbc699bd16653c", "score": "0.6000015", "text": "function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }", "title": "" }, { "docid": "6cd48dc1ac8a10d72c2092fd3c2d47f4", "score": "0.5939418", "text": "function OrdinaryGetPrototypeOf(O) {\r\n var proto = Object.getPrototypeOf(O);\r\n if (typeof O !== \"function\" || O === functionPrototype)\r\n return proto;\r\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\r\n // Try to determine the superclass constructor. Compatible implementations\r\n // must either set __proto__ on a subclass constructor to the superclass constructor,\r\n // or ensure each class has a valid `constructor` property on its prototype that\r\n // points back to the constructor.\r\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\r\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\r\n if (proto !== functionPrototype)\r\n return proto;\r\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\r\n var prototype = O.prototype;\r\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\r\n if (prototypeProto == null || prototypeProto === Object.prototype)\r\n return proto;\r\n // If the constructor was not a function, then we cannot determine the heritage.\r\n var constructor = prototypeProto.constructor;\r\n if (typeof constructor !== \"function\")\r\n return proto;\r\n // If we have some kind of self-reference, then we cannot determine the heritage.\r\n if (constructor === O)\r\n return proto;\r\n // we have a pretty good guess at the heritage.\r\n return constructor;\r\n }", "title": "" }, { "docid": "6cd48dc1ac8a10d72c2092fd3c2d47f4", "score": "0.5939418", "text": "function OrdinaryGetPrototypeOf(O) {\r\n var proto = Object.getPrototypeOf(O);\r\n if (typeof O !== \"function\" || O === functionPrototype)\r\n return proto;\r\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\r\n // Try to determine the superclass constructor. Compatible implementations\r\n // must either set __proto__ on a subclass constructor to the superclass constructor,\r\n // or ensure each class has a valid `constructor` property on its prototype that\r\n // points back to the constructor.\r\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\r\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\r\n if (proto !== functionPrototype)\r\n return proto;\r\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\r\n var prototype = O.prototype;\r\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\r\n if (prototypeProto == null || prototypeProto === Object.prototype)\r\n return proto;\r\n // If the constructor was not a function, then we cannot determine the heritage.\r\n var constructor = prototypeProto.constructor;\r\n if (typeof constructor !== \"function\")\r\n return proto;\r\n // If we have some kind of self-reference, then we cannot determine the heritage.\r\n if (constructor === O)\r\n return proto;\r\n // we have a pretty good guess at the heritage.\r\n return constructor;\r\n }", "title": "" }, { "docid": "6cd48dc1ac8a10d72c2092fd3c2d47f4", "score": "0.5939418", "text": "function OrdinaryGetPrototypeOf(O) {\r\n var proto = Object.getPrototypeOf(O);\r\n if (typeof O !== \"function\" || O === functionPrototype)\r\n return proto;\r\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\r\n // Try to determine the superclass constructor. Compatible implementations\r\n // must either set __proto__ on a subclass constructor to the superclass constructor,\r\n // or ensure each class has a valid `constructor` property on its prototype that\r\n // points back to the constructor.\r\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\r\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\r\n if (proto !== functionPrototype)\r\n return proto;\r\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\r\n var prototype = O.prototype;\r\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\r\n if (prototypeProto == null || prototypeProto === Object.prototype)\r\n return proto;\r\n // If the constructor was not a function, then we cannot determine the heritage.\r\n var constructor = prototypeProto.constructor;\r\n if (typeof constructor !== \"function\")\r\n return proto;\r\n // If we have some kind of self-reference, then we cannot determine the heritage.\r\n if (constructor === O)\r\n return proto;\r\n // we have a pretty good guess at the heritage.\r\n return constructor;\r\n }", "title": "" }, { "docid": "6cd48dc1ac8a10d72c2092fd3c2d47f4", "score": "0.5939418", "text": "function OrdinaryGetPrototypeOf(O) {\r\n var proto = Object.getPrototypeOf(O);\r\n if (typeof O !== \"function\" || O === functionPrototype)\r\n return proto;\r\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\r\n // Try to determine the superclass constructor. Compatible implementations\r\n // must either set __proto__ on a subclass constructor to the superclass constructor,\r\n // or ensure each class has a valid `constructor` property on its prototype that\r\n // points back to the constructor.\r\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\r\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\r\n if (proto !== functionPrototype)\r\n return proto;\r\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\r\n var prototype = O.prototype;\r\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\r\n if (prototypeProto == null || prototypeProto === Object.prototype)\r\n return proto;\r\n // If the constructor was not a function, then we cannot determine the heritage.\r\n var constructor = prototypeProto.constructor;\r\n if (typeof constructor !== \"function\")\r\n return proto;\r\n // If we have some kind of self-reference, then we cannot determine the heritage.\r\n if (constructor === O)\r\n return proto;\r\n // we have a pretty good guess at the heritage.\r\n return constructor;\r\n }", "title": "" }, { "docid": "6cd48dc1ac8a10d72c2092fd3c2d47f4", "score": "0.5939418", "text": "function OrdinaryGetPrototypeOf(O) {\r\n var proto = Object.getPrototypeOf(O);\r\n if (typeof O !== \"function\" || O === functionPrototype)\r\n return proto;\r\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\r\n // Try to determine the superclass constructor. Compatible implementations\r\n // must either set __proto__ on a subclass constructor to the superclass constructor,\r\n // or ensure each class has a valid `constructor` property on its prototype that\r\n // points back to the constructor.\r\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\r\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\r\n if (proto !== functionPrototype)\r\n return proto;\r\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\r\n var prototype = O.prototype;\r\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\r\n if (prototypeProto == null || prototypeProto === Object.prototype)\r\n return proto;\r\n // If the constructor was not a function, then we cannot determine the heritage.\r\n var constructor = prototypeProto.constructor;\r\n if (typeof constructor !== \"function\")\r\n return proto;\r\n // If we have some kind of self-reference, then we cannot determine the heritage.\r\n if (constructor === O)\r\n return proto;\r\n // we have a pretty good guess at the heritage.\r\n return constructor;\r\n }", "title": "" }, { "docid": "6785556e4d09685663ad2c61e464d182", "score": "0.5922566", "text": "function OrdinaryGetPrototypeOf(O) {\r\n var proto = Object.getPrototypeOf(O);\r\n if (typeof O !== \"function\" || O === functionPrototype)\r\n return proto;\r\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\r\n // Try to determine the superclass constructor. Compatible implementations\r\n // must either set __proto__ on a subclass constructor to the superclass constructor,\r\n // or ensure each class has a valid `constructor` property on its prototype that\r\n // points back to the constructor.\r\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\r\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\r\n if (proto !== functionPrototype)\r\n return proto;\r\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\r\n var prototype = O.prototype;\r\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\r\n if (prototypeProto == null || prototypeProto === Object.prototype)\r\n return proto;\r\n // If the constructor was not a function, then we cannot determine the heritage.\r\n var constructor = prototypeProto.constructor;\r\n if (typeof constructor !== \"function\")\r\n return proto;\r\n // If we have some kind of self-reference, then we cannot determine the heritage.\r\n if (constructor === O)\r\n return proto;\r\n // we have a pretty good guess at the heritage.\r\n return constructor;\r\n }", "title": "" }, { "docid": "6785556e4d09685663ad2c61e464d182", "score": "0.5922566", "text": "function OrdinaryGetPrototypeOf(O) {\r\n var proto = Object.getPrototypeOf(O);\r\n if (typeof O !== \"function\" || O === functionPrototype)\r\n return proto;\r\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\r\n // Try to determine the superclass constructor. Compatible implementations\r\n // must either set __proto__ on a subclass constructor to the superclass constructor,\r\n // or ensure each class has a valid `constructor` property on its prototype that\r\n // points back to the constructor.\r\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\r\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\r\n if (proto !== functionPrototype)\r\n return proto;\r\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\r\n var prototype = O.prototype;\r\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\r\n if (prototypeProto == null || prototypeProto === Object.prototype)\r\n return proto;\r\n // If the constructor was not a function, then we cannot determine the heritage.\r\n var constructor = prototypeProto.constructor;\r\n if (typeof constructor !== \"function\")\r\n return proto;\r\n // If we have some kind of self-reference, then we cannot determine the heritage.\r\n if (constructor === O)\r\n return proto;\r\n // we have a pretty good guess at the heritage.\r\n return constructor;\r\n }", "title": "" }, { "docid": "6785556e4d09685663ad2c61e464d182", "score": "0.5922566", "text": "function OrdinaryGetPrototypeOf(O) {\r\n var proto = Object.getPrototypeOf(O);\r\n if (typeof O !== \"function\" || O === functionPrototype)\r\n return proto;\r\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\r\n // Try to determine the superclass constructor. Compatible implementations\r\n // must either set __proto__ on a subclass constructor to the superclass constructor,\r\n // or ensure each class has a valid `constructor` property on its prototype that\r\n // points back to the constructor.\r\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\r\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\r\n if (proto !== functionPrototype)\r\n return proto;\r\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\r\n var prototype = O.prototype;\r\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\r\n if (prototypeProto == null || prototypeProto === Object.prototype)\r\n return proto;\r\n // If the constructor was not a function, then we cannot determine the heritage.\r\n var constructor = prototypeProto.constructor;\r\n if (typeof constructor !== \"function\")\r\n return proto;\r\n // If we have some kind of self-reference, then we cannot determine the heritage.\r\n if (constructor === O)\r\n return proto;\r\n // we have a pretty good guess at the heritage.\r\n return constructor;\r\n }", "title": "" }, { "docid": "2b460c6b4ee0cf8349e872790f11267e", "score": "0.5889895", "text": "function OrdinaryGetPrototypeOf(O) {\n\t var proto = Object.getPrototypeOf(O);\n\t if (typeof O !== \"function\" || O === functionPrototype)\n\t return proto;\n\t // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n\t // Try to determine the superclass constructor. Compatible implementations\n\t // must either set __proto__ on a subclass constructor to the superclass constructor,\n\t // or ensure each class has a valid `constructor` property on its prototype that\n\t // points back to the constructor.\n\t // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n\t // This is the case when in ES6 or when using __proto__ in a compatible browser.\n\t if (proto !== functionPrototype)\n\t return proto;\n\t // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n\t var prototype = O.prototype;\n\t var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n\t if (prototypeProto == null || prototypeProto === Object.prototype)\n\t return proto;\n\t // If the constructor was not a function, then we cannot determine the heritage.\n\t var constructor = prototypeProto.constructor;\n\t if (typeof constructor !== \"function\")\n\t return proto;\n\t // If we have some kind of self-reference, then we cannot determine the heritage.\n\t if (constructor === O)\n\t return proto;\n\t // we have a pretty good guess at the heritage.\n\t return constructor;\n\t }", "title": "" }, { "docid": "741b13c894db4cb026bb3a86f2592fe7", "score": "0.58086115", "text": "function objTypeName(obj) {\n if(typeof obj === 'object' && typeof obj.constructor === 'function')\n return obj.constructor.name;\n return typeof obj;\n}", "title": "" }, { "docid": "d6d89947d9c0ec27189f91afe965c310", "score": "0.5781422", "text": "function getClass(obj, forceConstructor) {\r\n if ( typeof obj == \"undefined\" ) return \"undefined\";\r\n if ( obj === null ) return \"null\";\r\n if ( forceConstructor == true && obj.hasOwnProperty(\"constructor\") ) delete obj.constructor; // reset constructor\r\n if ( forceConstructor != false && !obj.hasOwnProperty(\"constructor\") ) return getFunctionName(obj.constructor);\r\n return Object.prototype.toString.call(obj)\r\n .match(/^\\[object\\s(.*)\\]$/)[1];\r\n}", "title": "" }, { "docid": "194d47103d48afcd0cc0fe1dc0bd239d", "score": "0.5655968", "text": "function IsConstructor ( obj ) {\n return typeof obj === 'function';\n }", "title": "" }, { "docid": "a3cfd568d083fd71c6e55bedd323c825", "score": "0.5652848", "text": "function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { // eslint-disable-line no-unused-vars\n\t// 1. Assert: intrinsicDefaultProto is a String value that is this specification's name of an intrinsic object. The corresponding object must be an intrinsic that is intended to be used as the [[Prototype]] value of an object.\n\t// 2. Assert: IsCallable(constructor) is true.\n\t// 3. Let proto be ? Get(constructor, \"prototype\").\n\tvar proto = Get(constructor, \"prototype\");\n\t// 4. If Type(proto) is not Object, then\n\tif (Type(proto) !== 'object') {\n\t\t// a. Let realm be ? GetFunctionRealm(constructor).\n\t\t// b. Set proto to realm's intrinsic object named intrinsicDefaultProto.\n\t\tproto = intrinsicDefaultProto;\n\t}\n\t// 5. Return proto.\n\treturn proto;\n}", "title": "" }, { "docid": "f9f5a021c91c0495f1b2af14c24e00ce", "score": "0.5644453", "text": "function _getObjectClassName (obj) {\n if (obj && obj.constructor && obj.constructor.toString) {\n let arr = obj.constructor.toString().match(/function\\s*(\\w+)/);\n \n if (arr && 2 === arr.length) {\n return arr[1]\n }\n }\n}", "title": "" }, { "docid": "8b0d85d8c7675adce6f26fd018b139d9", "score": "0.5637126", "text": "constructor() {\n /**\n * This property, stores enumerable properties\n * of Object Class constructor prototype.\n */\n this.ob_proto_attrs = this.constructor.getObjectConstructorProperties;\n /**\n * This property, stores non_enumerable properties\n * of Object Class constructor prototype.\n */\n this.obj_proto_methods = this.constructor.getObjectConstructorMethods;\n }", "title": "" }, { "docid": "f1bfb8c7310b4a7c4758f708b517a862", "score": "0.555294", "text": "function objectHasPrototype(obj, prototype) {\n if (prototype.constructor === Object) {\n // The prototype is a plain object.\n // Only case to defend against is someone trying to mixin Object itself.\n return prototype === Object.prototype;\n }\n if (obj === prototype || obj instanceof prototype.constructor) {\n // The prototype was found along the prototype chain.\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "0a43c0cddf7569f16b047171b588b07a", "score": "0.5429636", "text": "function getClass (obj) {\n const string = Object.prototype.toString.call(obj);\n const m = /\\[object ([^\\]]+)/.exec(string);\n return m && m[1];\n}", "title": "" }, { "docid": "69dc87533430d052f4a26239a1cbc314", "score": "0.5419346", "text": "classof(obj) {\n return Object.prototype\n .toString\n .call(obj)\n .replace(/^\\[object\\s(.*)\\]$/, \"$1\");\n }", "title": "" }, { "docid": "9661ce9c829f2fbf13dcafeddab3d9c0", "score": "0.5311674", "text": "static isPrototype(value) { console.log(Object.getPrototypeOf(value) === prototype1); }", "title": "" }, { "docid": "9661ce9c829f2fbf13dcafeddab3d9c0", "score": "0.5311674", "text": "static isPrototype(value) { console.log(Object.getPrototypeOf(value) === prototype1); }", "title": "" }, { "docid": "99cfc015e357f55ac8888500ee93bc84", "score": "0.5278668", "text": "function createObject(obj) {\n let constructorFunc = function() {};\n constructorFunc.prototype = obj;\n return new constructorFunc()\n}", "title": "" }, { "docid": "a66073ee0fab4003265a2ca4db900479", "score": "0.52073276", "text": "function isObject$2(obj) {\n\t var _obj$constructor;\n\t return typeof obj === 'object' && obj != null && (obj == null || (_obj$constructor = obj.constructor) == null ? void 0 : _obj$constructor.name) === 'Object';\n\t}", "title": "" }, { "docid": "ab583e1d038d3b203ea534acaa4ae301", "score": "0.51441425", "text": "function exports(obj) {\n\t if (obj.constructor && obj.constructor.name) return obj.constructor.name;\n\n\t return upperFirst({}.toString.call(obj).replace(/(\\[object )|]/g, ''));\n\t }", "title": "" }, { "docid": "0e2bbd7957f0b9c3074b4a8f893acb26", "score": "0.514361", "text": "function getPropsObjFor(obj) {\n if (obj == null) {\n return {};\n }\n\n var ret = propsMapCache.get(obj);\n if (ret) {\n return ret;\n }\n\n ret = getPropsObjFor(Object.getPrototypeOf(obj)) || {};\n\n var ownNames = Object.getOwnPropertyNames(obj),\n ownSymbols = Object.getOwnPropertySymbols(obj),\n index;\n\n index = ownSymbols.indexOf(PROXY_DEF);\n if (index >= 0) {\n ownSymbols.splice(index, 1);\n }\n index = ownNames.indexOf(\"prototype\");\n if (index >= 0) {\n ownNames.splice(index, 1);\n }\n\n if (ownNames.length || ownSymbols.length) {\n ret = Object.assign({}, ret);\n var p, tdescr,\n i, len;\n\n for (i = 0, len = ownNames.length; i < len; ++i) {\n p = ownNames[i];\n tdescr = Object.getOwnPropertyDescriptor(obj, p);\n ret[p] = {\n tdescr: tdescr,\n get: getter(p),\n set: setter(p),\n enumerable: !!tdescr.enumerable\n };\n }\n for (i = 0, len = ownSymbols.length; i < len; ++i) {\n p = ownSymbols[i];\n tdescr = Object.getOwnPropertyDescriptor(obj, p);\n ret[p] = {\n tdescr: tdescr,\n get: getter(p),\n set: setter(p),\n enumerable: !!tdescr.enumerable\n };\n }\n }\n\n propsMapCache.set(obj, ret);\n return ret;\n }", "title": "" }, { "docid": "d69df2c8b226138b28138cb608f6d91d", "score": "0.51322705", "text": "function classOrNil(obj) { return (functionOrNil(obj) && (obj.prototype && obj === obj.prototype.constructor) && obj) || null; }", "title": "" }, { "docid": "d69df2c8b226138b28138cb608f6d91d", "score": "0.51322705", "text": "function classOrNil(obj) { return (functionOrNil(obj) && (obj.prototype && obj === obj.prototype.constructor) && obj) || null; }", "title": "" }, { "docid": "d69df2c8b226138b28138cb608f6d91d", "score": "0.51322705", "text": "function classOrNil(obj) { return (functionOrNil(obj) && (obj.prototype && obj === obj.prototype.constructor) && obj) || null; }", "title": "" }, { "docid": "fedb95f01a5391db8f168915eacfac65", "score": "0.5122722", "text": "function isPrototypical(obj) {\n if ((typeof obj) !== 'object') { return false; }\n if (obj === null) { return false; }\n var constr = obj.constructor;\n if ((typeof constr) !== 'function') { return false; }\n return constr.prototype === obj;\n }", "title": "" }, { "docid": "7df55cf2650bf0e1d88747dbb7752710", "score": "0.5098646", "text": "function getPrototypeOf(prototype) {\n return prototype.__proto__;\n }", "title": "" }, { "docid": "cae04dd28d440f5a072834ab5fce66ed", "score": "0.5095794", "text": "function getObjectName(obj) {\r\n var name = obj.constructor.name;\r\n \r\n return name === undefined? obj.fixedName : name;\r\n}", "title": "" }, { "docid": "2bc5aa74c7fd004e8116acef2e99494b", "score": "0.50767803", "text": "function getPrototypeOf(prototype) {\n return prototype.__proto__;\n }", "title": "" }, { "docid": "d642313ca08ad8119b4662613d22f87b", "score": "0.50383115", "text": "static get getObjectConstructorMethods() {\n return Object.getOwnPropertyNames(Object.constructor.prototype);\n }", "title": "" }, { "docid": "67a12c187722f51dad131c39f9abf175", "score": "0.5029661", "text": "function baseCreate(prototype) {\n if (!isObject(prototype)) return {};\n if (nativeCreate) return nativeCreate(prototype);\n Ctor.prototype = prototype;\n var result = new Ctor;\n Ctor.prototype = null;\n return result;\n }", "title": "" }, { "docid": "5ea5bcbb94c29c8196ee95e3c68585b5", "score": "0.50128865", "text": "function baseCreate(prototype) {\n if (!isObject(prototype)) return {};\n if (nativeCreate) return nativeCreate(prototype);\n Ctor.prototype = prototype;\n var result = new Ctor;\n Ctor.prototype = null;\n return result;\n}", "title": "" }, { "docid": "5ea5bcbb94c29c8196ee95e3c68585b5", "score": "0.50128865", "text": "function baseCreate(prototype) {\n if (!isObject(prototype)) return {};\n if (nativeCreate) return nativeCreate(prototype);\n Ctor.prototype = prototype;\n var result = new Ctor;\n Ctor.prototype = null;\n return result;\n}", "title": "" }, { "docid": "c7f75dbe6b36e47779d7f10d9c896bf9", "score": "0.4941245", "text": "function FastObject(o) {\n\t\t\t// A prototype object will have \"fast properties\" enabled once it is checked\n\t\t\t// against the inline property cache of a function, e.g. fastProto.property:\n\t\t\t// https://github.com/v8/v8/blob/6.0.122/test/mjsunit/fast-prototype.js#L48-L63\n\t\t\tif (fastProto !== null && typeof fastProto.property) {\n\t\t\t\tconst result = fastProto\n\t\t\t\tfastProto = FastObject.prototype = null\n\t\t\t\treturn result\n\t\t\t}\n\t\t\tfastProto = FastObject.prototype = o == null ? Object.create(null) : o\n\t\t\treturn new FastObject()\n\t\t}", "title": "" }, { "docid": "21665124d4f34cccb50b488da9a682ec", "score": "0.49293244", "text": "function Constructor() {\n\n // All construction is actually done in the init method.\n if (!initializing) {\n\n return ( this === undefined || this.constructor !== Constructor ) && arguments.length && Constructor.constructorExtends ?\n // We are being called without `new` or we are extending.\n Constructor.extend.apply(Constructor, arguments) :\n // We are being called with `new`.\n Constructor.newInstance.apply(Constructor, arguments);\n }\n }", "title": "" }, { "docid": "e80a2716e6ef715bf98f79a3fde28150", "score": "0.4869749", "text": "function CheckNoPrototype(object) {\n var desc = Object.getOwnPropertyDescriptor(object, \"prototype\");\n assertEquals(undefined, desc);\n}", "title": "" }, { "docid": "49bdf1da853040844039ce55f5a31b15", "score": "0.48610374", "text": "function baseCreate(prototype) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__[\"a\" /* default */])(prototype)) return {};\n if (__WEBPACK_IMPORTED_MODULE_1__setup_js__[\"j\" /* nativeCreate */]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__[\"j\" /* nativeCreate */])(prototype);\n var Ctor = ctor();\n Ctor.prototype = prototype;\n var result = new Ctor;\n Ctor.prototype = null;\n return result;\n}", "title": "" }, { "docid": "459a615c337ad086bdedcea1e58043b4", "score": "0.48288628", "text": "function baseCreate(prototype) {\n if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(prototype)) return {};\n if (_setup_js__WEBPACK_IMPORTED_MODULE_1__[\"nativeCreate\"]) return Object(_setup_js__WEBPACK_IMPORTED_MODULE_1__[\"nativeCreate\"])(prototype);\n var Ctor = ctor();\n Ctor.prototype = prototype;\n var result = new Ctor;\n Ctor.prototype = null;\n return result;\n}", "title": "" }, { "docid": "d0e289be617f1801a9a1119eb62d8006", "score": "0.4822295", "text": "function FastObject(o) {\n\t// A prototype object will have \"fast properties\" enabled once it is checked\n\t// against the inline property cache of a function, e.g. fastProto.property:\n\t// https://github.com/v8/v8/blob/6.0.122/test/mjsunit/fast-prototype.js#L48-L63\n\tif (fastProto !== null && typeof fastProto.property) {\n\t\tconst result = fastProto;\n\t\tfastProto = FastObject.prototype = null;\n\t\treturn result;\n\t}\n\tfastProto = FastObject.prototype = o == null ? Object.create(null) : o;\n\treturn new FastObject;\n}", "title": "" }, { "docid": "d0e289be617f1801a9a1119eb62d8006", "score": "0.4822295", "text": "function FastObject(o) {\n\t// A prototype object will have \"fast properties\" enabled once it is checked\n\t// against the inline property cache of a function, e.g. fastProto.property:\n\t// https://github.com/v8/v8/blob/6.0.122/test/mjsunit/fast-prototype.js#L48-L63\n\tif (fastProto !== null && typeof fastProto.property) {\n\t\tconst result = fastProto;\n\t\tfastProto = FastObject.prototype = null;\n\t\treturn result;\n\t}\n\tfastProto = FastObject.prototype = o == null ? Object.create(null) : o;\n\treturn new FastObject;\n}", "title": "" }, { "docid": "d0e289be617f1801a9a1119eb62d8006", "score": "0.4822295", "text": "function FastObject(o) {\n\t// A prototype object will have \"fast properties\" enabled once it is checked\n\t// against the inline property cache of a function, e.g. fastProto.property:\n\t// https://github.com/v8/v8/blob/6.0.122/test/mjsunit/fast-prototype.js#L48-L63\n\tif (fastProto !== null && typeof fastProto.property) {\n\t\tconst result = fastProto;\n\t\tfastProto = FastObject.prototype = null;\n\t\treturn result;\n\t}\n\tfastProto = FastObject.prototype = o == null ? Object.create(null) : o;\n\treturn new FastObject;\n}", "title": "" }, { "docid": "d0e289be617f1801a9a1119eb62d8006", "score": "0.4822295", "text": "function FastObject(o) {\n\t// A prototype object will have \"fast properties\" enabled once it is checked\n\t// against the inline property cache of a function, e.g. fastProto.property:\n\t// https://github.com/v8/v8/blob/6.0.122/test/mjsunit/fast-prototype.js#L48-L63\n\tif (fastProto !== null && typeof fastProto.property) {\n\t\tconst result = fastProto;\n\t\tfastProto = FastObject.prototype = null;\n\t\treturn result;\n\t}\n\tfastProto = FastObject.prototype = o == null ? Object.create(null) : o;\n\treturn new FastObject;\n}", "title": "" }, { "docid": "d0e289be617f1801a9a1119eb62d8006", "score": "0.4822295", "text": "function FastObject(o) {\n\t// A prototype object will have \"fast properties\" enabled once it is checked\n\t// against the inline property cache of a function, e.g. fastProto.property:\n\t// https://github.com/v8/v8/blob/6.0.122/test/mjsunit/fast-prototype.js#L48-L63\n\tif (fastProto !== null && typeof fastProto.property) {\n\t\tconst result = fastProto;\n\t\tfastProto = FastObject.prototype = null;\n\t\treturn result;\n\t}\n\tfastProto = FastObject.prototype = o == null ? Object.create(null) : o;\n\treturn new FastObject;\n}", "title": "" }, { "docid": "71c6af088782e15a25335d3ad51614e5", "score": "0.48082176", "text": "function _describe(obj) {\n return (obj && obj.constructor && obj.constructor.name ? obj.constructor.name : '' + obj);\n}", "title": "" }, { "docid": "74939af4e8ecb762931b42deb196677f", "score": "0.47922224", "text": "function getClassName(object) {\n\t\n\tvar _name = 'null';\n\t\n\tif (object) {\n\t\t\n\t\t//get object type\n\t\t_name = typeof(object);\n\t\t\n\t\tif (object.constructor) {\n\t\t\n\t\t\t// get classname abstracted from\n\t\t\t// constructor property\n\t\t\t_name = object.constructor.toString();\n\t\t\t\n\t\t\tif (_name) {\n\t\t\t\tvar start = _name.indexOf('function ') + 9;\n\t\t\t\tvar stop = _name.indexOf('(');\n\t\t\t\t_name = _name.substring(start, stop);\n\t\t\t}\n\t\t\t\n\t\t} //end if (object has constructor)\n\t\t\n\t} //end if (object exists)\n\t\n\treturn _name;\n\t\n} //end getClassName()", "title": "" }, { "docid": "e30bbce6a1bad05a03c7974eecc968a5", "score": "0.47845364", "text": "function baseCreate(prototype) {\n if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(prototype)) return {};\n if (_setup_js__WEBPACK_IMPORTED_MODULE_1__.nativeCreate) return (0,_setup_js__WEBPACK_IMPORTED_MODULE_1__.nativeCreate)(prototype);\n var Ctor = ctor();\n Ctor.prototype = prototype;\n var result = new Ctor;\n Ctor.prototype = null;\n return result;\n}", "title": "" } ]
36d7f54fb9e156f5b9ba3656383353b4
function to change index of to change the phrase on clicking th button
[ { "docid": "0fd5c3aaee6862565077259264b88c68", "score": "0.66600835", "text": "function changeIndex() {\n let index = Math.round(Math.random() * (text.length-1));\n if (index == lastIndex) {\n return changeIndex();\n } else {\n lastIndex = index;\n return index;\n }\n }", "title": "" } ]
[ { "docid": "ed7a5cba9b2468b97f85dd77e20ff37d", "score": "0.6642166", "text": "function actionOnClick(){\n switch(index){\n //when the user is prompted to put in the green block\n case 7:\n text.setText(content[index]);\n index++;\n break; \n //change to angie being lit up after block is placed at the end of the dialogue\n case (content.length):\n showAngieLight();\n default:\n text.setText(content[index]);\n index++;\n }\n }", "title": "" }, { "docid": "98bf0060db935c1cc8a34c8189aada8e", "score": "0.6634361", "text": "toggle(index){\n this.setState({\n textos: this.state.textos.map((text,i) => {\n if (index === i){\n if (text.state === \"Comenzar\" || text.state === \"Renaudar\"){\n \ttext.state = \"Stop\"\n }else if (text.state === \"Stop\"){\n\t\t\ttext.state = \"Renaudar\"\n } \n }\n return text\n })\n })\n }", "title": "" }, { "docid": "ef75e110bbc7b3a810840f2adbcf0b5f", "score": "0.65317935", "text": "function clickEventHandler(index) {\n var meaning = emojis[index];\n setMeaning(meaning);\n // console.log(index);\n }", "title": "" }, { "docid": "e34aa129cc2e2ed4b32d80610186f680", "score": "0.64657074", "text": "function change() { // method to change the text within the array\n elem.innerHTML = text[counter];\n counter++;\n if (counter >= text.length) {\n counter = 0;\n }\n}", "title": "" }, { "docid": "8561a9b7063f66b249cca5322de99d36", "score": "0.6405653", "text": "function handleClick() {\n setI(i+1)\n if (i === arr.length){\n set_End(true)\n }\n else{\n setWord(arr[i][0])\n setWordHe(arr[i][1])\n setBtn(\"<< למילה הבאה\")\n if (i === arr.length - 1){\n setBtn(\"סיום\")\n props.updateProgress('learn', level)\n } \n }\n }", "title": "" }, { "docid": "7723de72f64f5f1f61689d12d1f55ead", "score": "0.63995373", "text": "function fillCurrentWord(_keyPressed, _index) {\n\n $(\"#divWord\" + _index).text(_keyPressed.toUpperCase());\n\n}", "title": "" }, { "docid": "94fb11274222adec4be09cba2af423bc", "score": "0.63572824", "text": "function updateProspectorButtonIndex() {\n\t\t\tindexChar = searchhelpIndex.slice(-1);\t//gets index from variable on searchhelp_ pages\n\t\t\tsearchIndexVal = $(\"#SEARCH\").val(); //gets search text\n\n\t\t\t\tif(indexChar.match(/t|a|d/) && searchIndexVal.length > 0) { //when index is t|a|d and there is a value \n\t\t\t\t\tprospectorArgIndex = indexChar + \":(\" + searchIndexVal + \")\"; //creates url for t/a/d indexes\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tprospectorArgIndex = searchIndexVal; //creates url for keyword and other indexes\n\t\t\t\t}\n\n\t\t\t$(\"#prospectorLink\").attr(\"href\", prospectorUrl + prospectorArgIndex)\n\t\t}", "title": "" }, { "docid": "20f311d0394677e853fc68feac5a84ab", "score": "0.6120116", "text": "function changeTitle(index,change){\n list1[index] = change;\n}", "title": "" }, { "docid": "3cee4a0c4c36c3571778c2bab9fe57d4", "score": "0.61155874", "text": "function setContent(rowIndex,colIndex,content){\r\n //search how to target the element in a specific row and col of a table javascript\r\n var targetedButton = table.eq(rowIndex).find('td').eq(colIndex).find('button')\r\n targetedButton .text(content);\r\n targetedButton.css('color',\"#f0f0f0\");\r\n\r\n}", "title": "" }, { "docid": "e49af9a30e59cd9d6d13387039a973e3", "score": "0.60912055", "text": "function Browse(number){ // Gets +1 or -1 as parameter, if it is +1 descends in list, if -1 goes up in list\n\n // number is added to the iteration variable (currentPhrase), increasing or decreasing its value\n currentPhrase += number;\n\n // Implementing a loop in the list selection \n if (currentPhrase == phraseList.length){\n currentPhrase = 0;\n }\n else if (currentPhrase == -1){\n currentPhrase = phraseList.length - 1;\n }\n highlightPhrase();\n AutoScroll();\n}", "title": "" }, { "docid": "26b7e6a14a71bcecbfd74de70d0f1a0b", "score": "0.6027503", "text": "function increaseIndex() {\n\t\t\tindex++;\n\t\t}", "title": "" }, { "docid": "adac191a2e51b13bf1f3c60321f53bc3", "score": "0.6022066", "text": "function loveWordToggle() {\n var loveArray = [\"MUSIC\", \"CREATING\", \"READABLE CODE\", \"DOGS\", \"QUENTIN TARANTINO\", \"GAME DEVELOPMENT\",\n \"RAMEN\", \"COLLABORATION\", \"CHRISTOPHER NOLAN\", \"JQUERY\", \"PYOTR TCHAIKOVSKY\", \"VANCOUVER, CANADA\",\n \"FRONT-END DEVELOPMENT\", \"READABLE CODE\", \"DESIGN\", \"CARBONARA\", \"SEOUL, SOUTH KOREA\", \"COOKING\", \"SUNSETS\",\n \"CHRISTMAS\", \"FLUME (MUSICIAN)\", \"CONCERTS\"];\n var loveButton = document.getElementById('love-button');\n var blankSpace = document.getElementById('love-container').getElementsByTagName('h4')[0];\n var index = 0;\n loveButton.onclick = function () {\n if (index >= loveArray.length) index = 0;\n blankSpace.innerHTML = \"\";\n fontSizeAdaptor(loveArray[index], blankSpace);\n blankSpace.textContent = loveArray[index];\n ++index;\n };\n }", "title": "" }, { "docid": "9ab41ca2f3ff2e4651504f87d86fa4d0", "score": "0.6022035", "text": "toggleDone(index){\n \tthis.setState({\n \t\t textos: this.state.textos.map((text,i) => {\n \t\t \tif(index === i){\n \t\t \t\ttext.done ? text.done = false : text.done = true \n text.error = false\n text.aux1 = text.tittle\n text.aux2 = text.proyect\n \t\t \t}\n \t\t \treturn text\n })\n \t})\n }", "title": "" }, { "docid": "83c9e1835c23954e0cc41aabb5b1a7a3", "score": "0.60071605", "text": "textHandler() {\n this.updateActiveItemIndex(-1);\n }", "title": "" }, { "docid": "21bca488254fb9fef42b10f9fa298ac0", "score": "0.6000554", "text": "function seteaIndex(){\n \n var nn1 = 0;\n $(\"#hor-minimalist-a tbody tr[class='cabN']\").each(function (index) {\n \n var row1 = $(this); \n \n \n var idSanc = row1.find('.idClase').val();\n \t\tvar valCampo = row1.find('.campoClausura').val();\n \n var valdat = row1.find('.campoSancion').val();\n var valobs = row1.find('.campoObs').val();\n \n /*\n if(idSanc == 1){\n \t\t\tvaldat = \"S/. \" + valdat;\n \t\t}else if(idSanc == 3){\t\t\n \t\t if(valCampo != \"\" && valCampo == 2) { \n \t\t\t\tvaldat += \" Días\";\n \t } \n \t\t}else{\n \t\t\tvaldat = \"\";\n \t\t}*/\n \n \n var row2 =row1.html().replace(/_n/g,nn1); \n var row = $(row2);\n row1.html(row); \n \n row1.find('.campoSancion').val(valdat);\n row1.find('.campoObs').val(valobs);\n \n nn1++; \n });\n \n}", "title": "" }, { "docid": "ef03c9127b4d4223cf99d120354b7f00", "score": "0.59490913", "text": "function updateWord(indexes){\n indexes.forEach(function(foundIndexes){\n document.querySelector('#letter' + foundIndexes).textContent = currentWord[foundIndexes];\n return updateWord();\n });\n}", "title": "" }, { "docid": "7ccf95d2062e90d846f5cd2fe95f3cf6", "score": "0.594559", "text": "function setHangmanField(index) {\n\tconst hangmanField = document.getElementById(\"hangmanField\");\n\n\thangmanField.innerHTML = hangman[index];\n}", "title": "" }, { "docid": "2b6a4169ab5592d20c0788b8ad0bb532", "score": "0.5900276", "text": "function displayQuote(index) {\n $('#myQuote').text(coolQuotes[index]);\n console.log(index);\n}", "title": "" }, { "docid": "cc12201ff8e6a390db6e301cd8310090", "score": "0.58854324", "text": "function afficherLettre (recupLettre, index) {\n var recupSpan = document.getElementsByTagName('span');\n\n for (var j = 0; j < recupSpan.length; j++) {\n if (j == index) {\n recupSpan[j].innerHTML = recupLettre;\n }\n }\n}", "title": "" }, { "docid": "a0200970e7e3140f28bfadce10b486bb", "score": "0.58748037", "text": "function mousePressed() {\n index = index + 1;\n \n //(gpB)reloop the words code, 12 is the quality of words in line 1\n if (index == words.length) {\n index = 0;\n //can also write \"if (index == 12) { index = 0;\n \n }\n}", "title": "" }, { "docid": "c3ec9d12e93ce8bdb1426969edb54ae7", "score": "0.58703023", "text": "function changeText() {\n console.log(\"changed beer content\")\n let currentBeerName = this.className.split(\" \")[1];\n let newSource = currentBeerName.charAt(0).toUpperCase() + currentBeerName.slice(1);\n beerName.textContent = `${beerData[this.dataset.offset][0]}`;\n beerSum.textContent = `${beerData[this.dataset.offset][1]}`;\n }", "title": "" }, { "docid": "d2d5ddb02b6de38b0321750b357fdd78", "score": "0.5860459", "text": "function ChangesText(textChange) {\n //get element by string\n var isDisplay;\n var listContent;\n var strContent;\n var keys = Object.keys(listRowTable[0].data);\n for (var i = 0; i < listRowTable.length; i++) {\n isDisplay = false;\n for (var j = 0; j < keys.length; j++) {\n if (listRowTable[i].data[keys[j]] == null) continue;\n if(keys[j]=='Action') continue;\n if (covertUnicodeToChar(listRowTable[i].data[keys[j]].toString()).toUpperCase().indexOf(covertUnicodeToChar(textChange).toUpperCase()) > -1) {\n listRowTable[i].flag = 0;\n isDisplay = true;\n break;\n }\n }\n if (!isDisplay) {\n listRowTable[i].flag = 1;\n }\n }\n GetProperties(listRowTable);\n GetRecordInpage(1);\n CreatePageNavition();\n }", "title": "" }, { "docid": "ba26af4a3c05bea807fbfa938f724738", "score": "0.5817485", "text": "function switchPangram() {\r\n if (pangramIndex < PANGRAM_ARRAY.length - 1) {\r\n pangramIndex++;\r\n } else {\r\n pangramIndex = 0;\r\n }\r\n originTextElement.innerHTML = PANGRAM_ARRAY[pangramIndex];\r\n originText = document.querySelector('#originText').innerHTML;\r\n}", "title": "" }, { "docid": "76c5260133e5d22abb03c8f4e255586a", "score": "0.58109653", "text": "function handleCharacterSelection(index) {\n const id = \"cb_\" + index;\n\n const clickedButton = document.getElementById(id);\n\n let pinyinField = document.getElementById(\"pinyin\");\n\n if(pinyinField.value !== currentVocab[2]) {\n pinyinField.setAttribute(\"style\", \"border: solid 1px red;\");\n return;\n } else {\n pinyinField.setAttribute(\"style\", \"border: solid 1px c3c3c3;\");\n }\n\n if(clickedButton.innerText === currentVocab[1]) {\n // Clicked button was correct\n\n // Remove content of pinyin field\n pinyinField.value = \"\";\n\n updateProgressBar();\n if(currentIndex < vocabsArray.length) {\n displayVocab(vocabsArray[currentIndex]);\n } else {\n // TODO: Learning finished\n }\n } else {\n // Clicked button was false\n clickedButton.classList.remove(\"btn-outline-dark\");\n clickedButton.classList.add(\"btn-outline-danger\");\n }\n\n}", "title": "" }, { "docid": "4324604065d4d1b7cbc89cffc89c6b6e", "score": "0.5775624", "text": "function moveBackToList (word) { // word är det ord som ska flyttas tillbaks\r\n let i // loopvariable\r\n i = words8.indexOf(word)\r\n wordElems[i].innerHTML = words8[i]\r\n} // End moveBackToList", "title": "" }, { "docid": "f05ac70a9d4049344f84b3278473d1fd", "score": "0.57621855", "text": "function updateTextUI(index) {\n const activeDiv = colorDivs[index];\n const color = chroma(activeDiv.style.backgroundColor).hex();\n const textHex = activeDiv.querySelector('h2');\n const icons = activeDiv.querySelectorAll('.controls button');\n //set h2 value to the background.\n textHex.innerText = color;\n // check and change text and controls color to contrast with the bg color of the color block\n checkTextContrast(color,textHex);\n for(icon of icons) {\n checkTextContrast(color,icon);\n }\n\n}", "title": "" }, { "docid": "fe230d0fd47db9814767c6488403a0c3", "score": "0.5750128", "text": "advance() {\n this.index++;\n if (this.index === this.text.length) {\n this.done = true;\n }\n }", "title": "" }, { "docid": "6ae72e57e2d4192ec0934bb853313018", "score": "0.57459384", "text": "function updateCurrentText() {\n currentEl.innerText = `${currentActiveCard + 1}/${cardsEl.length}` //adds 1 to it bcause index starts at 0 ???\n}", "title": "" }, { "docid": "ab0ee65852ac472e397ee321fb632b57", "score": "0.57427216", "text": "function editTitle(){\n\t\t$('#namedList').click(function(){\n\t\t\tswapTitleContents();\n\t\t});\n\t\t}", "title": "" }, { "docid": "c729f2d1ab74a5d31746350a9e47ac2a", "score": "0.5738195", "text": "function arrayClickHandler(index) {\n\t\tplay(this.value(index).split(\"<br>\")[0]);\n\t}", "title": "" }, { "docid": "bed624f3a68aa3c27d9bf4129a26c698", "score": "0.5734431", "text": "function changeItemsAtIndexes(arr,index){\r\n\tvar listOfNameElem = document.getElementsByClassName('view-elem-name');\r\n\tvar temp = listOfNameElem[index].textContent;\r\n\tlistOfNameElem[index].textContent = listOfNameElem[index+1].textContent;\r\n\tlistOfNameElem[index+1].textContent = temp;\r\n\treturn arr.slice(0,index).concat(arr.slice(index+1,index+2)).concat(arr.slice(index,index+1)).concat(arr.slice(index+2));\r\n}", "title": "" }, { "docid": "237b28c75e9ad4996565f18692204cb4", "score": "0.5722107", "text": "function switchQuestion(i) {\n questionTextEl.textContent = questionsArray[i].questionText;\n answerText1El.textContent = questionsArray[i].answer1;\n answerText2El.textContent = questionsArray[i].answer2;\n answerText3El.textContent = questionsArray[i].answer3;\n answerText4El.textContent = questionsArray[i].answer4;\n}", "title": "" }, { "docid": "8df15bf3aaafd9790fd88508e0a7e862", "score": "0.57129955", "text": "function rep() {\n displayWord = setCharAt(displayWord, i, userGuess);\n document.getElementById(\"text\").innerHTML = displayWord;\n\n }", "title": "" }, { "docid": "7e71830dc5664fc4ee26e6393cb592dd", "score": "0.5699518", "text": "function onBtnPushed3() {\n if(idH3.textContent === \"Hello Alberta\" ) {\n idH3.textContent = \"Hello Saskatchewan\";\n }\telse {\n idH3.textContent = \"Hello Alberta\";\n }\n\n}", "title": "" }, { "docid": "0f902d1dd82a1eb63e976a073a58b6ca", "score": "0.56982857", "text": "function updateHeading(index) {\n\t\tremoveActiveLinks();\n\t\ttocElements[index].classList.add('em-is-active');\n\t}", "title": "" }, { "docid": "34327def6ab257ad5692d36e0012a3fc", "score": "0.56442285", "text": "function nextText(){\n\n\t\t\t//vars\n\t\t\tvar count = storyLine.length;\n\t\t\tvar count2 = charAndLocation.length;\n\n\t\t\t//up i value\n\t\t\tif (i < count-1) {\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\t//enable previous button\n\t\t\tif (i > 0) {\n\t\t\t\tenableBtn(\"#prevBtn\", true);\n\t\t\t}\n\n\t\t\t//store i for save/load purposes\n\t\t\tconsole.log(i);\n\t\t\tcurrentLocation = i;\n\n\t\t\t//used for normal\n\t\t\tcurrentDialogue = storyLine[i];\n\n\t\t\tif(i < count && i < count2 ) {\t\t\t\t\n\t\t\t\t$(\"#charDialogue\").html(currentDialogue);\n\t\t\t\t$('#title').html(charAndLocation[i]);\n\t\t\t}\n\n\t\t\tif (i == count-1) {\n\t\t\t\tshowUI(\".conversationContainer .optionContainer\", true);\n\t\t\t\t$('.conversationContainer .optionContainer').html(''); //clear\n\t\t\t\t//Populates the choices on screen.\n\n\t\t\t\tfor(var j = 0; j < decision.length; j++) {\n\t\t\t\t\tvar n = j+1;\n\n\t\t\t\t\t//links\n\t\t\t\t\tvar link = '#';\n\t\t\t\t\tif (j == 0) { link = link1; }\n\t\t\t\t\tif (j == 1) { link = link2; }\n\t\t\t\t\tif (j == 2) { link = link3; }\n\t\t\t\t\tif (j == 3) { link = link4; }\n\t\t\t\t\t\n\t\t\t\t\t$('.conversationContainer .optionContainer').append('<a href=\"'+link+'\"><h3>END</h3><p>'+decision[j]+'</p></a>');\n\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\tenableBtn(\"#nextBtn\", false);\n\t\t\t}\n\t\t\t\n\t}", "title": "" }, { "docid": "3c0fcf2a59ffd9afbdd5fbbb120124c8", "score": "0.56419975", "text": "function changePageNumber(){\n\t$(\"#indexnavtrack\").text((currentLinkText+1)+\"/\"+textsInLinks[currentLink]);\n}", "title": "" }, { "docid": "387e4c9cada863e681dfe193e4e3d861", "score": "0.5638351", "text": "function changeLetter(spanList, position, idx, colorIdx) {\n\tspanList[position].textContent = characterArray[idx];\n\tspanList[position].style.color = colorLetterArray[colorIdx];\n}", "title": "" }, { "docid": "3757ebf85223818f46d8bf2d01753179", "score": "0.56226236", "text": "function handleClick() {\n // retrieve the data-action attribute of the button\n const dataAction = this.getAttribute('data-action');\n // modify number according to the data attribute, clamping its value to the interval [0, length - 1]\n // where the considered length is the length of the arrays making up the explanation and the snippet\n if (dataAction === 'prev') {\n number = Math.max(0, number - 1);\n } else {\n number = Math.min(explanation.length - 1, number + 1);\n }\n // if number reaches either end of the specified interval remove the class of .active from the matching button\n buttons.forEach(button => button.classList.add('active'));\n if (number === 0 || number === explanation.length - 1) {\n this.classList.remove('active');\n }\n // call the function to show the HTML for the selected index\n showPresentation(number);\n}", "title": "" }, { "docid": "c567d617edb748421d34fce247aa5595", "score": "0.5616913", "text": "function updateButtonText() {\n\t\t\tthis.prevText = 'Prev'; //'Question ' + (vm.pages.currentPage - 1);\n\t\t\tthis.nextText = 'Next'; //'Question ' + (vm.pages.currentPage + 1);\n\n\t\t\tif(vm.pages.currentPage - 1 <= 0) {\n\t\t\t\tthis.prevText = 'Instructions';\n\t\t\t}\n\n\t\t\tif(vm.pages.currentPage === vm.pages.lastPage - 1) {\n\t\t\t\tthis.nextText = 'Results'\n\t\t\t} \n\t\t}", "title": "" }, { "docid": "0c1288714fac52456b6ebcefb7f470fc", "score": "0.5614081", "text": "function busqueda(){\n $(\"#anterior2\").html(\"1\");\n $(\"#anterior1\").html(\"2\");\n $(\"#medio\").html(\"3\");\n $(\"#siguiente1\").html(\"4\");\n $(\"#siguiente2\").html(\"5\");\n\n $(\"#anterior2\").click();\n}", "title": "" }, { "docid": "0d8ed593bc717727b6b1e5ec4638abc3", "score": "0.5612145", "text": "function continueSearch(oldIndex, newIndex) {\n const matched = SearchState.matched\n SearchState.current = newIndex\n document.querySelector('menu span[name=index]')\n .textContent = newIndex + 1\n unhighlight(matched[oldIndex])\n highlight(matched[newIndex])\n view(matched[newIndex])\n}", "title": "" }, { "docid": "9007e158a08702f85b50007c9ee5c3ad", "score": "0.56059855", "text": "function coloumnEditInPage(td , text){\n \t\n td.innerHTML = text;\n\n }", "title": "" }, { "docid": "17aaba3a5dc5344f491b7dbe28b5e6a2", "score": "0.5601907", "text": "function changeSynonymRow(index) {\n console.log(\"changeSynonymRow(): \" + index);\n\t\t\tvm.selectedSynonymIndex = index;\n\n if (vm.apiDomain.synonyms[index] == null) {\n\t\t\t\tvm.selectedSynonymIndex = 0;\n return;\n }\n\n\t\t\tif (vm.apiDomain.synonyms[index].processStatus != \"d\" \n && vm.apiDomain.synonyms[index].processStatus != \"c\") {\n vm.apiDomain.synonyms[index].processStatus = \"u\";\n };\n\t\t}", "title": "" }, { "docid": "5cd8b50293b4ab707decf6290fa1f5dc", "score": "0.5599537", "text": "function setData(index) {\n dataIndex = index;\n displayInTable(dataSets[dataIndex].data);\n\n //Creates a space between a lowercase and uppercase number (since data is camal-cased)\n //Learned from: https://stackoverflow.com/questions/5582228/insert-space-before-capital-letters\n //Author: Göran Andersson\n //Accessed: 6 Dec 2020\n\n //Tells user what term they should search by\n filterButton.innerHTML = 'Filter by ' + dataSets[dataIndex].filter.replace(/([a-z])([A-Z])/g, '$1 $2') + ' <i class=\"fas fa-search\"></i>';\n}", "title": "" }, { "docid": "85bd38a26200de4e7f15ae7e32164f8e", "score": "0.5598951", "text": "function thirdChangeTitle() {\n SECOND_TITLE.innerText = \"Subiendo GiF\"\n}", "title": "" }, { "docid": "5da553fb85ea9b1d3f7b8276dafb2121", "score": "0.5596938", "text": "function changeCharacter( idx, char, callback ) {\n var text = this._text;\n var newText = text.substr( 0, idx )\n + char\n + text.substr( idx + 1, text.length - idx - 1 );\n this._text = newText;\n if( callback ) callback();\n }", "title": "" }, { "docid": "cd4e793c8cdb8ae4ca9e79158cdd996a", "score": "0.5592878", "text": "function updateCurrentQuestionIndex() {\n\tcurrentQuestionIndex++;\n}", "title": "" }, { "docid": "5e2c7e5f80adc461a488a48179c3c33f", "score": "0.558723", "text": "function jumpToIndex(i)\r\n{\r\n\tpause();\r\n\tactiveYear = yearArray[i];\r\n\tyearIndex = i;\r\n\tgenerateVisualization();\r\n}", "title": "" }, { "docid": "4b743590e0cdd27b59b7407729da7e3d", "score": "0.55857635", "text": "function updateDisplayedVerbs(verb_index = current_verb_index) {\r\n if(slider_ennl_state === false) {\r\n document.getElementById(\"text_inf\").innerHTML = data[current_verb_index][0];\r\n document.getElementById(\"text_imp\").innerHTML = data[current_verb_index][1];\r\n document.getElementById(\"text_per\").innerHTML = data[current_verb_index][2];\r\n document.getElementById(\"text_eng\").innerHTML = data[current_verb_index][3];\r\n } else {\r\n document.getElementById(\"text_inf\").innerHTML = data[current_verb_index][3];\r\n document.getElementById(\"text_imp\").innerHTML = data[current_verb_index][1];\r\n document.getElementById(\"text_per\").innerHTML = data[current_verb_index][2];\r\n document.getElementById(\"text_eng\").innerHTML = data[current_verb_index][0];\r\n }\r\n\r\n}", "title": "" }, { "docid": "18f40006f0e9a9ae6b1b3bc00bf37850", "score": "0.5585574", "text": "function twInitTableau() {\n [].forEach.call( document.getElementsByClassName(\"avectri\"), function(oTableau) {\n var oEntete = oTableau.getElementsByTagName(\"tr\")[0];\n var nI = 1;\n [].forEach.call( oEntete.querySelectorAll(\"th\"), function(oTh) {\n oTh.addEventListener(\"click\", twTriTableau, false);\n oTh.setAttribute(\"data-pos\", nI);\n if(oTh.getAttribute(\"data-tri\")==\"1\") {\n oTh.innerHTML += \"<span class=\\\"flecheDesc\\\"></span>\";\n } else {\n oTh.setAttribute(\"data-tri\", \"0\");\n oTh.innerHTML += \"<span class=\\\"flecheAsc\\\"></span>\";\n }\n if (oTh.className==\"selection\") {\n oTh.click();\n }\n nI++;\n });\n });\n }", "title": "" }, { "docid": "90c3121953fd0a857da575816d742a8d", "score": "0.558355", "text": "function handleClick(index) {\n // retrieve the player guess\n const { player } = state.guess;\n // decrement/increment the option according to the index\n // ! cap the values in the 1, 5 range\n const optionNumber = index === 0 ? Math.max(1, player - 1) : Math.min(player + 1, 5);\n\n // update the labels\n const labels = document.querySelectorAll('label');\n labels.forEach((label, indx) => ((indx + 1) === optionNumber ? label.classList.add('active') : label.classList.remove('active')));\n // update the state\n state.guess.player = optionNumber;\n}", "title": "" }, { "docid": "39864d02a13e030c34967005cebae27a", "score": "0.5582088", "text": "function myFunction() {\n let text = document.getElementById(\"button1\").innerHTML;\n document.getElementById(\"button1\").innerHTML =\n text.replace(\"Translate\", \"Vertaal\");\n}", "title": "" }, { "docid": "498685bda7b0371e05a45a0f73d22a70", "score": "0.5574197", "text": "function _gotoQuestion(index) {\n this.set('currentQuestionIndex', index);\n}", "title": "" }, { "docid": "7a55f27ad054bf086987a2d50092ce4c", "score": "0.5568064", "text": "function change(page) {\n //using a template literal format, which allows you to add variables easily\n document.getElementById(\n \"content\"\n ).innerHTML = `<div class=\"intro\"><div class=\"col\"> <img class=\"portrait\" src=${images[page]}> </div>\n \n <div class=\"intro-text\">\n <h1> ${headertitles[page]}\n </h1> <h2 class=\"tenure\"> <em>TENURE:</em> ${tenure[page]}</h2> </div></div> <div id=\"article-wrapper\" class=\"article-text\"> ${paragraphs[page]}\n </div>\n <div onclick=\"back()\" class=\"next triangle-left\"></div> `;\n\n //to figure out what next button to show\n if (page == headertitles.length - 1) {\n document.getElementById(\n \"content\"\n ).innerHTML += `<button onclick=\"restart()\" class=\"restart\">RESTART</button>`;\n } else {\n document.getElementById(\n \"content\"\n ).innerHTML += ` <div onclick=\"next()\" class=\"next triangle-right\"></div>`;\n }\n}", "title": "" }, { "docid": "e87043a84a9b0a446bd1e37e424566b8", "score": "0.55667484", "text": "function updateUI(index) {\n\tvar uiWidth = -280;\n\tvar uiInner = document.getElementById(\"uiInner\");\n\tvar spot = index * uiWidth;\n\n\tfor (var i = 0; i < 3; i++) {\n \t\tvar idName = \"nd\" + i;\n \t\tvar e = document.getElementById(idName);\n \t\tif (i == index) {\n \t\t\te.className = \"cBtn cBtn_active\";\n \t\t} else {\n \t\t\te.className = \"cBtn cBtn_inactive\";\n \t\t}\n \t}\n\n\tspot = spot.toString() + \"px\";\n\tTweenLite.to(uiInner, 0.3, {left:spot});\n\tclearSearch();\n\n \tuiPageIndex = index;\n}", "title": "" }, { "docid": "66b596f80e963ffb5c435686248a659e", "score": "0.556631", "text": "function copyTextChange() {\n for (let i = 0; i < fallenTextCopy.length; i++) {\n fallenTextCopy[i].innerText = \"Kliknij, by skopiować\";\n };\n}", "title": "" }, { "docid": "888f4e54277728942a836bc2a3f7e422", "score": "0.5558933", "text": "function clickHandler(index) {\n if (selected_index === -1) { // if nothing currently selected\n jsavArr.css(index, {\"font-size\": \"110%\"});\n selected_index = index;\n jsavArr.highlight(index);\n } else { // an array element is selected\n // Do not swap for the same index.\n if (selected_index !== index) {\n jsavArr.swap(selected_index, index);\n jsavArr.unhighlight(selected_index);\n }\n jsavArr.css(selected_index, {\"font-size\": \"100%\"});\n jsavArr.unhighlight(index);\n selected_index = -1; // Reset to nothing selected\n }\n alistInsertPRO.userInput = true;\n }", "title": "" }, { "docid": "0bfcee717c530c1e3028fa6f210b08c8", "score": "0.55576205", "text": "function UpdateLineNumber(table){\n\tvar lineNumber, nbLine, cell\n\n\tnbLine = CountLine(table) //- 1\n\tfor (var i = 0; i < nbLine; i++) {\n\t\tlineNumber = table.rowIndex\n\t\ttable.rows[i].cells[0].innerHTML = '<button onclick=\"DellLine(quotation, ' + i + ')\" type=\"button\" class=\"btn btn-danger btn-xs\">\\\n\t\t\t\t\t\t\t\t\t\t\t\t<strong><i class=\"fa fa-minus\" aria-hidden=\"true\"></i></strong>\\\n\t\t\t\t\t\t\t\t\t\t\t</button>\\\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"btn btn-primary btn-xs pull-right\">' + (i + 1) + '</span>'\n\t\ttable.rows[i].cells[1].innerHTML = '<input type=\"text\" class=\"form-control\" placeholder=\"Produit\" id=\"InputText\">'\n\t\tUpdateTotal(table)\n\t}\n}", "title": "" }, { "docid": "0253b2a7e667f404b9f53721d90619d5", "score": "0.5546956", "text": "function onChangeMemeCurrText(textIdx) {\n\tsetMemeCurrText(textIdx);\n\t// renderMemeTexts();\n\trenderMemeDesigns();\n}", "title": "" }, { "docid": "1aaa166d198b07f4a6738954a6dc9b25", "score": "0.5546076", "text": "changeIndex() {\n\t\tif(i < this.state.slides.length -1) {\n\t\t\t++i\n\t\t} else {\n\t\t\ti = 0\n\t\t}\n\t\tthis.getImage(i)\n\t}", "title": "" }, { "docid": "3ccfaba20d340f5576d4296b60ebead5", "score": "0.55442107", "text": "function setChar(index, chr)\n {\n // alert(chr);\n this.text = this.text.substring(0, index) + chr + this.text.substring(index + 1);\n this.setText(this.text, false);\n }", "title": "" }, { "docid": "3efb5568159496f2b01f0f48fb16ccc6", "score": "0.5516494", "text": "function updateWord(answer) {\n console.log(`updateWord : ${answer}`);\n let letter = $(\"span.shown-letter:first\");\n for (let char of answer) {\n // what can char be? A letter, or an underscore '_'\n if (char != '_') {\n letter.text(char);\n }\n else {\n letter.html('&nbsp');\n }\n letter = letter.next();\n }\n}", "title": "" }, { "docid": "ac6211b26793906c81091453befd8047", "score": "0.5503067", "text": "function setIndex( index ) {\n var indices = $('.index-wrapper .dots li');\n\n //si no esta cargado lo carga y pone por defecto el\n if ( !( indices.length > 0 ) ) {\n var indiceTotal = 3\n var html = '';\n for (var i = 0; i < indiceTotal; i++) {\n \n html += '<li';\n /*if ( i == 0 ) {\n html += ' class=\"active active-1\"';\n }*/\n html += '><span class=\"number-index\">'+(i+1)+'</span></li>';\n \n }//for\n \n $('.index-wrapper .dots').append( $(html) );\n }\n\n //ahora se setea el indice\n switch (index) {\n case 3:\n var indices = $('.index-wrapper .dots li');\n $(indices[0]).addClass('active active-1');\n break;\n case 4:\n $(indices[0]).addClass('active active-2');\n break;\n case 5:\n $(indices[0]).addClass('active active-full');\n $(indices[1]).addClass('active');\n break;\n case 6:\n $(indices[1]).addClass('active-1');\n break;\n case 7:\n $(indices[1]).addClass('active-2');\n break;\n case 8:\n $(indices[1]).addClass('active-3');\n break;\n case 9:\n $(indices[1]).addClass('active-full');\n $(indices[2]).addClass('active');\n break;\n }\n}", "title": "" }, { "docid": "54882eebcef2ee07779e0d3f577d5e48", "score": "0.5501792", "text": "function catch_hint() {\r\n $(\"#button_ayuda\").click(function () {\r\n let pos_aleatoria = random_int_int(0, palabra_misterio_backend.length-1);\r\n for (let i = 0; i < palabra_misterio_backend.length; i++) {\r\n if (i == pos_aleatoria) {\r\n palabra_misterio_frontend = palabra_misterio_frontend.replaceAt(i, palabra_misterio_backend[i]);\r\n }\r\n }\r\n $(\"#unknown_word\").attr(\"value\", palabra_misterio_frontend);\r\n });\r\n}", "title": "" }, { "docid": "a3cf3de27060f69352a4ec804ad1a986", "score": "0.5501639", "text": "setValuesToText(indices, newValue, editorState) {\n let editorText = this.getTextFromEditorState(editorState);\n const tmp_arr = editorText.split(/\\s+/);\n console.log(indices)\n console.log(this.state.variable);\n for (let i of indices) {\n const toReplace = tmp_arr[i];\n editorText = editorText.split(toReplace).join(newValue);\n }\n return editorText;\n }", "title": "" }, { "docid": "9a78f2da0577891baffe00e5fe6a6d91", "score": "0.5498268", "text": "function updateTitle(indx) {\r\n\t$(\"#scheduleNum\").html(\"<center><h1>Schedule \" + String(indx+1) + \" / \" + String(allSchedules.length) + \"</h1></center>\");\r\n}", "title": "" }, { "docid": "9ba63c7918c3ade825aa55208a7e98f4", "score": "0.5488301", "text": "function updateBtnClick(e) {\n let tr = e.target.parentNode.parentNode.children;\n let newTitle = tr[1].innerText;\n let newDescription = tr[2].innerText;\n console.log(newTitle);\n console.log(newDescription);\n let array_index = todos.length-tr[0].innerText;\n console.log(array_index);\n todos[array_index].title = newTitle;\n todos[array_index].description = newDescription;\n console.log(todos);\n tableData();\n}", "title": "" }, { "docid": "0e04420a1a3a5f01fab1fc0a6061cd20", "score": "0.54816705", "text": "function songIndexChange(delta) {\n var newSongIndex = currentSongIndex + delta;\n if (newSongIndex == songList.length) {\n newSongIndex = 0;\n }\n if (newSongIndex < 0) {\n newSongIndex = songList.length - 1;\n }\n if (newSongIndex >= 0 && newSongIndex < songList.length) {\n currentSong = songList[newSongIndex];\n currentSongIndex = newSongIndex;\n episodeNameTextArea.setText(currentSong);\n applyToLeaderboard(currentSong);\n }\n }", "title": "" }, { "docid": "2df9324f2731d827b1884e12f6d6c842", "score": "0.54687613", "text": "onClickTriTitre() {\n this.sortByTitre()\n trier.prepend(titre)\n this.initMedia() \n }", "title": "" }, { "docid": "dda5b55e38ddd6eff4104dea1ecde372", "score": "0.5464604", "text": "function changeItem(direction) {\n\t\tcurrentIndex = mod(numbers.length, currentIndex + direction);\n\t\t$('#learn-pic').attr('alt', numbers[currentIndex].numeral);\n\t\t$('#numeral').html(numbers[currentIndex].numeral);\n\t\t$('#word').html(numbers[currentIndex].word);\n\t\t$('#learn-pic').attr('src', numbers[currentIndex].image);\n\t\t$('#learn-pic').attr('alt', numbers[currentIndex].numeral);\n\t}", "title": "" }, { "docid": "d8117bd2895dc2dbff40637a382de546", "score": "0.5460826", "text": "function _highlightSong(index) {\n $(\".song:nth-child(\" + (index + 1) + \")\").addClass(\"now-playing\");\n}", "title": "" }, { "docid": "b9beafdd3e8ae70dbe3e44ee9fa6b1ab", "score": "0.54543734", "text": "function selectWord(idx) {\n wordSelector = idx;\n const word = activeWordsSelector;\n word[idx].classList.add(\"word-active\");\n if (idx == 0) {\n for (let i = 1; i < word.length; i++) {\n word[i].classList.remove(\"word-active\");\n word[i].classList.remove(\"word-wrong\");\n word[i].classList.remove(\"word-right\");\n }\n }\n}", "title": "" }, { "docid": "8cae5b59750ad4a8efc60cc1b0d6c3fc", "score": "0.5452732", "text": "function changeText(e) {\r\n textElement.innerText = \"hello, world!\";\r\n }", "title": "" }, { "docid": "a5aa6b13e8defadbcb88f4bcf359bb44", "score": "0.54505146", "text": "function editSong(index) {\n//can do JavaScript like line below\n//document.getElementById('editTitle').value = songs[b].title;\n//or jquery like below\n$('#editTitle').val(songs[index].title);\n$('#editArtist').val(songs[index].artist);\n$('#editGenre').val(songs[index].genre);\n//create a button in javascript like line below\n//document.getElementById('saveEditButton').innerHTML = '<button type=\"button\" class=\"btn btn-primary\">Save changes</button>'\n//in jquery\n$('#saveEditButton').html('<button onclick=\"saveChanges('+index+')\" type=\"button\" class=\"btn btn-primary\">Save changes</button>');\n$('#myModal').modal('toggle');\n\n}", "title": "" }, { "docid": "f6da5a8e7dcecfba0f47a9aaff3f1c16", "score": "0.5445108", "text": "function buttonEventHandler(e){\n const index = e.target.dataset.index;\n let likeDisplay = document.getElementById(`numb-${index}`)\n let post = filteredPosts[index];\n\n\n let currentLikes = likeDisplay.textContent;\n currentLikes = parseInt(currentLikes, 10)\n const ogLikes = post.likes;\n const addedLikes = ogLikes+1;\n \n if(currentLikes === ogLikes){\n currentLikes++\n likeDisplay.textContent = currentLikes;\n } else if(currentLikes === addedLikes){\n currentLikes--\n likeDisplay.textContent = currentLikes;\n }\n }", "title": "" }, { "docid": "450219226f059bf030a5983e5be2f0d2", "score": "0.54431283", "text": "function changeTitle(){\r\n\tvar questions = [\"1. Given a category ID, name and type, create a new category\", \r\n\t\"2. Given a category ID, remove the record for that category\",\r\n\t\"3. Produce a summary report of books available in each category.\"];\r\n\r\n\tvar qstNo = (questions[0]);\t// Get first index of array of questions\r\n\tvar question= '';\t\t\t// an empty string\r\n\t\r\n\ttitle = qstNo; // give it a value\r\n\t\r\n\t$('#title').empty();\t\t// remove the children\t\r\n\t$('#title').append(question);\t// add question\r\n\tfor(var i=0; i<questions.length; i++){\r\n\t\tif(document.getElementById('button').clicked == true)\r\n\t\t\t{\r\n \t\t\t\tqstNo++;\r\n\t\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "df994117148f1e7a108f39ab3749addd", "score": "0.5442557", "text": "function changeInputText(placeholdetext) {\n if (placeholdetext === \"Ask a Question\") {\n $('.banner__result').find('.banner__result-button').text('Get Answers');\n $('.banner__searchbar').find('input[type=text]').attr(\"placeholder\", \"Ex. How to add domain user to local admin group on Win 10\");\n $('.banner__searchbar').find('input[type=text]').attr(\"labelValue\", \"\");\n } else if (placeholdetext === \"Learn Tech Skills\") {\n $('.banner__result').find('.banner__result-button').text('Find Resources');\n $('.banner__searchbar').find('input[type=text]').attr(\"placeholder\", \"Ex. Cloud Computing\");\n $('.banner__searchbar').find('input[type=text]').attr(\"labelValue\", \"Learn_\");\n } else if (placeholdetext === \"Read Product Reviews\") {\n $('.banner__result').find('.banner__result-button').text('Find Products');\n $('.banner__searchbar').find('input[type=text]').attr(\"placeholder\", \"Ex. Cisco Routers\");\n $('.banner__searchbar').find('input[type=text]').attr(\"labelValue\", \"Products_\");\n }\n}", "title": "" }, { "docid": "b175e65e88a9f65cfafe291ad81a6759", "score": "0.54370594", "text": "function updateQuestion(){\n questionIndex += 1;\n $('.q-counter span').html(`${questionIndex}`);\n console.log(questionIndex);\n }", "title": "" }, { "docid": "55907373c13e91f2524aab00957ee83e", "score": "0.5434407", "text": "function editItem(title){\r\n let previous = editingEl.innerText\r\n\r\n let i = items.indexOf(previous)\r\n items[i] = title\r\n saveItems()\r\n\r\n editingEl.innerText = title\r\n input.value = ''\r\n submitBtn.innerText = 'submit'\r\n editing = false\r\n editingEl = null\r\n}", "title": "" }, { "docid": "55e6340b8d9de8f5e15ac90b3982a112", "score": "0.54214686", "text": "function selectByIndex(i, mode, noHistory) {\r\n\t//Select the item that was clicked on in the list so it will be highlighted upon return\r\n\t$('.ui-focus').removeClass('ui-focus');\r\n\t$('#lsWords li:nth-child(' + (i + 1) + ')').addClass('ui-focus');\r\n\r\n\tvar ls = getList(mode); /* Get the word list based on the current mode */\r\n\tvar wordObj = ls[i]; /* Select the word object */\r\n\twordObj.mode = mode; /* Set the current mode on the word selected */\r\n\r\n\thighlightSearchTerms(wordObj, ls); /* Highlight any search terms */\r\n\tsetHeader(wordObj, ls); /* Set the header on the word display page (word and count) */\r\n\tselectWord(wordObj, noHistory); /* Display the word */\r\n}", "title": "" }, { "docid": "75d0cdccf42a625a8c69ead250371ee8", "score": "0.54202557", "text": "function WelcomePhrase() {\n $('[data-action=\"toggle-welcome-phrase\"]').on('click', function (e) {\n e.preventDefault();\n this.togglePhrase(e.target);\n }.bind(this));\n }", "title": "" }, { "docid": "63636de366b278791b8644efb73286d1", "score": "0.54185605", "text": "function next(){\r\n\tconsole.log(\"Next was clicked\");\r\n\tcurrentWord += 1;\r\n\tif (currentWord>(totalWords-1)){\r\n\t\tcurrentWord = 0;\r\n\t}\r\n\tupdateCurrentWord();\r\n\trefreshDisplay();\r\n}", "title": "" }, { "docid": "72846694fa7587cac9433f451f4b9796", "score": "0.5411484", "text": "function showWord(words) {\n //generate array from index\n const randIndex = Math.floor(Math.random() * words.length);\n //output random word\n currentWord.innerHTML = words[randIndex];\n}", "title": "" }, { "docid": "c65376332fcc539aed2fbb716f7cb072", "score": "0.54109895", "text": "function updateIndexes() {\n currentImageIndex = currentIndex * 3;\n currentTextIndex = currentImageIndex + 1;\n currentNumberIndex = currentImageIndex + 2;\n }", "title": "" }, { "docid": "89bcc7056a7fd8ef66a1ec7fc31282a1", "score": "0.5409752", "text": "function changeCompletely(element, index, array){\n array[index] = 'and now ${array[index]}';\n\n}", "title": "" }, { "docid": "41f296c33f23ab83454ed6aa4adac5dd", "score": "0.54095346", "text": "function changeSentence() {\n sentence = document.getElementById(\"sentence\").value;\n start = document.getElementById(\"first_index\").value;\n end = document.getElementById(\"second_index\").value;\n if (end > start) {\n sentence = sentence.substring(0, start).concat(sentence.substring(end + 1));\n }\n document.getElementById(\"sent_changed\").innerHTML = sentence;\n }", "title": "" }, { "docid": "de556e6f60543f6c21c73956e760fedb", "score": "0.54038334", "text": "addCommandAt(index, name, target, value) {\n let caseIdText = this.getSelectedCases()[0];\n return this.addCommand(caseIdText, index, name, target, value);\n }", "title": "" }, { "docid": "aa1e88f6a7817fee38b15907d5b8e209", "score": "0.5403224", "text": "function displayQuestion() {\n\t\tconst html = questions[index];\n\t\tif (index < questions.length - 1) {\n\t\t\tindex++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tindex = 0;\n\t\t}\n\t\tconsole.log(index);\n\t\tquestion.innerHTML = html;\n\t}", "title": "" }, { "docid": "ec92dc135f6cc8d8a9c6e3e56f3da30f", "score": "0.53974694", "text": "function updateState(index) {\n var newstate = read.question('enter the new state name');\n data[index].state = newstate;\n writefile(data);\n }", "title": "" }, { "docid": "a5aeedf1a9bd35129e8fa80ddf375a42", "score": "0.5393603", "text": "function changeText(item, text){\n item.textContent = text;\n if(item === 'help'){\n setTimeout(() => {\n item.textContent = 'Waiting to see what you do next!';\n }, 1500);\n }\n}", "title": "" }, { "docid": "b021f993b490c88c54043d270aa0192f", "score": "0.53924775", "text": "function secondChangeTitle() {\n SECOND_TITLE.innerText = \"Vista Previa\"\n}", "title": "" }, { "docid": "9ae2110dfd7227a956428f4edd72f3e7", "score": "0.53870326", "text": "function nextQuestion(index){\n\t//document.getElementById('question').innerHTML = \"Question \" + (index + 1) + \": \" + trivia[index].question;\n\t$(\"#question\").html(\"Question \" + (index + 1) + \": \" + trivia[index].question);\n\n\t//var options = \"<ol>\";\n\tvar options = $(\"<ol>\");\n\tfor(var i = 0; i < trivia[index].options.length; i++){\n\t\toptions.append($(\"<button>\").addClass(\"choice-button\").attr(\"value\", trivia[index].options[i].split(\" \").join(\"+\")).text(trivia[index].options[i]))\n\t\t//options += \"<button class='choice-button' value=\"+trivia[index].options[i].split(\" \").join(\"+\")+\">\" + trivia[index].options[i] + \"</button>\"\n\t}\n\t//document.getElementById('options-list').innerHTML = options + \"</ol>\"\n\t$(\"#options-list\").html(options);\n}", "title": "" }, { "docid": "df53ab0388682a22d7d0ad72af55ad1a", "score": "0.5386729", "text": "function fillWithArg(chosenWord){\n //loop to the length of the word to generate spans\n for( i=0;i<chosenWord.length;i++){\n //generate span with an id that hold the index of the letters in the word \n //so we can use it when we try to change a specific span\n $(\"#current_word_content\").append(\"<span id=\\\"\"+i+\"\\\">\"+\"- \"+\"</span>\");\n }\n }", "title": "" }, { "docid": "bbf7a4bb887a7a78f9a017475fa846b1", "score": "0.53815174", "text": "function CapNhatThongTin(){\n//Lay thong tin va tao doi tuong\nvar nhanVien = LayThongTin();\n\n//Cập nhật Đè lên đối tượng cần sửa\nvar index = TimViTri(nhanVien.maNhanVien);\nmangNhanVien[index] = nhanVien;\n\nHienThi(mangNhanVien);\n}", "title": "" }, { "docid": "3ba908058b53613a39cdb9a19a27388a", "score": "0.53780276", "text": "function onBtnPushed5() {\n if(idH2.textContent === \"Hello Canada\" ) {\n idH2.textContent = \"Hello Banff\";\n }\n else {\n idH2.textContent = \"Hello Canada\";\n }\n}", "title": "" }, { "docid": "6a1ae50306d674d1aa8d908927d41879", "score": "0.53778774", "text": "function showWord(words) {\n // Generate random array index\n const randIndex = Math.floor(Math.random() * words.length);\n //output phrase\n currentPhrase.innerHTML = words[randWordsIndex].join(' ');\n // Output random word\n currentWord.innerHTML = words[randWordsIndex][phraseIndex++];\n}", "title": "" }, { "docid": "14e0e90e31ec51dada4301813b320be7", "score": "0.53760064", "text": "goTo (state, i) {\n if (i >= 0 && i < state.songs.length) {\n state.currentIndex = i\n }\n }", "title": "" }, { "docid": "16b742a02de9da4b10d85eb3d32dae6b", "score": "0.5375523", "text": "function placeMur(i, j){\n \n table.rows[i].cells[j].innerHTML = 1;\n \n}", "title": "" }, { "docid": "ef9d7ba1baa4bd8544e36a68ad9c6798", "score": "0.53736204", "text": "function showWord() {\n const randIndex = Math.floor(Math.random() * app.wordList.length);\n app.newWord = app.wordList[randIndex];\n $(\"#current-word\").html(app.newWord);\n}", "title": "" } ]
81cd1e360627aed1fbe1a8fa5beda221
Returns a random integer between min (included) and max (included)
[ { "docid": "86bbaab3287523e5e5069c4212ec3bff", "score": "0.8451298", "text": "function getRandomIntInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" } ]
[ { "docid": "a08d808794d579057dca0b50e6a61c46", "score": "0.87615114", "text": "getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive\n }", "title": "" }, { "docid": "3ade48806414b84549ed89dc4b542805", "score": "0.8742099", "text": "function getRandomInt(min, max) {return Math.floor(Math.random() * (max - min + 1)) + min;}", "title": "" }, { "docid": "f1c0c8d721c70925ee04fdf16ad74151", "score": "0.8711243", "text": "getRandomIntInclusive(min = ceil(min), max = floor(max)) {\n return floor(random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "e5df56dc53f58f5206c390b00cef0f21", "score": "0.8692936", "text": "function getRandomIntInclusive(min,max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;}", "title": "" }, { "docid": "123e09ef2e729e32e194432a50dc7686", "score": "0.8674383", "text": "function intBetween(min, max) {\n return Math.random() * (max - min) + min;\n}", "title": "" }, { "docid": "5b97e23f74c5dbcc7362346474a3dbb7", "score": "0.8661591", "text": "function randint(min, max) { return Math.floor(Math.random() * (max - min) + min); }", "title": "" }, { "docid": "a0d01d30115aac9f836c06f6b0fefd6d", "score": "0.8632284", "text": "function randomInt(min, max) {return Math.floor(Math.random() * (max - min)) + min;}", "title": "" }, { "docid": "0f47b4eddf10b93ac8a500208499e9c8", "score": "0.861902", "text": "getRandomInt(min, max){\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min) + min); \n }", "title": "" }, { "docid": "7b707372ff41d90d7b296be5ad83956e", "score": "0.86127335", "text": "getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "b34ecc1ecf63d4ea8abf19318f452aea", "score": "0.8580716", "text": "getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "30e1fdb46298ae672bf530a14679e572", "score": "0.85801244", "text": "getRandomInt(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n }", "title": "" }, { "docid": "5e34b509b23fd7061084051a3f8991a9", "score": "0.85783845", "text": "function getRandomIntInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "5f5ff04441100d633cbe3a0678417f28", "score": "0.8576308", "text": "function randomIntFromInterval(min,max){\n\n return Math.floor(Math.random()*(max-min+1)+min);\n }", "title": "" }, { "docid": "0d7edbe2bea6e0138f65b482b5f3b60c", "score": "0.8573773", "text": "function getRandomInt() {\n min = Math.ceil(min);\n max = Math.floor(max);\n \n return Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "9327515f8cdedcc78fb0e2be2ddf95d6", "score": "0.8570666", "text": "function randomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }", "title": "" }, { "docid": "4fccb248dde5527abe988c555dc7ebd2", "score": "0.85515094", "text": "function getRandomIntByRange(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min }", "title": "" }, { "docid": "9a704e6f22c04519c458f3a02c79b125", "score": "0.8550625", "text": "function randomIntFromInterval(min,max)\n{\n return Math.floor(Math.random()*(max - min + 1) + min);\n}", "title": "" }, { "docid": "2a22321ccab04babced38c23020cfb66", "score": "0.85499567", "text": "function getRandomIntInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "f62bb82ec7259413f976c4e4ebd837c9", "score": "0.85469234", "text": "function getRandomInt(min, max)\r\n{\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "title": "" }, { "docid": "8a576fe99ac9133038ec1310b7a27c77", "score": "0.854483", "text": "getRandomIntegerBetween(min, max) {\n\t\treturn Math.floor(Math.random() * (max - min + 1) + min);\n\t}", "title": "" }, { "docid": "0f4867a7fcb1270c419cccb1a89f1865", "score": "0.85424036", "text": "function randomIntFromInterval(min,max)\n{\n return Math.floor(Math.random()*(max-min+1)+min);\n}", "title": "" }, { "docid": "162db9070afe3b0f3fd58194d9d3223d", "score": "0.85404754", "text": "function getRandomIntegerInclusive(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "title": "" }, { "docid": "ba0b390a87668a56f8ae590550bfc845", "score": "0.8539158", "text": "randomInt(min, max) {\n return Math.floor(Math.random() * max) + min;\n }", "title": "" }, { "docid": "5030ba9abd5b448da7029cb96a96e688", "score": "0.85372305", "text": "function getRandomIntInclusive(min, max){\n\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "6ba1dc5aa4ef451e9df22b0ff143f2cb", "score": "0.8536109", "text": "function getRndInteger(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1) ) + min;\r\n }", "title": "" }, { "docid": "d70bdebd533b5973eb1363f01e965bf0", "score": "0.8529527", "text": "static randomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "title": "" }, { "docid": "ee3cfc20893d2759b468ffd1bcce8d88", "score": "0.8528274", "text": "function getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; //max included - min included\n}", "title": "" }, { "docid": "693dd8f10ce3b54e7b37b2030d6c8996", "score": "0.8523303", "text": "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n} //random number", "title": "" }, { "docid": "8a6299852d36dd4db6d973dd4d6b2ee9", "score": "0.852231", "text": "function getRandomInt(min, max) \n{\n return Math.floor(Math.random() * Math.floor(max - min) + min);\n}", "title": "" }, { "docid": "7de04d79b36e3339fb1dfe99a29f1b8a", "score": "0.85220087", "text": "function getRandomIntInclusive(min, max) {\n\t\t\t\tmin = Math.ceil(min);\n\t\t\t\tmax = Math.floor(max);\n\t\t\t\treturn Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive \n\t\t\t}", "title": "" }, { "docid": "250e2de4576ffd82b4f37bee971898ab", "score": "0.8517817", "text": "function getRndInteger(min, max) \n{\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n}", "title": "" }, { "docid": "e404fd77a3090e944e3f04b5950453fe", "score": "0.85160786", "text": "static getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min;\n }", "title": "" }, { "docid": "fd7fb8323ca272aa57f4bf20540edd10", "score": "0.85159177", "text": "function getRandomIntInclusive(min, max) {\n \t\tmin = Math.ceil(min);\n \t\tmax = Math.floor(max);\n \t\treturn Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive \n\t}", "title": "" }, { "docid": "c29a0bd5951aca50414e6656df8de716", "score": "0.85147387", "text": "function randomIntInclusive(min, max) {\n\tmin = Math.ceil(min);\n\tmax = Math.floor(max);\n\treturn Math.floor(Math.random() * (max - min + 1)) + min; \n}", "title": "" }, { "docid": "bd150360e152490b257e7b8f6f28e761", "score": "0.8512378", "text": "function getRndInteger(min, max) \n {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "title": "" }, { "docid": "2ebe95f3456ab4c4e553a06102ca8cee", "score": "0.8512228", "text": "function getRandomInt(min, max) \n{ \n return Math.floor(Math.random() * (max - min + 1)) + min; \n}", "title": "" }, { "docid": "901cd7b5495dd6de3d7dc78140a99a39", "score": "0.8511477", "text": "getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "ba21b9d3d976b4cac8c881eeb9c6e21e", "score": "0.85111225", "text": "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "title": "" }, { "docid": "114e8b678cb1b15c46a91d22504f4aed", "score": "0.85105497", "text": "function randomIntFromInterval(min,max){\n return Math.floor(Math.random()*(max-min+1)+min);\n}", "title": "" }, { "docid": "c481bf069a00b8f3e3f753f48f8ad4cc", "score": "0.8508825", "text": "randomIntFromInterval(min, max){\n return Math.floor(Math.random() * ( max - min + 1)) + min\n }", "title": "" }, { "docid": "1c745aa60b8214a4b1fcfedb02883c4b", "score": "0.85026306", "text": "function randomIntFromInterval(min, max) { // min and max included \n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "title": "" }, { "docid": "da6dd77fb5db06f5182b3f45128c2c8f", "score": "0.8498232", "text": "function randomIntFromInterval(min,max) {\n return Math.floor(Math.random()*(max-min+1)+min);\n }", "title": "" }, { "docid": "d1e99567c8b3996a874bd51c256796d9", "score": "0.849661", "text": "function getRandomInt(min, max) {\r return Math.floor(Math.random() * (max - min)) + min;\r}", "title": "" }, { "docid": "9b2d1d839f31daef3136a4a1303958f3", "score": "0.84907854", "text": "function getRndInteger(min,max){\n\treturn Math.floor(Math.random() * (max - min )) + min;\n}", "title": "" }, { "docid": "67b6a52ebdf2a011e704412b4fa0db53", "score": "0.84895605", "text": "function getRndInteger(min, max) {\r\n return Math.floor(Math.random() * (max - min) ) + min;\r\n }", "title": "" }, { "docid": "8b7c5a086a50915697d6280ed9eaa12c", "score": "0.84892774", "text": "function getRndInteger(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1) ) + min;\r\n}", "title": "" }, { "docid": "7ff3c3eb3bee409f4f32aadeb2dffa7f", "score": "0.84860575", "text": "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "title": "" }, { "docid": "16b7109ea7b8211ff494213265a057a5", "score": "0.8485631", "text": "function getRandomInt(min,max){\n return Math.floor((Math.random() * max) + min);\n}", "title": "" }, { "docid": "f2a292f149e8c8480858954a11adaad0", "score": "0.84841233", "text": "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "title": "" }, { "docid": "f2a292f149e8c8480858954a11adaad0", "score": "0.84841233", "text": "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "title": "" }, { "docid": "154c7b4620fdcd07be114f8a44876bcd", "score": "0.84809804", "text": "function getRndInteger (min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min; \n}", "title": "" }, { "docid": "8fb9e370c63ce364d6f568224d593eb2", "score": "0.8479174", "text": "function getRandomInteger(min, max)\n{\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "86fff2271b3c3d73bbb95e7f033d9bf3", "score": "0.84774405", "text": "function randomInteger(min,max){\n return Math.floor(Math.random()*(max-min+1) +min);\n}", "title": "" }, { "docid": "46f35184c826be707c6c8947f5904d51", "score": "0.8476356", "text": "function randomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; \n}", "title": "" }, { "docid": "c04393fa7aae10d813bb75dfeda0a79b", "score": "0.847625", "text": "function getRandomInt(min,max){\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random()*(max-min+1))+min;\n }", "title": "" }, { "docid": "a440c4c8bdad0468462b3d8de4d98384", "score": "0.84750795", "text": "function randomIntFromInterval(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "title": "" }, { "docid": "df0f524887bcf017a79d35f8717db2ae", "score": "0.84749657", "text": "function getRandomInt(min, max)\n{\n return Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "e022b8c425d0c2274de7b042f87726e6", "score": "0.8473855", "text": "function getRandomInteger(min, max) {\n \treturn Math.floor(Math.random() * (max - min + 1) ) + min;\n\t}", "title": "" }, { "docid": "51f5926ab9ec03e7f831b219d7da3f68", "score": "0.84731007", "text": "function randomizeInt(min,max){\n\t\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n\t}", "title": "" }, { "docid": "9580601c257742ded4abefa8b28cea3f", "score": "0.8469696", "text": "function randomIntFromInterval(min, max) { // min and max included \n return Math.floor(Math.random() * (max - min + 1) + min)\n}", "title": "" }, { "docid": "6a894eb8cd935544c4e5d2a6110f80dd", "score": "0.8466652", "text": "static randInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive\n }", "title": "" }, { "docid": "bd41b45b4d702ae6356c3ab7b8e81d48", "score": "0.84643644", "text": "function getRndInteger(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1) ) + min;\r\n}", "title": "" }, { "docid": "b03df98f2a89204445e29dbc7db14cde", "score": "0.846362", "text": "function getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min; }", "title": "" }, { "docid": "8f18a46e44ebb89d1303c0a1cba0f482", "score": "0.84626764", "text": "function randomIntFromInterval(min,max) {\n return Math.floor(Math.random()*(max-min+1)+min);\n}", "title": "" }, { "docid": "ccd9d9a969a36922edb0a7bcc997a3f1", "score": "0.8460855", "text": "static randomInt(min, max){\n \n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min;\n \n }", "title": "" }, { "docid": "388372ce63acb7527d07e1ec916e0113", "score": "0.8460713", "text": "function getRndInteger(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1) ) + min;\r\n }", "title": "" }, { "docid": "772cf375a14d8febad7286986be07a4e", "score": "0.84599876", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive \n}", "title": "" }, { "docid": "972225c00eac0f20061d70bac8328b97", "score": "0.8459447", "text": "function randomIntFromInterval(min, max) { // min and max included \n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "title": "" }, { "docid": "9fdd8aca26d6518954c90690a4b65c7e", "score": "0.8459271", "text": "function getRandomIntInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "9fdd8aca26d6518954c90690a4b65c7e", "score": "0.8459271", "text": "function getRandomIntInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "aa4b25e2923e74b6b525a0b506f89840", "score": "0.84583044", "text": "function randomIntegerBetween(min, max) {\n\n\treturn Math.floor(Math.random() * (max-min) + min);\n\n}", "title": "" }, { "docid": "333ab3db05bb8acd2638bf789035bd02", "score": "0.8456797", "text": "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "50866091895b3dc74a63ed11cd8eb674", "score": "0.8456375", "text": "function getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "b40a5db5e3f1f798fdff395dbd0070c2", "score": "0.8454267", "text": "function getRandomIntInclusive(min, max) {\n\t\tmin = Math.ceil(min);\n\t\tmax = Math.floor(max);\n\t\treturn Math.floor(Math.random() * (max - min +1)) + min;\n\t}", "title": "" }, { "docid": "24e101291c326b18867c8ec3ae5055c2", "score": "0.84530073", "text": "function randomInteger(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n }", "title": "" }, { "docid": "a3af3f6e71dcbb0ecad1f4eeeb0b91b1", "score": "0.8452024", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; //Il max è incluso e il min è incluso \n }", "title": "" }, { "docid": "2bfd3e8d744f8348af804f99a20179ab", "score": "0.84519756", "text": "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "9d0db82be201eab73095457316572363", "score": "0.84511364", "text": "function getRandomInt(min, max) \n{\n return Math.floor(Math.random() * (max - min + 1)) + min;\n} // getRandomInt()", "title": "" }, { "docid": "708fea7a58a97139d0a8af066d7b3ee1", "score": "0.8450414", "text": "static getRandomInt(min, max) {\n\t\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n\t}", "title": "" }, { "docid": "194e95e24f241dbf42e8b4e87b6755a4", "score": "0.8449021", "text": "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min; \n }", "title": "" }, { "docid": "af9ad0d40de55f7221cf0195b0f2c412", "score": "0.84481466", "text": "function getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive \n}", "title": "" }, { "docid": "8b6f7e5dd776a033e4859074715f52fc", "score": "0.84475315", "text": "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "bfc391a0532002764adb8e562a325728", "score": "0.8447328", "text": "function randomIntFromInterval(min, max) { // min and max included \n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "title": "" }, { "docid": "0b2d98aacbe0fdedf8d141facf8fc1a6", "score": "0.84467345", "text": "function random_int(min, max){ \n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "ad6af9b3b01c7ebbb52597ab821aaba7", "score": "0.8444111", "text": "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "title": "" }, { "docid": "ad6af9b3b01c7ebbb52597ab821aaba7", "score": "0.8444111", "text": "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "title": "" }, { "docid": "c724b82d5df131f2dd51149366594f8c", "score": "0.84411055", "text": "function randomInt(min, max)\r\n{\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "title": "" }, { "docid": "c724b82d5df131f2dd51149366594f8c", "score": "0.84411055", "text": "function randomInt(min, max)\r\n{\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "title": "" }, { "docid": "9da582abb7bd086842a14c56d60ad49d", "score": "0.8441101", "text": "function randInt(min, max) {\r\n return Math.floor(Math.random()*max + min);\r\n}", "title": "" }, { "docid": "59471cb6f421f0cab14584a9c71bd01b", "score": "0.84407556", "text": "function randInt(min,max){\r\n return Math.floor(Math.random()*(max-min))+min;\r\n}", "title": "" }, { "docid": "09cf6b9600df013495d7a577d5ade814", "score": "0.84405667", "text": "function getRandomInt(min, max) {\r\n \treturn Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "title": "" }, { "docid": "9dfd14c703d9b6829173c4056ce4380b", "score": "0.84401697", "text": "function randomInt(min, max){ // min and max included \n return Math.floor(Math.random()*(max-min+1)+min);\n}", "title": "" }, { "docid": "6b6fa406654d8c950a138de2322180d6", "score": "0.8439068", "text": "function getRandomInteger(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "title": "" }, { "docid": "f329dc0be2ec5a00fca5a16c2e1065a0", "score": "0.84377295", "text": "function getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" } ]
a583b5fb04ff6d10cd2beb0d0da24ae2
to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine whether mapToProps needs to be invoked when props have changed. A length of one signals that mapToProps does not depend on props from the parent component. A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and therefore not reporting its length accurately..
[ { "docid": "5f268b23d9a296a0bfe6413911856609", "score": "0.0", "text": "function getDependsOnOwnProps(mapToProps) {\n return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n} // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,", "title": "" } ]
[ { "docid": "4d4ea5c7850065ffb16715aada823351", "score": "0.5888752", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t }; // allow detectFactoryAndVerify to get ownProps\n\n\n\t proxy.dependsOnOwnProps = true;\n\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\t return props;\n\t };\n\n\t return proxy;\n\t };\n\t}", "title": "" }, { "docid": "11f842b88dbafd693001c539b549e59b", "score": "0.58535624", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t }; // allow detectFactoryAndVerify to get ownProps\n\n\n\t proxy.dependsOnOwnProps = true;\n\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\n\t if (false) (0, _verifyPlainObject.default)(props, displayName, methodName);\n\t return props;\n\t };\n\n\t return proxy;\n\t };\n\t}", "title": "" }, { "docid": "85b4ac253b21b0d94d82a2164a53e507", "score": "0.5814533", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\t\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t }; // allow detectFactoryAndVerify to get ownProps\n\t\n\t\n\t proxy.dependsOnOwnProps = true;\n\t\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\t\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\t\n\t if (false) (0, _verifyPlainObject[\"default\"])(props, displayName, methodName);\n\t return props;\n\t };\n\t\n\t return proxy;\n\t };\n\t}", "title": "" }, { "docid": "85b4ac253b21b0d94d82a2164a53e507", "score": "0.5814533", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\t\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t }; // allow detectFactoryAndVerify to get ownProps\n\t\n\t\n\t proxy.dependsOnOwnProps = true;\n\t\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\t\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\t\n\t if (false) (0, _verifyPlainObject[\"default\"])(props, displayName, methodName);\n\t return props;\n\t };\n\t\n\t return proxy;\n\t };\n\t}", "title": "" }, { "docid": "6d6831e51c85e828a197323560d0ff38", "score": "0.5813384", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\r\n return function initProxySelector(dispatch, _ref) {\r\n var displayName = _ref.displayName;\r\n \r\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\r\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\r\n };\r\n \r\n // allow detectFactoryAndVerify to get ownProps\r\n proxy.dependsOnOwnProps = true;\r\n \r\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\r\n proxy.mapToProps = mapToProps;\r\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\r\n var props = proxy(stateOrDispatch, ownProps);\r\n \r\n if (typeof props === 'function') {\r\n proxy.mapToProps = props;\r\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\r\n props = proxy(stateOrDispatch, ownProps);\r\n }\r\n \r\n if (\"production\" !== 'production') (0, _verifyPlainObject2.default)(props, displayName, methodName);\r\n \r\n return props;\r\n };\r\n \r\n return proxy;\r\n };\r\n }", "title": "" }, { "docid": "684084449ef50815ec3709dc951457f2", "score": "0.5809302", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\t\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t }; // allow detectFactoryAndVerify to get ownProps\n\t\n\t\n\t proxy.dependsOnOwnProps = true;\n\t\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\t\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\t\n\t if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject[\"default\"])(props, displayName, methodName);\n\t return props;\n\t };\n\t\n\t return proxy;\n\t };\n\t}", "title": "" }, { "docid": "684084449ef50815ec3709dc951457f2", "score": "0.5809302", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\t\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t }; // allow detectFactoryAndVerify to get ownProps\n\t\n\t\n\t proxy.dependsOnOwnProps = true;\n\t\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\t\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\t\n\t if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject[\"default\"])(props, displayName, methodName);\n\t return props;\n\t };\n\t\n\t return proxy;\n\t };\n\t}", "title": "" }, { "docid": "001ebcef2148928588c052afdc594c17", "score": "0.58074576", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n verifyPlainObject(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n }", "title": "" }, { "docid": "001ebcef2148928588c052afdc594c17", "score": "0.58074576", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n verifyPlainObject(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n }", "title": "" }, { "docid": "7f12c7931a2681d0a300449563c89a2a", "score": "0.5800517", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\t\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\t\n\t // allow detectFactoryAndVerify to get ownProps\n\t proxy.dependsOnOwnProps = true;\n\t\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\t\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\t\n\t if (false) (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\t\n\t return props;\n\t };\n\t\n\t return proxy;\n\t };\n\t}", "title": "" }, { "docid": "704b0f5ab23a200a3aaa85b12289f2de", "score": "0.5795866", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\t\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\t\n\t // allow detectFactoryAndVerify to get ownProps\n\t proxy.dependsOnOwnProps = true;\n\t\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\t\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\t\n\t if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\t\n\t return props;\n\t };\n\t\n\t return proxy;\n\t };\n\t}", "title": "" }, { "docid": "704b0f5ab23a200a3aaa85b12289f2de", "score": "0.5795866", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\t\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\t\n\t // allow detectFactoryAndVerify to get ownProps\n\t proxy.dependsOnOwnProps = true;\n\t\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\t\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\t\n\t if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\t\n\t return props;\n\t };\n\t\n\t return proxy;\n\t };\n\t}", "title": "" }, { "docid": "4ce933384082f8805339d18316040058", "score": "0.57819283", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n return props;\n };\n\n return proxy;\n };\n }", "title": "" }, { "docid": "cf49c928c717256b473bd411e9d8383d", "score": "0.5764342", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) {}\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "cf49c928c717256b473bd411e9d8383d", "score": "0.5764342", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) {}\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "cf49c928c717256b473bd411e9d8383d", "score": "0.5764342", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) {}\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "cf49c928c717256b473bd411e9d8383d", "score": "0.5764342", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) {}\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "cf49c928c717256b473bd411e9d8383d", "score": "0.5764342", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) {}\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "cf49c928c717256b473bd411e9d8383d", "score": "0.5764342", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) {}\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "cf49c928c717256b473bd411e9d8383d", "score": "0.5764342", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) {}\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "cf49c928c717256b473bd411e9d8383d", "score": "0.5764342", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) {}\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "cf49c928c717256b473bd411e9d8383d", "score": "0.5764342", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) {}\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "cf49c928c717256b473bd411e9d8383d", "score": "0.5764342", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) {}\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "17a1136eb0772bba95d98cfdea8b6ae5", "score": "0.5758933", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\n\t // allow detectFactoryAndVerify to get ownProps\n\t proxy.dependsOnOwnProps = true;\n\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\n\t if (true) (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n\t return props;\n\t };\n\n\t return proxy;\n\t };\n\t}", "title": "" }, { "docid": "17a1136eb0772bba95d98cfdea8b6ae5", "score": "0.5758933", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\n\t // allow detectFactoryAndVerify to get ownProps\n\t proxy.dependsOnOwnProps = true;\n\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\n\t if (true) (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n\t return props;\n\t };\n\n\t return proxy;\n\t };\n\t}", "title": "" }, { "docid": "17a1136eb0772bba95d98cfdea8b6ae5", "score": "0.5758933", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\n\t // allow detectFactoryAndVerify to get ownProps\n\t proxy.dependsOnOwnProps = true;\n\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\n\t if (true) (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n\t return props;\n\t };\n\n\t return proxy;\n\t };\n\t}", "title": "" }, { "docid": "17a1136eb0772bba95d98cfdea8b6ae5", "score": "0.5758933", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\n\t // allow detectFactoryAndVerify to get ownProps\n\t proxy.dependsOnOwnProps = true;\n\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\n\t if (true) (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n\t return props;\n\t };\n\n\t return proxy;\n\t };\n\t}", "title": "" }, { "docid": "d799a941108a4eebc672f3142b544048", "score": "0.57304454", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\n\t // allow detectFactoryAndVerify to get ownProps\n\t proxy.dependsOnOwnProps = true;\n\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\n\t if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n\t return props;\n\t };\n\n\t return proxy;\n\t };\n\t}", "title": "" }, { "docid": "d799a941108a4eebc672f3142b544048", "score": "0.57304454", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\n\t // allow detectFactoryAndVerify to get ownProps\n\t proxy.dependsOnOwnProps = true;\n\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\n\t if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n\t return props;\n\t };\n\n\t return proxy;\n\t };\n\t}", "title": "" }, { "docid": "d799a941108a4eebc672f3142b544048", "score": "0.57304454", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\n\t // allow detectFactoryAndVerify to get ownProps\n\t proxy.dependsOnOwnProps = true;\n\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\n\t if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n\t return props;\n\t };\n\n\t return proxy;\n\t };\n\t}", "title": "" }, { "docid": "3553828972e360967fabc11490728277", "score": "0.5727039", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\t\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\t\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t var props = proxy(stateOrDispatch, ownProps);\n\t\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\t\n\t if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\t\n\t return props;\n\t };\n\t\n\t return proxy;\n\t };\n\t}", "title": "" }, { "docid": "9bda2bfb94f2477fb437eeb42770e7d7", "score": "0.5726897", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) verifyPlainObject(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "9bda2bfb94f2477fb437eeb42770e7d7", "score": "0.5726897", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) verifyPlainObject(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "9bda2bfb94f2477fb437eeb42770e7d7", "score": "0.5726897", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) verifyPlainObject(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "9bda2bfb94f2477fb437eeb42770e7d7", "score": "0.5726897", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) verifyPlainObject(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "9bda2bfb94f2477fb437eeb42770e7d7", "score": "0.5726897", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) verifyPlainObject(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "da067a989e67ef42015dcc64dcc9d48f", "score": "0.57254624", "text": "function dispatchToProps() {\n return {}\n }", "title": "" }, { "docid": "4e421dbb5cc54c9393e15532fc2021aa", "score": "0.5719545", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (undefined !== 'production') (0, _verifyPlainObject.default)(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "adbcd5973057b081b4bb5e1ff92060e4", "score": "0.571328", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (\"production\" !== 'production') (0, _verifyPlainObject.default)(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "84121a6c62f2054032fc243e4c5bc7e4", "score": "0.5712269", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (\"production\" !== 'production') (0, _verifyPlainObject[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "83fa8523e2c1b9ba9d53b1705d285ecd", "score": "0.5711236", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) (0,_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "83fa8523e2c1b9ba9d53b1705d285ecd", "score": "0.5711236", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) (0,_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "83fa8523e2c1b9ba9d53b1705d285ecd", "score": "0.5711236", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) (0,_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "6da22e0b02d154215420d023d3ac4d9b", "score": "0.5695309", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) (0, _verifyPlainObject.default)(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "c944fe81dd04bea760270127206af4b2", "score": "0.56898224", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (\"development\" !== 'production') (0, _verifyPlainObject.default)(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "c944fe81dd04bea760270127206af4b2", "score": "0.56898224", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (\"development\" !== 'production') (0, _verifyPlainObject.default)(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "c944fe81dd04bea760270127206af4b2", "score": "0.56898224", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (\"development\" !== 'production') (0, _verifyPlainObject.default)(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "0b6bfacb758c8e84d0c6d6eb903c7c68", "score": "0.568615", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) {}\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "0b6bfacb758c8e84d0c6d6eb903c7c68", "score": "0.568615", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) {}\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "0b6bfacb758c8e84d0c6d6eb903c7c68", "score": "0.568615", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) {}\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "d824b4487317c3e9317628e37e5f810b", "score": "0.5684159", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "a38e19893d52ad3737e6feefab7b0b1d", "score": "0.5675557", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) (0,_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__.default)(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "a38e19893d52ad3737e6feefab7b0b1d", "score": "0.5675557", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) (0,_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__.default)(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "a89678a2cf51962ddb2a0ac16021d3a2", "score": "0.56737983", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t var props = proxy(stateOrDispatch, ownProps);\n\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\n\t if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n\t return props;\n\t };\n\n\t return proxy;\n\t };\n\t}", "title": "" }, { "docid": "a89678a2cf51962ddb2a0ac16021d3a2", "score": "0.56737983", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t var props = proxy(stateOrDispatch, ownProps);\n\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\n\t if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n\t return props;\n\t };\n\n\t return proxy;\n\t };\n\t}", "title": "" }, { "docid": "114ee571744527a7a1fc162e5f644806", "score": "0.56630415", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "80d018b8fa15fdf2bfe58c1c0b39b01d", "score": "0.56485575", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "80d018b8fa15fdf2bfe58c1c0b39b01d", "score": "0.56485575", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "80d018b8fa15fdf2bfe58c1c0b39b01d", "score": "0.56485575", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "80d018b8fa15fdf2bfe58c1c0b39b01d", "score": "0.56485575", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "80d018b8fa15fdf2bfe58c1c0b39b01d", "score": "0.56485575", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "80d018b8fa15fdf2bfe58c1c0b39b01d", "score": "0.56485575", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "80d018b8fa15fdf2bfe58c1c0b39b01d", "score": "0.56485575", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "80d018b8fa15fdf2bfe58c1c0b39b01d", "score": "0.56485575", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "80d018b8fa15fdf2bfe58c1c0b39b01d", "score": "0.56485575", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "80d018b8fa15fdf2bfe58c1c0b39b01d", "score": "0.56485575", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "80d018b8fa15fdf2bfe58c1c0b39b01d", "score": "0.56485575", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "80d018b8fa15fdf2bfe58c1c0b39b01d", "score": "0.56485575", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "80d018b8fa15fdf2bfe58c1c0b39b01d", "score": "0.56485575", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "80d018b8fa15fdf2bfe58c1c0b39b01d", "score": "0.56485575", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "17698d0d464413090fc3c2f3d4c9d185", "score": "0.56441593", "text": "function mapStateToProps(state, ownProps) {\n return {\n center: ownProps.center\n };\n\n}", "title": "" }, { "docid": "dc38c142261d217cd23d08577b5efc41", "score": "0.56422585", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "71c2b1e8727d9b21e3852ac0e2605c92", "score": "0.56407434", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "71c2b1e8727d9b21e3852ac0e2605c92", "score": "0.56407434", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "9664dea37eb04de326cfa1a034e6c3d0", "score": "0.56298995", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "c99db2144bd5b210adb1693f25e8aa98", "score": "0.5617762", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (undefined !== 'production') Object(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "c99db2144bd5b210adb1693f25e8aa98", "score": "0.5617762", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (undefined !== 'production') Object(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "95f9ac8f79bca1734a2d327827e6ff3f", "score": "0.5610705", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "95f9ac8f79bca1734a2d327827e6ff3f", "score": "0.5610705", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" }, { "docid": "95f9ac8f79bca1734a2d327827e6ff3f", "score": "0.5610705", "text": "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(_utils_verifyPlainObject__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "title": "" } ]
6ce23109d983dfec93302429ba6c3433
user click clear button remove all color from table
[ { "docid": "df75a5bb53aa9cae401683432dd06c13", "score": "0.81817997", "text": "function clean(){\n\t$('#clear').on('click',function(){\n $('.cell').css('background-color','')\n\t});\n}", "title": "" } ]
[ { "docid": "0473887fc7ddc64d0b5df551a4e1e0e3", "score": "0.7865885", "text": "function clearAll() {\n for (let i = 0; i < row; i++) {\n for (let j = 0; j < col; j++) {\n let currCell = table.rows[i].cells[j];\n currCell.style.backgroundColor = \"rgb(255,255,242)\";\n }\n }\n}", "title": "" }, { "docid": "c457fc5e7a18d987e48c684e9e9c6ee4", "score": "0.7389095", "text": "function clearAll() {\n //for all pixels\n let rows = document.getElementsByTagName(\"tr\");\n //for each row\n for (let row of rows) {\n //for each column\n let cols = row.getElementsByTagName(\"td\");\n for (let i = 0; i < cols.length; i++) {\n cols[i].style.background = \"white\";\n }\n }\n}", "title": "" }, { "docid": "acc366115652fbaee4d3918d306bb654", "score": "0.7330619", "text": "function clearAll() {\n const rows = [...table.children];\n\n rows.forEach((row) => {\n [...row.children].forEach((cell) => {\n cell.className = '';\n cell.removeAttribute('style');\n });\n });\n}", "title": "" }, { "docid": "08d021f7a0c50d2a6763cbfc9a841a41", "score": "0.72293776", "text": "function onClearClick ()\n{\n\n $('.controls .clear').click(onClearClick);\n $('.grid .cell').css('background-color', '');\n\n\n}", "title": "" }, { "docid": "440848140438ca62a8db72d9a513ce15", "score": "0.7199679", "text": "function clearTable() {\n d3.selectAll(\"tbody>tr\").remove();\n // d3.selectAll(\".filter list-group-item\").remove();\n console.log(\"Clear table\");\n}", "title": "" }, { "docid": "3896f4c5511a5a044d7f622d35c7a12e", "score": "0.7176196", "text": "function clearTable() {\n tbody.html(\"\");\n}", "title": "" }, { "docid": "4defff2b70cec5640b2ab1661e998759", "score": "0.71249574", "text": "function clearTable() {\n tbody.html(\"\");\n}", "title": "" }, { "docid": "b71a14ff7ff543b0d47d7fd8f2487eda", "score": "0.70953715", "text": "function clear() {\n regl.clear({\n color: bg\n })\n}", "title": "" }, { "docid": "c196425630069d801aeda6ac68ec890a", "score": "0.7083925", "text": "function clearToBlack() {\n\tdocument.getElementById(\"col_0_0\").background = \"black\";\n}", "title": "" }, { "docid": "1e397b82f88a37b30e9ff41f91b800b4", "score": "0.70816505", "text": "function clearBoard() {\n $('td').html('');\n }", "title": "" }, { "docid": "a2f221e7bc4bcddb8dbcac71b9014997", "score": "0.70628744", "text": "function clearColor () {\n \tgreen.style.backgroundColor = '#005f00'\n \tgreen.style.borderColor = '#4cbb17'\n \tred.style.backgroundColor = '#c00000'\n \tred.style.borderColor = '#ff0000'\n \tyellow.style.backgroundColor = '#ede212'\n \tyellow.style.borderColor = '#fffa00'\n \tblue.style.backgroundColor = '#0000ce'\n \tblue.style.borderColor = '#0059ff'\n }", "title": "" }, { "docid": "9926984aa5b8611570686dfd369398ca", "score": "0.7026752", "text": "function ClearAll() {\n tbody.html(\"\")\n}", "title": "" }, { "docid": "aacb350a986c3ffb480476c5cdeabda5", "score": "0.70207834", "text": "function segment_change_table_clear_fields(){\n\tdocument.getElementById('segment_top_part_right').innerHTML = '<span style=\"opacity:0.5;\">Veuillez selectionner une table</span>';\n\t\n\t//Clear the groupes\n\tsegment_build_prebuild_groupe();\n}", "title": "" }, { "docid": "80f4afb6363cbb447b33d10b829648c3", "score": "0.69720364", "text": "function clearTable() {\n for (let i = 0; i < cells.length; i++) {\n cells[i].innerText = '';\n }\n coiuntCells = 0;\n}", "title": "" }, { "docid": "cde4b74fecc73575d877646208490252", "score": "0.69664407", "text": "function clearBoard()\n {\n //clear board code\n $(\"td.box\").html(\"\");\n \n }", "title": "" }, { "docid": "84a039638e9e870fa262165b0929fdfa", "score": "0.69378763", "text": "function clearColors() {\n let gridColors = container.querySelectorAll(\".cell\");\n gridColors.forEach(gridColor => gridColor.style.backgroundColor = \"#ffffff\");\n}", "title": "" }, { "docid": "d183609a2de4277e47c06580fa87343e", "score": "0.6906829", "text": "function clear(){\n cells = document.getElementsByClassName(\"cell\")\n for(let i = 0; i < cells.length; i++){\n cells[i].style.backgroundColor = \"gray\"\n }\n}", "title": "" }, { "docid": "0b7e982339736dee709bd7414c5b3b9a", "score": "0.689013", "text": "function clearTable() {\n livsmedelTabell.innerHTML = \"\";\n}", "title": "" }, { "docid": "54cc3ec3890de91cca7504d01173e5b1", "score": "0.6886201", "text": "function clearButtons() {\n\t$(\"#green\").css({\"background\":\"green\"})\n\t$(\"#red\").css({\"background\":\"#b40101\"})\n\t$(\"#blue\").css({\"background\":\"#2650db\"})\n\t$(\"#yellow\").css({\"background\":\"#cbcb39\"})\n}", "title": "" }, { "docid": "bb83ed0cd633ec90330f638d6dedf4e0", "score": "0.6876381", "text": "function clearGrid() {\n for (c = 1; c <= 81; c++) {\n id(\"cell\" + c).children[0].children[0].value = \"\";\n id(\"cell\" + c).children[0].children[0].style.backgroundColor = \"rgba(255, 255, 255, 0.5)\";\n id(\"cell\" + c).children[0].children[0].removeAttribute('readonly');\n }\n}", "title": "" }, { "docid": "e45b8b68a7b84d1053d17ec409233e77", "score": "0.68687606", "text": "function clearGrid() {\n let i = 0;\n let $cells = $(\".cell\");\n\n if ($cells.length > 0) {\n\n $cells.each(function (e, elm) {\n $(elm).css(\"background-color\", \"#ffffff\");\n });\n }\n\n}", "title": "" }, { "docid": "46b98de9e9633f9afae193d63d97e4f2", "score": "0.68621653", "text": "function clear() {\n initData();\n Object.keys(dataCells).forEach(function(c) {\n dataCells[c].remove(); \n });\n }", "title": "" }, { "docid": "7be070b0058948cf62a4a749da0c8622", "score": "0.6804476", "text": "function removeColor(){\n\t$('.cell').on('dblclick',function(){\n\t//var c = $('#colorPicker').val();\n\t\t$(this).css(\"background-color\",\"\");\n\t});\n}", "title": "" }, { "docid": "79452f1b633131a36ac931e7ca1b345f", "score": "0.6802918", "text": "function clear(cell) {\r\n cell.innerText = ''; \r\n}", "title": "" }, { "docid": "b04749431ca6ce9db9a8f4641a6651a9", "score": "0.6799876", "text": "function handleClearTable(){\n setFoodData([])\n setFoodNames([])\n setSelectedFoodData([])\n setFoodTransformed([])\n }", "title": "" }, { "docid": "463ebd2c6787f889f9b68989569a87ac", "score": "0.67935747", "text": "function clearTable() {\n htmlElements.pokemonTable.empty();\n }", "title": "" }, { "docid": "b4d9e0e7ac5820f031463d30cafe79cf", "score": "0.67878336", "text": "function clearTable() {\r\n\t\t$('#ratings-table tr:not(:first-child)').remove();\r\n\t}", "title": "" }, { "docid": "8606a132e5cba624e2a82db08079f1c9", "score": "0.67660403", "text": "function clearTable() {\n document.getElementById('tablebody').innerHTML = '';\n}", "title": "" }, { "docid": "c9c538096b2cf6ba33930e99ffd32c6c", "score": "0.67653596", "text": "function clearStatTable() {\n let dataRows = document.querySelectorAll(\"#stat-table tr\");\n let statTable = document.getElementById(\"stat-table\");\n if(dataRows.length > 1) {\n //Remove all rows except the first row, which has column headers\n for(let i=1; i<dataRows.length; i++) {\n statTable.removeChild(dataRows[i]);\n }\n }\n }", "title": "" }, { "docid": "f4f6021fcc4141446e1af3ef36ad627b", "score": "0.67600775", "text": "function clearData() {\n tbody.selectAll(\"tr\").remove();\n}", "title": "" }, { "docid": "ba772d141be42597075ab4c3ff4c3a7a", "score": "0.67455876", "text": "function clearTable() {\n var tableLength = $('#bc-table tr').length;\n\n // Clear the `guess` and `result` columns of the game table.\n for (var i = 0; i < tableLength; i++) {\n $('#guess-' + i).text(\"\");\n $('#result-' + i).text(\"\");\n }\n}", "title": "" }, { "docid": "e19c72595af93ae326ce5213c7e9895b", "score": "0.67455566", "text": "function clearTable () {\n var table = document.getElementById(\"ufo-table\");\n for(var i = table.rows.length - 1; i > 0; i--)\n {\n table.deleteRow(i);\n }\n}", "title": "" }, { "docid": "1857668cf2a2a495664727fea78e5b2c", "score": "0.67336625", "text": "function clearTable() {\n NOTES_DOM.divData.innerHTML = \"\"\n}", "title": "" }, { "docid": "89cdff93d312208e30bc4598eee0b67d", "score": "0.66892165", "text": "function clearTrickTable() {\n $('#contentRows').empty();\n}", "title": "" }, { "docid": "650956df393f1437487137e591479c37", "score": "0.66804343", "text": "clear() {\n this.cells.clear();\n }", "title": "" }, { "docid": "04e985e268a41084f19234b45583e525", "score": "0.6675987", "text": "function clearShape(cellList, color){\n for(let i in cellList){\n let cell = document.getElementById(cellList[i]);\n if(cell == null){\n \n }\n if(cell){\n cell.classList.remove('filled');\n cell.classList.remove(color);\n }\n }\n}", "title": "" }, { "docid": "4acc4879dfab53ea1ad5bae7bf58369b", "score": "0.6658873", "text": "function clearField(t){ //declaring the array outside of the\n if(! cleared[t.id]){ // function makes it static and global\n cleared[t.id] = 1; // you could use true and false, but that's more typing\n t.value=''; // with more chance of typos\n t.style.color='#fff';\n }\n }", "title": "" }, { "docid": "3b8b3b9338e4bea6de53c558b5115ce4", "score": "0.6657339", "text": "function cleanTableBody() { \n var tb = $(\".raw\");\n tb.css(\"background-color\", \"#FF8080\");\n tb.fadeOut(400, function () {\n tb.remove();\n });\n return false; \n }", "title": "" }, { "docid": "501bba8831e2403de75c6a9f25cda69e", "score": "0.66512245", "text": "function clearTable(){\n if($scope.rows.length > 0)\n for(var i = 0; i < 16 ; i++){\n $scope.rows[i] = [];\n }\n }", "title": "" }, { "docid": "aa6b42fe9d71f917676ad8a00b388f49", "score": "0.6643937", "text": "function clearTable () {\n $('table.code tbody').empty()\n }", "title": "" }, { "docid": "08e7d2787b37e09a2b52cfc0efe40a1c", "score": "0.6641479", "text": "function clearAllFunction(){\r\n\t$('#myTable input[type=\"text\"]').val(\"\");\r\n\t$('#myTable input[type=\"number\"]').val(\"\");\r\n\t$('#myTable .sumAmt, .sumQty, .sumVol, .total').text(\"\");\r\n\t$('.datadisplay #hiddentable').html('');\r\n\t// $('#myTable .sumQty').text(\"\");\r\n\t// $('#myTable .sumVol').text(\"\");\r\n\t// $('#myTable .total').text(\"\");\r\n\trefreshFunction()\r\n}", "title": "" }, { "docid": "842693a09bfe84841bd3d2c91898308d", "score": "0.66412127", "text": "function clearGrid() {\n setGrid(new Array(size).fill('').map(() => new Array(size).fill('')));\n resetColor('finished');\n let underlined = document.getElementsByClassName(\"search-word\")\n\n for (const li of underlined) {\n li.style.textDecoration = \"none\"\n }\n }", "title": "" }, { "docid": "e7e5f5fc8db3864cacb1e5108b4bb38b", "score": "0.6631247", "text": "clear() {\n for (let cell of this.cells) {\n cell.clear();\n }\n }", "title": "" }, { "docid": "db7eaa26064b1858617db9a4134d675b", "score": "0.6629901", "text": "function makeGrid() {\n var height = $('#input_height').val();\n var width = $('#input_width').val();\n var content = '<tbody>';\n for(var i=0; i<height; i++){\n content += '<tr>';\n for (var j=0; j<width; j++) {\n content += '<td></td>';\n }\n content += '</tr>';\n }\n content += '</tbody>';\n\n document.getElementById('pixel_canvas').innerHTML = content;\n $('#clear').remove();\n $('#pixel_canvas').after('<input type=\"button\" value=\"Clear\" id=\"clear\">');\n $( function() {\n var color =\n $('td').click( function() {\n if($(this).attr('style'))\n $(this).removeAttr('style');\n else\n $(this).css('background', $('#colorPicker').val());\n } );\n } );\n $(function(){\n $('#clear').click(function(){\n $('td').each(function(){\n $(this).attr ('style', '');\n });\n });\n });\n return false;\n\n}", "title": "" }, { "docid": "2e092493150ac192289ea32c06953c5a", "score": "0.66264045", "text": "function unhighlightTableRow(e)\n{\n e.style.backgroundColor = '';\n}", "title": "" }, { "docid": "5d52b16345724db1475c0bd0da98b782", "score": "0.6620993", "text": "clearTable(){\n let table = document.getElementById(\"currencyPairData\");\n let totalRows = table.rows.length;\n for (let i = totalRows; i > 1; i--) { //header should not be deleted\n table.deleteRow(i-1);\n }\n\n }", "title": "" }, { "docid": "58c5e005ba78cfb2b2294bb09bb56022", "score": "0.66202784", "text": "function handleClearButtonClick() {\n sightings = dataSet;\n $dateInput.value = \"\";\n $cityInput.value = \"\";\n $stateInput.value = \"\";\n $countrySelect.value = \"(Country)\";\n $shapeSelect.value = \"(Shape)\";\n renderTable();\n}", "title": "" }, { "docid": "08d5ca3b97b8bd0612709b6ad1b1dcb5", "score": "0.66107047", "text": "function resetTableColumn(id, resetColor)\n{\n if (!resetColor)\n resetColor = DEFAULT_RESET_COLOR;\n\n thisElement = document.getElementById(id);\n thisElement.style.color = resetColor;\n thisElement.style.fontWeight = \"normal\";\n \n}", "title": "" }, { "docid": "c884444801b0209913d585b93c4df9b7", "score": "0.65969515", "text": "function resetMappa(){\n $(\".postazione\").css(\"background-color\", \"white\");\n $(\".postazione\").removeAttr(\"data-original-title\");\n $(\"#spiaggiaTableBody\").empty();\n}", "title": "" }, { "docid": "c7da71a7bbb6c22912143ef443751929", "score": "0.6591751", "text": "function clearGrid() {\n let gridCells = document.querySelectorAll('.grid-cell');\n gridCells.forEach(cell => {\n cell.style.backgroundColor = 'white';\n });\n}", "title": "" }, { "docid": "def1fdf2d7731ad5f24b321a5aeeec4d", "score": "0.6587996", "text": "function clearStatus() {\r\n for(i = 0; i < sampleBoxSize; i += 1) {\r\n sampleBox[i] = [];\r\n for(j = 0; j < 16; j += 1) {\r\n sampleBox[i][j] = false;\r\n columnsArray[i].children[j].style.backgroundColor = \"#111111\";\r\n }\r\n }\r\n}", "title": "" }, { "docid": "8d1b3242636e00f300bdd1f9a5b090dd", "score": "0.6580825", "text": "function clearTint() {\n\tOutliner.elements.forEach(obj => {\n\t\tconst geometry = obj.mesh.geometry;\n\t\tgeometry.deleteAttribute('color');\n\t\tobj.preview_controller.updateFaces(obj);\n\t});\n}", "title": "" }, { "docid": "77192846ef19eb4816a21b2624685316", "score": "0.6576569", "text": "function clearGrid() {\n let active = document.querySelectorAll('.buttonOneColor');\n active.forEach(function (element) {\n element.classList.remove(\"buttonOneColor\");\n });\n\n}", "title": "" }, { "docid": "781defe329c30ea16ef93dd44e42fd4d", "score": "0.65740836", "text": "function clearTableStatus(){\n\n xRow = $('.x-row td');\n $.each(xRow, function(index, value){\n\n var inputX = $($('.x-row input')[index]);\n var inputY = $($('.y-row input')[index]);\n inputX.val('');\n inputY.val('');\n\n });\n\n\n updateTableStatus();\n\n //clear equation\n $('[name=m]').val('');\n $('[name=b]').val('');\n\n $('div#graph-container').css(\"display\", \"none\");\n\n\n}", "title": "" }, { "docid": "4671560c48db447f0768747e01bf7249", "score": "0.6571965", "text": "function colorSpace(evt) {\n\t\n var tableCell = $(evt.target);\n\t\n\t\n if(tableCell.attr('style')) {\n\t\t//check if the cell already has color set and remove it if it exist\n tableCell.removeAttr('style');\n }else {\n\t\t//insert color on cell\n tableCell.css('background', picker.val());\n }\n}", "title": "" }, { "docid": "7b5a01b7200bff25b327b0f15de20557", "score": "0.6556487", "text": "function clearTable() {\n rows = [];\n cells = [];\n while(ticTacTable.rows.length > 0) {\n ticTacTable.deleteRow(-1);\n }\n}", "title": "" }, { "docid": "8bddd3876cfa5c76e6f21c030decf115", "score": "0.6553051", "text": "function clear_grid() {\n let myNode = document.getElementById('lista');\n while (myNode.firstChild) {\n myNode.removeChild(myNode.firstChild);\n }\n }", "title": "" }, { "docid": "98e3689b61b0b89fbe58b903c4f1eb3f", "score": "0.6550103", "text": "function clearTable() {\n d3.select(\"#sample-metadata\").selectAll(\"table\").remove(\"tr\");\n}", "title": "" }, { "docid": "0420a854393edc996618e208e8d1dfa0", "score": "0.65491915", "text": "function clearTable(){\n let tableData = document.getElementById(\"tableData\");\n let myTable = document.getElementById(\"myTable\");\n if(tableData != null && tableData.value != ''){\n myTable.removeChild(tableData);\n } \n}", "title": "" }, { "docid": "9570b6ca0aebef752e924c2081e5917a", "score": "0.6545205", "text": "function clearBoard() {\n\tvar table = document.getElementsByTagName(\"TABLE\")[0];\n\twhile (table.firstChild) {\n\t\ttable.removeChild(table.firstChild);\n\t}\n}", "title": "" }, { "docid": "992e9b668676af7d78f2b3fa7865e814", "score": "0.654504", "text": "function clearAllFunction(){\n\t$('#myTable input[type=\"text\"]').val(\"\");\n\t$('#myTable input[type=\"number\"]').val(\"\");\n\t$('#myTable .sumAmt, .sumQty, .sumVol, .total').text(\"\");\n\t// $('#myTable .sumQty').text(\"\");\n\t// $('#myTable .sumVol').text(\"\");\n\t// $('#myTable .total').text(\"\");\n\trefreshFunction()\n}", "title": "" }, { "docid": "ec68282c5673af6e0a6b1505513f84e8", "score": "0.65354025", "text": "function clearTable() {\r\n for (var i = table.rows.length - 1; i > 0; i--) {\r\n table.deleteRow(i);\r\n }\r\n}", "title": "" }, { "docid": "1bc062d4a48bcf8c584e4a779f1e1bd1", "score": "0.652937", "text": "function clear() {\t\t\n console.log(\"clear()\");\n\t\t\tresetData();\n refreshTotalCount();\n\t\t\tsetFocus();\n console.log(\"done clear()\");\n\t\t}", "title": "" }, { "docid": "e3ccfb5bf8f38fbaf11ac5210a3c1e83", "score": "0.6524401", "text": "function clearMakesTable() {\n $('#contentRows').empty();\n}", "title": "" }, { "docid": "056be711fc749f04493ae19d1338006c", "score": "0.6519116", "text": "function clearTable(){\n var div=document.getElementById('listView');\n var table=div.querySelector('table');\n var rows=table.querySelectorAll('tr');\n for(let i=1;i<rows.length;i++){\n table.removeChild(rows[i])\n }\n}", "title": "" }, { "docid": "322d4388f552d80fe7651ef5892e89d7", "score": "0.65147144", "text": "function clearGrid() {\n $('.cells').remove();\n}", "title": "" }, { "docid": "95bb68f9f84c5949571c9bf5c14d243b", "score": "0.65114766", "text": "function clearGrid(){\n for(let i=0; i<x.length; i++){\n x[i].style = null\n }\n}", "title": "" }, { "docid": "54775b086059c533d7e0aff7de2483b7", "score": "0.650197", "text": "function clearAll(){\n $('#table').empty(); \n $('#EditData').empty();\n $('#EditData1').empty();\n $('#EditData2').empty();\n y = \"\";\n}", "title": "" }, { "docid": "7d6e7f0cdb15a8cc751f62387bf6cd04", "score": "0.6494786", "text": "function clearField(t) {\n //declaring the array outside of the\n if (!cleared[t.id]) {\n // function makes it static and global\n cleared[t.id] = 1; // you could use true and false, but that's more typing\n t.value = \"\"; // with more chance of typos\n t.style.color = \"#fff\";\n }\n}", "title": "" }, { "docid": "2f3ba2adaf55889bb81927697c3acfac", "score": "0.64909095", "text": "function clearTable() {\n var table = document.getElementById(\"gable\");\n for (var i = table.rows.length - 1; i > 0; i--) {\n table.deleteRow(i);\n }\n}", "title": "" }, { "docid": "cea08af29b7eaae226c3ae4b488deb79", "score": "0.6490765", "text": "function clearTable(){\n const table = document.getElementsByTagName(\"table\");\n document.body.removeChild(table[0]);\n initializeTable();\n}", "title": "" }, { "docid": "92e1352562a7255cb1a8a5891489cb36", "score": "0.64892143", "text": "function clearGrid() {\r\n let divs = Array.from(document.querySelectorAll('#grid-container > div'));\r\n let clearBtn = document.querySelector('#clear-button');\r\n clearBtn.addEventListener('click', function(){\r\n divs.forEach(function(item){\r\n item.style.backgroundColor = \"\";\r\n });\r\n });\r\n}", "title": "" }, { "docid": "af046111367c6a8e0e0ba6d4b06f7e45", "score": "0.64891654", "text": "static removeAll(){\n let table=document.getElementById(\"tbody\");\n table.innerHTML=\"\";\n }", "title": "" }, { "docid": "1993dca334e531f2faf72742ed6c346f", "score": "0.64857334", "text": "function ClearSimpleFieldTable( TableName )\n{\n var CurRows = TableName.rows.length;\n for (var r = 0; r < CurRows; r++)\n {\n TableName.rows[r].cells[1].innerText = \"-\";\n }\n}", "title": "" }, { "docid": "82ce4c4c8612e75ba3450998422341e9", "score": "0.6485085", "text": "function clear() {\t\t\n\t\t\tresetDomain();\n refreshTotalCount();\n\t\t\taddAllelePairRow();\n\t\t\taddAllelePairRow();\n\t\t\taddNotes();\n\t\t\taddImagePaneRow();\n\t\t\taddDataSetRow();\n\t\t\t//setFocus();\n\t\t}", "title": "" }, { "docid": "716773e4e83e4c6e3e5fe0b656ae661c", "score": "0.6480546", "text": "function clearTable( idTable ) {\n\tvar table = $('#' + idTable ).DataTable();\n\ttable.clear().draw();\n}", "title": "" }, { "docid": "84a1595aaa33d35da501e2afa901dd13", "score": "0.64799374", "text": "function clearInterpreterTables() {\r\n\t$(\".interpreterTable\").remove();\t\r\n}", "title": "" }, { "docid": "e2f17fbc615634f55c2b06d90031c34f", "score": "0.64767766", "text": "onClearButtonClicked() {\n this.dataGrid.instance.clearSelection();\n }", "title": "" }, { "docid": "0134cd27edec968d279a82f9468f5108", "score": "0.64763767", "text": "function removetable() {\nd3.selectAll('td').remove(); }", "title": "" }, { "docid": "c78fd693ea9da0d76c3b01a7fa4c0e49", "score": "0.64741826", "text": "function clearTable() {\n // translationHeader.style.display = \"none\"\n // arabicHeader.style.width = \"100vw\"\n element = document.getElementById(\"dTable\").getElementsByTagName('tbody')[0];;\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n}", "title": "" }, { "docid": "1e2db87446520647d377f7daf17306d7", "score": "0.6471741", "text": "function colorReset() {\n let row = document.getElementsByClassName(\"column\");\n for (let i=0; i<row.length; i++)\n { let element = row[i];\n element.style.backgroundColor = \"grey\";\n } \n document.getElementsByTagName(\"h1\")[0].style.color = \"white\";\n}", "title": "" }, { "docid": "98d1d5c65c66c9fb46460df43858557b", "score": "0.64697105", "text": "function clearRotateBoard() {\n $(\"#rt_board\").find(\".cell\").each(function() {\n setHighlightClass($(this)[0].id, CONSTS.highlightClasses.none);\n });\n}", "title": "" }, { "docid": "aaddbc967944b8346d9d912bef2adf6e", "score": "0.6462666", "text": "function clearTable() {\n // get table rows\n const rows = document.getElementsByClassName('row');\n length = rows.length;\n\n // Loop through rolls\n for (let i = length - 1; i >= 0; i--) {\n rows[i].remove();\n }\n}", "title": "" }, { "docid": "9ac565e35537a39a3eecb2cc01ab75c8", "score": "0.64517534", "text": "function resetGrid() {\n create.style.display=\"\";\n while (container.firstChild) {\n container.removeChild(container.firstChild);\n }\n container.style.display=\"none\";\n rainbow.style.display=\"none\";\n cellColor=\"black\";\n random=false;\n }", "title": "" }, { "docid": "c0747dd8d6bee738a9129709f45ab186", "score": "0.6447003", "text": "function clearGrid(pianoRollObject){\r\n\tvar columns = document.getElementById(\"columnHeaderRow\").children;\r\n\r\n\t// start at 1 to ignore the column before 1 (the blank one)\r\n\tfor(var i = 1; i < columns.length; i++){\r\n\t\tif(columns[i].getAttribute(\"hasnote\") !== \"0\"){\r\n\t\t\t// change hasnote attribute back to 0!\r\n\t\t\tcolumns[i].setAttribute(\"hasnote\", \"0\");\r\n\t\t\tvar columnToCheck = $(\"div[id$='\" + columns[i].id + \"']\").get();\r\n\t\t\tfor(var j = 0; j < columnToCheck.length; j++){\r\n\t\t\t\tif(columnToCheck[j].style.backgroundColor === \"rgb(0, 178, 0)\"){\r\n\t\t\t\t\tcolumnToCheck[j].style.backgroundColor = \"transparent\";\r\n\t\t\t\t}\r\n\t\t\t\tif(columnToCheck[j].style.background !== \"\"){\r\n\t\t\t\t\tcolumnToCheck[j].style.background = \"\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t// reset activeNotes for current instrument\r\n\tpianoRollObject.currentInstrument.activeNotes = {};\r\n\t\r\n}", "title": "" }, { "docid": "422a4bf92ecbb100de8382dd9201757c", "score": "0.64412975", "text": "function clearCol() {\n columnOne.textContent = \"\";\n columnTwo.textContent = \"\";\n}", "title": "" }, { "docid": "2c372b0588ec035d19375b9248a18eff", "score": "0.64372903", "text": "function clear() {\n const boxes = document.querySelectorAll('#element');\n boxes.forEach(key => key.style.backgroundColor = '#AAAAAA');\n}", "title": "" }, { "docid": "5c4d33182e0afb0b6cc8d0536c5f5575", "score": "0.643536", "text": "function clearBoard() {\n // Resets the states of all the buttons\n for (const b of buttons) {\n b.selected = false;\n b.special = false;\n }\n\n // Resets the note counts\n for (const note of notes) {\n note[2] = 0;\n }\n\n // Resets the active scale and updates everything.\n activeScale = \"None\";\n drawBoard();\n updateTable();\n\n // Re-enable tuning selection in case it got disabled\n $(\"#tuning-select\").prop(\"disabled\", false);\n}", "title": "" }, { "docid": "b6c65dc7123bac314df67ec8558eb05a", "score": "0.6431564", "text": "function clearSelected()\r\n\t\t{\r\n\t\t\t$('#list-table').find(':checkbox').attr('checked', false);\r\n\t\t\t$('.checked-count').text('0');\r\n\t\t\t$('#actions .message').removeClass(\"ui-state-error\");\t\r\n\t\t\t$('#actions .message').removeClass(\"ui-state-highlight\");\t\r\n\t\t\t$('#actions .filter-select').hide();\t\r\n\t\t}", "title": "" }, { "docid": "976e75ef3ec21ef742970fcdf6aabe4a", "score": "0.6422128", "text": "function clearTable() {\n $(\"#movieTableRows\").empty();\n}", "title": "" }, { "docid": "87435034028e8eccfa330c2b884a4ba1", "score": "0.6421325", "text": "function clearContent(){\n $(\"table tbody\").empty();\n }", "title": "" }, { "docid": "eca7587a977e7d90a3ec85f74fe0ea92", "score": "0.6417648", "text": "function clearTable()\n\t{\n\t var tableRef = document.getElementById('table_body');\n\t while ( tableRef.rows.length > 0 )\n\t {\n\t tableRef.deleteRow(0);\n\t }\n\n\t var tableRef2 = document.getElementById('table_body2');\n\t while ( tableRef2.rows.length > 0 )\n\t {\n\t tableRef2.deleteRow(0);\n\t }\n\n\t var tableRef3 = document.getElementById('table_body3');\n\t while ( tableRef3.rows.length > 0 )\n\t {\n\t tableRef3.deleteRow(0);\n\t }\n\n\t var tableRef4 = document.getElementById('table_body4');\n\t while ( tableRef4.rows.length > 0 )\n\t {\n\t tableRef4.deleteRow(0);\n\t }\n\n\t var tableRef5 = document.getElementById('table_body5');\n\t while ( tableRef5.rows.length > 0 )\n\t {\n\t tableRef5.deleteRow(0);\n\t }\n\n\t var tableRef6 = document.getElementById('table_body6');\n\t while ( tableRef6.rows.length > 0 )\n\t {\n\t tableRef6.deleteRow(0);\n\t }\n\n\t var tableRef7 = document.getElementById('table_body7');\n\t while ( tableRef7.rows.length > 0 )\n\t {\n\t tableRef7.deleteRow(0);\n\t }\n\n\t var tableRef8 = document.getElementById('table_body8');\n\t while ( tableRef8.rows.length > 0 )\n\t {\n\t tableRef8.deleteRow(0);\n\t }\n }", "title": "" }, { "docid": "f1d0ac59a4360540b7271641431e4dbd", "score": "0.64139986", "text": "function clearTable() {\n while (tableBody.firstChild) {\n tableBody.removeChild(tableBody.firstChild);\n }\n}", "title": "" }, { "docid": "a52a87032c0b19f726e4ff0d33c187fc", "score": "0.64114994", "text": "removeFromDisplay() {\n this.table.remove();\n }", "title": "" }, { "docid": "9de67b4774b94a09607ae062636d5ff9", "score": "0.6409715", "text": "function cleanDataTable() {\n\t$(\"table\").bootstrapTable('removeAll');\n\t$(\"#dataTable_title\").text(\"Selected Point : \");\n\t$(\"#dataTable_empty_text\").text(\"[ click on a Point to see additional data ]\");\n}", "title": "" }, { "docid": "027a82b8f27b5af2f04fd5192d6fea14", "score": "0.64096725", "text": "function clearGame() {\n let squares = $('td')\n for (let i=0; i < squares.length; i++) {\n squares[i].innerHTML = \"\"\n }\n turn = 0\n currentGame = 0\n }", "title": "" }, { "docid": "585f19984a363ae1b40a9a33b8d93b07", "score": "0.6406657", "text": "function clearGrid(){\n\tgrid.forEach((cell) => {\n\t\tcell.classList.remove('hovered');\n\t});\n}", "title": "" }, { "docid": "151486210cbe7a7d49bede92dd7c9800", "score": "0.6403795", "text": "function clearGrid() {\n if (table.hasChildNodes()) {\n table.innerHTML = '';\n }\n}", "title": "" }, { "docid": "77e97cd94a0db216e756dccaf57f92e7", "score": "0.63958865", "text": "function clearbtn() {\r\n //Just clears the creen.\r\n reset();\r\n}", "title": "" }, { "docid": "aa82ba1be65f6d376495f37fb3f4f71c", "score": "0.63943785", "text": "function clearTable() {\n let table1 = document.getElementById(\"table-info\");\n let table2 = document.getElementById(\"table-results\");\n table1.deleteRow(0);\n table2.deleteRow(0);\n\n}", "title": "" } ]
213e1f067c16733af07818aa727c2d14
Function used to draw all the tooltip
[ { "docid": "0421f420fab321ac5a1751680e09933f", "score": "0.6533843", "text": "function _BuildToolTip() {\n\n $(\".tooltip\").remove();\n\n $(\".end-points\")\n .data('bs.tooltip', false)\n .tooltip({\n 'container': 'body',\n 'placement': 'top',\n 'html': true\n });\n\n $(\".line\")\n .data('bs.tooltip', false)\n .tooltip({\n 'container': 'body',\n 'placement': 'top',\n 'html': true\n });\n\n $(\".menu\")\n .data('bs.tooltip', false)\n .tooltip({\n 'container': 'body',\n 'placement': 'top',\n 'html': true\n });\n\n $(\".interface\")\n .data('bs.tooltip', false)\n .tooltip({\n 'container': 'body',\n 'placement': 'top',\n 'html': true\n });\n }", "title": "" } ]
[ { "docid": "598d766c9eb64fcc4000fea0efa2430a", "score": "0.7260774", "text": "function drawTooltip() {\r\n\t\td3.select(\"#logo\").append(\"div\").attr(\"class\", \"tooltip\").attr(\"id\",\r\n\t\t\t\t\"femaleP\").style(\"opacity\", 0.9).style(\"left\", \"10%\").style(\r\n\t\t\t\t\"top\", \"10%\");\r\n\r\n\t\td3.select(\"#logo\").append(\"div\").attr(\"class\", \"tooltip\").attr(\"id\",\r\n\t\t\t\t\"maleP\").style(\"opacity\", 0.9).style(\"left\", \"75%\").style(\r\n\t\t\t\t\"top\", \"10%\");\r\n\t}", "title": "" }, { "docid": "69dbca537b0e7802d2d9c6f775cbbec8", "score": "0.7258846", "text": "function tooltip() {\n \n}", "title": "" }, { "docid": "8af6830223aab7b46243f37e9487a105", "score": "0.72233355", "text": "function ApexTooltip() { }", "title": "" }, { "docid": "8af6830223aab7b46243f37e9487a105", "score": "0.72233355", "text": "function ApexTooltip() { }", "title": "" }, { "docid": "c8b0cdbeb6fbc3eb8e6035b7fc5f146e", "score": "0.7043375", "text": "function createTooltip()\n{\n tooltip = d3.select(\"body\")\n .append(\"div\")\n .classed(\"myTip tabelaSimples\", true)\n .html(\"Senado\");\n hookTooltip();\n}", "title": "" }, { "docid": "b0b165f721ec1cf4983d5d4f87df86cc", "score": "0.70180994", "text": "function show_tooltip(d, name, vars, thoseParam) {\r\n\r\n var d = d.data ? d.data : d;\r\n\r\n if (d){\r\n d3.select(\"#tooltip\").style('display', 'block');\r\n\r\n var dx = d3.event.pageX;\r\n var dy = d3.event.pageY - 28;\r\n\r\n // var this_chart_width = Math.round(svgGraphContainer.node().getBBox().width);\r\n var this_chart_right = d3.select('#chart svg').node().getBoundingClientRect().right\r\n\r\n var this_inner_html = '';\r\n this_inner_html = name ? '<strong>' + name + '</strong><br />' : '';\r\n if (vars){\r\n for (i in vars){\r\n this_inner_html += '<strong>'+ vars[i]['name'] + '</strong> : '+ vars[i]['value']+ '</strong><br />'\r\n }\r\n }\r\n\r\n\r\n if (graphParameters.selected_tooltip && graphParameters.selected_tooltip.length > 0){\r\n var param_array = [graphParameters.selected_tooltip]\r\n // var tooltip_values = 1\r\n }\r\n else if (thoseParam){\r\n var param_array = thoseParam\r\n }\r\n else{\r\n var param_array = [graphParameters.selected_xRows, graphParameters.selected_yRows, \r\n graphParameters.selected_size, graphParameters.selected_color, graphParameters.selected_label];\r\n }\r\n\r\n for (i in param_array){\r\n var inner_array =param_array[i];\r\n if (_.isEmpty(inner_array) == false){\r\n for (j in inner_array){\r\n\r\n this_inner_html += '<strong>'+ inner_array[j] + '</strong> : '+ (d[inner_array[j]] ? formatIfNumbers(d[inner_array[j]]) : formatIfNumbers(d3.values(d)[i]))+ '</strong><br />'\r\n }\r\n } \r\n}\r\n\r\nif (manualReusableParameters.caseCustomTooltip.value && manualReusableParameters.customTooltips.value){\r\n\r\n this_inner_html = manualReusableParameters.customTooltips.value;\r\n\r\n var thoseValuesArray = this_inner_html.match(/\\[\\[(.*?)\\]\\]/g);\r\n\r\n var TextTransformationFonctions = {'round':_.round,\r\n'frenchDate': dateToFrench,\r\n'number_separator':numbers_separators}\r\n\r\n for (i in thoseValuesArray){\r\n var v = thoseValuesArray[i];\r\n var k = v.replace('[[', '').replace(']]', '');\r\n k = k.split('|')\r\n var k0 = k[0]\r\n var d0 = d[k0]\r\n // if (k[1] ){\r\n\r\n // console.log(k[1]);\r\n // console.log(TextTransformationFonctions[k[1]]);\r\n // console.log(TextTransformationFonctions[k[1]]);\r\n // console.log(TextTransformationFonctions[k[1]](+d[k0]));\r\n // console.log(d[k0]);\r\n // console.log(Math.round(+d[k0]));\r\n // }\r\n if (k[1] && k[1] == 'frenchDate'){\r\n d0 = TextTransformationFonctions[k[1]](d0);\r\n this_inner_html = this_inner_html.replace(v, d0);\r\n }\r\n else{\r\n d0 = k[1] ? (k[2] ? TextTransformationFonctions[k[1]](+d0, k[2]) : TextTransformationFonctions[k[1]](+d0)) : d0;\r\n this_inner_html = this_inner_html.replace(v, d0)\r\n\r\n }\r\n }\r\n}\r\n\r\n\r\nd3.select(\"#tooltip\")\r\n.classed('is-active', true)\r\n.html(this_inner_html);\r\n\r\nvar thisTooltip = d3.select('#tooltip').node().getBoundingClientRect();\r\n\r\nif (dx > (this_chart_right - thisTooltip.width)){\r\n\r\ndx = (this_chart_right - thisTooltip.width - 10)\r\n\r\n}\r\n\r\n\r\nd3.select(\"#tooltip\")\r\n.style(\"left\", (dx) + \"px\")\r\n.style(\"top\", (dy) + \"px\");\r\n\r\n}\r\nelse\r\n{\r\n d3.select(\"#tooltip\").style('display', 'none');\r\n}\r\n\r\n}", "title": "" }, { "docid": "3ff5206eaaa3031838e65a01d965c068", "score": "0.6925394", "text": "mouseOver() {\n this.tooltipBox\n .text(this.tooltips[0])\n .style(\"visibility\", \"visible\");\n }", "title": "" }, { "docid": "9168c665218eabe8af5cca342412ee06", "score": "0.6910912", "text": "createTooltip() {\n this.tooltip = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"nicemap-tooltip\")\n .style(\"position\", \"absolute\")\n .style(\"z-index\", \"10\")\n .style(\"visibility\", \"hidden\");\n this.tooltip\n .append(\"div\").attr(\"class\", \"tooltip-text\")\n }", "title": "" }, { "docid": "aea42e66862f78fc45afa0f6c22c34f2", "score": "0.6887259", "text": "_tooltipHtml(d) {\n const html = this.props.tooltipHtml(this.props.x(d), this.props.y(d));\n return [html, 0, 0];\n }", "title": "" }, { "docid": "e77dcc5f8166b35281a07e32aad1d6e7", "score": "0.68651336", "text": "function showTooltip(arrObj, event, className)\r\n{\r\n\t//\r\n\t//\tSelect multiple elements from the document and remove them.\r\n\t//\r\n\td3.selectAll(\".CBTTooltip\").remove();\r\n\r\n\t//\r\n\t//\tSelect multiple elements from the document and remove them.\r\n\t//\r\n\td3.selectAll(\".CBTDataTip\").remove();\r\n\r\n\t//\r\n\t//\tCreating the content appears inside tooltip.\r\n\t//\r\n\tarrObj.map(function (obj, i) {\r\n\t\tvar tooltipClass = \"CBTTooltip\";\r\n\t\td3.select(\"body\")\r\n\t\t\t.append(\"div\")\r\n\t\t\t.attr(\"class\", \"tooltip \" + tooltipClass + \" tooltipCustomBarChart \"\r\n\t\t\t+ (className ? className : \"\"))\r\n\t\t\t.attr(\"id\", \"CBTBarTooltip_\" + i)\r\n\t\t\t.style(\"pointer-events\", \"none\")\r\n\t\t\t.style(\"opacity\", 1.0);\r\n\r\n\t\t//\r\n\t\t//\t1.\tAppending table in tool-tip.\r\n\t\t//\r\n\t\t$(\"#CBTBarTooltip_\" + i).append(\"<table></table>\");\r\n\r\n\t\t//\r\n\t\t//\t2.\tAppending data into table inside tool-tip.\r\n\t\t//\r\n\t\t$(\"#CBTBarTooltip_\" + i + \" table\").append(obj.content);\r\n\r\n\t\t//\r\n\t\t//\t3.\tSetting the outer width of tool-tip\r\n\t\t//\r\n\t\t$(\"#CBTBarTooltip_\" + i)\r\n\t\t\t.innerWidth($(\"#CBTBarTooltip_\" + i + \" table\")\r\n\t\t\t.outerWidth());\r\n\r\n\t\t//\r\n\t\t//\t4.\tAppend tooltip div and Assign it class,i d and opacity.\r\n\t\t//\r\n\t\td3.select(\"body\")\r\n\t\t\t.append(\"div\")\r\n\t\t\t.attr(\"class\", tooltipClass)\r\n\t\t\t.attr(\"id\", \"triangle_\" + i)\r\n\t\t\t.style(\"opacity\", 1.0);\r\n\t});\r\n\r\n\t//\r\n\t//\tUpdate position of tool-tip.\r\n\t//\r\n\tupdatePosition(arrObj, event);\r\n}", "title": "" }, { "docid": "650bef81f34a20ab6d0488cf7b33640a", "score": "0.6834628", "text": "function showToolTipOnAllChart()\n{\n \n\t var toolTipRow = d3.tip()\n\t .attr('class', 'd3-tip')\n\t .offset([-10, 0])\n\t .html(function (p) {\t \n\t\t $('.d3-tip').css(\"background\",$(this).attr('fill'));\n\t\t $('.d3-tip').after($('.d3-tip').css(\"color\",$(this).attr('fill')));\n\t\t return \"<span style='color: #000'>\" + p.key +\" : \"+p.value +\"</span>\"\t \n\t });\n\t \n\t //call to bubble chart tooltip\n\t d3.selectAll(\".row rect\").call(toolTipRow);\t \n\t d3.selectAll(\".row rect, .row text\").on('mouseover', toolTipRow.show).on('mouseout', toolTipRow.hide);\n\n\t var toolTipBubble = d3.tip()\n\t .attr('class', 'd3-tip')\n\t .offset([-10, 0])\n\t .html(function (p) {\n\t\tvar avg_deno_num = (bubble_text[p.key]).split(':'); \n\t //if($(this).parent().children(\"g rect\").attr('width') > 0){\t\t\n\t\t $('.d3-tip').css(\"background\",$(this).attr('fill'));\n\t\t $('.d3-tip').after($('.d3-tip').css(\"color\",$(this).attr('fill')));\n\t\t return \"<span style='color: #FFF'> Region: \" + p.key + \"<br> Avg Deno: \"+avg_deno_num[0]+\"<br>Avg Nume: \"+avg_deno_num[1]+\"</span>\"\n\t\t//}\n\t });\t \t \n\t \n\t d3.selectAll(\".node circle\").call(toolTipBubble); \n\t d3.selectAll(\".bubble, .node text\").on('mouseover', toolTipBubble.show).on('mouseout', toolTipBubble.hide);\t \n \n\n\t var toolTipStackChart1 = d3.tip()\n\t .attr('class', 'd3-tip')\n\t .offset([-10, 0])\n\t .html(function (p) { \n\t var stack_title = $(this).children('label').first().text().split(':'); \n\t //if($(this).parent().children(\"g rect\").attr('width') > 0){\t\t\n\t\t $('.d3-tip').css(\"background\",$(this).attr('fill'));\n\t\t $('.d3-tip').after($('.d3-tip').css(\"color\",$(this).attr('fill')));\n\t\t return \"<span style='color: #FFF'>\" + stack_title[0] +\" : \"+stack_title[1] +\"</span>\"\n\t //}\n\t });\t \t \n\t \n\t d3.selectAll(\"#stack-bar-chart1 ._0 rect, #stack-bar-chart1 ._1 rect\").call(toolTipStackChart1);\t \n\t d3.selectAll(\"#stack-bar-chart1 ._0 rect,#stack-bar-chart1 ._1 rect\").on('mouseover', toolTipStackChart1.show).on('mouseout', toolTipStackChart1.hide);\n \n\t var toolTipStackChart2 = d3.tip()\n\t .attr('class', 'd3-tip')\n\t .offset([-10, 0])\n\t .html(function (p) { \n\t var stack_title = $(this).children('label').first().text().split(':'); \t \n\t\t $('.d3-tip').css(\"background\",$(this).attr('fill'));\n\t\t $('.d3-tip').after($('.d3-tip').css(\"color\",$(this).attr('fill')));\n\t\t return \"<span style='color: #FFF'>\" + stack_title[0] +\" : \"+max_deno_num[stack_title[0]] +\"</span>\"\t \n\t });\t\t \t \n\t \n\t d3.selectAll(\"#stack-bar-chart2 ._0 rect, #stack-bar-chart2 ._1 rect\").call(toolTipStackChart2);\t \n\t d3.selectAll(\"#stack-bar-chart2 ._0 rect,#stack-bar-chart2 ._1 rect\").on('mouseover', toolTipStackChart2.show).on('mouseout', toolTipStackChart2.hide);\n \n}", "title": "" }, { "docid": "863fa548bea3e7a0a3a42c379b5b1e51", "score": "0.6832313", "text": "_tooltipMouseOver(color, el, d, i) {\n if (!this.createTooltip) return;\n for (var {css, prop, display} of this.tooltipProps) {\n this.tooltip.select('.' + css).html((display ? display + ': ' : '') + d[prop]);\n }\n // Fade the popup fill mixing the shape fill with 80% white\n const fill = color(d.colorValue);\n const backgroundColor = d3.rgb(\n d3.rgb(fill).r + 0.8 * (255 - d3.rgb(fill).r),\n d3.rgb(fill).g + 0.8 * (255 - d3.rgb(fill).g),\n d3.rgb(fill).b + 0.8 * (255 - d3.rgb(fill).b)\n );\n this.tooltip.style('display', 'block');\n\n const tooltipNode = this.tooltip.node();\n if (this.tooltipFunc) {\n this.tooltipFunc(tooltipNode, d, fill)\n }\n const width = tooltipNode.offsetWidth + 1; // +1 for rounding reasons\n const height = tooltipNode.offsetHeight;\n const buffer = 5;\n\n // calculate where the top is going to be. ideally it is\n // (d.y - height/2) which'll put the tooltip in the middle of the bubble.\n // we need to account for if this'll put it out of bounds.\n var top;\n // if it goes above the bounds, have the top be the buffer\n if (d.y - height < 0) {\n top = buffer;\n // if it goes below the bounds, have its buttom be a buffer length away\n } else if (d.y + height/2 > el.offsetHeight) {\n top = el.offsetHeight - height - buffer;\n // otherwise smack this bad boy in the middle of its bubble\n } else {\n top = d.y - height/2;\n }\n\n // calculate where the left is going to be. ideally it is\n // (d.x + d.r + buffer) which will put the tooltip to the right\n // of the bubble. we need to account for the case where this puts\n // the tooltip out of bounds.\n var left;\n // if there's room to put it on the right of the bubble, do so\n if (d.x + d.r + width + buffer < el.offsetWidth) {\n left = d.x + d.r + buffer;\n // if there's room to put it on the left of the bubble, do so\n } else if (d.x - d.r - width - buffer > 0) {\n left = d.x - d.r - width - buffer;\n // otherwise put it on the right part of its container\n } else {\n left = el.offsetWidth - width - buffer;\n }\n\n this.tooltip.style('background-color', backgroundColor)\n .style('border-color', fill)\n .style('width', width + 'px')\n .style('left', left + 'px')\n .style('top', top + 'px');\n }", "title": "" }, { "docid": "929c22218571e92c64715b4456fb358b", "score": "0.6828154", "text": "function tooltips() {\n // Tooltips are added with options.tooltips in original order.\n var tips = scope_Handles.map(addTooltip);\n bindEvent('update', function (values, handleNumber, unencoded) {\n if (!tips[handleNumber]) {\n return;\n }\n var formattedValue = values[handleNumber];\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n tips[handleNumber].innerHTML = formattedValue;\n });\n }", "title": "" }, { "docid": "736eaf24a9190a9ba390a8b28a8ddcf2", "score": "0.6815757", "text": "function add_circle_tooltips() {\n svg.selectAll(\"path\").each(function(d) {\n var path = d3.select(this),\n title = '';\n if (path.attr('fill') == '#d7efc5') {\n title = \"Significant basepair\";\n significant_basepairs += 1;\n } else if (path.attr('fill') == '#d90000') {\n title = \"Nucleotide present 97%\";\n } else if (path.attr('fill') == '#000000') {\n title = \"Nucleotide present 90%\";\n } else if (path.attr('fill') == '#807b88') {\n title = \"Nucleotide present 75%\";\n } else if (path.attr('fill') == '#ffffff') {\n title = \"Nucleotide present 50%\";\n }\n\n if (path.attr('stroke-width') == 1.44) {\n basepairs += 1;\n }\n\n if (title) {\n path.on(\"mouseover\", function(d) {\n tooltip.transition()\n .duration(200)\n .style(\"opacity\", .9);\n tooltip.html(title)\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n }).on(\"mouseout\", function(d) {\n tooltip.transition()\n .duration(500)\n .style(\"opacity\", 0);\n });\n }\n });\n }", "title": "" }, { "docid": "b56ce48b55135e77f7b06db24fea51b2", "score": "0.6809962", "text": "function tip() {\n\t// initiate tooltip function\n\ttip = d3.select(\"body\").append(\"div\")\n\t\t.attr(\"class\", \"tooltip\")\n\t\t.style(\"opacity\", 0);\n}", "title": "" }, { "docid": "5f66e1c967e5ae6ea9ec584be4bc2ae3", "score": "0.6805723", "text": "mouseOver() {\n this.tooltipBox\n .text(this.predicateFn() ? this.tooltips[0] : this.tooltips[1])\n .style(\"visibility\", \"visible\");\n }", "title": "" }, { "docid": "3fa1bd5944413fa5fdeb1f7f99793895", "score": "0.6795865", "text": "function tooltipMouseover(i) {\n if(tooltipShow != 0 ) showTooltip(markers[i])\n }", "title": "" }, { "docid": "1df2713d2516794cad6cf842cfe0a3ed", "score": "0.67674506", "text": "function tooltips() {\r\n // Tooltips are added with options.tooltips in original order.\r\n var tips = scope_Handles.map(addTooltip);\r\n\r\n bindEvent(\"update\", function(values, handleNumber, unencoded) {\r\n if (!tips[handleNumber]) {\r\n return;\r\n }\r\n\r\n var formattedValue = values[handleNumber];\r\n\r\n if (options.tooltips[handleNumber] !== true) {\r\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\r\n }\r\n\r\n tips[handleNumber].innerHTML = formattedValue;\r\n });\r\n }", "title": "" }, { "docid": "1df2713d2516794cad6cf842cfe0a3ed", "score": "0.67674506", "text": "function tooltips() {\r\n // Tooltips are added with options.tooltips in original order.\r\n var tips = scope_Handles.map(addTooltip);\r\n\r\n bindEvent(\"update\", function(values, handleNumber, unencoded) {\r\n if (!tips[handleNumber]) {\r\n return;\r\n }\r\n\r\n var formattedValue = values[handleNumber];\r\n\r\n if (options.tooltips[handleNumber] !== true) {\r\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\r\n }\r\n\r\n tips[handleNumber].innerHTML = formattedValue;\r\n });\r\n }", "title": "" }, { "docid": "1d5a7f143cf99639bad0d630cf5c12ef", "score": "0.67576385", "text": "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 }", "title": "" }, { "docid": "1d5a7f143cf99639bad0d630cf5c12ef", "score": "0.67576385", "text": "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 }", "title": "" }, { "docid": "1d5a7f143cf99639bad0d630cf5c12ef", "score": "0.67576385", "text": "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 }", "title": "" }, { "docid": "1d5a7f143cf99639bad0d630cf5c12ef", "score": "0.67576385", "text": "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 }", "title": "" }, { "docid": "efccce874676c0df31fe63a71ff5bf4b", "score": "0.6747142", "text": "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}", "title": "" }, { "docid": "efccce874676c0df31fe63a71ff5bf4b", "score": "0.6747142", "text": "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}", "title": "" }, { "docid": "efccce874676c0df31fe63a71ff5bf4b", "score": "0.6747142", "text": "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}", "title": "" }, { "docid": "efccce874676c0df31fe63a71ff5bf4b", "score": "0.6747142", "text": "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}", "title": "" }, { "docid": "efccce874676c0df31fe63a71ff5bf4b", "score": "0.6747142", "text": "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}", "title": "" }, { "docid": "29796e37a4f0a3608df4b5545b13ae3c", "score": "0.67451274", "text": "function draw() {\n // + UPDATE TOOLTIP\n function draw() {\n if(state.hover) {\n tooltip\n .html(\n `\n <div>Name: ${state.hover.name}</div>\n <div>Value: ${state.hover.value}</div>\n `\n )\n .transition()\n .duration(800)\n .style(\"transform\", `translate(${state.hover.position[0]}px, ${state.hover.position[1]}px)`)\n }\n }\n tooltip.classed(\"visible\", state.hover)\n}", "title": "" }, { "docid": "6936b5fc2546f628df2050f21fbc89fc", "score": "0.6719535", "text": "function createTooltip() {\n var tooltip = document.createElement(\"div\");\n var style = tooltip.style;\n tooltip.setAttribute(\"role\", \"tooltip\");\n tooltip.classList.add(\"tooltip\");\n var textElement = document.createElement(\"div\");\n textElement.classList.add(\"esri-widget\");\n textElement.id = \"id4tooltip\";\n textElement.style.fontSize = \"30px\";\n tooltip.appendChild(textElement);\n view.container.appendChild(tooltip);\n var x = 0;\n var y = 0;\n var targetX = 0;\n var targetY = 0;\n var visible = false;\n // move the tooltip progressively\n function move() {\n x += (targetX - x) * 0.1;\n y += (targetY - y) * 0.1;\n if (Math.abs(targetX - x) < 1 && Math.abs(targetY - y) < 1) {\n x = targetX;\n y = targetY;\n }\n else {\n requestAnimationFrame(move);\n }\n style.transform = \"translate3d(\" + Math.round(x) + \"px,\" + Math.round(y) + \"px, 0)\";\n }\n return {\n show: function (point, text) {\n if (!visible) {\n x = point.x;\n y = point.y;\n }\n targetX = point.x;\n targetY = point.y;\n style.opacity = \"1\";\n visible = true;\n textElement.innerHTML = text;\n move();\n },\n hide: function () {\n style.opacity = \"0\";\n visible = false;\n }\n };\n }", "title": "" }, { "docid": "9b34afa92cafbd435d56a69a59a0df34", "score": "0.67189354", "text": "create_tooltips() {\n // Create the popup in the main title\n $('.info.circle.blue.icon.main').popup({\n position: 'right center',\n target: '.info.circle.blue.icon.main',\n hoverable: true,\n html: \"Get a citeable DOI by publishing your Tale on <a href='https://www.dataone.org/' target='_blank'>DataONE.</a> \" +\n \"For more information on how to publish and cite your tale, visit the \" +\n \"<a href='http://wholetale.readthedocs.io/users_guide/publishing.html' target='_blank'>publishing guide</a>.\"\n });\n\n // Create the popups for the environment files. Files with an extension\n // need to have the period escaped with a double backslash when referencing.\n // Create the tale.yaml popup\n $('.info.circle.blue.icon.manifest\\\\.json').popup({\n position: 'right center',\n target: '.info.circle.blue.icon.manifest\\\\.json',\n hoverable: true,\n html: \"This file holds metadata about the tale, such as script execution order and file structure.\"\n });\n // Create the environment.tar popup\n $('.info.circle.blue.icon.docker-environment\\\\.tar\\\\.gz').popup({\n position: 'right center',\n target: '.info.circle.blue.icon.docker-environment\\\\.tar\\\\.gz',\n hoverable: true,\n html: \"The environment archive holds the information needed to re-create the tale's base virtual machine.\"\n });\n // Create the LICENSE popup\n $('.info.circle.blue.icon.LICENSE').popup({\n position: 'right center',\n target: '.info.circle.blue.icon.LICENSE',\n hoverable: true,\n html: \"The Tale's license is included in the package. This can be selected from the Tale's metadata view.\"\n });\n // Create the science_metadata popup\n $('.info.circle.blue.icon.metadata\\\\.xml').popup({\n position: 'right center',\n target: '.info.circle.blue.icon.metadata\\\\.xml',\n hoverable: true,\n html: \"The contents of each package are described using the Ecological Metadata Language (EML). \" +\n \"To learn more about EML, visit the \" +\n \"<a href='https://esajournals.onlinelibrary.wiley.com/doi/abs/10.1890/0012-9623%282005%2986%5B158%3AMTVOED%5D2.0.CO%3B2'\" +\n \"target='_blank'>EML primer</a>.\"\n });\n }", "title": "" }, { "docid": "daed36a91c6a6ee72d144faee96353bf", "score": "0.6703319", "text": "function generateTooltip(text) {\n infoTooltip.html(text)\n .style(\"left\", (d3.event.pageX + 20) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n}", "title": "" }, { "docid": "ddcaf63b1e7c7ad1575229efb7ed65e0", "score": "0.67027426", "text": "function ViewTip(Txt,backgColor,textColor,borderdColor,textSize,doFadeFlag) {\nHideTip();\nbuf=\"<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=2 BGCOLOR=\" + backgColor +\" style=\\\"border: 1px solid \" + borderdColor + \"\\\"><TR><TD><FONT FACE=\\\"Tahoma, Arial\\\" SIZE=\" + textSize + \" COLOR=\" + textColor + \">\" + Txt + \"</FONT></TD></TR></TABLE>\";\ndocument.all.imToolTip.innerHTML = buf;\ndocument.all.imToolTip.style.left=event.x;\ndocument.all.imToolTip.style.top=event.y + 15;\ndocument.all.imToolTip.style.visibility=\"visible\";\nfadeStep=0\nif (doFadeFlag) doFade();\n}", "title": "" }, { "docid": "9e03e99026b4e52cdaf41234a7e060dd", "score": "0.668238", "text": "function util(_selection) {\n _selection.each(function(_data) {\n d3.select(this)\n .datum(_data)\n .on(\"mouseover.tooltip.\" + tooltip_id, function(d) {\n show(d);\n })\n .on(\"mousemove.tooltip.\" + tooltip_id, function(d) {\n if (!fixed_position) {\n move(d);\n }\n })\n .on(\"mouseout.tooltip.\" + tooltip_id, function() { \n hide(); \n });\n\n //create tooltip chart\n var show = function(data) {\n //remove any existing tooltip divs\n d3.selectAll(\"#\" + tooltip_id).remove();\n\n //create tooltip container div\n if (!fixed_position) {\n d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", tooltip_class)\n .attr(\"id\", tooltip_id)\n .style({width : width + \"px\", height : height + \"px\", padding : padding + \"px\"})\n .style(\"position\", \"absolute\")\n .style(\"opacity\", 0);\n\n tooltip_container = d3.select(\"#\" + tooltip_id);\n\n tooltip_container\n .html(html(data))\n .style(\"left\",(d3.event.pageX + offset.x)+\"px\")\n .style(\"top\",(d3.event.pageY + offset.y)+\"px\");\n } else {\n d3.select(fixed_position)\n .append(\"div\")\n .attr(\"class\", tooltip_class)\n .attr(\"id\", tooltip_id)\n .style({width : width + \"px\", height : height + \"px\", padding : padding + \"px\"})\n .style(\"position\", \"absolute\")\n .style(\"opacity\", 0);\n\n tooltip_container = d3.select(\"#\" + tooltip_id);\n\n tooltip_container\n .html(html(data));\n }\n\n\n tooltip_container.transition()\n .duration(fade_in)\n .style(\"opacity\", opacity);\n };\n\n //move tooltip\n var move = function() {\n //fade out and remove tooltip div\n tooltip_container\n .style(\"left\",(d3.event.pageX + offset.x)+\"px\")\n .style(\"top\",(d3.event.pageY + offset.y)+\"px\");\n };\n\n //hide tooltip\n var hide = function() {\n //fade out tooltip div\n tooltip_container\n .transition()\n .duration(fade_out)\n .style(\"opacity\", 0);\n };\n });\n }", "title": "" }, { "docid": "397a919ee15ebfc21ab6eb15acd11319", "score": "0.66810584", "text": "function tooltipper() {\r\n\t\tvar opacity = .95,\r\n\t\t\ttooltip = {\r\n\t\t\t\ttipContener : undefined,\r\n\t\t\t\ttipTitle : undefined,\r\n\t\t\t\ttipText : undefined,\r\n\t\t\t\tvisible: false,\r\n\t\t\t\tinit: function init() {\r\n\t\t\t\t\tvar x = 10,\r\n\t\t\t\t\t\ty = 10,\r\n\t\t\t\t\t\twin = $(window)\r\n\t\t\t\t\t;\r\n\r\n\t\t\t\t\tx = ( x + this.width > win.width() ? win.width() - 1.1 * this.width : x );\r\n\t\t\t\t\ty = ( y + this.height > win.height() ? win.height() - 1.1 * this.height : y );\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(\"<div id='tipContener' style='opacity:\"+opacity+\";position: absolute; top:\" + y + \"px; left:\"+ x +\"px; width:auto;height:auto; background-color: #666; color: black; '> </div>\").appendTo(\"body\");\r\n\t\t\t\t\t$(\"<div id='tipTitle' style='font-size: 14px;padding:5px 5px 5px 5px;opacity:\"+opacity+\";border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:gray;border-radius: 5px 5px 0px 0px; text-align: center; background-color: #666; color: #fff; font-weight: bold;'> </div>\").appendTo(\"#tipContener\");\r\n\t\t\t\t\t$(\"<div id='tipText' style='font-size: 12px;opacity:\"+opacity+\";border-radius: 0px 0px 5px 5px; padding: 5px 5px 15px 5px; background-color: #666; font-weight: normal; text-align: left; color: white;'> </div>\").appendTo(\"#tipContener\");\r\n\r\n\t\t\t\t\tthis.tipContener = $(\"#tipContener\");\r\n\t\t\t\t\tthis.tipTitle = $(\"#tipTitle\");\r\n\t\t\t\t\tthis.tipText = $(\"#tipText\");\r\n\r\n\t\t\t\t\tthis.tipContener.hide();\r\n\t\t\t\t},\r\n\t\t\t\tisOpen: function isOpen() {\r\n\t\t\t\t\treturn this.visible;\r\n\t\t\t\t},\r\n\t\t\t\topenHelper: function openHelper(title, text, x, y) {\r\n\t\t\t\t\tthis.tipContener.show();\r\n\t\t\t\t\tthis.visible = true;\r\n\t\t\t\t},\r\n\t\t\t\topen: function open(title, text, x, y, evt) {\r\n\t\t\t\t\t// console.log(title, text, x, y, evt)\r\n\t\t\t\t\t// console.log(\"open\")\r\n\t\t\t\t\tif (title && text) {\r\n\t\t\t\t\t\tthis.tipTitle.html(title);\r\n\t\t\t\t\t\tthis.tipText.html(text);\r\n\r\n\t\t\t\t\t\tif (x) this.tipContener.css(\"left\", x);\r\n\t\t\t\t\t\tif (y) this.tipContener.css(\"top\", y);\r\n\r\n\t\t\t\t\t\tthis.tipContener.css(\"height\", (this.tipTitle.height() + this.tipText.height()) + \"px\");\r\n\r\n\t\t\t\t\t\tif (evt.shiftKey)\r\n\t\t\t\t\t\t\tthis.openHelper(this.title, this.text, this.x, this.y);\r\n\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\tthis.tOut = setTimeout((function() { this.openHelper(this.title, this.text, this.x, this.y); }).bind(this), 500);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tclose: function close() {\r\n\t\t\t\t\tclearTimeout(this.tOut);\r\n\t\t\t\t\tthis.tipContener.hide();\r\n\t\t\t\t\tthis.visible = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t;\r\n\r\n\t\ttooltip.init();\r\n\t\ttooltip.init = undefined;\r\n\r\n\t\treturn tooltip;\r\n\t}", "title": "" }, { "docid": "86e121f9bfdec380eba8208d403685c6", "score": "0.6672569", "text": "showTooltip(countryCode, countryName) {\n \n let content = \"<strong>\" + countryName + \"</strong>\" + \n \"<br>Value = \" + this.valueTable[countryCode];\n \n this.tooltip\n .style(\"visibility\", \"visible\")\n .style(\"top\", (d3.event.pageY+10)+\"px\") \n .style(\"left\",(d3.event.pageX+10)+\"px\")\n\n this.tooltip.select(\".tooltip-text\")\n .html(content)\n }", "title": "" }, { "docid": "df85ea92743ec5eafa62b2f5f08cd52f", "score": "0.6670206", "text": "function tooltipAsk() {\n //INDICE\n const templateIndice = document.getElementById('help-tooltip-indice');\n const containerIndice = document.createElement('div');\n containerIndice.appendChild(document.importNode(templateIndice.content, true));\n tippy('#indice-tooltip', {\n allowHTML: true,\n placement: \"top\",\n content: containerIndice.innerHTML,\n arrow: true,\n animation: \"fade\",\n distance: 15\n });\n\n //TACOMETRO\n const templateTacometro = document.getElementById('help-tooltip-tacometro');\n const containerTacometro = document.createElement('div');\n containerTacometro.appendChild(document.importNode(templateTacometro.content, true));\n tippy('#tacometro-tooltip', {\n allowHTML: true,\n placement: \"top\",\n content: containerTacometro.innerHTML,\n arrow: true,\n animation: \"fade\",\n distance: 15\n });\n\n //MONTOS TOTALES\n const templateTotales = document.getElementById('help-tooltip-totales');\n const containerTotales = document.createElement('div');\n containerTotales.appendChild(document.importNode(templateTotales.content, true));\n tippy('#totales-tooltip', {\n allowHTML: true,\n placement: \"top\",\n content: containerTotales.innerHTML,\n arrow: true,\n animation: \"fade\",\n distance: 15\n });\n\n //CONTRATOS\n const templateContratos = document.getElementById('help-tooltip-contratos');\n const containerContratos = document.createElement('div');\n containerContratos.appendChild(document.importNode(templateContratos.content, true));\n tippy('#contratos-tooltip', {\n allowHTML: true,\n placement: \"top\",\n content: containerContratos.innerHTML,\n arrow: true,\n animation: \"fade\",\n distance: 15\n });\n\n //DATOS GENERALES\n const templateDatos = document.getElementById('help-tooltip-datos');\n const containerDatos = document.createElement('div');\n containerDatos.appendChild(document.importNode(templateDatos.content, true));\n tippy('#datos-tooltip', {\n allowHTML: true,\n placement: \"top\",\n content: containerDatos.innerHTML,\n arrow: true,\n animation: \"fade\",\n distance: 15\n });\n}", "title": "" }, { "docid": "c258eee49d325ae2acf929d9e3f9d6ef", "score": "0.6655752", "text": "loadTooltips() {\n const elements = document.querySelectorAll('#container-for-histogram g.bars rect.bars');\n tippy(elements, {\n content(reference) {\n const start = reference.getAttribute('data-start');\n const end = reference.getAttribute('data-end');\n return `<span class=\"tippy-template\">${start}<br>${end}</span>`;\n },\n allowHTML: true,\n appendTo: () => document.body,\n });\n }", "title": "" }, { "docid": "d41e62fdef1d1d6bacc14f3da967a4b8", "score": "0.6650947", "text": "function mouseover(d) {\n d3.select(\".tooltip\").style(\"display\", \"inline\");\n\n d3.select(this)\n .style(\"stroke\", \"black\")\n .style(\"opacity\", 1);\n }", "title": "" }, { "docid": "59b94cc2905d7d16e2436388ac6a84e6", "score": "0.66457", "text": "function BeginTooltip() { bind.BeginTooltip(); }", "title": "" }, { "docid": "274874062cd045648e1926700bc42fe1", "score": "0.6644261", "text": "function setupFuelTypeChartTooltip() {\n var svgFuelType = d3.select('#svgFuelType');\n var circles = svgFuelType.selectAll('circle');\n var tooltip = d3.select(\"body\")\n .append(\"div\")\n .attr('class', 'fuelTypeChartTooltip')\n .style(\"position\", \"absolute\")\n .style(\"z-index\", \"10\")\n .style(\"opacity\", \"0\")\n .text(\"tooltip\");\n\n // set tooltip animation\n circles\n .on(\"mouseover\", function(d) {\n tooltip\n .html(d.count+\"<br />(\"+d.time+\")\")\n .style(\"opacity\", 1)\n .style(\"top\", (event.pageY-10)+\"px\")\n .style(\"left\",(event.pageX+20)+\"px\");\n\n d3.select(this)\n .transition()\n .attr(\"r\", 9); \n })\n .on(\"mousemove\", function(d) {\n tooltip\n .html(d.count+\"<br />(\"+d.time+\")\")\n .style(\"opacity\", 1)\n .style(\"top\", (event.pageY-10)+\"px\")\n .style(\"left\",(event.pageX+20)+\"px\"); \n })\n .on(\"mouseout\", function(d) {\n tooltip\n .style(\"opacity\", 0);\n \n d3.select(this)\n .transition()\n .attr(\"r\", 6); \n }); \n}", "title": "" }, { "docid": "0fec5308a95ed0098ec16d51596e6ae1", "score": "0.6629494", "text": "function toolTip(){\n\t\t\n\t\t\tvar toolTips = $('.hover');\n\t\t\tvar tips = $('.hover_content');\n\t\t\tvar offsetX = 10;\n \t\tvar offsetY= -tips.height() - 50;\n\t\t\tvar id =0;\n\t\t\ttips.hide();\n\t\t\t\n\t\t\ttoolTips.each(function(i){\n\t\t\t\t\t$(this).attr('id', 'tool_' + i);\t\t\t \n\t\t\t});\n\t\t\t\n\t\t\ttips.each(function(i){\n\t\t\t\t\t$(this).attr('id', 'tip_' + i);\t\t\t \n\t\t\t});\n\t\t\t\n\t\t\ttoolTips.mouseover(function(event){\n\t\t\t\t\tid = $(this).attr('id').slice(5);\n\t\t\t\t\t$(tips[id]).css('top', event.pageY + offsetY).css('left', event.pageX + offsetX).fadeIn();\n\t\t\t\t\t\t\t\t\t\n\t\t\t}).mousemove(function(event){\n\t\t\t\t\t$(tips[id]).css('top', event.pageY + offsetY).css('left', event.pageX + offsetX);\n\t\t\t\t\n\t\t\t\t}).mouseout(function(){\n\t\t\t\t\t\t$(tips[id]).fadeOut(100);\n\t\t\t\t\t});\n\t\t\t\n\t\t\t\n\t\t\n\t\t}", "title": "" }, { "docid": "5918cb26997a547b610b2baf3a91d78f", "score": "0.6611141", "text": "_tooltipMouseOut(d, i) {\n if (!this.createTooltip) return;\n this.tooltip.style('display', 'none')\n .style('width', '')\n .style('top', '')\n .style('left', '');\n }", "title": "" }, { "docid": "b3c2cde5cdbdcceeb30da99f23025966", "score": "0.66071916", "text": "function appendTooltip() {\n $tooltip = $module.find(\".tooltip\");\n $tooltipBackground = $module.find(\".tooltip-background\");\n $tooltipClose = $module.find(\".tooltip-close\");\n $tooltipContentField = $module.find(\".tooltip-content\");\n }", "title": "" }, { "docid": "61090482ba310a7f0ec04ab17d069572", "score": "0.6591998", "text": "function add_nucleotide_tooltips() {\n svg.selectAll(\"tspan\").each(function(d) {\n var tspan = d3.select(this),\n title = '',\n nucleotide = tspan.text();\n if (nucleotide === 'R') {\n nucleotide = 'G or A';\n } else if (nucleotide === 'Y') {\n nucleotide = 'C or U';\n }\n if (tspan.attr('fill') == '#d90000') {\n title = nucleotide + \" present >97%\";\n } else if (tspan.attr('fill') == '#000000') {\n if (nucleotide != \"5'\") {\n title = nucleotide + \" present 90-97%\";\n }\n } else if (tspan.attr('fill') == '#807b88') {\n title = nucleotide + \" present 75-90%\";\n } else if (tspan.attr('fill') == '#ffffff') {\n title = nucleotide + \" present 50-75%\";\n }\n\n if (title) {\n tspan.on(\"mouseover\", function(d) {\n tooltip.transition()\n .duration(200)\n .style(\"opacity\", .9);\n tooltip.html(title)\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n }).on(\"mouseout\", function(d) {\n tooltip.transition()\n .duration(500)\n .style(\"opacity\", 0);\n });\n }\n });\n }", "title": "" }, { "docid": "d0ba1849d38dffb98619dede7bd34188", "score": "0.65802455", "text": "function toolTipDisplay() { \n document.getElementById('mark').onmouseover = function() {\n var toolTip = document.getElementById('tooltip');\n toolTip.style.display='block';\n } \t \n document.getElementById('mark').onmouseout = function() {\n var toolTip = document.getElementById('tooltip');\n toolTip.style.display='none';\n } \t\n }", "title": "" }, { "docid": "1b332d4c18954622fc69df31d434bb09", "score": "0.6576074", "text": "function handleTooltips() {\n tippy('#regexHelper', {\n arrow: true,\n position: 'right',\n theme: 'light',\n html: '#regexTooltipTemplate',\n interactive: true\n });\n\n tippy('#cssHelper', {\n arrow: true,\n position: 'right',\n theme: 'light',\n html: '#cssTooltipTemplate',\n interactive: true\n })\n\n tippy('.help-image', {\n position: 'right',\n arrow: true,\n theme: 'light'\n });\n\n return;\n }", "title": "" }, { "docid": "ab8fcf7b7ac6c7f70f30a883a383cf8e", "score": "0.6575183", "text": "function mouseover(event) {\n tooltip\n .style(\"opacity\", 1)\n d3.select(this)\n .style(\"stroke\", \"black\")\n .style(\"opacity\", 1)\n }", "title": "" }, { "docid": "0aa4f9a64fb726174fe4980162090614", "score": "0.6549993", "text": "function initTooltip() { // 771\n if (!tooltip) { // 772\n var body; // 773\n if (chartContainer) { // 774\n body = chartContainer; // 775\n } else { // 776\n body = document.body; // 777\n } // 778\n //Create new tooltip div if it doesn't exist on DOM. // 779\n tooltip = d3.select(body).append(\"div\") // 780\n .attr(\"class\", \"nvtooltip \" + (classes ? classes : \"xy-tooltip\")) // 781\n .attr(\"id\", id); // 782\n tooltip.style(\"top\", 0).style(\"left\", 0); // 783\n tooltip.style('opacity', 0); // 784\n tooltip.selectAll(\"div, table, td, tr\").classed(nvPointerEventsClass, true); // 785\n tooltip.classed(nvPointerEventsClass, true); // 786\n tooltipElem = tooltip.node(); // 787\n } // 788\n } // 789", "title": "" }, { "docid": "364ece7e6faecb394461f40e69fd8a8b", "score": "0.6545411", "text": "plotEvents() {\n var cols = Object.keys(this.eDict);\n var tipId = 0;\n var tip;\n var self = this;\n cols.forEach(function(key) {\n var eArr = self.eDict[key];\n var colOverFArr = [];\n var yIndex = 0;\n var releaseIndex = 0;\n for (var i = 0; i < eArr.length; i++) {\n var event = eArr[i];\n tip = self.renderToolTips(tip, tipId);\n tipId += 1;\n if (yIndex < self.chicLimit) {\n if (event.event_type == 'release') {\n self.drawFlag(tip, new Date(key), releaseIndex, event);\n releaseIndex++;\n } else {\n self.drawChic(tip, new Date(key), yIndex, event);\n yIndex++;\n }\n } else {\n colOverFArr.push(event);\n }\n }\n if (colOverFArr.length > 0) {\n self.drawOverflow(tip, new Date(key), colOverFArr);\n }\n });\n }", "title": "" }, { "docid": "807a2e9f9818e8188451d79f5506f7b8", "score": "0.651861", "text": "custom(tooltip) {\r\n if (!tooltip) return;\r\n tooltip.displayColors = false;\r\n }", "title": "" }, { "docid": "f660895357c3c1c8eeecec41556af48a", "score": "0.6492334", "text": "function createTooltip(){\r\n tooltip = d3.select(chartContainerID)\r\n .append(\"div\")\t\r\n .attr(\"class\", \"tooltip\") \r\n .style(\"opacity\", 0);\r\n}", "title": "" }, { "docid": "ebb6dad3da92e4679b1494f7a3c9a94b", "score": "0.64900047", "text": "autoAddTooltips() {\n\n let posY = this.position.y\n let posX = this.position.x\n\n\n if (this.exits[0] == 1) {\n this.addPoint({\n position: enFace,\n name: \"Avancer\",\n scene: trouverScene(posX, posY + 1)\n })\n }\n if (this.exits[1] == 1) {\n this.addPoint({\n position: aDroite,\n name: \"Aller à droite\",\n scene: trouverScene(posX + 1, posY)\n })\n }\n if (this.exits[2] == 1) {\n this.addPoint({\n position: posX === 1 ? aGauche : derriere,\n name: \"Reculer\",\n scene: posX === 1 ? trouverScene(posX - 1, posY) : trouverScene(posX, posY - 1)\n })\n }\n if (this.exits[3] == 1) {\n this.addPoint({\n position: aGauche,\n name: \"Aller à gauche\",\n scene: trouverScene(posX - 1, posY)\n })\n\n }\n }", "title": "" }, { "docid": "df2dc83722988403dca4dda6138ae830", "score": "0.64753395", "text": "function createToolTip(){\n\ttip = d3.tip()\n\t .attr('class', 'd3-tip')\n\t .offset([-10, 0])\n\t .html(function(d) {\n\t\t\treturn \"<div><span class='tooltipTitle'>\" + d['Artist(s)']+ \"</span></div>\" +\n\t\t\t \"<div><span># Songs:</span> <span class='tooltipContents'>\" + d['Counts']+ \"</span></div>\" +\n\t\t\t \"<div><span># Years:</span> <span class='tooltipContents'>\" + d['Years of presence']+ \"</span></div>\";\n\t\t});\n\n\tcontainer.call(tip);\n}", "title": "" }, { "docid": "0b903beb142e4a4c09bd9ef5b39489a2", "score": "0.64710796", "text": "function tooltip(html) {\n if (SHOW_TT) {\n cb.createMouseTT(html, TT_TIMEOUT, { fadeoutTime: TT_FADEOUT });\n }\n }", "title": "" }, { "docid": "f1b3529baabc8e08277c42c8e84b9309", "score": "0.6458265", "text": "function mouseover() {\n focus.style(\"opacity\", 1);\n tooltip\n .style(\"opacity\", 1)\n .style('display', 'inline-block');\n }", "title": "" }, { "docid": "26c3ceda55eb24193f0ef4b676a9742e", "score": "0.6455225", "text": "function smartTooltip(d){var e=0,f=0,b=0,c=0;$(d).hover(function(){var a=$(this).attr(\"data-tooltip\");if($('.smart_tooltip').length == 0){$(\"body\").append('<div class=\"smart_tooltip\" style=\"position: fixed; z-index: 9999;\">'+a+\"</div>\");}c=$(\"body\").find(\".smart_tooltip\").outerWidth();b=$(\"body\").find(\".smart_tooltip\").outerHeight();e=$(window).width();f=$(window).height()},function(){$(\"body\").find(\".smart_tooltip\").remove()});$(d).mousemove(function(a){e-a.clientX<=c+15?$(\"body\").find(\".smart_tooltip\").css({left:a.clientX-c,\"margin-left\":-15}):\r\n$(\"body\").find(\".smart_tooltip\").css({left:a.clientX,\"margin-left\":15});f-a.clientY<=b+15?$(\"body\").find(\".smart_tooltip\").css({top:a.clientY-b,\"margin-top\":-5}):$(\"body\").find(\".smart_tooltip\").css({top:a.clientY,\"margin-top\":15})})}", "title": "" }, { "docid": "eeed8b8a01d24bc87c6dcf0925d82d06", "score": "0.64459926", "text": "function mouseover(d){\n tooltip\n .style(\"opacity\", 1)\n d3.select(this)\n .style(\"stroke-width\", 3)\n .style(\"opacity\", 0.5)\n }", "title": "" }, { "docid": "877bc87074b84b23dd3bd4b4e39e1758", "score": "0.6442885", "text": "function createToolTip(gardenObject)\r\n{\r\n var selector = gardenObject.classType\r\n\r\n $(\"#\" + gardenObject.id).tooltip({\r\n content: function(event, ui){\r\n if(selector ===\"plant\" || selector ===\"plantJ\")\r\n {\t\r\n return createPlantTooltipString(gardenObject);\r\n }\r\n else {\r\n return createPlotTooltipString($(this), gardenObject);\r\n }\r\n },\r\n show:{\r\n delay: 1000\r\n },\r\n disabled: false,\r\n track: false,\r\n close: function (event, ui) {\r\n ui.tooltip.hover(\r\n function () {\r\n $(this).stop(true).fadeTo(400, 1);\r\n },\r\n function () {\r\n $(this).fadeOut(\"400\", function () {\r\n $(this).remove();\r\n })\r\n });\r\n $(\".ui-helper-hidden-accessible\").children(\":not(:last)\").remove();\r\n }\r\n });\r\n}//end tooltip functions", "title": "" }, { "docid": "5292b2c77f85ba0c56160e6a08b79803", "score": "0.6428937", "text": "function showtooltip() {\n // set position relative to crosshair\n tooltip = document.getElementById(\"tooltip\");\n tooltip.style.left = (canvas_x + 10)+\"px\";\n tooltip.style.top = (transformy(canvas_y) + 65) +\"px\";\n\n // update tooltip with correct information\n document.getElementById(\"tooltip\").innerHTML = \"Date: \" + data[crosshair_x][0] + \"<br> Max temp: \" + (temperature[crosshair_x] / 10) + \"&deg\";\n tooltip.style.visibility = \"visible\";\n mousemove = false;\n}", "title": "" }, { "docid": "6bc1fb77aa4d6669da54c2f2e77a4b39", "score": "0.6422666", "text": "function makeTooltips() {\n $(\".ttLink[title]\").tooltip({\n track: true\n });\n}", "title": "" }, { "docid": "7707d82ce113301f2c382379a22f7f53", "score": "0.64165294", "text": "function track(){ // run function on mouse move\n mouseX = event.clientX + document.body.scrollLeft + 1, // get x position of mouse\n mouseY = event.clientY + document.body.scrollTop - 40; // get y position of mouse\n\ttoolTip.setAttribute('style', 'top:' + mouseY + 'px; left:' + mouseX + 'px;'); // set the x and y of tooltip based on mouse position\n}", "title": "" }, { "docid": "d2e4a3c2d0b2dc7005dc31fc4baaeb31", "score": "0.64126515", "text": "function mouseoverFunc(d) {\n return tooltip\n .style(\"display\", null); // this removes the display none setting\n }", "title": "" }, { "docid": "f29915a719e4e5ecc10ff8658f5e5e02", "score": "0.6412128", "text": "function display_title(id, string)\n{\n $(id).mousemove(function(e)\n {\n if($('.tool_tip').css('opacity')<'0.8')\n {\n $('.tool_tip').html(\"<p class='tool_tip_text'>\"+string+\"</p>\").css({'left': (e.pageX-50), 'top': (e.pageY+20)});\n $('.tool_tip').stop().animate({\n opacity: 1\n }, 100, function()\n {});\n }\n else\n $('.tool_tip').css({'left': (e.pageX-50), 'top': (e.pageY+20)});\n });\n}", "title": "" }, { "docid": "82a312b07f187c1c5a48a17db325876c", "score": "0.6411139", "text": "function drawToolTip(selectedX, selectedY, circleGroup) {\n\n // initializing all my variatbles\n // These will be the X and Y labels that go in front of the value\n var xLabel;\n var yLabel;\n // These values potenially hold a '%' depending on whether or not it is a percent value\n var pxLabel;\n var pyLabel;\n\n // switching for xLabel\n switch (selectedX) {\n case 'poverty':\n xLabel = 'Poverty';\n pxLabel = '%';\n break;\n \n case 'age':\n xLabel = 'Age';\n pxLabel = '';\n break;\n \n case 'income':\n xLabel = 'Income';\n pxLabel = '';\n break;\n }\n\n // switching for yLabel\n switch (selectedY) {\n case 'healthcare':\n yLabel = 'Healthcare';\n pyLabel = '%';\n break;\n \n case 'smokes':\n yLabel = 'Smokes';\n pyLabel = '%';\n break;\n\n case 'obesity':\n yLabel = 'Obesity';\n pyLabel = '%';\n break;\n }\n\n // here I am defining tool tip object\n var toolTip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([80, -60])\n .html(function(s) {\n return (`${s.state}<br>${xLabel}: ${s[selectedX]}${pxLabel}<br>${yLabel}: ${s[selectedY]}${pyLabel}`);\n });\n\n // creating and appending tooltips\n circleGroup.call(toolTip);\n\n // I got help fixing a frustrating tooltip error from this site\n // https://github.com/caged/d3-tip/issues/231\n\n circleGroup.on('mouseover', function(d) {\n toolTip.show(d, this);\n\n // selecting just the circle that I am on\n var sCircle = d3.select(this);\n\n // turning off it's class to clear css\n sCircle.classed('stateCircle', false)\n // readding the css I want\n .attr('fill', '#89bdd3')\n // want i want is a different color stroke that is bigger\n .attr('stroke', 'crimson')\n .attr('stroke-width', '3');\n\n }).on('mouseout', function(d) {\n toolTip.hide(d);\n\n // selecting that cirlce again\n var sCircle = d3.select(this);\n\n // turning back on css which overwrites those changes i made...\n sCircle.classed('stateCircle', true)\n // ...except stroke-width so I reset that back to 1\n .attr('stroke-width', '1');\n });\n\n return circleGroup;\n}", "title": "" }, { "docid": "c926ca2ecdeca77df2b18b336fc20458", "score": "0.64043784", "text": "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 }", "title": "" }, { "docid": "c926ca2ecdeca77df2b18b336fc20458", "score": "0.64043784", "text": "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 }", "title": "" }, { "docid": "50ce52a1f6fedbba0634923c10dbc1d1", "score": "0.6399456", "text": "function iniCustomToolTips(tooltip) {\n var tooltipEl = $('#chartjs-tooltip');\n \n if (!tooltip) {\n tooltipEl.css({\n opacity: 0\n });\n return;\n }\n\n tooltipEl.removeClass('above below');\n tooltipEl.addClass(tooltip.yAlign);\n tooltipEl.addClass(tooltip.xAlign);\n\n // split out the label and value and make your own tooltip here\n var parts = tooltip.text.split(\":\");\n var innerHtml = '<span>' + parts[0].trim() + '</span>: <span>' + parts[1].trim() + '</span> ';\n innerHtml += '<span class=\"tooltip-label\">' + parts[2].trim() + '</span>';\n tooltipEl.html(innerHtml);\n\n tooltipEl.css({\n opacity: 1,\n left: tooltip.chart.canvas.offsetLeft + tooltip.x + 'px',\n top: tooltip.chart.canvas.offsetTop + (tooltip.y - ($(tooltipEl).height() + 10)) + 'px',\n fontFamily: $(document.body).css('fontFamily'),\n fontSize: $(document.body).css('fontSize'),\n fontStyle: $(document.body).css('fontStyle')\n });\n }", "title": "" }, { "docid": "c446f119ae2468457ee58cfae1e5664f", "score": "0.6389797", "text": "function svgTooltips(suffix) {\n // SVG mouseover, mousemove and mouseout callbacks \n function mouseoverSVG(d) {\n if (d3.select(this).classed(\"predicted\"))\n tooltipSVG.html(\"Predicted colors!\");\n else if (d3.select(this).classed(\"complement\"))\n tooltipSVG.html(\"Complementary colors\");\n else if (d3.select(this).classed(\"original\"))\n tooltipSVG.html(\"Original colors\");\n else if (d3.select(this).classed(\"sampleBand\"))\n tooltipSVG.html(\"Latest \" + MAX_COLORS +\" rendered color predictions\");\n else\n tooltipSVG.html(\"Color reference (predictions should be as close to the reference as possible)\");\n return tooltipSVG.style(\"visibility\", \"visible\");\n }\n\n function mousemoveSVG(d) {\n return tooltipSVG.style(\"top\", (d3.event.pageY-20)+\"px\")\n .style(\"left\",(d3.event.pageX+25)+\"px\");\n }\n\n function mouseoutSVG(d) {\n return tooltipSVG.style(\"visibility\", \"hidden\");\n }\n\n // Set SVG callbacks\n d3.select(\"#svg\"+suffix).selectAll(\".colorDemo\")\n .on(\"mouseover\", mouseoverSVG)\n .on(\"mousemove\", mousemoveSVG)\n .on(\"mouseout\", mouseoutSVG);\n}", "title": "" }, { "docid": "dadf4988d9144c548395027463570df6", "score": "0.63871557", "text": "function toolTipInit() {\n\t\n\t\t$('.social-icons li a').tooltip({\n\t\t\tplacement: 'top'\n\t\t});\n\t}", "title": "" }, { "docid": "7fa5aa894d6e08609ba402389b804ff0", "score": "0.6367435", "text": "function createTooltip(oncoprint, row, column, tooltipText) {\n\n\tvar rect = oncoprint.body_canvas.rect(getXCoordinate(oncoprint, column),\n\t\t\t\t\t\t\t\t\t\t getYCoordinate(oncoprint, row),\n\t\t\t\t\t\t\t\t\t\t oncoprint.alteration_width,\n\t\t\t\t\t\t\t\t\t\t oncoprint.alteration_height);\n\n\t// without adding fill, mouseover will not work\n\trect.attr('fill', '#000000');\n\trect.attr('opacity', 0);\n\n\trect.node.style.cursor = \"default\";\n addTooltipText(rect.node, tooltipText);\n}", "title": "" }, { "docid": "97583ef9c18ddb1a0492ea8e6d571020", "score": "0.6365419", "text": "function zXTooltip(owner, evt, msg){\r\n\tevt = (evt) ? evt : event;\r\n\t\r\n\tif (window.createPopup == undefined) {\r\n\t\tif (isNS4) {\r\n\t\t\tzXTT=document.tooltip;\r\n\t\t\tdocument.captureEvents(Event.MOUSEMOVE);\r\n\t \t\tzXTT.document.write(msg);\r\n\t \t\tzXTT.document.close();\r\n\t \t\tzXTT.visibility=\"visible\";\r\n\t \t\t\r\n\t\t} else {\r\n\t\t\tzXTT=document.getElementById(\"tooltip\").style;\r\n\t\t\tzXTT.visibility=\"visible\";\r\n\t \t\tzXTT.display='';\r\n\t \t\tdocument.getElementById(\"tooltip\").innerHTML=msg;\r\n\t\t\tzXTT.maxWidth = 300;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tzXTT.left = evt.pageX+-10;\r\n\t\tzXTT.top = evt.pageY+15;\r\n\t\t\r\n\t} else {\r\n\t\t// IE divs cannot cover select list etc.. so we use createPopup.\r\n \t\tzXTT = window.createPopup();\r\n \t\tzXTT.document.body.innerHTML = \"<html><body><div ID='tooltipvisible' style='\" \r\n \t\t\t\t\t\t\t\t\t+ getStyle(\"#tooltipvisible\")+ \"'>\" + msg \r\n \t\t\t\t\t\t\t\t\t+ \"</div></body></html>\";\r\n\t\tzXTT.show(0, 0, 50, 0, zXTT.document.body);\r\n\t\trealHeight = zXTT.document.body.scrollHeight;\r\n\t\trealWidth = zXTT.document.body.scrollWidth;\r\n\t\tzXTT.hide();\r\n\t\tzXTT.show(evt.x + 100, evt.y + 10, realWidth, realHeight, zXTT.document.body);\r\n\t\t\r\n \t}\r\n \t\r\n\tif (owner.attachEvent) {\r\n\t\towner.attachEvent('onmouseout', zXTooltiphide);\r\n\t} else {\r\n\t\towner.addEventListener('mouseout', zXTooltiphide, true);\r\n\t}\r\n}", "title": "" }, { "docid": "4e7bcf0a1f985dec8bd63ae3c24511c5", "score": "0.6356409", "text": "function mouseover(d) \n {\n\tvar ele = document.getElementById('tooltip')\n var elem = document.getElementById('treechart')\n var rect = elem.getBoundingClientRect();\n var position = {\n top: rect.top + window.pageYOffset,\n left: rect.left + window.pageXOffset\n }; \n\tele.innerHTML = levelTxt(d.detail,d.name)\n\tele.style.top =(event.pageY - position.top + elem.offsetTop - 30)+\"px\"\n\tele.style.left =(event.pageX - position.left + elem.offsetLeft + 30)+\"px\"\n\tele.style.display = \"block\"\n\n }", "title": "" }, { "docid": "41a2b48bbe6e40974617a42c0d126604", "score": "0.6355046", "text": "function plotData(map) {\n\n // mapping functions\n let xMap = map.x;\n let yMap = map.y;\n\n // make tooltip\n div = d3.select(\"body\").append(\"div\")\n .attr(\"class\", \"tooltip\")\n .style(\"opacity\", 0);\n\n\n\n // append data to SVG and plot as points\n circles = svgContainer.selectAll('.dot')\n .data(data)\n .enter()\n .append('circle')\n .attr('cx', xMap)\n .attr('cy', yMap)\n .attr('r', 5)\n // .attr('fill', \"#4286f4\")\n .attr('fill', (d) => { return colors[d[\"Type 1\"]]; })\n // add tooltip functionality to points\n .on(\"mouseover\", (d) => {\n count = 0;\n\n for (var i = 0; i < sp_def_data.length; i++) {\n var x = sp_def_data[i];\n var y = total_data[i];\n if (x == d3.event.pageX && y == d3.event.pageY) {\n count = count + 1;\n }\n }\n if (count > 1) {\n // show all tooltips at that area\n div.transition()\n .duration(200)\n .style(\"opacity\", .9);\n div.html(d[\"Name\"] + \"<br/>\" + d[\"Type 1\"] + \"<br/>\" + d[\"Type 2\"])\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY - 68) + \"px\");\n } else {\n div.transition()\n .duration(200)\n .style(\"opacity\", .9);\n div.html(d[\"Name\"] + \"<br/>\" + d[\"Type 1\"] + \"<br/>\" + d[\"Type 2\"])\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n }\n })\n .on(\"mouseout\", (d) => {\n div.transition()\n .duration(500)\n .style(\"opacity\", 0);\n });\n\n svgContainer.append(\"text\")\n .attr(\"x\", 1000)\n .attr(\"y\", 90)\n .text(\"Type 1\")\n .style(\"font-weight\", \"bold\");\n\n svgContainer.selectAll(\"mydots\")\n .data(Object.keys(colors))\n .enter()\n .append(\"rect\")\n .attr(\"x\", 1000)\n .attr(\"y\", function (d, i) { return 100 + i * 25 }) // 100 is where the first dot appears. 25 is the distance between dots\n .attr(\"width\", 10)\n .attr(\"height\", 10)\n .style(\"fill\", (d) => { return colors[d]; });\n\n svgContainer.selectAll(\"mylabels\")\n .data(Object.keys(colors))\n .enter()\n .append(\"text\")\n .attr(\"x\", 1020)\n .attr(\"y\", function (d, i) { return 106 + i * 25 }) // 100 is where the first dot appears. 25 is the distance between dots\n .text(function (d) { return d })\n .attr(\"text-anchor\", \"left\")\n .style(\"alignment-baseline\", \"middle\");\n\n }", "title": "" }, { "docid": "4134c7cde91c74a8250bf9c034186692", "score": "0.63388586", "text": "function nvtooltip() { // 792\n if (!enabled) return; // 793\n if (!dataSeriesExists(data)) return; // 794\n // 795\n convertViewBoxRatio(); // 796\n // 797\n var left = position.left; // 798\n var top = (fixedTop !== null) ? fixedTop : position.top; // 799\n // 800\n nv.dom.write(function () { // 801\n initTooltip(); // 802\n // generate data and set it into tooltip // 803\n // Bonus - If you override contentGenerator and return falsey you can use something like // 804\n // React or Knockout to bind the data for your tooltip // 805\n var newContent = contentGenerator(data); // 806\n if (newContent) { // 807\n tooltipElem.innerHTML = newContent; // 808\n } // 809\n // 810\n if (chartContainer && isInteractiveLayer) { // 811\n nv.dom.read(function() { // 812\n var svgComp = chartContainer.getElementsByTagName(\"svg\")[0]; // 813\n var svgOffset = {left:0,top:0}; // 814\n if (svgComp) { // 815\n var svgBound = svgComp.getBoundingClientRect(); // 816\n var chartBound = chartContainer.getBoundingClientRect(); // 817\n var svgBoundTop = svgBound.top; // 818\n // 819\n //Defensive code. Sometimes, svgBoundTop can be a really negative // 820\n // number, like -134254. That's a bug. // 821\n // If such a number is found, use zero instead. FireFox bug only // 822\n if (svgBoundTop < 0) { // 823\n var containerBound = chartContainer.getBoundingClientRect(); // 824\n svgBoundTop = (Math.abs(svgBoundTop) > containerBound.height) ? 0 : svgBoundTop; // 825\n } // 826\n svgOffset.top = Math.abs(svgBoundTop - chartBound.top); // 827\n svgOffset.left = Math.abs(svgBound.left - chartBound.left); // 828\n } // 829\n //If the parent container is an overflow <div> with scrollbars, subtract the scroll offsets. // 830\n //You need to also add any offset between the <svg> element and its containing <div> // 831\n //Finally, add any offset of the containing <div> on the whole page. // 832\n left += chartContainer.offsetLeft + svgOffset.left - 2*chartContainer.scrollLeft; // 833\n top += chartContainer.offsetTop + svgOffset.top - 2*chartContainer.scrollTop; // 834\n // 835\n if (snapDistance && snapDistance > 0) { // 836\n top = Math.floor(top/snapDistance) * snapDistance; // 837\n } // 838\n calcTooltipPosition([left,top]); // 839\n }); // 840\n } else { // 841\n calcTooltipPosition([left,top]); // 842\n } // 843\n }); // 844\n // 845\n return nvtooltip; // 846\n } // 847", "title": "" }, { "docid": "da99fa89b423e5822363f9e7ee79f4c7", "score": "0.6337903", "text": "tipMouseover(event, d) {\n // To make the tooltip easier to read\n let vis = this;\n let gdp = parseFloat(d.gdp_per_capita).toFixed(2)\n if (d.total == 0) { let prop = 0} else {let prop = d.total/d.athletes};\n vis.tooltip.html(`\n <div style=\"border: thin solid grey; border-radius: 5px; background: white; width: 250px\">\n <h5><bold>${d.country}</bold></h5>\n <h6>Medals: ${d.total}</h6>\n <h6>Population: ${(d.population / 1000000).toFixed(2)}M</h6>\n <h6>GDP/Capita in USD: ${gdp}</h6>\n <h6>Olympians: ${d.athletes}</h6>\n <h6>Medals per Athlete: ${d.prop.toFixed(2)}</h6>\n </div>`\n )\n .style(\"left\", 445 + \"px\")\n .style(\"top\", 150 + \"px\")\n .style(\"text-align\", \"center\")\n .transition()\n .duration(300) // ms\n .style(\"opacity\", 0.9)\n\n }", "title": "" }, { "docid": "02b763eb01dfba5e3f1572b19869f122", "score": "0.6335758", "text": "function addOverviewTooltipBehaviour() {\n $('.overview-list li a[title]').tooltip({\n position: 'center right',\n predelay: 500,\n effect: 'fade'\n });\n}", "title": "" }, { "docid": "9d480d7b1ae90f5884d9abc90b0754c3", "score": "0.6334006", "text": "function ToolTip() {\n xOffset = 10;\n yOffset = 20;\n var el_parent, el_child;\n $(\".toolparent\").hover(function(e){\n if (el_child) el_child.appendTo(el_parent).hide();\n el_parent = $(this);\n el_child = el_parent.children(\".tooltip\")\n .appendTo(\"body\")\n .css(\"top\",(e.pageY - xOffset) + \"px\")\n .css(\"left\",(e.pageX + yOffset) + \"px\")\n .fadeIn(\"fast\");\n },\n function(){\n if (el_child) el_child.appendTo(el_parent);\n $(\".tooltip\").hide();\n el_child = null;\n });\n $(\".toolparent\").mousemove(function(e){\n if (el_child) {\n el_child\n .css(\"top\",(e.pageY - xOffset) + \"px\")\n .css(\"left\",(e.pageX + yOffset) + \"px\");\n }\n });\n}", "title": "" }, { "docid": "9df1935c5f6e87b081ef037f9097d994", "score": "0.6328254", "text": "function justThetip(chosenXAxis, chosenYAxis, groups) {\n var x_label;\n\n if (chosenXAxis === \"poverty\") {\n x_label = \"Percentage of population in poverty\";\n } else if (chosenXAxis === 'age') {\n x_label = \"Average age of popultaion\";\n } else {\n x_label = 'Average income of Population';\n }\n // varible to display tooltip\n var toolTip = d3.tip()\n .attr(\"class\", \"tooltip\")\n .offset([80, -60])\n .html(function(d) {\n return (`${d.state}<br>${x_label} :${d[chosenXAxis]}<br>percent of population with healthcare : ${d[chosenYAxis]}`);\n });\n\n groups.call(toolTip);\n\n groups.on('mouseover', function(data) {\n toolTip.show(data, this);\n })\n groups.on('mouseout', function(data) {\n toolTip.hide(data);\n })\n return groups;\n}", "title": "" }, { "docid": "76e3c4b03d6a43c448da5a7be81ea69e", "score": "0.6320884", "text": "function addToolTips(graph) {\r\r\n var tt = function (n) {\r\r\n var name = \"\";\r\r\n if (flattenedNodes[n].type == \"channel\" || flattenedNodes[n].type == \"stream\") name += flattenedNodes[n].type + \" \";\r\r\n \r\r\n name += flattenedNodes[n].name;\r\r\n\r\r\n if (flattenedNodes[n].count && flattenedNodes[n].count > 1) name += \" (x\" + flattenedNodes[n].count + \")\";\r\r\n\r\r\n var text = \"<p class='name'>\" + name + \" Info</p><p class='description'>\";\r\r\n Object.keys(flattenedNodes[n].details).forEach(function (k) {\r\r\n text += k + \": \" + flattenedNodes[n].details[k] + \"<br>\";\r\r\n });\r\r\n text += \"</p>\";\r\r\n return text;\r\r\n }\r\r\n\r\r\n graph.selectAll(\"g.node rect, g.cluster rect, g.node circle, g.node polygon\")\r\r\n .filter(function (d) {\r\r\n if (d.indexOf(\"container\") != -1 || d == \"glbmem\") return false;\r\r\n return (flattenedNodes[d] && flattenedNodes[d].details);\r\r\n })\r\r\n .style(\"fill\", \"white\")\r\r\n .attr(\"title\", function (d) { return tt(d); })\r\r\n .each(function (v) { $(this).tipsy({ gravity: \"s\", opacity: 1, html: true }); });\r\r\n }", "title": "" }, { "docid": "fd75569b54c3bac0d6253a8fa616f116", "score": "0.63207537", "text": "renderTooltip(){\n return d3.tip()\n .attr(\"class\", \"d3-tip\")\n .html(d => {\n const state = d[dataColumns.state];\n\n const xAxis = this.getSelectedAxisX();\n const xLabel = xAxis.label;\n const xValue = d[xAxis.dataColumn];\n\n const yAxis = this.getSelectedAxisY();\n const yLabel = yAxis.label;\n const yValue = d[yAxis.dataColumn];\n\n return (`\n <strong>${state}</strong>\n <hr>\n ${xLabel}: ${xValue}\n <br>\n ${yLabel}: ${yValue}\n `);\n });\n }", "title": "" }, { "docid": "7ad0d32636b0cb1e2b0da2f3764b14da", "score": "0.6318139", "text": "function makeTooltip(tooltipText, locX, locY) {\n // console.log(\"makeTooltip\");\n if (tooltipText) {\n // console.log(\" tooltipText: \", tooltipText);\n tooltipString = \"<p>\" + tooltipText + \"</p>\";\n $(\"#tooltips\").html(tooltipString);\n $(\"#tooltips\").css(\"left\", locX);\n $(\"#tooltips\").css(\"top\", locY);\n } else {\n $(\"#tooltips\").html(\"\");\n }\n }", "title": "" }, { "docid": "b2f504ff5d7da894461a43f9e8f09fdd", "score": "0.6311328", "text": "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 }", "title": "" }, { "docid": "6e768a40d7869686a297bd0e51c4905e", "score": "0.6307763", "text": "function initTooltip() {\n if (!tooltip || !tooltip.node()) {\n var container = chartContainer ? chartContainer : document.body;\n // Create new tooltip div if it doesn't exist on DOM.\n\n var data = [1];\n tooltip = d3.select(container).selectAll('.nvtooltip').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 }", "title": "" }, { "docid": "527a116cdc06685038394c99af9ca3c5", "score": "0.6298842", "text": "_showTooltip() {\n this._tooltipContainer = document.createElement('div');\n this._tooltipContainer.textContent = this._tooltipText;\n this.shadowRoot.appendChild(this._tooltipContainer);\n }", "title": "" }, { "docid": "667f7dbab0bd32c232c6685801c8406f", "score": "0.62907773", "text": "function updateTooltip(e){\r\n//\t\tvar div = get(\"tb_tooltip\");\r\n//\t\tdiv.style.left = (e.pageX + 15) + \"px\";\r\n//\t\tdiv.style.top = (e.pageY + 5) + \"px\";\r\n\r\n\t\tvar dx = 15;\r\n\t\tvar dy = 10;\r\n\r\n\t\tvar div = get(\"tb_tooltip\");\r\n\t\t//if(div.clientWidth==0 || div.clientHeight==0) return;\r\n\t\tif(div.clientWidth!=0 && e.pageX+dx+div.clientWidth - document.documentElement.scrollLeft > document.documentElement.clientWidth)\r\n\t\t\tdiv.style.left = (e.pageX - dx - div.clientWidth) + \"px\";\r\n\t\telse\r\n\t\t\tdiv.style.left = (e.pageX + dx) + \"px\";\r\n\r\n\t\tif(div.clientHeight!=0 && e.pageY+dy+div.clientHeight - document.documentElement.scrollTop > document.documentElement.clientHeight)\r\n\t\t\tdiv.style.top = (e.pageY - dy - div.clientHeight) + \"px\";\r\n\t\telse\r\n\t\t\tdiv.style.top = (e.pageY + dy) + \"px\";\r\n\t}", "title": "" }, { "docid": "2fab237e0d7cf2d0cd618a5e27ab339b", "score": "0.62814826", "text": "function MapToolTip(scatterPlot) {\n\n var tip = d3.tip();\n \n\ttip.attr('class', 'd3-tip')\n\t\t.offset([-10, 0])\n\t\t.html(function() {\n\t\t\tvar info = {};\n\t\t\t\n\t\t\td3.select(this).attr(\"r\", function(d) {\n\t\t\t\tinfo.name = d.hospitals[hospitalIDs[i]].DRGs[DRGchoice].name ;\n\t\t\t\tinfo.adress = d.hospitals[hospitalIDs[i]].adress;\n\t\t\t\tinfo.avgCC = d.hospitals[hospitalIDs[i]].DRGs[DRGchoice].avgCC;\n\t\t\t\tinfo.avgTP = d.hospitals[hospitalIDs[i]].DRGs[DRGchoice].avgTP;\n\t\t\t\tinfo.discharges= d.hospitals[hospitalIDs[i]].discharges ;\n\t\t\t\treturn r(d.otherValue.name);\n\t\t\t});\n\t\t\t\n\t\t\treturn \"<br>\" + info.name + \"</br>\" +\n\t\t\t\t\"<br>Average covered charges: \" + info.avgCC + \" </br>\" +\n\t\t\t\t\"<br>\" + info.adress + \" </br>\" +\n\t\t\t\t\"<br>Average total medicare coverage : \" + info.avgTP + \"</br>\" +\n\t\t\t\t\"<br>* Out of : \" + info.discharges+ \"discharges</br>\";\n\t\t}); \n return tip;\n}", "title": "" }, { "docid": "081c2173802cb1bf063e9d337615eb08", "score": "0.6279821", "text": "redrawTooltip() {\n const domControl = this._domControl;\n if (domControl) {\n Activatable.redrawTooltip.call(this, domControl);\n }\n }", "title": "" }, { "docid": "543bf527ec4f03a42717d3702f1e1d1f", "score": "0.6279537", "text": "function responsiveTooltips() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('.nectar_image_with_hotspots').each(function () {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(this).find('.nectar_hotspot_wrap').each(function () {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (nectarDOMInfo.winW > 690) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Remove click if applicable\r\n\t\t\t\t\t\t\t\tif ($(this).parents('.nectar_image_with_hotspots[data-tooltip-func=\"hover\"]').length > 0) {\r\n\t\t\t\t\t\t\t\t\t$(this).find('.nectar_hotspot').removeClass('click');\r\n\t\t\t\t\t\t\t\t\t$(this).find('.nttip').removeClass('open');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$(this).find('.nttip .inner a.tipclose').remove();\r\n\t\t\t\t\t\t\t\t$('.nttip').css('height', 'auto');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Reset for positioning\r\n\t\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t\t'width': 'auto',\r\n\t\t\t\t\t\t\t\t\t'height': 'auto'\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$(this).find('.nttip')\r\n\t\t\t\t\t\t\t\t\t.removeClass('force-right')\r\n\t\t\t\t\t\t\t\t\t.removeClass('force-left')\r\n\t\t\t\t\t\t\t\t\t.removeClass('force-top')\r\n\t\t\t\t\t\t\t\t\t.css('width', 'auto');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tvar $tipOffset = $(this).find('.nttip').offset();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Against right side \r\n\t\t\t\t\t\t\t\tif ($tipOffset.left > $(this).parents('.nectar_image_with_hotspots').width() - 200) {\r\n\t\t\t\t\t\t\t\t\t$(this).find('.nttip').css('width', '250px');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t$(this).find('.nttip').css('width', 'auto');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Responsive\r\n\t\t\t\t\t\t\t\tif ($tipOffset.left < 0) {\r\n\t\t\t\t\t\t\t\t\t$(this).find('.nttip').addClass('force-right');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ($tipOffset.left + $(this).find('.nttip').outerWidth(true) > nectarDOMInfo.winW) {\r\n\t\t\t\t\t\t\t\t\t$(this).find('.nttip').addClass('force-left').css('width', '250px');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ($tipOffset.top + $(this).find('.nttip').height() + 35 > $window.height() && $('#nectar_fullscreen_rows').length > 0) {\r\n\t\t\t\t\t\t\t\t\t$(this).find('.nttip').addClass('force-top');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($(this).find('> .open').length == 0) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t\t\t'width': '30px',\r\n\t\t\t\t\t\t\t\t\t\t'height': '30px'\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//fixed position\r\n\t\t\t\t\t\t\t\t$(this).find('.nttip')\r\n\t\t\t\t\t\t\t\t\t.removeClass('force-left')\r\n\t\t\t\t\t\t\t\t\t.removeClass('force-right')\r\n\t\t\t\t\t\t\t\t\t.removeClass('force-top');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$(this).find('.nectar_hotspot').addClass('click');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($(this).find('.nttip a.tipclose').length == 0) {\r\n\t\t\t\t\t\t\t\t\t$(this).find('.nttip .inner').append('<a href=\"#\" class=\"tipclose\"><span></span></a>');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Change height of fixed\r\n\t\t\t\t\t\t\t\t$('.nttip').css('height', $window.height());\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}", "title": "" }, { "docid": "f450cd6e957e1f3cec57d0a45e6d5dc0", "score": "0.6271774", "text": "function tooltipMouseover(d) {\n $(\"#div_tooltip\").remove();\n var tooltip = d3.select(\"#data_visualization\").append(\"div\").attr(\"id\", \"div_tooltip\").attr(\"class\", \"tooltip\"),\n tooltipText = tooltipUpdate(d);\n tooltip.transition().style(\"opacity\", 0.9).style(\"display\", \"block\");\n tooltip.html(tooltipText)\n\t\t.style(\"left\", ($(this).position()[\"left\"] + 15) + \"px\")\n\t\t.style(\"top\", ($(this).position()[\"top\"] - 30) + \"px\");\n}", "title": "" }, { "docid": "cabc3036688b243223c0d71d1d369aac", "score": "0.62676185", "text": "function applyHoverEvent(canvasId) {\n\t\n $(\"#\" + canvasId).bind(\"plothover\", function (event, pos, item) {\n if (item) {\n if (previousPoint != item.dataIndex) {\n previousPoint = item.dataIndex;\n $(\"#tooltip\").remove();\n var dataPoint = item.datapoint;\n var dataInfo = PSE_nodesInfo[dataPoint[0]][dataPoint[1]];\n var tooltipText = (\"\" + dataInfo[\"tooltip\"]).split(\"&amp;\").join(\"&\").split(\"&lt;\").join(\"<\").split(\"&gt;\").join(\">\");\n\n $('<div id=\"tooltip\"> </div>').html(tooltipText\n ).css({ position: 'absolute', display: 'none', top: item.pageY + 5, left: item.pageX + 5,\n\t\t\t\t\t\t border: '1px solid #fdd', padding: '2px', 'background-color': '#C0C0C0', opacity: 0.80 }\n ).appendTo('body').fadeIn(200);\n }\n } else {\n $(\"#tooltip\").remove();\n previousPoint = null;\n }\n });\n}", "title": "" }, { "docid": "aa676485329dff53289802e38efc0911", "score": "0.62642723", "text": "function createtip() { \n\n var toolTip = d3.tip()\n .attr(\"class\", \"d3-tip\")\n .direction('w') \n .html(function(d) { \n return (`<strong><center>${(d.postcode)}</center></strong>\n <hr>Total Installations: ${d['Install_total']}\n <hr>Total Output: ${d['Output_total'].toFixed(0)} MWh\n <hr>Average income: $${d['Average_total']} <hr>\n <ht>Rebate: $${d['rebate']}<hr>`)});\n \n\n // Call the tooltip on the chartGroup visualisation\n chartGroup.call(toolTip);\n \n pulseCircle = d3.selectAll(\".pulse\")\n \n // Create event listener to display/hide/move the tooltip\n pulseCircle.on(\"mouseover\", d => toolTip.show(d, this).style(\"display\", null))\n .on('mouseout', function() {\n d3.select(\".d3-tip\")\n .transition()\n .delay(200)\n .duration(600)\n .style(\"opacity\",0)\n .style('pointer-events', 'none')\n })\n\n\n }", "title": "" }, { "docid": "6054db83c70a4799b589d7befa8c18a3", "score": "0.625507", "text": "function updateTooltip(e){\r\n\t\tvar div = get(\"tb_tooltip\");\r\n\t\tdiv.style.left = (e.pageX + 8) + \"px\";\r\n\t\tdiv.style.top = (e.pageY + 8) + \"px\";\r\n\t}", "title": "" }, { "docid": "a77e769d562dad5aa345de141b24cdfa", "score": "0.62504095", "text": "function UpdateTooltips() {\n for (var i = 0; i < demonsSel.length; i++) {\n //Remove focus from any control\n demonCustomSkill1[i].blur();\n demonCustomSkill2[i].blur();\n\n $(demonCustomSkill1[i]).next().find(\"div\")[0].setAttribute('data-original-title',\n GetSkillInfo(demonCustomSkill1[i].value));\n $(demonCustomSkill2[i]).next().find(\"div\")[0].setAttribute('data-original-title',\n GetSkillInfo(demonCustomSkill2[i].value));\n }\n}", "title": "" }, { "docid": "a47cdeac0c5bd24ed89120aca6f3c1b1", "score": "0.6246893", "text": "function init_tooltips(){\n\n $(\".tooltip-bot, .tooltip-bot a, .nav-social-links a\").tooltip({\n placement: \"bottom\"\n });\n\n $(\".tooltip-top, .tooltip-top a\").tooltip({\n placement: \"top\"\n });\n\n $(\".marker a\").tooltip({\n placement: \"bottom\"\n });\n\n }", "title": "" }, { "docid": "ab72d2d58992532cd7e72b315d1a03c6", "score": "0.6243323", "text": "function display_title_up(id, string)\n{\n $(id).mousemove(function(e)\n {\n if($('.tool_tip').css('opacity')<'0.8')\n {\n $('.tool_tip').html(\"<p class='tool_tip_text'>\"+string+\"</p>\").css({'left': (e.pageX-50), 'top': (e.pageY-50)});\n $('.tool_tip').stop().animate({\n opacity: 1\n }, 100, function()\n {});\n }\n else\n $('.tool_tip').css({'left': (e.pageX-50), 'top': (e.pageY-50)});\n });\n}", "title": "" }, { "docid": "a8d03ffc09561d701c0581e1ad0ad1aa", "score": "0.6236434", "text": "function drawTooltip(info) {\n if (info === null) {\n return;\n }\n\n var text = info.text;\n\n if (!Array.isArray(text)) {\n text = [text];\n }\n\n const FONT_SIZE = 14;\n\n var tooltipHeight = (FONT_SIZE * text.length + 6) / G_canvasHeight;\n var tooltipWidth = 0;\n for (var ii = 0; ii < text.length; ++ ii) {\n tooltipWidth = Math.max(tooltipWidth, measureTextWidth(text[ii], FONT_SIZE));\n }\n tooltipWidth += 2 * TEXT_INSET;\n\n var tooltipX = clamp(G_mousePos.x, 0, 1.0 - tooltipWidth);\n var tooltipY = 0.01 + G_mousePos.y + tooltipHeight * 0.5;\n\n G_textCtxOffscreen.fillStyle = COLOR_TOOLTIP;\n G_textCtxOffscreen.fillRect(tooltipX * G_canvasWidth, (1.0 - (tooltipY + 0.5 * tooltipHeight)) * G_canvasHeight, tooltipWidth * G_canvasWidth, tooltipHeight * G_canvasHeight);\n\n for (var ii = 0; ii < text.length; ++ ii) {\n drawText(text[ii], tooltipX + TEXT_INSET, tooltipY - ((ii - text.length / 2) * FONT_SIZE + 2) / G_canvasHeight, \"left\", \"top\", tooltipWidth, \"#ffffff\", FONT_SIZE);\n }\n}", "title": "" }, { "docid": "e130809fb6faf199c14bd19bf27b8f15", "score": "0.6234372", "text": "function mouseoverFunc(d) {\n circle.attr(\"opacity\", 1.0);\n bindingLine.attr(\"opacity\", 1.0);\n\n var year = xScale.invert(d3.mouse(this)[0]).getFullYear();\n return tooltip\n .style(\"display\", null) // this removes the display none setting\n .html(\"<p class='sans'><span class='tooltipHeader'>\" + year + \"</span></p>\");\n } // end mouseover", "title": "" }, { "docid": "e8f8abf9468b7b5d07333192c073c13a", "score": "0.6233684", "text": "function showTooltip(x, y, contents) {\n $('<div id=\"tooltip\">' + contents + '</div>').css({\n position: 'absolute',\n display: 'none',\n top: y - 70,\n left: x + 5,\n border: '1px solid #fdd',\n padding: '2px',\n 'background-color': '#fee',\n opacity: 0.80\n }).appendTo(\"body\").fadeIn(200);\n}", "title": "" }, { "docid": "69a9348f966b91e32f9426a27fe33f92", "score": "0.6231037", "text": "function bindToolTips()\r\n{\t\r\n\t//check to see if dual-tooltips are enabled\r\n\tif(getcookie2(\"armory.cookieDualTooltip\") == 1)\r\n\t\tdualTipsEnabled = true;\r\n\t\r\n\t//see if we're on character sheet\r\n\tif(location.href.indexOf(\"character-sheet.xml\") != -1)\r\n\t\tisOnCharSheet = true;\r\n\r\n\t//store reference to the tooltip\r\n\ttheGlobalToolTip = $(\".globalToolTip\");\t\r\n\t\r\n\t//bind mouseover function for objects with class='tooltip'\r\n\t$(\".staticTip\").mouseover(function (e){\r\n\t\t\r\n\t\t//need ajax call for tooltip text for items\r\n\t\tif($(this).hasClass(\"itemToolTip\"))\r\n\t\t{\t\r\n\t\t\t//only show an \"ajax\" tooltip if the item we moused over has an ID\r\n\t\t\tif(this.id != \"\")\r\n\t\t\t{\r\n\t\t\t\t//set current item id to prevent async mixups (and clean the id)\r\n\t\t\t\tcurrItemID = cleanID(this.id);\t\t\r\n\t\t\t\t\r\n\t\t\t\t//get the html to put in the div\r\n\t\t\t\tgetTipHTML(currItemID, this, e,getSlotNum($(this).parent().attr(\"id\")))\r\n\t\t\t\t\r\n\t\t\t\t//show the tooltip\r\n\t\t\t\tif($(theGlobalToolTip).css(\"display\") != \"block\")\r\n\t\t\t\t\t$(theGlobalToolTip).show();\r\n\r\n\t\t\t}else{\r\n\t\t\t\t//no id means no item, character sheet items have tooltip placeholders\r\n\t\t\t\tif(isOnCharSheet){\t\t\t\t\t\r\n\t\t\t\t\t//get id of parent (that will tell us the slot)\r\n\t\t\t\t\tsetToolTipPosition(this,e);\r\n\t\t\t\t\tsetTipText(getEmptySlotToolTip($(this).parent().attr(\"id\")));\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(theGlobalToolTip).show();\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//if not on char sheet hide tip\r\n\t\t\t\t\t$(theGlobalToolTip).hide();\t\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t//normal tooltips (static text)\r\n\t\t\tsetToolTipPosition(this,e); //set the position of the tooltip\t\t\t\r\n\t\t\t$(theGlobalToolTip).show();\r\n\t\t}\t\t\r\n\t});\r\n\r\n\t//mouseout event for objects with class='tooltip' (hide the tooltip)\r\n\t$(\".staticTip\").mouseout(function (){\r\n\t\t$(theGlobalToolTip).hide();\t\r\n\t\tcurrItemID = null; //set itemid to null (for preventing async messups)\r\n\t});\r\n\r\n}", "title": "" } ]
309be5800c731090345fff99e4850941
Palauttaa datasta kaikki leimaustavat
[ { "docid": "250ed2718e75aeeca8bf075993e87356", "score": "0.6376341", "text": "function haeLeimaustavat(data) {\n let leimaustavat = [];\n for (let kilpailu of data) {\n for (let leimaustapa of kilpailu.leimaustapa) {\n if (!leimaustavat.includes(leimaustapa)) {\n leimaustavat.push(leimaustapa);\n }\n }\n }\n return leimaustavat;\n}", "title": "" } ]
[ { "docid": "ffa56f46410ecc6d5214be4795ffd718", "score": "0.6638804", "text": "function ziskaj_tabulku_podla_zapasov(all)\n{\n var id_tymu;\n var goly_dane=0;\n var goly_dostane=0;\n var body=0;\n var vitazstva=0;\n var prehry=0;\n var remizy=0;\n var skupina=\"\";\n var pocitadlo=0;\n var vysledne_pole=[];\n pole=zorad_tabulku_podla_abecedy();\n for(var i=0; i<pole.length; i++)\n {\n pocitadlo=0;\n goly_dane=0;\n goly_dostane=0;\n body=0;\n vitazstva=0;\n prehry=0;\n remizy=0;\n odohrane=0;\n skupina=\"\"\n id_tymu=pole[i][1];\n for(var j=0; j<zapasy.length; j++)\n {\n if(zapasy[j][1]==aktualny_turnaj_id || all==1)\n {\n if(zapasy[j][3]==id_tymu)\n {\n pocitadlo++;\n if(zapasy[j][7]!=undefined && all!=1)skupina=zapasy[j][7];\n if(skupina!=\"\"&&zapasy[j][7]==undefined && all!=1)continue;\n \n if(zapasy[j][5]!=\"-\"&&zapasy[j][6]!=\"-\")\n {\n zapasy[j][5]=parseInt(zapasy[j][5], 10);\n zapasy[j][6]=parseInt(zapasy[j][6], 10);\n \n odohrane++;\n goly_dane=goly_dane+zapasy[j][5];\n goly_dostane=goly_dostane+zapasy[j][6];\n if(zapasy[j][5]>zapasy[j][6])\n {\n vitazstva++;\n body=body+parseInt(localStorage.pocet_bodov_za_vyhru, 10);\n }\n else if(zapasy[j][5]==zapasy[j][6])\n {\n remizy++;\n body=body+parseInt(localStorage.pocet_bodov_za_remizu, 10);\n }\n else \n {\n prehry++;\n body=body+parseInt(localStorage.pocet_bodov_za_prehru, 10);\n }\n }\n }\n else if(zapasy[j][4]==id_tymu)\n {\n pocitadlo++;\n if(zapasy[j][7]!=undefined)skupina=zapasy[j][7];\n if(skupina!=\"\"&&zapasy[j][7]==undefined)continue;\n \n if(zapasy[j][5]!=\"-\"&&zapasy[j][6]!=\"-\")\n {\n zapasy[j][5]=parseInt(zapasy[j][5], 10);\n zapasy[j][6]=parseInt(zapasy[j][6], 10);\n odohrane++;\n goly_dane=goly_dane+zapasy[j][6];\n goly_dostane=goly_dostane+zapasy[j][5];\n if(zapasy[j][6]>zapasy[j][5])\n {\n vitazstva++;\n body=body+parseInt(localStorage.pocet_bodov_za_vyhru, 10);\n }\n else if(zapasy[j][6]==zapasy[j][5])\n {\n remizy++;\n body=body+parseInt(localStorage.pocet_bodov_za_remizu, 10);\n }\n else \n {\n prehry++;\n body=body+parseInt(localStorage.pocet_bodov_za_prehru, 10);\n }\n }\n }\n }\n }\n if (pocitadlo>0)vysledne_pole.push([ziskaj_nazov_tymu_z_id(id_tymu), id_tymu, odohrane, goly_dane, goly_dostane, vitazstva, remizy, prehry, body,skupina]);\n }\n return vysledne_pole;\n}", "title": "" }, { "docid": "b8a5e3a5183ae81e4426f90406fe25ab", "score": "0.6528524", "text": "function etsiAsemaSaapumis() {\n $.each(kaikkiAsemat, function (indexInArray, valueOfElement) {\n if (this.stationName == saapumisAsema) {\n saapumisAsemaLyhenne = this.stationShortCode;\n la_loppu = this.latitude\n lo_loppu = this.longitude\n }\n });\n }", "title": "" }, { "docid": "90e9211ae2e05616cb9af939c9b7d3fc", "score": "0.6441214", "text": "function naytaTaulukko(){\n\t\tvar tuloste=\"\";\n\t\tvar otsikot=[];\n\t\tvar arvo;\n\n\t\ttuloste = \"<table>\";\n\t\ttuloste += \"<tr>\";\n\t\t\n\t\t//taulukoi html -taulukon otsikot, jotka ovat\n\t\t//myös samalla arvoparien nimet\n\t\tfor (x in tiedot[0]){\n\t\t\ttuloste +=\"<th>\"+x+\"</th>\";\n\t\t\totsikot.push(x);\n\t\t}\n\t\ttuloste += \"</tr>\";\n\t\t\n\t\t//Html-taulukon solut \n\t\tfor (var i=0;i<tiedot.length;i++){\t\t\t\n\t\t\ttuloste +=\"<tr>\";\t\t\n\t\t\tfor (var j=0;j<otsikot.length;j++){\t//arvot html -taulukon soluihin\n\t\t\t\tarvo=tiedot[i][otsikot[j]];\t\t//yksittäinen arvo\n\t\t\t\tif (isNaN(arvo)){\t\t\t\t//arvon tyylimäärittely sen tietotyypin perusteella\n\t\t\t\t\ttuloste +='<td class=\"teksti\">'+arvo+'</td>';\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttuloste +='<td class=\"numero\">'+arvo+'</td>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\ttuloste +=\"</tr>\";\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\ttuloste += \"</table>\";\n\t\t$tulostus.append(tuloste);\t//valmiin html -taulukon tulostus\t\n}", "title": "" }, { "docid": "acf03b4935dacca5403c0a49586df4ee", "score": "0.6332732", "text": "function hitungLuasSegiEmpat(sisi){\n //tidak ada nilai balik\n var luas = sisi * sisi\n return luas\n\n}", "title": "" }, { "docid": "c9226d8b61b8fe24c60c41532c8f13cb", "score": "0.6312669", "text": "function ucitavanjePodatakaImpl() {\r\n var JSONrez;\r\n //console.log(\"Za test\");\r\n var xhttp = new XMLHttpRequest();\r\n xhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n JSONrez = JSON.parse(this.responseText);\r\n Kalendar.ucitajPodatke(JSONrez.periodicna, JSONrez.vanredna);\r\n }\r\n };\r\n xhttp.open(\"GET\", \"/zauzeca.json\", true);\r\n xhttp.send();\r\n }", "title": "" }, { "docid": "32b58533cc07be97e03a8c92be64e635", "score": "0.63038814", "text": "function vypis_tabulky_turnaj()\n{\n for(var i=0; i<aktualny_turnaj_pocet_skupin;i++)\n {\n var tabulka=ziskaj_tabulku_podla_zapasov();\n zorad_tabulku_podla_bodov(tabulka);\n }\n}", "title": "" }, { "docid": "b903b23fe273d83208f36662b04fdbe8", "score": "0.62776554", "text": "controlla() {\n for (var j = 0; j < pallino.length; j++) {\n this.urtoPallino(pallino[j]);\n }\n this.urtoParete();\n if (new Date().getTime() - this.tempo > tempoguarigione && this.tempo > 0) {\n this.stato = 2;\n }\n }", "title": "" }, { "docid": "95cdb286730a332803aac67484f47643", "score": "0.6243855", "text": "function stampaOverview(dati) {\n var risultato;\n if (dati == \"\"){\n risultato = \"Siamo spiacenti, overview non disponibile.\";\n } else {\n risultato = dati;\n }\n return risultato;\n }", "title": "" }, { "docid": "0faa50da755d820e71a80e483e64506c", "score": "0.62234956", "text": "function tarkistaPari() {\n let ovatPari = ekaKortti.dataset.kehys === tokaKortti.dataset.kehys;\n //jos kortit ovat pari estetään niitä kääntymästä ja\n //jos kortit eivät ole pari käännetään ne takaisin\n ovatPari ? disable() : unflip();\n}", "title": "" }, { "docid": "76c2bf348a9d58eb0ca3609f7935b893", "score": "0.6206532", "text": "function exibePalavra() {\n\t\tvar posicoesPalavra = doc.querySelectorAll('.posicao-letra');\n\t\tposicoesPalavra.forEach(function(pos) {\n\t\t\tpos.value = pos.dataset.letraValue;\n\t\t});\n\t}", "title": "" }, { "docid": "9a9d7bfca7872884a4288358fa999454", "score": "0.6183483", "text": "function joukkueenData() {\n let joukkue = {\n nimi: \"\",\n jasenet: [],\n id: -1,\n rastit: [],\n leimaustapa: []\n };\n\n joukkue.nimi = document.getElementById('nimi').value.trim();\n\n joukkue.leimaustapa = leimaustavat;\n\n let sarja;\n let sarjat = document.getElementsByName('sarja');\n for (let alkio of sarjat) {\n if (alkio.checked) {\n sarja = alkio.value;\n }\n }\n\n joukkue.id = palautaSeuraavaValidiId();\n\n joukkue.jasenet = [\"Foo Bar\", \"Bar Foo\"];\n\n lisaaJoukkue(joukkue, sarja);\n\n}", "title": "" }, { "docid": "bdd49fc886dfeb5886eb72ef563883c2", "score": "0.6144265", "text": "function Predizione() {\n //carico i coefficienti, medie e madiane\n coefficienti = CaricaJSON('Standardizzazione.txt');\n medie = coefficienti[0];\n std = coefficienti[1];\n coefficienti = coefficienti[2];\n\n //carico allenamenti\n allenamento = CalcolaAllenamento(LeggiEsercizi());\n\n // carico dati giocatori\n giocatori = CaricaJSON('Giocatori.txt');\n\n //cambio nome alle collone (tolgo '_mean')\n keys = getKeys(allenamento)\n for (i in keys) {\n key_ = keys[i];\n key = key_.split('_')[0];\n allenamento[key] = allenamento[key_];\n delete allenamento[key_];\n }\n //console.log(JSON.stringify(allenamento));\n\n //unisco giocatori e allenamento previsto\n db_gioc_all = []\n for (i in giocatori) {\n giocatore = giocatori[i]\n db_gioc_all.push({...giocatore,\n ...allenamento\n });\n }\n //console.log(JSON.stringify(db_gioc_all));\n\n //standardizzo i dati\n db_gioc_all_std = [];\n for (i in db_gioc_all) {\n record = db_gioc_all[i];\n\n keys = getKeys(record)\n for (i in keys) {\n key = keys[i];\n if (!(key === 'playerName')) //problema con playername\n {\n record[key] = (record[key] - medie[key]) / std[key];\n }\n }\n db_gioc_all_std.push(record);\n }\n //console.log(JSON.stringify(db_gioc_all_std));\n\n //faccio previsioni\n db_gioc_all_std_prev = [];\n for (i in db_gioc_all_std) {\n record = db_gioc_all_std[i];\n keys = getKeys(record)\n\n record['Go_score+1'] = 0\n\n for (i in keys) {\n\n key = keys[i];\n if (!(key === 'playerName')) //problema con playername\n {\n record['Go_score+1'] += record[key] * coefficienti[key];\n }\n }\n\n db_gioc_all_std_prev.push(record);\n }\n //console.log(JSON.stringify(db_gioc_all_std_prev));\n\n //standardizzazione inversa\n db_gioc_all_prev = [];\n for (i in db_gioc_all_std_prev) {\n record = db_gioc_all_std_prev[i];\n\n keys = getKeys(record)\n\n for (i in keys) {\n key = keys[i];\n if (!(key === 'playerName')) //problema con playername\n {\n record[key] = (record[key] * std[key]) + medie[key];\n }\n }\n db_gioc_all_prev.push(record);\n }\n //console.log(JSON.stringify(db_gioc_all_prev));\n\n return db_gioc_all_prev;\n}", "title": "" }, { "docid": "dd56302add266daceb4ce7ea222e6a0b", "score": "0.61046624", "text": "function hitungLuasPersegiPanjang(panjang,lebar){\n //tidak memiliki nilai balik\n var luas = panjang * lebar\n return luas\n}", "title": "" }, { "docid": "95d87c5dec6cc597294dd62c0905612e", "score": "0.6059411", "text": "function intandactData() {\n return [\n { \n \"label\": \"Cruisin\",\n \"value\" : 5.99\n } , \n { \n \"label\": \"Snowmobile\",\n \"value\" : 33.9\n } , \n { \n \"label\": \"Harley\",\n \"value\" : 5.55\n } , \n { \n \"label\": \"Racing\",\n \"value\" : 15.48\n } , \n { \n \"label\": \"Street\",\n \"value\" : 11.89\n } , \n { \n \"label\": \"Tourism\",\n \"value\" : 9.29\n } \n ];\n }", "title": "" }, { "docid": "cf6f90a0c01f7d0c7ec3796fc260caff", "score": "0.60578215", "text": "function datos(){\n\n\t\n\tvar balyu = document.getElementById(\"select1\").value;\n\n\tfetch('https://disease.sh/v2/countries/' + balyu)\n\t.then((resp) => resp.json()) // Transform the data into json\n\t.then( data => { \n\n\t\t// ibalik ang nawala \n\n\n\t\t\n\t\terrorto.style.display=\"none\";\t \n\t\tupdated.style.display = \"block\"; \n\t\tconfirma.style.display = \"block\";\t \n\t\trecover.style.display = \"block\"; \n\t\tded.style.display = \"block\";\t\t\n\t\t//deyt.style.display = \"block\"; \n\n // data grab\n\t\t \n\t\tvar ca = data.updated; // date \tnaka epoch pa ito\t\n\t\tvar cb = data.cases; // confirmed cases\n\t\tvar cd = data.recovered; // recovered cases\n\t\tvar ce = data.deaths; // deds cases\n\n\n\t\tvar zz = data.todayCases;\n\t\tvar qwr = data.active;\n\t\tvar pop = data.tests;\n\t\tvar zzz = data.todayDeaths;\n\t\tvar zzzz = data.critical;\n\n\t\t// kulay \n\n\t\tvar ty = konvert.format(zz).toString().fontcolor(\"#FFEEAA\");\n\t\tvar yyt = konvert.format(qwr).toString().fontcolor(\"#FFEEAA\");\n\t\tvar tty = konvert.format(zzz).toString().fontcolor(\"#e53935\"); // red\n\t\tvar popi = konvert.format(pop).toString().fontcolor(\"#FFEEAA\");\n\t\tvar ttyy = konvert.format(zzzz).toString().fontcolor(\"#f44336\"); // crtitical\n\n\n\n\t\t// plus color \n\t\t\n\t\tvar plas = (\"+\").fontcolor(\"#00CCCC\");\n\t\t\n\n\n\t\t// data post \n\n\t\tupdated.innerHTML = \"</br>\" + moment(ca).format('LLL').fontcolor(\"EC826A\") + \"</br>\" + \"Last Update \";\n\t\tkon.innerHTML = \"<br>\" + konvert.format(cb); \n\t\trek.innerHTML = \"<br>\" + konvert.format(cd);\n\t\toww.innerHTML = \"<br>\" + konvert.format(ce);\t\t\n\t\tabangwan.innerHTML = \"New Cases \" + plas + ty;\n\t\tabangwana.innerHTML = \"Active Cases \" + yyt;\n\t\tabangtwon.innerHTML = \"Number of Tested \" + popi + \"</br></br>\";\n\t\tabangtres.innerHTML = \"New Deaths \" + plas + tty;\n\t\tabangkwatro.innerHTML = \"Critical \" + ttyy;\n\n\t\t\n\n\n\t\n\t\n\t\t\n\n\t})\t\n} // end of datos function", "title": "" }, { "docid": "9305567e593d69ea8bbff19caf245fe4", "score": "0.6051979", "text": "function loadDataDonViTinh() {\n $scope.donViTinh = [];\n if (!tempDataService.tempData('donViTinh')) {\n donViTinhService.getAllData().then(function (successRes) {\n if (successRes && successRes.status === 200 && successRes.data && successRes.data.Status && successRes.data.Data && successRes.data.Data.length > 0) {\n tempDataService.putTempData('donViTinh', successRes.data.Data);\n $scope.donViTinh = successRes.data.Data;\n }\n }, function (errorRes) {\n console.log('errorRes', errorRes);\n });\n } else {\n $scope.donViTinh = tempDataService.tempData('donViTinh');\n }\n }", "title": "" }, { "docid": "9305567e593d69ea8bbff19caf245fe4", "score": "0.6051979", "text": "function loadDataDonViTinh() {\n $scope.donViTinh = [];\n if (!tempDataService.tempData('donViTinh')) {\n donViTinhService.getAllData().then(function (successRes) {\n if (successRes && successRes.status === 200 && successRes.data && successRes.data.Status && successRes.data.Data && successRes.data.Data.length > 0) {\n tempDataService.putTempData('donViTinh', successRes.data.Data);\n $scope.donViTinh = successRes.data.Data;\n }\n }, function (errorRes) {\n console.log('errorRes', errorRes);\n });\n } else {\n $scope.donViTinh = tempDataService.tempData('donViTinh');\n }\n }", "title": "" }, { "docid": "5c2b817b3e6e71c51728e1eba3989b5a", "score": "0.60505426", "text": "function ucitajCitate()\n{\n var citati = [];\n // iz nekog razloga mora GET\n dobaviPodatke(\"GET\", \"data/citati.json\", true, function (podaci)\n {\n var citatiJSON = JSON.parse(podaci);\n for(var i = 0; i < citatiJSON.length; i++)\n citati.push(citatiJSON[i].sadrzaj);\n });\n return citati;\n}", "title": "" }, { "docid": "8afc3a123c900440b4b0cc4e7b5b089a", "score": "0.6044324", "text": "function kiesRaadsel(){\n let getal = willekeurigGetal(0,29);\n mijnParagraaf.innerHTML = mijnRaadsels[getal];\n mijnKnop.innerHTML = \"Volgend raadsel!\";\n}", "title": "" }, { "docid": "4bfc3d58b411966ba1a8431b6470ef71", "score": "0.60403496", "text": "function trazi() {\n var temp = [];\n for (let i = 0; i < self.todos.length; i++) {\n \n var valid = self.todos[i].zadatak;\n var valid2 = self.todos[i].opis;\n var valid3 = self.todos[i].id;\n \n // ako je našao riječ iz input polja u key value objecta u arrayu todos (pretvoreno u lower case) \n if (valid.toLowerCase().includes(self.zadatakIme)) {\n temp.push(self.todos[i]);\n } else if (valid2.toLowerCase().includes(self.zadatakOpis)) {\n temp.push(self.todos[i]);\n } else if (valid3.toString().includes(self.zadatakId)) { // valid3 je broj, zato treba toString()\n temp.push(self.todos[i]);\n }\n }\n if (temp.length > 0) { // ako je našao u bilo kojoj rubrici ubaci rezultat u array todos\n self.todos = temp;\n }\n }", "title": "" }, { "docid": "6bdf38a4bbe5c0ab2ac045fb28939f20", "score": "0.60254335", "text": "function singole_vendite(vendite) {\r\n //Creo L'oggetto totale_vendite dove andare ad inserire i dati recuperati delle vendite\r\n var totale_vendite = {};\r\n\r\n var somma_totale_vendite = 0;\r\n\r\n //Imposto un ciclo for per andare a prendere i dati relativi ai singoli venditori\r\n for (var i = 0; i < vendite.length; i++) {\r\n var dati_vendite = vendite[i]\r\n //console.log(dati_vendite);\r\n var cifra_vendita = parseInt(dati_vendite.amount);\r\n //console.log(cifra_vendita);\r\n var venditori = dati_vendite.salesman;\r\n //console.log(venditori);\r\n\r\n //Imposto le condizioni per verificare se nell'oggetto sia già presente la chiave del singolo venditore\r\n if(!totale_vendite.hasOwnProperty(venditori)) {\r\n //Se il venditore non è presente viene creata una nuova chiave con il valore del venditore corrente\r\n totale_vendite[venditori] = cifra_vendita;\r\n } else {\r\n //Se il venditore è già presente viene sommato la cifra delle vendita corrente a quella delle precedenti\r\n totale_vendite[venditori] += cifra_vendita;\r\n }\r\n //console.log(totale_vendite);\r\n somma_totale_vendite += cifra_vendita;\r\n }\r\n\r\n for (var vendita in totale_vendite) {\r\n var importo_venditore = totale_vendite[vendita];\r\n var percentuale = (importo_venditore * 100 / somma_totale_vendite).toFixed(1);\r\n totale_vendite[vendita] = percentuale;\r\n }\r\n\r\n //Recupero le chiavi dell'oggetto\r\n var keys = Object.keys(totale_vendite);\r\n //Recupero il valore delle chiavi dell'oggetto\r\n var values = Object.values(totale_vendite);\r\n scrivi_venditore(keys);\r\n\r\n //Richiamo il grafico per andare ad inserire i dati\r\n grafico_venditori(keys, values);\r\n\r\n }", "title": "" }, { "docid": "085361354c8046ad7b8e90a0f1ef2854", "score": "0.6022805", "text": "function taobangsua()\r\n{\r\n\t \t\tvar data = {};\r\n\t\t\tvar theme = '';\r\n\t\t\tvar manoidung='';\r\n\t\t\tvar ma='';\r\n\t\t\t//var data = {};\r\n\t\t\tma = $(\"#cbo_tenphieumausua\").val();\r\n\t\t\tvar theme = '';\r\n\t\t\tvar params= \"maphieu=\" + ma;\r\n\t\t\thttp=GetXmlHttpObject();\r\n\t\t\thttp.open(\"POST\",'get_info_noidungsua.php', false);\r\n\t\t\thttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\r\n\t\t\thttp.onreadystatechange = function()\r\n\t\t\t{\r\n\t\t\t\tif(http.readyState == 4 && http.status == 200) \r\n\t\t\t\t{\r\n\t\t\t\t\tvar x=http.responseXML.getElementsByTagName('INFO');\r\n\t\t\t\t\tfor(var i=0;i<x.length;i++)//lay duoc danh sach cac quyen ma can bo (macanbo) co\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar row = {};\r\n\t\t\t\t\t//\talert(x[i].getElementsByTagName('RESULT2')[1].firstChild.nodeValue);\r\n\t\t\t\t\t\t//row[\"stt\"] = i + 1;\r\n\t\t\t\t\t\trow[\"mandsua\"] = x[i].getElementsByTagName('RESULT')[0].firstChild.nodeValue;\r\n\t\t\t\t\t\trow[\"tenndsua\"] = x[i].getElementsByTagName('RESULT')[1].firstChild.nodeValue;\r\n\t\t\t\t\t\trow[\"ghichusua\"] = x[i].getElementsByTagName('RESULT')[2].firstChild.nodeValue;\r\n\t\t\t\t\t\t//row[\"tenndcon\"] = x[i].getElementsByTagName('RESULT')[0].firstChild.nodeValue;\t\t\t\t\t\t\r\n\t\t\t\t\t\tdata[i] = row;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\thttp.send(params);\r\n\t\t\tvar source =\r\n {\r\n localdata: data,\r\n\t\t\t\tdatatype: \"array\",\r\n };\r\n /* var source =\r\n {\r\n datatype: \"json\",\r\n datafields: \r\n\t\t\t\t [\r\n\t\t\t\t \t//{ name: 'stt' },\r\n { name: 'mandsua' },\r\n { name: 'tenndsua' },\r\n { name: 'ghichusua' },\r\n ],\t\t\t\t\r\n\t\t\t\tid: 'mandsua', \r\n\t\t\t\troot: 'Rows',\r\n\t\t\t\t//url: url,\r\n\t\t\t\tbeforeprocessing: function(data)\r\n\t\t\t\t{\t\t\r\n\t\t\t\t\tsource.totalrecords = data[0].TotalRows;\r\n\t\t\t\t},\t\t\t\t\t\t\r\n };*/\r\n\t\t\t\r\n \t\t var dataadapter = new $.jqx.dataAdapter(source);\r\n // initialize jqxGrid\r\n $(\"#jqsua\").jqxGrid(\r\n {\r\n width: 550,\r\n source: dataadapter,\r\n\t\t\t\teditable: true,\r\n theme: theme,\r\n\t\t\t\tautoheight: true,\r\n\t\t\t\tpageable: true,\r\n columnsresize: true,\r\n columns: [\r\n\t\t\t\t\t { text: 'Mã nội dung', editable: false, datafield: 'mandsua', width: 150, cellsalign: 'center' },\r\n\t\t\t\t\t { text: 'Tên nội dung', editable: false, datafield: 'tenndsua', width: 150, cellsalign: 'center' },\r\n { text: 'Ghi chú', editable: false, datafield: 'ghichusua', width: 250, cellsalign: 'center' },\r\n ]\r\n });\r\n\t\t\t//chon 1 dong\r\n\t\t\t$(\"#jqsua\").jqxGrid('selectionmode', 'singlerow');\r\n\t\t\t$('#jqsua').bind('rowselect', function (event) \r\n\t\t\t{\r\n\t\t\t\tvar args = event.args;\r\n\t\t\t\tvar row = args.rowindex;\r\n\t\t\t\tmanoidung = $('#jqsua').jqxGrid('getcellvalue', row, \"mandsua\");\r\n\t\t\t});\r\n// delete row.***************************************************************************************************************************\r\n $(\"#deleterowbutton2\").bind('click', function () \r\n\t\t\t{\r\n\t\t\t\tvar data = \"delete=true&MaPhieu=\" +ma +\"&MaND=\" + manoidung; \r\n\t\t\t\t$.ajax\r\n\t\t\t\t({\r\n\t\t\t\t\tdataType: 'json',\r\n\t\t\t\t\turl: 'delete_noidungphieumau.php',\r\n\t\t\t\t\tdata: data,\r\n\t\t\t\t\tsuccess: function (data, status, xhr) {}\t\t\r\n\t\t\t\t})\r\n\t\t\t\tvar selectedrowindex = $(\"#jqsua\").jqxGrid('getselectedrowindex');\r\n var rowscount = $(\"#jqsua\").jqxGrid('getdatainformation').rowscount;\r\n if (selectedrowindex >= 0 && selectedrowindex < rowscount) {\r\n var id = $(\"#jqsua\").jqxGrid('getrowid', selectedrowindex);\r\n $(\"#jqsua\").jqxGrid('deleterow', id);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\talert(\"Bạn chưa chọn nội dung cần xóa!\");\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\t\r\n });\t\t\r\n\t\t\t\r\n\tfunction capitaliseFirstLetter2(string) \r\n\t\t{\r\n return string.charAt(0).toUpperCase() + string.slice(1);\r\n }\r\n\t\t\r\n//tao popup hiện thị data trong bang noidung de chọn *******************************************************************************************\r\n\t\tfunction createElements2(theme)\r\n\t\t{\r\n $('#cancel2').jqxButton({ theme: theme, height: '25px', width: '65px' });\r\n $('#eventWindow2').jqxWindow({ maxHeight: 400, maxWidth:400, minHeight: 30, minWidth: 150, height: 300, width: 400,\r\n theme: theme, resizable: false, modalOpacity: 0.3,\r\n okButton: $('#save2'), cancelButton: $('#cancel2')\r\n });\r\n }\r\n function addEventListeners2() \r\n\t\t{\r\n $('#showWindowButton2').mousedown(function () \r\n\t\t\t{\r\n\t\t\t\tcreateElements2(theme);\r\n $('#eventWindow2').jqxWindow('show');\r\n// lấy dữ liệu tử bang noidung đưa lên bảng trong popup ***************************************************************************************\r\n\t\t\t\tvar source2 =\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdatatype: \"json\",\r\n\t\t\t\t\t\tdatafields: \r\n\t\t\t\t\t\t[\r\n\t\t\t\t\t\t\t//{ name: 'stt' },\r\n \t\t{ name: 'mandsua' },\r\n \t\t\t{ name: 'tenndsua' },\r\n \t\t{ name: 'ghichusua' },\r\n\t\t\t\t\t\t],\r\n\t\t\t\t\t\tid: 'mandsua',\r\n\t\t\t\t\t\turl: 'get_info_noidung_phieumau.php', \r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar dataAdapter3 = new $.jqx.dataAdapter(source2);\r\n\t\t\t\t\t$(\"#jqxWidget2\").jqxGrid(\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\twidth: 350,\r\n\t\t\t\t\t\tselectionmode: 'singlerow',\r\n\t\t\t\t\t\tsource: dataAdapter3,\r\n\t\t\t\t\t\ttheme: theme,\r\n\t\t\t\t\t\teditable: true,\r\n\t\t\t\t\t\tautoheight: true, \r\n\t\t\t\t\t\tcolumns: [\r\n\t\t\t\t\t \t\t\t{ text: 'Mã nội dung', editable: false, datafield: 'mandsua', width: 100, cellsalign: 'center' },\r\n\t\t\t\t\t\t\t \t{ text: 'Tên nội dung', editable: false, datafield: 'tenndsua', width: 100, cellsalign: 'center' },\r\n \t\t\t{ text: 'Ghi chú', editable: false, datafield: 'ghichusua', width: 180, cellsalign: 'center' },\r\n\t\t\t\t\t\t ]\r\n\t\t\t\t\t});\r\n });\r\n } \r\n// Select 1 dong tren popup roi đổ qua bảng lớn*************************************************************************************************\r\n \t\t$('#jqxWidget2').bind('rowclick', function (event) \r\n\t\t{\r\n\t\t\tvar args = event.args;\r\n\t\t\tvar row = args.rowindex;\r\n\t\t\tvar data = $('#jqxWidget2').jqxGrid('getrowdata',row);\r\n\t\t\tmanoidung = $('#jqxWidget2').jqxGrid('getcellvalue', row, \"mandsua\");\r\n\t\t\tvar i = 0,them=1;\r\n\t \tvar rowscount = $(\"#jqsua\").jqxGrid('getdatainformation').rowscount;\r\n\t\t\tfor(i;i < rowscount;i++) \r\n\t\t\t{\r\n\t\t\t\t var manoidung2 = $('#jqsua').jqxGrid('getcellvalue', i, \"mandsua\");\r\n\t\t\t\t if(manoidung2==manoidung)\r\n\t\t\t\t {\r\n\t\t\t\t\t\tthem=0;\r\n\t\t\t\t }\r\n }\r\n// add vao bang co lớn (Không phải popup)*******************************************************************************************************\r\n\t\t\tif(them==1)\r\n\t\t\t{\r\n\t\t\t\t$('#jqsua').jqxGrid('addrow',null, data);\r\n\t\t\t}\r\n\t\t\telse{alert('Đã tồn tại tên nội dung này!!!.');}\r\n\t\t});\r\n// Chỉnh sửa size cua 2 button thêm và xóa******************************************************************************************************\r\n\t$(document).ready(function () {\r\n var theme = $.data(document.body, 'theme', theme);\r\n if (theme == undefined) theme = '';\r\n addEventListeners2();\r\n\t\t\t$('#showWindowButton2').jqxButton({ theme: theme, width: '150px', height: '25px' });\r\n\t\t\t$(\"#deleterowbutton2\").jqxButton({ theme: theme, width: '150px', height: '25px' });\r\n $(\"#jqxWidget3\").css('visibility', 'visible');\r\n });\r\n// su kiện khi click vao nút luu phiếu mẫu *****************************************************************************************************\r\n\t\t$(\"#btn_luuphieumau\").unbind(\"click\").click(function()\r\n\t\t{\r\n\t\t\tvar rowcount4 = $(\"#jqsua\").jqxGrid('getdatainformation').rowscount;\r\n\t\t\t if($(\"#txt_tenphieumaumoi\").val()==\"\") {\r\n\t\t\t\t\talert(\"Bạn chưa nhập tên phiếu mẫu mới!\"),\r\n\t\t\t\t\tFocusAndSelect(\"#txt_tenphieumaumới\");\r\n\t\t\t}else if($(\"#cbo_ngaysua\").val()==-1) {\r\n\t\t\t\t\talert(\"Bạn chưa nhập ngày!\"),\r\n\t\t\t\t\tFocusAndSelect(\"#cbo_ngaysua\");\r\n\t\t\t}else if($(\"#cbo_thangsua\").val()==-1) {\r\n\t\t\t\t\talert(\"Bạn chưa nhập tháng!\"),\r\n\t\t\t\t\tFocusAndSelect(\"#cbo_thangsua\");\r\n\t\t\t}else if($(\"#cbo_namsua\").val()==-1) {\r\n\t\t\t\t\talert(\"Bạn chưa nhập năm!\"),\r\n\t\t\t\t\tFocusAndSelect(\"#cbo_namsua\");\r\n\t\t\t}\r\n\t\t\telse if(check_date_ngaysinh($(\"#cbo_ngaysua option:selected\").val(),$(\"#cbo_thangsua option:selected\").val(),$(\"#cbo_namsua option:selected\").val())){\r\n\t\t\t\t\talert(\"Ngày tháng năm không hợp lệ.\");FocusAndSelect(\"#cbo_ngaysua\");\r\n\t\t\t}\r\n\t\t\t else if(rowcount4==0){\r\n\t\t\t\t\talert(\"Bạn chưa chọn nội dung cho phiếu mẫu!\");\r\n\t\t\t}else{\t\t\t // synchronize with the server - send update command\r\n\t\t\t\tvar data1=\"&tenphieumaumoi=\" +$(\"#txt_tenphieumaumoi\").val() + \"&ngay=\" + $(\"#cbo_ngaysua\").val()+ \"&thang=\" + $(\"#cbo_thangsua\").val() + \"&nam=\"+ $(\"#cbo_namsua\").val() + \"&ghichu=\"+$(\"#txt_ghichusua\").val() + \"&maphieu=\"+ma;\r\n\t\t\t\t$.ajax\r\n\t\t\t\t\t({\r\n\t\t\t\t\t\tdataType: 'json',\r\n\t\t\t\t\t\turl: 'suaphieumau.php',//them phiếu mẫu mới vào bảng phiếu mẫu\r\n\t\t\t\t\t\tdata: data1,\r\n\t\t\t\t\t\tsuccess: function (data, status, xhr)\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\tfor(var m=0;m<rowcount4;m++){\r\n\t\t\t\t\t\tvar mand = $('#jqsua').jqxGrid('getcellvalue', m,'mandsua');\r\n\t\t\t\t\t\tvar data = \"update=true&mand=\" + mand + \"&maphieu=\"+ma;\r\n\t\t\t\t\t$.ajax\r\n\t\t\t\t\t({\r\n\t\t\t\t\t\tdataType: 'json',\r\n\t\t\t\t\t\turl: 'sua_noidung.php',//them nội dung vào bảng thuocphieumau\r\n\t\t\t\t\t\tdata: data,\r\n\t\t\t\t\t\tsuccess: function (data, status, xhr)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\t\t\r\n }\r\n\t\t\t\talert(\"Sửa phiếu mẫu thành công!\");\r\n\t\t\t\twindow.location.reload(true);\t\t\r\n\t\t\t}\r\n\t\t});\r\n}", "title": "" }, { "docid": "487ac5835ca65a3dc91ce4752d2124a7", "score": "0.60191387", "text": "majvelo() {\n var attributId = $('.boutton').attr('id'); //On récupère l'id de la station\n systeme.tableauStation[attributId].velodisponible = systeme.tableauStation[attributId].velodisponible - 1; //On enlève 1\n Maps.setMapOnAll(null);\n systeme.tableauMarker = [];\n if (typeof (window.info) != 'undefined') info.close();\n for (let i = 0; i < systeme.tableauStation.length; i++) {\n systeme.Marqueur(systeme.tableauStation[i])\n }\n }", "title": "" }, { "docid": "494c94bb2dd99cbbcbc5d8ade2ef22c0", "score": "0.60062015", "text": "function preracunavanjeOptimalnogTreninga() { }//U slucaju da imamo posla sa sirovinom koja dize 150 iz bendza", "title": "" }, { "docid": "41ea39eced7abf36acc6537a64bf0b0c", "score": "0.60018927", "text": "function setData() {\n\tvar rows = db.execute('SELECT agendasermao.id, agendasermao.igreja, igreja.nome FROM agendasermao INNER JOIN igreja ON agendasermao.igreja = igreja.id WHERE agendasermao.sermao =\"' + idSermao + '\" and status = \"i\" ORDER BY igreja.nome');\n\tvar dataArray = [];\n\n\twhile (rows.isValidRow()) {\n\t\tvar vnome = rows.fieldByName('nome');\n\t\tvar vid = rows.fieldByName('id');\n\t\tdataArray.push({\n\t\t\ttitle : vnome,\n\t\t\t//hasChild : true,\n\t\t\tid : vid,\n\t\t\tpath : 'detalhedistrito.js',\n\t\t\tcolor : '#245553',\n\t\t\tfont : {\n\t\t\t\tfontSize : 16,\n\t\t\t}\n\t\t});\n\t\trows.next();\n\t\ttableview.setData(dataArray);\n\t};\n}", "title": "" }, { "docid": "32c2244a6eada70d2bcd2d1666de52bd", "score": "0.59917414", "text": "function loadDataDonViTinh() {\n $scope.donViTinh = [];\n if (!tempDataService.tempData('donViTinh')) {\n donViTinhService.getAllData().then(function (successRes) {\n if (successRes && successRes.status === 200 && successRes.data && successRes.data.Status && successRes.data.Data && successRes.data.Data.length > 0) {\n tempDataService.putTempData('donViTinh', successRes.data.Data);\n $scope.donViTinh = successRes.data.Data;\n }\n }, function (errorRes) {\n console.log('errorRes', errorRes);\n });\n } else {\n $scope.donViTinh = tempDataService.tempData('donViTinh');\n }\n }", "title": "" }, { "docid": "d46b03809c9fdf502bae13c1845774d5", "score": "0.5983355", "text": "function limpaPrazoSemanal() {\n $scope.novoPrazoForn = {};\n $scope.novoPrazoFornSemanal = {};\n $scope.arrayPrazoSemana = [];\n $scope.estados = [];\n $scope.regioes = [];\n $scope.fornRegiaoCidades = [];\n $scope.fornRegiaoCidadesSemanal = [];\n loadEstado();\n $scope.arrayDiasSemana = [];\n $scope.arrayDiasSemana = [\n { Id: 1, DescDiaSemana: 'Segunda' },\n { Id: 2, DescDiaSemana: 'Terça' },\n { Id: 3, DescDiaSemana: 'Quarta' },\n { Id: 4, DescDiaSemana: 'Quinta' },\n { Id: 5, DescDiaSemana: 'Sexta' },\n { Id: 6, DescDiaSemana: 'Sábado' },\n { Id: 7, DescDiaSemana: 'Domingo' }\n ];\n }", "title": "" }, { "docid": "7a6fe5941e3aa082c518b81a04584a7b", "score": "0.5956512", "text": "function staviUkorpu(e) {\n // svakako pushuj u niz data atribut i upisi i u ls\n nizKnjigaUkorpi.push(e.target.getAttribute(\"data-ISBN\"));\n localStorage.setItem(\"nizKnjiga\", JSON.stringify(nizKnjigaUkorpi));\n\n //za konkretan isbn koje je dovucen iz data atributa (nizKnjigaUkorpi.length - 1)\n // dovuci podatke o konkretnoj knjzi\n //promenljivoj ukupnaVrednostKnjigaUKorpi dodaj vrednost cene konkretne knjige\n //to sve evidentiraj u local storage\n knjiga = vratiPodatkeNizKnjigaISBN(nizKnjigaUkorpi[nizKnjigaUkorpi.length - 1]);\n ukupnaVrednostKnjigaUKorpi += knjiga.Cena;\n localStorage.setItem(\"vrednostKnjigaUkorpi\", ukupnaVrednostKnjigaUKorpi);\n\n // nakon svega toga osvezi prikaz hedera sa podacima o broju knjiga u korpi\n upisiUheaderKorpa();\n}", "title": "" }, { "docid": "f0420871c9e941f0f9485ca868323b93", "score": "0.59560865", "text": "function ControlloDataInserita(datadafiltrare,dt) {\r\n\r\nvar gg; //variabile per i giorni\r\nvar mm; // variabile per i mesi\r\nvar yy; // variabile per l'anno\r\nvar dateNow = new Date(); // assegna la data corrente (presa dal pc locale)\r\nvar yearNow = dateNow.getFullYear(); //assegna l'anno corente\r\nvar indice=0; // variabile di servizio\r\n\r\nvar nrgiorni = new Array();\r\n\tnrgiorni[0]=29; // febbraio bisestile\r\n\tnrgiorni[1]=31; // gennaio\r\n\tnrgiorni[2]=28; // febbraio\r\n\tnrgiorni[3]=31; // marzo\r\n\tnrgiorni[4]=30;\t// aprile\r\n\tnrgiorni[5]=31; // maggio\r\n\tnrgiorni[6]=30; // giugno\r\n\tnrgiorni[7]=31; // luglio\r\n\tnrgiorni[8]=31; // agosto\r\n\tnrgiorni[9]=30; // settembre\r\n\tnrgiorni[10]=31; // ottobre\r\n\tnrgiorni[11]=30; // novembre\r\n\tnrgiorni[12]=31; // dicembre\r\n\r\nif (datadafiltrare.value==\"undefined\" || datadafiltrare.value==\"\") { //se il campo è vuoto esce dalla funzione\r\n datadafiltrare.style.color=\"#000088\";\r\n datadafiltrare.style.background=\"white\";\r\n return;\r\n}\r\n\r\nswitch (datadafiltrare.value.length) { //analizza il formato della data e prepara le variabili gg, mm, yy\r\n case is = 6: //formato data breve\r\n gg = datadafiltrare.value.slice(0,2);\r\n mm = datadafiltrare.value.slice(2,4);\r\n yy = datadafiltrare.value.slice(4,6);\r\n break; \r\n \r\n case is = 8: //formato data a 8 caratteri\r\n if (datadafiltrare.value.indexOf(\"/\") >= 0 || datadafiltrare.value.indexOf(\"-\")>=0) { //con separatori\r\n gg = datadafiltrare.value.slice(0,2);\r\n mm = datadafiltrare.value.slice(3,5);\r\n yy = datadafiltrare.value.slice(6,8);\r\n } else { //data a 8 cifre senza separatori\r\n gg = datadafiltrare.value.slice(0,2);\r\n mm = datadafiltrare.value.slice(2,4);\r\n yy = datadafiltrare.value.slice(4,8);\r\n }\r\n break;\r\n \r\n case is = 10: //formato data completa\r\n gg = datadafiltrare.value.slice(0,2);\r\n mm = datadafiltrare.value.slice(3,5);\r\n yy = datadafiltrare.value.slice(6,10);\r\n break;\r\n\r\n default: //negli altri formati inseriti la routine genera un errore\r\n alert(\"Attenzione! La data che hai inserito e' errata. Sono validi i seguenti formati: 'ggmmaa','gg/mm/aa','ggmmaaaa' e 'gg/mm/aaaa'\");\r\n datadafiltrare.focus();\r\n datadafiltrare.value=\"\";\r\n return datadafiltrare.value;\r\n}\r\n\r\n//controlla che i dati di riferimento al giorno, al mese e all'anno siano dati numerici \r\nif (isNaN(gg) || isNaN(mm) || isNaN(yy)) {\r\n\talert(\"Attenzione! La data che hai inserito e' errata.\");\r\n datadafiltrare.focus();\r\n datadafiltrare.value=\"\";\r\n return datadafiltrare.value;\r\n}\r\n\r\n//controlla che siano stati inseriti giusti tutti gli elementi che compongono la data\r\nif (Number(gg) <= 0 || Number(mm) <= 0 || Number(mm) > 12 || Number(yy) < 0) { \r\n alert(\"Attenzione! La data che hai inserito e' errata.\");\r\n datadafiltrare.focus();\r\n datadafiltrare.value=\"\";\r\n return datadafiltrare.value;\r\n}\r\n\r\n//porta l'anno a quattro cifre calcolando il cambio del millennio\r\nif (Number(yy) <= (Number(yearNow)-2000)) { \r\n yy = (Number(yy)+2000); \r\n } else if (Number(yy) < 100 && Number(yy) > (Number(yearNow)-2000)){\r\n yy = (Number(yy)+1900);\r\n }\r\n\r\n//controlla che l'anno non sia maggiore o uguale a quello corrente\r\n//(dt e dn significano data tesseramento e data di nascita)\r\nif (dt==\"dn\") {\r\n if (Number(yy) >= Number(yearNow)) { \r\n alert(\"Attenzione! L'anno che hai inserito e' errato!\");\r\n datadafiltrare.focus();\r\n datadafiltrare.value=\"\";\r\n return datadafiltrare.value;\r\n }\r\n}\r\n// controlla che l'anno inserito non sia bisestile e assegna il valore alla variabile indice\r\nif ((Number(yy) % 4) == 0 && Number(mm)==2) {\r\n\tindice=0;\r\n} else {\r\n\tindice=Number(mm);\r\n}\r\n\r\n// controlla che l'utente non abbia inserito un numero giorni del mese errato\r\nif (Number(gg) > nrgiorni[indice]) {\t\r\n\talert(\"Attenzione! La data che hai inserito e' errata.\");\r\n datadafiltrare.focus();\r\n datadafiltrare.value=\"\";\r\n return datadafiltrare.value;\r\n}\r\n// ricompone e stampa la data filtrata\r\ndatadafiltrare.value=gg+\"/\"+mm+\"/\"+yy;\r\ndatadafiltrare.style.color=\"#000088\";\r\ndatadafiltrare.style.background=\"white\";\r\nreturn datadafiltrare.value;\r\n}", "title": "" }, { "docid": "7ad99c300308306a4e9e066fc7ca8f00", "score": "0.5953544", "text": "function Wczytaj() {\n tablicaNotatek = JSON.parse(localStorage.getItem(\"tablica\")) || []\n Sortuj();\n}", "title": "" }, { "docid": "05f753cc7c85b541e6950588ae796a4e", "score": "0.5935249", "text": "function CapNhatDanhSachNhanVien() {\n // dom den tbody\n var CapNhat = document.getElementById('capnhatnhanvien');\n //Clear\n CapNhat.innerHTML = '';\n //Duyet mang\n for (var _i = 0, _a = dsnv.DanhSachNV; _i < _a.length; _i++) {\n var nv = _a[_i];\n var tdMaNV = taoTD(\"MaNV\", nv.MaNV);\n var tdHoTen = taoTD(\"HoTen\", nv.HoTen);\n var tdLuongCB = taoTD(\"MaNV\", nv.LuongCB);\n var tdLoaiNV = taoTD(\"MaNV\", nv.LayTenLoaiNhanVien());\n var tdTongLuong = taoTD(\"MaNV\", nv.TongLuong());\n //tao tr\n var trNhanVien = document.createElement('tr');\n trNhanVien.appendChild(tdMaNV);\n trNhanVien.appendChild(tdHoTen);\n trNhanVien.appendChild(tdLuongCB);\n trNhanVien.appendChild(tdLoaiNV);\n trNhanVien.appendChild(tdTongLuong);\n CapNhat.appendChild(trNhanVien);\n }\n}", "title": "" }, { "docid": "8a0de01c8bbdb820e45899513a0260a0", "score": "0.593256", "text": "function mostraStoricoIncassi(data){\n\t\n\tdata[0].giorno != undefined ? $(\"#giorno\").html(parseFloat(data[0].giorno).toFixed(2)+\"&euro;\") : $(\"#giorno\").html(\"0.00&euro;\");\n\tdata[1].settimana != undefined ? $(\"#settimana\").html(parseFloat(data[1].settimana).toFixed(2)+\"&euro;\"): $(\"#settimana\").html(\"0.00&euro;\");\n\tdata[2].mese != undefined ? $(\"#mese\").html(parseFloat(data[2].mese).toFixed(2)+\"&euro;\"): $(\"#mese\").html(\"0.00&euro;\");\n\tdata[3].anno != undefined ? $(\"#anno\").html(parseFloat(data[3].anno).toFixed(2)+\"&euro;\"): $(\"#anno\").html(\"0.00&euro;\");\n}", "title": "" }, { "docid": "1e4c1461371bbd099020d037ec74ab7a", "score": "0.5922618", "text": "function unificarDatos(data, id) {\n\n let datosMapa = [];\n var temp = [];\n\n data.forEach(function (item) {\n var pais = primeraMayuscula((item.Paisdeorigen).toLowerCase());\n datosMapa[pais] = datosMapa[pais] ? (datosMapa[pais] + 1) : 1;\n });\n\n datosMapa = Object.keys(datosMapa).map(function (pais) {\n return [pais, datosMapa[pais]];\n });\n\n $scope.datosImpo = data;\n\n temp.push(['Country', 'Exportador']);\n datosMapa.forEach((pais) => {\n temp.push(pais)\n });\n\n google.charts.load('upcoming', {'packages': ['geochart']});\n google.charts.setOnLoadCallback(drawRegionsMap);\n\n function drawRegionsMap() {\n debugger;\n console.log(temp);\n var data = google.visualization.arrayToDataTable(temp);\n var options = {};\n var chart = new google.visualization.GeoChart(document.getElementById(id));\n chart.draw(data, options);\n }\n }", "title": "" }, { "docid": "22d1e8b39bacd4af8898976bc632982e", "score": "0.59048975", "text": "function vykresli_tabulku(pole)\n{\n var pocitadlo=0;\n string=\"\";\n string+=\"<h1>\"+turnaje[aktualny_turnaj_id][1]+\"</h1>\";\n for(var i=0; i<aktualny_turnaj_pocet_skupin; i++)\n {\n if(aktualny_turnaj_pocet_skupin!=0 && aktualny_turnaj_typ==\"turnaj\")string+=\"<h2>\"+String.fromCharCode(i+65)+\" skupina</h2>\";\n string+=\"<table width=\\\"100%\\\"><tr><th>Č.</th><th>\"+lang_tim+\"</th><th>\"+lang_zapasov+\"</th><th>GF</th><th>GA</th><th>\"+lang_body+\"</th></tr>\";\n for(var j=0; j<pole.length;j++)\n {\n if(aktualny_turnaj_pocet_skupin==1 || pole[j][9]==String.fromCharCode(i+65))\n {\n string=string+\"<tr onClick=\\\"vypis_statistika_team_aktualny_turnaj(\"+pocitadlo+\");\\\"><td>\"+(j+1)+\".</td><td>\"+pole[j][0]+\"</td><td>\"+ pole[j][2] +\"</td><td>\"+ pole[j][3] +\"</td><td>\"+ pole[j][4] +\"</td><td>\"+ pole[j][8] +\"</td></tr>\";\n pocitadlo++;\n }\n }\n string=string+\"</table>\";\n }\n obsah_stranky[3][1]=string;\n}", "title": "" }, { "docid": "0a232f7b27a30738f91a097f94db6055", "score": "0.5886954", "text": "mediana(data)\n\t{\n\t\tlet size = data[3].length;\n\t\tlet result = 0;\n\n\t\t// Obtenemos Li\n\t\tlet sumaLi = 0;\n\t\tlet auxLi = 0;\n\t\tlet promedioLi = 0;\n\t\tlet controlLi = 0;\n\n\t\t// Obtenemos el promedio\n\t\tfor(let i = 0; i < size; i++){\n\t\t\tpromedioLi += data[3][i];\n\t\t}\n\t\tpromedioLi = promedioLi / 2;\n\n\t\tfor(let i = 0; i < size; i++){\n\t\t\tauxLi = sumaLi;\n\t\t\tsumaLi += data[3][i];\n\n\t\t\tif(sumaLi < promedioLi){\n\t\t\t\tcontrolLi++; // Aumentamos control\n\t\t\t} else {\n\t\t\t\tbreak; // Salimos\n\t\t\t}\n\t\t}\n\t\tcontrolLi--;\n\n\t\t// Calculamos el resultado\n\t\tresult = data[0][controlLi] + ((promedioLi - auxLi) / data[3][controlLi+1]) * (data[1][controlLi + 1] - data[0][controlLi + 1]);\n\n\t\treturn result;\n\t}", "title": "" }, { "docid": "a16bc19c93605b53f326bb2c9a5df1fe", "score": "0.5886376", "text": "function taobang(makhms)\r\n{\r\n\t\t\tvar data = {};\r\n\t\t\tvar data2 = {};\r\n\t\t\tvar data3 = {};\r\n\t\t\tvar theme = '';\r\n\t\t\tvar madonvi= '';\r\n\t\t\tvar tendonvi= '';\r\n\t\t\tvar mataisan= '';\r\n\t\t\tvar mataisan2= '';\r\n\t\t\tvar tongtien= 0;\r\n\t\t\t\r\n\t\t\thttp=GetXmlHttpObject();\r\n\t\t\tvar params = \"makhms=\" +makhms;\t\t\r\n\t\t\thttp.open(\"POST\", 'get_list_taisanthuocKHMS.php', false);\r\n\t\t\thttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\r\n\t\t\thttp.onreadystatechange = function()\r\n\t\t\t{\r\n\t\t\t\tif(http.readyState == 4 && http.status == 200) \r\n\t\t\t\t{\r\n\t\t\t\t\tvar x=http.responseXML.getElementsByTagName('row');\r\n\t\t\t\t\tfor(var i=0;i<x.length;i++)//lay duoc danh sach cac quyen ma can bo (macanbo) co\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar row = {};\r\n\t\t\t\t\t\trow[\"MaTaiSan\"] = x[i].getElementsByTagName('column')[0].firstChild.nodeValue;\r\n\t\t\t\t\t\trow[\"TenTaiSan\"] = x[i].getElementsByTagName('column')[1].firstChild.nodeValue;\r\n\t\t\t\t\t\trow[\"TinhNangKT\"] = x[i].getElementsByTagName('column')[2].firstChild.nodeValue;\r\n\t\t\t\t\t\trow[\"TenDVT\"] = x[i].getElementsByTagName('column')[3].firstChild.nodeValue;\r\n\t\t\t\t\t\trow[\"SoLuong\"] = x[i].getElementsByTagName('column')[4].firstChild.nodeValue;\r\n\t\t\t\t\t\trow[\"DonGia\"] = x[i].getElementsByTagName('column')[5].firstChild.nodeValue;\r\n\t\t\t\t\t\trow[\"ThanhTien\"] = x[i].getElementsByTagName('column')[4].firstChild.nodeValue*x[i].getElementsByTagName('column')[5].firstChild.nodeValue;\r\n\t\t\t\t\t\trow[\"ThuyetMinh\"] = x[i].getElementsByTagName('column')[6].firstChild.nodeValue;\r\n\t\t\t\t\t\tdata[i] = row;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\thttp.send(params);\r\n var source =\r\n {\r\n localdata: data,\r\n\t\t\t\tdatatype: \"array\",\r\n };\r\n\t\t\t\r\n \t\t var dataadapter = new $.jqx.dataAdapter(source);\r\n // initialize jqxGrid\r\n $(\"#jqthem\").jqxGrid(\r\n {\r\n width: 960,\r\n\t\t\t\tselectionmode: 'singlerow',\r\n source: dataadapter,\r\n \teditable: true,\r\n\t\t\t\tautoheight: true,\r\n theme: theme,\r\n columnsresize: true,\r\n columns: [\r\n\t\t\t\t\t { text: 'Mã', editable: false, datafield: 'MaTaiSan', width: 20, cellsalign: 'left' },\r\n\t\t\t\t\t { text: 'Tên tài sản', editable: false, datafield: 'TenTaiSan', width: 200, cellsalign: 'left' },\r\n { text: 'Tính năng kỹ thuật', editable: false, datafield: 'TinhNangKT', width: 300, cellsalign: 'left' },\r\n { text: 'ĐVT',editable: false, datafield: 'TenDVT', width: 40 },\r\n\t\t\t\t\t { text: 'Số Lượng',columntype: 'numberinput',editable: true ,datafield: 'SoLuong', width: 60,\r\n\t\t\t\t\t \t\tvalidation: function (cell, value) \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t if(value > 0)\r\n\t\t\t\t\t\t\t return true;\r\n\t\t\t\t\t\t\t else return { result: false, message: \"Số lượng phải lớn hơn không.\"};\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t initeditor: function (row, cellvalue, editor) \r\n\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t editor.jqxNumberInput({ decimalDigits: 0, digits: 3 });\r\n\t\t\t\t\t\t\t }\r\n\t\t\t\t\t },\r\n\t\t\t\t\t { text: 'Đơn giá',columntype: 'numberinput',editable:false, datafield: 'DonGia', width: 80 },\r\n\t\t\t\t\t { text: 'Thành tiền',columntype: 'numberinput',editable: false, datafield: 'ThanhTien', width: 80 },\r\n\t\t\t\t\t { text: 'Thuyết minh yêu cầu sử dụng',editable: true, datafield: 'ThuyetMinh', width: 600 },\r\n ]\r\n });\r\n\t\t\t\r\n\t\t$('#jqthem').bind('rowselect', function (event) \r\n\t\t{\r\n\t\t\tvar args = event.args;\r\n\t\t\tvar row = args.rowindex;\r\n\t\t\tmataisan = $('#jqthem').jqxGrid('getcellvalue', row, \"MaTaiSan\");\r\n\t\t});\t\r\n // delete row.\r\n $(\"#deleterowbutton\").bind('click', function () \r\n\t\t{\r\n\t\t\t\t//xoa du lieu co mataisan va mathuoctinh bang cothuoctinh\r\n\t\t\t\tvar data = \"delete=true&MaTaiSan=\" +mataisan+\"&MaKHMS=\" +makhms; \t\t\t\t\t\r\n\t\t\t\t$.ajax\r\n\t\t\t\t({\r\n\t\t\t\t\tdataType: 'json',\r\n\t\t\t\t\turl: 'data_taisanthuocKHMS.php',\r\n\t\t\t\t\tdata: data,\r\n\t\t\t\t\tsuccess: function (data, status, xhr) {}\t\t\r\n\t\t\t\t})\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n var selectedrowindex = $(\"#jqthem\").jqxGrid('getselectedrowindex');\r\n var rowscount = $(\"#jqthem\").jqxGrid('getdatainformation').rowscount;\r\n if (selectedrowindex >= 0 && selectedrowindex < rowscount) \r\n\t\t\t\t{\r\n var id = $(\"#jqthem\").jqxGrid('getrowid', selectedrowindex);\r\n $(\"#jqthem\").jqxGrid('deleterow', id);\r\n }\r\n });\r\n\t\t\r\n\t\t//tao popup\r\n\t\tfunction createElements(theme)\r\n\t\t{\r\n $('#save').jqxButton({ theme: theme, height: '25px', width: '65px' });\r\n $('#cancel').jqxButton({ theme: theme, height: '25px', width: '65px' });\r\n $('#eventWindow').jqxWindow({ maxHeight: 500, maxWidth:500, minHeight: 30, minWidth: 250, height: 400, width: 500,\r\n theme: theme, resizable: false, isModal: true, modalOpacity: 0.3,\r\n okButton: $('#save'), cancelButton: $('#cancel')\r\n });\r\n \r\n }\r\n\t\t\r\n\t\t//su kien nhan nut them\r\n function addEventListeners() \r\n\t\t{\r\n $('#showWindowButton').mousedown(function () \r\n\t\t\t{\r\n\t\t\t\tcreateElements(theme);\r\n $('#eventWindow').jqxWindow('show');\r\n\r\n\t\t\t\t \t// tìm tài sản\r\n\t\t\t\t\thttp=GetXmlHttpObject();\r\n\t\t\t\t\tvar params =\"\";\r\n\t\t\t\t\thttp.open(\"POST\", 'get_list_taisan.php', false);\r\n\t\t\t\t\thttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\r\n\t\t\t\t\thttp.onreadystatechange = function()\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(http.readyState == 4 && http.status == 200) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tvar x=http.responseXML.getElementsByTagName('row');\r\n\t\t\t\t\t\t\tfor(var i=0;i<x.length;i++)//lay duoc danh sach cac quyen ma can bo (macanbo) co\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tvar row3 = {};\r\n\t\t\t\t\t\t\t\trow3[\"MaTaiSan\"] = x[i].getElementsByTagName('column')[0].firstChild.nodeValue;\r\n\t\t\t\t\t\t\t\trow3[\"TenTaiSan\"] = x[i].getElementsByTagName('column')[1].firstChild.nodeValue;\r\n\t\t\t\t\t\t\t\tdata3[i] = row3;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\thttp.send(params);\r\n\t\t\t\t\tvar source3 =\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlocaldata: data3,\r\n\t\t\t\t\t\tdatatype: \"array\",\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar dataAdapter3 = new $.jqx.dataAdapter(source3);\r\n\t\t\t\t\t$(\"#cbotaisan\").jqxComboBox(\r\n\t\t\t\t\t{ \t\t\t \r\n\t\t\t\t\t\tsource: dataAdapter3, \r\n\t\t\t\t\t\tautocomplete: true,\r\n\t\t\t\t\t\tautoDropDownHeight: true,\r\n\t\t\t\t\t\tdisplayMember: \"TenTaiSan\", \r\n\t\t\t\t\t\tvalueMember: \"MaTaiSan\", \r\n\t\t\t\t\t\twidth: 340, \r\n\t\t\t\t\t\theight: 25, \r\n\t\t\t\t\t\ttheme: theme \r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar dataAdapter4;\r\n\t\t\t\t\t$(\"#tabletaisan\").jqxGrid(\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\twidth: 340,\r\n\t\t\t\t\t\tselectionmode: 'singlerow',\r\n\t\t\t\t\t\ttheme: theme,\r\n\t\t\t\t\t\teditable: true,\r\n\t\t\t\t\t\theight: 200,\r\n\t\t\t\t\t\tcolumns: [\r\n\t\t\t\t\t\t\t { text: 'Mã tài sản', editable: false, datafield: 'MaTaiSan', width: 100, cellsalign: 'left' },\r\n\t\t\t\t\t\t\t { text: 'Tên tài sản', editable: false, datafield: 'TenTaiSan', width: 240, cellsalign: 'left' },\r\n\t\t\t\t\t\t ]\r\n\t\t\t\t\t});\r\n });\r\n }\r\n \r\n\t\t \r\n\t\t//khi chon 1 row tren combo taisan, tu dong se addrow vao bang taisan\r\n $('#cbotaisan').bind('change', function (event) \r\n\t\t{\r\n\t\t\tvar args = event.args;\r\n var item = $('#cbotaisan').jqxComboBox('getItem', args.index);\r\n\t\t\tmataisan = item.value;\r\n\t\t\ttentaisan =item.label;\r\n\t\t\tvar row = {};\r\n row[\"MaTaiSan\"] = mataisan;\r\n\t\t\trow[\"TenTaiSan\"] = tentaisan;\r\n\t\t\t\r\n\t\t\tvar them=1;\r\n\t\t\tvar rowscount = $(\"#tabletaisan\").jqxGrid('getdatainformation').rowscount;\r\n\t\t\tfor(var i=0;i < rowscount;i++) \r\n\t\t\t{\r\n\t\t\t\t\tvar mataisan2 = $('#tabletaisan').jqxGrid('getcellvalue', i, \"MaTaiSan\");\r\n\t\t\t\t\tif(mataisan==mataisan2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthem=0;\r\n\t\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tvar rowscount2 = $(\"#jqthem\").jqxGrid('getdatainformation').rowscount;\r\n\t\t\tfor(var j=0;j < rowscount2;j++) \r\n\t\t\t{\r\n\t\t\t\t\tvar mataisan2 = $('#jqthem').jqxGrid('getcellvalue', j, \"MaTaiSan\");\r\n\t\t\t\t\tif(mataisan==mataisan2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthem=0;\r\n\t\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\t// add vao bang taisan\r\n\t\t\tif(them==1)\r\n\t\t\t{\r\n\t\t\t\t$('#tabletaisan').jqxGrid('addrow',null, row);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\t$(\"#save\").bind('click', function () \r\n\t\t {\r\n \t\tvar rowscount = $(\"#tabletaisan\").jqxGrid('getdatainformation').rowscount;\r\n\t\t\t\t\tvar dongia;\r\n\t\t\t\t\tfor(var i=0;i < rowscount;i++) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t \tvar mats = $('#tabletaisan').jqxGrid('getcellvalue', i, \"MaTaiSan\");\r\n\t\t\t\t\t\t \tvar tents = $('#tabletaisan').jqxGrid('getcellvalue', i, \"TenTaiSan\");\r\n\t\t\t\t\t\t var row12 = {};\r\n\t\t\t\t\t\t\trow12[\"MaTaiSan\"] = mats;\r\n\t\t\t\t\t\t\trow12[\"TenTaiSan\"] = tents;\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\thttp=GetXmlHttpObject();\r\n\t\t\t\t\t\t\t\tvar params = \"MaTaiSan=\" +mats;\t\t\t\t\r\n\t\t\t\t\t\t\t\thttp.open(\"POST\", 'get_list_taisan_cothuoctinh.php', false);\r\n\t\t\t\t\t\t\t\thttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\r\n\t\t\t\t\t\t\t\thttp.onreadystatechange = function()\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif(http.readyState == 4 && http.status == 200) \r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\trow12[\"SoLuong\"]=1;\r\n\t\t\t\t\t\t\t\t\t\tdongia = http.responseXML.getElementsByTagName('column')[0].firstChild.nodeValue;\r\n\t\t\t\t\t\t\t\t\t\trow12[\"DonGia\"]=http.responseXML.getElementsByTagName('column')[0].firstChild.nodeValue;\r\n\t\t\t\t\t\t\t\t\t\trow12[\"ThanhTien\"]=http.responseXML.getElementsByTagName('column')[0].firstChild.nodeValue;\r\n\t\t\t\t\t\t\t\t\t\trow12[\"TinhNangKT\"]=http.responseXML.getElementsByTagName('column')[1].firstChild.nodeValue;\r\n\t\t\t\t\t\t\t\t\t\trow12[\"TenDVT\"]=http.responseXML.getElementsByTagName('column')[2].firstChild.nodeValue;\r\n\t\t\t\t\t\t\t\t\t\trow12[\"ThuyetMinh\"]='Thuyết minh';\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\thttp.send(params);\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$('#jqthem').jqxGrid('addrow',null, row12);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// luu vao csdl\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\thttp=GetXmlHttpObject();\r\n\t\t\t\t\t\t\t\tvar params = \"insert=true&MaTaiSan=\" + mats+\"&SoLuong=\" + 1+\"&DonGia=\" + dongia+\"&MaKHMS=\" + makhms;\t\t\t\t\r\n\t\t\t\t\t\t\t\thttp.open(\"POST\", 'data_taisanthuocKHMS2.php', false);\r\n\t\t\t\t\t\t\t\thttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\r\n\t\t\t\t\t\t\t\thttp.onreadystatechange = function()\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif(http.readyState == 4 && http.status == 200){} \r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\thttp.send(params);\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$(\"#cbotaisan\").jqxComboBox('clearSelection'); \r\n\t\t\t\t\t$('#tabletaisan').jqxGrid('clear');\r\n\t\t\t\t\t\r\n });\r\n\t\t \r\n \t\t//xoa khms\r\n\t\t$(\"#delete\").bind('click', function () \r\n\t\t {\r\n \t\t\t\t\thttp=GetXmlHttpObject();\r\n\t\t\t\t\t\t\t\tvar params = \"makhms=\" +makhms;\t\t\t\t\r\n\t\t\t\t\t\t\t\thttp.open(\"POST\", 'data_taisanthuocKHMS5.php', false);\r\n\t\t\t\t\t\t\t\thttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\r\n\t\t\t\t\t\t\t\thttp.onreadystatechange = function()\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif(http.readyState == 4 && http.status == 200) \r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\talert('Thành công.');\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\thttp.send(params);\t\t\t\t\t\t\r\n });\r\n\t\t\r\n\t\t\r\n\t\t//update \r\n\t\t$(\"#jqthem\").bind('cellendedit', function (event) \r\n\t\t{\r\n\t\t var column = args.datafield;\r\n\t\t var row = args.rowindex;\r\n\t\t var value = args.value;\r\n\t\t var oldvalue = args.oldvalue;\r\n\t\t var tongtien2 = 0;\r\n\t\t var sl = $('#jqthem').jqxGrid('getcellvalue', row, \"SoLuong\");\r\n\t\t var dg = $('#jqthem').jqxGrid('getcellvalue', row, \"DonGia\");\r\n\t\t var tm = $('#jqthem').jqxGrid('getcellvalue', row, \"ThuyetMinh\");\r\n\t\t var ma = $('#jqthem').jqxGrid('getcellvalue', row, \"MaTaiSan\");\r\n\t\t \r\n\t\t if(column=='SoLuong' )\r\n\t\t {\r\n\t\t\t $(\"#jqthem\").jqxGrid('setcellvalue', row, \"ThanhTien\",value*dg);\r\n\t\t\t var rowscount = $(\"#jqthem\").jqxGrid('getdatainformation').rowscount;\r\n\t\t\t for(var i=0;i < rowscount;i++) \r\n\t\t\t\t{\r\n\t\t\t\t\tvar thanhtien = $('#jqthem').jqxGrid('getcellvalue', i, \"ThanhTien\");\r\n\t\t\t\t\ttongtien2 = tongtien2 + thanhtien;\r\n\t\t\t\t}\r\n\t\t\t\t$('#tongtien').html(tongtien2);\r\n\t\t \r\n\t\t\t\tvar data = \"update=true&SoLuong=\" + value;\r\n\t\t\t\tdata = data + \"&MaTaiSan=\" + ma;\r\n\t\t\t\tdata = data + \"&DonGia=\" + dg;\r\n\t\t\t\tdata = data + \"&MaKHMS=\" + makhms;\t\t\t\r\n\t\t\t\t$.ajax\r\n\t\t\t\t({\r\n\t\t\t\t\t//dataType: 'json',\r\n\t\t\t\t\turl: 'data_taisanthuocKHMS.php',\r\n\t\t\t\t\tdata: data,\r\n\t\t\t\t\tsuccess: function (data, status, xhr) {}\r\n\t\t\t\t});\r\n\t\t\t\ttongtien2 = 0;\r\n\t\t\t}\r\n\t\t\telse if(column=='ThuyetMinh')\r\n\t\t\t{\r\n\t\t\t\thttp=GetXmlHttpObject();\r\n\t\t\t\tvar params = \"SoLuong=\" + sl + \"&ThuyetMinh=\" + value+ \"&MaTaiSan=\" + ma+ \"&DonGia=\" + dg+ \"&MaKHMS=\" + makhms;\t\t\r\n\t\t\t\thttp.open(\"POST\", 'data_taisanthuocKHMS3.php', false);\r\n\t\t\t\thttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\r\n\t\t\t\thttp.onreadystatechange = function()\r\n\t\t\t\t{\r\n\t\t\t\t\tif(http.readyState == 4 && http.status == 200){} \r\n\t\t\t\t}\r\n\t\t\t\thttp.send(params);\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t //lay gia tri cua so luong * don gia\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t//tinh tổng tiền\r\n\t\tvar rowscount = $(\"#jqthem\").jqxGrid('getdatainformation').rowscount;\r\n\t\tfor(var i=0;i < rowscount;i++) \r\n\t\t{\r\n\t\t\t\t\tvar thanhtien = $('#jqthem').jqxGrid('getcellvalue', i, \"ThanhTien\");\r\n\t\t\t\t\ttongtien = tongtien + thanhtien;\r\n\t\t}\r\n\t\t$('#tongtien').html(tongtien);\r\n\t\t\r\n\t\t\r\n\t\t\r\n $(document).ready(function () \r\n\t\t{\r\n var theme = $.data(document.body, 'theme', theme);\r\n if (theme == undefined) theme = '';\r\n addEventListeners();\r\n\t\t\t$(\"#cbotaisan\").jqxComboBox('clearSelection');\r\n $(\"#jqxWidget\").css('visibility', 'visible');\r\n });\r\n\t/*else\r\n\t{\r\n\t\t$('#jqthem').jqxGrid('clear');\r\n\t\tdocument.getElementById('tienmuasam').style.display = 'none';\r\n\t\tdocument.getElementById('buttondk').style.display = 'none';\t\r\n\t\t\r\n\t}*/\r\n}", "title": "" }, { "docid": "d9547baedebf75ff205b97aa0478ea3b", "score": "0.588411", "text": "function pokazProdukt(obiektProduktu, ileGram) {\n if (ileGram == null) {\n ileGram = \"100\";\n }\n \n wsadzTresc.innerHTML = \"<h3>\" + obiektProduktu.nazwa + \", w \" + ileGram + \" gramach:</h3><div class='polowa'><h4>Kalorii:\" + obiektProduktu.kalorie + \"</h4><h4>Bialka:\" + obiektProduktu.bialko + \"</h4></div><div class='polowa'><h4>Weglowodane:\" + obiektProduktu.weglowodany + \"</h4><h4>Tluszcze:\" + obiektProduktu.tluszcz + \"</h4></div>\";\n\n }", "title": "" }, { "docid": "901f3cd061c17dde12c51bc74429bfa8", "score": "0.58779424", "text": "function all_es() {\n\tvar es = {\n\t class: 'table-striped table-bordered',\n\t columnas: [\n\t { leyenda: 'ID', class:'text-center', style: 'width:50px;', columna: 'id',ordenable:true },\n\t { leyenda: 'Vehículo', style: 'width:100px;', ordenable:false,filtro:false },\n\t { leyenda: 'Datos salida', style:'width:100px;',ordenable:false },\n\t { leyenda: 'Datos de entrada', style:'width:200px;' },\n\t { leyenda: 'Observaciones', style:'width:200px;',ordenable:false, filtro:false },\n\t ],\n\t modelo: [\n\t { propiedad: 'id'},\n\t { formato:function (tr,obj,celda) {\n\t \treturn '<ul>'+\n\t \t\t\t'<li> <b>PLACAS:</b> '+obj.placa+'</li>'+\n\t \t\t\t'<li> <b>MARCA:</b> '+obj.marca+'<l/i>'+\n\t \t\t\t'<li> <b>TIPO:</b> '+obj.t_vehiculo+'</li>'+\n\t \t\t\t'<li> <b>¿QUIEN CONDUCE?:</b> '+obj.chofer+'</li>'+\n\t \t\t'</ul>';\n\t \t} \n\t },\n\t { formato:function (tr,obj,celda) {\n\t \treturn '<ul>'+\n\t \t\t\t'<li> <b>FECHA Y HORA:</b> '+obj.salida+'</li>'+\n\t \t\t\t'<li> <b>NIVEL DE GAS:</b> '+obj.gas_salida+' % <l/i>'+\n\t \t\t\t'<li> <b>KILOMETRAJE:</b> '+obj.km_salida+'</li>'+\n\t \t\t'</ul>';\n\t \t} \n\t },\n\t {formato:function (tr,obj,celda) {\n\t\t \tif ( obj.entrada != null ) {\n\t\t \t\treturn '<ul>'+\n\t\t \t\t\t\t'<li> <b>FECHA Y HORA:</b> '+obj.entrada+'</li>'+\n\t\t \t\t\t\t'<li> <b>NIVEL DE GAS:</b> '+obj.gas_entrada+' % <l/i>'+\n\t\t \t\t\t\t'<li> <b>KILOMETRAJE:</b> '+obj.km_entrada+'</li>'+\n\t\t \t\t\t'</ul>';\n\t\t \t}else{\n\t\t \t\treturn '<ul>'+\n\t \t\t\t'<li> <b>FECHA Y HORA:</b> SIN REGISTRAR</li>'+\n\t \t\t\t'<li> <b>NIVEL DE GAS:</b> SIN REGISTRAR <l/i>'+\n\t \t\t\t'<li> <b>KILOMETRAJE:</b> SIN REGISTRAR </li>'+\n\t \t\t'</ul>';\n\t\t \t}\n\t \t\n\t }},\n\t { propiedad: 'observaciones'}\n\t ],\n\t url: 'controller/puente.php?option=10',\n\t type:'POST',\n\t limite: [25,50,100],\n\t columna: 'id',\n\t columna_orden: 'DESC',\n\t paginable:true,\n\t filtrable: false,\n\n\t};\n\t$(\"#es_today\").anexGrid(es);\n}", "title": "" }, { "docid": "60a139bc4ddfb50ffc38b7b17091687d", "score": "0.58732677", "text": "function ControlloDataNascita() {\r\n var dt=\"dn\";\r\n var campo=document.getElementById(\"dataN\");\r\n if (campo.value !=\"\") {\r\n campo.value=ControlloDataInserita(campo,dt);\r\n }\r\n \r\n campo.style.color =\"#000088\";\r\n campo.style.background=\"white\";\r\n campo.style.border=\"1px dotted grey\";\r\n\r\n //SEZIONE PER PROPORRE LA CLASSE DELL'ISCRITTO IN BASE ALLA DATA DI NASCITA\r\n // setta l'oggetto classe\r\n var classe=document.getElementById(\"myclassi\");\r\n if (classe.value !=0){\r\n return;\r\n } else {\r\n // legge la data di nascita dell'iscritto \r\n var campodatanascita=document.getElementById(\"dataN\");\r\n var datanascita=campodatanascita.value.split('/');\r\n \r\n // legge la data di oggi già stampata in pagina\r\n var campodataoggi=document.getElementById(\"dataserver\");\r\n var dataoggi=campodataoggi.value.split('/');\r\n \r\n // trova la differenza fra le due date\r\n var differenzadate=(Number(dataoggi[2])-Number(datanascita[2]));\r\n classe.value=ClasseProposta(differenzadate);\r\n }\r\n return;\r\n }", "title": "" }, { "docid": "36277e8f03ea94f800e70b155064dfe1", "score": "0.587265", "text": "mostrarEstablecimientos() {\n this.api.obtenerDatos()\n .then(datos => {\n const resultado = datos.respuestaJSON.lugares;\n \n // Muestra los pines en el Mapa\n this.mostrarMapa(resultado);\n console.log(resultado[0].latitude);\n } )\n }", "title": "" }, { "docid": "9c01b86680ee21f4426b0adebbb60712", "score": "0.5867173", "text": "constructor(id, naziv, brPolica){\n\n this.id = id;\n if(typeof(naziv) == \"string\")\n this.naziv = naziv;\n else \n throw new Error(\"Invalid naziv type!\");\n\n if(typeof(brPolica) == \"number\")\n this.brPolica = brPolica;\n else \n throw new Error(\"Invalid brPolica type!\");\n\n this.velikiKontejner = null;\n this.police = [];\n //imamo 10 oznaka(zanrova) polica i za svaku oznaku max br knjiga\n this.oznakePolice = [\"Akcioni romani\", \"Drama\", \"Enciklopedija\", \"Epska fantastika\", \"Horor\", \"Klasici\", \"Krimi romani\", \"Ljubavni romani\", \"Naucna fantastika\", \"Trileri\"];\n this.maxBrojevi = [8, 4, 5, 3, 4, 10, 7, 9, 10, 6];\n \n }", "title": "" }, { "docid": "75d792746a22a77bfde8cbd4e26a37b6", "score": "0.5864517", "text": "function razem() {\n suma.innerText = 0;\n sumaTablica = [];\n for (var i = 1; i < tab.length; i++) {\n if (tab[i].children[2] != undefined) {\n sumaTablica.push(tab[i].children[2].innerText.split(' '));\n }\n }\n for (var k = 0; k <= sumaTablica.length; k++) {\n if (tab[k].children[3] != undefined && tab[k].children[3].children[0] != undefined && tab[k].children[3].children[0].value > 1) {\n console.log('ile jest k ' + k);\n console.log(sumaTablica[k - 1][4] * tab[k].children[3].children[0].value);\n sumaTablica[k - 1][4] = sumaTablica[k - 1][4] * tab[k].children[3].children[0].value;\n }\n }\n for (var q = 0; q < sumaTablica.length; q++) {\n var dodaj = parseFloat(sumaTablica[q][4]);\n suma.innerText = Math.round((parseFloat(suma.innerText) + dodaj) * 100) / 100;\n }\n }", "title": "" }, { "docid": "8fc81e7b68f8bc464e4e3b58850aad6a", "score": "0.5864195", "text": "function visaalla() {\r\n if (kortsantalggr < 1) { // För att den inte ska lägga till samma punkter flera ggr om man trycker på knappen flera ggr \r\n for (let i=0; i < restaurang.length; i++) {\r\n restaurang[i].skapalistelement();\r\n }\r\n kortsantalggr = 1; // Se kommentaren ovan\r\n }\r\n }", "title": "" }, { "docid": "81ff2065804575ab5c70762dafa34a80", "score": "0.58561426", "text": "function refreshTableData() {\n tableQuanLytaiKhoan.clear();\n for (let taiKhoan of taiKhoans) {\n tableQuanLytaiKhoan.row.add([\n taiKhoan.maTaiKhoan, taiKhoan.tenDangNhap, taiKhoan.matKhau, taiKhoan.loai, taiKhoan\n ]);\n }\n tableQuanLytaiKhoan.draw();\n}", "title": "" }, { "docid": "19c4d923cff218513c1a8d41bb04a13a", "score": "0.5850939", "text": "desviacionEstandar(data)\n\t{\n\t\tlet size = data[3].length;\n\t\tlet media = this.mediaAritmetica(data);\n\t\tlet suma = 0;\n\t\tlet total = 0;\n\t\tlet sumaFrecuencia = 0;\n\n\t\tfor(let i = 0; i < size; i++){\n\t\t\tsuma += Math.pow(data[2][i] - media, 2) * data[3][i];\n\t\t}\n\n\t\tfor(let i = 0; i < size; i++){\n\t\t\tsumaFrecuencia += data[3][i];\n\t\t}\n\n\t\ttotal = suma / (sumaFrecuencia - 1);\n\n\t\treturn Math.pow(total, 1/2);\n\t}", "title": "" }, { "docid": "3749e1cd03f31df40a67a0debc60ca95", "score": "0.5841225", "text": "function nbpData(){\n // sprawdzam czy string nie jest pusty/ jerzeli vartosc div nie jest pusta\n if(selectDiv.value !=='') {\n // w tuldzie! pobiera link\n fetch(`http://api.nbp.pl/api/exchangerates/tables/${selectDiv.value}/?format=json`)\n // res to prosto nazwa i zamienia text na json\n .then(res => res.json())\n .then(res => {\n // zeby oczysczac div za kazdym razem\n mainDiv.innerHTML = ''\n let h = document.createElement('h1')\n h.innerHTML = \"Tabela\" + res[0].table\n mainDiv.appendChild(h)\n // console.log('nbpData -> res', res)\n // console.log(res[0].rates)\n // rates to jest notowanie kursu, czyli pobralismy wartosc jednej tab(0) i pozniej mamy jakos w niej porusac sie i wybieramy rates a w nim code\n // i - wartosc poczatkowa, jak dlugo bedzie spejniona i ostatnie dodaje 1\n for(let i=0; i< res[0].rates.length; i++) {\n // if(res[0].rates[i].code===\"EUR\"){\n // console.log(res[0].rates[i].code)\n // }\n // sprawdzie czy ta wartosc istnieje, w 3 tab jej nie ma/ czyli albo mid albo bid\n // to skrót ternary\n // let kurs = res[0].retes[i].mid ? res[0].retes[i].mid : res[0].retes[i].bid\n // a to to same ale rozszerzone\n function sprawdzamyCzyJestMid(){\n if(res[0].rates[i].mid) {\n return res[0].rates[i].mid\n } else {\n return res[0].rates[i].bid\n }\n }\n // tworzymy zmiena w ktorej tworzymyparagraf w div\n let paragraf = document.createElement('p')\n // dodajemy dane do pafragrafy w html\n paragraf.innerHTML = res[0].rates[i].code + \" a kurs \" + sprawdzamyCzyJestMid() + \" waluta \" + res[0].rates[i].currency + ' jest to tabela ' + res[0].table\n // wyswietlamy\n mainDiv.appendChild(paragraf)\n }\n \n })\n // console.log(selectDiv.value)\n }\n}", "title": "" }, { "docid": "50b201d90ab4c9a56dfdc19370cf77e3", "score": "0.58371013", "text": "function saberi(value) {\n //ovde resavamo brojac ispod korpe\n let korpaDemo = document.getElementById(\"korpaDemo\");\n korpaDemo.setAttribute(\"type\", \"number\");\n korpaDemo.setAttribute(\"value\", 0);\n sumDemo += 1;\n korpaDemo.innerHTML = sumDemo;\n let newsDemo = document.getElementById(\"newsDemo\");\n newsDemo.innerHTML = \"<span id='redColor'>!</span>\";\n //parsiramo json podatak za value\n let valueJson = JSON.parse(value);\n korpa.suma += parseFloat(valueJson.UnitPrice);\n tempProizvod = JSON.parse(event.target.value).ProductID;\n tempPrice = JSON.parse(event.target.value).UnitPrice;\n //uslovi i petlja za pravilno dodavanje proizvoda u korpu\n if (sumDemo == 1) {\n console.log(\"prvi proizvod\");\n korpa.proizvodi.push({\n id: valueJson.ProductID,\n imeProizvoda: valueJson.ProductName,\n suplierId: valueJson.SuplierID,\n categoryId: valueJson.CategoryID,\n cenaProizvoda: valueJson.UnitPrice,\n dostupno: valueJson.UnitsInStock,\n popust: valueJson.Discount,\n value: valueJson.Value\n });\n } else {\n console.log(\"nije prvi\");\n for (let y in korpa.proizvodi) {\n //console.log(tempProizvod);\n var uslov = false;\n if (korpa.proizvodi[y].id == tempProizvod) {\n console.log(\"kopija\");\n console.log(tempPrice);\n korpa.proizvodi[y].value += 1;\n korpa.proizvodi[y].cenaProizvoda += tempPrice;\n uslov = true;\n console.log(\"kopija? \" + uslov);\n break;\n } else {\n uslov = false;\n }\n }\n if (uslov == false) {\n console.log(\"kopija? \" + uslov);\n korpa.proizvodi.push({\n id: valueJson.ProductID,\n imeProizvoda: valueJson.ProductName,\n suplierId: valueJson.SuplierID,\n categoryId: valueJson.CategoryID,\n cenaProizvoda: valueJson.UnitPrice,\n dostupno: valueJson.UnitsInStock,\n popust: valueJson.Discount,\n value: valueJson.Value\n });\n }\n }\n document.getElementById(\"cena\").innerHTML =\n \"Ukupna cena: \" + korpa.suma + \" $\";\n}", "title": "" }, { "docid": "b3c01ac6e11b54d02896e000feb7ba66", "score": "0.58369887", "text": "function paspaudimas( event ) {\n const paspaustasElementas = event.target;\n const duomenys = paspaustasElementas.dataset; \n const index = parseInt(duomenys.number);\n \n paspaudimuKiekis[index-1]++;\n console.log( paspaudimuKiekis );\n\n return console.log(`Paspaustas ${index}: ${paspaudimuKiekis[index-1]} kartu`)\n}", "title": "" }, { "docid": "8abb591615af655c7829cbecba2551cd", "score": "0.5834723", "text": "function kapazitaetDarstellen() {\r\n\t\t//Wenn Tabelle existiert loesche sie\r\n\t\tif($(\"#kaptable\").length > 0) {\r\n\t\t\t$(\"#kaptable\").remove();\r\n\t\t}\r\n\t\t//Tabellenkopf fuer Produktplanung\r\n\t\t$(\"#lC\").append(\"<table class='tableshow table-condensed table-striped' id='kaptable'>\");\r\n\t\t$(\"#kaptable\").append(\"<tr class='tablehead'><td data-i18n='kapa.maschine'></td><td data-i18n='kapa.nstunden'align='center'></td><td data-i18n='kapa.schichten'></td><td data-i18n='kapa.ustunden'></td></tr>\");\r\n\r\n\t\t$(kapazitaetsbedarf).each(function(index, maschine) {\r\n\t\t\t$(\"#kaptable\").append(\"<tr class=\\\"tableline\\\">\");\r\n\t\t\t$(\"#kaptable .tableline\").last().append(\"<td>\"+maschine.id+\"</td>\");\r\n\t\t\t$(\"#kaptable .tableline\").last().append(\"<td align='center'>\"+maschine.kapazitaet+\"</td>\");\r\n\t\t\t$(\"#kaptable .tableline\").last().append(\"<td><input type='number' style='width: 60px;' class='form-control' value=\" +maschine.schicht+\" step='1'min='0'></td>\");\r\n\t\t\t$(\"#kaptable .tableline\").last().append(\"<td><input type='number' style='width: 60px;' class='form-control' value=\" + maschine.ueberstunden + \" step='5' min='0'></td></tr>\");\r\n\t\t});\r\n\t\tfortschrittanzeigeBewegen(60);\r\n\r\n\t\t//FIXME: Übersetzung nochmal aufrufen\r\n\t\t$('body').i18n();\r\n\t}", "title": "" }, { "docid": "f6878e2dca4ab98082643340742aa2cd", "score": "0.5834695", "text": "function zorad_tabulku_podla_bodov(tabulka)\n{\n var pole=[];\n vysledne_pole=[];\n tabulka.reverse();\n for(var i=0; i<tabulka.length; i++)\n {\n pole[i]=tabulka[i][8]+\"_\"+i;\n }\n pole.sort();\n pole.reverse();\n for(var i=0; i<pole.length; i++)\n {\n poradie=pole[i].split(\"_\");\n pom=poradie[1];\n vysledne_pole.push(tabulka[pom]);\n }\n return vysledne_pole;\n}", "title": "" }, { "docid": "b9babd012c0eaad5bd5c2557b4ed1cb2", "score": "0.58321893", "text": "async function getData() {\n //Attendi finche' non ottieni dati di un alloggio\n var alloggio = await AlloggioModel.getAlloggioByStrutturaRef(strutturaId, alloggioId);\n setAlloggio(alloggio); //salva i dati dell'alloggio nello stato\n //Prendi la prima foto presente per l'alloggio e salva nello state\n var fotoArray = Object.values(alloggio.fotoList); //restituisce gli URL delle foto in un array JS \n var imageURL = \"\";\n if (fotoArray.length == 0) {\n imageURL = require(\"../../assets/imagenotfound.png\");\n } else {\n imageURL = { uri: fotoArray[0] };\n }\n setFotoAlloggio(imageURL);\n\n //Attendi finche' non ottieni dati di una recensione\n var recensione = await RecensioneModel.getRecensioneById(strutturaId, alloggioId, recensioneId);\n recensione.dataRecensione = ((new Date(recensione.dataRecensione.seconds * 1000)).toLocaleString(\"it-IT\").split(','))[0];\n setRecensione(recensione); //salva i dati della recensione nello stato\n\n //Attendi finche' non ottieni dati dell'utente che ha scritto la recensione\n var ospite = await GuestModel.getGuestDocument(recensione.guestRef);\n setOspite(ospite); //salva i dati nello stato\n\n }", "title": "" }, { "docid": "a7cf38fc5012552bee10878b82590920", "score": "0.5829335", "text": "function _loadData() {\r\n //Xet Danh sach nhan vien da co trong localStorage hay chua. Neu chua co thi tao no\r\n if (!localStorage.Nguoi_dung) {\r\n //du lieu o dang mang (Array)\r\n localStorage.Nguoi_dung = JSON.stringify([]);\r\n }\r\n //Ep keieu JSON string sang Javascript Object (Mang - Array)\r\n dataArray = JSON.parse(localStorage.Nguoi_dung);\r\n\r\n setTimeout(function () {\r\n // $(\"tbody\").html(html(dataArray)); \r\n document.querySelector(\"tbody\").innerHTML = html(dataArray);\r\n }, 250);\r\n\r\n}", "title": "" }, { "docid": "333cc35a697b4f16ec22bea6695c1aff", "score": "0.5823022", "text": "function hitung_laut(harga,tujuan){\n\t\t\tvar berat = $(\"#berat_laut\").val();\n\t\t\tvar volume = $(\"#volume_laut\").val();\n\t\t\tif(berat!='' && volume!=''){\n\t\t\t\tif(parseInt(berat) > parseInt(volume)){\n\t\t\t\t\tvar jumlah = harga*berat;\n\t\t\t\t}else{\n\t\t\t\t\tvar jumlah = harga*volume;\n\t\t\t\t}\n\t\t\t$(\"#biaya_kirim_laut\").val(jumlah);\n\t\t\t$(\"#b_kirim_laut\").html(rupiah(jumlah));\n\t\t\thitung_total_laut();\t\t\n\t\t}}", "title": "" }, { "docid": "e3213e0a57c754d1b1fad8a5b27eb2de", "score": "0.58163", "text": "function setData(){\n // Ambil value input user\n var nama = document.forms[\"registrasiMhs\"][\"nama\"].value;\n var nim = document.forms[\"registrasiMhs\"][\"nim\"].value;\n var prodi = document.forms[\"registrasiMhs\"][\"prodi\"].value;\n var email = document.forms[\"registrasiMhs\"][\"email\"].value;\n\n // Cek apakah input user valid. Jika ya, maka ...\n if(validateForm(nama, nim, prodi, email)){\n var data = new Data(nama, nim, prodi, email);\n // Masukkan data ke array dalam bentuk dictionary\n dataMahasiswa.push({nama: data.getNama(), nim: data.getNim(), prodi: data.getProdi(), email: data.getEmail()});\n console.log(dataMahasiswa);\n // Tambahkan data ke database\n addData();\n }\n}", "title": "" }, { "docid": "5fc36b6553ea90f00f2dd04e3c76b096", "score": "0.58145505", "text": "function spisakPredmeta(n2) {\r\n var prosek;\r\n var table = document.getElementById(\"tabela2\");\r\n for (i = 0; i < 12; i++) {\r\n var tr = document.createElement(\"tr\");\r\n for (j = 0; j < 1; j++) {\r\n var td = document.createElement(\"td\");\r\n td.textContent = predmeti[i];\r\n tr.appendChild(td);\r\n var ocena = 0;\r\n for (k = 0; k < 4; k++) {\r\n var td = document.createElement(\"td\");\r\n td.textContent = ucenici[n2].ocene[j][k];\r\n ocena += ucenici[n2].ocene[i][k];\r\n td.setAttribute(\"title\", tultip[j][k])\r\n tr.appendChild(td);\r\n }\r\n prosek = (ocena / 4).toFixed(2);\r\n var td = document.createElement(\"td\");\r\n td.textContent = \"Prosek: \" + prosek;\r\n tr.appendChild(td);\r\n }\r\n table.appendChild(tr);\r\n }\r\n return;\r\n}", "title": "" }, { "docid": "1ef24da12c0d64b028aa385ea575be40", "score": "0.5807527", "text": "function dataErHentet(data){\n data.retter.forEach(visRet);\n }", "title": "" }, { "docid": "bf30f44cc978043ca08892876808e9b7", "score": "0.5807177", "text": "function hitungLuasSegiTiga(alas,tinggi){\n var luas = 0.5 * alas * tinggi \n return luas;\n}", "title": "" }, { "docid": "124d463ac69a482c95114acf3662b69e", "score": "0.58012444", "text": "getNomesNaChamada(data) {\n const dataTemp = this.getData(data)\n return Object.keys(dataTemp).map(numeroAluno => {\n return [numeroAluno, this.nomes[numeroAluno], dataTemp[numeroAluno]]\n })\n }", "title": "" }, { "docid": "4393080a04adda68c6fcbaf236611e7d", "score": "0.57954377", "text": "function obradaZanrova(id){\n let zanrovi = getFromLS(\"zanrovi\");\n return zanrovi.filter(d => d.id == id)[0].naslov;\n}", "title": "" }, { "docid": "90f85faa8752321f0fbd44ada5260b21", "score": "0.5789998", "text": "getNextProprietesVisitees (joueur) { //,seuil){\n let maisons = [];\n GestionJoueur.forEach(j=>{\n if (!j.equals(joueur)) {\n // On parcours toutes les statistiques et on mesure le risque de tomber sur une propriete du joueur\n for (let i = 1; i < 12; i++) {\n let fiche = GestionFiche.get(j.pion.deplaceValeursDes(i));\n if (fiche.isTerrain() && fiche.joueurPossede != null && fiche.joueurPossede.equals(joueur)) {\n //maison visitable, on ajoute la maison avec la proba\n if (maisons[fiche.id] != null) {\n maisons[fiche.id].proba += this.probaDes[i] / 100;\n } else {\n maisons[fiche.id] = ({\n proba: this.probaDes[i] / 100,\n maison: fiche\n });\n }\n }\n }\n }\n },this);\n return maisons;\n }", "title": "" }, { "docid": "25d10b6350acfd14f8638e254e1f592e", "score": "0.5784922", "text": "function tampilkanDataKeForm(data){\n let Data=[];\n for(let i =0; i <= 6; i++){\n Data.push(data[i]);\n }\n let [title, role, availability, usia, lokasi, pengalaman, email] = Data;\n \n\n let form_nama = document.getElementById('input_nama').value = title;\n let form_role = document.getElementById('input_role').value = role;\n let form_availability = document.getElementById('input_availability').value = availability;\n let form_usia = document.getElementById('input_age').value = usia;\n let form_lokasi = document.getElementById('input_lokasi').value = lokasi;\n let form_pengalaman = document.getElementById('input_yearExperience').value = pengalaman;\n let form_email = document.getElementById('input_email').value = email;\n }", "title": "" }, { "docid": "5b8eb97c355a1ae8bda10096845aa589", "score": "0.5782053", "text": "function obtenerDatosBiblioteca (dato) {\n\n\t\t\t\t//VARIABLES\n\t\t\t\tconst datosbi = dato.val()\n\t\t\t\tconst keysbi = Object.keys(datosbi)\n\n\t\t\t\t//OBTENEMOS LOS DATOS DE LA TABLA CARRITO\n\t\t\t\tfunction obtenerDatosCarrito (dato) {\n\n\t\t\t\t\t//VARIABLES\n\t\t\t\t\tconst datos = dato.val()\n\t\t\t\t\tconst keys = Object.keys(datos)\n\t\t\t\t\tvar html = ''\n\t\t\t\t\tvar htmlCarrito = ''\n\t\t\t\t\tvar index = ''\n\t\t\t\t\tvar existe = false\n\n\t\t\t\t\t//RECORREMOS LOS DATOS OBTENIDOS DE LA TABLA CARRITO\n\t\t\t\t\tfor( var i = 0; i <keys.length; i++) {\n\n\t\t\t\t\t\t//VARIABLES\n\t\t\t\t\t\tconst key = keys[i]\n\t\t\t\t\t\tconst item = datos[key]\n\t\t\t\t\t\texiste = false\n\n\t\t\t\t\t\t//RECORREMOS LOS DATOS DE BIBLIOTECA\n\t\t\t\t\t\tfor( var x = 0; x <keysbi.length; x++) {\n\n\t\t\t\t\t\t\t//VARIABLES\n\t\t\t\t\t\t\tconst keybi = keysbi[x]\n\t\t\t\t\t\t\tconst itembi = datosbi[keybi]\n\n\t\t\t\t\t\t\t//VALIDAMOS QUE EL USAURIO NO TENGA ESE JUEGO EN SU BIBLIOTECA PARA QUE NO APAREZCA EN EL CARRITO\n\t\t\t\t\t\t\tif (itembi.keyG == item.keyGame) {\n\t\t\t\t\t\t\t\texiste= true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//validamos que solo los JUEGOS DEL USUARIO SE CARGUEN AL HTML\n\t\t\t\t\t\tif (user.uid == item.uidUser && existe == false) {\n\n\t\t\t\t\t\t\t//REINICIAMOS A EXISTE\n\t\t\t\t\t\t\texiste = false\n\n\t\t\t\t\t\t\t//INSERTAMOS INFORMACION DE LOS JUEGOS AL HTML\n\t\t\t\t\t\t\thtmlCarrito = `\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class=\"product-name\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"product-detail\">\n\n\t\t\t\t\t\t\t\t\t\t<div class=\"product-thumbnail\" style =\"text-align:center\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"${item.urlGame}\">\n\t\t\t\t\t\t\t\t\t\t\t\t<img src=\"${item.urlGame}\" height=\"150\" width=\"250\">\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t<td class=\"product-price\" style =\"text-align:center\">\n\t\t\t\t\t\t\t\t\t\t<h3 class=\"product-title\" style = \"margin: 31px\">\n\t\t\t\t\t\t\t\t\t\t${item.nombreGame}\n\t\t\t\t\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t<td class=\"product-price\" style =\"text-align:center\" style = \"margin: 31px\">$${item.precioGame}</td>\n\t\t\t\t\t\t\t\t\t\t<td class=\"product-price\" style =\"text-align:center\" style = \"margin: 31px\">${item.fechaAlta}</td>\n\t\t\t\t\t\t\t\t\t\t<td style =\"text-align:center\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"/compra/${item.keyGame}\" class= \"button product-price\"style = \"margin:31px;margin-right:0px; text-align: center;\">Comprar</a>\n\t\t\t\t\t\t\t\t\t\t<a id=\"borrar\" key=\"${key}\" class= \"button product-price\" style = \" text-align: center; background-color: red;\">borrar</a>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t`\n\t\t\t\t\t\t\t//INSERTAMOS TODA LA LISTA DE LOS JUEGOS AL HTML\n\t\t\t\t\t\t\thtml += htmlCarrito\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//INSERTAMOS EL HTML CON LA INFORMACION\n\t\t\t\t\tindex = `\n\t\t\t\t\t\t<div class=\"container\">\n\t\t\t\t\t\t<div class=\"page\">\n\t\t\t\t\t\t<table class=\"cart\" style = \"border-spacing: 0px 20px\">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th class=\"product-name\" style =\"text-align:center\">Caratula</th>\n\t\t\t\t\t\t<th class=\"product-name\" style =\"text-align:center\">Juego</th>\n\t\t\t\t\t\t<th class=\"product-name\" style =\"text-align:center\">Precio</th>\n\t\t\t\t\t\t<th class=\"product-name\" style =\"text-align:center\">Fecha</th>\n\t\t\t\t\t\t<th class=\"product-name\" style =\"text-align:center\">Opciones</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t${html}\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`\n\n\t\t\t\t\t//OBTENEMOS EL MAIN DE LA PAGINA PRINCIPAL PARA INSERTAR EL HTML\n\t\t\t\t\tconst main = document.querySelector('main')\n\t\t\t\t\tmain.innerHTML = index\n\n\n\t\t\t\t\tvar borrarBtn = document.querySelector('#borrar')\n\t\t\t\t\tborrarBtn.addEventListener('click', borrar)\n\t\t\t\t}\n\n\t\t\t\t//HACEMOS REFERENCIA A LA TABLA DE CARRITO PARA OBTENER INFORMACION\n\t\t\t\tdb.ref('carrito').once('value').then(obtenerDatosCarrito)\n\n\t\t\t\tfunction borrar () {\n\n\t\t\t\t\t//VARIABLES\n\t\t\t\t\tlet doc = document;\n\t\t\t\t\tlet key = doc.getElementById('borrar').getAttribute('key')\n\n\t\t\t\t\t//CONFIRMAMOS CON EL USUARIO SI DESEA BORRAR\n\t\t\t\t\tvar confirmarBorrado = confirm(\"¿Esta seguro de Eliminar?\")\n\n\t\t\t\t\t//VERIFICAMOS LA RESPUESTA DEL USUARIO CON EL TEMA DEL BORRADO\n\t\t\t\t\tif (key!=null && confirmarBorrado == true) {\n\n\t\t\t\t\t\t//HACEMOS REFERENCIA A LA TABLA GAMES\n\t\t\t\t\t\tvar ref = db.ref(\"carrito\")\n\n\t\t\t\t\t\t//PROCEDEMOS A BORRAR\n\t\t\t\t\t\tref.child(key).remove()\n\n\t\t\t\t\t\t//REDIRECCIONAMOS A TIENDA\n\t\t\t\t\t\tpage.redirect('/carrito')\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}", "title": "" }, { "docid": "3a6a729bca1bdc3754b641ec205efcf7", "score": "0.5781994", "text": "function prepararDatos(data) {\n // primero guardamos una copia en el controlador para uso futuro.\n self.raw_data = data;\n var n_pasillos = 0;\n if(data.pasillo1){\n n_pasillos++;\n }\n if(data.pasillo2){\n n_pasillos++;\n }\n if(data.pasillo3){\n n_pasillos++;\n }\n if(data.pasillo4){\n n_pasillos++;\n }\n \n data.columnas_sala += n_pasillos;\n\n // Aqui populamos las filas\n for (var j = data.columnas_sala; j > 0; j--) {\n self.filas.push(j);\n };\n \n // Aqui populamos las columnas, \n // Letras para columnas validas, Guión (-) para pasillo.\n \n \n for (var i = data.filas_sala; i > 0; i--) {\n self.columnas.push({\n name: String.fromCharCode(64+i)\n });\n };\n\n // Ahora interpretamos el mapa para armar\n interpretarMapa(data.mapa)\n }", "title": "" }, { "docid": "277aa983467bbaeecc47b88b41068afd", "score": "0.5777137", "text": "function deseneazaTabel(){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//functie care afiseaza datele coresp celor 3 tari pt un interval de timp ales de user\r\n\r\n d3.json('media/date3.json', function (data) {\t\t\t\t\t\t\t\t\t\t//citirea datelor din fisierul JSON\t\t\t\t\t\r\n\r\n var select1 = document.getElementById(\"an1\");\t\t\t\t\t\t\t\t\t//preluarea elem cu id \"an1\"\r\n var an1 = parseInt(select1.options[select1.selectedIndex].text);\t\t\t\t//selectarea valorii coresp anului cu id \"an1\"\r\n var select2 = document.getElementById(\"an2\");\t\t\t\t\t\t\t\t\t//preluarea elem cu id \"an2\"\r\n var an2 = parseInt(select2.options[select2.selectedIndex].text);\t\t\t\t//selectarea valorii coresp anului cu id \"an2\"\r\n\r\n informatie = data.filter(function(val){\t\t\t\t\t\t\t\t\t\t\t//in informatie retin datele din JSON filtrate dupa cei doi ani\r\n return val.an >= an1 && val.an <= an2;\t\t\t\t\t\t\t\t\t\t//sunt returnate doar valorile cuprinse in intervalul [an1, an2] ales de user\r\n });\r\n\r\n function tabulate(informatie, columns) {\t\t\t\t\t\t\t\t\t\t//functie de desenare a unui tabel continand informatie si dupa numele coloanelor(columns)\r\n \t\r\n \tvar oldtable=document.getElementById('mytable');\t\t\t\t\t\t\t//se selecteaza in oldtable elemtul cu id \"mytable\"\r\n \t\r\n \tif(oldtable!=null){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//daca exista deja un astfel de element\r\n \t\t$('#mytable').remove();\t\t\t\t\t\t\t\t\t\t\t\t\t//acesta este sters\r\n \t}\r\n\r\n var table = d3.select('body').append('table');\t\t\t\t\t\t\t\t//pe body se pune un element de tip \"table\"\r\n var thead = table.append('thead');\t\t\t\t\t\t\t\t\t\t\t//tabelului ii adaug un element \"thead\"\r\n var tbody = table.append('tbody');\t\t\t\t\t\t\t\t\t\t\t//tabelului ii adaug un element \"tbody\"\r\n\r\n table.attr(\"id\",\"mytable\");\t\t\t\t\t\t\t\t\t\t\t\t\t//tabelului ii atribui id-ul \"mytable\"\r\n\r\n // append the header row\r\n thead.append('tr')\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n .selectAll('th')\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//la thead apendam tag-ul \"tr\"\r\n .data(columns)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//apoi luam toate coloanele pe care le avem in functie\r\n .enter()\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//si le adaugam la rand folosind tag-ul \"th\"\r\n .append('th')\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n .text(function (column) { return column; });\t\t\t\t\t\t\t\r\n\r\n // create a row for each object in the data\r\n var rows = tbody.selectAll('tr')\t\t\t\t\t\t\t\t\t\t\t//la fiecare rand adauga un tag \"tr\" de fiecare data cand e apelata functia\r\n .data(informatie)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n .enter()\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n .append('tr');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\r\n // create a cell in each row for each column\r\n var cells = rows.selectAll('td')\t\t\t\t\t\t\t\t\t\t\t//selectam fiecare rand pe care l-am adaugat\r\n .data(function (row) {\r\n return columns.map(function (column) {\t\t\t\t\t\t\t\t\t\r\n return {column: column, value: row[column]};\t\t\t\t\t\t\t//intersectia informatiei aflate la linie si coloana(celula)\r\n });\r\n })\r\n .enter()\r\n .append('td')\r\n .text(function (d) { return d.value; });\t\t\t\t\t\t\t\t//ia datele si le pune in celula corespunzatoare din HTML\r\n\r\n return table;\r\n }\r\n\r\n // render the table\r\n tabulate(informatie, ['tara', 'an', 'PIB', 'populatie', 'SV']); \t\t\t\t//deseaza tabelul cu datele preluate din Json si care are 5 coloane: tara, an, Pib, pop, SV\r\n\r\n});\r\n\r\n\r\n}", "title": "" }, { "docid": "20f5cd5208938102c681412ebcf0766a", "score": "0.57736343", "text": "function oduzmi(id) {\n let korpaDemo = document.getElementById(\"korpaDemo\");\n korpaDemo.setAttribute(\"type\", \"number\");\n sumDemo -= 1;\n korpaDemo.innerHTML = sumDemo;\n let proizvodi = korpa.proizvodi;\n // uslovi i petlje za oduzimanje i malo matematike zbog discount-a\n for (const key in proizvodi) {\n console.log(document.getElementById(\"dugmeOduzmi\" + key).value);\n if (proizvodi[key].id == id) {\n if (event.target.value < 1) {\n korpa.suma -= korpa.proizvodi[key].cenaProizvoda;\n korpa.proizvodi.splice(key, 1);\n } else if (korpa.proizvodi[key].value > 1) {\n korpa.proizvodi[key].cenaProizvoda -=\n korpa.proizvodi[key].cenaProizvoda / korpa.proizvodi[key].value;\n korpa.proizvodi[key].value -= 1;\n korpa.suma -=\n korpa.proizvodi[key].cenaProizvoda / korpa.proizvodi[key].value;\n console.log(korpa.proizvodi[key].value);\n } else {\n korpa.suma -= korpa.proizvodi[key].cenaProizvoda;\n korpa.proizvodi[key].cenaProizvoda = 0;\n korpa.proizvodi[key].value = 0;\n }\n break;\n }\n }\n korpaDiv = document.getElementById(\"korpa\");\n korpaDiv.innerHTML = \"\";\n // ovo sluzi da nam korpa ostane otvorena nakon bilo kakvog brisanja proizvoda\n prikaziKorpu();\n document.getElementById(\"cena\").innerHTML =\n \"Ukupna cena: \" + korpa.suma + \" $\";\n}", "title": "" }, { "docid": "3cfa5d67ee23480eb1a30c1237287d26", "score": "0.5770264", "text": "async function hentData() {\n console.log(\"Data fra restdb hentes\");\n const respons = await fetch(url, options);\n sange = await respons.json();\n visSange();\n}", "title": "" }, { "docid": "6a6360ece233094eacdca49fc4be28ae", "score": "0.57657135", "text": "function Sapporo() {\n return {\n \"Namboku\": { \n abbr: \"N\", \n name: \"Namboku\",\n color: \"#008a00\",\n jp: \"南北線\",\n stations: [\n { number: 1, name: \"Asabu\", jp: \"麻生\", km: 0 },\n { number: 2, name: \"Kita-Sanjūyo-Jō\", jp: \"北34条\", km: 1.0 },\n { number: 3, name: \"Kita-Nijūyo-Jō\", jp: \"北24条\", km: 2.2}, \n { number: 4, name: \"Kita-Jūhachi-Jō\", jp: \"北18条\", km: 3.1}, \n { number: 5, name: \"Kita-Jūni-Jō\", jp: \"北12条\", km: 3.9}, \n { number: 6, name: \"Sapporo\", jp: \"さっぽろ\", km: 4.9}, \n { number: 7, name: \"Ōdōri\", jp: \"大通\", km: 5.5}, \n { number: 8, name: \"Susukino\", jp: \"すすきの\", km: 6.1}, \n { number: 9, name: \"Nakajima-Kōen\", jp: \"中島公園\", km: 6.8}, \n { number: 10, name: \"Horohira-Bashi\", jp: \"幌平橋\", km: 7.8}, \n { number: 11, name: \"Nakanoshima\", jp: \"中の島\", km: 8.3}, \n { number: 12, name: \"Hiragishi\", jp: \"平岸\", km: 9.0}, \n { number: 13, name: \"Minami-Hiragishi\", jp: \"南平岸\", km: 10.1}, \n { number: 14, name: \"Sumikawa\", jp: \"澄川\", km: 11.3}, \n { number: 15, name: \"Jieitai-Mae\", jp: \"自衛隊前\", km: 12.6}, \n { number: 16, name: \"Makomanai\", jp: \"真駒内\", km: 14.3} \n ]\n },\n \"Tōzai\": { \n abbr: \"T\", \n name: \"Tōzai\",\n color: \"#ffa900\",\n jp: \"東西線\",\n stations: [\n { number: 1, name: \"Miyanosawa\", jp: \"宮の沢\", km: 0}, \n { number: 2, name: \"Hassamu-Minami\", jp: \"発寒南\", km: 1.5}, \n { number: 3, name: \"Kotoni\", jp: \"琴似\", km: 2.8}, \n { number: 4, name: \"Nijūyon-Ken\", jp: \"二十四軒\", km: 3.7}, \n { number: 5, name: \"Nishi-Nijūhatchōme\", jp: \"西28丁目\", km: 4.9}, \n { number: 6, name: \"Maruyama-Kōen\", jp: \"円山公園\", km: 5.7}, \n { number: 7, name: \"Nishi-Jūhatchōme\", jp: \"西18丁目\", km: 6.6}, \n { number: 8, name: \"Nishi-Jūitchōme\", jp: \"西11丁目\", km: 7.5}, \n { number: 9, name: \"Ōdōri\", jp: \"大通\", km: 8.5}, \n { number: 10, name: \"Bus Center-Mae\", jp: \"バスセンター前\", km: 9.3}, \n { number: 11, name: \"Kikusui\", jp: \"菊水\", km: 10.4}, \n { number: 12, name: \"Higashi-Sapporo\", jp: \"東札幌\", km: 11.6}, \n { number: 13, name: \"Shiroishi\", jp: \"白石\", km: 12.7}, \n { number: 14, name: \"Nangō-Nanachōme\", jp: \"南郷7丁目\", km: 14.1}, \n { number: 15, name: \"Nangō-Jūsanchōme\", jp: \"南郷13丁目\", km: 15.2}, \n { number: 16, name: \"Nangō-Jūhatchōme\", jp: \"南郷18丁目\", km: 16.4}, \n { number: 17, name: \"Ōyachi\", jp: \"大谷地\", km: 17.9}, \n { number: 18, name: \"Hibarigaoka\", jp: \"ひばりが丘\", km: 18.9}, \n { number: 19, name: \"Shin-Sapporo\", jp: \"新さっぽろ\", km: 20.1 }\n ]\n },\n \"Tōhō\" : {\n abbr: \"H\",\n name: \"Tōhō\",\n color: \"#0074ff\",\n jp: \"東豊線\",\n stations: [\n { number: 1, name: \"Sakaemachi\", jp: \"栄町\", km: 0 }, \n { number: 2, name: \"Shindō-Higashi\", jp: \"新道東\", km: 0.9}, \n { number: 3, name: \"Motomachi\", jp: \"元町\", km: 2.1}, \n { number: 4, name: \"Kanjō-Dōri-Higashi\", jp: \"環状通東\", km: 3.5}, \n { number: 5, name: \"Higashi-Kuyakusho-Mae\", jp: \"東区役所前\", km: 4.5}, \n { number: 6, name: \"Kita-Jūsan-Jō-Higashi\", jp: \"北13条東\", km: 5.4}, \n { number: 7, name: \"Sapporo\", jp: \"さっぽろ\", km: 6.7},\n { number: 8, name: \"Ōdōri\", jp: \"大通\", km: 7.3}, \n { number: 9, name: \"Hōsui-Susukino\", jp: \"豊水すすきの\", km: 8.1}, \n { number: 10, name: \"Gakuen-Mae\", jp: \"学園前\", km: 9.5}, \n { number: 11, name: \"Toyohira-Kōen\", jp: \"豊平公園\", km: 10.4}, \n { number: 12, name: \"Misono\", jp: \"美園\", km: 11.4}, \n { number: 13, name: \"Tsukisamu-Chūō\", jp: \"月寒中央\", km: 12.6}, \n { number: 14, name: \"Fukuzumi\", jp: \"福住\", km: 13.6}\n ]\n }\n };\n}", "title": "" }, { "docid": "39eacbf6f5f5ea748e5bd99865d7e89f", "score": "0.5761387", "text": "function hitung_total_laut(){\n\t\t\tvar b_kirim = $(\"#biaya_kirim_laut\").val();\n\t\t\tvar b_packing = $(\"#biaya_packing_laut\").val();\n\t\t\tvar b_asuransi = $(\"#biaya_asuransi_laut\").val();\n\t\t\tvar dibayar = $(\"#dibayar_laut\").val();\n\t\t\tvar totalnya = parseInt(b_kirim) + parseInt(b_packing) + parseInt(b_asuransi);\n\t\t\t$(\"#subtotal_laut\").html(rupiah(totalnya));\n\t\t\t\n\t\t\tif(dibayar >= totalnya){\n\t\t\t\tvar totalakhir = parseInt(dibayar) - totalnya;\n\t\t\t\t$('#status_bayar_laut').val('lunas');\n\t\t\t\t$('#ketuang_laut').html('Kembalian');\n\t\t\t}else{\n\t\t\t\tvar totalakhir = totalnya - parseInt(dibayar);\n\t\t\t\t$('#status_bayar_laut').val('belum_lunas');\n\t\t\t\t$('#ketuang_laut').html('Kekurangan');\n\t\t\t}\n\t\t\t$(\"#total_laut\").html(rupiah(totalakhir));\n\t\t}", "title": "" }, { "docid": "2cfa28a02ba4f84a8c9bf12edaf61fa3", "score": "0.5746033", "text": "function updatetarifparkirmot(){\n readRecords(\"dbmotor\", {Lokasi:getProperty(\"pilihanmotor\",\"text\")}, function(records) {\n var tarifparkirmot = records[0].Tarif_dasar + (durasiparkirmot * records[0].Tarif_perjam);\n setProperty(\"label26\", \"text\", \"Rp\" + tarifparkirmot);\n });\n}", "title": "" }, { "docid": "034f8f919629bb4386889c8255cbe120", "score": "0.5745931", "text": "function getLieu(){\n\n\t\t\t$.getJSON('visualisationLieu.php',function(data) { //récupère l'objet pour executer une fonction que l'on définit \n\n\t\t\t\t$.each(data,function(Titre,val){ //double foreach pour les valeurs function(clé,valeur)\n\n\t\t\t\t\t$.each(val,function(key2,val2){\n\n\t\t\t\t\t\tswitch (key2){\n\t\t\t\t\t\t\tcase \"P\":\n\t\t\t\t\t\t\t\ttabP.push({\n\t\t\t\t\t\t\t\t\tlabel: Titre,\n\t\t\t\t\t\t\t\t\ty: val2\n\t\t\t\t\t\t\t\t}); //ajouter la paire (label,y) au tableau\n\t\t\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase \"R\":\n\t\t\t\t\t\t\t\ttabR.push({\n\t\t\t\t\t\t\t\t\tlabel: Titre,\n\t\t\t\t\t\t\t\t\ty: val2\n\t\t\t\t\t\t\t\t});\t\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\n\n\t\t\t\t\t\t\tcase \"O\":\n\t\t\t\t\t\t\t\ttabO.push({\n\t\t\t\t\t\t\t\t\tlabel: Titre,\n\t\t\t\t\t\t\t\t\ty: val2\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase \"SJ\":\n\t\t\t\t\t\t\t\ttabSJ.push({\n\t\t\t\t\t\t\t\t\tlabel: Titre,\n\t\t\t\t\t\t\t\t\ty: val2\n\t\t\t\t\t\t\t\t});\t\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase \"SA\":\n\t\t\t\t\t\t\t\ttabSA.push({\n\t\t\t\t\t\t\t\t\tlabel: Titre,\n\t\t\t\t\t\t\t\t\ty: val2\n\t\t\t\t\t\t\t\t});\t\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase \"E\":\n\t\t\t\t\t\t\t\ttabE.push({\n\t\t\t\t\t\t\t\t\tlabel: Titre,\n\t\t\t\t\t\t\t\t\ty: val2\n\t\t\t\t\t\t\t\t});\t\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase \"Recette\":\n\t\t\t\t\t\t\t\ttabRecette.push({\n\t\t\t\t\t\t\t\t\tlabel: Titre,\n\t\t\t\t\t\t\t\t\ty: val2\n\t\t\t\t\t\t\t\t});\t\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase \"Depenses\":\n\t\t\t\t\t\t\t\ttabDepenses.push({\n\t\t\t\t\t\t\t\t\tlabel: Titre,\n\t\t\t\t\t\t\t\t\ty: val2\n\t\t\t\t\t\t\t\t});\t\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t//console.log(tabP);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tsetTimeout(function () {console.log(tabP); }, 100);\n\t //console.log(\"tabP :\"+ tabP); //pb de récupération des valeurs à l'extérieur du JSON,json s'éxécute après je javascript donc on met un délai pour récupérer les valeurs avant l'affichage le tableau\n}", "title": "" }, { "docid": "39a20c7613f4af849c6d3450cd87b3be", "score": "0.5740743", "text": "function panggilObjects() {\n var mobil = {\n type: 'Sedan',\n harga: 20000,\n warna: 'Putih',\n tahun: [2000,2001,2002,2003]\n }\n \n console.log(mobil);\n console.log(mobil.warna);\n // console.log(mobil.type);\n // console.log(mobil.harga);\n // console.log(mobil.tahun);\n // console.log(mobil.tahun[0]);\n console.log(mobil.tahun[mobil.tahun.length-1]);\n }", "title": "" }, { "docid": "6b169cb1a01960def826b94f34f9f99d", "score": "0.5731458", "text": "function dibuja(){\r\n\tvar datos,\r\n\t\tv_txt = \"Sin datos\",\r\n\t\tm_txt = \"Sin datos\";\r\n\r\n\tswitch (this.id){ // refresco datos del mapa según botón clickeado\r\n\r\n\t\tcase \"provBtn\":\r\n\t\t\targentina.vista.prov();\r\n\t\t\tdocument.getElementById(\"referenciasVotos\").className = \"descOculto\";\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"partBtn\":\r\n\t\t\targentina.vista.part();\r\n\t\t\tdocument.getElementById(\"referenciasVotos\").className = \"descOculto\";\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"votoBtn\":\r\n\t\t\targentina.vista.voto();\r\n\t\t\tdocument.getElementById(\"referenciasVotos\").className = \"descMuestro\";\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"diputadosBtn\":\r\n\t\t\telecciones.dataset = \"diputados\";\r\n\t\t\t//cambia el display del mapa;\t\r\n\t\t\telecciones.event.viewchange();\r\n \t\t\tbreak;\r\n \t\t\t\r\n\t\tcase \"senadoresBtn\":\r\n\t\t\telecciones.dataset = \"senadores\";\r\n\t\t\t//cambia el display del mapa;\t\r\n\t\t\telecciones.event.viewchange();\r\n \tbreak;\r\n\t}\r\n\t\r\n\tif (elecciones.dataset === \"diputados\") { // elijo dataset según la vista\r\n\r\n\t\tdatos = elecciones.diputados;\r\n\r\n\t} else {\r\n\r\n\t\tdatos = elecciones.senadores;\r\n\r\n\t}\r\n\t\r\n\tif (argentina.selection){ // está en una provincia o localidad\r\n\r\n\t\tdatos = datos[argentina.selection];\r\n\t\tif (datos){\r\n\t\t\t//si hay datos se arman las barras detalladas\r\n\t\t\tm_txt = datos.votacion.mesas.per.toLocaleString() + \"%\";\r\n\t\t\tv_txt = datos.votacion.votos.per.toLocaleString() + \"%\";\r\n\t\t\tdocument.getElementById(\"referenciaBarrasDetalle\").className = \"descMuestro\";\t\t\r\n\r\n\t\t\tif (datos.nivel_administrativo == 2){\r\n\t\t\t\tdocument.getElementById(\"referenciaTotal\").innerHTML = datos.nombre;\r\n\t\t\t}else{\r\n\r\n\t\t\t\tdocument.getElementById(\"referenciaTituloProvincia\").innerHTML = datos.nombre;\r\n\t\t\t\tdocument.getElementById(\"referenciaTotal\").innerHTML = \"\";\r\n\t\t\t};\t\r\n\t\t} else { \r\n\t\t\t// si no hay datos se avisa que no hay datos\r\n\t\t\tdocument.getElementById(\"referenciaTituloProvincia\").innerHTML = argentina.datum.properties.administrative_area[0].name;\r\n\t\t\tdocument.getElementById(\"referenciaTotal\").innerHTML = \"\";\r\n\t\t}\r\n\r\n\t\t\r\n\t}else{ // Se esta viendo el mapa completo\r\n\t\t\r\n\t\tdocument.getElementById(\"referenciaTituloProvincia\").innerHTML = \"RESULTADO GENERAL 2013\";\r\n\t\tdocument.getElementById(\"referenciaTotal\").innerHTML = \"Es la suma de los votos obtenidos en todas las provincias, agupados según la orientación política del voto.\";\r\n\t\tdocument.getElementById(\"referenciaBarrasDetalle\").className = \"descOculto\";\t\t\r\n\t\t\r\n\t\tdatos = datos.TOTALES;\r\n\t\tif (datos){\r\n\t\t\tm_txt = datos.votacion.mesas.per.toLocaleString() + \"%\";\r\n\t\t\tv_txt = datos.votacion.votos.per.toLocaleString() + \"%\";\r\n\t\t}\r\n\t}\r\n\r\n\tdibujaBarras(datos);\r\n\t\r\n\tdocument.getElementById(\"mesas\").innerHTML = m_txt;\r\n\tdocument.getElementById(\"votos\").innerHTML = v_txt;\r\n}", "title": "" }, { "docid": "772894746e0eb7db4bf287e16ece4b99", "score": "0.5730333", "text": "function kapazitaetsplanung() {\r\n\t\t//Fuer die Kapazitaetsberechnung, werden die Produktionsmenge benoetigt\r\n\t\tif(!produktionsliste.length) {\r\n\t\t\tproduktionsplanung();\r\n\t\t}\r\n\t\tkapazitaetsbedarf = [];\r\n\t\t$.getJSON( \"js/core/kapazitaetsberechnung.json\", function( maschinen ) {\r\n\t\t\t$.each(maschinen, function(index, maschine) {\r\n\t\t\t\tvar stunden = maschine.ruestzeit;\r\n\t\t\t\t$.each(maschine.bauteile, function(bauteil, zeitbedarf) {\r\n\t\t\t\t\tfor(var no = 0; no < produktionsliste.length; ++no) {\r\n\t\t\t\t\t\t//Stimmt die Id des Bauteils in der Herstelliste mit der Bauteilid in der KapazitaetsbechnungListe ueberein\r\n\t\t\t\t\t\tif(produktionsliste[no].id.replace(/[a-z]/g, \"\") == (bauteil)) {\r\n\t\t\t\t\t\t\tstunden += zeitbedarf * produktionsliste[no].menge;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t//Teile vor der Maschine werden hinzuaddiert\r\n\t\t\t\tergebnisseletzteperiode.find(\"waitinglistworkstations\").children(\"workplace[id='\" + index + \"']\").each(function(){\r\n\t\t\t\t\tstunden += Number($(this).attr(\"timeneed\"));\r\n\t\t\t\t});\r\n\t\t\t\t//Teile in der Maschine werden hinzuaddiert\r\n\t\t\t\tergebnisseletzteperiode.find(\"ordersinwork\").children(\"workplace[id='\" + index + \"']\").each(function(){\r\n\t\t\t\t\tstunden += Number($(this).attr(\"timeneed\"));\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tvar schicht = 1;\r\n\t\t\t\tvar ueberstunden = 0;\r\n\t\t\t\tif(stunden > 2400 && stunden % 2400 < 1200) {\r\n\t\t\t\t\tschicht = Math.floor(stunden/2400);\r\n\t\t\t\t\tueberstunden = stunden % 2400;\r\n\t\t\t\t}\r\n\t\t\t\tif(stunden > 2400 && stunden % 2400 > 1200) {\r\n\t\t\t\t\tschicht = Math.ceil(stunden/2400);\r\n\t\t\t\t}\r\n\t\t\t\tkapazitaetsbedarfFuerMaschineSpeichern(index, stunden, schicht, ueberstunden);\r\n\t\t\t});\r\n\t\t\tkapazitaetDarstellen();\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "fdb3e9cda35645537fa0dafc98ecc92b", "score": "0.57291466", "text": "function consultarDetalleUni(data) {\n\tconsole.log(data)\n\n\tif (data.estatus>0){\n\t\t\n\t\n\t\tunidad=data.unidad[0];\n\t//\tconsole.log(unidad);\n\t\tcadena=\"\";\n\t\t$(\"#codigoUnidaLLenar\").val(unidad[0]);\n\n\t\tcadena+=\"<div id='detallePen' class='third'>\";\n\t\tcadena+=\"<table id='pesum' class='table table-bordered table-striped table-responsive' style='clear: both'><tbody>\";\n\t\tcadena+=\"<tr><td style='width: 35%;''>Código:</td><td style='width: 65%;'><a href='#'' >\"+unidad[0]+\"</a></td></tr>\";\n\t\tcadena+=\"<tr><td>Código de Ministerio:</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[1]+\"</a></td></tr>\";\n\t\tcadena+=\"<tr><td>Nombre:</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[2]+\"</a></td></tr>\";\t\t\n\t\tcadena+=\"<tr><td>Horas de Trabajo Acompañadas (HTA):</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[3]+\"</a></td></tr>\";\n\t\tcadena+=\"<tr><td>Horas de Trabajo Independiente (HTI):</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[4]+\"</a></td></tr>\";\t\n\t\tcadena+=\"<tr><td>Unidades de Crédito:</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[5]+\"</a></td></tr>\";\t\n\t\tcadena+=\"<tr><td>Duración de Semanas:</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[6]+\"</a></td></tr>\";\n\t\tcadena+=\"<tr><td>Nota Mínima Aprobatoria:</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[7]+\"</a></td></tr>\";\t\n\t\tcadena+=\"<tr><td>Nota Máxima:</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[8]+\"</a></td></tr>\";\n\t\tcadena+=\"<tr><td>Descripción:</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[9]+\"</a></td></tr>\";\n\t\tcadena+=\"<tr><td>Observación:</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[10]+\"</a></td></tr>\";\n\t\tcadena+=\"<tr><td>Contenido:</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[11]+\"</a></td></tr>\";\n\t\tif (data.usada != null){\n\t\t\tusada = data.usada;\n\t\t\tcadena+=\"<tr><td>Usada en pensums:</td><td>\";\n\t\t\tcadena+=\"<a href='#'' >\";\n\t\t\tfor (var i = 0; i < usada.length ; i++) {\t\n\t\t\t\tcadena+=\" (\"+usada[i][0]+\") \";\n\t\t\t}\n\t\t\tcadena+=\"</a></td></tr>\";\n\t\t}else{\n\t\t\tcadena+=\"<tr><td>Usada en pensums:</td><td>\";\n\t\t\tcadena+=\"<a href='#'' > No asiganado ningun pensum</a></td></tr>\";\n\t\t}\n\n\n\t\tcadena+=\"</tbody></table></div>\";\n\t//\t$(\"#detallePen\").html(cadena);\n\t//\talert(cadena);\n\t\t//$(cadena).appendTo('#detallePen');\n\t\t$(\"div.third\").replaceWith(cadena);\n\t\t$( \"#bloqEliEdit\" ).removeClass( \"inactivoA\" );\n\t}\n}", "title": "" }, { "docid": "5cb06eed4a6c3e3c7502294e8139ac1b", "score": "0.57291466", "text": "function consultarDetalleUni(data) {\n\tconsole.log(data)\n\n\tif (data.estatus>0){\n\t\t\n\t\n\t\tunidad=data.unidad[0];\n\t//\tconsole.log(unidad);\n\t\tcadena=\"\";\n\t\t$(\"#codigoUnidaLLenar\").val(unidad[0]);\n\n\t\tcadena+=\"<div id='detallePen' class='third'>\";\n\t\tcadena+=\"<table id='pesum' class='table table-bordered table-striped table-responsive' style='clear: both'><tbody>\";\n\t\tcadena+=\"<tr><td style='width: 35%;''>Código:</td><td style='width: 65%;'><a href='#'' >\"+unidad[0]+\"</a></td></tr>\";\n\t\tcadena+=\"<tr><td>Código de Ministerio:</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[1]+\"</a></td></tr>\";\n\t\tcadena+=\"<tr><td>Nombre:</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[2]+\"</a></td></tr>\";\t\t\n\t\tcadena+=\"<tr><td>Horas de Trabajo Acompañadas (HTA):</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[3]+\"</a></td></tr>\";\n\t\tcadena+=\"<tr><td>Horas de Trabajo Independiente (HTI):</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[4]+\"</a></td></tr>\";\t\n\t\tcadena+=\"<tr><td>Unidades de Crédito:</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[5]+\"</a></td></tr>\";\t\n\t\tcadena+=\"<tr><td>Duración de Semanas:</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[6]+\"</a></td></tr>\";\n\t\tcadena+=\"<tr><td>Nota Mínima Aprobatoria:</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[7]+\"</a></td></tr>\";\t\n\t\tcadena+=\"<tr><td>Nota Máxima:</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[8]+\"</a></td></tr>\";\n\t\tcadena+=\"<tr><td>Descripción:</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[9]+\"</a></td></tr>\";\n\t\tcadena+=\"<tr><td>Observación:</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[10]+\"</a></td></tr>\";\n\t\tcadena+=\"<tr><td>Contenido:</td><td>\";\n\t\tcadena+=\"<a href='#'' >\"+unidad[11]+\"</a></td></tr>\";\n\t\tif (data.usada != null){\n\t\t\tusada = data.usada;\n\t\t\tcadena+=\"<tr><td>Usada en pensums:</td><td>\";\n\t\t\tcadena+=\"<a href='#'' >\";\n\t\t\tfor (var i = 0; i < usada.length ; i++) {\t\n\t\t\t\tcadena+=\" (\"+usada[i][0]+\") \";\n\t\t\t}\n\t\t\tcadena+=\"</a></td></tr>\";\n\t\t}else{\n\t\t\tcadena+=\"<tr><td>Usada en pensums:</td><td>\";\n\t\t\tcadena+=\"<a href='#'' > No asiganado ningun pensum</a></td></tr>\";\n\t\t}\n\n\n\t\tcadena+=\"</tbody></table></div>\";\n\t//\t$(\"#detallePen\").html(cadena);\n\t//\talert(cadena);\n\t\t//$(cadena).appendTo('#detallePen');\n\t\t$(\"div.third\").replaceWith(cadena);\n\t}\n}", "title": "" }, { "docid": "65b94b82f285dc645390123a36bdc237", "score": "0.5725462", "text": "function meGustaElHelado(datosDePersona){\nreturn datosDePersona.leGustaElHelado;\n}", "title": "" }, { "docid": "738e5af1362c81cc9b4ef9b0ff837b83", "score": "0.5723948", "text": "function nimeKontroll(kood){\n\t$.getJSON(\"otsi_nimi.php\",{ikood:kood},function(data){\n\t\tif (data.error==1){\n\t\t\tif (!tootaja.nimi) { //kui on isik kirjas, siis ei kustuta ekraanilt\n\t\t\t\ttootaja.nimi=false;\n\t\t\t\tviga(data.Text, 'yld');\n\t\t\t}else{\n\t\t\t\tviga(data.Text);\n\t\t\t};\t\t\n\t\t}else{\n\t\t\ttootaja.nimi=data[0].nimi;\n\t\t\ttootaja.ikood=data[0].ikood;\n\t\t\ttootaja.tid=data[0].tid;\n\t\t\ttootaja.louna_algus=aeg_minutiks(data[0].lalgus);\n\t\t\ttootaja.louna_lopp=aeg_minutiks(data[0].llopp);\n\t\t\ttootaja.too_algus=aeg_minutiks(data[0].tooalgus);\n\t\t\ttootaja.too_lopp=aeg_minutiks(data[0].toolopp);\n\t\t\ttootaja.aja_algus=aeg_minutiks(data[0].ajaalgus);\n\t\t\tconsole.log(data[0].ajaalgus);\n\t\t\ttootaja.aja_lopp=aeg_minutiks(data[0].ajalopp);\n\t\t\tconsole.log(tootaja);\n\t\t\tselleKuuTunnid(kood); //leiame selle kuu tundide summa\n\t\t\tpoolikToo(tootaja.tid);\n\t\t\t//$(\"#jobText\").slideUp();\n\t\t\t$(\"#nimiText\").html(\"<h1>\"+tootaja.nimi+\"</h>\");\n\t\t\t$(\"#nimiText\").slideDown();\n\t\t}\n\t})\n}", "title": "" }, { "docid": "0a0c3c7be15607a769bb702219607e9b", "score": "0.57225424", "text": "function canvasTarifPlein(){\n\n\t\t\tvar donnees ={\n\t\t\t\t\ttype: \"column\",\n\t\t\t\t\tname: \"Nombre de billets\", \n\t\t\t\t\tdataPoints: tabP\n\t\t\t\t\t}; //jeu données\n\t\t\t\t\t\n\t\t\tchart.options.title.text=\"Nombre de billet Plein Tarif vendu par Lieu\";\n\t\t\tchart.options.data = [];\n\t\t\tchart.options.data.push(donnees);\n\t\t\tchart.options.toolTip.content = popUpPT;\n\n\t\t\tchart.render();\n\t\t}", "title": "" }, { "docid": "5e9516747ce20990a1fec5853a19397d", "score": "0.57198083", "text": "function Angkot(sopir, rute, penumpang, kas) {\n this.sopir = sopir;\n this.rute = rute;\n this.penumpang = penumpang;\n this.kas = kas;\n\n this.penumpangNaik = function (namaPenumpang) {\n this.penumpang.push(namaPenumpang);\n return this.penumpang;\n };\n\n this.penumpangTurun = function (namaPenumpang, bayar) {\n if (this.penumpang.length === 0) {\n alert('angkot masih kosong masbro');\n return false;\n }\n for (let i = 0; i < this.penumpang.length; i++) {\n if (this.penumpang[i] == namaPenumpang) {\n this.penumpang[i] = undefined;\n this.kas += bayar;\n return this.penumpang;\n }\n }\n };\n}", "title": "" }, { "docid": "118ec0ab6af63ac2bcbca4859efa6769", "score": "0.5716865", "text": "function summeRechnenWba2Mat1(data){\n\t\tvar rechnen = data;\n\t\tvar post = '';\n\t\tvar summe = 0;\n\t\tvar anzahl = rechnen.length;\n\t\tfor(i=0; i<anzahl; i++){\n\t\t\tsumme += Number(rechnen[i].bewertung);\n\t\t};\n\t\tpost += '<tr>';\n\t\tpost += '<td>' + anzahl + '</td>';\n\t\tpost += '<td>' + summe/anzahl + '</td>';\n\t\tpost += '<tr>';\n\n\t\t$('#BewertungWba2Mat1 div table tbody').html(post);\n\t}", "title": "" }, { "docid": "df06d3d524b59f574aee98eb41a8ceaa", "score": "0.5715376", "text": "function Puodukas(spalva, maxTuris) {\n this.spalva = spalva;\n this.kiekis = 0;\n this.maxTuris = maxTuris;\n}", "title": "" }, { "docid": "0b56151f7d00ddf390bc11d435471f83", "score": "0.5713161", "text": "function getMatkulTerpilih() {\n let tabel_matakuliah = getId('table-belanja-matakuliah-ppi')\n\n // mengambil data dari table\n return [...tabel_matakuliah.rows]\n .map(column => [...column.children]\n .map(text => text.innerText))\n}", "title": "" }, { "docid": "dee1c9c017530715de036318e743c59a", "score": "0.5711128", "text": "function read() {\r\n let naziv = document.getElementById('naziv');\r\n let vrednost = document.getElementById('vrednost');\r\n let tip = document.querySelector('select').value;\r\n\r\n if (naziv.value.length <= 0 || naziv.value.length >= 15 || vrednost.value.length <= 0 || vrednost.value <= 0 || isNaN(vrednost.value)) {\r\n alert('Molimo unesite ispravne vrednosti');\r\n }\r\n else {\r\n if (tip == 'Dohodak') {\r\n profileModule.addDohodak(naziv.value, parseFloat(vrednost.value));\r\n data.readSingleDohodak();\r\n naziv.value = '';\r\n vrednost.value = '';\r\n data.displayInfo();\r\n\r\n } else\r\n if (tip == 'Rashod') {\r\n profileModule.addRashod(naziv.value, parseFloat(vrednost.value));\r\n data.readSingleRashod();\r\n naziv.value = '';\r\n vrednost.value = '';\r\n data.displayInfo();\r\n }\r\n }\r\n\r\n\r\n }", "title": "" }, { "docid": "817dec059a0994fe5da21d83d74b81fb", "score": "0.5708824", "text": "function setData() {\n\tvar db = Ti.Database.install('sgs2', 'sgs2');\n\tvar rows = db.execute('SELECT * FROM igreja GROUP BY nome ');\n\tvar dataArray = [];\n\n\twhile (rows.isValidRow()) {\n\t\tvar vnome = rows.fieldByName('nome');\n\t\tvar vid = rows.fieldByName('id');\n\t\tdataArray.push({\n\t\t\ttitle : vnome,\n\t\t\thasChild : true,\n\t\t\tid : vid,\n\t\t\tpath : 'detalhedistrito.js'\n\t\t});\n\t\trows.next();\n\t\ttableview.setData(dataArray);\n\t};\n\n}", "title": "" }, { "docid": "fedb9e7aa3215fc560d0cc84fe3ab51d", "score": "0.5693039", "text": "function dataHandling(){\n var input = [\n [\"0001\", \"Roman Alamsyah\", \"Bandar Lampung\", \"21/05/1989\", \"Membaca\"],\n [\"0002\", \"Dika Sembiring\", \"Medan\", \"10/10/1992\", \"Bermain Gitar\"],\n [\"0003\", \"Winona\", \"Ambon\", \"25/12/1965\", \"Memasak\"],\n [\"0004\", \"Bintang Senjaya\", \"Martapura\", \"6/4/1970\", \"Berkebun\"]\n ];\n for (let i = 0; i < 4; i++) {\n console.log (\"Nomor ID: \" + input[i][0]);\n console.log(\"Nama Lengkap: \" + input[i][1]);\n console.log(\"TTL: \" + input[i][2]+ \" \"+input[i][3]);\n console.log (\"Hobi: \" + input[i][4]);\n console.log('\\n');\n }\n}", "title": "" }, { "docid": "38f192eddd8661658b1c34f7fbb96f66", "score": "0.56846744", "text": "constructor(datos, Idtabla, w0, w1, w2, w3, w4, alfa, constante, iniciales) {\n // Cargamos la tabla donde se mostraran los datos de pesos, alfa y constante/decaimiento\n this.iniciales = document.getElementById(iniciales);;\n // Cargamos la tabla donde serán mostrado los datos\n this.tabla = document.getElementById(Idtabla);\n\n // Variables para almacenar alfa y constante/decaimiento\n this.alfa = alfa;\n this.constante = constante;\n\n // Asignamos los datos a una variable\n this.data = datos;\n\n //pesos iniciales\n this.pesosI = [w0, w1, w2, w3, w4]\n\n // Inicializacion de los pesos con su varibale para la suma\n this.w0 = [];\n this.sumaW0 = 0\n this.w1 = [];\n this.sumaW1 = 0\n this.w2 = [];\n this.sumaW2 = 0\n this.w3 = [];\n this.sumaW3 = 0\n this.w4 = [];\n this.sumaW4 = 0\n\n // Vector para la Columna Predicción\n this.prediccion = [];\n\n // Vector para la coulmna Error\n this.error = [];\n\n // Vector para la columna SQR Error\n this.errorCuadrado = [];\n\n // Variable para almacenar la suma de todos los datos del vector errorCuadrado[]\n this.sumaErrorCuadrado = 0;\n\n // Variable para calcular el resultado de sumaErrorCuadrado/2;\n this.sumaErrorCuadrado2 = 0;\n }", "title": "" }, { "docid": "0d28736f2024b1c4be2620d3a200d472", "score": "0.56841224", "text": "function kargatuHizkuntza(beste_hizkuntza, atal_berria)\n{\n \n if ( hizkuntza === null)\n {\n hizkuntza = \"eu\";\n }\n \n aldatuHizkuntzaBotoia();\n hizkuntza = beste_hizkuntza;\n $(\"#content\").load(momentuko_atala + \".php?hizk=\"+ hizkuntza);\n}", "title": "" }, { "docid": "47cb6544afcf090a8266eba70bf5e364", "score": "0.5683729", "text": "function tanaTool(){\n\t$.getJSON(\"tanaTool.php\",function(data){\n\t\tif (data.error==1){\n\t\t\tviga(data.Text, 'yld');\n\t\t}else{\n $(\"#tooLoendur\").html(data[0].tanakokku);\n $('#tooLoendur').html(data[0].tanaKokku);\n\t\t\t$(\"#tooLoendur\").html(data[0].tanakokku);\n\t\t};\n\t});\n}", "title": "" }, { "docid": "db72549aa9f603d20648bf9f140c7ef6", "score": "0.56779784", "text": "function CotaDetalhe(data) {\n if (data) {\n this.setData(data);\n }\n \n this.DADOS = [];\n this.ITENS = [];\n \n\t\tgScope.CotaDetalhe = this; \n \n }", "title": "" }, { "docid": "a80821db387a787533b75a43d95e6260", "score": "0.5675113", "text": "function summeRechnenCgaMat1(data){\n\t\tvar rechnen = data;\n\t\tvar post = '';\n\t\tvar summe = 0;\n\t\tvar anzahl = rechnen.length;\n\t\tfor(i=0; i<anzahl; i++){\n\t\t\tsumme += Number(rechnen[i].bewertung);\n\t\t};\n\t\tpost += '<tr>';\n\t\tpost += '<td>' + anzahl + '</td>';\n\t\tpost += '<td>' + summe/anzahl + '</td>';\n\t\tpost += '<tr>';\n\n\t\t$('#BewertungCgaMat1 div table tbody').html(post);\n\t}", "title": "" }, { "docid": "1e12160abbc48f29565d845ab354e09f", "score": "0.56720513", "text": "function setTrademoodData(data) {\n\t//Si no hay datos de trademood para la divisa\n\tif(!(data.active_id in trade_mood))\n\t trade_mood[data.active_id] = {};\n\n\t//Si no hay datos de trademood para la expiración\n\tif(!(data.expiration in trade_mood[data.active_id])){\n\t trade_mood[data.active_id][data.expiration] = {\n\t call:{\n\t operations:0,\n\t amount:0\n\t },\n\t put:{\n\t operations:0,\n\t amount:0\n\t }\n\t };\n\t}\n\n\ttrade_mood[data.active_id][data.expiration][data.direction]['operations']++;\n\ttrade_mood[data.active_id][data.expiration][data.direction]['amount'] += data.amount_enrolled;\n\n\tshowTradeMood();\n}", "title": "" }, { "docid": "682f712e0a02d845b36ae0b9ee49e079", "score": "0.56589836", "text": "function addData(data, type){\n clearTable();\n let myTable = document.getElementById(\"myTable\");\n let myTbody = document.createElement('tbody');\n myTbody.id = \"tableData\";\n\n data.forEach(element => {\n if(element.entite in listEntite){\n listEntite[element.entite] = element;\n } \n });\n\n Object.keys(listEntite).forEach(element => {\n if(type == 'modif'){\n if(ligneEstVide(listEntite[element]))\n {\n myTbody = addLineModifData(myTbody, element, 0, 0, 0, 0, \"\", 0, 0, \"\", 0, 0);\n }else{\n myTbody = addLineModifData(myTbody, listEntite[element].entite, listEntite[element].instance, \n listEntite[element].affect, listEntite[element].ADSL, listEntite[element].nonADSL, listEntite[element].comment,\n listEntite[element].entraide, listEntite[element].quantAE, listEntite[element].entAE, listEntite[element].majo, \n listEntite[element].sitel);\n }\n }else{\n if(ligneEstVide(listEntite[element]))\n {\n myTbody = addLineResilData(myTbody, element, 0, 0, 0, 0, 0, 0, \"\", 0, 0, \"\", 0, 0);\n }else{\n myTbody = addLineResilData(myTbody, listEntite[element].entite, listEntite[element].instance, \n listEntite[element].affect, listEntite[element].ADSL, listEntite[element].BIC, listEntite[element].EGO, \n listEntite[element].nonADSL, listEntite[element].comment, listEntite[element].entraide, \n listEntite[element].quantAE, listEntite[element].entAE, listEntite[element].majo, listEntite[element].sitel);\n }\n }\n \n });\n\n myTable.appendChild(myTbody);\n}", "title": "" }, { "docid": "8ff1ded7335d574f1881f536885de001", "score": "0.56563556", "text": "function obtenerDatosCarrito (dato) {\n\n\t\t\t\t\t//VARIABLES\n\t\t\t\t\tconst datos = dato.val()\n\t\t\t\t\tconst keys = Object.keys(datos)\n\t\t\t\t\tvar html = ''\n\t\t\t\t\tvar htmlCarrito = ''\n\t\t\t\t\tvar index = ''\n\t\t\t\t\tvar existe = false\n\n\t\t\t\t\t//RECORREMOS LOS DATOS OBTENIDOS DE LA TABLA CARRITO\n\t\t\t\t\tfor( var i = 0; i <keys.length; i++) {\n\n\t\t\t\t\t\t//VARIABLES\n\t\t\t\t\t\tconst key = keys[i]\n\t\t\t\t\t\tconst item = datos[key]\n\t\t\t\t\t\texiste = false\n\n\t\t\t\t\t\t//RECORREMOS LOS DATOS DE BIBLIOTECA\n\t\t\t\t\t\tfor( var x = 0; x <keysbi.length; x++) {\n\n\t\t\t\t\t\t\t//VARIABLES\n\t\t\t\t\t\t\tconst keybi = keysbi[x]\n\t\t\t\t\t\t\tconst itembi = datosbi[keybi]\n\n\t\t\t\t\t\t\t//VALIDAMOS QUE EL USAURIO NO TENGA ESE JUEGO EN SU BIBLIOTECA PARA QUE NO APAREZCA EN EL CARRITO\n\t\t\t\t\t\t\tif (itembi.keyG == item.keyGame) {\n\t\t\t\t\t\t\t\texiste= true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//validamos que solo los JUEGOS DEL USUARIO SE CARGUEN AL HTML\n\t\t\t\t\t\tif (user.uid == item.uidUser && existe == false) {\n\n\t\t\t\t\t\t\t//REINICIAMOS A EXISTE\n\t\t\t\t\t\t\texiste = false\n\n\t\t\t\t\t\t\t//INSERTAMOS INFORMACION DE LOS JUEGOS AL HTML\n\t\t\t\t\t\t\thtmlCarrito = `\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class=\"product-name\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"product-detail\">\n\n\t\t\t\t\t\t\t\t\t\t<div class=\"product-thumbnail\" style =\"text-align:center\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"${item.urlGame}\">\n\t\t\t\t\t\t\t\t\t\t\t\t<img src=\"${item.urlGame}\" height=\"150\" width=\"250\">\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t<td class=\"product-price\" style =\"text-align:center\">\n\t\t\t\t\t\t\t\t\t\t<h3 class=\"product-title\" style = \"margin: 31px\">\n\t\t\t\t\t\t\t\t\t\t${item.nombreGame}\n\t\t\t\t\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t<td class=\"product-price\" style =\"text-align:center\" style = \"margin: 31px\">$${item.precioGame}</td>\n\t\t\t\t\t\t\t\t\t\t<td class=\"product-price\" style =\"text-align:center\" style = \"margin: 31px\">${item.fechaAlta}</td>\n\t\t\t\t\t\t\t\t\t\t<td style =\"text-align:center\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"/compra/${item.keyGame}\" class= \"button product-price\"style = \"margin:31px;margin-right:0px; text-align: center;\">Comprar</a>\n\t\t\t\t\t\t\t\t\t\t<a id=\"borrar\" key=\"${key}\" class= \"button product-price\" style = \" text-align: center; background-color: red;\">borrar</a>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t`\n\t\t\t\t\t\t\t//INSERTAMOS TODA LA LISTA DE LOS JUEGOS AL HTML\n\t\t\t\t\t\t\thtml += htmlCarrito\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//INSERTAMOS EL HTML CON LA INFORMACION\n\t\t\t\t\tindex = `\n\t\t\t\t\t\t<div class=\"container\">\n\t\t\t\t\t\t<div class=\"page\">\n\t\t\t\t\t\t<table class=\"cart\" style = \"border-spacing: 0px 20px\">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th class=\"product-name\" style =\"text-align:center\">Caratula</th>\n\t\t\t\t\t\t<th class=\"product-name\" style =\"text-align:center\">Juego</th>\n\t\t\t\t\t\t<th class=\"product-name\" style =\"text-align:center\">Precio</th>\n\t\t\t\t\t\t<th class=\"product-name\" style =\"text-align:center\">Fecha</th>\n\t\t\t\t\t\t<th class=\"product-name\" style =\"text-align:center\">Opciones</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t${html}\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`\n\n\t\t\t\t\t//OBTENEMOS EL MAIN DE LA PAGINA PRINCIPAL PARA INSERTAR EL HTML\n\t\t\t\t\tconst main = document.querySelector('main')\n\t\t\t\t\tmain.innerHTML = index\n\n\n\t\t\t\t\tvar borrarBtn = document.querySelector('#borrar')\n\t\t\t\t\tborrarBtn.addEventListener('click', borrar)\n\t\t\t\t}", "title": "" }, { "docid": "96a1ef4ebc1a7e7f1c0fe52e735837a4", "score": "0.56521434", "text": "function kretanjeLopte() {\n console.log(lopta.dx);\n console.log(lopta.dy);\n\n lopta.x += lopta.dx;\n lopta.y += lopta.dy;\n\n // udarac od odbojnika\n if (\n // lopta.y + lopta.radius > odbojnik.y &&\n lopta.x - lopta.radius > odbojnik.x &&\n lopta.x + lopta.radius < odbojnik.x + odbojnik.width &&\n lopta.y + lopta.radius > odbojnik.y\n ) {\n lopta.dy = -lopta.brzinaKretanja;\n }\n\n // gornji zid\n if (lopta.y - lopta.radius < 0) {\n lopta.dy = -lopta.dy;\n }\n\n // desni/lijevi zid odbijanje\n if (lopta.x + lopta.radius > c.width || lopta.x - lopta.radius < 0) {\n lopta.dx = -lopta.dx;\n }\n // donji zid\n if (lopta.y + lopta.radius > c.height) {\n lopta.dy = -lopta.dy;\n\n // Nova igra\n rezultat = 0;\n blokoviVidljivi();\n }\n\n // provjera za svaki blok dali je lopta dodirnila\n poljeBlokova.forEach((kolona) => {\n kolona.forEach((data, index) => {\n if (data.vidljiv) {\n if (\n lopta.x - lopta.radius > data.x &&\n lopta.x + lopta.radius < data.x + data.w &&\n lopta.y + lopta.radius > data.y &&\n lopta.y - lopta.radius < data.y + data.h\n ) {\n lopta.dy = -lopta.dy;\n data.vidljiv = false;\n povecajRezultat();\n }\n }\n });\n });\n}", "title": "" }, { "docid": "6a5d19a94f329e288e5e755c07dabb11", "score": "0.5646345", "text": "function TalaoProduzido(data) {\n if (data) {\n this.setData(data);\n }\n this.TOTALIZADOR = {};\n this.DADOS = [];\n }", "title": "" }, { "docid": "ddd0f18f31bc6e6e7679f5d5ca2ced0a", "score": "0.564294", "text": "function loadDataThue() {\n $scope.thue = [];\n if (!tempDataService.tempData('thue')) {\n thueService.getAllData().then(function (successRes) {\n if (successRes && successRes.status === 200 && successRes.data && successRes.data.Status && successRes.data.Data && successRes.data.Data.length > 0) {\n tempDataService.putTempData('thue', successRes.data.Data);\n $scope.thue = successRes.data.Data;\n }\n }, function (errorRes) {\n console.log('errorRes', errorRes);\n });\n } else {\n $scope.thue = tempDataService.tempData('thue');\n }\n }", "title": "" }, { "docid": "19c5bdf65411db6e1c9d58d85f7b76f5", "score": "0.56396556", "text": "procesa() {\n let tempData = this.data.slice(); //Copia del arreglo de datos.\n let offsetY = Math.floor(this.malla.length / 2); //El extra de la malla\n let offsetX = Math.floor(this.malla[0].length / 2);\n\n for (let j = 0; j < this.imgHeight; j++) //Recorre imagen\n for (let i = 0; i < this.imgWidth; i++){\n let pixPos = (i + j*this.imgWidth)*4;\n let res = this.seccion(i, j, offsetX, offsetY, tempData);\n this.data[pixPos] = res[0];\n this.data[pixPos+1] = res[1];\n this.data[pixPos+2] = res[2];\n }\n }", "title": "" }, { "docid": "21e7ce52f6983dd01ee676a1899b01fd", "score": "0.5634729", "text": "function datos() { \n $.ajax({\n url: '?controlador=recomendaciones&accion=itemsFrecuencias',\n method: 'GET',\n \n success: function(frecuencias) {\n arrayFrecuencias=frecuencias;\n /*metodos para entrenamiento*/\n //probabilidad(arrayFrecuencias);\n //calcularProbabilidad();\n\n }\n })\n }", "title": "" }, { "docid": "e770f6f87e72ab1a39c1538196ec8092", "score": "0.56269646", "text": "function revenuLubrifiantParMois(data){\n let arr = JSON.parse(data);\n let revenu = 0\n\n for(let i=0; i<arr.length; i++){\n revenu = parseInt(revenu) + parseInt(arr[i].total_vente)\n }\n\n document.getElementById('revenu-lubrifiant-par-mois').innerHTML = `${revenu} FCFA`\n}", "title": "" }, { "docid": "2d6a19580d09d36710531a3889cd52a8", "score": "0.5625868", "text": "async premaOpisuAPI(data) {\n const podatak = await fetch(\n `https://www.themealdb.com/api/json/v1/1/search.php?s=${data}`\n )\n .then((data) => {\n data = data.json();\n return data;\n })\n .then((data) => {\n return data;\n });\n return podatak;\n }", "title": "" } ]
8a362def05551cd43e41c177ee590ba3
These functions implement the four basic operations the algorithm uses.
[ { "docid": "a7d1b6f6820f1024fe9d6041b4ea4ea6", "score": "0.0", "text": "function md5_cmn(q, a, b, x, s, t)\n{\n return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);\n}", "title": "" } ]
[ { "docid": "0401593c8b327cd71f3de1f77e97fa2d", "score": "0.6074539", "text": "function basicas(number1,number2,op){\n switch(op){\n case 1://Suma\n return number1 + number2;\n case 2://Resta\n return number1 - number2;\n case 3://Mult\n return number1 * number2;\n case 4://div\n return number1 / number2 \n default:\n return -1;//error\n \n }\n}", "title": "" }, { "docid": "d4e78a32c80e672023b993fe5ae48b4a", "score": "0.6000138", "text": "function part1(intData) { \n const operations = {\n 1: sum,\n 2: multiply\n };\n\n function sum(a, b) {\n return intData[a] + intData[b];\n }\n\n function multiply(a,b) {\n return intData[a] * intData[b];\n }\n \n for (let i = 0; i < intData.length; i += 4) {\n if (intData[i] !== 99 && operations[intData[i]]) {\n const operation = operations[intData[i]];\n const pos = intData[i+3] ;\n intData[pos] = operation(intData[i+1], intData[i+2]);\n }\n }\n // console.log(intData[0]);\n return intData[0];\n }", "title": "" }, { "docid": "0052ba3a5bed580f8bf06209c0f8b7be", "score": "0.5950406", "text": "function operations(arg1, arg2, arg3) {\n let n1 = Number(arg1);\n let n2 = Number(arg2);\n let operator = arg3;\n let result = 0\n let num = '';\n if (operator == \"+\") {\n result = n1 + n2;\n if (result % 2 == 0) {\n num = \"even\"\n } else {\n num = \"odd\"\n }\n console.log(`${n1} + ${n2} = ${result} - ${num}`);\n }\n else if (operator == \"-\") {\n result = n1 - n2;\n if (result % 2 == 0) {\n num = \"even\"\n } else {\n num = \"odd\"\n }\n console.log(`${n1} - ${n2} = ${result} - ${num}`);\n } else if (operator == \"*\") {\n result = n1 * n2;\n if (result % 2 == 0) {\n num = \"even\"\n } else {\n num = \"odd\"\n }\n console.log(`${n1} * ${n2} = ${result} - ${num}`);\n } else if (operator == \"/\") {\n if (n2 == 0) {\n console.log(`Cannot divide ${n1} by zero`);\n } else {\n result = (n1 / n2).toFixed(2);\n console.log(`${n1} / ${n2} = ${result}`);\n }\n } else if (operator == \"%\") {\n if (n2 == 0) {\n console.log(`Cannot divide ${n1} by zero`);\n } else {\n result = n1 % n2;\n console.log(`${n1} % ${n2} = ${result}`);\n }\n }\n}", "title": "" }, { "docid": "c5120eab11fe3916763b77d409a30997", "score": "0.5943552", "text": "function basicOp(operation, value1, value2)\n{\nif(operation==='+'){\nlet sum =value1 + value2\nreturn sum\n}else if(operation==='-'){\nlet sum = value1 - value2\nreturn sum\n}else if(operation==='*'){\nlet sum = value1 * value2\nreturn sum\n}else if(operation==='/'){\nlet sum = value1 / value2\nreturn sum\n}else return 'no'\n\n}", "title": "" }, { "docid": "ef7036919d9f35805db5e3b8fe9012bf", "score": "0.5903369", "text": "function part1() {\n let pointerPosition = 0;\n let opcode = input[0];\n \n function fetch(amount, positions=false) {\n let toReturn = [];\n for (let i = 0; i < amount; i++) {\n pointerPosition ++;\n let position = input[pointerPosition]\n toReturn.push(positions ? position : input[position])\n }\n return toReturn;\n }\n let value;\n do {\n switch (opcode) {\n case 1: {\n value = common.sum(fetch(2));\n input[fetch(1, true)[0]] = value;\n break;\n }\n case 2: {\n value = common.multiply(fetch(2));\n input[fetch(1, true)[0]] = value;\n break;\n }\n }\n pointerPosition ++;\n opcode = input[pointerPosition]\n } while (opcode !== 99)\n return input[0];\n}", "title": "" }, { "docid": "3ac6e63ba71b4d57f8712f8099beedb4", "score": "0.57706195", "text": "function basicOp(operation, value1, value2)\n\t{\n\t if (operation == '+'){\n\t return (value1 + value2);\n\t } else if (operation == '-'){\n\t return (value1 - value2);\n\t } else if (operation == '*'){\n\t return (value1 * value2);\n\t } else {\n\t return (value1 / value2);\n\t }\n\t}", "title": "" }, { "docid": "167b85194fb4a12b1eb208220eedb03e", "score": "0.5746062", "text": "function main(array) {\n // array[1] = 12;\n // array[2] = 2;\n // console.log('array length', array.length);\n // console.log('array', array);\n \n let opCodes = new Set([1,2,3,4,99]);\n \n for (let i = 0; i < array.length; i+= 1) {\n \n let instruction = array[i].toString();\n \n // console.log('instruction', instruction);\n let opCode = parseInt(instruction.slice(instruction.length - 2));\n let param = instruction.slice(0,instruction.length - 2);\n // console.log('opcode', opCode);\n\n if (opCode == 1) {\n let a,b;\n if (param == '1') {\n a = 1;\n b = 0;\n } else {\n a = parseInt(param[1] || 0);\n b = parseInt(param[0] || 0);\n }\n \n // console.log('a', a);\n // console.log('b', b);\n //let c = param.length == 0 ? 0 : 1;\n \n let suma = a == 0 ? array[array[i + 1]] : array[i + 1];\n let sumb = b == 0 ? array[array[i + 2]] : array[i + 2];\n \n let sum = suma + sumb;\n if (!sum || sum == -1216) {\n let be = true;\n console.log('here');\n }\n \n\n if (isNaN(sum)) {\n console.log('i', i, array[i + 2], array[array[i+2]], instruction);\n console.log('suma', a, suma,array[i+1]);\n console.log('sumb', b, sumb);\n }\n array[array[i + 3]] = sum;\n i = i + 3;\n }\n if (opCode == 2) {\n let a,b;\n if (param == '1') {\n a = 1;\n b = 0;\n } else {\n a = parseInt(param[1] || 0);\n b = parseInt(param[0] || 0);\n }\n //let c = param.length == 0 ? 0 : 1;\n a = a == 0 ? array[array[i + 1]] : array[i + 1];\n b = b == 0 ? array[array[i + 2]] : array[i + 2];\n let multi = a * b;\n if (!multi || multi == -1216) {\n let be = 'here';\n }\n if (isNaN(multi)) {\n console.log('a', a);\n console.log('b', b);\n }\n // console.log('multi', multi);\n array[array[i + 3]] = multi;\n i = i + 3;\n }\n if (opCode == 3) {\n \n if (i == 0) {\n array[array[i + 1]] = 1;\n } else {\n let val = array[i+1];\n console.log('val', val);\n array[val] = val;\n \n }\n i = i + 1;\n }\n if (opCode == 4) {\n // console.log('i', i);\n if (param.length == 0 ) {\n let val = array[i+1];\n console.log('i', i)\n //console.log('array[i+1', array)\n console.log('output', array[val]);\n i = i + 1;\n } else if (param == '1') {\n console.log('output2', array[i+1]);\n }\n \n }\n if (opCode == 99) {\n break;\n }\n }\n // return array[0];\n}", "title": "" }, { "docid": "b7587591ee512613e1a5f4d9ffccf0bf", "score": "0.5736566", "text": "function opCodes(array) {\r\n\r\n let pointer = 0\r\n\r\n\r\n while(pointer < array.length){\r\n let curr = '' + array[pointer]\r\n\r\n let opCode = curr.slice(-1)\r\n let mode = curr.slice(0,curr.length - 2).split('').reverse()\r\n let total = 0\r\n\r\n pointer++\r\n while(mode.length < 2) mode.push('0')\r\n \r\n if(opCode === '1'){\r\n let mode1 = mode[0]\r\n let mode2 = mode[1]\r\n\r\n let param1 = mode1 === '0' ? array[array[pointer]] : array[pointer]\r\n let param2 = mode2 === '0' ? array[array[pointer + 1]] : array[pointer + 1]\r\n\r\n total = param1 + param2\r\n\r\n pointer += 2\r\n } else if(opCode === '2'){\r\n let mode1 = mode[0]\r\n let mode2 = mode[1]\r\n\r\n let param1 = mode1 === '0' ? array[array[pointer]] : array[pointer]\r\n let param2 = mode2 === '0' ? array[array[pointer + 1]] : array[pointer + 1]\r\n\r\n total = param1 * param2\r\n\r\n pointer += 2\r\n } else if(opCode === '3'){\r\n //Part 1 - Input = 1\r\n //Part 2 - Input = 5\r\n let input = 5\r\n array[array[pointer]] = input\r\n \r\n pointer++\r\n continue;\r\n } else if(opCode === '4'){\r\n if(mode[0] === '1') console.log('OPCODE 04 OUTPUT', array[pointer])\r\n else console.log('OPCODE 4 OUTPUT', array[+array[pointer]])\r\n\r\n pointer++\r\n continue;\r\n } else if(opCode === '5'){\r\n let mode1 = mode[0]\r\n let mode2 = mode[1]\r\n\r\n let param1 = mode1 === '0' ? array[array[pointer]] : array[pointer]\r\n let param2 = mode2 === '0' ? array[array[pointer + 1]] : array[pointer + 1]\r\n\r\n if(param1 !== 0) pointer = param2\r\n else pointer += 2\r\n\r\n continue;\r\n } else if(opCode === '6'){\r\n let mode1 = mode[0]\r\n let mode2 = mode[1]\r\n\r\n let param1 = mode1 === '0' ? array[array[pointer]] : array[pointer]\r\n let param2 = mode2 === '0' ? array[array[pointer + 1]] : array[pointer + 1]\r\n\r\n if(param1 === 0) pointer = param2\r\n else pointer += 2\r\n\r\n continue;\r\n } else if(opCode === '7'){\r\n let mode1 = mode[0]\r\n let mode2 = mode[1]\r\n\r\n let param1 = mode1 === '0' ? array[array[pointer]] : array[pointer]\r\n let param2 = mode2 === '0' ? array[array[pointer + 1]] : array[pointer + 1]\r\n\r\n if(param1 < param2) total = 1\r\n else total = 0\r\n\r\n pointer += 2\r\n } else if(opCode === '8'){\r\n let mode1 = mode[0]\r\n let mode2 = mode[1]\r\n\r\n let param1 = mode1 === '0' ? array[array[pointer]] : array[pointer]\r\n let param2 = mode2 === '0' ? array[array[pointer + 1]] : array[pointer + 1]\r\n\r\n if(param1 === param2) total = 1\r\n else total = 0\r\n\r\n pointer += 2\r\n } else if(curr.slice(-2) === '99'){\r\n console.log('OPCODE 99')\r\n return\r\n } else {\r\n console.log(curr, 'BROKEN OPCODE', pointer)\r\n return;\r\n }\r\n\r\n //Modifies position if the opcode has a 3rd param for address\r\n if(pointer !== array.length) {\r\n let position = array[pointer]\r\n array[position] = total\r\n pointer++\r\n }\r\n }\r\n}", "title": "" }, { "docid": "f406eccc43f624776008f5a0ca9da8ca", "score": "0.5719819", "text": "function intComputer(array, inputs, iPointer = 0) {\n let i = iPointer;\n let result;\n //console.log('array', array);\n while(i < array.length) {\n \n let instruction = array[i].toString();\n \n // console.log('instruction', instruction);\n let opCode = parseInt(instruction.slice(instruction.length - 2));\n let param = instruction.slice(0,instruction.length - 2);\n // console.log('opcode', opCode);\n\n if (opCode == 1) {\n let a,b;\n if (param == '1') {\n a = 1;\n b = 0;\n } else {\n a = parseInt(param[1] || 0);\n b = parseInt(param[0] || 0);\n }\n \n // console.log('a', a);\n // console.log('b', b);\n //let c = param.length == 0 ? 0 : 1;\n \n let suma = a == 0 ? array[array[i + 1]] : array[i + 1];\n let sumb = b == 0 ? array[array[i + 2]] : array[i + 2];\n \n let sum = suma + sumb;\n\n if (isNaN(sum)) {\n console.log('i', i, array[i + 2], array[array[i+2]], instruction);\n console.log('suma', a, suma,array[i+1]);\n console.log('sumb', b, sumb);\n }\n array[array[i + 3]] = sum;\n i = i + 4;\n }\n if (opCode == 2) {\n let a,b;\n if (param == '1') {\n a = 1;\n b = 0;\n } else {\n a = parseInt(param[1] || 0);\n b = parseInt(param[0] || 0);\n }\n //let c = param.length == 0 ? 0 : 1;\n a = a == 0 ? array[array[i + 1]] : array[i + 1];\n b = b == 0 ? array[array[i + 2]] : array[i + 2];\n let multi = a * b;\n \n if (isNaN(multi)) {\n console.log('a', a);\n console.log('b', b);\n }\n // console.log('multi', multi);\n array[array[i + 3]] = multi;\n i = i + 4;\n }\n if (opCode == 3) {\n \n if (inputs.length > 0) {\n array[array[i + 1]] = inputs.shift();\n } else {\n let val = array[i+1];\n console.log('val', val);\n array[val] = val;\n \n }\n \n i = i + 2;\n }\n if (opCode == 4) {\n // console.log('i', i);\n \n if (param.length == 0 ) {\n let val = array[i+1];\n // console.log('i', i)\n //console.log('array[i+1', array)\n // console.log('output', array[val]);\n result = array[val];\n \n } else if (param == '1') {\n // console.log('output2', array[i+1]);\n result = array[i + 1];\n }\n i = i + 2;\n return {result: result, final: false, iPointer: i, array: array.slice()};\n \n }\n if (opCode == 5) {\n let a,b;\n if (param == '1') {\n a = 1;\n b = 0;\n } else {\n a = parseInt(param[1] || 0);\n b = parseInt(param[0] || 0);\n }\n //let c = param.length == 0 ? 0 : 1;\n paramOne = a == 0 ? array[array[i + 1]] : array[i + 1];\n paramTwo = b == 0 ? array[array[i + 2]] : array[i + 2];\n if (paramOne != 0) {\n i = paramTwo;\n } else {\n i = i + 3;\n }\n }\n if (opCode == 6) {\n let a,b;\n if (param == '1') {\n a = 1;\n b = 0;\n } else {\n a = parseInt(param[1] || 0);\n b = parseInt(param[0] || 0);\n }\n //let c = param.length == 0 ? 0 : 1;\n paramOne = a == 0 ? array[array[i + 1]] : array[i + 1];\n paramTwo = b == 0 ? array[array[i + 2]] : array[i + 2];\n if (paramOne == 0) {\n i = paramTwo;\n } else {\n i = i + 3;\n }\n }\n if (opCode == 7) {\n let a,b;\n if (param == '1') {\n a = 1;\n b = 0;\n } else {\n a = parseInt(param[1] || 0);\n b = parseInt(param[0] || 0);\n }\n //let c = param.length == 0 ? 0 : 1;\n paramOne = a == 0 ? array[array[i + 1]] : array[i + 1];\n paramTwo = b == 0 ? array[array[i + 2]] : array[i + 2];\n // paramOne = array[i + 1];\n // paramTwo = array[i + 2];\n array[array[i + 3]] = paramOne < paramTwo ? 1 : 0;\n i = i + 4;\n }\n if (opCode == 8) {\n let a,b;\n if (param == '1') {\n a = 1;\n b = 0;\n } else {\n a = parseInt(param[1] || 0);\n b = parseInt(param[0] || 0);\n }\n //let c = param.length == 0 ? 0 : 1;\n paramOne = a == 0 ? array[array[i + 1]] : array[i + 1];\n paramTwo = b == 0 ? array[array[i + 2]] : array[i + 2];\n array[array[i + 3]] = paramOne == paramTwo ? 1 : 0;\n i = i + 4;\n }\n if (opCode == 99) {\n //break;\n return {result: result, final: true, iPointer: -1, array: array.slice()};\n }\n }\n}", "title": "" }, { "docid": "fc9e82ce78a20922a59dca16cc8b938f", "score": "0.57017666", "text": "test() {\n console.log(\"\\n### TESTING CLASS BasicMath ###\\n\");\n \n this.testMethod(\"#add(v1,v2)\", [\n [\"should return the integer sum of adding integers v1 and v2 correctly\", this.add(1,10), 11],\n [\"should return the integer sum of adding integers v1 and v2 correctly when one is negitive\", this.add(-1,10), 9],\n [\"should return the integer sum of adding integers v1 and v2 correctly when both are negitive\", this.add(-1,-10), -11],\n ]);\n \n this.testMethod(\"#divide(v1,v2)\", [\n [\"should return the integer quotient of v1 divided by v2 correctly\", this.divide(10,2), 5],\n [\"should return the integer quotient of v1 divided by v2 correctly when v1 is negitive\", this.divide(-10,2), -5],\n [\"should return the integer quotient of v1 divided by v2 correctly when v2 is negitive\", this.divide(10,-2), -5],\n [\"should return the integer quotient of v1 divided by v2 correctly when both are negitive\", this.divide(-10,-2), 5],\n [\"should return the integer quotient of v1 divided v2 correctly when v1 is zero\", this.divide(0,1), 0],\n [\"should return the integer quotient of v1 divided v2 correctly when v2 is zero\", this.divide(1,0), Infinity],\n [\"should return the integer quotient of v1 divided v2 correctly when both are zero\", this.divide(0,0), Infinity],\n [\"should return the integer quotient of v1 divided v2 correctly when it results in a fraction\", this.divide(3,2), 1]\n ]);\n \n this.testMethod(\"#multiply(v1,v2)\", [\n [\"should return the integer product of v1 and v2 correctly\", this.multiply(5,6), 30],\n [\"should return the integer product of v1 and v2 correctly when v1 is negitive\", this.multiply(-5,6), -30],\n [\"should return the integer product of v1 and v2 correctly when v2 is negitive\", this.multiply(5,-6), -30],\n [\"should return the integer product of v1 and v2 correctly when both are negitive\", this.multiply(-5,-6), 30],\n [\"should return the integer product of v1 and v2 correctly when v1 is zero\", this.multiply(0,6), 0],\n [\"should return the integer product of v1 and v2 correctly when v2 is zero\", this.multiply(5,0), 0],\n [\"should return the integer product of v1 and v2 correctly when both are zero\", this.multiply(0,0), 0],\n ]);\n\n this.testMethod(\"#subtract(v1,v2)\", [\n [\"should return the integer difference of v2 from v1 correctly\", this.subtract(25,10), 15],\n [\"should return the integer difference of v2 from v1 correctly when one is negitive\", this.subtract(25,-10), 35],\n [\"should return the integer difference of v2 from v1 correctly when both are negitive\", this.subtract(-25,-10), -15],\n ]);\n }", "title": "" }, { "docid": "6c53659b0521dfbb7382f6809b19bf0e", "score": "0.565389", "text": "function Ops() {}", "title": "" }, { "docid": "99003ff4f2ce076b64befbbafd941d28", "score": "0.56516314", "text": "function basicOp(operation, value1, value2){\n if (operation === \"+\"){\n return value1 + value2;\n }\n else if (operation === \"-\"){\n return value1 - value2;\n }\n else if (operation === \"*\"){\n return value1 * value2;\n }\n else if (operation === \"/\"){\n return value1 / value2;\n }\n}", "title": "" }, { "docid": "742bae9c6eea3acebb0207cd98a94ca3", "score": "0.5641711", "text": "function o0(stdlib,o1,buffer) {\n try {\n\"use asm\";\n}catch(e){}\n function add(o2,o3) {\n try {\no2 = +o2;\n}catch(e){}\n try {\nMath.cbrt = +o3;\n}catch(e){}\n try {\nreturn !(new Int32Array(1)['set']);\n}catch(e){}\n }\n \n function o4(o2,o3){\n try {\no2 = +o2;\n}catch(o390){}\n try {\no3 = +o3;\n}catch(e){}\n var o5 = 0.0;\n var o6 = o1;\n try {\no5 = NaN >= new Number(Number.o4);\n}catch(e){}\n try {\nreturn +o5;\n}catch(e){}\n }\n \n var o7 = [add,add,add,add];\n \n \n try {\nreturn this.o497;\n}catch(e){}\n}", "title": "" }, { "docid": "ed80cce7bc8ca099e5431e9e973645ad", "score": "0.5640065", "text": "static transform (operation1, operation2) {\n const ops1 = operation1.ops, ops2 = operation2.ops\n let i1 = 0, i2 = 0\n let op1 = ops1[i1++], op2 = ops2[i2++]\n let ops1prime = [], ops2prime = []\n while (op1 || op2) {\n if (isInsert(op1)) {\n ops1prime.push(op1)\n ops2prime.push(1)\n op1 = ops1[i1++]\n continue\n }\n\n if (isInsert(op2)) {\n ops1prime.push(1)\n ops2prime.push(op2)\n op2 = ops2[i2++]\n continue\n }\n\n if (op1 === undefined || op2 === undefined) {\n throw new Error('Can not transform operations')\n }\n\n const l1 = opLen(op1), l2 = opLen(op2)\n let restOp1, restOp2\n if (l1 > l2) {\n ;[op1, restOp1] = splitOp(op1, l2)\n } else if (l1 < l2) {\n ;[op2, restOp2] = splitOp(op2, l1)\n }\n\n // at this point opLen(op1) === opLen(op2)\n\n if (isModify(op1) && isModify(op2)) {\n const [op1prime, op2prime] = TextOperation.transform(TextOperation.fromJSON(op1), TextOperation.fromJSON(op2))\n ops1prime.push(op1prime.isNoop() ? 1 : op1prime.toJSON())\n ops2prime.push(op2prime.isNoop() ? 1 : op2prime.toJSON())\n } else {\n if (!isDelete(op2)) {\n ops1prime.push(op1)\n }\n if (!isDelete(op1)) {\n ops2prime.push(op2)\n }\n }\n\n op1 = restOp1 || ops1[i1++]\n op2 = restOp2 || ops2[i2++]\n }\n return [new AceOperation(ops1prime), new AceOperation(ops2prime)]\n }", "title": "" }, { "docid": "723d0e8336688c5758c7c553f31ec12f", "score": "0.56313694", "text": "function basicOp(operation, value1, value2)\n{\n // Code\n if( operation == \"+\") {\n return value1 + value2\n }\n if( operation == \"-\") {\n return value1 - value2\n }\n if( operation == \"*\") {\n return value1 * value2\n }\n if( operation == \"/\") {\n return value1 / value2\n }\n}", "title": "" }, { "docid": "b07ff2abd7ec5318e2db216e091f66d2", "score": "0.56210893", "text": "function core(x,len){\n\t\tx[len>>5]|=0x80<<((len)%32);\n\t\tx[(((len+64)>>>9)<<4)+14]=len;\n\t\tvar a= 1732584193;\n\t\tvar b=-271733879;\n\t\tvar c=-1732584194;\n\t\tvar d= 271733878;\n\t\tfor(var i=0; i<x.length; i+=16){\n\t\t\tvar olda=a;\n\t\t\tvar oldb=b;\n\t\t\tvar oldc=c;\n\t\t\tvar oldd=d;\n\n\t\t\ta=FF(a,b,c,d,x[i+ 0],7 ,-680876936);\n\t\t\td=FF(d,a,b,c,x[i+ 1],12,-389564586);\n\t\t\tc=FF(c,d,a,b,x[i+ 2],17, 606105819);\n\t\t\tb=FF(b,c,d,a,x[i+ 3],22,-1044525330);\n\t\t\ta=FF(a,b,c,d,x[i+ 4],7 ,-176418897);\n\t\t\td=FF(d,a,b,c,x[i+ 5],12, 1200080426);\n\t\t\tc=FF(c,d,a,b,x[i+ 6],17,-1473231341);\n\t\t\tb=FF(b,c,d,a,x[i+ 7],22,-45705983);\n\t\t\ta=FF(a,b,c,d,x[i+ 8],7 , 1770035416);\n\t\t\td=FF(d,a,b,c,x[i+ 9],12,-1958414417);\n\t\t\tc=FF(c,d,a,b,x[i+10],17,-42063);\n\t\t\tb=FF(b,c,d,a,x[i+11],22,-1990404162);\n\t\t\ta=FF(a,b,c,d,x[i+12],7 , 1804603682);\n\t\t\td=FF(d,a,b,c,x[i+13],12,-40341101);\n\t\t\tc=FF(c,d,a,b,x[i+14],17,-1502002290);\n\t\t\tb=FF(b,c,d,a,x[i+15],22, 1236535329);\n\n\t\t\ta=GG(a,b,c,d,x[i+ 1],5 ,-165796510);\n\t\t\td=GG(d,a,b,c,x[i+ 6],9 ,-1069501632);\n\t\t\tc=GG(c,d,a,b,x[i+11],14, 643717713);\n\t\t\tb=GG(b,c,d,a,x[i+ 0],20,-373897302);\n\t\t\ta=GG(a,b,c,d,x[i+ 5],5 ,-701558691);\n\t\t\td=GG(d,a,b,c,x[i+10],9 , 38016083);\n\t\t\tc=GG(c,d,a,b,x[i+15],14,-660478335);\n\t\t\tb=GG(b,c,d,a,x[i+ 4],20,-405537848);\n\t\t\ta=GG(a,b,c,d,x[i+ 9],5 , 568446438);\n\t\t\td=GG(d,a,b,c,x[i+14],9 ,-1019803690);\n\t\t\tc=GG(c,d,a,b,x[i+ 3],14,-187363961);\n\t\t\tb=GG(b,c,d,a,x[i+ 8],20, 1163531501);\n\t\t\ta=GG(a,b,c,d,x[i+13],5 ,-1444681467);\n\t\t\td=GG(d,a,b,c,x[i+ 2],9 ,-51403784);\n\t\t\tc=GG(c,d,a,b,x[i+ 7],14, 1735328473);\n\t\t\tb=GG(b,c,d,a,x[i+12],20,-1926607734);\n\n\t\t\ta=HH(a,b,c,d,x[i+ 5],4 ,-378558);\n\t\t\td=HH(d,a,b,c,x[i+ 8],11,-2022574463);\n\t\t\tc=HH(c,d,a,b,x[i+11],16, 1839030562);\n\t\t\tb=HH(b,c,d,a,x[i+14],23,-35309556);\n\t\t\ta=HH(a,b,c,d,x[i+ 1],4 ,-1530992060);\n\t\t\td=HH(d,a,b,c,x[i+ 4],11, 1272893353);\n\t\t\tc=HH(c,d,a,b,x[i+ 7],16,-155497632);\n\t\t\tb=HH(b,c,d,a,x[i+10],23,-1094730640);\n\t\t\ta=HH(a,b,c,d,x[i+13],4 , 681279174);\n\t\t\td=HH(d,a,b,c,x[i+ 0],11,-358537222);\n\t\t\tc=HH(c,d,a,b,x[i+ 3],16,-722521979);\n\t\t\tb=HH(b,c,d,a,x[i+ 6],23, 76029189);\n\t\t\ta=HH(a,b,c,d,x[i+ 9],4 ,-640364487);\n\t\t\td=HH(d,a,b,c,x[i+12],11,-421815835);\n\t\t\tc=HH(c,d,a,b,x[i+15],16, 530742520);\n\t\t\tb=HH(b,c,d,a,x[i+ 2],23,-995338651);\n\n\t\t\ta=II(a,b,c,d,x[i+ 0],6 ,-198630844);\n\t\t\td=II(d,a,b,c,x[i+ 7],10, 1126891415);\n\t\t\tc=II(c,d,a,b,x[i+14],15,-1416354905);\n\t\t\tb=II(b,c,d,a,x[i+ 5],21,-57434055);\n\t\t\ta=II(a,b,c,d,x[i+12],6 , 1700485571);\n\t\t\td=II(d,a,b,c,x[i+ 3],10,-1894986606);\n\t\t\tc=II(c,d,a,b,x[i+10],15,-1051523);\n\t\t\tb=II(b,c,d,a,x[i+ 1],21,-2054922799);\n\t\t\ta=II(a,b,c,d,x[i+ 8],6 , 1873313359);\n\t\t\td=II(d,a,b,c,x[i+15],10,-30611744);\n\t\t\tc=II(c,d,a,b,x[i+ 6],15,-1560198380);\n\t\t\tb=II(b,c,d,a,x[i+13],21, 1309151649);\n\t\t\ta=II(a,b,c,d,x[i+ 4],6 ,-145523070);\n\t\t\td=II(d,a,b,c,x[i+11],10,-1120210379);\n\t\t\tc=II(c,d,a,b,x[i+ 2],15, 718787259);\n\t\t\tb=II(b,c,d,a,x[i+ 9],21,-343485551);\n\n\t\t\ta=base.addWords(a, olda);\n\t\t\tb=base.addWords(b, oldb);\n\t\t\tc=base.addWords(c, oldc);\n\t\t\td=base.addWords(d, oldd);\n\t\t}\n\t\treturn [a,b,c,d];\n\t}", "title": "" }, { "docid": "60208e9ccab21b60b38c9c85cb639d53", "score": "0.5607476", "text": "function main() {\r\n let output = add(10, 20);\r\n console.log(\"Add\", output);\r\n \r\n let soutput = subtract(50, 10);\r\n console.log(\"Difference\", soutput);\r\n }", "title": "" }, { "docid": "d3ce47181f1f22def4ec71054c9d99a8", "score": "0.560034", "text": "function homeWork(){\r\n var numbers = [23,45,23,56,2,-34,8,1,-12,2,123,9045,546,34,-123];\r\n\r\n // 1 find the smallest\r\n var smallest = numbers[0];\r\n for(var i=0; i < numbers.length; i++){\r\n var n = numbers[i];\r\n if(n < smallest) smallest = n;\r\n }\r\n console.log(\"The Smallest: \", smallest);\r\n // 2 the biggest\r\n var biggest = numbers[0];\r\n for(var i=0; i < numbers.length; i++){\r\n var n = numbers[i];\r\n if(n > biggest) biggest = n;\r\n }\r\n console.log(\"The Biggest: \", biggest);\r\n // 3 the sum of them all\r\n var sum = numbers.reduce(function(a, b){\r\n return a + b;\r\n }, 0);\r\n console.log(\"The Sum: \", sum);\r\n // 4 the multiplication of them all\r\n var multi = mathLib.multiply(numbers)\r\n console.log(\"The answer of multiplying\", multi);\r\n // 5 non positive (lower than 0)\r\n\r\n // print the odd numbers\r\n \r\n}", "title": "" }, { "docid": "50af92f0bc7dfc68970afe35fe33b8fd", "score": "0.5580921", "text": "function o215(o216, o97, o217, o114) {\n var o218, o85;\n try {\nif (typeof o216 === 'number') {\n try {\no218 = true;\n}catch(e){}\n try {\no85 = o216;\n}catch(e){}\n } else {\n try {\no218 = false;\n}catch(e){}\n try {\no85 = o216.length;\n}catch(e){}\n }\n}catch(e){}\n\n var o219 = typeof o97 === 'string' ? o97 : null;\n\n var o30;\n try {\nif (o217 == o214) {\n try {\no30 = o114;\n}catch(e){}\n } else {\n try {\no30 = [o220, o48.o140, o48.o141, o48.o143][o217 === undefined ? o212 : o217](Math.o75(o85, o219 ? 1 : o97.length));\n}catch(e){}\n }\n}catch(e){}\n\n try {\nif (o218) {\n var o114 = o30,\n o221;\n try {\no73((o30 & 3) == 0);\n}catch(e){}\n try {\no221 = o30 + (o85 & ~3);\n}catch(e){}\n try {\nfor (; o114 < o221; o114 += 4) {\n try {\no202[((o114) >> 2)] = 0;\n}catch(e){}\n }\n}catch(e){}\n try {\no221 = o30 + o85;\n}catch(e){}\n try {\nwhile (o114 < o221) {\n try {\no200[((o114++) | 0)] = 0;\n}catch(e){}\n }\n}catch(e){}\n try {\nreturn o30;\n}catch(e){}\n }\n}catch(e){}\n\n try {\nif (o219 === 'i8') {\n try {\nif (o216.subarray || o216.slice) {\n try {\no222.set(o216, o30);\n}catch(e){}\n } else {\n try {\no222.set(new Uint8Array(o216), o30);\n}catch(e){}\n }\n}catch(e){}\n try {\nreturn o30;\n}catch(e){}\n }\n}catch(e){}\n\n var o82 = 0,\n type, o223, o224;\n try {\nwhile (o82 < o85) {\n var o99 = o216[o82];\n\n try {\nif (typeof o99 === 'function') {\n try {\no99 = o48.o225(o99);\n}catch(e){}\n }\n}catch(e){}\n\n try {\ntype = o219 || o97[o82];\n}catch(e){}\n try {\nif (type === 0) {\n try {\no82++;\n}catch(e){}\n try {\ncontinue;\n}catch(e){}\n }\n}catch(e){}\n\n try {\nif (type == 'i64') try {\ntype = 'i32';\n}catch(e){}\n}catch(e){} // special case: we have one i32 here, and one i32 later\n\n try {\no198(o30 + o82, o99, type);\n}catch(e){}\n\n // no need to look up size unless type changes, so cache it\n try {\nif (o224 !== type) {\n try {\no223 = o48.o70(type);\n}catch(e){}\n try {\no224 = type;\n}catch(e){}\n }\n}catch(e){}\n try {\no82 += o223;\n}catch(e){}\n }\n}catch(e){}\n\n try {\nreturn o30;\n}catch(e){}\n}", "title": "" }, { "docid": "3859facb50cc3375bcadc56241d2fc83", "score": "0.5577428", "text": "function calculateResults() {\n // 1\n function multDivOperation(index) {\n var subvalue = 0\n var truevalue = 0\n switch(trace.firstArg[index]) {\n case \"times\":\n subvalue = recursiveOps(trace.times[index],false,0,\"times\")\n if (trace.divide[index].length) {\n truevalue = recursiveOps(trace.divide[index],true,subvalue,\"divide\")\n } else {\n truevalue = subvalue\n }\n break\n case \"divide\" :\n subvalue = recursiveOps(trace.divide[index],false,0,\"divide\")\n if (trace.times[index].length) {\n truevalue = recursiveOps(trace.times[index],true,subvalue,\"times\")\n } else {\n truevalue = subvalue\n }\n break\n default :\n console.log(\"get real\")\n }\n return truevalue\n }\n // 2\n function substitutionOperation() {\n var newbacktrace = trace.backtrace\n var returnbacktrace = []\n var subVal = 0\n for (let ii = 0; ii < trace.indexIndex.length; ii++) {\n subVal = multDivOperation(ii)\n trace.subVals.push(subVal)\n for (let iii = 0; iii < trace.indexIndex[ii].length; iii++) {\n newbacktrace[trace.indexIndex[ii][iii]] = iii == 0? subVal : null\n }\n }\n for (let v = 0; v < newbacktrace.length; v++) {\n if (newbacktrace[v] != null) {\n returnbacktrace.push(newbacktrace[v])\n }\n }\n return returnbacktrace\n }\n // 3\n function traceOperation(index,isNewStage,isMultDiv) {\n var verb = trace.backtrace[index].slice(1,trace.backtrace[index].length-1)\n if (isNewStage) {\n if (isMultDiv) {\n trace.times.push([])\n trace.divide.push([])\n trace.indexIndex.push([])\n if (!trace.firstArg[trace.times.length-1]) {\n trace.firstArg.push(verb)\n }\n trace[verb][trace[verb].length-1].push(\n trace.backtrace[index-1],\n trace.backtrace[index+1]\n )\n trace.indexIndex[trace.indexIndex.length-1].push(index-1,index,index+1)\n }\n } else if (isMultDiv) {\n trace[verb][trace[verb].length-1].push(trace.backtrace[index+1])\n trace.indexIndex[trace[verb].length-1].push(index,index+1)\n } else {\n }\n }\n /*\n //_calculateResults _M__A__I__N_\n */\n // 4\n var sumArr = []\n var summary = []\n var sum = 0\n // 5\n trace.indexMultDiv = false\n if (trace.backtrace.length == 2 && trace.backtrace[1] == \"&equals;\") {\n sum = trace.backtrace[0]\n } else {\n if (controller.lineCalc == true) {\n sum = trace.lineCalcSubTotal()\n trace.total = sum\n } else {\n for (let i = 1; i < trace.backtrace.length; i+=2) {\n switch(trace.backtrace[i]) {\n case \"&plus;\" :\n case \"&minus;\" :\n if (trace.indexMultDiv == true) {\n trace.indexMultDiv = false\n traceOperation(i,true,trace.indexMultDiv)\n } else {\n traceOperation(i,false,trace.indexMultDiv)\n }\n break\n case \"&times;\" :\n case \"&divide;\" :\n if (trace.indexMultDiv == false) {\n trace.indexMultDiv = true\n traceOperation(i,true,trace.indexMultDiv)\n } else {\n traceOperation(i,false,trace.indexMultDiv)\n }\n break;\n default :\n }\n }\n summary = substitutionOperation()\n for (let i = 0; i < summary.length; i+=2) {\n if (i != 0 && summary[i-1] == \"&minus;\") {\n sumArr.push(summary[i] - (summary[i]*2))\n } else {\n sumArr.push(summary[i])\n }\n }\n sum = recursiveOps(sumArr,false,0,\"sum\")\n trace.total = sum\n }\n }\n trace.reRack()\n return sum\n }", "title": "" }, { "docid": "d78929c85c7a1ba84fb154becbbadb3e", "score": "0.55768275", "text": "function calculate() {\n for (var i = 0; i < elementsArray.length; i++) {\n if (elementsArray[i] == \"*\") {\n multiply(i - 1, i + 1);\n i = i - 2;\n } else if (elementsArray[i] == \"/\") {\n divide(i - 1, i + 1);\n i = i - 2;\n }\n };\n for (var i = 0; i < elementsArray.length; i++) {\n if (elementsArray[i] == \"+\") {\n add(i - 1, i + 1);\n i = i - 2;\n } else if (elementsArray[i] == \"-\") {\n substract(i - 1, i + 1);\n i = i - 2;\n }\n }\n }", "title": "" }, { "docid": "df6de07bad51455bee24697a5dd28cb5", "score": "0.55705047", "text": "function orderOperations () {\n return (2 + 2) * (2 + 2) * 2\n }", "title": "" }, { "docid": "4962ea124ce5a53c8bc457c5e5dfab20", "score": "0.5555856", "text": "function doOperation (operation) {\r\n\t if (operation == 'plus') {\r\n\t\t return previousNum+currentNum;\r\n\t }\r\n\t else if (operation == 'minus') {\r\n\t\t return previousNum-currentNum;\r\n\t }\r\n\t else if (operation == 'multiply') {\r\n\t\t return previousNum*currentNum;\r\n\t }\r\n\t else if (operation == 'divide') {\r\n\t\t return previousNum/currentNum;\r\n\t }\t\t\t\r\n\t}", "title": "" }, { "docid": "fa41855050fd4dd5628b25910fba923f", "score": "0.55399156", "text": "function compute(method,a,b){\n\t//a = 1\n\tif(method === 'add'){\n a = 100 - a;// i have to modify it \n //a --> 99\n\t\treturn sum(a,b);\n\t}else if(method === 'subtract'){\n\t\treturn diff(a,b);\n\t}\n\n}", "title": "" }, { "docid": "47863ca9e3773c3b139c2e19605678e1", "score": "0.553837", "text": "function calculate() {\r\n\r\n //do divisions\r\n for (var j = 0; j < operators.length; j++) {\r\n if (floats.length === 1) {\r\n break;\r\n }\r\n\r\n if (operators[j] === \"divide\") {\r\n var toSplice = floats[j] / floats[j + 1];\r\n floats.splice(j, 2, toSplice);\r\n operators.splice(j, 1);\r\n j--;\r\n }\r\n }\r\n\r\n //do multiplication\r\n for (var j = 0; j < operators.length; j++) {\r\n if (floats.length === 1) {\r\n break;\r\n }\r\n\r\n if (operators[j] === \"multiply\") {\r\n var toSplice = floats[j] * floats[j + 1];\r\n floats.splice(j, 2, toSplice);\r\n operators.splice(j, 1);\r\n j--;\r\n }\r\n }\r\n\r\n //do addition\r\n for (var j = 0; j < operators.length; j++) {\r\n if (floats.length === 1) {\r\n break;\r\n }\r\n\r\n if (operators[j] === \"plus\") {\r\n var toSplice = floats[j] + floats[j + 1];\r\n floats.splice(j, 2, toSplice);\r\n operators.splice(j, 1);\r\n j--;\r\n }\r\n }\r\n\r\n //do subtraction\r\n for (var j = 0; j < operators.length; j++) {\r\n if (floats.length === 1) {\r\n break;\r\n }\r\n\r\n if (operators[j] === \"minus\") {\r\n var toSplice = floats[j] - floats[j + 1];\r\n floats.splice(j, 2, toSplice);\r\n operators.splice(j, 1);\r\n j--;\r\n }\r\n }\r\n\r\n chars = [floats[0]];\r\n return floats[0];\r\n}", "title": "" }, { "docid": "44634d9646b68febb9ca09fd51145759", "score": "0.55330336", "text": "function operaciones(){\n var array = [6, \"pepe\", 2, \"juan\"];\n\n//suma\nvar suma=0;\nsuma +=array[0]+array[2];\nconsole.log(\"el resultado de la suma es \"+suma);\ndocument.write(\"el resultado de la suma es \"+suma+\"<br><br>\");\n\n\n//resta\nvar resta=0;\nresta =array[0]-array[2];\nconsole.log(\"el resultado de la resta es \"+resta);\ndocument.write(\"el resultado de la resta es \"+resta+\"<br><br>\");\n\n\n//multiplicacion\nvar multiplicacion=0;\nmultiplicacion =array[0]*array[2];\nconsole.log(\"el resultado de la multiplicacion es \"+multiplicacion);\ndocument.write(\"el resultado de la multiplicacion es \"+multiplicacion+\"<br><br>\");\n\n\n//division\nvar division=0;\ndivision =array[0]/array[2];\nconsole.log(\"el resultado de la divison es \"+division);\ndocument.write(\"el resultado de la divison es \"+division+\"<br><br>\");\n}", "title": "" }, { "docid": "924e7614ff22d0bc71926c042a09da9c", "score": "0.5523733", "text": "function tracing4core(n1, n2, n3, n4, o1, o2, o3, o4) {\n var debug = function() {};\n // var debug = console.log.bind(console);\n\n var useGreedy = false; // greedy or permutation?\n var safety;\n\n var old_el = [o1, o2, o3, o4];\n var new_el = [n1, n2, n3, n4];\n\n // first we leave everything to input\n if (tracingInitial)\n return new_el;\n\n var res, dist, i, j, distMatrix;\n var min_cost = 0;\n\n if (useGreedy) {\n safety = 3;\n res = new_el;\n for (i = 0; i < 4; i++) {\n var idx = i;\n var min_dist = List.projectiveDistMinScal(old_el[i], res[i]);\n for (j = i + 1; j < 4; j++) {\n dist = List.projectiveDistMinScal(old_el[i], res[j]);\n if (dist < min_dist) {\n idx = j;\n min_dist = dist;\n }\n }\n // swap elements\n var tmp = res[i];\n res[i] = res[idx];\n res[idx] = tmp;\n min_cost += min_dist;\n }\n } else {\n safety = 1;\n\n // build dist matrix\n distMatrix = new Array(4);\n for (i = 0; i < 4; i++) {\n distMatrix[i] = new Array(4);\n for (j = 0; j < 4; j++) {\n dist = List.projectiveDistMinScal(old_el[i], new_el[j]);\n distMatrix[i][j] = dist;\n }\n }\n\n var bestperm = minCostMatching(distMatrix);\n res = new Array(4);\n for (i = 0; i < 4; ++i) {\n res[i] = new_el[bestperm[i]];\n min_cost += distMatrix[i][bestperm[i]];\n }\n } // end use greedy\n\n // assume now we have machting between res and old_el\n var need_refine = false;\n var match_cost = min_cost * safety;\n var odist = Infinity;\n var ndist = Infinity;\n\n for (i = 0; i < 4; i++) {\n if (need_refine) break;\n if (List._helper.isNaN(new_el[i])) {\n // Something went very wrong, numerically speaking. We have no\n // clue whether refining will make things any better, so we\n // assume it won't and give up.\n debug(\"Tracing failed due to NaNs.\");\n tracingFailed = true;\n return res;\n }\n for (j = i + 1; j < 4; j++) {\n dist = List.projectiveDistMinScal(old_el[i], old_el[j]); // do1o2...\n if (odist > dist) odist = dist;\n dist = List.projectiveDistMinScal(res[i], res[j]); // dn1n2...\n if (ndist > dist) ndist = dist;\n }\n }\n\n if (traceLog && traceLog.currentStep) {\n var logRow = [\n traceLog.labelTracing4, // 1\n General.wrap(traceLog.currentElement.name), // 2\n List.turnIntoCSList(res), // 3\n List.turnIntoCSList(old_el), // 4\n List.realMatrix(distMatrix), // 5\n General.wrap(min_cost), // 6\n General.wrap(odist), // 7\n General.wrap(ndist), // 8\n nada, // will become the outcome message // 9\n ];\n traceLog.currentStep.push(List.turnIntoCSList(logRow));\n debug = function(msg) {\n if (!traceLog.hasOwnProperty(msg))\n traceLog[msg] = General.wrap(msg);\n logRow[logRow.length - 1] = traceLog[msg];\n // Evil: modify can break copy on write! But it's safe here.\n };\n }\n\n if (odist > match_cost && ndist > match_cost) {\n // Distance within matching considerably smaller than distance\n // across matching, so we could probably match correctly.\n //debug(\"Normal case, everything all right.\");\n } else if (ndist < 1e-5) {\n // New points too close: we presumably are inside a singularity.\n if (odist < 1e-5) {\n // The last \"good\" position was already singular.\n // Nothing we can do about this.\n debug(\"Staying inside singularity.\");\n } else {\n // We newly moved into the singularity. New position is\n // not \"good\", but refining won't help since the endpoint\n // is singular.\n debug(\"Moved into singularity.\");\n tracingFailed = true;\n }\n } else if (odist < 1e-5) {\n // We just moved out of a singularity. Things can only get\n // better. If the singular situation was \"good\", we stay\n // \"good\", and keep track of things from now on.\n debug(\"Moved out of singularity.\");\n } else {\n if (noMoreRefinements)\n debug(\"Reached refinement limit, giving up.\");\n else\n debug(\"Need to refine.\");\n requestRefinement();\n\n }\n return res;\n}", "title": "" }, { "docid": "bc2cd3d7aef85424f1a16b94685d47f3", "score": "0.55125254", "text": "function mathOperation2(a, b, c) {\n return a + b - c;\n}", "title": "" }, { "docid": "d7ae7e58618bb06779031df7428b8fd7", "score": "0.55123943", "text": "add(other) {\n const { px: X1, py: Y1, pz: Z1 } = this; // free formula from Renes-Costello-Batina\n const { px: X2, py: Y2, pz: Z2 } = isPoint(other); // https://eprint.iacr.org/2015/1060, algo 1\n const { a, b } = CURVE; // Cost: 12M + 0S + 3*a + 3*b3 + 23add\n let X3 = 0n, Y3 = 0n, Z3 = 0n;\n const b3 = mod(b * 3n);\n let t0 = mod(X1 * X2), t1 = mod(Y1 * Y2), t2 = mod(Z1 * Z2), t3 = mod(X1 + Y1); // step 1\n let t4 = mod(X2 + Y2); // step 5\n t3 = mod(t3 * t4);\n t4 = mod(t0 + t1);\n t3 = mod(t3 - t4);\n t4 = mod(X1 + Z1);\n let t5 = mod(X2 + Z2); // step 10\n t4 = mod(t4 * t5);\n t5 = mod(t0 + t2);\n t4 = mod(t4 - t5);\n t5 = mod(Y1 + Z1);\n X3 = mod(Y2 + Z2); // step 15\n t5 = mod(t5 * X3);\n X3 = mod(t1 + t2);\n t5 = mod(t5 - X3);\n Z3 = mod(a * t4);\n X3 = mod(b3 * t2); // step 20\n Z3 = mod(X3 + Z3);\n X3 = mod(t1 - Z3);\n Z3 = mod(t1 + Z3);\n Y3 = mod(X3 * Z3);\n t1 = mod(t0 + t0); // step 25\n t1 = mod(t1 + t0);\n t2 = mod(a * t2);\n t4 = mod(b3 * t4);\n t1 = mod(t1 + t2);\n t2 = mod(t0 - t2); // step 30\n t2 = mod(a * t2);\n t4 = mod(t4 + t2);\n t0 = mod(t1 * t4);\n Y3 = mod(Y3 + t0);\n t0 = mod(t5 * t4); // step 35\n X3 = mod(t3 * X3);\n X3 = mod(X3 - t0);\n t0 = mod(t3 * t1);\n Z3 = mod(t5 * Z3);\n Z3 = mod(Z3 + t0); // step 40\n return new Point(X3, Y3, Z3);\n }", "title": "" }, { "docid": "2313127e6968ddfb157bd1cb5b503991", "score": "0.55118585", "text": "function basicOp(operation, value1, value2) {\n switch (operation) {\n case \"+\":\n return value1 + value2;\n case \"-\":\n return value1 - value2;\n case \"*\":\n return value1 * value2;\n case \"/\":\n return value1 / value2;\n default:\n return 0;\n }\n}", "title": "" }, { "docid": "a72b6f2f32a434c6d59797c8fcf15d54", "score": "0.5473437", "text": "function basicOp(operation, value1, value2) {\n if (operation === \"+\") {\n return value1 + value2;\n }\n if (operation === \"-\") {\n return value1 - value2;\n }\n if (operation === \"*\") {\n return value1 * value2;\n }\n if (operation === \"/\") {\n return value1 / value2;\n } else {\n console.log(\"Invalid operator\");\n }\n}", "title": "" }, { "docid": "584565eae611e975a8aeda6cfe3b8450", "score": "0.5445883", "text": "function basicOp(operation, value1, value2) {\n switch (operation) {\n case '+':\n return value1 + value2;\n case '-':\n return value1 - value2;\n case '*':\n return value1 * value2;\n case '/':\n return value1 / value2;\n default:\n return 0;\n }\n}", "title": "" }, { "docid": "301d521213dc65c82f234afe9601867a", "score": "0.5443535", "text": "function mathOperation(a, b, c, d) {\n return a + b - (c - d);\n}", "title": "" }, { "docid": "418d8f5cd109749d0056f8dfbe08cac5", "score": "0.5436638", "text": "operation() {}", "title": "" }, { "docid": "274112b87771576df2fa46ebcd45890d", "score": "0.54332167", "text": "function operaciones(op)\n{\n\n var ops = {\n sumar: function sumarNumeros(n1, n2) {\n return (parseInt(n1) + parseInt(n2));\n },\n\n restar: function restarNumeros(n1, n2) {\n return (parseInt(n1) - parseInt(n2));\n },\n\n multiplicar: function multiplicarNumeros(n1, n2) {\n return (parseInt(n1) * parseInt(n2));\n },\n\n dividir: function dividirNumeros(n1, n2) {\n return (parseInt(n1) / parseInt(n2));\n }\n\n\n };\n\n\n\n var num1 = document.getElementById(\"num1\").value;\n var num2 = document.getElementById(\"num2\").value;\n\n\n //Comprobamos si se ha introducido números en las cajas\n if (isNaN(parseFloat(document.getElementById('num1').value))) {\n document.getElementById('resultado').innerHTML=\"<span style='color: red;'>Por favor, escriba un número 1</span>\";\n document.getElementById(\"num1\").innerText = \"0\";\n document.getElementById(\"num1\").focus();\n } else if (isNaN(parseFloat(document.getElementById('num2').value))) {\n document.getElementById('resultado').innerHTML=\"<span style='color: red;'>Por favor, escriba un número 2</span>\";\n document.getElementById(\"num2\").innerText = \"0\";\n document.getElementById(\"num2\").focus();\n }\n else {\n //Si se han introducido los números en ámbas cajas, operamos:\n switch(op) {\n case 'sumar':\n var resultado = ops.sumar(num1, num2);\n document.getElementById('resultado').innerHTML=\"<span style='color: green;'>\"+resultado+\"</span>\";\n break;\n case 'restar':\n var resultado = ops.restar(num1, num2);\n document.getElementById('resultado').innerHTML=\"<span style='color: green;'>\"+resultado+\"</span>\";\n break;\n case 'multiplicar':\n var resultado = ops.multiplicar(num1, num2);\n document.getElementById('resultado').innerHTML=\"<span style='color: green;'>\"+resultado+\"</span>\";\n break;\n case 'dividir':\n var resultado = ops.dividir(num1, num2);\n document.getElementById('resultado').innerHTML=\"<span style='color: green;'>\"+resultado+\"</span>\";\n break;\n\n }\n }\n\n\n}", "title": "" }, { "docid": "f446852df5ce043cc86a96607cc179a3", "score": "0.54245603", "text": "function process_calculations(calculations) {\n \tvar arg1 = \"\"+calculations[0];\n\tfor (var i = 1; i < calculations.length-1; i+=2) {\n\t\tvar op = calculations[i];\n\t\tvar arg2 = \"\"+calculations[i+1];\n\n\t\tcalculate(arg1, op, arg2);\n\n\t\targ1 = result;\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "4e595ba5e82efaac6a69f9bd45bfa670", "score": "0.5415049", "text": "function am1(e,t,s,o,r,l){for(;0<=--l;){var d=t*this[e++]+s[o]+r;r=_Mathfloor(d/67108864),s[o++]=67108863&d}return r}// am2 avoids a big mult-and-extract completely.", "title": "" }, { "docid": "dcf845de8b8830f1cd893b43da2f66f6", "score": "0.5415002", "text": "function calculatoin_3(fristNum, secondNmu, operation) {\n let fristResult = 0;\n let secondeResult = 0;\n let threeResult = 0;\n let fourResult = 0;\n\n for (i = 0; i < arguments.length; i++) {\n if (arguments[i] === \"add\") {\n fristResult += fristNum + secondNmu;\n console.log(fristResult);\n } else if (arguments[i] === \"subtract\") {\n secondeResult += fristNum - secondNmu;\n console.log(secondeResult);\n } else if (arguments[i] === \"multiply\") {\n threeResult += fristNum * secondNmu;\n console.log(threeResult);\n } else if (arguments.length === 1) {\n console.log(\"Second Number Not Found\");\n } else if (arguments.length === 2) {\n fourResult += fristNum + secondNmu;\n console.log(fourResult);\n }\n }\n}", "title": "" }, { "docid": "82bd9933450aaa264a9fa93ce2b810ff", "score": "0.5410771", "text": "function operate (operator, a,b){\n a= Number(a.join(' '));\n b= Number(b.join (' '));\n if (operator === '+'){return add(a,b);};\n if (operator === '-'){return subtract(a,b);};\n if (operator === '*'){return multiply(a,b);};\n if (operator === '/' && b !==0){return divide(a,b);};\n if (operator === '/' && b ===0){return '!KABOOM!'};\n}", "title": "" }, { "docid": "2cf84ac2bc50435123392e3ed4130ee2", "score": "0.54107326", "text": "function testCommon()\r\n{\r\n\tconsole.log(\"Test Rand range of 0~20 :\"+Rand(20)+\"\\n\");\r\n\tvar A = new vector3(1,1,1);\r\n\tvar B = new vector3();//test default constructor\r\n\tB.Set(2,2,2);\r\n\tconsole.log(\"Test vector3:A \"+A.toString());\r\n\tconsole.log(\"Test vector3:B \"+B.toString());\r\n\tvar C = DOT(A,B);\r\n\tconsole.log(\"Test vector3:C = A dot B = \"+C.toString());\r\n\tvar D = NORMALIZE(A);\r\n\tconsole.log(\"Test vector3:D = NORMALIZE(A) \"+D.toString());\r\n\tconsole.log(\"Test SQRLENGTH(A) \"+SQRLENGTH(A)+\" == 3\");\r\n\tconsole.log(\"Test vector3:A \"+A.toString());\r\n\tconsole.log(\"Test vector3:B \"+B.toString());\r\n\tconsole.log(\"Test SQRDISTANCE(A,B) \"+SQRDISTANCE(A,B)+\" == 3\");\r\n\r\n\tconsole.log(\"Test vector3 class member function...\");\r\n\tvar AdotB = A.Dot(B);\r\n\tconsole.log(\"Test A.Dot(B) \"+AdotB+\" == 6\");\r\n\tconsole.log(\"Test A.Length() \"+A.Length()+\" == sqrt(3)\");\r\n\tconsole.log(\"Test A.SqrLength() \"+A.SqrLength()+\" == 3\");\r\n\tconsole.log(\"Test A.Cross(B) \"+A.Cross(B).toString()+\" == 0\");\r\n\tvar AB =A.Add(B);\r\n\tconsole.log(\"Test A.Add(B) \"+AB.toString()+\" == (3,3,3)\");\r\n\tAB =A.Sub(B);\r\n\tconsole.log(\"Test A.Sub(B) \"+AB.toString()+\" == (1,1,1)\");\r\n\tA.Mul(4);\r\n\tconsole.log(\"Test A.Mul(4) \"+A.toString()+\" == (4,4,4)\");\r\n\tA.Mul(new vector3(5,5,5));\r\n\tconsole.log(\"Test A.Mul((5,5,5)) \"+A.toString()+\" == (20,20,20)\");\r\n\tconsole.log(\"Test A.Neg((5,5,5)) \"+A.Neg().toString()+\" == (-20,-20,-20)\");\r\n\t\r\n\r\n}", "title": "" }, { "docid": "cea691925e72c74ab43e94f1fcc2468d", "score": "0.5404085", "text": "handleBasicMathOperation(input) {\n let repeatNumber = null;\n let repeatOperation = null;\n \n if (previousNumber == null) {\n this.updatePreviousStatus(number, input);\n \n return number;\n } else {\n let temp = previousInput;\n previousInput = input;\n \n if (\n temp !== input &&\n previousOperation !== OperationEnum.equal &&\n temp !== \"=\"\n ) {\n if (previousOperation === OperationEnum.addition) {\n number = this.add(previousNumber, number);\n }\n if (previousOperation === OperationEnum.subtraction) {\n number = this.subtract(previousNumber, number);\n }\n if (previousOperation === OperationEnum.multiplication) {\n number = this.muliply(previousNumber, number);\n }\n if (previousOperation === OperationEnum.division) {\n number = this.divide(previousNumber, number);\n }\n \n this.updatePreviousStatus(number, input);\n \n return number;\n } else {\n this.updatePreviousStatus(number, input);\n \n return number;\n }\n }\n }", "title": "" }, { "docid": "22262f22f50a9ed634c019e77ed013d4", "score": "0.5402621", "text": "function operate(a,b,op){\r\n switch(op){\r\n case '+':\r\n return a+b;\r\n break;\r\n\r\n case '-':\r\n return a-b;\r\n break;\r\n\r\n case '*':\r\n return a*b;\r\n break;\r\n\r\n case '/':\r\n return a/b;\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "2d51258453b8567b871f2bcada18fe81", "score": "0.53925353", "text": "function myReduce()\n{\n\n}", "title": "" }, { "docid": "703c79a9a5c39591e4a27948ecd87f15", "score": "0.53881186", "text": "function funcomp(fna,fnb,s,e,d){\n\n var tt=0, mx=0 , ttv=0, mxv=0//, cntt=0, \n ,st=(e-s)*0.9999999999/(d-1) \n for(var i=s;i<=e;i=i+st){ \n var x=fna(i),y=fnb(i)\n //~ console.log(i.toPrecision(2),x,y,x-y)\n var uu=Math.abs(x-y)\n tt+=(x-y)*(x-y)\n if(uu>mx) mx=uu\n\n var uv, ax=Math.abs(x),ay=Math.abs(y)\n uv=Math.abs(x-y)/(ax+ay+0.0001)\n ttv+=(uv)*(uv)\n if(uv>mxv) mxv=uv\n\n //~ cnt++\n }\n //~ console.log(\"tot\",tt)\n //~ console.log(\"mx\",mx)\n return {t:tt,m:mx,tv:ttv,mv:mxv}\n}", "title": "" }, { "docid": "a182f1761b03d22dec06b3fb222a5579", "score": "0.5375121", "text": "function main() {\n\tconst input = process.argv[2].replace(/ /g, '').split(',');\n\tif (!input) {\n\t\tconsole.log('no compartments list is given');\n\t\tprocess.exit(1);\n\t}\n\n\tinput.forEach((item, index, theArray) => {\n\t\ttheArray[index] = Number(item);\n\t})\n\n\tlet minimumOperations;\n\tif (input.length % 2 === 0) { //array has no center\n\t\tlet center1 = smallestOperation((input.length/2)-1, input);\n\t\tlet center2 = smallestOperation(input.length/2, input);\n\t\tminimumOperations = Math.min(center1, center2);\n\t} else {\n\t\tminimumOperations = smallestOperation(Math.floor(input.length/2), input);\n\t}\n\n\tconsole.log(`Operations needed: ${minimumOperations}`);\n}", "title": "" }, { "docid": "5cafc260e5cdb90b015f296833fe9616", "score": "0.53744847", "text": "function operate (operator, num1, num2) {\n var code = operator.charCodeAt(0); \n var total; \n switch (code) { //calls functions on number parameters and saves results into a variable\n case 43:\n total = add(num1,num2);\n break;\n case 45:\n total = subtract(num1,num2);\n break;\n case 42:\n total = multiply(num1,num2);\n break;\n case 47:\n total = divide(num1,num2);\n break;\n }\n return total; // return value is variable containing solution\n }", "title": "" }, { "docid": "6488f684c126eae87fc2d6bac36a10e2", "score": "0.53671175", "text": "function operate(a,b,operator) {\n if (!(result === 0)) {\n if (operator === \"+\") {output.textContent = sum(result,b)}\n if (operator === \"-\") {output.textContent = subtract(result,b)}\n if (operator === \"*\") {output.textContent = multiply(result,b)}\n if (operator === \"/\") {output.textContent = divide(result,b)}\n }\n else if (result === 0) {\n if (operator === \"+\") {output.textContent = sum(a,b)}\n if (operator === \"-\") {output.textContent = subtract(a,b)}\n if (operator === \"*\") {output.textContent = multiply(a,b)}\n if (operator === \"/\") {output.textContent = divide(a,b)}\n };\n}", "title": "" }, { "docid": "d11064ec1b5c2cda566234a2aa7e8bce", "score": "0.5363992", "text": "compose (other) {\n let result = []\n const ops1 = this.ops, ops2 = other.ops\n let i1 = 0, i2 = 0\n let op1 = ops1[i1++], op2 = ops2[i2++]\n while (op1 || op2) {\n if (isDelete(op1)) {\n result.push(op1)\n op1 = ops1[i1++]\n continue\n }\n if (isInsert(op2)) {\n result.push(op2)\n op2 = ops2[i2++]\n continue\n }\n\n if (op1 === undefined || op2 === undefined) {\n throw new Error('Can not compose operations')\n }\n\n const l1 = opLen(op1), l2 = opLen(op2)\n let restOp1, restOp2\n if (l1 > l2) {\n ;[op1, restOp1] = splitOp(op1, l2)\n } else if (l1 < l2) {\n ;[op2, restOp2] = splitOp(op2, l1)\n }\n\n // at this point opLen(op1) === opLen(op2)\n\n if (isRetain(op1)) {\n result.push(op2)\n } else if (isRetain(op2)) {\n result.push(op1)\n } else if (isInsert(op1) && isDelete(op2)) {\n // Do nothing\n } else if (isInsert(op1) && isModify(op2)) {\n result.push(TextOperation.fromJSON(op2).apply(op1))\n } else if (isModify(op1) && isDelete(op2)) {\n result.push(op2)\n } else if (isModify(op1) && isModify(op2)) {\n const op = TextOperation.fromJSON(op1).compose(TextOperation.fromJSON(op2))\n result.push(op.isNoop() ? 1 : op.toJSON())\n } else {\n throw new Error('this should not happen')\n }\n\n op1 = restOp1 || ops1[i1++]\n op2 = restOp2 || ops2[i2++]\n }\n return new AceOperation(result)\n }", "title": "" }, { "docid": "738416b2aa589567bf193c91f39b02c9", "score": "0.53571343", "text": "function operation(ops) {\r\n\r\n if (variables.operand === 0) {\r\n if (variables.d === 1) {\r\n variables.current = variables.current.slice(0,-1);\r\n }\r\n if(variables.current === '-' || variables.current === '-0'){\r\n variables.current = '0';\r\n }\r\n variables.memory = variables.current;\r\n variables.current = '0';\r\n document.getElementById('input').value = variables.memory;\r\n document.getElementById('ans').value = variables.current;\r\n variables.decimal = 0;\r\n }else if(variables.operand !== 0 && variables.current !== '0'){\r\n equal();\r\n }\r\n if (variables.eq === 1) {\r\n variables.memory = variables.result;\r\n variables.current = '0';\r\n document.getElementById('input').value = variables.memory;\r\n document.getElementById('ans').value = variables.current;\r\n variables.eq = 0;\r\n }\r\n if (ops === '+') {\r\n variables.operand = 1;\r\n } else if (ops === '-') {\r\n variables.operand = 2;\r\n } else if (ops === '*') {\r\n variables.operand = 3;\r\n } else if (ops === '/') {\r\n variables.operand = 4;\r\n }\r\n else if(ops === '=' || ops === 'Enter'){\r\n equal();\r\n if(variables.result === 'err'){\r\n document.getElementById('ans').value = \"error! Division by zero\";\r\n document.getElementById('input').value = '';\r\n variables.result = 0;\r\n }else{\r\n document.getElementById('ans').value = variables.result;\r\n variables.memory = '0';\r\n variables.current = '0';\r\n document.getElementById('input').value = '';\r\n }\r\n\r\n }\r\n variables.neg = 0;\r\n}", "title": "" }, { "docid": "66e1837692a742f39959ff9def1eb253", "score": "0.5349343", "text": "function o0(stdlib,o1,call) {\n try {\n\"use asm\";\n}catch(e){}\n function add(o2,o3) {\n try {\nthis.o155[0xFF55] = 0xFF;\n}catch(e){}\n try {\no502.o508 = +o3;\n}catch(e){}\n try {\nreturn +(o2+o3);\n}catch(e){}\n }\n \n function o4(o29,o3){\n try {\no2 = +o2;\n}catch(e){}\n try {\no3 = +o3;\n}catch(e){}\n var o5 = 0.0;\n var o6 = 1;\n try {\no25.next = NaN >= new Number(Number.String);\n}catch(e){}\n try {\nreturn +o5;\n}catch(e){}\n }\n \n var o7 = [add,o2,add,add];\n \n \n try {\nreturn { \n o4 : o4\n };\n}catch(e){}\n}", "title": "" }, { "docid": "bb577d26c9bec23e72130a6363cf9d88", "score": "0.5346195", "text": "operation(){ /** todo */ }", "title": "" }, { "docid": "d6ca253b4d3f41cbdd13c74ac1976c9b", "score": "0.5340185", "text": "function doMaths(intBuffer) {\n if (currentOp === '+') {\n sumSoFar += intBuffer\n }\n else if(currentOp === '-') {\n sumSoFar -= intBuffer\n }\n else if (currentOp === 'x') {\n sumSoFar *= intBuffer\n }\n else {\n sumSoFar /= intBuffer \n }\n}", "title": "" }, { "docid": "af0ac5cf29f0e981b9c1cca8b1a3b7b7", "score": "0.53380334", "text": "function makeOpComposition () {\n \n var ops = []; \n var domain = makeEmptyMap(); \n var gen = 0; \n \n var func = function (s) {\n return function (i) {\n return evaluate(domain.has(i) ? (ops.length-1) - (gen-domain.get(i)) : -1, i)(i);\n }\n \n // determine selection state of i but only access the elements \n // of ops (staring from ind) that have i in their domain\n function evaluate(ind, i) {\n if (ind < 0) return s; // i defined in the base selection mapping s\n else {\n var op = ops[ind];\n return op(function (j) { return evaluate(ind - op.domain.get(i), j)(i); });\n // the call to evaluate is wrapped to a lambda to make the call lazy.\n // op will only call the lambda if op.f.constant is false\n }\n }\n }\n \n func.domain = domain;\n \n // member functions of func\n func.push = function (op) {\n ops.push(op);\n ++gen\n op.domain.forEach(function(_, i) {\n op.domain.set(i, domain.has(i) ? gen - domain.get(i) : ops.length);\n domain.set(i, gen); \n });\n }\n func.pop = function () {\n var n = ops.length;\n var op = ops.pop();\n --gen;\n // domain updated for those elements that are in op.domain\n op.domain.forEach(function (_, i) {\n if (op.domain.get(i) >= n) domain.delete(i); // no op defines i\n else domain.set(i, domain.get(i) - op.domain.get(i)); \n });\n return op;\n }\n func.top = function () { return ops[ops.length - 1]; }\n func.top2 = function () { return ops[ops.length - 2]; }\n func.shift = function (bmap) {\n var op = ops.shift();\n op.domain.forEach(function(_, i) {\n if (domain.get(i) - gen === ops.length) { domain.delete(i); }\n // if lastOp the only op that defines i, remove i from domain\n });\n return op;\n }\n func.size = function () { return ops.length; }\n func.removeIndex = function (i) {\n if (!domain.has(i)) return;\n \n // find the first op in ops that defines i\n var j = (ops.length - 1) - (gen - domain.get(i));\n \n while (j >= 0) {\n var d = ops[j].domain.get(i);\n ops[j].domain.delete(i);\n j -= d;\n }\n domain.delete(i);\n }\n \n return func;\n }", "title": "" }, { "docid": "c9fce50f52991c9589e629327b0b3c0b", "score": "0.5335897", "text": "function calculate( n1 , n2, operation) {\n return operation(n1, n2)\n}", "title": "" }, { "docid": "75203b737e98c49002acf0b66b69d65b", "score": "0.53296506", "text": "function allOperations (n) {\n const resultOfHalfNumber = halfNumber(n);\n const resultOfSquareNumber = squareNumber(resultOfHalfNumber);\n const resultOfAreaOfCircle = areaOfCircle(resultOfSquareNumber);\n const resultOfPercentOf = percentOf(resultOfAreaOfCircle, 2);\n result = resultOfPercentOf;\n return result\n}", "title": "" }, { "docid": "bffd2fad900232a4bbbf9f63d4195cb1", "score": "0.5320609", "text": "function calculateAll() {\n var holder = 0;\n for (i = 1; i <= oc; i++) {\n\n num[i]=Number(num[i]);\n\n if (operate[i] > 2) {\n\n if (operate[i]===3) {\n holder = num[(i-1)] * num[i];\n } else if (operate[i]===4){\n holder = num[(i-1)] / num[i];\n }\n num[(i-1)] = holder;\n\n for (k = i; k <= (oc-1); k++) {\n num[k] = num[k+1];\n operate[k] = operate[k+1];\n }\n num[oc]='';\n operate[oc]=0;\n oc--;\n i--;\n }\n }\n\n final = Number(num[0]);\n\n for (i = 1; i <= oc; i++) {\n if (operate[i] === 1) {\n final = final + num[i];\n } else if (operate[i] === 2){\n final = final - num [i];\n }\n }\n\n document.getElementById('view').value = final;\n clearOut();\n num[counter] = '';\n\n}", "title": "" }, { "docid": "8f7d8cb5d4e12f761e732dc718293909", "score": "0.5305169", "text": "function comprehensiveOperation() {\n calculation.pop();\n result = doMath(calculation);\n calculation = [];\n displayResult(result);\n}", "title": "" }, { "docid": "0bf30a0c266630fa6b52d087666aee9b", "score": "0.5296698", "text": "function o0(e,o1,buffer) {\n try {\n0;\n}catch(e){}\n var o40 = new o57()\n \n function o4(o2,o3){\n try {\no8[4294967294/2] = 2;\n}catch(e){}\n try {\nthis.o781 = +o3;\n}catch(e){}\n var o673 = o215(1, \"i32*\", o212);\n var o6 = 1;\n try {\no5 = +o7[this.o565[o810]](o2,o3);\n}catch(e){}\n try {\nreturn +o5;\n}catch(e){}\n }\n \n var o7 = [add,add,add,add];\n \n \n try {\nreturn o4.o10;\n}catch(e){}\n}", "title": "" }, { "docid": "7cf0edcf64b7b82c062bd6f177a5770c", "score": "0.52935815", "text": "function calculator() {\n // The inputArr is the process.argv \n let inputArr = process.argv;\n let operation = inputArr[2];\n let numbers = inputArr.slice(3);\n let adjustedNum = numbers.map(Number);\n const add = (a, b) => a + b;\n const subt = (a, b) => a - b;\n let sum = 0;\n // use if statements to check for the operation and numbers\n if(!operation){\n return \"No operation provided...\"; \n } else if(!numbers.length){\n return \"No numbers provided...\";\n } else if(operation === \"minus\"){\n sum += adjustedNum.reduce(subt)\n return sum;\n } else if(operation === \"plus\"){\n sum += adjustedNum.reduce(add)\n return sum;\n } else {\n return \"Invalid operation: modulo\"; \n }\n}", "title": "" }, { "docid": "9ef2102108e59fdef627e40e6fc4a38f", "score": "0.5286639", "text": "function calculate (a, b, operation){\n if(operation === 'add'){\n return a + b;\n }else if(operation === 'substract'){\n return a - b;\n }else if ( operation === 'multiply'){\n return a*b;\n }else (operation === 'divide')\n return a/b;\n }", "title": "" }, { "docid": "13b64a5e4f21e793040ef067a1417dbd", "score": "0.5263641", "text": "function add4(a, b) {\r\n return (a + b);\r\n}", "title": "" }, { "docid": "13b64a5e4f21e793040ef067a1417dbd", "score": "0.5263641", "text": "function add4(a, b) {\r\n return (a + b);\r\n}", "title": "" }, { "docid": "1ff4020c9342a0590f197f738b389552", "score": "0.5261652", "text": "function o187(o116, o185, o186, o81) {\n var o190 = 0;\n\n function o191(value, type) {\n try {\nif (type == 'string') {\n try {\nif (value === null || value === undefined || value === 0) try {\nreturn 0;\n}catch(e){}\n}catch(e){} // null string\n try {\nvalue = o192(value);\n}catch(e){}\n try {\ntype = 'array';\n}catch(e){}\n }\n}catch(e){}\n try {\nif (type == 'array') {\n try {\nif (!o190) try {\no190 = o48.o49();\n}catch(e){}\n}catch(e){}\n var o30 = o48.o140(value.length);\n try {\no193(value, o30);\n}catch(e){}\n try {\nreturn o30;\n}catch(e){}\n }\n}catch(e){}\n try {\nreturn value;\n}catch(e){}\n }\n\n function o194(value, type) {\n try {\nif (type == 'string') {\n try {\nreturn o122(value);\n}catch(e){}\n }\n}catch(e){}\n try {\no73(type != 'array');\n}catch(e){}\n try {\nreturn value;\n}catch(e){}\n }\n var o82 = 0;\n var o195 = o81 ? o81.map(function (o196) {\n try {\nreturn o191(o196, o186[o82++]);\n}catch(e){}\n }) : [];\n var o30 = o194(o116.apply(null, o195), o185);\n try {\nif (o190) try {\no48.o51(o190);\n}catch(e){}\n}catch(e){}\n try {\nreturn o30;\n}catch(e){}\n}", "title": "" }, { "docid": "a32eec1abe7aa4930a7f62f441871512", "score": "0.5258984", "text": "function operate (operator, a, b){ \n a = displVals[0]; \n b = displVals[2]; \n operator = displVals[1]; \n if(operator === '+'){ \n return add(a,b); \n } else if (operator === '-'){ \n return subtract(a,b);\n } else if (operator === '*'){ \n return multiply(a,b);\n } else { \t\n return division(a,b);\n } \n}", "title": "" }, { "docid": "e36fec06c645a2a397c30fed05b0174b", "score": "0.5256804", "text": "function mathoperation(op) {\n debugger;\n var fvalue = parseInt(document.getElementById(\"no1\").value)\n var svalue = parseInt(document.getElementById(\"no2\").value)\n\n if (op == \"addition\") {\n alert(\"The result of the given input is \" + addition(fvalue, svalue))\n }\n if (op == \"subtraction\") {\n alert(\"The result of the given input is \" + subtraction(fvalue, svalue))\n }\n if (op == \"multiplication\") {\n alert(\"The result of the given input is \" + multiplication(fvalue, svalue))\n }\n if (op == \"division\") {\n alert(\"The result of the given input is \" + division(fvalue,svalue))\n }\n if (op == \"getmod\") {\n alert(\"The result of the given input is \" + getmod(fvalue, svalue))\n }\n\n\n\n function addition(fvalue, svalue) {\n return fvalue + svalue;\n }\nfunction subtraction(fvalue, svalue) {\n return fvalue - svalue;\n }\n function multiplication(fvalue, svalue) {\n return fvalue * svalue;\n }\nfunction division(fvalue, svalue) {\n return fvalue / svalue;\n }\nfunction getmod(fvalue, svalue) {\n return fvalue % svalue;\n }\n}", "title": "" }, { "docid": "28b7bd038bc7d6eac15842ef378732ac", "score": "0.52558887", "text": "function calculate(a, b) {\n function sum() {\n return a + b;\n }\n function sub() {\n return a - b;\n }\n function times() {\n return a * b;\n }\n function div() {\n return a / b;\n }\n return sum() + sub() + times() + div();\n }", "title": "" }, { "docid": "fc9a5592d5b9f7f31dced47e8847e47a", "score": "0.52433336", "text": "function FindIntersectionTime( pT1, s1, o1\r\n , pT2, s2, o2 )\r\n{\r\n var R1, R2, denoms;\r\n var t1, t2, denom;\r\n\r\nconst a = (o1[0])\r\nconst b = (o1[1])\r\nconst c = (o1[2])\r\n\r\nconst d = (o2[0])\r\nconst e = (o2[1])\r\nconst f = (o2[2])\r\n\r\nconst na = (s1[0])\r\nconst nb = (s1[1])\r\nconst nc = (s1[2])\r\n\r\nconst nd = (s2[0])\r\nconst ne = (s2[1])\r\nconst nf = (s2[2])\r\n\r\n denoms = crossproduct(denoms, s1, s2 ); // - result...\r\n denom = denoms[2];\r\n // denom = ( nd * nb ) - ( ne * na );\r\n if( NearZero( denom ) )\r\n {\r\n denom = denoms[1];\r\n // denom = ( nd * nc ) - (nf * na );\r\n if( NearZero( denom ) )\r\n {\r\n denom = denoms[0];\r\n// denom = ( ne * nc ) - ( nb * nf );\r\n if( NearZero( denom ) )\r\n {\r\n if( FULL_DEBUG ) {\r\n console.log( \"Bad!-------------------------------------------\\n\" );\r\n }\r\n return false;\r\n }\r\n else\r\n {\r\n DebugBreak();\r\n t1 = ( ne * ( c - f ) + nf * ( b - e ) ) / denom;\r\n t2 = ( nb * ( c - f ) + nc * ( b - e ) ) / denom;\r\n }\r\n }\r\n else\r\n {\r\n DebugBreak();\r\n t1 = ( nd * ( c - f ) + nf * ( d - a ) ) / denom;\r\n t2 = ( na * ( c - f ) + nc * ( d - a ) ) / denom;\r\n }\r\n }\r\n else\r\n {\r\n // this one has been tested.......\r\n t1 = ( nd * ( b - e ) + ne * ( d - a ) ) / denom;\r\n t2 = ( na * ( b - e ) + nb * ( d - a ) ) / denom;\r\n }\r\n\r\n R1[0] = a + na * t1;\r\n R1[1] = b + nb * t1;\r\n R1[2] = c + nc * t1;\r\n\r\n R2[0] = d + nd * t2;\r\n R2[1] = e + ne * t2;\r\n R2[2] = f + nf * t2;\r\n\r\n if( ( !COMPARE(R1[0],R2[0]) ) ||\r\n ( !COMPARE(R1[1],R2[1]) ) ||\r\n ( !COMPARE(R1[2],R2[2]) ) )\r\n {\r\n return false;\r\n }\r\n pT2[0] = t2;\r\n pT1[0] = t1;\r\n return true;\r\n}", "title": "" }, { "docid": "8418e9ddb3b6839855b160a21c87d5f3", "score": "0.5242647", "text": "function mathsAsigtment(a, b, c, d) {\n console.log(a - b - c - d);\n}", "title": "" }, { "docid": "2f0e1d13e2afa69890deecd7a1ef914f", "score": "0.5240299", "text": "function performOperation(nr1, nr2, operator)\n{\n if(operator==\"+\")\n {\n return parseFloat(nr1) + parseFloat(nr2);\n }\n if(operator==\"-\")\n {\n return parseFloat(nr1) - parseFloat(nr2);\n }\n if(operator==\"*\")\n {\n return parseFloat(nr1) * parseFloat(nr2);\n }\n if(operator==\"/\")\n {\n return parseFloat(nr1) / parseFloat(nr2);\n }\n}", "title": "" }, { "docid": "dab72723620291b0ff5615e4df4e816c", "score": "0.5235395", "text": "function operation(num1, num2, funct){\n \tlet result= funct(num1, num2);\n \treturn result;\n }", "title": "" }, { "docid": "420993aa1737f44405448c6625cacefb", "score": "0.52302533", "text": "function stimulus_function(i){\n\t/*\n\tif (final_node[i]>aim[i]){\n\t\treturn -pow((aim[i] - final_node[i]), 2);\n\t} else {\n\t\treturn pow((aim[i] - final_node[i]), 2);\n\t}\n*/\n// \tvar toAdd = 0;\n/*\n\tswitch (i){\n\t\tcase 0: if (xDiff > 0){ return pow(xDiff,2); } else { return -pow(xDiff,2); } break;\n\t\tcase 1: if (yDiff > 0){ return pow(yDiff,2); } else { return -pow(yDiff,2); } break;\n\t\tcase 2: if (xDiff < 0){ return pow(xDiff,2); } else { return -pow(xDiff,2); } break;\n\t\tcase 3: if (yDiff < 0){ return pow(yDiff,2); } else { return -pow(yDiff,2); }\n\t}\n*/\n\tswitch (i){\n\t\tcase 0: if (xDiff > 0){ return pow(xDiff,2); } else { return 0; } break;\n\t\tcase 1: if (yDiff > 0){ return pow(yDiff,2); } else { return 0; } break;\n\t\tcase 2: if (xDiff < 0){ return pow(xDiff,2); } else { return 0; } break;\n\t\tcase 3: if (yDiff < 0){ return pow(yDiff,2); } else { return 0; }\n\t}\n/*\nswitch (i){\n\t\tcase 0: if (xDiff > 0){ return xDiff; } else { return -xDiff; } break;\n\t\tcase 1: if (yDiff > 0){ return yDiff; } else { return -yDiff; } break;\n\t\tcase 2: if (xDiff < 0){ return -xDiff; } else { return xDiff; } break;\n\t\tcase 3: if (yDiff < 0){ return -yDiff; } else { return yDiff; }\n\t}\n*/\n\n/*\nswitch (i){\n\t\tcase 0: if (xDiff > 0){ return xDiff; } break;\n\t\tcase 1: if (yDiff > 0){ return yDiff; } break;\n\t\tcase 2: if (xDiff < 0){ return -xDiff; } break;\n\t\tcase 3: if (yDiff < 0){ return -yDiff; }\n\t}\n*/\n// \treturn toAdd;\n}", "title": "" }, { "docid": "a56260f611a041dddb48d30fe97d2289", "score": "0.52287453", "text": "function solution(){\n\n}", "title": "" }, { "docid": "2534bef1f0705b2514fd9a3e9931d42a", "score": "0.522841", "text": "function operate(operation,num1,num2){\n switch (operation) {\n case '+':\n return add(num1,num2)\n break;\n case '-':\n return subtract(num1,num2)\n break;\n case \"x\":\n return multiply(num1,num2)\n break;\n case \"÷\":\n return divide(num1,num2)\n break;\n default:\n\n }\n}", "title": "" }, { "docid": "fd554ca59ba287e45e4db4920fc876d5", "score": "0.5222087", "text": "function operation(a, b, funct){\n \tvar c = funct(a,b);\n }", "title": "" }, { "docid": "6778f4f3d4682dd67e91bad9436040e9", "score": "0.52198464", "text": "function o0(o9,o1,buffer) {\n try {\n\"use asm\";\n}catch(e){}\n var o35 = o1 = [];\n //views\n function o0() {\n try {\n'use strict';\n}catch(e){}\n try {\ntry {\n var o1 = {};\n var o2 = new Array(10);\n try {\no1.length = 1;\n}catch(e){}\n var o3 = 0;\n try {\nwhile ((1) && o3 < 3) {\n try {\no3++;\n}catch(e){}\n try {\no2.length = -804513990;\n}catch(e){}\n }\n}catch(e){}\n //Snippet 3: fewer arguments than formal parameters\n try {\no1.length = (function (o4, o5, o6, o7, o8) {\n try {\no9 *= o1.o10;\n}catch(e){}\n var o11 = o4 + o5 + o6 + o7 + o8;\n try {\nreturn o11 + o2[(1)];\n}catch(e){}\n })(1, 1, 1);\n}catch(e){}\n }\n catch(o9) {\n try {\no12.o13(o9);\n}catch(e){}\n }\n}catch(e){}\n};\n\n var o733 = 0\n try {\nreturn o4;\n}catch(e){}\n}", "title": "" }, { "docid": "9d66508c11fe7e90651512c86f1e906b", "score": "0.52183473", "text": "function calculateSetOperation() {\n\n const operation = operations.find((e) => e.operator === operator);\n\n if (operation) {\n result = operation.fn(operand1, operand2);\n }\n\n if (result === null) {\n console.error('Not implemented or is not a mathematical operator:', operator);\n console.log('Supported operators are: + , - , / , * , p (power) and % (modulo).');\n } else {\n console.log('Result:', result);\n }\n}", "title": "" }, { "docid": "0228e645f5d9dc350229908efe9bcf45", "score": "0.52169806", "text": "function sum(a, b, c, d, e, f, g, h, i, k, l, m) {\n\t// return arg[100] / arg[99]\n}", "title": "" }, { "docid": "6515a79ba6a7be11f9e095461a7d964a", "score": "0.5216957", "text": "function calculation(a,b,op){\nif(op == \"*\"){\n console.log(a*b);\n}else if (op == \"+\"){\n console.log(a+b);\n}else if (op == \"/\"){\n console.log(a/b);\n}else{\nconsole.log(a-b);\n}\n}", "title": "" }, { "docid": "299a3a352b35df4c786435e2e4abcb45", "score": "0.5209958", "text": "function opeArit() \n\t{\n\t\t//Definicion de variables\n\t\t//Suma\n\t\tvar op1 = 3;\n\t\tvar op2 = 10;\n\t\tvar res = 0;\n\t\tres = op1 + op2;\n\t\tconsole.log(\"Suma\");\n\t\tconsole.log(res);\n\t\t//Multiplicacion\n\t\tconsole.log(\"Multiplicacion\");\n\t\tres = op1 * op2;\n\t\tconsole.log(res);\n\t\t//Division\n\t\tconsole.log(\"Division\");\n\t\tres = op1 / op2;\n\t\tconsole.log(res);\n\t\t//Resta\n\t\tconsole.log(\"Resta\");\n\t\tres = op1 - op2;\n\t\tconsole.log(res);\n\t\t//Modulo - residuo de una division\n\t\tconsole.log(\"Modulo\");\n\t\tres = op1 % op2;\n\t\tconsole.log(res);\n\t\t//Exponencial\n\t\tconsole.log(\"Exponencial\");\n\t\tres = op1 ** 2;\n\t\tconsole.log(res);\n\t\t//Raiz cuadrada\n\t\tconsole.log(\"Raiz Cuadrada\");\n\t\tres = Math.sqrt(op2);\n\t\tconsole.log(res);\n\t\t//Logaritmo natural\n\t\tconsole.log(\"Logaritmo\");\n\t\tres = Math.log(op2);\n\t\tconsole.log(res);\n\t\tres = Math.log(-op2);\t//NaN Not at Number\n\t\tconsole.log(res);\n\t\tres = Math.log(0);\t\t//-Infinity\n\t\tconsole.log(res);\n\t}", "title": "" }, { "docid": "7fa15fe0c17a32ffc52d2ece9ab5da03", "score": "0.5203471", "text": "function calculation(a,b) {\n\n function plus () {\n return a + b;\n };\n function minus () {\n return a - b;\n };\n function multiply() {\n return a * b;\n };\n function divition() {\n return a / b;\n };\n\n return plus() + minus() + multiply() + divition();\n}", "title": "" }, { "docid": "289ba4f965062c6e3afbdbbe539b841d", "score": "0.5201154", "text": "function add(a,b){return a+b;}", "title": "" }, { "docid": "86ced7252c30fbd6a4edc5453777a951", "score": "0.5200703", "text": "test() {\n console.log(\"\\n### TESTING CLASS AdvancedMath ###\\n\");\n\n this.testMethod(\"#add(v1,...,vN)\", [\n [\"should return the sum of any number of parameters sent into it\", this.add(1,2,3,2,1), 9]\n ]);\n \n this.testMethod(\"#isRightTriangle\", [\n [\"should return false if any side length is negitive\", this.isRightTriangle(1,-1,1), false],\n [\"should return false if any side length is zero because that is a line\", this.isRightTriangle(1,0,1), false],\n [\"should return false if a squared plus b squared does not equal c squared\", this.isRightTriangle(2,2,2), false],\n [\"should return true if a squared plus b squared equals c squared\", this.isRightTriangle(3,4,5), true]\n ]);\n \n this.testMethod(\"#posPower(base,exponent)\", [\n [\"should return base to the power of exponent correctly\", this.posPower(5,3), 125],\n [\"should return a negitive base to the power of exponent correctly\", this.posPower(-5,3), -125],\n [\"should return base to the power of a negitive exponent as zero\", this.posPower(5,-1), 0],\n [\"should return base to the power of zero as one\", this.posPower(5,0), 1]\n ]);\n }", "title": "" }, { "docid": "e79f8dcac5e84455c714d76b4759719f", "score": "0.51808083", "text": "function geometric_product(a, b){\r\n\r\n c = [0, 0,0,0, 0,0,0, 0];\r\n c[0] = +a[0]*b[0] +a[1]*b[1] +a[2]*b[2] +a[3]*b[3] -a[4]*b[4] -a[5]*b[5] -a[6]*b[6] -a[7]*b[7];\r\n c[1] = +a[0]*b[1] +a[1]*b[0] -a[2]*b[4] +a[3]*b[6] +a[4]*b[2] -a[5]*b[7] -a[6]*b[3] -a[7]*b[5];\r\n c[2] = +a[0]*b[2] +a[1]*b[4] +a[2]*b[0] -a[3]*b[5] -a[4]*b[1] +a[5]*b[3] -a[6]*b[7] -a[7]*b[6];\r\n c[3] = +a[0]*b[3] -a[1]*b[6] +a[2]*b[5] +a[3]*b[0] -a[4]*b[7] -a[5]*b[2] +a[6]*b[1] -a[7]*b[4];\r\n c[4] = +a[0]*b[4] +a[1]*b[2] -a[2]*b[1] +a[3]*b[7] +a[4]*b[0] -a[5]*b[6] +a[6]*b[5] +a[7]*b[3];\r\n c[5] = +a[0]*b[5] +a[1]*b[7] +a[2]*b[3] -a[3]*b[2] +a[4]*b[6] +a[5]*b[0] -a[6]*b[4] +a[7]*b[1];\r\n c[6] = +a[0]*b[6] -a[1]*b[3] +a[2]*b[7] +a[3]*b[1] -a[4]*b[5] +a[5]*b[4] +a[6]*b[0] +a[7]*b[2];\r\n c[7] = +a[0]*b[7] +a[1]*b[5] +a[2]*b[6] +a[3]*b[4] +a[4]*b[3] +a[5]*b[1] +a[6]*b[2] +a[7]*b[0]; \r\n return c;\r\n }", "title": "" }, { "docid": "ec4ac5ecb6a1976d0972e41342878baf", "score": "0.5178933", "text": "function solution(a) {\n\n\n}", "title": "" }, { "docid": "0b21ea46c2424344b92e4d2c12ef00d7", "score": "0.51733893", "text": "function _t(t){var N,L,A,S,e,c=Math.floor,_=new Array(64),F=new Array(64),P=new Array(64),k=new Array(64),y=new Array(65535),v=new Array(65535),Z=new Array(64),w=new Array(64),I=[],C=0,B=7,j=new Array(64),E=new Array(64),M=new Array(64),n=new Array(256),O=new Array(2048),b=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],q=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],T=[0,1,2,3,4,5,6,7,8,9,10,11],R=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],D=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],U=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],z=[0,1,2,3,4,5,6,7,8,9,10,11],H=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],W=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function r(t,e){for(var n=0,r=0,i=new Array,o=1;o<=16;o++){for(var a=1;a<=t[o];a++)i[e[r]]=[],i[e[r]][0]=n,i[e[r]][1]=o,r++,n++;n*=2}return i}function V(t){for(var e=t[0],n=t[1]-1;0<=n;)e&1<<n&&(C|=1<<B),n--,--B<0&&(255==C?(G(255),G(0)):G(C),B=7,C=0)}function G(t){I.push(t)}function Y(t){G(t>>8&255),G(255&t)}function J(t,e,n,r,i){for(var o,a=i[0],s=i[240],l=function(t,e){var n,r,i,o,a,s,l,h,u,c,f=0;for(u=0;u<8;++u){n=t[f],r=t[f+1],i=t[f+2],o=t[f+3],a=t[f+4],s=t[f+5],l=t[f+6];var p=n+(h=t[f+7]),d=n-h,g=r+l,m=r-l,y=i+s,v=i-s,w=o+a,b=o-a,x=p+w,N=p-w,L=g+y,A=g-y;t[f]=x+L,t[f+4]=x-L;var S=.707106781*(A+N);t[f+2]=N+S,t[f+6]=N-S;var _=.382683433*((x=b+v)-(A=m+d)),F=.5411961*x+_,P=1.306562965*A+_,k=.707106781*(L=v+m),I=d+k,C=d-k;t[f+5]=C+F,t[f+3]=C-F,t[f+1]=I+P,t[f+7]=I-P,f+=8}for(u=f=0;u<8;++u){n=t[f],r=t[f+8],i=t[f+16],o=t[f+24],a=t[f+32],s=t[f+40],l=t[f+48];var B=n+(h=t[f+56]),j=n-h,E=r+l,M=r-l,O=i+s,q=i-s,T=o+a,R=o-a,D=B+T,U=B-T,z=E+O,H=E-O;t[f]=D+z,t[f+32]=D-z;var W=.707106781*(H+U);t[f+16]=U+W,t[f+48]=U-W;var V=.382683433*((D=R+q)-(H=M+j)),G=.5411961*D+V,Y=1.306562965*H+V,J=.707106781*(z=q+M),X=j+J,K=j-J;t[f+40]=K+G,t[f+24]=K-G,t[f+8]=X+Y,t[f+56]=X-Y,f++}for(u=0;u<64;++u)c=t[u]*e[u],Z[u]=0<c?c+.5|0:c-.5|0;return Z}(t,e),h=0;h<64;++h)w[b[h]]=l[h];var u=w[0]-n;n=w[0],0==u?V(r[0]):(V(r[v[o=32767+u]]),V(y[o]));for(var c=63;0<c&&0==w[c];c--);if(0==c)return V(a),n;for(var f,p=1;p<=c;){for(var d=p;0==w[p]&&p<=c;++p);var g=p-d;if(16<=g){f=g>>4;for(var m=1;m<=f;++m)V(s);g&=15}o=32767+w[p],V(i[(g<<4)+v[o]]),V(y[o]),p++}return 63!=c&&V(a),n}function X(t){if(t<=0&&(t=1),100<t&&(t=100),e!=t){(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;n<64;n++){var r=c((e[n]*t+50)/100);r<1?r=1:255<r&&(r=255),_[b[n]]=r}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],o=0;o<64;o++){var a=c((i[o]*t+50)/100);a<1?a=1:255<a&&(a=255),F[b[o]]=a}for(var s=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],l=0,h=0;h<8;h++)for(var u=0;u<8;u++)P[l]=1/(_[b[l]]*s[h]*s[u]*8),k[l]=1/(F[b[l]]*s[h]*s[u]*8),l++})(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),e=t}}this.encode=function(t,e){var n,r;(new Date).getTime();e&&X(e),I=new Array,C=0,B=7,Y(65496),Y(65504),Y(16),G(74),G(70),G(73),G(70),G(0),G(1),G(1),G(0),Y(1),Y(1),G(0),G(0),function(){Y(65499),Y(132),G(0);for(var t=0;t<64;t++)G(_[t]);G(1);for(var e=0;e<64;e++)G(F[e])}(),n=t.width,r=t.height,Y(65472),Y(17),G(8),Y(r),Y(n),G(3),G(1),G(17),G(0),G(2),G(17),G(1),G(3),G(17),G(1),function(){Y(65476),Y(418),G(0);for(var t=0;t<16;t++)G(q[t+1]);for(var e=0;e<=11;e++)G(T[e]);G(16);for(var n=0;n<16;n++)G(R[n+1]);for(var r=0;r<=161;r++)G(D[r]);G(1);for(var i=0;i<16;i++)G(U[i+1]);for(var o=0;o<=11;o++)G(z[o]);G(17);for(var a=0;a<16;a++)G(H[a+1]);for(var s=0;s<=161;s++)G(W[s])}(),Y(65498),Y(12),G(3),G(1),G(0),G(2),G(17),G(3),G(17),G(0),G(63),G(0);var i=0,o=0,a=0;C=0,B=7,this.encode.displayName=\"_encode_\";for(var s,l,h,u,c,f,p,d,g,m=t.data,y=t.width,v=t.height,w=4*y,b=0;b<v;){for(s=0;s<w;){for(f=c=w*b+s,p=-1,g=d=0;g<64;g++)f=c+(d=g>>3)*w+(p=4*(7&g)),v<=b+d&&(f-=w*(b+1+d-v)),w<=s+p&&(f-=s+p-w+4),l=m[f++],h=m[f++],u=m[f++],j[g]=(O[l]+O[h+256>>0]+O[u+512>>0]>>16)-128,E[g]=(O[l+768>>0]+O[h+1024>>0]+O[u+1280>>0]>>16)-128,M[g]=(O[l+1280>>0]+O[h+1536>>0]+O[u+1792>>0]>>16)-128;i=J(j,P,i,N,A),o=J(E,k,o,L,S),a=J(M,k,a,L,S),s+=32}b+=8}if(0<=B){var x=[];x[1]=B+1,x[0]=(1<<B+1)-1,V(x)}return Y(65497),new Uint8Array(I)},function(){(new Date).getTime();t||(t=50),function(){for(var t=String.fromCharCode,e=0;e<256;e++)n[e]=t(e)}(),N=r(q,T),L=r(U,z),A=r(R,D),S=r(H,W),function(){for(var t=1,e=2,n=1;n<=15;n++){for(var r=t;r<e;r++)v[32767+r]=n,y[32767+r]=[],y[32767+r][1]=n,y[32767+r][0]=r;for(var i=-(e-1);i<=-t;i++)v[32767+i]=n,y[32767+i]=[],y[32767+i][1]=n,y[32767+i][0]=e-1+i;t<<=1,e<<=1}}(),function(){for(var t=0;t<256;t++)O[t]=19595*t,O[t+256>>0]=38470*t,O[t+512>>0]=7471*t+32768,O[t+768>>0]=-11059*t,O[t+1024>>0]=-21709*t,O[t+1280>>0]=32768*t+8421375,O[t+1536>>0]=-27439*t,O[t+1792>>0]=-5329*t}(),X(t),(new Date).getTime()}()}", "title": "" }, { "docid": "0b21ea46c2424344b92e4d2c12ef00d7", "score": "0.51733893", "text": "function _t(t){var N,L,A,S,e,c=Math.floor,_=new Array(64),F=new Array(64),P=new Array(64),k=new Array(64),y=new Array(65535),v=new Array(65535),Z=new Array(64),w=new Array(64),I=[],C=0,B=7,j=new Array(64),E=new Array(64),M=new Array(64),n=new Array(256),O=new Array(2048),b=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],q=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],T=[0,1,2,3,4,5,6,7,8,9,10,11],R=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],D=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],U=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],z=[0,1,2,3,4,5,6,7,8,9,10,11],H=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],W=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function r(t,e){for(var n=0,r=0,i=new Array,o=1;o<=16;o++){for(var a=1;a<=t[o];a++)i[e[r]]=[],i[e[r]][0]=n,i[e[r]][1]=o,r++,n++;n*=2}return i}function V(t){for(var e=t[0],n=t[1]-1;0<=n;)e&1<<n&&(C|=1<<B),n--,--B<0&&(255==C?(G(255),G(0)):G(C),B=7,C=0)}function G(t){I.push(t)}function Y(t){G(t>>8&255),G(255&t)}function J(t,e,n,r,i){for(var o,a=i[0],s=i[240],l=function(t,e){var n,r,i,o,a,s,l,h,u,c,f=0;for(u=0;u<8;++u){n=t[f],r=t[f+1],i=t[f+2],o=t[f+3],a=t[f+4],s=t[f+5],l=t[f+6];var p=n+(h=t[f+7]),d=n-h,g=r+l,m=r-l,y=i+s,v=i-s,w=o+a,b=o-a,x=p+w,N=p-w,L=g+y,A=g-y;t[f]=x+L,t[f+4]=x-L;var S=.707106781*(A+N);t[f+2]=N+S,t[f+6]=N-S;var _=.382683433*((x=b+v)-(A=m+d)),F=.5411961*x+_,P=1.306562965*A+_,k=.707106781*(L=v+m),I=d+k,C=d-k;t[f+5]=C+F,t[f+3]=C-F,t[f+1]=I+P,t[f+7]=I-P,f+=8}for(u=f=0;u<8;++u){n=t[f],r=t[f+8],i=t[f+16],o=t[f+24],a=t[f+32],s=t[f+40],l=t[f+48];var B=n+(h=t[f+56]),j=n-h,E=r+l,M=r-l,O=i+s,q=i-s,T=o+a,R=o-a,D=B+T,U=B-T,z=E+O,H=E-O;t[f]=D+z,t[f+32]=D-z;var W=.707106781*(H+U);t[f+16]=U+W,t[f+48]=U-W;var V=.382683433*((D=R+q)-(H=M+j)),G=.5411961*D+V,Y=1.306562965*H+V,J=.707106781*(z=q+M),X=j+J,K=j-J;t[f+40]=K+G,t[f+24]=K-G,t[f+8]=X+Y,t[f+56]=X-Y,f++}for(u=0;u<64;++u)c=t[u]*e[u],Z[u]=0<c?c+.5|0:c-.5|0;return Z}(t,e),h=0;h<64;++h)w[b[h]]=l[h];var u=w[0]-n;n=w[0],0==u?V(r[0]):(V(r[v[o=32767+u]]),V(y[o]));for(var c=63;0<c&&0==w[c];c--);if(0==c)return V(a),n;for(var f,p=1;p<=c;){for(var d=p;0==w[p]&&p<=c;++p);var g=p-d;if(16<=g){f=g>>4;for(var m=1;m<=f;++m)V(s);g&=15}o=32767+w[p],V(i[(g<<4)+v[o]]),V(y[o]),p++}return 63!=c&&V(a),n}function X(t){if(t<=0&&(t=1),100<t&&(t=100),e!=t){(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;n<64;n++){var r=c((e[n]*t+50)/100);r<1?r=1:255<r&&(r=255),_[b[n]]=r}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],o=0;o<64;o++){var a=c((i[o]*t+50)/100);a<1?a=1:255<a&&(a=255),F[b[o]]=a}for(var s=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],l=0,h=0;h<8;h++)for(var u=0;u<8;u++)P[l]=1/(_[b[l]]*s[h]*s[u]*8),k[l]=1/(F[b[l]]*s[h]*s[u]*8),l++})(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),e=t}}this.encode=function(t,e){var n,r;(new Date).getTime();e&&X(e),I=new Array,C=0,B=7,Y(65496),Y(65504),Y(16),G(74),G(70),G(73),G(70),G(0),G(1),G(1),G(0),Y(1),Y(1),G(0),G(0),function(){Y(65499),Y(132),G(0);for(var t=0;t<64;t++)G(_[t]);G(1);for(var e=0;e<64;e++)G(F[e])}(),n=t.width,r=t.height,Y(65472),Y(17),G(8),Y(r),Y(n),G(3),G(1),G(17),G(0),G(2),G(17),G(1),G(3),G(17),G(1),function(){Y(65476),Y(418),G(0);for(var t=0;t<16;t++)G(q[t+1]);for(var e=0;e<=11;e++)G(T[e]);G(16);for(var n=0;n<16;n++)G(R[n+1]);for(var r=0;r<=161;r++)G(D[r]);G(1);for(var i=0;i<16;i++)G(U[i+1]);for(var o=0;o<=11;o++)G(z[o]);G(17);for(var a=0;a<16;a++)G(H[a+1]);for(var s=0;s<=161;s++)G(W[s])}(),Y(65498),Y(12),G(3),G(1),G(0),G(2),G(17),G(3),G(17),G(0),G(63),G(0);var i=0,o=0,a=0;C=0,B=7,this.encode.displayName=\"_encode_\";for(var s,l,h,u,c,f,p,d,g,m=t.data,y=t.width,v=t.height,w=4*y,b=0;b<v;){for(s=0;s<w;){for(f=c=w*b+s,p=-1,g=d=0;g<64;g++)f=c+(d=g>>3)*w+(p=4*(7&g)),v<=b+d&&(f-=w*(b+1+d-v)),w<=s+p&&(f-=s+p-w+4),l=m[f++],h=m[f++],u=m[f++],j[g]=(O[l]+O[h+256>>0]+O[u+512>>0]>>16)-128,E[g]=(O[l+768>>0]+O[h+1024>>0]+O[u+1280>>0]>>16)-128,M[g]=(O[l+1280>>0]+O[h+1536>>0]+O[u+1792>>0]>>16)-128;i=J(j,P,i,N,A),o=J(E,k,o,L,S),a=J(M,k,a,L,S),s+=32}b+=8}if(0<=B){var x=[];x[1]=B+1,x[0]=(1<<B+1)-1,V(x)}return Y(65497),new Uint8Array(I)},function(){(new Date).getTime();t||(t=50),function(){for(var t=String.fromCharCode,e=0;e<256;e++)n[e]=t(e)}(),N=r(q,T),L=r(U,z),A=r(R,D),S=r(H,W),function(){for(var t=1,e=2,n=1;n<=15;n++){for(var r=t;r<e;r++)v[32767+r]=n,y[32767+r]=[],y[32767+r][1]=n,y[32767+r][0]=r;for(var i=-(e-1);i<=-t;i++)v[32767+i]=n,y[32767+i]=[],y[32767+i][1]=n,y[32767+i][0]=e-1+i;t<<=1,e<<=1}}(),function(){for(var t=0;t<256;t++)O[t]=19595*t,O[t+256>>0]=38470*t,O[t+512>>0]=7471*t+32768,O[t+768>>0]=-11059*t,O[t+1024>>0]=-21709*t,O[t+1280>>0]=32768*t+8421375,O[t+1536>>0]=-27439*t,O[t+1792>>0]=-5329*t}(),X(t),(new Date).getTime()}()}", "title": "" }, { "docid": "0b21ea46c2424344b92e4d2c12ef00d7", "score": "0.51733893", "text": "function _t(t){var N,L,A,S,e,c=Math.floor,_=new Array(64),F=new Array(64),P=new Array(64),k=new Array(64),y=new Array(65535),v=new Array(65535),Z=new Array(64),w=new Array(64),I=[],C=0,B=7,j=new Array(64),E=new Array(64),M=new Array(64),n=new Array(256),O=new Array(2048),b=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],q=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],T=[0,1,2,3,4,5,6,7,8,9,10,11],R=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],D=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],U=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],z=[0,1,2,3,4,5,6,7,8,9,10,11],H=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],W=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function r(t,e){for(var n=0,r=0,i=new Array,o=1;o<=16;o++){for(var a=1;a<=t[o];a++)i[e[r]]=[],i[e[r]][0]=n,i[e[r]][1]=o,r++,n++;n*=2}return i}function V(t){for(var e=t[0],n=t[1]-1;0<=n;)e&1<<n&&(C|=1<<B),n--,--B<0&&(255==C?(G(255),G(0)):G(C),B=7,C=0)}function G(t){I.push(t)}function Y(t){G(t>>8&255),G(255&t)}function J(t,e,n,r,i){for(var o,a=i[0],s=i[240],l=function(t,e){var n,r,i,o,a,s,l,h,u,c,f=0;for(u=0;u<8;++u){n=t[f],r=t[f+1],i=t[f+2],o=t[f+3],a=t[f+4],s=t[f+5],l=t[f+6];var p=n+(h=t[f+7]),d=n-h,g=r+l,m=r-l,y=i+s,v=i-s,w=o+a,b=o-a,x=p+w,N=p-w,L=g+y,A=g-y;t[f]=x+L,t[f+4]=x-L;var S=.707106781*(A+N);t[f+2]=N+S,t[f+6]=N-S;var _=.382683433*((x=b+v)-(A=m+d)),F=.5411961*x+_,P=1.306562965*A+_,k=.707106781*(L=v+m),I=d+k,C=d-k;t[f+5]=C+F,t[f+3]=C-F,t[f+1]=I+P,t[f+7]=I-P,f+=8}for(u=f=0;u<8;++u){n=t[f],r=t[f+8],i=t[f+16],o=t[f+24],a=t[f+32],s=t[f+40],l=t[f+48];var B=n+(h=t[f+56]),j=n-h,E=r+l,M=r-l,O=i+s,q=i-s,T=o+a,R=o-a,D=B+T,U=B-T,z=E+O,H=E-O;t[f]=D+z,t[f+32]=D-z;var W=.707106781*(H+U);t[f+16]=U+W,t[f+48]=U-W;var V=.382683433*((D=R+q)-(H=M+j)),G=.5411961*D+V,Y=1.306562965*H+V,J=.707106781*(z=q+M),X=j+J,K=j-J;t[f+40]=K+G,t[f+24]=K-G,t[f+8]=X+Y,t[f+56]=X-Y,f++}for(u=0;u<64;++u)c=t[u]*e[u],Z[u]=0<c?c+.5|0:c-.5|0;return Z}(t,e),h=0;h<64;++h)w[b[h]]=l[h];var u=w[0]-n;n=w[0],0==u?V(r[0]):(V(r[v[o=32767+u]]),V(y[o]));for(var c=63;0<c&&0==w[c];c--);if(0==c)return V(a),n;for(var f,p=1;p<=c;){for(var d=p;0==w[p]&&p<=c;++p);var g=p-d;if(16<=g){f=g>>4;for(var m=1;m<=f;++m)V(s);g&=15}o=32767+w[p],V(i[(g<<4)+v[o]]),V(y[o]),p++}return 63!=c&&V(a),n}function X(t){if(t<=0&&(t=1),100<t&&(t=100),e!=t){(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;n<64;n++){var r=c((e[n]*t+50)/100);r<1?r=1:255<r&&(r=255),_[b[n]]=r}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],o=0;o<64;o++){var a=c((i[o]*t+50)/100);a<1?a=1:255<a&&(a=255),F[b[o]]=a}for(var s=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],l=0,h=0;h<8;h++)for(var u=0;u<8;u++)P[l]=1/(_[b[l]]*s[h]*s[u]*8),k[l]=1/(F[b[l]]*s[h]*s[u]*8),l++})(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),e=t}}this.encode=function(t,e){var n,r;(new Date).getTime();e&&X(e),I=new Array,C=0,B=7,Y(65496),Y(65504),Y(16),G(74),G(70),G(73),G(70),G(0),G(1),G(1),G(0),Y(1),Y(1),G(0),G(0),function(){Y(65499),Y(132),G(0);for(var t=0;t<64;t++)G(_[t]);G(1);for(var e=0;e<64;e++)G(F[e])}(),n=t.width,r=t.height,Y(65472),Y(17),G(8),Y(r),Y(n),G(3),G(1),G(17),G(0),G(2),G(17),G(1),G(3),G(17),G(1),function(){Y(65476),Y(418),G(0);for(var t=0;t<16;t++)G(q[t+1]);for(var e=0;e<=11;e++)G(T[e]);G(16);for(var n=0;n<16;n++)G(R[n+1]);for(var r=0;r<=161;r++)G(D[r]);G(1);for(var i=0;i<16;i++)G(U[i+1]);for(var o=0;o<=11;o++)G(z[o]);G(17);for(var a=0;a<16;a++)G(H[a+1]);for(var s=0;s<=161;s++)G(W[s])}(),Y(65498),Y(12),G(3),G(1),G(0),G(2),G(17),G(3),G(17),G(0),G(63),G(0);var i=0,o=0,a=0;C=0,B=7,this.encode.displayName=\"_encode_\";for(var s,l,h,u,c,f,p,d,g,m=t.data,y=t.width,v=t.height,w=4*y,b=0;b<v;){for(s=0;s<w;){for(f=c=w*b+s,p=-1,g=d=0;g<64;g++)f=c+(d=g>>3)*w+(p=4*(7&g)),v<=b+d&&(f-=w*(b+1+d-v)),w<=s+p&&(f-=s+p-w+4),l=m[f++],h=m[f++],u=m[f++],j[g]=(O[l]+O[h+256>>0]+O[u+512>>0]>>16)-128,E[g]=(O[l+768>>0]+O[h+1024>>0]+O[u+1280>>0]>>16)-128,M[g]=(O[l+1280>>0]+O[h+1536>>0]+O[u+1792>>0]>>16)-128;i=J(j,P,i,N,A),o=J(E,k,o,L,S),a=J(M,k,a,L,S),s+=32}b+=8}if(0<=B){var x=[];x[1]=B+1,x[0]=(1<<B+1)-1,V(x)}return Y(65497),new Uint8Array(I)},function(){(new Date).getTime();t||(t=50),function(){for(var t=String.fromCharCode,e=0;e<256;e++)n[e]=t(e)}(),N=r(q,T),L=r(U,z),A=r(R,D),S=r(H,W),function(){for(var t=1,e=2,n=1;n<=15;n++){for(var r=t;r<e;r++)v[32767+r]=n,y[32767+r]=[],y[32767+r][1]=n,y[32767+r][0]=r;for(var i=-(e-1);i<=-t;i++)v[32767+i]=n,y[32767+i]=[],y[32767+i][1]=n,y[32767+i][0]=e-1+i;t<<=1,e<<=1}}(),function(){for(var t=0;t<256;t++)O[t]=19595*t,O[t+256>>0]=38470*t,O[t+512>>0]=7471*t+32768,O[t+768>>0]=-11059*t,O[t+1024>>0]=-21709*t,O[t+1280>>0]=32768*t+8421375,O[t+1536>>0]=-27439*t,O[t+1792>>0]=-5329*t}(),X(t),(new Date).getTime()}()}", "title": "" }, { "docid": "0b21ea46c2424344b92e4d2c12ef00d7", "score": "0.51733893", "text": "function _t(t){var N,L,A,S,e,c=Math.floor,_=new Array(64),F=new Array(64),P=new Array(64),k=new Array(64),y=new Array(65535),v=new Array(65535),Z=new Array(64),w=new Array(64),I=[],C=0,B=7,j=new Array(64),E=new Array(64),M=new Array(64),n=new Array(256),O=new Array(2048),b=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],q=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],T=[0,1,2,3,4,5,6,7,8,9,10,11],R=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],D=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],U=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],z=[0,1,2,3,4,5,6,7,8,9,10,11],H=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],W=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function r(t,e){for(var n=0,r=0,i=new Array,o=1;o<=16;o++){for(var a=1;a<=t[o];a++)i[e[r]]=[],i[e[r]][0]=n,i[e[r]][1]=o,r++,n++;n*=2}return i}function V(t){for(var e=t[0],n=t[1]-1;0<=n;)e&1<<n&&(C|=1<<B),n--,--B<0&&(255==C?(G(255),G(0)):G(C),B=7,C=0)}function G(t){I.push(t)}function Y(t){G(t>>8&255),G(255&t)}function J(t,e,n,r,i){for(var o,a=i[0],s=i[240],l=function(t,e){var n,r,i,o,a,s,l,h,u,c,f=0;for(u=0;u<8;++u){n=t[f],r=t[f+1],i=t[f+2],o=t[f+3],a=t[f+4],s=t[f+5],l=t[f+6];var p=n+(h=t[f+7]),d=n-h,g=r+l,m=r-l,y=i+s,v=i-s,w=o+a,b=o-a,x=p+w,N=p-w,L=g+y,A=g-y;t[f]=x+L,t[f+4]=x-L;var S=.707106781*(A+N);t[f+2]=N+S,t[f+6]=N-S;var _=.382683433*((x=b+v)-(A=m+d)),F=.5411961*x+_,P=1.306562965*A+_,k=.707106781*(L=v+m),I=d+k,C=d-k;t[f+5]=C+F,t[f+3]=C-F,t[f+1]=I+P,t[f+7]=I-P,f+=8}for(u=f=0;u<8;++u){n=t[f],r=t[f+8],i=t[f+16],o=t[f+24],a=t[f+32],s=t[f+40],l=t[f+48];var B=n+(h=t[f+56]),j=n-h,E=r+l,M=r-l,O=i+s,q=i-s,T=o+a,R=o-a,D=B+T,U=B-T,z=E+O,H=E-O;t[f]=D+z,t[f+32]=D-z;var W=.707106781*(H+U);t[f+16]=U+W,t[f+48]=U-W;var V=.382683433*((D=R+q)-(H=M+j)),G=.5411961*D+V,Y=1.306562965*H+V,J=.707106781*(z=q+M),X=j+J,K=j-J;t[f+40]=K+G,t[f+24]=K-G,t[f+8]=X+Y,t[f+56]=X-Y,f++}for(u=0;u<64;++u)c=t[u]*e[u],Z[u]=0<c?c+.5|0:c-.5|0;return Z}(t,e),h=0;h<64;++h)w[b[h]]=l[h];var u=w[0]-n;n=w[0],0==u?V(r[0]):(V(r[v[o=32767+u]]),V(y[o]));for(var c=63;0<c&&0==w[c];c--);if(0==c)return V(a),n;for(var f,p=1;p<=c;){for(var d=p;0==w[p]&&p<=c;++p);var g=p-d;if(16<=g){f=g>>4;for(var m=1;m<=f;++m)V(s);g&=15}o=32767+w[p],V(i[(g<<4)+v[o]]),V(y[o]),p++}return 63!=c&&V(a),n}function X(t){if(t<=0&&(t=1),100<t&&(t=100),e!=t){(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;n<64;n++){var r=c((e[n]*t+50)/100);r<1?r=1:255<r&&(r=255),_[b[n]]=r}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],o=0;o<64;o++){var a=c((i[o]*t+50)/100);a<1?a=1:255<a&&(a=255),F[b[o]]=a}for(var s=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],l=0,h=0;h<8;h++)for(var u=0;u<8;u++)P[l]=1/(_[b[l]]*s[h]*s[u]*8),k[l]=1/(F[b[l]]*s[h]*s[u]*8),l++})(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),e=t}}this.encode=function(t,e){var n,r;(new Date).getTime();e&&X(e),I=new Array,C=0,B=7,Y(65496),Y(65504),Y(16),G(74),G(70),G(73),G(70),G(0),G(1),G(1),G(0),Y(1),Y(1),G(0),G(0),function(){Y(65499),Y(132),G(0);for(var t=0;t<64;t++)G(_[t]);G(1);for(var e=0;e<64;e++)G(F[e])}(),n=t.width,r=t.height,Y(65472),Y(17),G(8),Y(r),Y(n),G(3),G(1),G(17),G(0),G(2),G(17),G(1),G(3),G(17),G(1),function(){Y(65476),Y(418),G(0);for(var t=0;t<16;t++)G(q[t+1]);for(var e=0;e<=11;e++)G(T[e]);G(16);for(var n=0;n<16;n++)G(R[n+1]);for(var r=0;r<=161;r++)G(D[r]);G(1);for(var i=0;i<16;i++)G(U[i+1]);for(var o=0;o<=11;o++)G(z[o]);G(17);for(var a=0;a<16;a++)G(H[a+1]);for(var s=0;s<=161;s++)G(W[s])}(),Y(65498),Y(12),G(3),G(1),G(0),G(2),G(17),G(3),G(17),G(0),G(63),G(0);var i=0,o=0,a=0;C=0,B=7,this.encode.displayName=\"_encode_\";for(var s,l,h,u,c,f,p,d,g,m=t.data,y=t.width,v=t.height,w=4*y,b=0;b<v;){for(s=0;s<w;){for(f=c=w*b+s,p=-1,g=d=0;g<64;g++)f=c+(d=g>>3)*w+(p=4*(7&g)),v<=b+d&&(f-=w*(b+1+d-v)),w<=s+p&&(f-=s+p-w+4),l=m[f++],h=m[f++],u=m[f++],j[g]=(O[l]+O[h+256>>0]+O[u+512>>0]>>16)-128,E[g]=(O[l+768>>0]+O[h+1024>>0]+O[u+1280>>0]>>16)-128,M[g]=(O[l+1280>>0]+O[h+1536>>0]+O[u+1792>>0]>>16)-128;i=J(j,P,i,N,A),o=J(E,k,o,L,S),a=J(M,k,a,L,S),s+=32}b+=8}if(0<=B){var x=[];x[1]=B+1,x[0]=(1<<B+1)-1,V(x)}return Y(65497),new Uint8Array(I)},function(){(new Date).getTime();t||(t=50),function(){for(var t=String.fromCharCode,e=0;e<256;e++)n[e]=t(e)}(),N=r(q,T),L=r(U,z),A=r(R,D),S=r(H,W),function(){for(var t=1,e=2,n=1;n<=15;n++){for(var r=t;r<e;r++)v[32767+r]=n,y[32767+r]=[],y[32767+r][1]=n,y[32767+r][0]=r;for(var i=-(e-1);i<=-t;i++)v[32767+i]=n,y[32767+i]=[],y[32767+i][1]=n,y[32767+i][0]=e-1+i;t<<=1,e<<=1}}(),function(){for(var t=0;t<256;t++)O[t]=19595*t,O[t+256>>0]=38470*t,O[t+512>>0]=7471*t+32768,O[t+768>>0]=-11059*t,O[t+1024>>0]=-21709*t,O[t+1280>>0]=32768*t+8421375,O[t+1536>>0]=-27439*t,O[t+1792>>0]=-5329*t}(),X(t),(new Date).getTime()}()}", "title": "" }, { "docid": "0b21ea46c2424344b92e4d2c12ef00d7", "score": "0.51733893", "text": "function _t(t){var N,L,A,S,e,c=Math.floor,_=new Array(64),F=new Array(64),P=new Array(64),k=new Array(64),y=new Array(65535),v=new Array(65535),Z=new Array(64),w=new Array(64),I=[],C=0,B=7,j=new Array(64),E=new Array(64),M=new Array(64),n=new Array(256),O=new Array(2048),b=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],q=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],T=[0,1,2,3,4,5,6,7,8,9,10,11],R=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],D=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],U=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],z=[0,1,2,3,4,5,6,7,8,9,10,11],H=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],W=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function r(t,e){for(var n=0,r=0,i=new Array,o=1;o<=16;o++){for(var a=1;a<=t[o];a++)i[e[r]]=[],i[e[r]][0]=n,i[e[r]][1]=o,r++,n++;n*=2}return i}function V(t){for(var e=t[0],n=t[1]-1;0<=n;)e&1<<n&&(C|=1<<B),n--,--B<0&&(255==C?(G(255),G(0)):G(C),B=7,C=0)}function G(t){I.push(t)}function Y(t){G(t>>8&255),G(255&t)}function J(t,e,n,r,i){for(var o,a=i[0],s=i[240],l=function(t,e){var n,r,i,o,a,s,l,h,u,c,f=0;for(u=0;u<8;++u){n=t[f],r=t[f+1],i=t[f+2],o=t[f+3],a=t[f+4],s=t[f+5],l=t[f+6];var p=n+(h=t[f+7]),d=n-h,g=r+l,m=r-l,y=i+s,v=i-s,w=o+a,b=o-a,x=p+w,N=p-w,L=g+y,A=g-y;t[f]=x+L,t[f+4]=x-L;var S=.707106781*(A+N);t[f+2]=N+S,t[f+6]=N-S;var _=.382683433*((x=b+v)-(A=m+d)),F=.5411961*x+_,P=1.306562965*A+_,k=.707106781*(L=v+m),I=d+k,C=d-k;t[f+5]=C+F,t[f+3]=C-F,t[f+1]=I+P,t[f+7]=I-P,f+=8}for(u=f=0;u<8;++u){n=t[f],r=t[f+8],i=t[f+16],o=t[f+24],a=t[f+32],s=t[f+40],l=t[f+48];var B=n+(h=t[f+56]),j=n-h,E=r+l,M=r-l,O=i+s,q=i-s,T=o+a,R=o-a,D=B+T,U=B-T,z=E+O,H=E-O;t[f]=D+z,t[f+32]=D-z;var W=.707106781*(H+U);t[f+16]=U+W,t[f+48]=U-W;var V=.382683433*((D=R+q)-(H=M+j)),G=.5411961*D+V,Y=1.306562965*H+V,J=.707106781*(z=q+M),X=j+J,K=j-J;t[f+40]=K+G,t[f+24]=K-G,t[f+8]=X+Y,t[f+56]=X-Y,f++}for(u=0;u<64;++u)c=t[u]*e[u],Z[u]=0<c?c+.5|0:c-.5|0;return Z}(t,e),h=0;h<64;++h)w[b[h]]=l[h];var u=w[0]-n;n=w[0],0==u?V(r[0]):(V(r[v[o=32767+u]]),V(y[o]));for(var c=63;0<c&&0==w[c];c--);if(0==c)return V(a),n;for(var f,p=1;p<=c;){for(var d=p;0==w[p]&&p<=c;++p);var g=p-d;if(16<=g){f=g>>4;for(var m=1;m<=f;++m)V(s);g&=15}o=32767+w[p],V(i[(g<<4)+v[o]]),V(y[o]),p++}return 63!=c&&V(a),n}function X(t){if(t<=0&&(t=1),100<t&&(t=100),e!=t){(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;n<64;n++){var r=c((e[n]*t+50)/100);r<1?r=1:255<r&&(r=255),_[b[n]]=r}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],o=0;o<64;o++){var a=c((i[o]*t+50)/100);a<1?a=1:255<a&&(a=255),F[b[o]]=a}for(var s=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],l=0,h=0;h<8;h++)for(var u=0;u<8;u++)P[l]=1/(_[b[l]]*s[h]*s[u]*8),k[l]=1/(F[b[l]]*s[h]*s[u]*8),l++})(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),e=t}}this.encode=function(t,e){var n,r;(new Date).getTime();e&&X(e),I=new Array,C=0,B=7,Y(65496),Y(65504),Y(16),G(74),G(70),G(73),G(70),G(0),G(1),G(1),G(0),Y(1),Y(1),G(0),G(0),function(){Y(65499),Y(132),G(0);for(var t=0;t<64;t++)G(_[t]);G(1);for(var e=0;e<64;e++)G(F[e])}(),n=t.width,r=t.height,Y(65472),Y(17),G(8),Y(r),Y(n),G(3),G(1),G(17),G(0),G(2),G(17),G(1),G(3),G(17),G(1),function(){Y(65476),Y(418),G(0);for(var t=0;t<16;t++)G(q[t+1]);for(var e=0;e<=11;e++)G(T[e]);G(16);for(var n=0;n<16;n++)G(R[n+1]);for(var r=0;r<=161;r++)G(D[r]);G(1);for(var i=0;i<16;i++)G(U[i+1]);for(var o=0;o<=11;o++)G(z[o]);G(17);for(var a=0;a<16;a++)G(H[a+1]);for(var s=0;s<=161;s++)G(W[s])}(),Y(65498),Y(12),G(3),G(1),G(0),G(2),G(17),G(3),G(17),G(0),G(63),G(0);var i=0,o=0,a=0;C=0,B=7,this.encode.displayName=\"_encode_\";for(var s,l,h,u,c,f,p,d,g,m=t.data,y=t.width,v=t.height,w=4*y,b=0;b<v;){for(s=0;s<w;){for(f=c=w*b+s,p=-1,g=d=0;g<64;g++)f=c+(d=g>>3)*w+(p=4*(7&g)),v<=b+d&&(f-=w*(b+1+d-v)),w<=s+p&&(f-=s+p-w+4),l=m[f++],h=m[f++],u=m[f++],j[g]=(O[l]+O[h+256>>0]+O[u+512>>0]>>16)-128,E[g]=(O[l+768>>0]+O[h+1024>>0]+O[u+1280>>0]>>16)-128,M[g]=(O[l+1280>>0]+O[h+1536>>0]+O[u+1792>>0]>>16)-128;i=J(j,P,i,N,A),o=J(E,k,o,L,S),a=J(M,k,a,L,S),s+=32}b+=8}if(0<=B){var x=[];x[1]=B+1,x[0]=(1<<B+1)-1,V(x)}return Y(65497),new Uint8Array(I)},function(){(new Date).getTime();t||(t=50),function(){for(var t=String.fromCharCode,e=0;e<256;e++)n[e]=t(e)}(),N=r(q,T),L=r(U,z),A=r(R,D),S=r(H,W),function(){for(var t=1,e=2,n=1;n<=15;n++){for(var r=t;r<e;r++)v[32767+r]=n,y[32767+r]=[],y[32767+r][1]=n,y[32767+r][0]=r;for(var i=-(e-1);i<=-t;i++)v[32767+i]=n,y[32767+i]=[],y[32767+i][1]=n,y[32767+i][0]=e-1+i;t<<=1,e<<=1}}(),function(){for(var t=0;t<256;t++)O[t]=19595*t,O[t+256>>0]=38470*t,O[t+512>>0]=7471*t+32768,O[t+768>>0]=-11059*t,O[t+1024>>0]=-21709*t,O[t+1280>>0]=32768*t+8421375,O[t+1536>>0]=-27439*t,O[t+1792>>0]=-5329*t}(),X(t),(new Date).getTime()}()}", "title": "" }, { "docid": "0b21ea46c2424344b92e4d2c12ef00d7", "score": "0.51733893", "text": "function _t(t){var N,L,A,S,e,c=Math.floor,_=new Array(64),F=new Array(64),P=new Array(64),k=new Array(64),y=new Array(65535),v=new Array(65535),Z=new Array(64),w=new Array(64),I=[],C=0,B=7,j=new Array(64),E=new Array(64),M=new Array(64),n=new Array(256),O=new Array(2048),b=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],q=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],T=[0,1,2,3,4,5,6,7,8,9,10,11],R=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],D=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],U=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],z=[0,1,2,3,4,5,6,7,8,9,10,11],H=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],W=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function r(t,e){for(var n=0,r=0,i=new Array,o=1;o<=16;o++){for(var a=1;a<=t[o];a++)i[e[r]]=[],i[e[r]][0]=n,i[e[r]][1]=o,r++,n++;n*=2}return i}function V(t){for(var e=t[0],n=t[1]-1;0<=n;)e&1<<n&&(C|=1<<B),n--,--B<0&&(255==C?(G(255),G(0)):G(C),B=7,C=0)}function G(t){I.push(t)}function Y(t){G(t>>8&255),G(255&t)}function J(t,e,n,r,i){for(var o,a=i[0],s=i[240],l=function(t,e){var n,r,i,o,a,s,l,h,u,c,f=0;for(u=0;u<8;++u){n=t[f],r=t[f+1],i=t[f+2],o=t[f+3],a=t[f+4],s=t[f+5],l=t[f+6];var p=n+(h=t[f+7]),d=n-h,g=r+l,m=r-l,y=i+s,v=i-s,w=o+a,b=o-a,x=p+w,N=p-w,L=g+y,A=g-y;t[f]=x+L,t[f+4]=x-L;var S=.707106781*(A+N);t[f+2]=N+S,t[f+6]=N-S;var _=.382683433*((x=b+v)-(A=m+d)),F=.5411961*x+_,P=1.306562965*A+_,k=.707106781*(L=v+m),I=d+k,C=d-k;t[f+5]=C+F,t[f+3]=C-F,t[f+1]=I+P,t[f+7]=I-P,f+=8}for(u=f=0;u<8;++u){n=t[f],r=t[f+8],i=t[f+16],o=t[f+24],a=t[f+32],s=t[f+40],l=t[f+48];var B=n+(h=t[f+56]),j=n-h,E=r+l,M=r-l,O=i+s,q=i-s,T=o+a,R=o-a,D=B+T,U=B-T,z=E+O,H=E-O;t[f]=D+z,t[f+32]=D-z;var W=.707106781*(H+U);t[f+16]=U+W,t[f+48]=U-W;var V=.382683433*((D=R+q)-(H=M+j)),G=.5411961*D+V,Y=1.306562965*H+V,J=.707106781*(z=q+M),X=j+J,K=j-J;t[f+40]=K+G,t[f+24]=K-G,t[f+8]=X+Y,t[f+56]=X-Y,f++}for(u=0;u<64;++u)c=t[u]*e[u],Z[u]=0<c?c+.5|0:c-.5|0;return Z}(t,e),h=0;h<64;++h)w[b[h]]=l[h];var u=w[0]-n;n=w[0],0==u?V(r[0]):(V(r[v[o=32767+u]]),V(y[o]));for(var c=63;0<c&&0==w[c];c--);if(0==c)return V(a),n;for(var f,p=1;p<=c;){for(var d=p;0==w[p]&&p<=c;++p);var g=p-d;if(16<=g){f=g>>4;for(var m=1;m<=f;++m)V(s);g&=15}o=32767+w[p],V(i[(g<<4)+v[o]]),V(y[o]),p++}return 63!=c&&V(a),n}function X(t){if(t<=0&&(t=1),100<t&&(t=100),e!=t){(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;n<64;n++){var r=c((e[n]*t+50)/100);r<1?r=1:255<r&&(r=255),_[b[n]]=r}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],o=0;o<64;o++){var a=c((i[o]*t+50)/100);a<1?a=1:255<a&&(a=255),F[b[o]]=a}for(var s=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],l=0,h=0;h<8;h++)for(var u=0;u<8;u++)P[l]=1/(_[b[l]]*s[h]*s[u]*8),k[l]=1/(F[b[l]]*s[h]*s[u]*8),l++})(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),e=t}}this.encode=function(t,e){var n,r;(new Date).getTime();e&&X(e),I=new Array,C=0,B=7,Y(65496),Y(65504),Y(16),G(74),G(70),G(73),G(70),G(0),G(1),G(1),G(0),Y(1),Y(1),G(0),G(0),function(){Y(65499),Y(132),G(0);for(var t=0;t<64;t++)G(_[t]);G(1);for(var e=0;e<64;e++)G(F[e])}(),n=t.width,r=t.height,Y(65472),Y(17),G(8),Y(r),Y(n),G(3),G(1),G(17),G(0),G(2),G(17),G(1),G(3),G(17),G(1),function(){Y(65476),Y(418),G(0);for(var t=0;t<16;t++)G(q[t+1]);for(var e=0;e<=11;e++)G(T[e]);G(16);for(var n=0;n<16;n++)G(R[n+1]);for(var r=0;r<=161;r++)G(D[r]);G(1);for(var i=0;i<16;i++)G(U[i+1]);for(var o=0;o<=11;o++)G(z[o]);G(17);for(var a=0;a<16;a++)G(H[a+1]);for(var s=0;s<=161;s++)G(W[s])}(),Y(65498),Y(12),G(3),G(1),G(0),G(2),G(17),G(3),G(17),G(0),G(63),G(0);var i=0,o=0,a=0;C=0,B=7,this.encode.displayName=\"_encode_\";for(var s,l,h,u,c,f,p,d,g,m=t.data,y=t.width,v=t.height,w=4*y,b=0;b<v;){for(s=0;s<w;){for(f=c=w*b+s,p=-1,g=d=0;g<64;g++)f=c+(d=g>>3)*w+(p=4*(7&g)),v<=b+d&&(f-=w*(b+1+d-v)),w<=s+p&&(f-=s+p-w+4),l=m[f++],h=m[f++],u=m[f++],j[g]=(O[l]+O[h+256>>0]+O[u+512>>0]>>16)-128,E[g]=(O[l+768>>0]+O[h+1024>>0]+O[u+1280>>0]>>16)-128,M[g]=(O[l+1280>>0]+O[h+1536>>0]+O[u+1792>>0]>>16)-128;i=J(j,P,i,N,A),o=J(E,k,o,L,S),a=J(M,k,a,L,S),s+=32}b+=8}if(0<=B){var x=[];x[1]=B+1,x[0]=(1<<B+1)-1,V(x)}return Y(65497),new Uint8Array(I)},function(){(new Date).getTime();t||(t=50),function(){for(var t=String.fromCharCode,e=0;e<256;e++)n[e]=t(e)}(),N=r(q,T),L=r(U,z),A=r(R,D),S=r(H,W),function(){for(var t=1,e=2,n=1;n<=15;n++){for(var r=t;r<e;r++)v[32767+r]=n,y[32767+r]=[],y[32767+r][1]=n,y[32767+r][0]=r;for(var i=-(e-1);i<=-t;i++)v[32767+i]=n,y[32767+i]=[],y[32767+i][1]=n,y[32767+i][0]=e-1+i;t<<=1,e<<=1}}(),function(){for(var t=0;t<256;t++)O[t]=19595*t,O[t+256>>0]=38470*t,O[t+512>>0]=7471*t+32768,O[t+768>>0]=-11059*t,O[t+1024>>0]=-21709*t,O[t+1280>>0]=32768*t+8421375,O[t+1536>>0]=-27439*t,O[t+1792>>0]=-5329*t}(),X(t),(new Date).getTime()}()}", "title": "" }, { "docid": "6d4f0f8a3329d308db02b3d5e1cdda3c", "score": "0.51733893", "text": "function _t(t){var N,L,A,S,e,c=Math.floor,_=new Array(64),F=new Array(64),P=new Array(64),k=new Array(64),y=new Array(65535),v=new Array(65535),Z=new Array(64),w=new Array(64),I=[],C=0,B=7,j=new Array(64),E=new Array(64),M=new Array(64),n=new Array(256),O=new Array(2048),b=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],q=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],T=[0,1,2,3,4,5,6,7,8,9,10,11],R=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],D=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],U=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],z=[0,1,2,3,4,5,6,7,8,9,10,11],H=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],W=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function r(t,e){for(var n=0,r=0,i=new Array,o=1;o<=16;o++){for(var a=1;a<=t[o];a++)i[e[r]]=[], i[e[r]][0]=n, i[e[r]][1]=o, r++, n++;n*=2;}return i}function V(t){for(var e=t[0],n=t[1]-1;0<=n;)e&1<<n&&(C|=1<<B), n--, --B<0&&(255==C?(G(255), G(0)):G(C), B=7, C=0);}function G(t){I.push(t);}function Y(t){G(t>>8&255), G(255&t);}function J(t,e,n,r,i){for(var o,a=i[0],s=i[240],l=function(t,e){var n,r,i,o,a,s,l,h,u,c,f=0;for(u=0;u<8;++u){n=t[f], r=t[f+1], i=t[f+2], o=t[f+3], a=t[f+4], s=t[f+5], l=t[f+6];var p=n+(h=t[f+7]),d=n-h,g=r+l,m=r-l,y=i+s,v=i-s,w=o+a,b=o-a,x=p+w,N=p-w,L=g+y,A=g-y;t[f]=x+L, t[f+4]=x-L;var S=.707106781*(A+N);t[f+2]=N+S, t[f+6]=N-S;var _=.382683433*((x=b+v)-(A=m+d)),F=.5411961*x+_,P=1.306562965*A+_,k=.707106781*(L=v+m),I=d+k,C=d-k;t[f+5]=C+F, t[f+3]=C-F, t[f+1]=I+P, t[f+7]=I-P, f+=8;}for(u=f=0;u<8;++u){n=t[f], r=t[f+8], i=t[f+16], o=t[f+24], a=t[f+32], s=t[f+40], l=t[f+48];var B=n+(h=t[f+56]),j=n-h,E=r+l,M=r-l,O=i+s,q=i-s,T=o+a,R=o-a,D=B+T,U=B-T,z=E+O,H=E-O;t[f]=D+z, t[f+32]=D-z;var W=.707106781*(H+U);t[f+16]=U+W, t[f+48]=U-W;var V=.382683433*((D=R+q)-(H=M+j)),G=.5411961*D+V,Y=1.306562965*H+V,J=.707106781*(z=q+M),X=j+J,K=j-J;t[f+40]=K+G, t[f+24]=K-G, t[f+8]=X+Y, t[f+56]=X-Y, f++;}for(u=0;u<64;++u)c=t[u]*e[u], Z[u]=0<c?c+.5|0:c-.5|0;return Z}(t,e),h=0;h<64;++h)w[b[h]]=l[h];var u=w[0]-n;n=w[0], 0==u?V(r[0]):(V(r[v[o=32767+u]]), V(y[o]));for(var c=63;0<c&&0==w[c];c--);if(0==c)return V(a), n;for(var f,p=1;p<=c;){for(var d=p;0==w[p]&&p<=c;++p);var g=p-d;if(16<=g){f=g>>4;for(var m=1;m<=f;++m)V(s);g&=15;}o=32767+w[p], V(i[(g<<4)+v[o]]), V(y[o]), p++;}return 63!=c&&V(a), n}function X(t){if(t<=0&&(t=1), 100<t&&(t=100), e!=t){(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;n<64;n++){var r=c((e[n]*t+50)/100);r<1?r=1:255<r&&(r=255), _[b[n]]=r;}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],o=0;o<64;o++){var a=c((i[o]*t+50)/100);a<1?a=1:255<a&&(a=255), F[b[o]]=a;}for(var s=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],l=0,h=0;h<8;h++)for(var u=0;u<8;u++)P[l]=1/(_[b[l]]*s[h]*s[u]*8), k[l]=1/(F[b[l]]*s[h]*s[u]*8), l++;})(t<50?Math.floor(5e3/t):Math.floor(200-2*t)), e=t;}}this.encode=function(t,e){var n,r;(new Date).getTime();e&&X(e), I=new Array, C=0, B=7, Y(65496), Y(65504), Y(16), G(74), G(70), G(73), G(70), G(0), G(1), G(1), G(0), Y(1), Y(1), G(0), G(0), function(){Y(65499), Y(132), G(0);for(var t=0;t<64;t++)G(_[t]);G(1);for(var e=0;e<64;e++)G(F[e]);}(), n=t.width, r=t.height, Y(65472), Y(17), G(8), Y(r), Y(n), G(3), G(1), G(17), G(0), G(2), G(17), G(1), G(3), G(17), G(1), function(){Y(65476), Y(418), G(0);for(var t=0;t<16;t++)G(q[t+1]);for(var e=0;e<=11;e++)G(T[e]);G(16);for(var n=0;n<16;n++)G(R[n+1]);for(var r=0;r<=161;r++)G(D[r]);G(1);for(var i=0;i<16;i++)G(U[i+1]);for(var o=0;o<=11;o++)G(z[o]);G(17);for(var a=0;a<16;a++)G(H[a+1]);for(var s=0;s<=161;s++)G(W[s]);}(), Y(65498), Y(12), G(3), G(1), G(0), G(2), G(17), G(3), G(17), G(0), G(63), G(0);var i=0,o=0,a=0;C=0, B=7, this.encode.displayName=\"_encode_\";for(var s,l,h,u,c,f,p,d,g,m=t.data,y=t.width,v=t.height,w=4*y,b=0;b<v;){for(s=0;s<w;){for(f=c=w*b+s, p=-1, g=d=0;g<64;g++)f=c+(d=g>>3)*w+(p=4*(7&g)), v<=b+d&&(f-=w*(b+1+d-v)), w<=s+p&&(f-=s+p-w+4), l=m[f++], h=m[f++], u=m[f++], j[g]=(O[l]+O[h+256>>0]+O[u+512>>0]>>16)-128, E[g]=(O[l+768>>0]+O[h+1024>>0]+O[u+1280>>0]>>16)-128, M[g]=(O[l+1280>>0]+O[h+1536>>0]+O[u+1792>>0]>>16)-128;i=J(j,P,i,N,A), o=J(E,k,o,L,S), a=J(M,k,a,L,S), s+=32;}b+=8;}if(0<=B){var x=[];x[1]=B+1, x[0]=(1<<B+1)-1, V(x);}return Y(65497), new Uint8Array(I)}, function(){(new Date).getTime();t||(t=50), function(){for(var t=String.fromCharCode,e=0;e<256;e++)n[e]=t(e);}(), N=r(q,T), L=r(U,z), A=r(R,D), S=r(H,W), function(){for(var t=1,e=2,n=1;n<=15;n++){for(var r=t;r<e;r++)v[32767+r]=n, y[32767+r]=[], y[32767+r][1]=n, y[32767+r][0]=r;for(var i=-(e-1);i<=-t;i++)v[32767+i]=n, y[32767+i]=[], y[32767+i][1]=n, y[32767+i][0]=e-1+i;t<<=1, e<<=1;}}(), function(){for(var t=0;t<256;t++)O[t]=19595*t, O[t+256>>0]=38470*t, O[t+512>>0]=7471*t+32768, O[t+768>>0]=-11059*t, O[t+1024>>0]=-21709*t, O[t+1280>>0]=32768*t+8421375, O[t+1536>>0]=-27439*t, O[t+1792>>0]=-5329*t;}(), X(t), (new Date).getTime();}();}", "title": "" }, { "docid": "5e5e0c49d27de9bd2527f7f8978d07b2", "score": "0.51681614", "text": "_coreSHA1(_x, _len) {\n\n _x[_len >> 5] |= 0x80 << (24 - _len % 32);\n _x[((_len + 64 >> 9) << 4) + 15] = _len;\n\n const _this = this;\n let _a = 1732584193;\n let _b = -271733879;\n let _c = -1732584194;\n let _d = 271733878;\n let _e = -1009589776;\n const _w = new Array(80);\n let i;\n let _olda;\n let _oldb;\n let _oldc;\n let _oldd;\n let _olde;\n let j;\n let _t;\n\n for (i = 0; i < _x.length; i += 16) {\n _olda = _a;\n _oldb = _b;\n _oldc = _c;\n _oldd = _d;\n _olde = _e;\n\n for (j = 0; j < 80; j++) {\n if (j < 16) {\n _w[j] = _x[i + j];\n }\n else {\n _w[j] = _this._rol(_w[j-3] ^ _w[j-8] ^ _w[j-14] ^ _w[j-16], 1);\n }\n _t = _this._safeAdd(_this._safeAdd(_this._rol(_a, 5), _this._sha1FT(j, _b, _c, _d)),\n _this._safeAdd(_this._safeAdd(_e, _w[j]), _this._sha1KT(j)));\n _e = _d;\n _d = _c;\n _c = _this._rol(_b, 30);\n _b = _a;\n _a = _t;\n }\n\n _a = _this._safeAdd(_a, _olda);\n _b = _this._safeAdd(_b, _oldb);\n _c = _this._safeAdd(_c, _oldc);\n _d = _this._safeAdd(_d, _oldd);\n _e = _this._safeAdd(_e, _olde);\n }\n return [_a, _b, _c, _d, _e];\n }", "title": "" }, { "docid": "0842758f73f0387db2482a98ce159aff", "score": "0.51610523", "text": "function anotherFunChallenge(input) {\n let a = 5; //O(1)\n let b = 10; //O(1)\n let c = 50; //O(1)\n for (let i = 0; i < input; i++) {\n let x = i + 1; //O(n)\n let y = i + 2; //O(n)\n let z = i + 3; //O(n)\n \n }\n for (let j = 0; j < input; j++) {\n let p = j * 2; //O(n)\n let q = j * 2; //O(n)\n }\n let whoAmI = \"I don't know\"; //O(1)\n }", "title": "" }, { "docid": "75e8817eee991dbd6e8300a6383f5596", "score": "0.5159886", "text": "function brainfuck_division(arg1, arg2) {\n\n //initialization of array (representing the memory) and pointer\n const arr = [0, 0, 0, 0, 0, 0];\n let i = 0;\n\n //brainfuck program begins\n\n arr[i] = arg1; // ,\n i += 1; // >\n arr[i] = arg2; // ,\n i -= 1; // <\n\n while (arr[i] !== 0) { // [ // main loop begins - it stops when the Divident is 0 \n // console.log('A ', arr, i); // uncoment for seeing progress\n arr[i] -= 1; // - // decrement the Divident \n i += 1; // >\n arr[i] -= 1; // - // decrement the Divisor \n // console.log('B ', arr, i); // uncoment for seeing progress\n while (arr[i] !== 0) { // [ // while the Divisor is not zero increment the next cell and move to the last but one cell\n\n i += 1; // >\n arr[i] += 1; // + \n i += 1; // >\n i += 1; // >\n } // ] \n // console.log('C ', arr, i); // uncoment for seeing progres\n i += 1; // > // if the Divisor is not zero then i == 5 and we will move to the last cell \n // if the Divisor is zero then i == 1 (the Divisor cell) and we will move the next cell which is 'Divisor - 1'\n // !!! this is the most difficult part of this program !!!\n\n while (arr[i] !== 0) { // [ // while the 'Divisor - 1' is not zero\n // console.log('C 0', arr, i); // uncoment for seeing progress\n arr[i] += 1; // + // increment, so that the cell value is equal to the Divisor\n // console.log('C 1', arr, i); // uncoment for seeing progress\n while (arr[i] !== 0) { // [ // copy back the Divisor from the 3rd position to the 2nd\n\n arr[i] -= 1; // -\n i -= 1; // <\n arr[i] += 1; // +\n i += 1; // >\n } // ] // we are at the 3rd position\n // console.log('C 2', arr, i); // uncoment for seeing progress\n i += 1; // > // we are the the 4th position\n arr[i] += 1; // + // increment cell representing the Quotient, each time the Divisor is zeroed we increment it\n i += 1; // > // move to the last but one cell\n i += 1; // > // move to the last cell\n // console.log('C 3', arr, i); // uncoment for seeing progress\n } // ]\n // console.log('D ', arr, i); // uncoment for seeing progress\n i -= 1; // < // move back to the 1st position, it now contains the Divident decreased by the Divisor\n i -= 1; // <\n i -= 1; // <\n i -= 1; // <\n i -= 1; // <\n // console.log('E ', arr, i); // uncoment for seeing progress\n } // ] // the 1st position is zero, whe have the Quotent and the 4th positon and the Remainder at the 3rd position\n // console.log('F ', arr, i); // uncoment for seeing progress\n i += 1; // > // move to the 4th position\n i += 1; // >\n i += 1; // >\n\n console.log(arr[i]); // . // print quotient\n\n i -= 1; // < // move back to the 3rd position\n\n console.log(arr[i]); // . // print remainder\n}", "title": "" }, { "docid": "494f03d95f7944a357a8d0da7b770bd7", "score": "0.5159169", "text": "function tester() {\n //1\n document.getElementById(\"output\").innerHTML += sleep_in(true, false);\n //2\n document.getElementById(\"output\").innerHTML += monkey_trouble(true, false);\n //3\n document.getElementById(\"output\").innerHTML += string_times('hello', 3);\n //4\n document.getElementById(\"output\").innerHTML += front_times('Hello',7);\n //5\n document.getElementById(\"output\").innerHTML += string_bits(dude);\n //6\n document.getElementById(\"output\").innerHTML += caughtSpeeding(64,true);\n //7\n document.getElementById(\"output\").innerHTML += fizz_buzz(21);\n //8\n document.getElementById(\"output\").innerHTML += teaParty(22,10);\n //9\n document.getElementById(\"output\").innerHTML += blackjack(2,21);\n //10\n document.getElementById(\"output\").innerHTML += loneSum(3,22,22);\n\n}", "title": "" }, { "docid": "07acdb9387e7f5ef04f3747b9cd4f13e", "score": "0.5153065", "text": "function operator() {\n //the arr will store two value for calculation\n let arr\n\n /*plus operator*/\n if (memory.match(/^[\\-\\+]?\\d+(\\.\\d+)?\\+(\\d+)?\\.?(\\d+|\\+)$/g)) {\n arr = memory.split('+').filter((num) => num !== '')\n memory = String(sum(arr))\n display.value = memory\n return true\n } else if (memory.match(/^[\\-\\+]?\\d+(\\.\\d+)?\\-(\\d+)?\\.?(\\d+|\\-)$/g)) {\n /* minus operator */\n console.log('minus')\n let allMinus = memory\n .split('')\n .filter((num) => num == '-')\n .join('')\n arr = memory.split('-').filter((num) => num !== '')\n if (allMinus === '--') {\n memory = `-${String(sum(arr))}`\n } else {\n memory = String(subtract(arr))\n }\n display.value = memory\n return true\n } else if (memory.match(/^[\\-\\+]?\\d+(\\.\\d+)?\\*[\\-\\+]?(\\d+)?\\.?(\\d+)$/g)) {\n /* multiple operator */\n console.log('multiple')\n let allMinus = memory\n .split('')\n .filter((num) => num == '-')\n .join('')\n arr = memory.split('*').filter((num) => num !== '')\n memory = String(multiply(arr))\n display.value = memory\n return true\n } else if (memory.match(/^[\\-\\+]?\\d+(\\.\\d+)?\\/[\\-\\+]?(\\d+)?\\.?(\\d+)$/g)) {\n /* division operator */\n console.log('division')\n arr = memory.split('/').filter((num) => num !== '')\n memory = String(division(arr))\n display.value = memory\n return true\n } else if (memory.match(/^[\\+\\-]?\\d+(\\.\\d+)?\\^[\\+\\-]?(\\d+)?\\.?\\d+$/g)) {\n /* power operator */\n console.log('power')\n arr = memory.split('^').filter((num) => num !== '')\n console.log(memory)\n memory = String(power(arr))\n display.value = memory\n return true\n } else if (memory.match(/^√[\\d+]?\\.?\\d+$/g)) {\n /* root operator*/\n console.log('root')\n let x = memory.split('√')\n memory = String(power([x[1], 0.5]))\n display.value = memory\n return true\n } else if (memory.match(/^[\\+\\-]?(\\d+\\.)?\\d+!$/g)) {\n /* factorial operator */\n console.log('factorial')\n let x = memory.split('!')\n memory = String(factorial(x[0]))\n display.value = memory\n return true\n } else if (memory.match(/^[\\+\\-]?(\\d+\\.)?\\d+%$/g)) {\n /* percentage operator */\n console.log('percentage')\n let x = memory.split('%')\n console.log(memory)\n memory = String(division([x[0], 100]))\n display.value = memory\n return true\n }\n return false\n}", "title": "" }, { "docid": "721b29c4570f712960c8e169d4cec156", "score": "0.51511043", "text": "function main4(x,y,x1,y1){\n return (xy(x+x1,y+y1)) ||\n (xy(x-x1,y+y1)) ||\n (xy(x+y1,y+x1)) ||\n (xy(x+y1,y-x1));\n}", "title": "" }, { "docid": "4fe12c154457b0a22c2158b8c2cb7782", "score": "0.51496553", "text": "function sumCalculator(q, w, e) {\r\n return q + w + e;\r\n}", "title": "" }, { "docid": "6d3d278ed5198d8d5112205442231aba", "score": "0.51494646", "text": "function basicCalculation(){\n\t\tvar input1 = getFloat(\"basic-num-1\");\n\t\tvar input2 = getFloat(\"basic-num-2\");\n\t\tvar operator = getValue(\"basic-operation\");\n\t\tvar ans;\n\n\t\tswitch(operator){\n\t\t\tcase \"+\":\n\t\t\tans = input1 + input2;\n\t\t\tbreak;\n\n\t\t\tcase \"-\":\n\t\t\tans = input1 - input2;\n\t\t\tbreak;\n\n\t\t\tcase \"*\":\n\t\t\tans = input1 * input2;\n\t\t\tbreak;\n\n\t\t\tcase \"/\":\n\t\t\tans = input1 / input2;\n\t\t\tbreak;\n\t\t}\n\n\t\tdocument.getElementById(\"basic-answer-alert\").innerHTML = input1 + operator + input2 + \"=\"+ ans;\n\t}", "title": "" }, { "docid": "80939701e7c29ef9e3c36715d7275896", "score": "0.51493734", "text": "function runOperation(operation, numbers) {\n switch (operation) {\n case '+':\n return numbers.reduce((a, b) => (a + b), 0);\n\n case '*':\n return numbers.reduce((a, b) => (a * b), 1);\n\n default:\n throw new Error('bad operation: ' + operation);\n }\n}", "title": "" }, { "docid": "634c36d11c35486cbdfc212b957bf419", "score": "0.5144139", "text": "function all8(x,y,x1,y1){\n return (xy(x+x1,y-y1)) ||\n (xy(x-x1,y-y1)) ||\n (xy(x-y1,y+x1)) ||\n (xy(x-y1,y-x1)) || \n main4(x,y,x1,y1);\n}", "title": "" } ]
99fea04cf46dd58c6c092d46fb96aa4b
Decapitalizes the first letter of str.
[ { "docid": "2c9b8c674130e0eb3fbbaaabece51e98", "score": "0.83041656", "text": "function decapitalize(str) {\n if (str) {\n return str[0].toLowerCase() + str.substr(1);\n }\n return str;\n}", "title": "" } ]
[ { "docid": "967aa9c2fb2e43aef434d9c32651c9ed", "score": "0.8469761", "text": "function decapitalize(str) {\n\t 'use strict';\n\t if (str) {\n\t return str[0].toLowerCase() + str.substr(1);\n\t }\n\t return str;\n\t}", "title": "" }, { "docid": "4b7cac9dfd1cff6f7d0f6df3e2ad4d79", "score": "0.8323208", "text": "function decapitalize(str) {\r\n if (str) {\r\n return str[0].toLowerCase() + str.substr(1);\r\n }\r\n return str;\r\n}", "title": "" }, { "docid": "a4b79eafb402e2416af539162ee9f394", "score": "0.8161726", "text": "function capitaliseFirstLetter(str) {\r\n return str.charAt(0).toUpperCase() + str.slice(1);\r\n }", "title": "" }, { "docid": "f9bf944ab0eef3ca9615165903320a84", "score": "0.8070407", "text": "function uncapitalize(str) {\n return str.charAt(0).toLowerCase() + str.slice(1);\n}", "title": "" }, { "docid": "cb36b771de333f5bd79b06f4ed1ad277", "score": "0.79666644", "text": "function capitalise(str) {\n str = str.replace(/^\\s\\s*/, '');\n return str.charAt(0).toUpperCase() + str.slice(1);\n }", "title": "" }, { "docid": "3dc4a619b4d02e01ed99b83e9aba6582", "score": "0.7863872", "text": "function capitaliseFirst(str) {\n return str.replace( /(?:_+|^)([a-z])/g, (m0, m1) => m1.toUpperCase() );\n}", "title": "" }, { "docid": "e326d9ca8cc71ebca4d40cf8fc4c6db1", "score": "0.7853976", "text": "function capitalize(str) {\n\tvar firstChar = str.charAt(0).toUpperCase();\n\treturn firstChar + str.slice(1).toLowerCase();\n}", "title": "" }, { "docid": "93cd46e24b86b597eafde4a67b828f8b", "score": "0.78382677", "text": "function decapitalize(string) {\n return string.charAt(0).toLowerCase() + string.slice(1);\n}", "title": "" }, { "docid": "14ae14ba28fa8a405d370d15f68c383b", "score": "0.7787638", "text": "function capitalize(str) {\n if (typeof (str) === \"string\" && str.length > 0) {\n // capitalize the first letter\n return str.charAt(0).toUpperCase() + str.slice(1);\n }\n else {\n return str;\n }\n }", "title": "" }, { "docid": "cbc1f90f06f480371452fe30c9412b9a", "score": "0.7771193", "text": "function cleanAndCap (str){\r\n if(!str) return null\r\n let temp = str.trim()\r\n return temp[0].toUpperCase() + temp.substring(1)\r\n}", "title": "" }, { "docid": "c934429e82b907747155cdc1eebb43a2", "score": "0.77554005", "text": "function capitalize(str) {\n return str.replace(/\\w\\S*/g, function(txt) {\n return txt.charAt(0).toUpperCase() + txt.slice(1);\n })\n}", "title": "" }, { "docid": "032ed7da5f54bc90be2a58eafe0212c7", "score": "0.7755197", "text": "function capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n }", "title": "" }, { "docid": "9e19c028c113af50ea44c5bb8043bad3", "score": "0.7748141", "text": "static capitalize(str){\n let strFirst = str[0];\n let strfirst = str[0].toUpperCase();\n return str.replace(strFirst,strfirst);\n }", "title": "" }, { "docid": "056c20c7abca5a9f39d0d05a44b51f2f", "score": "0.774606", "text": "function capitalize(str) {\r\n var arr = str.split(\"\");\r\n arr[0] = arr[0].toUpperCase();\r\n return arr.join(\"\");\r\n}", "title": "" }, { "docid": "149f970510961e5eb598f38da77a03fa", "score": "0.77374834", "text": "function uncapitalize(str){\n return str.toLowerCase();\n}", "title": "" }, { "docid": "0fccc1cbfd21b86d014b57c03402560c", "score": "0.77361935", "text": "function capitalize(str) {\n var arr = str.split(\"\");\n arr[0] = arr[0].toUpperCase();\n return arr.join(\"\");\n}", "title": "" }, { "docid": "dc8ab5d636d5a6a676dc446756ad288a", "score": "0.77341276", "text": "function capitalize(str) {\n\treturn str.charAt(0).toUpperCase() + str.slice(1);\n}", "title": "" }, { "docid": "0056767665f850952cd25b644f136b20", "score": "0.7729012", "text": "function capitalize (str) {\n}", "title": "" }, { "docid": "33b89339540acd54f963f9cdd3099425", "score": "0.7716432", "text": "function capitalize(str) {\n return str.replace(/\\w\\S*/g, ( (char) => {\n return char.charAt(0).toUpperCase() + char.substr(1).toLowerCase()\n }))\n}", "title": "" }, { "docid": "34e3a4451f16659aeebeb3fb60c535c6", "score": "0.77050656", "text": "function uncapitalize(string) {\n return string.split(' ')[0].charAt(0).toLowerCase() + string.slice(1);\n}", "title": "" }, { "docid": "d84abb92321de0e02fa2d1432894f300", "score": "0.76916087", "text": "function capitalize(str) {\r\n if (str) {\r\n return str[0].toUpperCase() + str.substr(1);\r\n }\r\n return str;\r\n}", "title": "" }, { "docid": "37a31a1d1e1670d274a98cf6ed4b891c", "score": "0.769025", "text": "function capitaliseFirstLetter(string) {\n\treturn string.charAt(0).toUpperCase() + string.slice(1);\n}", "title": "" }, { "docid": "f154f646bf954c2545457fe39a5312b9", "score": "0.76844597", "text": "function capitalize(str) {\n\t 'use strict';\n\t if (str) {\n\t return str[0].toUpperCase() + str.substr(1);\n\t }\n\t return str;\n\t}", "title": "" }, { "docid": "ba0db0059823cd33cfdecab43b9c6d63", "score": "0.76736087", "text": "function toCap(str) {\n return str.replace(/\\w\\S*/g, function(txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n}", "title": "" }, { "docid": "30fbcb03ef0d664a07368c524dd3681f", "score": "0.76729554", "text": "function letterCapitalize(str) {\n var newStr = str[0].toUpperCase();\n for (var i = 1; i < str.length; i++) {\n if (str[i-1] === \" \") {\n newStr += str[i].toUpperCase()\n }\n else {\n newStr += str[i];\n }\n }\n return newStr;\n}", "title": "" }, { "docid": "9b6c89796b6b48669fa433cb1c8493cd", "score": "0.7668174", "text": "function _capFirst(str) {\n if (str === undefined)\n return \"\";\n return str.replace(/\\w\\S*/g, function (txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n}", "title": "" }, { "docid": "d61059711c4975c009a20e3504fb22ea", "score": "0.7663845", "text": "function capitalizeFirstLetter(str) {\n\n return str.replace(/\\w\\S*/g, function(text) {\n return text.charAt(0).toUpperCase() + text.substr(1).toLowerCase();\n });\n}", "title": "" }, { "docid": "d61059711c4975c009a20e3504fb22ea", "score": "0.7663845", "text": "function capitalizeFirstLetter(str) {\n\n return str.replace(/\\w\\S*/g, function(text) {\n return text.charAt(0).toUpperCase() + text.substr(1).toLowerCase();\n });\n}", "title": "" }, { "docid": "29f8d9af9f4097b066b23bc41d186445", "score": "0.7659448", "text": "static capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n }", "title": "" }, { "docid": "5a24f08201579a93880eee598695bfa3", "score": "0.76514536", "text": "static capitalize(str) {\n return str[0].toUpperCase() + str.slice(1);\n }", "title": "" }, { "docid": "a7926802179f4a017c93e058f433fe23", "score": "0.76352507", "text": "static capitalize(str) {\n\t\treturn str[0].toUpperCase() + str.slice(1)\n\t}", "title": "" }, { "docid": "66addeec81d7e8c000d671c48baa724b", "score": "0.76341087", "text": "function capitalize(str) {\n if (str) {\n return str[0].toUpperCase() + str.substr(1);\n }\n return str;\n}", "title": "" }, { "docid": "4df112e71ae52f2bac7d0bc5ff0abd1d", "score": "0.7619933", "text": "function capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "title": "" }, { "docid": "4df112e71ae52f2bac7d0bc5ff0abd1d", "score": "0.7619933", "text": "function capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "title": "" }, { "docid": "4df112e71ae52f2bac7d0bc5ff0abd1d", "score": "0.7619933", "text": "function capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "title": "" }, { "docid": "4df112e71ae52f2bac7d0bc5ff0abd1d", "score": "0.7619933", "text": "function capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "title": "" }, { "docid": "8b007b99e3ec77a71ff39059251c2e34", "score": "0.7611643", "text": "function capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "title": "" }, { "docid": "8b007b99e3ec77a71ff39059251c2e34", "score": "0.7611643", "text": "function capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "title": "" }, { "docid": "6e1cb243951905a93444eebdac181f28", "score": "0.7609118", "text": "static capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1)\n }", "title": "" }, { "docid": "7e74ae7aa031031b97bd5b92a9bd80a8", "score": "0.76086634", "text": "function capitalize(str) {\n return str[0].toUpperCase()\n + str.toLowerCase().substr(1);\n}", "title": "" }, { "docid": "f2f62981b6aa8e1d34a808c0497e766e", "score": "0.7601162", "text": "function capitalize(str) {\n return str[0].toUpperCase() + str.slice(1);\n}", "title": "" }, { "docid": "158e2eb68b3500a895d78b2b19905e1e", "score": "0.76010513", "text": "function toCapital(str) {\n return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();\n}", "title": "" }, { "docid": "26b05f372fef851e697a3215b2a1b0b9", "score": "0.7598246", "text": "function letterCapitalize(str) {\n // lets break up str into an array of words\n var words = str.split(' ');\n \n // now loop through the array and capitalize the first letter with .charAt(0), replacing\n // that character\n for (var i = 0; i < words.length; i++) {\n words[i] = words[i].charAt(0).toUpperCase() + words[i].slice(1);\n }\n \n // now lets join them back together\n return words.join(' ');\n}", "title": "" }, { "docid": "4686b28f90e577464b2ceae1940916c1", "score": "0.7592826", "text": "function capitaliseFirst2(str) {\n var firstCapital = str.replace(/[a-z]+/g, x => x[0].toUpperCase() + x.slice(1));\n return firstCapital.replace(/_/g, '')\n}", "title": "" }, { "docid": "31f80f9ae2f92a700c5730886bd3f6e8", "score": "0.7592507", "text": "function uppercase(str) {\n\treturn str.replace(/\\w\\S*/g, function (txt) {\n\t\treturn txt.substr(0).toUpperCase();\n\t});\n}", "title": "" }, { "docid": "543984b93c3443fe50c75c23f40f8dbd", "score": "0.7592028", "text": "function capitalize(str) {\n return str[0].toUpperCase() + str.slice(1)\n}", "title": "" }, { "docid": "788450ce119b0bc0da0addd19efee9f0", "score": "0.7580864", "text": "function deCamelCase(str) {\r\n return str\r\n .replace(/([A-Z])/g, function (match) { return \" \" + match; })\r\n .replace(/^./, function (match) { return match.toUpperCase(); });\r\n}", "title": "" }, { "docid": "aa3a8ccb0dcddd095446659c3a42dc60", "score": "0.75685966", "text": "function capitalizeFirstLetter(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "title": "" }, { "docid": "37ca6d8e774df4a0a52becade3f30f23", "score": "0.7563245", "text": "function toUpperCaseFirstLetter(str){\n return str[0].toUpperCase() + str.slice(1);\n}", "title": "" }, { "docid": "43e349e58be8f136695ce903e984bf61", "score": "0.754582", "text": "function capitalize(str) {\n if (str.length == 0)\n return str;\n if (str.length == 1)\n return str[0].toUpperCase();\n return str[0].toUpperCase() + str.slice(1);\n}", "title": "" }, { "docid": "b6d7f44a2a128343bcc65c03b4e61688", "score": "0.7545684", "text": "function capitalizeFirstChar(str) {\n return str.slice(0, 1).toUpperCase() + str.slice(1);\n}", "title": "" }, { "docid": "323f46e60f0c20fd7aad520acfdca105", "score": "0.75444067", "text": "static capitalize(str){\n return str.charAt(0).toUpperCase() + str.slice(1);\n }", "title": "" }, { "docid": "9e1e0ac1e1446bb7b03b65040e92d0f1", "score": "0.7541543", "text": "function deCamelCase(str) {\n return str\n .replace(/([A-Z])/g, function (match) { return \" \" + match; })\n .replace(/^./, function (match) { return match.toUpperCase(); });\n}", "title": "" }, { "docid": "9e1e0ac1e1446bb7b03b65040e92d0f1", "score": "0.7541543", "text": "function deCamelCase(str) {\n return str\n .replace(/([A-Z])/g, function (match) { return \" \" + match; })\n .replace(/^./, function (match) { return match.toUpperCase(); });\n}", "title": "" }, { "docid": "4878998d03e6bda4cb9dd92fd32bc833", "score": "0.75360274", "text": "function capString (str) {\n return str[0].toUpperCase()+str.slice(1)\n }", "title": "" }, { "docid": "83d8c43c6e7124a347e18c9fef74abec", "score": "0.75339043", "text": "function capitalize(str){if(str===undefined||str===\"\"||typeof str!=\"string\"){return str;}return str.charAt(0).toUpperCase()+str.slice(1);}", "title": "" }, { "docid": "ffcc9c2f93bd1e04498148f62d262b90", "score": "0.7525919", "text": "function LetterCapitalize(str) { \n return str.split(' ').map(e => e.charAt(0).toUpperCase() + e.substr(1)).join(' ');\n}", "title": "" }, { "docid": "7831ed9dfbc3b81feae3e3efd3b75f9f", "score": "0.75231516", "text": "function capitalize(str) {\n if (typeof (str) !== \"string\")\n return \"\";\n\n tab = str.split(\" \");\n var result = \"\";\n tab.forEach(e => {\n result += ucfirst(e) + \" \";\n });\n return result.trim();\n}", "title": "" }, { "docid": "93196f2e24f106603b6ca26c0d40447e", "score": "0.751881", "text": "capFirstLetter(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n }", "title": "" }, { "docid": "211472e6d2a5f5f8d63336a2acaa8537", "score": "0.751584", "text": "function capital_letter(str) \n{\n str = str.split(\" \");\n\n for (var i = 0, x = str.length; i < x; i++) {\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\n }\n\n return str.join(\" \");\n}", "title": "" }, { "docid": "e5b0e92cdc70ac71edbb8e6e4adb4010", "score": "0.75148684", "text": "function capitaliseFirstLetter(string)\n {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "title": "" }, { "docid": "d1f903acdc9a15c57ae429e76220faae", "score": "0.7513721", "text": "function CapitalizeLetters(str){\n const strArr = str.toLowerCase().split(' ');\n\n for(let i =0; i < strArr.length; i ++){\n strArr[i] = strArr[i].substring(0,1).toUpperCase()+ //plucking out the first letter then we uppercase the rest\n strArr[i].substring(1); \n }\n\n return strArr.join(' ')//space because we are separating the words in an array not the characters\n}", "title": "" }, { "docid": "525f8dda2d0c523fc76a43a2261502d6", "score": "0.7499849", "text": "function uppercaseFirstLeter(str) {\n if (str) {\n return str[0].toUpperCase() + str.substr(1);\n }\n}", "title": "" }, { "docid": "10c8f9138fd04e5b676a99e699a973ba", "score": "0.74939156", "text": "static capitalize(str){\n return `${str[0].toUpperCase()}${str.substring(1)}`\n }", "title": "" }, { "docid": "11fe2acf2607fc271065d0b93eb166cd", "score": "0.74925196", "text": "function firstLetterToUpper(str) {\n words = str.split(' ');\n for (var i = 0; i < words.length; i++) {\n words[i] = words[i].charAt(0).toUpperCase() + words[i].substring(1);\n }\n\n return words.join(' ');\n}", "title": "" }, { "docid": "9e3c26c4e655696bbda21f9371737de7", "score": "0.7487173", "text": "static capitalize(str) {\n return str.slice(0, 1).toUpperCase() + str.slice(1);\n }", "title": "" }, { "docid": "eb8d922c5735315defa7671ed6cfd5d0", "score": "0.7466075", "text": "function Capitalize(str)\n{\n // first take in passed-in string, lower case all letters and then split by whitespace\n lowercase_all = str.toLowerCase().split(' ');\n // use map to upper case at index 0 (ie first letter) and keep rest of index lowercase\n uppercase_first = lowercase_all.map((s) =>s.charAt(0).toUpperCase() + s.substring(1));\n // use join to put back together as string\n result = uppercase_first.join(' ');\n // return converted string\n return result;\n}", "title": "" }, { "docid": "d66948c6671903870d521720e2cec90c", "score": "0.74634546", "text": "function capitalize(str){\n \n \n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "title": "" }, { "docid": "06d0f3341cd3b4120563286fbba6c0a4", "score": "0.74594027", "text": "function capitalizeFirstLetter(string) {\n \treturn string.charAt(0).toUpperCase() + string.slice(1);\n\t}", "title": "" }, { "docid": "332b61e6f99f1c5ef4306ca2f6dd61f5", "score": "0.74499816", "text": "function capitalize(str) {\n let result = str.trim();\n return result.substring(0, 1).toUpperCase() + result.substring(1);\n }", "title": "" }, { "docid": "e50a48cf9ec1d65a993f01547303a405", "score": "0.7448173", "text": "function capitalLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "title": "" }, { "docid": "ca0f0731abc55ce22e2f1eb78bd6009e", "score": "0.7446143", "text": "function capitaliseFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "title": "" }, { "docid": "ca0f0731abc55ce22e2f1eb78bd6009e", "score": "0.7446143", "text": "function capitaliseFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "title": "" }, { "docid": "605c95cc05f0c65e07dfe94c7807a3b3", "score": "0.7445498", "text": "static capitalize(str){\n return str.charAt(0).toUpperCase() + str.slice(1)\n }", "title": "" }, { "docid": "1c3db27daf0a66911b2fd22a578e77ee", "score": "0.7439927", "text": "function capitalizeFirstLetter(str) {\n //converting the giving string into array\n str = str.split(\" \");\n //iterating over all elements in the array\n for (let i = 0; i < str.length; i++) {\n // converting the first char to upper case &concatenating to the rest chars\n str[i] = str[i].charAt(0).toUpperCase(str[i]) + str[i].substring(1);\n }\n return str.join(\" \");\n}", "title": "" }, { "docid": "8d070495b592490794908f48fb68bbc3", "score": "0.7435584", "text": "function capitalize_first(str){\n var uppercaseFirstLetter = str.charAt(0).toUpperCase();\n return (uppercaseFirstLetter + str.slice(1)); \n}", "title": "" }, { "docid": "a2f016ca50ecbcc764dbd2942980c3c5", "score": "0.7433032", "text": "function oneCap(str){\n\treturn str.charAt(0).toUpperCase() + str.slice(1)\n}", "title": "" }, { "docid": "874f6b87fb34eb1e082ccc91e3a95f34", "score": "0.7432154", "text": "function capitalize(str){\n var i = 0;\n var first = true;\n var arr = str.split('-');\n\n while(i < arr.length){\n\n if(first){\n if(arr[i] == ''){\n arr.shift();\n continue;\n }else{\n first = false;\n }\n }else{\n arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].slice(1);\n }\n i += 1;\n }\n\n return arr.join('');\n}", "title": "" }, { "docid": "ef4bc2d2d481127ca5546a2ce89d40d2", "score": "0.74225706", "text": "function capitaliseFirstLetter (string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "title": "" }, { "docid": "88fa5082a973248846dbae3be90e87d9", "score": "0.7416365", "text": "function capitalize(str) {\n let result = str[0].toUpperCase();\n for (let i = 1; i < str.length; i++) {\n if (str[i - 1] === ' ') {\n result += str[i].toUpperCase();\n } else {\n result += str[i];\n }\n }\n return result;\n }", "title": "" }, { "docid": "b21c07d74d0d45b7604268d1d4cd3a7b", "score": "0.7411365", "text": "function capitaliseFirstLetter(string){\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "title": "" }, { "docid": "dcc54d6379fd5d82bc44f864e0bb53c4", "score": "0.74051374", "text": "function capital(str) {\n var splitStr = str.toLowerCase().split(' ');\n for (var i = 0; i < splitStr.length; i++) {\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1); \n }\n return splitStr.join(' '); \n}", "title": "" }, { "docid": "d86ab6b3ee7c5696c7314dc64d455d7a", "score": "0.7400145", "text": "function capitalize(str){if(!R.is(String,str)){return str;}return str.charAt(0).toUpperCase()+str.slice(1);}", "title": "" }, { "docid": "d24a18813a6292fcfb794d10a99ea7e4", "score": "0.7395401", "text": "function capitals(str)\n{\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n}", "title": "" }, { "docid": "6626799002a08773be9a3a70256aa0a4", "score": "0.73910505", "text": "function capitalizeLetters1 (str) {\n var splitStr = str.split(' '); // split returns an array\n str = ''; // reset str to empty string\n\n for (var i = 0; i < splitStr.length; i++) {\n var splitWord = splitStr[i].split(''); // split returns an array of letters\n splitWord.splice(0, 1, splitWord[0].toUpperCase());//replace letter 1:caps\n splitWord = splitWord.join(''); // turns array to string\n str += splitWord + ' '; // white space trimmed at return\n };\n return str.trim(); // trim white space\n}", "title": "" }, { "docid": "12dc81651d6219352891a1e1c2521de5", "score": "0.73908824", "text": "function deCamelCase(str) {\n return str.replace(/([A-Z])/g, match => ` ${match}`).replace(/^./, match => match.toUpperCase());\n}", "title": "" }, { "docid": "edd5c4ea1385adc340c9b10cc74c1b97", "score": "0.7389825", "text": "function upperFirst(str) {\r\n return str.charAt(0).toUpperCase() + str.slice(1);\r\n}", "title": "" }, { "docid": "b9d8aba5328667aaccf655611cd40bc0", "score": "0.73846245", "text": "function capitalize(str) {\n let finalStr = str[0].toUpperCase();\n\n for(let i = 1; i < str.length; i++ ){\n if (str[i-1] == ' '){\n finalStr += str[i].toUpperCase();\n }else{\n finalStr += str[i];\n }\n }\n\n return finalStr;\n}", "title": "" }, { "docid": "2b25c28bfdd9121e7a1aade6f943802e", "score": "0.7382688", "text": "function firstCapital(str){\n //...\n let jadedString =str.split(' ');\n\n for(let i =0; i<str.length ; i++){\n\n jadedString[i] = jadedString[i].charAt(0).ToUpperCase() + jadedString[i].substring(1)\n }\n return jadedString;\n \n }", "title": "" }, { "docid": "e6b30550c865b7cdb502259fc813e281", "score": "0.7382425", "text": "function capitalizeFirstLetter(string) {\n\t\t return string.charAt(0).toUpperCase() + string.slice(1);\n\t\t}", "title": "" }, { "docid": "9d5696d5c6a9f3a5909c7290e2ebdd87", "score": "0.73807126", "text": "function capsTheFirstLetterAfterSpace(str) {\n if (typeof str === 'string' & str.length > 0) {\n var stringArr = [];\n stringArr = str.split('');\n var fixedString = stringArr.map(function(char, i, arr){\n if (i === 0){\n return char.toUpperCase();\n }\n\n if (arr[i - 1] === ' '){\n return char.toUpperCase();\n }\n\n return char;\n });\n return fixedString.join('');\n }\n throw Error('Must pass a string and must be longer then 0 characters.');\n}", "title": "" }, { "docid": "ebc5a8140f0354f8e4bf08a5dd837f21", "score": "0.7376535", "text": "function capitalize(str){\n\tvar splitStr = str.toLowerCase().split(' ');\n\tfor(var i = 0; i < splitStr.length; i++) splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);\n\treturn splitStr.join(' '); \n}", "title": "" }, { "docid": "f419911b112c16d4be14e694e61400e3", "score": "0.73723656", "text": "function capitalizeWord(str){\n let firstLet = str[0];\n let rest = str.slice(1);\n firstLet = firstLet.toUpperCase();\n return firstLet + rest;\n}", "title": "" }, { "docid": "f65e026501ee409f9ab8c78a03ec2420", "score": "0.73695755", "text": "function capitalize(str) {\n return str.split(' ').map(str => str[0].toUpperCase() + str.slice(1)).join(' ');\n }", "title": "" }, { "docid": "b67e598b994c7bc5ab9951e7f693cd2b", "score": "0.7368927", "text": "function capitaliseLetter(str){\n\n //convert all to lowercase\n //split the acceptem params into individual words\n //in each word , isolate first letter and uppercase it , concat the rest of the character\n //join back all character to return a proper sentence with space\n\n return str\n .toLowerCase()\n .split(' ')\n .map(word => word[0].toUpperCase() + word.substr(1))\n .join(' ')\n}", "title": "" }, { "docid": "38d013fbacc0bd6269d2e6285ec4b017", "score": "0.73668504", "text": "strToFirstLetterUpperCase(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n }", "title": "" }, { "docid": "d143f65099784e45fb6e3772969f6f9f", "score": "0.73638254", "text": "function CapitalizeLetters(str){\n return str.replace(/\\b[a-z]/gi,function(char){\n return char.toUpperCase();\n })\n}", "title": "" }, { "docid": "17bb01205bdf7173ad7a7fc57e61bdc6", "score": "0.73594", "text": "function letterCapitalize(str) {\n words = str.toLowerCase().split(' ');\n\n for(var i = 0; i < words.length; i++) {\n var letters = words[i].split('');\n letters[0] = letters[0].toUpperCase();\n words[i] = letters.join('');\n }\n return words.join(' ');\n}", "title": "" }, { "docid": "e94d1cba1d03dd968f83b097bc02d48e", "score": "0.73552567", "text": "function capitalizeFirstLetters(str) {\n return str.split(' ').map(function (e) {\n return e.replace(/([a-z])/, function (match, value) {\n return value.toUpperCase();\n })\n }).join(' ');\n}", "title": "" }, { "docid": "4933f6c48799e1ceb8a2b4798e8578e9", "score": "0.73486525", "text": "function capitalizeLetters(str) { \r\n const r = str.toLowerCase().split(' ');\r\n const result = r.map(e => {\r\n const res = e[0].toUpperCase() + e.substring(1);\r\n return res\r\n });\r\n\r\n return result.join(' ');\r\n}", "title": "" } ]
c72f7358c131845b8f50be9a671cc2cc
Extra space to be added to the background image.
[ { "docid": "47e9cd1b647a8d34133774efe0716c6d", "score": "0.0", "text": "set overflow(value) {}", "title": "" } ]
[ { "docid": "038c34215ba583282b292ae6f47ab32b", "score": "0.62802124", "text": "function createBackground() {\r\n var background = this.add.image(256, 256, \"background\");\r\n background.setScale(2.2, 2.5);\r\n}", "title": "" }, { "docid": "53fcd2c18f66fff303c699318edeefba", "score": "0.6191248", "text": "function imageMinusMargin() {\n var $image = $('.hero__supporting-image');\n var imageHeightHalf = $image.height() / 2;\n $image.css('margin-bottom', -imageHeightHalf);\n }", "title": "" }, { "docid": "5b071da843526c946f08172fecc951af", "score": "0.6159422", "text": "function placeBackground() {\n displayModules_1.createImage(this.ctx, this.img, this.sx, this.sy, this.sWidth, this.sHeight, this.x, this.y, this.width, this.height);\n}", "title": "" }, { "docid": "5f1372f389da962ba12fa9434b6e18c8", "score": "0.5942944", "text": "function drawBackground(){\n\tif(deltaB == 2399)\n\t\tdeltaB = 0;\n\tctx.drawImage(background, deltaB, 0, 1200, 400, 0, 0, 600, 200);\n\tdeltaB += 1;\n}", "title": "" }, { "docid": "b80e745cd6663bb5c7bdfecbcb07b6cc", "score": "0.5823264", "text": "function loadImageBackground(){\n backgroundImgWidth = backgroundScrollImg.width,\n backgroundImgHeight = backgroundScrollImg.height;\n backgroundCanvas.width = backgroundImgWidth;\n backgroundCanvas.height = backgroundImgHeight;\n drawBackground(); \n}", "title": "" }, { "docid": "93593646353b515ed8187a841f502c86", "score": "0.5751163", "text": "function updateBackground() {\n\tthis.backgroundCtx.save();\n\tthis.backgroundCtx.clearRect(0, 0, this.background.width, this.background.height);\n\tvar actualOffX = this.backgroundOffX;\n\tvar actualOffY = this.backgroundOffY;\n\tvar actualWidth = this.backgroundWidth;\n\tvar actualHeight = this.backgroundHeight;\n\n\tif (actualOffX < 0) actualOffX = 0;\n\tif (actualOffY < 0) actualOffY = 0;\n\tif (actualWidth + Math.max(this.backgroundOffX, -this.backgroundOffX) >= this.blueprintWidth) actualWidth = Math.min(this.blueprintWidth - this.backgroundOffX, this.blueprintWidth);\n\tif (actualHeight + Math.max(this.backgroundOffY, -this.backgroundOffY) >= this.blueprintHeight) actualHeight = Math.min(this.blueprintHeight - this.backgroundOffY, this.blueprintHeight);\n\t\n\tvar leftClip \t= (actualOffX - this.backgroundOffX)/this.backgroundWidth;\n\tvar rightClip \t= (this.backgroundWidth - actualWidth)/this.backgroundWidth;\n\tvar topClip \t= (actualOffY - this.backgroundOffY)/this.backgroundHeight;\n\tvar bottomClip \t= (this.backgroundHeight - actualHeight)/this.backgroundHeight;\n\t\n\tif (actualWidth > 0 && actualHeight > 0)\n\t\tthis.backgroundCtx.drawImage(this.backgroundImg, actualOffX, actualOffY, actualWidth, actualHeight, leftClip * this.background.width, topClip * this.background.height, this.background.width - rightClip * this.background.width, this.background.height - bottomClip * this.background.height);\n\n\tthis.backgroundCtx.restore();\n}", "title": "" }, { "docid": "7ae7402af4c6246260e94e7dd0d1809a", "score": "0.5731735", "text": "setBackground(_image, _stretch) {\r\n\t\tthis.appBkg = _image;\r\n\t\tthis.appBkgStretch = _stretch;\r\n\t}", "title": "" }, { "docid": "3cb8e9d4678b997353a9850aa10fb8a4", "score": "0.57233566", "text": "function dynamicBackground(){\n //BACKGROUND\n var newImageWidth = can.height*1000/500;\n\t\tcon.drawImage(imageSky, backgroundX, 0, newImageWidth, can.height);\n\t\tcon.drawImage(imageSky, backgroundX+newImageWidth, 0, newImageWidth, can.height);\n\t\tbackgroundX -= 0.3;\n backgroundX = backgroundX%newImageWidth;\n //TITLE\n\t\tcon.fillStyle = \"black\";\n con.font = \"40px Calibri Bold\";\n con.fillText(\"- Tetris -\", can.width/2-100, 50);\n //SCORE\n con.fillStyle = \"black\";\n con.font = \"40px Calibri Bold\";\n con.fillText(\"SCORE : \" + Score, can.width/2-140, 100);\n //LIMIT\n con.beginPath();\n con.moveTo(0, limit*unitHeight);\n con.lineTo(gameWidth*unitWidth, limit*unitHeight);\n con.strokeStyle = \"red\";\n con.lineWidth = 0.5;\n con.stroke();\n con.closePath();\n }", "title": "" }, { "docid": "1400e60bc0629725171db127a1b0bf99", "score": "0.5679509", "text": "function __background_17() { \n__background_init__(this, background_17, 'img/23.jpg')}", "title": "" }, { "docid": "d8bb6c6ca259d06fe1c2c48db235e670", "score": "0.56647944", "text": "function drawBackground() {\r\n let background = new Image();\r\n background.src = \"resources/backgroundSpace_01.1.png\";\r\n\r\n background.onload = function () {\r\n ctx.drawImage(\r\n background, 0, 0, background.width, background.height, 0, 0, WIDTH, HEIGHT\r\n );\r\n }\r\n }", "title": "" }, { "docid": "e98fc62af268779519ef577baef4b63a", "score": "0.562002", "text": "function moveBackgroundImage ( e ) {\n var distLeft = (e.clientX - srcBounds.left - offsetLeft + $window.scrollLeft()) / scale,\n distTop = (e.clientY - srcBounds.top - offsetTop + $window.scrollTop()) / scale;\n\n if(distLeft < 0)\n distLeft = 0;\n\n if(distTop < 0)\n distTop = 0;\n\n var distFromSide = (enlargedWidth - enlargedDisplayWidth) - distLeft;\n\n if(distFromSide < 0)\n distLeft = enlargedWidth - enlargedDisplayWidth\n\n var distFromBottom = (enlargedHeight - enlargedDisplayHeight) - distTop;\n\n if(distFromBottom < 0)\n distTop = enlargedHeight - enlargedDisplayHeight;\n\n $enlarge.css({\n \t'background-position-x': -distLeft,\n \t'background-position-y': -distTop\n });\n \t}", "title": "" }, { "docid": "3d469a5a0b852a18f7d0d860a2520ea5", "score": "0.5537433", "text": "function drawBackground() {\n\tbackground = new Image();\n\tsea = new Image();\n\tbackground.src = 'resources/background.png';\n\tsea.src = 'resources/sea.png';\n\tcontxt.drawImage(background, 0, 0);\n\tcontxt.drawImage(sea, 0, canvas.height-sea.height);\n}", "title": "" }, { "docid": "09700a03816e8ef6e2a661533bfbbd78", "score": "0.55269283", "text": "function addBackground() {\n push();\n texture(stars);\n box(4500, 4500, 4500);\n pop();\n}", "title": "" }, { "docid": "8e82f0874d5b3d8f323dd5a9220d1853", "score": "0.552599", "text": "checkBackground() {\r\n if (floor % 10 === 0) {\r\n bgImage++\r\n }\r\n }", "title": "" }, { "docid": "9563a729a19fe702d46daf243c22eb36", "score": "0.55088073", "text": "function resizeBackground() {\n var viewportHeight = $(window).height();\n //Optionally account for the header height to add a border to the bottom of the screen.\n /*var headerHeight = $('header').outerHeight(false);\n viewportHeight = viewportHeight - headerHeight; //The current viewable area of the viewport window.*/\n $(\"#landingArea\").css('height', viewportHeight);\n }", "title": "" }, { "docid": "3ab045b4743703c2ecb9e59ac27fd578", "score": "0.55071324", "text": "_createBackground() {\n this._background = new Sprite.from(\"playScene\");\n this._background.anchor.set(0.5);\n scaleXY(this._background, config.backgroundImage.scale);\n this.addChild(this._background);\n }", "title": "" }, { "docid": "1a2d7783a07c5dbcc6820131a6194b72", "score": "0.55001915", "text": "function initBackgroundResize() {\n\tjQuery('.bg-stretch').each(function() {\n\t\tImageStretcher.add({\n\t\t\tcontainer: this,\n\t\t\timage: 'img'\n\t\t});\n\t});\n}", "title": "" }, { "docid": "1a2d7783a07c5dbcc6820131a6194b72", "score": "0.55001915", "text": "function initBackgroundResize() {\n\tjQuery('.bg-stretch').each(function() {\n\t\tImageStretcher.add({\n\t\t\tcontainer: this,\n\t\t\timage: 'img'\n\t\t});\n\t});\n}", "title": "" }, { "docid": "ecb9e567312fed3b5659e28ee2885841", "score": "0.5458471", "text": "function loadBackgroundImage () {\n var bgImg = $('<img />');\n bgImg.hide();\n bgImg.bind('load', function() {\n enlargedHeight = $(this).height();\n enlargedWidth = $(this).width();\n enlargedDisplayScale = enlargedDisplayWidth / enlargedWidth;\n scale = $src.outerWidth() / enlargedWidth;\n\n $target.css({\n width: enlargedDisplayWidth * scale,\n height: enlargedDisplayHeight * scale\n });\n\n offsetLeft = ($target.width() / 2);\n offsetTop = ($target.height() / 2);\n\n $(this).remove();\n });\n\n $('body').append(bgImg);\n bgImg.attr('src', $src.attr('data-img-src'));\n }", "title": "" }, { "docid": "0f3a9000617635edde3e5c4a509e6bcf", "score": "0.54575396", "text": "function _bgimage() {\n\t\tif(jQuery('body').hasClass('boxed')) {\n\t\t\tbackgroundImageSwitch();\n\t\t}\n\t\tfunction backgroundImageSwitch() {\n\t\t\tvar data_background = jQuery('body').attr('data-background');\n\t\t\tif(data_background) {\n\t\t\t\tjQuery.backstretch(data_background);\n\t\t\t\tjQuery('body').addClass('transparent'); // remove backround color of boxed class\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "4f38731c5cc94a3be6490df36eff127a", "score": "0.5441351", "text": "function setupBackground() {\n // Initialise leftRectangleBackground's position and their width\n leftRectangleBackground.x = 0;\n leftRectangleBackground.y = 0;\n leftRectangleBackground.width = width / 2;\n // Initialise rightRectangleBackground's position and their width\n rightRectangleBackground.x = 0;\n rightRectangleBackground.y = 0;\n rightRectangleBackground.width = width;\n}", "title": "" }, { "docid": "f431eccb336dbefb071c73c584c8e620", "score": "0.5429444", "text": "createBackground() {\n this.add(\n new Konva.Rect({\n fill: '#efefef',\n width: this._width,\n height: this._height,\n cornerRadius: 5,\n shadowBlur: 5,\n })\n );\n }", "title": "" }, { "docid": "56800532a9e77b8c672845480fff6e8e", "score": "0.5418872", "text": "function GameBackground () {\n\n\t\t// methods \n\t\tthis.render = function(){\n\n\t\t\tctx.drawImage(levelImage,this.clipX += 5, this.clipY, this.clipW, this.clipH, this.x, this.y, this.w, this.h);\n\t\t\t\n\t\t\tif (this.clipX >= 3300) {\n\t\t\t\tthis.clipX = 0;\n\t\t\t}\n\t\t\t\n\t\t};\n\t}", "title": "" }, { "docid": "a3544e00b753eb7497d74c63ede14fe5", "score": "0.5417099", "text": "function draw_bg() {\n// I hoped to do more with this?\n\tctx.drawImage(bg_img, 0, 0, w, h);\n}", "title": "" }, { "docid": "21db2079d4a44337be9b0e88d06466da", "score": "0.5416652", "text": "function defaultBackground(){\n push();\n imageMode(CORNER);\n image(basementClearImg, 0,0);\n pop();\n\n push();\n imageMode(CENTER);\n image(philipImg,100, height - 175, 125/1.5,500/1.5);\n pop();\n}", "title": "" }, { "docid": "81116ac32ce0d73e685a56babf090b08", "score": "0.53892493", "text": "function drawBackgroundExample () {\r\n\t\r\n\t// TODO: Implement method.\r\n}", "title": "" }, { "docid": "81b5085c76d854b24a71bec8a5d7f553", "score": "0.5384984", "text": "function rockthemes_add_image_size_data(that){\n\tvar image_url = that.css('background-image'),\n\t\timage;\n\t\n\t// Remove url() or in case of Chrome url(\"\")\n\timage_url = image_url.match(/^url\\(\"?(.+?)\"?\\)$/);\n\t\n\tif (typeof image_url != 'undefined' && jQuery.isArray(image_url) && image_url[1]) {\n\t\timage_url = image_url[1];\n\t\timage = new Image();\n\t\n\t\t// just in case it is not already loaded\n\t\tjQuery(image).load(function () {\n\t\t\tthat.attr('data-image-main-width',image.width);\n\t\t\tthat.attr('data-image-main-height',image.height);\n\t\t\timage = null;\n\t\t});\n\t\n\t\timage.src = image_url;\n\t}\t\n}", "title": "" }, { "docid": "c38a727652218cde9e532393960d868a", "score": "0.536927", "text": "get minHeight() {\n return this.i.bg;\n }", "title": "" }, { "docid": "ea8ae212af5248b244aa115955551cef", "score": "0.53517294", "text": "function drawBackground() {\n background(bg);\n}", "title": "" }, { "docid": "cae24b8054ebaae3ddda604deea0903d", "score": "0.5351226", "text": "function drawGameBackground() {\r\n if (noDrawMode) {\r\n\r\n } else {\r\n ctx.drawImage(bgGameImg, -2, -2, 1205, 683);\r\n }\r\n}", "title": "" }, { "docid": "d4c420a790da9bb307cad8fe9584002d", "score": "0.5311476", "text": "function mainBackgroundImage(backImage) {\n\tvar mainBackgroundImageView = Ti.UI.createView({\n\t\tbackgroundColor : 'transparent',\n\t\theight : Titanium.UI.FILL,\n\t\twidth : Titanium.UI.FILL,\n\t});\n\n\tvar mainBackgroundImage = Ti.UI.createImageView({\n\t\ttop : '0dp',\n\t\t//defaultImage : '/images/default.png',\n\t\t//backgroundColor:'#D8E028',\n\t\timage : backImage,\n\t});\n\n\tmainBackgroundImageView.add(mainBackgroundImage);\n\treturn [mainBackgroundImageView, mainBackgroundImage];\n}", "title": "" }, { "docid": "b57d9564cb50096795157831984dd356", "score": "0.52988416", "text": "function inlineBG() {\n\n\t\t// Common Inline CSS\n\t\t$(\".single-page-header, .intro-banner\").each(function() {\n\t\t\tvar attrImageBG = $(this).attr('data-background-image');\n\n\t if(attrImageBG !== undefined) {\n\t \t$(this).append('<div class=\"background-image-container\"></div>');\n\t $('.background-image-container').css('background-image', 'url('+attrImageBG+')');\n\t }\n\t\t});\n\n\t}", "title": "" }, { "docid": "4722694c2d4b332f2c74ce953d06d4c7", "score": "0.52961457", "text": "function _bgimage() {\n if(jQuery('body').hasClass('boxed')) {\n backgroundImageSwitch();\n }\n function backgroundImageSwitch() {\n var data_background = jQuery('body').attr('data-background');\n if(data_background) {\n jQuery.backstretch(data_background);\n jQuery('body').addClass('transparent'); // remove backround color of boxed class\n }\n }\n}", "title": "" }, { "docid": "a268d13e851576421bafc060eb757716", "score": "0.5283568", "text": "function BackgroundArt(x, y, w, h) {\n this.x = x;\n this.y = y;\n this.w = w;\n this.h = h;\n}", "title": "" }, { "docid": "55736305ec69f56e88770048662425eb", "score": "0.5279687", "text": "function reposBackground(e, amount) {\n if (e.css('backgroundPositionY') != \"\") {\n\t// IE and webkit\n\te.css('backgroundPositionY', amount + 'px');\n } else {\n\t// FF\n\te.css('backgroundPosition', e.css('backgroundPosition').split(\" \")[0] + ' ' + amount + 'px');\n }\n}", "title": "" }, { "docid": "7e5144cfda55b9979013f22f2ab1a6af", "score": "0.5275683", "text": "loadBackground(background, init) {\n const that = this;\n // insert backgrounds on top of previously placed ones\n let i = 0;\n while (this.game.entities[i] instanceof Background) {\n this.game.entities[i].removeOnNextScroll = true;\n i++;\n }\n background.layers.slice().reverse().forEach((bg) => {\n if (init) {\n that.game.entities.splice(i, 0, new Background(that.game, bg.layer, bg.verticalPixels, bg.parallaxMult, bg.offset + 768));\n } else {\n that.game.entities.splice(i, 0, new Background(that.game, bg.layer, bg.verticalPixels, bg.parallaxMult, bg.offset));\n }\n });\n }", "title": "" }, { "docid": "495eb009a9038db655e7787fe4d22eb6", "score": "0.5275351", "text": "setupBackground() {\n if (!this.initialised) return;\n\n // The background graphic is just a matte that lives behind everything.\n // If you wanted to you could apply a filter to this to create a pattern\n // or animation in the background to the navigation. For the purposes\n // of this demo, this is just a block of colour.\n this.background.clear();\n this.background.beginFill(this.backgroundColour, 0.);\n this.background.position.x = window.innerWidth * -.5;\n this.background.position.y = window.innerHeight * -.5;\n this.background.drawRect(-this.maskpadding, -this.maskpadding, window.innerWidth + this.maskpadding, window.innerHeight + this.maskpadding);\n this.background.endFill();\n\n // We mask the container so that the dimensions that PIXI provides to\n // our screen filter are predictable. If we don't do this, then the\n // behaviour of the shader becomes unpredictable and weird. The reason\n // that we pad the mask is so that we have a slightly larger than the\n // screen area to play with within the shader.\n const mask = new PIXI.Graphics();\n mask.beginFill(this.backgroundColour, .5);\n mask.position.x = window.innerWidth * -.5;\n mask.position.y = window.innerHeight * -.5;\n mask.drawRect(-this.maskpadding, -this.maskpadding, window.innerWidth + this.maskpadding, window.innerHeight + this.maskpadding);\n mask.endFill();\n this.container.mask = mask;\n }", "title": "" }, { "docid": "0042e5a2ae30b1411772e29e03f1f9f0", "score": "0.5234732", "text": "function setBackground() {\n // Put light tin in red to show hatred in the player (Gargamel) mind and with small\n // transparency so when the gargamel or the smurf go fast there's a small trail\n tint(255, random(255), 0, 127);\n // Display the background\n image(smurfBackgroundImage, width / 2, height / 2, smurfBackgroundImage.width * backgroundScale, smurfBackgroundImage.height * backgroundScale);\n}", "title": "" }, { "docid": "6921dc0172f2b38ba767300153bfe2be", "score": "0.5227813", "text": "function initBackgroundResize() {\n\tjQuery('.album-cover').each(function() {\n\t\tImageStretcher.add({\n\t\t\tcontainer: this,\n\t\t\timage: 'img'\n\t\t});\n\t});\n}", "title": "" }, { "docid": "887ad8789c1ff0dd79ca33d85858040e", "score": "0.5212026", "text": "function backgroundCSS(icon) {\n $(\"body\").css({\"background\":backgroundImageUrl[icon],\"background-size\": \"cover\",\"background-repeat\":\"no-repeat\"});\n }", "title": "" }, { "docid": "27935841ee20ae5ad214d1360cdcbf90", "score": "0.52018076", "text": "function _background() {\n\t _videoBG.call(this);\n\t //_photoBG.call(this);\n }", "title": "" }, { "docid": "bd4476bdee403864aa7c45e24a2b091b", "score": "0.5198554", "text": "function setupBackground(backgroundScene) {\n let bundleAssets = SSG.assets.getBundle('waterResistant');\n\n //backgroud image\n texture_bg = new THREE.TextureLoader().load( bundleAssets['/assets/images/waterResistant/water_background.jpg'] );\n let material_bg = new THREE.MeshBasicMaterial( { map: texture_bg } );\n plane_bg = new THREE.Mesh(new THREE.PlaneGeometry(750, 1800), material_bg);\n plane_bg.material.side = THREE.FrontSide;\n\n if(shaderEnabled===false){\n plane_bg.scale.x = plane_bg.scale.y = plane_bg.scale.z = backgroundScale-0.2;\n objectsScene.add(plane_bg);\n }\n }", "title": "" }, { "docid": "f16531725d0144b5e6826a8e6d6315ae", "score": "0.5190401", "text": "function createStrippedBackground(plot) {\n var strippedBackground = {};\n var scalperContainer = plot.background().append(\"g\").style(\"visibility\", \"hidden\")\n\n strippedBackground.rect = scalperContainer.append(\"svg:image\")\n .attr(\"xlink:href\", \"img/stripes.png\")\n .attr(\"preserveAspectRatio\", \"none\");\n\n strippedBackground.drawAt = function() {\n strippedBackground.rect.attr({\n x: 0,\n y: 0,\n width: 1000,\n height: 80\n })\n }\n\n strippedBackground.show = function() {\n scalperContainer.style(\"visibility\", \"visible\");\n }\n\n strippedBackground.hide = function() {\n scalperContainer.style(\"visibility\", \"hidden\");\n }\n\n return strippedBackground;\n}", "title": "" }, { "docid": "67f8b3941fd78399628a8728dbf46348", "score": "0.5189109", "text": "updateBackgroundImage() {\n let bgMat = Manager.GL.createMaterial(Manager.GL.textureLoader.load(Datas.Pictures.get(PictureKind.Pictures, this.backgroundImageID)\n .getPath()), { flipY: true });\n bgMat.depthTest = false;\n bgMat.depthWrite = false;\n this.sceneBackground = new THREE.Scene();\n this.cameraBackground = new THREE.Camera();\n this.sceneBackground.add(new THREE.Mesh(new THREE.PlaneBufferGeometry(2, 2), bgMat));\n }", "title": "" }, { "docid": "1d4924db93535d50d0a426d3dfbdf750", "score": "0.5188539", "text": "function rsbg() {\r\n var bge = document.getElementById('wpbg'); //bg element\r\n var bgse = document.getElementById('wpbgs'); //bg section element\r\n var comw = bgse.clientHeight * BGAR; //picture width\r\n bge.style.width = comw + 'px';\r\n bgse.style.width = (comw + document.body.clientWidth) + 'px';\r\n console.log(\"background resized.\");\r\n return true;\r\n}", "title": "" }, { "docid": "525c7361ef16a24a008b45bdbecaa2f4", "score": "0.5176072", "text": "function background () {\n\tcontext.fillStyle = \"#\" + bgColor;\n\tcontext.globalAlpha = 1;\n\tcontext.fillRect(0,0,canvas.width,canvas.height); //taille colonnes : 180 +2+ 192 +2+ 192 +2+ 180\n\tcontext.fillStyle = \"#\" + lineColor;\n\tcontext.globalAlpha = 0.5;\n\tfor (var i = 0; i < largeur; i++) {\n\t\tcontext.fillRect(columnSize + (i*columnSize), 200, 2, 1300);\n\t}\n\tcontext.globalAlpha = 1;\n}", "title": "" }, { "docid": "9da22deaf6ad77eb2d02dc13d8cad12e", "score": "0.51733226", "text": "function optimizeSliderImageBG() {\n\t$(\".slider-img-bg\").each(function () {\n\t\tvar imgHeight = $(this).closest(\"div\").height();\n\n\t\tif ($(\".banner-parallax\").children(\".banner-slider\").length > 0) {\n\t\t\t// $( \".banner-parallax, .banner-parallax .row > [class*='col-']\" ).height( $( \".banner-slider\" ).height() );\n\t\t}\n\n\t\t$(this).find(\".owl-item > li .slide\").children(\"img\").css({\n\t\t\t\"display\": \"none\",\n\t\t\t\"height\": imgHeight,\n\t\t\t\"opacity\": 0\n\t\t});\n\t});\n}", "title": "" }, { "docid": "7a94ed354cca6bac4142de9188f55e39", "score": "0.5171251", "text": "static processBackgroundImage(element,valueNew){return TcHmi.System.Services.styleManager.processBackground(element,{image:valueNew})}", "title": "" }, { "docid": "864cfd0991bd866ad679041655929054", "score": "0.51702636", "text": "function drawBackground() {\n ctx.drawImage(imgs.bg, 0, 0);\n\n // Pan background\n ceu.x -= ceu.speed;\n backdrop.x -= backdrop.speed;\n\n // draw imgs side by side to loop\n ctx.drawImage(imgs.ceu, ceu.x, ceu.y);\n ctx.drawImage(imgs.ceu, ceu.x + canvas.width, ceu.y);\n\n ctx.drawImage(imgs.backdrop, backdrop.x, backdrop.y);\n ctx.drawImage(imgs.backdrop, backdrop.x + canvas.width, backdrop.y);\n\n // If the image scrolled off the screen, reset\n if (ceu.x + imgs.ceu.width <= 0)\n ceu.x = 0;\n if (backdrop.x + imgs.backdrop.width <= 0)\n backdrop.x = canvas.width + backdrop.x;\n }", "title": "" }, { "docid": "af1f37e0a65bd368424c8164e4500901", "score": "0.51675963", "text": "function Background() {\n\tthis.draw = function() {\n\t\tthis.context.drawImage(imageRepository.background, this.x, this.y);\n\t};\n}", "title": "" }, { "docid": "a87dbf596b4b1873a1809c6ca13da78d", "score": "0.5162343", "text": "function getMargin() {\n\t\tvar imageBg = $('.pure-oh-m-testimonials .banner .bannerImage'),\n\t\t $header = $('.pure-oh-m-testimonials .pure-oh-m-header-dark').outerHeight(),\n\t\t marginTop = -$header;\n\t\timageBg.css('margin-top', marginTop);\n\t}", "title": "" }, { "docid": "8e15077c97d57a87c11d627f9bbbabdd", "score": "0.5161506", "text": "function drawBackground() {\n background(40);\n}", "title": "" }, { "docid": "dd753c6cf136b05cad29e366d7b4b475", "score": "0.5154801", "text": "getStyle(currentContent) {\n return {\n background: `url(${currentContent.backgroundImage}) no-repeat center`,\n paddingTop: currentContent.paddingTop + 'px',\n paddingBottom: currentContent.paddingBottom + 'px'\n };\n }", "title": "" }, { "docid": "351ef44dc8f2bff773b1c4baee9f833c", "score": "0.5136417", "text": "function appendBackground( theSrc ) {\n var bgCss = {\n display: 'block',\n top: 0,\n left: 0,\n width: options.bgWidth,\n height: options.bgHeight,\n zIndex: 0\n };\n \n bgCss.position = isIE6 ? 'absolute' : 'fixed';\n \n if ( options.bgRepeat ) {\n var $obj = options.appendInFront ? $('<div></div>').appendTo( $('body') ) : $('<div></div>').prependTo( $('body') );\n bgCss.backgroundRepeat = 'repeat';\n bgCss.backgroundImage = 'url(\"' + theSrc + '\")';\n }\n else {\n var $obj = options.appendInFront ? $('<img />').appendTo( $('body') ) : $('<img />').prependTo( $('body') );\n $obj.attr('src', theSrc);\n }\n \n \n $obj.css( bgCss );\n \n backgroundMode = true;\n \n return $obj;\n }", "title": "" }, { "docid": "8018dd5c7960e50136f551a8479057d9", "score": "0.51315707", "text": "get sliceBottom(){ return this.__bg.sliceBottom; }", "title": "" }, { "docid": "2507cad45d1849247bd09055244a8242", "score": "0.5128245", "text": "function scrollingBackground() {\n image(world.image, world.imageX + width/2, world.imageY + height/2, world.WIDTH, world.HEIGHT);\n}", "title": "" }, { "docid": "2507cad45d1849247bd09055244a8242", "score": "0.5128245", "text": "function scrollingBackground() {\n image(world.image, world.imageX + width/2, world.imageY + height/2, world.WIDTH, world.HEIGHT);\n}", "title": "" }, { "docid": "5bbcafa93bed656f89a0921a53ae8995", "score": "0.5124359", "text": "function renderBackground() {\n const url = 'https://source.unsplash.com/random';\n getImage(url);\n }", "title": "" }, { "docid": "fb67f6ddfdbca9b8382ee8679ea2060f", "score": "0.5115176", "text": "function backgroundSource(image, xFrame, y, width, height) {\n return { image: image, x: xFrame * 60, y: ifdefor(y, 0), width: ifdefor(width, 60), height: ifdefor(height, 300)};\n}", "title": "" }, { "docid": "9a204b3129bea97de97bfb37806db1ad", "score": "0.5112718", "text": "function BackgroundImage(_1){\r\nthis.editor=_1;\r\nvar _2=_1.config;\r\nvar _3=this;\r\n_2.registerButton({id:\"bgImage\",tooltip:this._lc(\"Set page background image\"),image:_1.imgURL(\"ed_bgimage.gif\",\"BackgroundImage\"),textMode:false,action:function(_4){\r\n_3.buttonPress(_4);\r\n}});\r\n_2.addToolbarElement(\"bgImage\",\"inserthorizontalrule\",1);\r\n}", "title": "" }, { "docid": "4faec28e214525e82ac38f2b66940124", "score": "0.5102937", "text": "function bannerParallaxImageBG() {\n\tvar bannerParallax = $(\".banner-parallax\"),\n\t\timgSrc = bannerParallax.children(\"img:first-child\").attr(\"src\");\n\n\tbannerParallax.prepend(\"<div class='bg-element'></div>\");\n\tvar bgElement = bannerParallax.find(\"> .bg-element\");\n\tbgElement.css(\"background-image\", \"url('\" + imgSrc + \"')\").attr(\"data-stellar-background-ratio\", 0.2);\n}", "title": "" }, { "docid": "5493270df6407d4d4d19a7efab55f004", "score": "0.510147", "text": "function addBattleBG()\n{\n\tvar bg = Math.floor( Math.random() * ( 7 - 1 ) ) + 1;\n\tdocument.body.background = 'src/images/bg' + bg + '.gif';\n\tdocument.body.style.imageRendering = 'pixelated';\n\tdocument.body.style.backgroundSize = \"cover\";\n}", "title": "" }, { "docid": "ceb6f24e40f6deac3ad0af52c6c12601", "score": "0.51010615", "text": "function drawBackground(){\n backgroundCtx.clearRect(0,0,backgroundCanvasWidth,backgroundCanvasHeight);\n\n if(backgroundScrollVal >= backgroundCanvasWidth){\n backgroundScrollVal = 0;\n }\n\n backgroundScrollVal = backgroundScrollVal + backgroundSpeed;\n backgroundCtx.fillRect(-100, -100, 1000, 1000);\n\n // Background appears to move because of the scroll value constantly changing.\n\n // Draws the first background image moving right to left.\n backgroundCtx.drawImage(backgroundScrollImg,-backgroundScrollVal,0,backgroundImgWidth, backgroundImgHeight);\n // Draws the scond background image moving at the end of the first background image moving right to left.\n backgroundCtx.drawImage(backgroundScrollImg,backgroundCanvasWidth-backgroundScrollVal,0,backgroundImgWidth, backgroundImgHeight);\n backgroundCtx.strokeRect(0, 0, 800, 500);\n backgroundCtx.closePath();\n \n}", "title": "" }, { "docid": "021fb3c9952a71c4cb58e6d14458c89d", "score": "0.5096796", "text": "function drawBankBackground()\n{\n ctx.drawImage(bankImg, 0, 0, GAME_WIDTH, GAME_HEIGHT);\n}", "title": "" }, { "docid": "33816f674079a9c7594a228b70b86c89", "score": "0.50919425", "text": "function drawBackground () \r\n{\r\n papel.drawImage(imagen, 400, 100);\r\n}", "title": "" }, { "docid": "f2b207d2b0afaf094bc57b9a4c8375ad", "score": "0.50909525", "text": "function drawBackground() {\n\t\t\t\t\t\tgradient = addGradient();\n\t\t\t\t\t\tbackgrounds = addBackgrounds();\n\t\t\t\t\t\tupdateBackgrounds(currentHour, previousHour, backgrounds);\n\t\t\t\t\t}", "title": "" }, { "docid": "584ea4f077d727f99a41034b8d57e427", "score": "0.50897825", "text": "moveBackground() {\r\n this.background.tilePositionX -= 0.1;\r\n this.clouds1.tilePositionX += 0.1;\r\n this.clouds2.tilePositionX += 0.3;\r\n this.clouds3.tilePositionX += 0.8;\r\n }", "title": "" }, { "docid": "e3ba142a1f2ac7312c27a68d0d6ac220", "score": "0.5075774", "text": "function resetBackgrounds() {\n $('.trullix-phone').css('background-position', '');\n $('.section-img').css('background-position', '50% 0');\n}", "title": "" }, { "docid": "17b887bad658a07f57100129d3433fb6", "score": "0.5046982", "text": "function drawBackground(){\n\t\tctx.canvas.width = window.innerWidth;\n \t\tctx.canvas.height = window.innerHeight;\n \t\tctx.drawImage(background, vx, vy, ctx.canvas.width, ctx.canvas.height);\n \t\tctx.drawImage(background, vx, -ctx.canvas.height+Math.abs(vy), ctx.canvas.width, ctx.canvas.height);\n \t\tif (Math.abs(vy)>ctx.canvas.height){\n \t\t\tvy = 0;\n \t\t}\n \t\tvy += 1;\n\t}", "title": "" }, { "docid": "cd328472d8d2bbb1d2c3e12faa5e21e6", "score": "0.50298464", "text": "function backStrech() {\r\n\t\t$(\"aside\").backstretch([\r\n\t\t\t\"https://i.imgur.com/Eofu2GY.jpg\",\r\n\t\t\t\"https://i.imgur.com/pCiK6C7.jpg\",\r\n\t\t\t], {duration: 5000, fade: 1000});\r\n\t}", "title": "" }, { "docid": "df187a86ae0ea71f4cb2b6579a2fde93", "score": "0.5024296", "text": "function edgtfParallaxTitle() {\n\t\tvar parallaxBackground = $('.edgtf-title-holder.edgtf-bg-parallax');\n\t\t\n\t\tif (parallaxBackground.length > 0 && edgtf.windowWidth > 1024) {\n\t\t\tvar parallaxBackgroundWithZoomOut = parallaxBackground.hasClass('edgtf-bg-parallax-zoom-out'),\n\t\t\t\ttitleHeight = parseInt(parallaxBackground.data('height')),\n\t\t\t\timageWidth = parseInt(parallaxBackground.data('background-width')),\n\t\t\t\tadminBarHeight = edgtfGlobalVars.vars.edgtfAddForAdminBar;\n\n if(!titleHeight) {\n titleHeight = parallaxBackground.height();\n }\n\n\t\t\tvar parallaxRate = titleHeight / 10000 * 7,\n parallaxYPos = -(edgtf.scroll * parallaxRate);\n\t\t\t\n\t\t\tparallaxBackground.css({'background-position': 'center ' + (parallaxYPos + adminBarHeight) + 'px'});\n\t\t\t\n\t\t\tif (parallaxBackgroundWithZoomOut) {\n\t\t\t\tparallaxBackgroundWithZoomOut.css({'background-size': imageWidth - edgtf.scroll + 'px auto'});\n\t\t\t}\n\t\t\t\n\t\t\t//set position of background on window scroll\n\t\t\t$(window).scroll(function () {\n\t\t\t\tparallaxYPos = -(edgtf.scroll * parallaxRate);\n\t\t\t\tparallaxBackground.css({'background-position': 'center ' + (parallaxYPos + adminBarHeight) + 'px'});\n\t\t\t\t\n\t\t\t\tif (parallaxBackgroundWithZoomOut) {\n\t\t\t\t\tparallaxBackgroundWithZoomOut.css({'background-size': imageWidth - edgtf.scroll + 'px auto'});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "df187a86ae0ea71f4cb2b6579a2fde93", "score": "0.5024296", "text": "function edgtfParallaxTitle() {\n\t\tvar parallaxBackground = $('.edgtf-title-holder.edgtf-bg-parallax');\n\t\t\n\t\tif (parallaxBackground.length > 0 && edgtf.windowWidth > 1024) {\n\t\t\tvar parallaxBackgroundWithZoomOut = parallaxBackground.hasClass('edgtf-bg-parallax-zoom-out'),\n\t\t\t\ttitleHeight = parseInt(parallaxBackground.data('height')),\n\t\t\t\timageWidth = parseInt(parallaxBackground.data('background-width')),\n\t\t\t\tadminBarHeight = edgtfGlobalVars.vars.edgtfAddForAdminBar;\n\n if(!titleHeight) {\n titleHeight = parallaxBackground.height();\n }\n\n\t\t\tvar parallaxRate = titleHeight / 10000 * 7,\n parallaxYPos = -(edgtf.scroll * parallaxRate);\n\t\t\t\n\t\t\tparallaxBackground.css({'background-position': 'center ' + (parallaxYPos + adminBarHeight) + 'px'});\n\t\t\t\n\t\t\tif (parallaxBackgroundWithZoomOut) {\n\t\t\t\tparallaxBackgroundWithZoomOut.css({'background-size': imageWidth - edgtf.scroll + 'px auto'});\n\t\t\t}\n\t\t\t\n\t\t\t//set position of background on window scroll\n\t\t\t$(window).scroll(function () {\n\t\t\t\tparallaxYPos = -(edgtf.scroll * parallaxRate);\n\t\t\t\tparallaxBackground.css({'background-position': 'center ' + (parallaxYPos + adminBarHeight) + 'px'});\n\t\t\t\t\n\t\t\t\tif (parallaxBackgroundWithZoomOut) {\n\t\t\t\t\tparallaxBackgroundWithZoomOut.css({'background-size': imageWidth - edgtf.scroll + 'px auto'});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "f5ae36e0ba67fbc6df25be9a87ee1feb", "score": "0.5021732", "text": "function bannerPadding(){\n var headerHeight = $('.header.fixed--header').height();\n $('.banner__single__content').css('padding-top', headerHeight);\n $('.breadcamb__inner').css('padding-top', headerHeight);\n }", "title": "" }, { "docid": "f06385e9b9455c6b57eb6c5b98cf802b", "score": "0.5019865", "text": "function Background(){\n\tthis.speed = 1;\n\tthis.draw = function(){\n\t\tthis.ctx = this.canvas.getContext(\"2d\");\n\t\tif (this.y >= this.canvas.height) {\n\t\t\tthis.y = 0;\n\t\t}\n\t\tthis.ctx.drawImage(this.image, this.x, this.y);\n\t\tthis.ctx.drawImage(this.image, this.x, this.y - this.canvas.height);\n\t\tthis.y += this.speed;\n\t}\n}", "title": "" }, { "docid": "953be68925bb1bc44948d95f103499f7", "score": "0.50083697", "text": "setupScrollingBG() {\n // This tile data could be imported from a file\n this.tile_data = [\n GRASS, GRASS, GRASS, GRASS, GRASS,\n TREE, HOUSE, TREE, HOUSE, TREE,\n ROAD, ROAD, ROAD, ROAD, ROAD,\n TREE, HOUSE, TREE, HOUSE, TREE,\n GRASS, GRASS, GRASS, GRASS, GRASS\n ];\n this.tiles = new Tiles(5, 5, this.background, this.tile_data);\n \n // Place the ghost at the center of the tiles\n this.background.position.x = this.width / 2 - this.background.width / 2;\n this.background.position.y = this.height / 2 - this.background.height / 2;\n }", "title": "" }, { "docid": "c2e0abb8930160474f8de8763ddb6442", "score": "0.5002123", "text": "function addDarkerBackground(container) {\n const spriteBackground = new Sprite(resources[backgroundDarkerPath].texture);\n spriteBackground.position.set(0, 0);\n\n container.addChild(spriteBackground);\n}", "title": "" }, { "docid": "3fc6890eccedd37ce47cc8072fbe613f", "score": "0.4999058", "text": "function dataBackground() {\n $(window).load(function () {\n var i, data, bg = $('.bg, .bg-img');\n for (i = 0; i < bg.length; i += 1) {\n data = bg.eq(i).data('background'); //get data\n bg.eq(i).css('background-image', 'url(' + data + ')'); //add css background-image\n bg.eq(i).removeAttr('data-background'); //remove data\n }\n });\n }", "title": "" }, { "docid": "1b163d523075016aa2eb776b8791de07", "score": "0.49984217", "text": "function background (image) {\n var $canvas = $('#canvas')\n $canvas.css({'backgroundImage': \"url('images/\" + image + \".gif')\", 'background-size': '100%, 100%'})\n }", "title": "" }, { "docid": "bda6c07083c3e8088911313666ace186", "score": "0.49831912", "text": "function Background(){\n this.speed = 1;\n\n this.draw = function(){\n //this.x += this.speed;\n this.x += this.speed;\n\n this.context.clearRect(0, 0, imageRepository.background.width, imageRepository.background.height);\n this.context.drawImage(imageRepository.background, this.x, this.y);\n\n // Draw another image at the top edge of the first image\n this.context.drawImage(imageRepository.background, this.x - this.canvasWidth, this.y);\n\n // If the image scrolled off the screen, reset\n if(this.x >= this.canvasWidth){\n this.x = 0;\n }\n };\n }", "title": "" }, { "docid": "104a51fc9c8ea082cca2f21383b62ba4", "score": "0.49769488", "text": "function drawBackground() {\n background(50, 20, 205);\n textSize(32);\n fill(250, 100, 0);\n text('Tetris', width/2 - blockSize, 30);\n translate(width / 2, blockSize * 4);\n fill(\"white\");\n rect(0, boundaries.b * blockSize / 2, (boundaries.r - boundaries.l) * blockSize, boundaries.b * blockSize)\n}", "title": "" }, { "docid": "29157071eb016095caeccaaa1d2f5139", "score": "0.49724376", "text": "function initBrickSize(size) {\n drawspace.css('background-size', size + \" \" + size);\n}", "title": "" }, { "docid": "136fb0b595436b7a1f91bb6b27da8725", "score": "0.49657005", "text": "function edgtfParallaxTitle() {\n var parallaxBackground = $('.edgtf-title-holder.edgtf-bg-parallax');\n\n if (parallaxBackground.length > 0 && edgtf.windowWidth > 1024) {\n var parallaxBackgroundWithZoomOut = parallaxBackground.hasClass('edgtf-bg-parallax-zoom-out'),\n titleHeight = parseInt(parallaxBackground.data('height')),\n imageWidth = parseInt(parallaxBackground.data('background-width')),\n parallaxRate = titleHeight / 10000 * 7,\n parallaxYPos = -(edgtf.scroll * parallaxRate),\n adminBarHeight = edgtfGlobalVars.vars.edgtfAddForAdminBar;\n\n parallaxBackground.css({'background-position': 'center ' + (parallaxYPos + adminBarHeight) + 'px'});\n\n if (parallaxBackgroundWithZoomOut) {\n parallaxBackgroundWithZoomOut.css({'background-size': imageWidth - edgtf.scroll + 'px auto'});\n }\n\n //set position of background on window scroll\n $(window).scroll(function () {\n parallaxYPos = -(edgtf.scroll * parallaxRate);\n parallaxBackground.css({'background-position': 'center ' + (parallaxYPos + adminBarHeight) + 'px'});\n\n if (parallaxBackgroundWithZoomOut) {\n parallaxBackgroundWithZoomOut.css({'background-size': imageWidth - edgtf.scroll + 'px auto'});\n }\n });\n }\n }", "title": "" }, { "docid": "a786c632f0d694ff56e0ddd0815ca9c0", "score": "0.4965027", "text": "function BackgroundLayer() {\n this.container = new createjs.Container();\n this.bitmap = new createjs.Bitmap();\n this.container.addChild(this.bitmap);\n }", "title": "" }, { "docid": "e4c0b6944f93ff862544bff6ec72d324", "score": "0.4962215", "text": "function createBackground() {\n\t\tctx.fillStyle = \"black\";\n\t\tctx.fillRect(0, 0, 640, 480);\n\t}", "title": "" }, { "docid": "92bc2db6950630791b4d3da6a58261fd", "score": "0.4953947", "text": "function createBackground() {\n background.position.y = -335;\n var signTexture = THREE.ImageUtils.loadTexture(\"textures/fabian/arrow_keys.png\");\n var signMaterial = new THREE.MeshPhongMaterial( { color: 0xffffff , map: signTexture} );\n\n signTexture.wrapS = signTexture.wrapT = THREE.RepeatWrapping;\n signTexture.repeat.set( 1,1 );\n\n\n\n\n signGeometry = new THREE.BoxGeometry( 600, 300, 1 );\n var signMesh = new THREE.Mesh( signGeometry, signMaterial );\n signMesh.position.x = 0;\n signMesh.position.y = 1000;\n signMesh.position.z = 0;\n\n\n background.add( signMesh );\n}", "title": "" }, { "docid": "4b498af3de94c27b8718e744b7142244", "score": "0.49487406", "text": "function setBackground() {\r\n var pixelData = getCameraData();\r\n num_pixels = pixelData.data.length/4;\r\n background = pixelData;\r\n background_fixed = new Object();\r\n background_fixed.data = new Array();\r\n for (var i=0; i<pixelData.data.length; i=i+4) {\r\n background_fixed.data[i] = pixelData.data[i];\r\n background_fixed.data[i+1] = pixelData.data[i+1];\r\n background_fixed.data[i+2] = pixelData.data[i+2];\r\n background_fixed.data[i+3] = pixelData.data[i+3];\r\n }\r\n}", "title": "" }, { "docid": "78dfc697c87753be575795b1242b156b", "score": "0.4945611", "text": "drawBackground() {\n\t\tthis.context.fillStyle=\"#FF0000\";\n\t\tthis.context.fillRect(0,0,this.widthHeight.x,this.widthHeight.y);\n\t}", "title": "" }, { "docid": "b5d3f39813b687247eca99b2a775a0af", "score": "0.494402", "text": "lazyLoadBackgroundImage() { // eslint-disable-line\n const { backgroundImage } = this.props;\n\n if (backgroundImage) {\n const img = new Image();\n img.onload = this.updateBackgroundImage;\n img.src = backgroundImage;\n }\n }", "title": "" }, { "docid": "3117ad745bbba378799f78b43f90a247", "score": "0.49433196", "text": "function createBackground() {\n /* Biblioteka Modernizr pozwala sprawdzic poziom obslugi elementu \"canvas\" w przegladarce.\n * Tego mechanizmu uzywamy wlasnie w tym kodzie, aby w przypadku wykrycia braku wsparcia\n * uruchomic plan awaryjny. Jezeli element \"canvas\" jest rozpoznawany,\n * Modernizr tworzy nowe plotno. Wymiary plotna sa automatycznie okreslane przez metode\n * modelu DOM \"getBoundingClientRect()\". */\n if (!Modernizr.canvas) return;\n\n var canvas = document.createElement(\"canvas\"),\n ctx = canvas.getContext(\"2d\"),\n background = $(\"#game .background\")[0],\n rect = background.getBoundingClientRect(),\n gradient,\n i;\n\n canvas.width = rect.width;\n canvas.height = rect.height;\n\n ctx.scale(rect.width, rect.height);\n\n gradient = ctx.createRadialGradient(\n 0.1, 0.1, 0.4,\n 0.5, 0.5, 1\n );\n gradient.addColorStop(0, \"rgb(50, 80, 200)\");\n gradient.addColorStop(1, \"rgb(30, 30, 30)\");\n ctx.fillStyle = gradient;\n ctx.fillRect(0, 0, 1, 1);\n\n ctx.strokeStyle = \"rgba(255, 255, 255 ,1)\";\n ctx.strokeStyle = \"rgba(0, 0, 0, 1)\";\n ctx.lineWidth = 0.005;\n ctx.beginPath();\n\n for (i = 0; i < 5; i += 0.008) {\n ctx.moveTo(i, 0);\n ctx.lineTo(0, i + 0.6);\n }\n ctx.stroke();\n background.appendChild(canvas);\n }", "title": "" }, { "docid": "0be8c663b88b047afb00b30aec82088c", "score": "0.49420223", "text": "function ScaleToPhysicalPixels() {\n\tdocument.body.style.setProperty('--bg-size', (512 / window.devicePixelRatio) + 'px');\n}", "title": "" }, { "docid": "bc50265069231febbe1035c9f75f6bfe", "score": "0.49402747", "text": "function addBackgrounds() {\n\n\t\t\t\t\t\t// We draw 8 backgrounds; one for each day of the week, plus one for overlap\n\t\t\t\t\t\tvar width = null;\n\t\t\t\t\t\tvar backgrounds = [];\n\t\t\t\t\t\tfor (var bgId = 0; bgId < 8; bgId++) {\n\t\t\t\t\t\t\tvar background = worldMap.svg.insert(\"rect\", \"g\")\n\t\t\t\t\t\t\t\t.attr(\"class\", backgroundClass)\n\t\t\t\t\t\t\t\t.attr(\"width\", \"100%\")\n\t\t\t\t\t\t\t\t.attr(\"height\", \"100%\")\n\t\t\t\t\t\t\t\t.attr(\"fill\", \"url(#sun)\");\n\n\t\t\t\t\t\t\tif (width === null) {\n\t\t\t\t\t\t\t\twidth = getWidthOfElementFromD3Selection(background);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Keep track of the width that the box is covering when at 100%.\n\t\t\t\t\t\t\t// This value should be used to calculate translations.\n\t\t\t\t\t\t\tbackground.imageWidth = width;\n\n\t\t\t\t\t\t\t// Add a small amount of overlap on the svg images.\n\t\t\t\t\t\t\tbackground.attr(\"width\", (1.02 * width) + \"px\");\n\n\t\t\t\t\t\t\tbackground.attr(\"x\", width * bgId);\n\t\t\t\t\t\t\tbackgrounds[bgId] = background;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn backgrounds;\n\t\t\t\t\t}", "title": "" }, { "docid": "86e744dfee844cffa2dee1c348775e1a", "score": "0.4939767", "text": "function backStrech() {\n\t\t$(\"aside\").backstretch([\n\t\t\t\"https://scontent-a-sea.xx.fbcdn.net/hphotos-frc3/t31.0-8/1658521_10152328683880844_56619524_o.jpg\",\n\n\t\t\t], {duration: 5000, fade: 1000});\n\t}", "title": "" }, { "docid": "af67703edb4dccaac30a52725e132229", "score": "0.49346393", "text": "function createBackground(x, y, widthin, heightin, colorin) {\n var rect = chart.createChild(am4core.Rectangle);\n rect.isMeasured = false;\n rect.width = am4core.percent(widthin);\n rect.height = am4core.percent(heightin);\n rect.x = am4core.percent(x);\n rect.y = am4core.percent(y);\n rect.opacity = .3;\n rect.fill = colorin;\n chart.plotContainer.children.push(rect);\n rect.defaultState.transitionDuration = 0;\n rect.hiddenState.transitionDuration = 0;\n }", "title": "" }, { "docid": "49ef845c63d2eaacd7e1269db7c2200f", "score": "0.4921554", "text": "function Background(){\n this.speed = 1;\n\n // Define the draw function for our background drawable.\n this.draw = function(){\n // This is where were gonna pan the background.\n this.y += this.speed;\n this.context.drawImage(imageRepo.background, this.x, this.y);\n // Draw another image at the top edge of the first image.\n this.context.drawImage(imageRepo.background, this.x, this.y - this.canvasHeight);\n // checking to see if the image scrolled off the screen, if it did, reset.\n if (this.y >= this.canvasHeight){\n this.y = 0;\n }\n }\n}", "title": "" }, { "docid": "21f8c0eb0c7220f63d12ba43e34e7d5c", "score": "0.49160388", "text": "function sectionParallaxImageBG() {\n\t$(\".section-parallax\").each(function () {\n\t\tvar parallaxSection = $(this),\n\t\t\timgSrc = parallaxSection.children(\"img:first-child\").attr(\"src\");\n\n\t\tparallaxSection.prepend(\"<div class='bg-element'></div>\");\n\t\tvar bgElement = parallaxSection.find(\"> .bg-element\");\n\t\tbgElement.css(\"background-image\", \"url('\" + imgSrc + \"')\").attr(\"data-stellar-background-ratio\", 0.1);\n\t});\n}", "title": "" }, { "docid": "c805b7da4e085b59a4162d5260d5fadc", "score": "0.491046", "text": "function Background(scene){\n\n var sprite = new EnhancedSprite(scene, \"./img/notepad.png\", 800, 600);\n \n sprite.init = function(){\n this.setX(this.cWidth/2 );\n this.setY(this.cHeight/2);\n this.setSpeed(0);\n this.width = this.cWidth;\n this.height = this.cHeight;\n //this.setMoveAngle(180);\n };\n\n return sprite; \n }", "title": "" }, { "docid": "f72a98f6a79fcfccd42f94c3a39e08e2", "score": "0.4909772", "text": "function sufragerie() {\n\t\t\t\tlet image = document.getElementById(\"schimba_imaginea\").style.backgroundImage = \"url('imagini/sufrageriePiese555.jpg')\";\n\t\t\t\tdocument.getElementById(\"loc_pentru_tablouri\").style.width = \"0\";\n\t\t\t\tdocument.getElementById(\"loc_pentru_tablouri\").style.height = \"0\";\n\t\t\t}", "title": "" }, { "docid": "29aca4ef29346f32389d09a2164f7f00", "score": "0.49050063", "text": "_getContainerWidth() {\n return window.innerWidth - PADDING;\n }", "title": "" }, { "docid": "4fcec7af7ba7f55845aff9c2cd423770", "score": "0.48989612", "text": "function draw()\n{\n backCtx.clearRect(0, 0, W, H);\n\n minusCharacter.updateFrame();\n\n\n updateBackgroundEffects(1);\n backCtx.drawImage(minusCharacter.image, minusCharacter.srcX, minusCharacter.srcY, minusCharacter.spriteWidth,\n minusCharacter.spriteHeight, 10, 100, W/5, H/5);\n}", "title": "" }, { "docid": "6bf6dfbb26462f6c95c44c9905a87d08", "score": "0.48720238", "text": "function loadBackgroundEmptyBlurImage() {\n if (backgroundEmptyBlurPath in loader.resources) {\n // console.log(`${backgroundEmptyBlurPath} - already in stage`);\n addBackgroundEmptyBlurImage();\n } else {\n loader\n .add(backgroundEmptyBlurPath);\n }\n loader\n .once('complete', (loader, resources) => {\n addBackgroundEmptyBlurImage();\n });\n }", "title": "" }, { "docid": "6bf6dfbb26462f6c95c44c9905a87d08", "score": "0.48720238", "text": "function loadBackgroundEmptyBlurImage() {\n if (backgroundEmptyBlurPath in loader.resources) {\n // console.log(`${backgroundEmptyBlurPath} - already in stage`);\n addBackgroundEmptyBlurImage();\n } else {\n loader\n .add(backgroundEmptyBlurPath);\n }\n loader\n .once('complete', (loader, resources) => {\n addBackgroundEmptyBlurImage();\n });\n }", "title": "" } ]
5be465c8840acdd953a47c4f1be5b285
parent component style should be after child's so that parent component's style could override it
[ { "docid": "a175fa4eb51ab50d7200368aee26de19", "score": "0.0", "text": "function getStyle(vnode, checkChild) {\n var res = {};\n var styleData;\n\n if (checkChild) {\n var childNode = vnode;\n\n while (childNode.componentInstance) {\n childNode = childNode.componentInstance._vnode;\n\n if (childNode && childNode.data && (styleData = normalizeStyleData(childNode.data))) {\n extend(res, styleData);\n }\n }\n }\n\n if (styleData = normalizeStyleData(vnode.data)) {\n extend(res, styleData);\n }\n\n var parentNode = vnode;\n\n while (parentNode = parentNode.parent) {\n if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {\n extend(res, styleData);\n }\n }\n\n return res;\n}", "title": "" } ]
[ { "docid": "fc766b6535b6c6a9ee24399a568662cc", "score": "0.6731237", "text": "render() {\n return (\n <div className=\"parent\" style={{backgroundColor: this.state.color}}>\n <Child color={this.state.childrenColor} handleColorChange={this.changeColor} />\n <Child color={this.state.childrenColor} handleColorChange={this.changeColor} />\n </div>\n ) // now, we go use this prop data (lines 29 & 30)\n // in our child component, to change the backgorund color\n }", "title": "" }, { "docid": "7c5f36095f824c521d3b5fccc66958c4", "score": "0.61883664", "text": "addStyles(input, parent) {\n const builder = this.styleBuilder;\n const useCache = builder.shouldCache;\n let genStyles = this.styleCache.get(input);\n if (!genStyles || !useCache) {\n genStyles = builder.buildStyles(input, parent);\n if (useCache) {\n this.styleCache.set(input, genStyles);\n }\n }\n this.mru = Object.assign({}, genStyles);\n this.applyStyleToElement(genStyles);\n builder.sideEffect(input, genStyles, parent);\n }", "title": "" }, { "docid": "1de0efa75dfd02285dec216d52d1c1b5", "score": "0.5808871", "text": "function inheritFromParent(props, parent, child) {\n props.forEach(function (prop) {\n if (parent.hasOwnProperty(prop) && !child.hasOwnProperty(prop)) {\n child[prop] = parent[prop];\n }\n });\n }", "title": "" }, { "docid": "67e87a987cd31a8e84547f871d6e5423", "score": "0.57437366", "text": "render() {\n return (\n <span style={this.state.styles}>\n {this.props.children}\n </span>\n );\n }", "title": "" }, { "docid": "fd69300edf08660226c95d4d5a0a6c34", "score": "0.5701956", "text": "function updateCss(self) {\n var supported = [\n 'border',\n 'borderRadius',\n 'borderWidth',\n 'borderColor',\n 'backgroundColor',\n ];\n\n var child_style = self.dom.firstChild.style;\n for (n = 0; n < supported.length; n++) {\n var o = supported[n];\n var v = self.css[o];\n if (v) {\n child_style[o] = v;\n self.css[o] = null;\n }\n }\n }", "title": "" }, { "docid": "df6d05d3a146660b5acf1c21139b6a8a", "score": "0.56917846", "text": "static get styles() {\n return css `\n :host {\n height: 10px;\n display: flex;\n position: relative;\n }\n [part~=bar] {\n height: 100%;\n position: relative;\n }\n [part=label] {\n position: absolute;\n top: 50%;\n left: 100%;\n height: 0;\n line-height: 0;\n white-space: nowrap;\n margin-left: 10px;\n }\n :host([alignment=right]) {\n justify-content: flex-end;\n }\n :host([alignment=right]) [part=label] {\n left: auto;\n right: 100%;\n margin-left: 0;\n margin-right: 10px;\n }\n :host [part~=bar-zero] [part=label] {\n margin: 0;\n }\n `;\n }", "title": "" }, { "docid": "f65e85b6272cf037b2547deac699abc7", "score": "0.5648271", "text": "getStyles() {\n return Object.assign(super.getStyles(), {\n fire: { alpha:0 },\n });\n }", "title": "" }, { "docid": "de0a671fa0b80ce328712d790c41c7d6", "score": "0.5640913", "text": "updateStyle() {\n this._styling(this._mainDiv, this);\n }", "title": "" }, { "docid": "de0a671fa0b80ce328712d790c41c7d6", "score": "0.5640913", "text": "updateStyle() {\n this._styling(this._mainDiv, this);\n }", "title": "" }, { "docid": "de0a671fa0b80ce328712d790c41c7d6", "score": "0.5640913", "text": "updateStyle() {\n this._styling(this._mainDiv, this);\n }", "title": "" }, { "docid": "de0a671fa0b80ce328712d790c41c7d6", "score": "0.5640913", "text": "updateStyle() {\n this._styling(this._mainDiv, this);\n }", "title": "" }, { "docid": "de0a671fa0b80ce328712d790c41c7d6", "score": "0.5640913", "text": "updateStyle() {\n this._styling(this._mainDiv, this);\n }", "title": "" }, { "docid": "de0a671fa0b80ce328712d790c41c7d6", "score": "0.5640913", "text": "updateStyle() {\n this._styling(this._mainDiv, this);\n }", "title": "" }, { "docid": "de0a671fa0b80ce328712d790c41c7d6", "score": "0.5640913", "text": "updateStyle() {\n this._styling(this._mainDiv, this);\n }", "title": "" }, { "docid": "4642fe4f3868b9076a51721183176918", "score": "0.5634127", "text": "updateStyle(): void {\n const { left, top } = this.props;\n\n const style = this._target.style;\n\n style.left = left + 'px';\n style.top = top + 'px';\n style.zIndex = 50;\n }", "title": "" }, { "docid": "769aba0f1e0c128f414543d9fdcf6b68", "score": "0.56190056", "text": "updateStyle(stateStyle) {\n let {styles} = this.stylesheet;\n\n this.setState({\n containerStyle: assign({}, styles.container, stateStyle)\n });\n }", "title": "" }, { "docid": "a85116084c4b7fdd5dd760b33e474871", "score": "0.56117535", "text": "function getStyle(vnode,checkChild){var res={};var styleData;if(checkChild){var childNode=vnode;while(childNode.componentInstance){childNode=childNode.componentInstance._vnode;if(childNode&&childNode.data&&(styleData=normalizeStyleData(childNode.data))){extend(res,styleData);}}}if(styleData=normalizeStyleData(vnode.data)){extend(res,styleData);}var parentNode=vnode;while(parentNode=parentNode.parent){if(parentNode.data&&(styleData=normalizeStyleData(parentNode.data))){extend(res,styleData);}}return res;}", "title": "" }, { "docid": "a85116084c4b7fdd5dd760b33e474871", "score": "0.56117535", "text": "function getStyle(vnode,checkChild){var res={};var styleData;if(checkChild){var childNode=vnode;while(childNode.componentInstance){childNode=childNode.componentInstance._vnode;if(childNode&&childNode.data&&(styleData=normalizeStyleData(childNode.data))){extend(res,styleData);}}}if(styleData=normalizeStyleData(vnode.data)){extend(res,styleData);}var parentNode=vnode;while(parentNode=parentNode.parent){if(parentNode.data&&(styleData=normalizeStyleData(parentNode.data))){extend(res,styleData);}}return res;}", "title": "" }, { "docid": "a85116084c4b7fdd5dd760b33e474871", "score": "0.56117535", "text": "function getStyle(vnode,checkChild){var res={};var styleData;if(checkChild){var childNode=vnode;while(childNode.componentInstance){childNode=childNode.componentInstance._vnode;if(childNode&&childNode.data&&(styleData=normalizeStyleData(childNode.data))){extend(res,styleData);}}}if(styleData=normalizeStyleData(vnode.data)){extend(res,styleData);}var parentNode=vnode;while(parentNode=parentNode.parent){if(parentNode.data&&(styleData=normalizeStyleData(parentNode.data))){extend(res,styleData);}}return res;}", "title": "" }, { "docid": "a85116084c4b7fdd5dd760b33e474871", "score": "0.56117535", "text": "function getStyle(vnode,checkChild){var res={};var styleData;if(checkChild){var childNode=vnode;while(childNode.componentInstance){childNode=childNode.componentInstance._vnode;if(childNode&&childNode.data&&(styleData=normalizeStyleData(childNode.data))){extend(res,styleData);}}}if(styleData=normalizeStyleData(vnode.data)){extend(res,styleData);}var parentNode=vnode;while(parentNode=parentNode.parent){if(parentNode.data&&(styleData=normalizeStyleData(parentNode.data))){extend(res,styleData);}}return res;}", "title": "" }, { "docid": "a85116084c4b7fdd5dd760b33e474871", "score": "0.56117535", "text": "function getStyle(vnode,checkChild){var res={};var styleData;if(checkChild){var childNode=vnode;while(childNode.componentInstance){childNode=childNode.componentInstance._vnode;if(childNode&&childNode.data&&(styleData=normalizeStyleData(childNode.data))){extend(res,styleData);}}}if(styleData=normalizeStyleData(vnode.data)){extend(res,styleData);}var parentNode=vnode;while(parentNode=parentNode.parent){if(parentNode.data&&(styleData=normalizeStyleData(parentNode.data))){extend(res,styleData);}}return res;}", "title": "" }, { "docid": "c0ac6bba3fcbfe57553edca35b85ea96", "score": "0.5611641", "text": "function onChildPropertyChanged(child) {\n\t var parent = child.parent;\n\t var layout = parent && parent.layout;\n\t if (layout instanceof BoxLayout)\n\t parent.fit();\n\t }", "title": "" }, { "docid": "66261d2433c5bb3d7446a59816887eba", "score": "0.56049746", "text": "render() {\n return <View style={{ ...this.props.style }} />\n }", "title": "" }, { "docid": "8b4bf4d2caa487853ad46ae47b8925c9", "score": "0.5568154", "text": "function getStyle(vnode,checkChild){var res={};var styleData;if(checkChild){var childNode=vnode;while(childNode.componentInstance){childNode=childNode.componentInstance._vnode;if(childNode.data&&(styleData=normalizeStyleData(childNode.data))){extend(res,styleData);}}}if(styleData=normalizeStyleData(vnode.data)){extend(res,styleData);}var parentNode=vnode;while(parentNode=parentNode.parent){if(parentNode.data&&(styleData=normalizeStyleData(parentNode.data))){extend(res,styleData);}}return res;}", "title": "" }, { "docid": "8b4bf4d2caa487853ad46ae47b8925c9", "score": "0.5568154", "text": "function getStyle(vnode,checkChild){var res={};var styleData;if(checkChild){var childNode=vnode;while(childNode.componentInstance){childNode=childNode.componentInstance._vnode;if(childNode.data&&(styleData=normalizeStyleData(childNode.data))){extend(res,styleData);}}}if(styleData=normalizeStyleData(vnode.data)){extend(res,styleData);}var parentNode=vnode;while(parentNode=parentNode.parent){if(parentNode.data&&(styleData=normalizeStyleData(parentNode.data))){extend(res,styleData);}}return res;}", "title": "" }, { "docid": "8b4bf4d2caa487853ad46ae47b8925c9", "score": "0.5568154", "text": "function getStyle(vnode,checkChild){var res={};var styleData;if(checkChild){var childNode=vnode;while(childNode.componentInstance){childNode=childNode.componentInstance._vnode;if(childNode.data&&(styleData=normalizeStyleData(childNode.data))){extend(res,styleData);}}}if(styleData=normalizeStyleData(vnode.data)){extend(res,styleData);}var parentNode=vnode;while(parentNode=parentNode.parent){if(parentNode.data&&(styleData=normalizeStyleData(parentNode.data))){extend(res,styleData);}}return res;}", "title": "" }, { "docid": "8b4bf4d2caa487853ad46ae47b8925c9", "score": "0.5568154", "text": "function getStyle(vnode,checkChild){var res={};var styleData;if(checkChild){var childNode=vnode;while(childNode.componentInstance){childNode=childNode.componentInstance._vnode;if(childNode.data&&(styleData=normalizeStyleData(childNode.data))){extend(res,styleData);}}}if(styleData=normalizeStyleData(vnode.data)){extend(res,styleData);}var parentNode=vnode;while(parentNode=parentNode.parent){if(parentNode.data&&(styleData=normalizeStyleData(parentNode.data))){extend(res,styleData);}}return res;}", "title": "" }, { "docid": "8b4bf4d2caa487853ad46ae47b8925c9", "score": "0.5568154", "text": "function getStyle(vnode,checkChild){var res={};var styleData;if(checkChild){var childNode=vnode;while(childNode.componentInstance){childNode=childNode.componentInstance._vnode;if(childNode.data&&(styleData=normalizeStyleData(childNode.data))){extend(res,styleData);}}}if(styleData=normalizeStyleData(vnode.data)){extend(res,styleData);}var parentNode=vnode;while(parentNode=parentNode.parent){if(parentNode.data&&(styleData=normalizeStyleData(parentNode.data))){extend(res,styleData);}}return res;}", "title": "" }, { "docid": "8b4bf4d2caa487853ad46ae47b8925c9", "score": "0.5568154", "text": "function getStyle(vnode,checkChild){var res={};var styleData;if(checkChild){var childNode=vnode;while(childNode.componentInstance){childNode=childNode.componentInstance._vnode;if(childNode.data&&(styleData=normalizeStyleData(childNode.data))){extend(res,styleData);}}}if(styleData=normalizeStyleData(vnode.data)){extend(res,styleData);}var parentNode=vnode;while(parentNode=parentNode.parent){if(parentNode.data&&(styleData=normalizeStyleData(parentNode.data))){extend(res,styleData);}}return res;}", "title": "" }, { "docid": "8b4bf4d2caa487853ad46ae47b8925c9", "score": "0.5568154", "text": "function getStyle(vnode,checkChild){var res={};var styleData;if(checkChild){var childNode=vnode;while(childNode.componentInstance){childNode=childNode.componentInstance._vnode;if(childNode.data&&(styleData=normalizeStyleData(childNode.data))){extend(res,styleData);}}}if(styleData=normalizeStyleData(vnode.data)){extend(res,styleData);}var parentNode=vnode;while(parentNode=parentNode.parent){if(parentNode.data&&(styleData=normalizeStyleData(parentNode.data))){extend(res,styleData);}}return res;}", "title": "" }, { "docid": "5aa8f3e51f145c8c39502ea228229be8", "score": "0.55657256", "text": "function _child() { \n _parent.apply(this, arguments);\n }", "title": "" }, { "docid": "e50975a3453b3f534ee84e0d7cd323b9", "score": "0.5549317", "text": "componentWillMount(){\n this.style={\n backgroundColor: '#949ba8',\n marginTop: '25px',\n borderRadius: '25px'\n }\n }", "title": "" }, { "docid": "a9bf91397ebf80b09bbab98fc66c9bf4", "score": "0.5510793", "text": "updateStyle(stateStyle) {\n let {styles} = stylesheet;\n\n this.setState({containerStyle: assign({}, styles.container, stateStyle)});\n }", "title": "" }, { "docid": "a34289f30d49bda2d6088e035263080e", "score": "0.5468794", "text": "componentDidUpdate() {\n // To make the ripple animation work we update the css properties after React finished building the DOM.\n if (this.refs.root)\n this.state.rippleCss.forEach((v, k) => {\n this.refs.root.style.setProperty(k, v)\n })\n }", "title": "" }, { "docid": "e94e07004a83c1184c7b7dab96dbcb16", "score": "0.5464094", "text": "function getStyle(vnode,checkChild){var res={};var styleData;if(checkChild){var childNode=vnode;while(childNode.child){childNode=childNode.child._vnode;if(childNode.data&&(styleData=normalizeStyleData(childNode.data))){extend(res,styleData);}}}if(styleData=normalizeStyleData(vnode.data)){extend(res,styleData);}var parentNode=vnode;while(parentNode=parentNode.parent){if(parentNode.data&&(styleData=normalizeStyleData(parentNode.data))){extend(res,styleData);}}return res;}", "title": "" }, { "docid": "df3adc64f6a5c1155c228d9e824e2aa2", "score": "0.54596835", "text": "componentWillMount() {\n this.style = { backgroundColor: \"#CCC\" };\n }", "title": "" }, { "docid": "54ab71bdd299e859ac725abf4780231f", "score": "0.54589814", "text": "function MatOptionParentComponent() { }", "title": "" }, { "docid": "881731b5282f0a8cc5beac55a74b3eeb", "score": "0.5456002", "text": "onAfterAttach(msg) {\r\n super.onAfterAttach(msg);\r\n Private.toggleDirection(this.parent, this._direction);\r\n let style = this.parent.node.style;\r\n style.flexWrap = this._wrap ? 'wrap' : 'nowrap';\r\n style.justifyContent = Private.translateFlexString(this._justifyContent);\r\n style.alignContent = Private.translateFlexString(this._alignContent);\r\n style.alignItems = Private.translateFlexString(this._alignItems);\r\n this.parent.fit();\r\n }", "title": "" }, { "docid": "42e3e6b691128599e26e8aa5d1d33938", "score": "0.54471576", "text": "renderBubble(props){\n return(\n <Bubble\n// Inherit props\n {...props}\n// Change chats bubble by modifying the wrapperStyle background color\n wrapperStyle={{\n // Left bubble\n left:{\n backgroundColor: \"#757083\"\n },\n// Right bubble\n right:{\n backgroundColor: \"#757083\"\n }\n }}\n// Text style of the bubble\n textStyle={{\n left:{\n color: \"white\",\n fontWeight: \"bold\",\n fontStyle: \"italic\"\n },\n right:{\n color: \"white\"\n }\n }}\n \n\n />\n )\n }", "title": "" }, { "docid": "49efa1f65900abf4d9956b1f88b4e052", "score": "0.54452085", "text": "static get styles() {\n return [\n ...super.styles,\n css`\n :host {\n display: block;\n box-sizing: content-box !important;\n border: 1px solid var(--simple-colors-default-theme-accent-6);\n min-width: 320px;\n min-height: 155px;\n border-radius: 20px;\n padding: 20px;\n width: 5em;\n background-color: var(--simple-colors-default-theme-accent-2);\n box-shadow: 0 0 5px var(--simple-colors-default-theme-accent-7);\n margin: 10px;\n }\n p {\n color: var(--simple-colors-default-theme-accent-10);\n }\n `,\n ];\n }", "title": "" }, { "docid": "4629702527eb98988a285b20556fc039", "score": "0.5436692", "text": "render() {\n let style = assign(this.defaultStyle, this.props.style || {})\n\n return (\n <div id={this.id} className={'jxgbox ' + this.props.className} style={style} />\n )\n }", "title": "" }, { "docid": "223431e78d0de37fa0001271266c5ea5", "score": "0.5433415", "text": "render() {\n //our return which renders our react element\n return (\n //the div is our parent element with a class of \"app\"\n //parent element contains 4 components that will be rendered from the other files, one with an inline style \n <div className=\"App\">\n <Header backColor=\"green\" width=\"50%\"></Header>\n <SectionMain></SectionMain>\n <Aside></Aside>\n <Footer></Footer>\n </div>\n );\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5392196", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5392196", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5392196", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5392196", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5392196", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5392196", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5392196", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "f34d36c807e762edf80c49e42efa97e8", "score": "0.5390188", "text": "sideEffect(_input, _styles, _parent) {\n }", "title": "" }, { "docid": "e9c9ec8cf1d25a90b4814d28b51a4aa3", "score": "0.5389802", "text": "renderBubble(props) {\n return (\n <Bubble\n {...props}\n wrapperStyle={{\n right: {\n backgroundColor: '#000'\n }\n }}\n />\n )\n }", "title": "" }, { "docid": "62a4ecd5e0ae0e3f171d3491678e910b", "score": "0.53791547", "text": "renderBubble(props) {\n return (\n <Bubble\n {...props}\n wrapperStyle={{\n right: {\n backgroundColor: '#123458'\n },\n left: {\n backgroundColor: '#6495ED'\n }\n }}\n />\n )\n }", "title": "" }, { "docid": "62a4ecd5e0ae0e3f171d3491678e910b", "score": "0.53791547", "text": "renderBubble(props) {\n return (\n <Bubble\n {...props}\n wrapperStyle={{\n right: {\n backgroundColor: '#123458'\n },\n left: {\n backgroundColor: '#6495ED'\n }\n }}\n />\n )\n }", "title": "" }, { "docid": "3383f3fbe5ad337ac3cc1eee7e8d8ed9", "score": "0.5371879", "text": "renderBubble(props) {\n return (\n <Bubble\n {...props}\n wrapperStyle={{\n right: {\n backgroundColor: \"#781820\",\n },\n left: {\n backgroundColor: \"#87CEFA\",\n },\n }}\n />\n );\n }", "title": "" }, { "docid": "67aa5caf9b3adf387b5090ce57136da8", "score": "0.53709483", "text": "loadStyle(){\n\t\tif( this.style ){\n\t\t\tthis.appendStyle( this.style(this.componentId) );\n\t\t}\n\t}", "title": "" }, { "docid": "cf80abc850ed29c0ef13c9e3b7e3611c", "score": "0.53644454", "text": "_forceRender(np) {\n if (this.state.forceReRender) {\n this.setState({\n forceReRender: false\n });\n }\n\n if (this.props.parentWidth !== np.parentWidth) {\n this.setState({\n forceReRender: true\n });\n }\n }", "title": "" }, { "docid": "ca783480c64648a5ada83481bf29e7a9", "score": "0.5360721", "text": "clearStyles() {\n const gridMode = Object.keys(this.mru).length > 0;\n const childrenStyle = gridMode ? 'padding' :\n getMarginType(this.directionality.value, this.layout);\n // If there are styles on the parent remove them\n if (gridMode) {\n super.clearStyles();\n }\n // Then remove the children styles too\n this.styleUtils.applyStyleToElements({ [childrenStyle]: '' }, this.childrenNodes);\n }", "title": "" }, { "docid": "21d69597ae7a72e4ad97932f456565d2", "score": "0.53578603", "text": "update(changedProperties){super.update(changedProperties);const templateResult=this.render();if(templateResult instanceof TemplateResult$1){this.constructor.render(templateResult,this.renderRoot,{scopeName:this.localName,eventContext:this})}// When native Shadow DOM is used but adoptedStyles are not supported,\n// insert styling after rendering to ensure adoptedStyles have highest\n// priority.\nif(this._needsShimAdoptedStyleSheets){this._needsShimAdoptedStyleSheets=!1;this.constructor._styles.forEach(s=>{const style=document.createElement(\"style\");style.textContent=s.cssText;this.renderRoot.appendChild(style)})}}", "title": "" }, { "docid": "ec495d0d73abe496bfdd08fb59206028", "score": "0.535481", "text": "function ChiefComplaintComponentStyle() {\n\tthis.initByNamespace(\"chief\");\n}", "title": "" }, { "docid": "5eaf0d1c09e76f8c4cb160b59eddacb9", "score": "0.5320811", "text": "render() {\n // eslint-disable-next-line no-unused-vars\n let baseStyle = {};\n // eslint-disable-next-line no-unused-vars\n let layoutFlowStyle = {};\n \n const style_elFbtn_prev = {\n backgroundImage: 'url('+img_elFbtn_prev+')',\n backgroundSize: '100% 100%',\n };\n const style_elTriangle = {\n backgroundImage: 'url('+img_elTriangle+')',\n backgroundSize: '100% 100%',\n };\n const style_elRectangle = {\n background: 'rgba(35, 69, 17, 1.000)',\n border: '2.2px solid #969696',\n };\n \n return (\n <div className=\"Fbtn_prev btn\" style={baseStyle}>\n <div className=\"foreground\">\n <div className='elFbtn_prev' style={style_elFbtn_prev} />\n <div className='elTriangle' style={style_elTriangle} />\n <div className='elRectangle' style={style_elRectangle} />\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "e5648ffc30446a92da282b6946fc76e2", "score": "0.5300201", "text": "update(changedProperties){super.update(changedProperties);const templateResult=this.render();if(templateResult instanceof TemplateResult){this.constructor.render(templateResult,this.renderRoot,{scopeName:this.localName,eventContext:this})}// When native Shadow DOM is used but adoptedStyles are not supported,\n// insert styling after rendering to ensure adoptedStyles have highest\n// priority.\nif(this._needsShimAdoptedStyleSheets){this._needsShimAdoptedStyleSheets=!1;this.constructor._styles.forEach(s=>{const style=document.createElement(\"style\");style.textContent=s.cssText;this.renderRoot.appendChild(style)})}}", "title": "" }, { "docid": "401ac9357a420402b538df7200e363e4", "score": "0.52992463", "text": "groupStyleChanged() {\n this.disableGroupAdjustmentWhenChildrenChange();\n this.adjustChildrenVertically();\n this.adjustChildrenHorizontally();\n this.enableGroupAdjustmentWhenChildrenChange();\n }", "title": "" }, { "docid": "0975868afcde5bc449999093a427d2d1", "score": "0.52974945", "text": "update(changedProperties){super.update(changedProperties);const templateResult=this.render();if(templateResult instanceof TemplateResult){this.constructor.render(templateResult,this.renderRoot,{scopeName:this.localName,eventContext:this});}// When native Shadow DOM is used but adoptedStyles are not supported,\n// insert styling after rendering to ensure adoptedStyles have highest\n// priority.\nif(this._needsShimAdoptedStyleSheets){this._needsShimAdoptedStyleSheets=false;this.constructor._styles.forEach(s=>{const style=document.createElement('style');style.textContent=s.cssText;this.renderRoot.appendChild(style);});}}", "title": "" }, { "docid": "0d63dd0e3aa426c6f3dfb69431d00622", "score": "0.5290307", "text": "mainStyle(pct){\n //Main Bar Represents Single Percentage\n pct = (pct%0.01)*100\n\n let barWidth = (this.props.width/2) * Math.abs(pct)\n if (pct > 0){\n //Positive Change\n //return{transform: `translate(${(this.props.width/2)}px, 0px)`, height: \"50px\", width: `${barWidth}`, backgroundColor: \"green\"}\n return{transform: `translate(${(this.props.width/2)}px, 0px)`, height: `${this.props.height}px`, width: `${barWidth}px`, backgroundColor: \"green\"}\n }else{\n //Negative Change\n //return{transform: `translate(${(this.props.width/2) - barWidth}px, 0px)`,height: \"50px\", width: `${barWidth}`, backgroundColor: \"red\"}\n return{transform: `translate(${(this.props.width/2) - barWidth}px, 0px)`, height: `${this.props.height}px`, width: `${barWidth}px`, backgroundColor: \"red\"}\n }\n }", "title": "" }, { "docid": "ecf012f985d7e5575b76d7471fed2fb6", "score": "0.528084", "text": "render(){\n return(\n <div className=\"bar-item\" style={navBarItemStyle}>\n {this.props.children}\n </div>\n );\n }", "title": "" }, { "docid": "0f72a1b4310beab58d9eafa9fc515b08", "score": "0.52731204", "text": "constructor() {\n super(\"background-color\");\n }", "title": "" }, { "docid": "ab189ed87bf6ccb16e866e18b36de569", "score": "0.5252123", "text": "constructor(props) {\n super(props);\n Dimensions.addEventListener('change', this.updateStyles);\n }", "title": "" }, { "docid": "06a0527955f0af576011f55e967c6e5f", "score": "0.5241361", "text": "function mergeStyles(styles) {\n // Merge styles, properties in children override the same property in parents\n // Remove rules without styles\n var style = cloneStyle({}, styles.filter(style => style));\n\n // Children of invisible parents are also invisible\n style.visible = !styles.some(style => style.visible === false);\n\n // The full original order chain is preserved\n // But, the order inheritance can be 'reset' at any point in the chain\n var order_start = 0;\n for (var i = styles.length-1; i >= 0; i--) {\n if (styles[i].orderReset) {\n order_start = i;\n break;\n }\n }\n style.order = styles.slice(order_start).filter(style => style.order).map(style => style.order);\n\n // Order can be cached if it is only a single value...\n if (style.order.length === 1 && typeof style.order[0] === 'number') {\n style.order = style.order[0];\n }\n // Or if there are no function dependencies\n else if (!style.order.some(style => typeof style === 'function')) {\n style.order = StyleParser.calculateOrder(style.order);\n }\n\n return style;\n}", "title": "" }, { "docid": "4cf103265554cbd191591e7dd83f7b85", "score": "0.5234898", "text": "render() {\n // eslint-disable-next-line no-unused-vars\n let baseStyle = {};\n // eslint-disable-next-line no-unused-vars\n let layoutFlowStyle = {};\n \n const style_elBn = {\n backgroundImage: 'url('+img_elBn+')',\n backgroundSize: '100% 100%',\n };\n const style_elIcon = {\n backgroundImage: 'url('+img_elIcon+')',\n backgroundSize: '100% 100%',\n };\n \n return (\n <div className=\"Fbtn_pause btn\" style={baseStyle}>\n <div className=\"foreground\">\n <div className='elBn' style={style_elBn} />\n <div className='elIcon' style={style_elIcon} />\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "f5d2a62f44b6536ccbdbd46345685fd0", "score": "0.52327204", "text": "function App() {\n return (\n <div className=\"App\">\n\n<styleSheet></styleSheet>\n{/* <NameList></NameList> */}\n{/* <ParentComponent></ParentComponent> */}\n {/* <FunctionClick></FunctionClick>\n <ClassClick></ClassClick> */}\n {/* <EventBind></EventBind> */}\n {/* <Counter></Counter> */}\n{/* \n <Message></Message> */}\n {/* <Greet name=\"Ghanshyam\" heroName=\"Captain America\">\n <p>This is Thakur Intenational</p>\n </Greet>\n <Greet name=\"Kumar\" heroName=\"Thor\"><button>Action</button> </Greet>\n <Greet name=\"Radhey\" heroName=\"BatMan\"/>\n <Welcome name=\"Ghanshyam\" heroName=\"Captain America\" />\n <Welcome name=\"Kumar\" heroName=\"Thor\" ></Welcome>\n <Welcome name=\"Kumar\" heroName=\"BatMan\" ></Welcome>\n {/* <Hello></Hello> */}\n \n </div>\n );\n}", "title": "" }, { "docid": "ee180df2b3a19ef86819b099dfd70055", "score": "0.5220564", "text": "render () {\n\n // grab the wrapper element styles\n const {before, after, style, ...unusedProps} = this.props\n\n // render the component\n return (\n <span style={style} {...unusedProps}>\n <span style={before} />\n {this.props.children}\n <span style={after} />\n </span>\n )\n }", "title": "" }, { "docid": "33839b1ebbcc845b55ed5aa45e5f63a1", "score": "0.52130765", "text": "fillParent (stretch=false) {\n if (this.parent) {\n let parentW = this.parent.$element.width();\n let parentH = this.parent.$element.height();\n let parentElementSize = Math.max(parentW, parentH);\n this.css({\n position: 'absolute',\n left: '0px', top: '0px',\n width: stretch ? parentW : parentElementSize,\n height: stretch ? parentH : parentElementSize\n });\n }\n return this;\n }", "title": "" }, { "docid": "4352586c03eff8f0c69a021e426da51b", "score": "0.5207308", "text": "static get styles() {\n return [...super.styles,\n css`\n :host{\n display: block;\n height: var(--header-height,inherit);\n width: var(--header-width,inherit);\n border-style: solid;\n border-color: black;\n border-width: 1px;\n background-color: var(--simple-colors-default-theme-accent-6,black);\n overflow: hidden;\n }\n\n\n .header-content{\n\n display: flex;\n height: inherit;\n width: inherit;\n align-items: center;\n\n }\n\n .header-text-box{\n\n width: 70% !important;\n text-align: center;\n margin-left: auto;\n margin-right: auto;\n display: flex;\n flex-direction: column;\n justify-content: center;\n color: white;\n\n }\n\n h2{margin:1px;}\n h3{margin:1px;}\n\n\n `\n ];\n \n }", "title": "" }, { "docid": "7f04d4df1c4a58032616e4bfbc9a968b", "score": "0.5199192", "text": "reStyle() {\n console.log('restyle')\n this._destroyStyles();\n this._initStyles();\n }", "title": "" }, { "docid": "4abcfed1b6de4e4383877a3a68b3c2ff", "score": "0.5197166", "text": "connectedCallback() {\r\n super.connectedCallback();\r\n\r\n this.style['display'] = 'flex';\r\n this.style['flex-direction'] = this.reversed ? 'row-reverse' : 'row';\r\n }", "title": "" }, { "docid": "7e6f70dadefbef4cd7560b16cc270dce", "score": "0.5195268", "text": "constructor(props){\n super({...props, ...{\n \n }}) \n }", "title": "" }, { "docid": "5cc8f405fc13acc4d545e8e65fcbac56", "score": "0.5195027", "text": "getStyles(el, index, inline, children) {\n const propName = 'bm' + el.replace(el.charAt(0), el.charAt(0).toUpperCase());\n\n // Set base styles.\n let output = baseStyles[el] ? this.getStyle(baseStyles[el]) : {};\n\n // Add animation-specific styles.\n if (styles[el]) {\n output = {\n ...output,\n ...this.getStyle(styles[el], index + 1, children)\n };\n }\n\n // Add custom styles.\n if (this.props.styles[propName]) {\n output = {\n ...output,\n ...this.props.styles[propName]\n };\n }\n\n // Add element inline styles.\n if (inline) {\n output = {\n ...output,\n ...inline\n };\n }\n\n return output;\n }", "title": "" }, { "docid": "dd9ae01ad9ffd640dbd3b65bb7d35f10", "score": "0.5184578", "text": "firstUpdated(changedProperties) {\n if (super.firstUpdated) {\n super.firstUpdated(changedProperties);\n this.style.backgroundColor = \"var(--simple-colors-default-theme-\"+this.color+\"-6)\";\n }\n \n }", "title": "" }, { "docid": "01a13355d75cd4cf5dcb054f53729acd", "score": "0.5184112", "text": "function addBaselineFixStyle (element) {\n //element.style.position = 'relative';\n element.style.marginTop = '-20px';\n //element.style.zIndex = '0';\n }", "title": "" }, { "docid": "f91a7fcf7eb9bab897b7f0ed4f3ccb8f", "score": "0.5182954", "text": "static get styles() {\n return css `\n :host {\n display: inline-flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n user-select:none;\n position: relative;\n }\n input {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n }\n `;\n }", "title": "" }, { "docid": "c498df97a277eddde78090cafe2eb939", "score": "0.51452494", "text": "havingBaseStyle(style) {\n style = style || this.style.text();\n const wantSize = sizeAtStyle(Options.BASESIZE, style);\n\n if (this.size === wantSize && this.textSize === Options.BASESIZE && this.style === style) {\n return this;\n } else {\n return this.extend({\n style: style,\n size: wantSize\n });\n }\n }", "title": "" }, { "docid": "90cb2dd9a50cc1efe08818bc7cb550a8", "score": "0.5143081", "text": "render() {\n // eslint-disable-next-line no-unused-vars\n let baseStyle = {};\n // eslint-disable-next-line no-unused-vars\n let layoutFlowStyle = {};\n \n const style_mask = {\n backgroundImage: 'url('+img_elMask+')',\n backgroundSize: '100% 100%',\n pointerEvents: 'none',\n };\n const style_buttonkeyexpanded = {\n backgroundImage: 'url('+img_elButtonkeyexpanded+')',\n backgroundSize: '100% 100%',\n pointerEvents: 'none',\n };\n const style_label = {\n fontSize: 12.2,\n fontFamily: \"'ArialNarrow-Bold', sans-serif\",\n color: 'rgba(166, 167, 171, 0.9000)',\n textAlign: 'right',\n pointerEvents: 'none',\n };\n \n return (\n <div className=\"Buttonkeyexpandbottom\" style={baseStyle}>\n <div className=\"compContent\">\n <div className='elMask' style={style_mask} />\n <div className='elButtonkeyexpanded' style={style_buttonkeyexpanded} />\n <div className='elLabel' style={style_label}>\n <div>{this.props.locStrings.buttonkeyexpandbottom_label_866384}</div>\n </div>\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "a4e590b52c3c8f37295d837a2f71728c", "score": "0.51386994", "text": "static get styles() {\n return css`\n :host{\n display:block;\n height: inherit;\n width: inherit;\n \n }\n\n :host([toggle]) .slime-card-bottom{\n transition: max-height 0.75s linear 0s;\n max-height: var(--slime-card-bottom, 0);\n height: auto;\n overflow: hidden;\n }\n \n `;\n }", "title": "" }, { "docid": "46918b6690e9deed0b47c891d5a86aaa", "score": "0.51366764", "text": "render() {\n // eslint-disable-next-line no-unused-vars\n let baseStyle = {};\n // eslint-disable-next-line no-unused-vars\n let layoutFlowStyle = {};\n \n const style_elRoundimage = {\n backgroundImage: 'url('+img_elRoundimage+')',\n backgroundRepeat: 'no-repeat',\n backgroundPosition: '50% 50%',\n backgroundSize: 'cover',\n };\n \n return (\n <div className=\"Comp1\" style={baseStyle}>\n <div className=\"foreground\">\n <div className='elRoundimage' style={style_elRoundimage} />\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "e61b17f45fe2592ec6f92bccef922e64", "score": "0.51362646", "text": "subStyle(pct){\n if (pct < 0){\n let barWidth = (Math.trunc(Math.abs(pct)*100))*7\n return {display:\"flex\", transform: `translate(${(this.props.width/2)-barWidth}px, 0px)`}\n }else{\n return {display:\"flex\", transform: `translate(${(this.props.width/2)}px, 0px)`}\n }\n }", "title": "" }, { "docid": "d2c2e060acda25475bc966ce8a1d3a18", "score": "0.51361924", "text": "constructor() {\n super(\"background-color\");\n }", "title": "" }, { "docid": "8df4cd2b67c1cfd14de2b86ab5a71aa6", "score": "0.51180583", "text": "render(){\n return(\n <div>\n <h1>Hey, I'm the father here son, take some state from me!</h1>\n <Child/>\n </div>\n )\n}", "title": "" }, { "docid": "fac85696a787ac2e900c8538c9185f75", "score": "0.51179785", "text": "function updateParent(e) {\n var context = e.context;\n\n self.updateParent(context.shape || context.connection, context.oldParent);\n }", "title": "" }, { "docid": "779c33d9211bf6bbf62627238fc6170d", "score": "0.50988656", "text": "function App() {\n return (\n <Fragment>\n \n <MyLayout />\n {/* <Parent /> */}\n \n \n \n </Fragment>\n\n );\n}", "title": "" }, { "docid": "8dbdc085d393468cf2320559cecafdcb", "score": "0.50984913", "text": "_updateComponent() {\n if (!this.hasColor()) {\n return;\n }\n\n if (this.component !== false) {\n let icn = this.component.find('i').eq(0);\n\n if (icn.length > 0) {\n icn.css({\n 'backgroundColor': this.toCssColorString()\n });\n } else {\n this.component.css({\n 'backgroundColor': this.toCssColorString()\n });\n }\n }\n }", "title": "" }, { "docid": "7d29aeaa5c21e71d2ade6cc8567a4b9b", "score": "0.5096796", "text": "function getStyle(vnode, checkChild) {\n var res = {};\n var styleData;\n\n if (checkChild) {\n var childNode = vnode;\n while (childNode.componentInstance) {\n childNode = childNode.componentInstance._vnode;\n if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {\n extend(res, styleData);\n }\n }\n }\n\n if (styleData = normalizeStyleData(vnode.data)) {\n extend(res, styleData);\n }\n\n var parentNode = vnode;\n while (parentNode = parentNode.parent) {\n if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {\n extend(res, styleData);\n }\n }\n return res;\n }", "title": "" }, { "docid": "7d29aeaa5c21e71d2ade6cc8567a4b9b", "score": "0.5096796", "text": "function getStyle(vnode, checkChild) {\n var res = {};\n var styleData;\n\n if (checkChild) {\n var childNode = vnode;\n while (childNode.componentInstance) {\n childNode = childNode.componentInstance._vnode;\n if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {\n extend(res, styleData);\n }\n }\n }\n\n if (styleData = normalizeStyleData(vnode.data)) {\n extend(res, styleData);\n }\n\n var parentNode = vnode;\n while (parentNode = parentNode.parent) {\n if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {\n extend(res, styleData);\n }\n }\n return res;\n }", "title": "" }, { "docid": "7d29aeaa5c21e71d2ade6cc8567a4b9b", "score": "0.5096796", "text": "function getStyle(vnode, checkChild) {\n var res = {};\n var styleData;\n\n if (checkChild) {\n var childNode = vnode;\n while (childNode.componentInstance) {\n childNode = childNode.componentInstance._vnode;\n if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {\n extend(res, styleData);\n }\n }\n }\n\n if (styleData = normalizeStyleData(vnode.data)) {\n extend(res, styleData);\n }\n\n var parentNode = vnode;\n while (parentNode = parentNode.parent) {\n if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {\n extend(res, styleData);\n }\n }\n return res;\n }", "title": "" }, { "docid": "9a2dfbcbdacfc38b824687bf3ff9ad8d", "score": "0.50956917", "text": "function addStyle(Component){for(var _len2=arguments.length,styleVariant=Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){styleVariant[_key2-1]=arguments[_key2];}bsStyles(styleVariant,Component);}", "title": "" }, { "docid": "aff2a1977e7c42afbde2ef7d05260ebb", "score": "0.50942606", "text": "render () {\n console.error('child class must override render method')\n }", "title": "" }, { "docid": "4293849314b8402fee76882161b5ac28", "score": "0.5088287", "text": "function setParentHeight(el) {\n var height = el.clientHeight - 4; //to hide white borders from rounding\n\n el.parentElement.style.height = height + 'px';\n }", "title": "" }, { "docid": "ac510e0acdc35aede6a9bbad9cc18a96", "score": "0.50784093", "text": "initialize(){super.initialize();this.renderRoot=this.createRenderRoot();// Note, if renderRoot is not a shadowRoot, styles would/could apply to the\n// element's getRootNode(). While this could be done, we're choosing not to\n// support this now since it would require different logic around de-duping.\nif(window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot){this.adoptStyles()}}", "title": "" }, { "docid": "ac510e0acdc35aede6a9bbad9cc18a96", "score": "0.50784093", "text": "initialize(){super.initialize();this.renderRoot=this.createRenderRoot();// Note, if renderRoot is not a shadowRoot, styles would/could apply to the\n// element's getRootNode(). While this could be done, we're choosing not to\n// support this now since it would require different logic around de-duping.\nif(window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot){this.adoptStyles()}}", "title": "" }, { "docid": "afc202dc2f52a3d237918c6ae4661421", "score": "0.507546", "text": "function useStyleApplicator(ref) {\n /* must pass in React.useRef object */\n const setStyles = (style) => {\n Object.keys(style).forEach((key) => {\n if (ref.current) ref.current.style[key] = style[key]\n })\n }\n return setStyles\n}", "title": "" }, { "docid": "6c2528fff8ead32d61cb6d40ed6e7779", "score": "0.5075335", "text": "function getStyle (vnode, checkChild) {\n var res = {};\n var styleData;\n\n if (checkChild) {\n var childNode = vnode;\n while (childNode.componentInstance) {\n childNode = childNode.componentInstance._vnode;\n if (\n childNode && childNode.data &&\n (styleData = normalizeStyleData(childNode.data))\n ) {\n extend(res, styleData);\n }\n }\n }\n\n if ((styleData = normalizeStyleData(vnode.data))) {\n extend(res, styleData);\n }\n\n var parentNode = vnode;\n while ((parentNode = parentNode.parent)) {\n if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {\n extend(res, styleData);\n }\n }\n return res\n }", "title": "" }, { "docid": "6c2528fff8ead32d61cb6d40ed6e7779", "score": "0.5075335", "text": "function getStyle (vnode, checkChild) {\n var res = {};\n var styleData;\n\n if (checkChild) {\n var childNode = vnode;\n while (childNode.componentInstance) {\n childNode = childNode.componentInstance._vnode;\n if (\n childNode && childNode.data &&\n (styleData = normalizeStyleData(childNode.data))\n ) {\n extend(res, styleData);\n }\n }\n }\n\n if ((styleData = normalizeStyleData(vnode.data))) {\n extend(res, styleData);\n }\n\n var parentNode = vnode;\n while ((parentNode = parentNode.parent)) {\n if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {\n extend(res, styleData);\n }\n }\n return res\n }", "title": "" } ]
1f9d1a2654dac6017fd775e7c1e81069
Start function to generate password
[ { "docid": "65b64bbd2e052fc5b75331724d8bcdc1", "score": "0.0", "text": "function generatePassword() {\r\n // asks for value\r\n enter = parseInt(prompt(\"How many characters would you like your password? Choose between 8 and 128\"));\r\n // first input vaule\r\n if (!enter) {\r\n alert(\"This needs a value\");\r\n } else if (enter < 8 || enter > 128) {\r\n \r\n // Start user input prompts\r\n enter = parseInt(prompt(\"You must choose between 8 and 128\"));\r\n\r\n } else {\r\n // Continues after all questions are answered\r\n confirmNumber = confirm(\"Will this contain numbers?\");\r\n confirmCharacter = confirm(\"Will this contain special characters?\");\r\n confirmUppercase = confirm(\"Will this contain Uppercase letters?\");\r\n confirmLowercase = confirm(\"Will this contain Lowercase letters?\");\r\n };\r\n\r\n // Else if for 4 negative options\r\n if (!confirmCharacter && !confirmNumber && !confirmUppercase && !confirmLowercase) {\r\n choices = alert(\"You must choose a criteria!\");\r\n\r\n }\r\n //first statement and and if statement for 4 options\r\n else if (confirmCharacter && confirmNumber && confirmUppercase && confirmLowercase) {\r\n\r\n choices = character.concat(number, alpha, alpha2);\r\n }\r\n // else if for 3 options\r\n else if (confirmCharacter && confirmNumber && confirmUppercase) {\r\n choices = character.concat(number, alpha2);\r\n }\r\n else if (confirmCharacter && confirmNumber && confirmLowercase) {\r\n choices = character.concat(number, alpha);\r\n }\r\n else if (confirmCharacter && confirmLowercase && confirmUppercase) {\r\n choices = character.concat(alpha, alpha2);\r\n }\r\n else if (confirmNumber && confirmLowercase && confirmUppercase) {\r\n choices = number.concat(alpha, alpha2);\r\n }\r\n // Else if for position options\r\n else if (confirmCharacter && confirmNumber) {\r\n choices = character.concat(number);\r\n\r\n } else if (confirmCharacter && confirmLowercase) {\r\n choices = character.concat(alpha);\r\n\r\n } else if (confirmCharacter && confirmUppercase) {\r\n choices = character.concat(alpha2);\r\n }\r\n else if (confirmLowercase && confirmNumber) {\r\n choices = alpha.concat(number);\r\n\r\n } else if (confirmLowercase && confirmUppercase) {\r\n choices = alpha.concat(alpha2);\r\n\r\n } else if (confirmNumber && confirmUppercase) {\r\n choices = number.concat(alpha2);\r\n }\r\n\r\n else if (confirmCharacter) {\r\n choices = character;\r\n }\r\n else if (confirmNumber) {\r\n choices = number;\r\n }\r\n else if (confirmLowercase) {\r\n choices = alpha;\r\n }\r\n // for all uppercase conversions\r\n else if (confirmUppercase) {\r\n choices = space.concat(alpha2);\r\n };\r\n\r\n // Random selection for all variables: \r\n for (var i = 0; i < enter; i++) {\r\n var pickChoices = choices[Math.floor(Math.random() * choices.length)];\r\n password.push(pickChoices);\r\n }\r\n // This joins the password array and converts it to a string\r\n var ps = password.join(\"\");\r\n UserInput(ps);\r\n return ps;\r\n}", "title": "" } ]
[ { "docid": "d4a4da74bc8ca78d921377832fa40033", "score": "0.7960202", "text": "function generatePassword() {\n \n getLength();\n var password = generator(passwordLength);\n displayPassword(password);\n}", "title": "" }, { "docid": "f582e796c84c0d798615272b9f259fbc", "score": "0.78990203", "text": "function generatePassword(){\n\n}", "title": "" }, { "docid": "3062689b589ee17cb87151e14696ab99", "score": "0.77125776", "text": "function generate() {\n password = \"\";\n for (let i = 0; i < pswLength; i++) {\n password += char[Math.floor(Math.random() * char.length)];\n }\n\n passwordText.textContent = password;\n }", "title": "" }, { "docid": "bd028292080ac611669cfbcd303e9432", "score": "0.76519567", "text": "function writePassword() {\n generatePassword();\n\n}", "title": "" }, { "docid": "6a8dfe275d4503c715e727e190e476b9", "score": "0.7559716", "text": "function generate()\r\n\t{\r\n\t\tvar string = '';\r\n\t\t// Loop over length of requested password\r\n\t\tfor(i=0;i<inputLengthObj.val();i++)\r\n\t\t{\r\n\t\t\t// Randomly select either alpha/numeric/symbol\r\n\t\t\tswitch(randNum(3))\r\n\t\t\t{\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\t// Numeric\r\n\t\t\t\t\tif(numericFlag.is(':checked'))\r\n\t\t\t\t\t\tstring += randNum(9);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\t// Alpha\r\n\t\t\t\t\tswitch(randNum(2))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t\t// Uppercase\r\n\t\t\t\t\t\t\tif(uppercaseFlag.is(':checked'))\r\n\t\t\t\t\t\t\t\tstring += lowercaseChars.charAt(randNum(lowercaseChars.length)-1).toUpperCase();\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\ti--;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\t\t// Lowercase\r\n\t\t\t\t\t\t\tstring += lowercaseChars.charAt(randNum(lowercaseChars.length)-1);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\t// Symbol\r\n\t\t\t\t\tif(symbolFlag.is(':checked'))\r\n\t\t\t\t\t\tstring += symbolChars.charAt(randNum(symbolChars.length)-1);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\t\r\n\t\tnewPassObj.text(string);\t\r\n\t}", "title": "" }, { "docid": "1fe6f65cbc2fe416284630384f36b083", "score": "0.75590056", "text": "function generatePasswordAlgorithm() {\n\n\n //Step 3 receive user input\n promptUser();\n //Step 4 generate password\n password = generatePassword(passwordLength, requiresCapitals, requiresSpecialChars, requiresNumbers);\n //Step 5 display password to user \n writePassword(password);\n\n}", "title": "" }, { "docid": "310fc0518c630f791f230c1daf246bc4", "score": "0.75534296", "text": "function generatePassword() {\n var pass = createRandomPassword();\n _dom.mainInput.value = pass;\n if (_dom.clearInput) {\n _dom.clearInput.value = pass;\n }\n triggerEvent(\"generated\", pass);\n toggleMasking(false);\n\n if (_validateTimer) {\n clearTimeout(_validateTimer);\n _validateTimer = null;\n }\n validatePassword();\n\n if (_dom.placeholder) {\n _dom.placeholder.style.display = \"none\";\n }\n }", "title": "" }, { "docid": "0f912057e31f218010d2bb73c184443d", "score": "0.7551427", "text": "function generatePassword() {\n checkPasswordParameters();\n if (requirementsMet) {\n generateRandomCharacter();\n displayPassword(password);\n }\n password = \"\";\n}", "title": "" }, { "docid": "64cbcec090a5519cfffbd5be888ea6b1", "score": "0.75148106", "text": "function generator() {\n\n var passwordLength = slideEl.value - 1;\n\n var characters = \"QWERTYUIOPLKJHGFDSAZXCVBNMqwertyuioplkjhgfdsazxcvbnm1234567890*&?%#@!\";\n \n var password = \"\";\n \n for (var i = 0; i<= passwordLength; i++) {\n password = password + characters.charAt(Math.floor(Math.random() * Math.floor(characters.length - 1)));\n }\n \n inputBoxEl.value = password;\n}", "title": "" }, { "docid": "5a917eb22b36473cbd0ae2dbce22c204", "score": "0.7514798", "text": "function passwordGenerator (){\n if (chooseLowercase) {\n passwordString = passwordString + passwordLowerLetters;\n }\n if (chooseUppercase) {\n passwordString = passwordString + passwordUpperLetters;\n } \n if (chooseNumbers) {\n passwordString = passwordString + passwordNumbers;\n }\n if (chooseSpecialCharacters) {\n passwordString = passwordString + passwordSpecialCharacters;\n }\n for (let i = 0; i < passwordLength; i++) {\n generatePassword += passwordString.charAt(Math.floor(Math.random() * passwordString.length));\n };\n// Add password to the screen\n writePassword();\n}", "title": "" }, { "docid": "c1c282e390438350e9a20e8077117408", "score": "0.74559885", "text": "function generatePassword() {\n var charset = generatePwdCharset();\n\n var pwd = \"\";\n for (var i = 0; i < builder.pwdLength; i++) {\n pwd += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n document.getElementById(\"password\").innerHTML = pwd;\n}", "title": "" }, { "docid": "12a513a0ad4ad9c56890d24e8af29cc7", "score": "0.74541986", "text": "function generatePassword(passwordLength,lowerCase, upperCase, numUse, symbolUse){\n var passwordNew=\"\";\n for (var i = 0; i < passwordLength; i++) {\n passwordNew += randomCharGenerator(lowerCase, upperCase, numUse, symbolUse);\n }\n password.passwordGen=passwordNew;\n}", "title": "" }, { "docid": "8de0f76218e3cd3d6f9aa26f2593177c", "score": "0.73993486", "text": "function generatePassword() {\n while (passwordLength > buildLength) {\n passBlock();\n // if (passwordLength - buildLength < maxOfMin) {\n // charLeft = passwordLength - buildLength;\n\n // for (var j = 0; j <= charLeft; j++) {\n // addRanChar;\n // }\n // passwordBuild = passwordBuild + addChar;\n // }\n // else {\n // passwordBuild = passwordBuild + passwordBlock;\n // }\n passwordBuild = passwordBuild + passwordBlock;\n }\n}", "title": "" }, { "docid": "456354979eee97cc665898e68136d234", "score": "0.73778445", "text": "function simpleGenerator(pwdlength) {\n var Password = '';\n for (i = 0; i < pwdlength; i++) {\n var temp = weak[Math.floor(Math.random() * weak.length)];\n Password = Password + temp;\n }\n document.getElementById(\"password\").value = Password;\n}", "title": "" }, { "docid": "1b9144d1bdcfc03b433c3915cdd59691", "score": "0.73046863", "text": "function generatePassword() {\n var newPW = generator.generate({ length: 6, numbers: true })\n return newPW;\n}", "title": "" }, { "docid": "07a193558e3312e4afc0c8f9774ff1d2", "score": "0.72814107", "text": "GeneratorPassword() {\n var passwordLength = 8;\n var uppercase = false;\n var lowercase = false;\n var numbers = false;\n var specialchars = false;\n if ($('input[name=\"password-length\"]').val() > 0 && $('input[name=\"password-length\"]').val() <= 100) {\n passwordLength = $('input[name=\"password-length\"]').val();\n }\n if ($('input[name=\"uppercase\"]').is(':checked')) {\n uppercase = true;\n }\n if ($('input[name=\"lowercase\"]').is(':checked')) {\n lowercase = true;\n }\n if ($('input[name=\"numbers\"]').is(':checked')) {\n numbers = true;\n }\n if ($('input[name=\"specialchars\"]').is(':checked')) {\n specialchars = true;\n }\n\n let newPassword = $.pGenerator({\n 'passwordLength': passwordLength,\n 'uppercase': uppercase,\n 'lowercase': lowercase,\n 'numbers': numbers,\n 'specialChars': specialchars\n });\n // update password\n this.set('passwordDecrypted', newPassword);\n this.send('setPassword', false);\n }", "title": "" }, { "docid": "01d6ab3e5f47b1d33a51bbd6d1c2ecb6", "score": "0.726836", "text": "function generatePassword() {\n var lengthEl = prompt(\"Please select the desired password length using number between a 8 and 128.\");\n var length = parseInt(lengthEl);\n if(length < 8 || length > 128 || !length) {\n alert(\"Sorry you need to select a number between 8 and 128 Characters.\")\n \n } \n\n // Asks user if they want to use lowercase letters\n var lowerCaseEl = confirm(\"Will you need to have lower case characters in your password?\");\n var lowercase = lowerCaseEl;\n if(lowerCaseEl) { \n masterPassword += lowerCaseArr.slice(0,8); \n // console.log(lowercase)\n } \n \n // Asks user if they want to use uppercase letters\n var upperCaseEl = confirm(\"Will you need to have upper case characters in your password?\");\n var uppercase = upperCaseEl;\n if(upperCaseEl) { \n masterPassword += upperCaseArr.slice(0,8);; \n // console.log(upperCaseEl);\n }\n \n // Asks user if they want to use a symbol\n var symbolEl = confirm(\"Will you need to have any special characters in your password?\");\n var symbol = symbolEl;\n if(symbolEl) { \n masterPassword += symbolArr.slice(0,8); \n // console.log(symbol);\n\n }\n \n // Asks user if they want to a number\n var numberEl = confirm(\"Will your password require any numbers?\");\n var number = numberEl;\n if(numberEl) { \n masterPassword += numberArr.slice(0,8); \n // console.log(number)\n }\n // User must select at least 1 character option or the generate function will be called again\n if (!lowerCaseEl && !upperCaseEl && !numberEl && !symbolEl) {\n alert(\"Please select either lower, uppercase, numbers or special characters to create your password.\") \n };\n \n resultEl = newPassword(length, masterPassword);\n}", "title": "" }, { "docid": "ad0769c30741705dc761135b0300995e", "score": "0.7234643", "text": "function generatePassword() {\n for (var m = 0; m < charAmount; m++) {\n randomPass = randomArray[Math.floor(Math.random(m) * randomArray.length)];\n writePassword();\n }\n}", "title": "" }, { "docid": "4414b9f3b8368add13c78d47ad949b40", "score": "0.7218945", "text": "function generatePassword() {\r\n var userResponse = passwordPrompt();\r\n var password = passwordCreate(userResponse);\r\n return password;\r\n}", "title": "" }, { "docid": "e55c8cdcfee5aca839e7f835db90085e", "score": "0.7216649", "text": "function generatePassword() {\n //setting options equal to an empty object\n var options = {};\n\n //prompting the user to input desired password length.\n //using the parseInt function to turn any input that isn't a number to a number.\n options.length = parseInt(\n prompt(\n \"How many characters from 8 - 128 would you like for your password to be?\"\n )\n );\n\n //Logic for the min/max char parameters\n if (options.length < 8 || options.length > 128) {\n alert(\n \"Please input between 8 and 128 characters for the generator to process your password request.\"\n );\n return \"Invalid parameters\";\n }\n //prompting the user for the character-inclusive options in the form of confirms\n //going into the options object...\n options.special = confirm(\n \"Would you like for your password to include special characters?\"\n );\n options.numbers = confirm(\n \"Would you like for your password to include numbers?\"\n );\n options.upperCase = confirm(\n \"Would you like for your password to include upper-cased characters?\"\n );\n options.lowerCase = confirm(\n \"Would you like for your password to include lower-cased characters?\"\n );\n\n // this is the empty var that will hold the password ultimately\n var password = \"\";\n //logic in the form of a for loop\n for (var i = 0; i < options.length; i++) {\n if (options.special) {\n password += getRand (specialCharacters);\n }\n if (options.lowerCase) {\n password += getRand(numbers);\n }\n if (options.lowerCase) {\n password += getRand(lowerCasedCharacters);\n }\n if (options.upperCase) {\n password += getRand(upperCasedCharacters);\n }\n }\n //Displays the characters inline next to the others in the password\n return password.substring(0, options.length);\n}", "title": "" }, { "docid": "ac1ef6446f2bd1d070f6ce094bab5f25", "score": "0.72095716", "text": "function generate(){\n var i;\n var passStr = \"\";\n for (i = 0; i < passLengthInt; i++) {\n var randomChar = bigArray[Math.floor(Math.random()*bigArray.length)];\n passChar = randomChar;\n passStr += passChar;\n };\n document.getElementById('password').value = passStr;\n alert(\"Please copy your password from the textbox below. Refresh to generate a new one!\")\n }", "title": "" }, { "docid": "de597c072b3b1ec497fe05e68130deea", "score": "0.7167766", "text": "function generatePassword() {\n // Initialises the password length\n var passLength = 0;\n\n // Ensures the password length is between the limits\n while (passLength < 8 || passLength > 128)\n {\n passLength = prompt(\"Password length: (Between 8 and 128 characters)\");\n }\n\n // Sets the user preferences\n var uppercase = confirm(\"Include UPPERCASE characters?\");\n var lowercase = confirm(\"Include lowercase characters?\");\n var special = confirm(\"Include special characters?\");\n var numeric = confirm(\"Include numeric characters?\");\n\n // Initialises the pool of characters\n var characterPool = [];\n\n // Add uppercase characters to the potential character pool\n if (uppercase) {\n characterPool.push(...getStandardCharacters(codes.uppercase));\n }\n\n // Add lowercase characters to the potential character pool\n if (lowercase) {\n characterPool.push(...getStandardCharacters(codes.lowercase));\n }\n\n // Add numeric characters to the potential character pool\n if (numeric) {\n characterPool.push(...getStandardCharacters(codes.numeric));\n }\n \n // Add special characters to the potential character pool\n if (special) {\n var specialChars = getSpecialCharacters();\n \n characterPool.push(...specialChars);\n }\n\n var password = \"\";\n\n if (characterPool.length > 0)\n {\n for (var i = 0; i < passLength; i++) {\n password += characterPool[Math.floor(Math.random() * characterPool.length)];\n }\n } else {\n password = \"I can't make a password without any characters\";\n }\n\n return password;\n}", "title": "" }, { "docid": "96ed73f3df809c5aad608888dce348ec", "score": "0.7163736", "text": "function writePassword() {\n var password = generatePassword();\n}", "title": "" }, { "docid": "ea63a0a522d4572c725c9f1d06c6c622", "score": "0.7160049", "text": "function passwordGenerator() {\n var password = generatePassword();\n\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "7dea9fff6777b79ee7baa2785fbac2d3", "score": "0.7152214", "text": "function generatePassword(){\n //1) Question: Ask how for the length of the password. Password >= 8 && Password <= 128;\n chooseLength();\n\n \n //2) Question: Ask to include lowercase;\n chooseLowercase();\n \n //3) Question: Ask to include uppercase;\n chooseUppercase();\n\n //4) Question: Ask to include numbers;\n chooseNumber();\n\n\n //5) Question: ask to include Special Characters;\n chooseSpecial();\n\n //generate the password\n return createPassword();\n\n }", "title": "" }, { "docid": "4447fce91220d973d46465bbaf5f7a9c", "score": "0.7141172", "text": "function generatePassword(characterCatcher, pwLength) {\n\n var password = \"\"\n for (var i = 0; i < pwLength; i++) {\n password += characterCatcher[Math.floor(Math.random() * characterCatcher.length)]\n }\n \n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "8f32ad97e34b7e176d94729ad46a067a", "score": "0.7133818", "text": "function generate() {\n var onlyUpperCase = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];\n var onlyLowerCase = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];\n var onlySpecialChar = ['!','@','#','$','%','&','*','=','-','+'];\n var onlyNumeric = [0,1,2,3,4,5,6,7,8,9];\n var password = generatePassword();\n var passwordText = document.getElementById(\"password\");\n\n passwordText.value = superDuperFinalPassword;\n}", "title": "" }, { "docid": "546959d61edd99e066125f18d7c44d65", "score": "0.7106427", "text": "function generatePassword(){\n var newPWstr = newPassWd.join(\"\");\n \n var password = \"\";\n \n for (var i = 0; i < length; i++) {\n var genChr = newPWstr.charAt(Math.floor(Math.random() * newPWstr.length));\n password = password.concat(genChr);\n }\n}", "title": "" }, { "docid": "3bda0bdc5f23ab31f648b00da20036fa", "score": "0.7103722", "text": "function generatePassword() {\n\tvar numChars = prompt(\n\t\t'How many characters would you like in your password (Enter a value between 8 and 128)'\n\t);\n\t// allow user to cancel\n\tif (numChars === null) return;\n\n\t// coerce NaN if input is a text string that cannot be coerced to a number\n\tnumChars = parseInt(numChars);\n\n\t// validate input\n\twhile (isNaN(numChars) || numChars < 8 || numChars > 128) {\n\t\tif (numChars === null) return;\n\t\tnumChars = prompt('Invalid entry, please enter a NUMBER between 8 and 128');\n\t}\n\n\tselectChars(numChars);\n}", "title": "" }, { "docid": "b97b2f943630d4702599d98bbb4dc3a9", "score": "0.70771456", "text": "function generatePassword() {\n var password = passwordResult();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "aeb9631837cc9bcb6b44f78c173b9b10", "score": "0.70765203", "text": "function generatePassword(){\n\n //lets user choose how long the password can be\n \n var passwordLength = parseInt(prompt(\"How long would you like your password to be, between 8 and 128?\"));\n \n //checks if passwordLength is a number\n function checkPasswordString(){\n if(isNaN(passwordLength)){\n passwordLength = parseInt(prompt(\"Please choose a NUMBER between 8 and 128.\"));\n checkPasswordString()\n }\n }\n checkPasswordString()\n //checks if passwordLength is between 8-128\n function checkPasswordLength(){\n if(passwordLength < 8 || passwordLength > 128){\n passwordLength = prompt(\"Make sure the number you choose is between 8 and 128.\")\n checkPasswordLength()\n }\n \n }\n checkPasswordLength()\n\n //Characters that password can use to be created\n var passwordOptions = {\n //base alphabet\n alphabet: \"abcdefghijklmnopqrstuvwxyz\",\n //with capitals\n alphabetCapital: \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n //with numbers\n alphabetNumbers: \"0123456789\",\n //with symbols\n alphabetSymbols: \"\\\"\\\\ !#$%&'()*+,-./:;<=>?@[]^_`{|}~\" \n }\n var selection = selectionHasOne();\n //password parameters\n function selectionHasOne(){\n selection = \"\"\n if(confirm(\"Do you want you password to contain lowercase letters?\")){\n selection += passwordOptions.alphabet\n }\n if(confirm(\"Do you want your password to contain capital letters?\")){\n selection += passwordOptions.alphabetCapital\n }\n if(confirm(\"Do you want your password to contain numbers?\")){\n selection += passwordOptions.alphabetNumbers\n }\n if(confirm(\"Do you want your password to contain symbols?\")){\n selection += passwordOptions.alphabetSymbols\n }\n //checks to see if you selected an option\n if(selection === \"\"){\n alert(\"You must select at least one option\");\n selectionHasOne()\n }\n return selection\n }\n var finalPassword = \"\"\n //Loop that adds letters to password\n for(i=1; i<=passwordLength;i++){\n finalPassword += selection.charAt(Math.floor(Math.random()*selection.length))\n }\n \n \n return finalPassword;\n }", "title": "" }, { "docid": "830f282461f1b18a9ae6354346f292b5", "score": "0.70763695", "text": "function generatePassword () {\n\n\tvar password = \"\";\n\tvar chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()-+<>1234567890\";\n\tfor (var i = 0; i < 8; i++) {\n\t\tpassword += chars.charAt(Math.floor(Math.random() * chars.length));\n\t}\n\treturn password;\n\n}// end generatePassword()", "title": "" }, { "docid": "c95998448a254c934070a3179fdcc2fe", "score": "0.70714295", "text": "function generateNewPassword() {\n var password = \"\";\n// these are the charaters that are allowed along with the random generator Rando.js\n var allowed = {};\n if (uppers) password += rando(allowed.uppers = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\");\n if (lowers) password += rando(allowed.lowers = \"abcdefghijklmnopqrstuvwxyz\");\n if (numbers) password += rando(allowed.numbers = \"1234567890\");\n if (symbols) password += rando(allowed.symbols = \"!@#$%^&*(){}[]=<>/,.?\");\n\n for (var i = password.length; i < length; i++) password += rando(rando(allowed).value);\n\n document.getElementById(\"password\").value = randoSequence(password).join(\"\");\n}", "title": "" }, { "docid": "d771c5885e5f689310ef3ca89e0f12ef", "score": "0.70710874", "text": "function generate() {\n var goodLen = '';\n //confirms a number between 8 and 128 long\n while (isNaN(goodLen) || goodLen < 8 || goodLen > 128) {\n goodLen = prompt(\"Please choose a number between 8 to 128 to determine character length:\");\n if (goodLen === null) {\n continue;\n }\n }\n//Prompt for the next set of criteria after length is entered\n if (goodLen) {\n if (confirm(\"Would you like to use lowercase characters?\") == true) {\n badLow = true\n } \n if (confirm(\"Or uppercase characters?\") == true) {\n badUp = true\n }\n if (confirm(\"How about numerical characters?\") == true) {\n badNum = true\n }\n if (confirm(\"Lastly, would you like to use special characters?\") == true) {\n badSpc = true\n }\n }\n//generate random password\n var characters = '';\n characters += (badLow ? lwrCase : '');\n characters += (badUp ? uppCase : '');\n characters += (badNum ? numChar : '');\n characters += (badSpc ? spcChar : '');\n\n genPswd = password(goodLen, characters);\n\n document.getElementById(\"password\").innerHTML = genPswd;\n\n}", "title": "" }, { "docid": "e4b4e5337f1c127bb5313b001bfe8b94", "score": "0.70433986", "text": "function generatePassword(){\n //Prompt to collect length of password used in Generation Section\n let checkLength = prompt('Please select the desired length of your password. (Between 8 and 128 characters)')\n //If selection isnt between required parameters restarts function\n while(checkLength <= 7 || checkLength >= 129 || isNaN(checkLength)) {\n alert('Password length out of paramters. Defaulting to a length of 12')\n checkLength = 12\n }\n //Collects user's choice of character types to be used in generation\n let upperCheck = confirm('Would you like to use upper case letters in this password?')\n let lowercheck = confirm('Would you like to use lower case letters in this password?')\n let numCheck = confirm('Would you like to use numbers in this password?')\n let symCheck = confirm('Would you like to use symbols in this password?')\n //Checks if at least one choice was made. If password cannot generate will restart function\n while(upperCheck === false && lowercheck === false && numCheck === false && symCheck === false) {\n alert('No values were selected. Defaulting to all character types')\n upperCheck = true;\n lowercheck = true;\n numCheck = true;\n symCheck = true;\n }\n //Concats each string with passwordChar if character type was confirmed\n let passwordChar = [];\n \n if (upperCheck) {\n passwordChar = passwordChar.concat(arrayOfAlphaUpper)\n }\n if (lowercheck) {\n passwordChar = passwordChar.concat(arrayOfAlphaLower)\n }\n if (numCheck) {\n passwordChar = passwordChar.concat(arrayOfNums)\n }\n if (symCheck) {\n passwordChar = passwordChar.concat(arrayOfSym)\n }\n \n let randomizedPassword = ''\n //Generates password with above information based on length chosen in first section of generatePassword Function\n for(i = 0; i < checkLength; i++) {\n randomizedPassword = randomizedPassword + passwordChar[Math.floor(Math.random() * passwordChar.length)]\n } //returns completed password for use in writePassword function.\n return randomizedPassword\n}", "title": "" }, { "docid": "50a6ebf64d21b3f3505d35fa6e95e51c", "score": "0.7039568", "text": "function generatePassword() {\n \n var password_length = window.prompt(\"How long would you like your password to be? Please pick a number between 8 and 128.\");\n password_length = parseInt(password_length);\n\n if (password_length >= 8 && password_length <= 128) {\n password_content = fillContent();\n var passwordFinished = []\n\n for (i = 0; i < password_length; i++) {\n\n passwordFinished[i] = password_content[Math.floor(Math.random() * password_content.length)]\n }\n\n passwordFinished = passwordFinished.join(\"\");\n\n return passwordFinished\n } else {\n return generatePassword();\n }\n\n}", "title": "" }, { "docid": "8164be36111a47f057853e045edf1a73", "score": "0.70377827", "text": "function generatePasswordEasy() {\r\n var retorno = 'password';\r\n var letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'];\r\n retorno = letters[returnRand()].toUpperCase() + letters[returnRand()] + letters[returnRand()] +\r\n returnRand() + returnRand() + returnRand();\r\n return retorno;\r\n}", "title": "" }, { "docid": "423ed9ff13759335e1bae708e4978b5d", "score": "0.7028701", "text": "function generatePassword(lowercase, uppercase, number, special, length) {\n for (var i = 0; i < length; i++) {\n password += passGen(lowercase, uppercase, number, special);\n }\n}", "title": "" }, { "docid": "dea389568bf973098454c2053fb15481", "score": "0.702653", "text": "function generatePassword() {\n let password = \"\";\n \n //saving an array of desired characters as a string array\n var criteriaString = wantLower() + wantSymbols() + wantUpper() + wantNumbers();\n\n // saving desired password length (integer)\n var pwCount = getLength();\n\n //for loop that'll randomly pick characters from the criteria string array length-of-password times.\n for(i=0; i<pwCount; i++){\n password += randomPassword(criteriaString)\n }\n // returns final generated password.\n return password;\n}", "title": "" }, { "docid": "fe4d2758ffa92486443d34f2b31b465a", "score": "0.70253617", "text": "function writePassword() {\n console.log(\"generate\");\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "title": "" }, { "docid": "9d2ff9e7f19e8a6f68af37639d1023a5", "score": "0.7022524", "text": "function generatePassword(){\n lengthCondition();\n var pswrd = '';\n for( i = 0; i < length; i++ ){\n pswrd += charset[parseInt(Math.random() * charset.length)];\n }\n charset = '';\n return pswrd;\n}", "title": "" }, { "docid": "c11a7810518eb8d4fbcdcbf0b406335d", "score": "0.70060694", "text": "function generate(num) {\n // Criteria options\n var lowercase = \"abcdefghijklmnopqrstuvwxyz\";\n var uppercase = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n var specialChar = \"!@#$%^&*()-_=+;:',<.>/?\";\n var intergers = \"0123456789\";\n var all = \"\"\n if (upper) {\n all = all + uppercase\n } \n \n if (lower) {\n all = all + lowercase\n }\n\n if (special) {\n all = all + specialChar\n }\n\n if (numbers) {\n all += intergers\n }\n\n // Variable that is set when user hits the generate button\n var pass = \"\";\n\n // For loop to build the password\n for (var i = 0; i < num; i++) {\n var character = Math.floor(Math.random() * all.length);\n pass += all.substring(character, character +1);\n console.log(character);\n }\n \n console.log(all);\n console.log(pass);\n\n // Changes the value of passwordText to whatever password is generated\n passwordText.value = pass;\n}", "title": "" }, { "docid": "d1d949107be2698a0281ecbd158faa0a", "score": "0.700512", "text": "function randomPasswordGenerator(){cov_56x3pjfvl.f[0]++;cov_56x3pjfvl.s[9]++;return Math.random(0,2).toString(36).substring(2,10);}", "title": "" }, { "docid": "3f94964e9ac7312ddeaba561d4a5593a", "score": "0.70006174", "text": "function generatePassword(){\n var chars = \"0123456789abcdefghijklmnopqrstuvwxyz!@#$%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n // var passwordLength = 12;\n\n\n passwordLength = passLength.value\n\n var password = \"\"\n\n for(var i=0; i<=passwordLength; i++){\n var randomNumber = Math.floor(Math.random() * chars.length)\n // password += chars.substring(randomNumber, randomNumber + 1)\n password += chars.charAt(randomNumber)\n }\n document.getElementById(\"password\").value = password;\n}", "title": "" }, { "docid": "d0ede1fcc64282ee3c79f3eb20f2ffe4", "score": "0.69999367", "text": "function generatePassword() {\n\n let text = \"\";\n \n for (i=0; i<passLength; i++) {\n text += passChar[Math.floor(\n Math.random() * passChar.length\n )\n ]\n }\n\n return text; \n \n }", "title": "" }, { "docid": "b127e5d2ea418d6491eead79dab8dbd3", "score": "0.6989356", "text": "function writePassword() {\n var genP = '';\n //Makes a variable of an empty string\n for (var i = pwrdLength; i > 0; i--) {\n //Runs as many times as the user selected\n genP +=\n userCharacters[Math.floor(Math.random() * userCharacters.length)];\n }\n console.log(genP);\n var password = genP;\n var passwordText = document.querySelector(\"#password\");\n//This creates a variable passwordText that is the first element of password id (\"Your secure password\")\n passwordText.value = password;\n //This changes the value of a text field from what it was before to password \n}", "title": "" }, { "docid": "f229a6a467cb4415bcdf78bef397d869", "score": "0.69827396", "text": "function createPassword(){\nmakePassword()\nreturn createdPassword\n}", "title": "" }, { "docid": "834a92e7aed8847a972c4fc9316dc43b", "score": "0.69771034", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n //variables re-set to make the generator re-usable\n passwordLength = 0;\n lowerCase = false;\n upperCase = false;\n number = false;\n specialCharacter = false;\n concatenatedArray = [];\n passwordArray = [];\n}", "title": "" }, { "docid": "f70846c7fa3d1d5b942b5cea5c38e866", "score": "0.6962125", "text": "function generatePassword() {\n // Set requirements based on page input values\n var requirements = {};\n requirements['pass-length'] = $('#password-generator .pass-length').val();\n requirements['alpha-lower'] = $('#password-generator .alpha-lower').is(':checked') ? true : false;\n requirements['alpha-upper'] = $('#password-generator .alpha-upper').is(':checked') ? true : false;\n requirements['numbers'] = $('#password-generator .numbers').is(':checked') ? true : false;\n requirements['symbols'] = $('#password-generator .symbols').is(':checked') ? true : false;\n requirements['spaces'] = $('#password-generator .spaces').is(':checked') ? true : false;\n requirements['similar'] = $('#password-generator .similar').is(':checked') ? true : false;\n\n // Build pool of valid characters\n var characterPool = '';\n if (requirements['alpha-lower'])\n characterPool += alphaLower;\n if (requirements['alpha-upper'])\n characterPool += alphaUpper;\n if (requirements['numbers'])\n characterPool += numbers;\n if (requirements['symbols'])\n characterPool += symbols;\n if (requirements['spaces'])\n characterPool += spaces;\n if (!requirements['similar'])\n characterPool = characterPool.replace(/[0O1IlB8\\|]/g,'');\n \n // Generate and return password\n var password = '';\n for (var i = 0; i < requirements['pass-length']; i++)\n password += characterPool.charAt(Math.floor(Math.random() * characterPool.length));\n\n return password;\n }", "title": "" }, { "docid": "1d7add16d3a43b0346a55cacbeced784", "score": "0.69611686", "text": "function generatePassword() {\n var randPass = password_generator(6);\n $(\"#password\").val(randPass).focus();\n}", "title": "" }, { "docid": "dc2dff5d6b9496ca76a4db23cb88ad18", "score": "0.69599074", "text": "function generatePassword() {\n\n // Get user input for pwd length\n // If input is not a number or not in range, reprompt user until input is ok\n var passwordLength = prompt(\"How long for your password? Enter number between 8 and 128 please.\");\n while (isNaN(passwordLength) || (passwordLength < 8 || passwordLength > 128)) {\n passwordLength = prompt(\"Please enter a length between 8 and 128!\");\n }\n\n // Confirm user's preferences for the following to include:\n // 1/ lower case letters (yes/no)\n // 2/ upper case letters (yes/no)\n // 3/ numbers (yes/no)\n // 4/ special characters (yes/no)\n var useLowerCase = confirm(\"Include lower case letters? Click OK if yes.\");\n var useUpperCase = confirm(\"Include upper case letters? Click OK if yes.\");\n var useNumbers = confirm(\"Include numbers? Click OK if yes.\");\n var useSpecialChars = confirm(\"Include special characters? Click OK if yes.\");\n\n // If user chooses none of the character types, alert them no character types were chosen and end.\n if (!useLowerCase && !useUpperCase && !useNumbers && !useSpecialChars) {\n alert(\"You have chosen no character types. Please try again.\")\n return pwd.toString;\n }\n\n // create password of length passwordLength using above criteria\n var pwd = \"\";\n while(pwd.length < passwordLength) {\n\n if(useLowerCase && pwd.length < passwordLength) {\n pwd = pwd + lowerCaseLetters[randomNumber(lowerCaseLetters)];\n }\n\n if(useUpperCase && pwd.length < passwordLength) {\n pwd = pwd + upperCaseLetters[randomNumber(upperCaseLetters)];\n }\n\n if(useNumbers && pwd.length < passwordLength) {\n pwd = pwd + numbers[randomNumber(numbers)];\n }\n\n if(useSpecialChars && pwd.length < passwordLength) {\n pwd = pwd + specialChars[randomNumber(specialChars)];\n }\n \n }\n\n return pwd.toString();\n}", "title": "" }, { "docid": "3a7e82840425e852798bd75733384f66", "score": "0.6954933", "text": "function generatePassword() {\n var passLength = selectLength();\n var passType = selectType();\n if (passType.every(validType) == true) {\n alert(\"You must include at least one character type!\")\n passType = selectType();\n }\n var chars = [];\n var passCode = [];\n if (passType[0]) {chars = chars.concat(lowercase);}\n if (passType[1]) {chars = chars.concat(uppercase);}\n if (passType[2]) {chars = chars.concat(numeric);}\n if (passType[3]) {chars = chars.concat(symbol);}\n for(i=0; i<passLength; i++) {\n var random = chars[Math.floor(Math.random()*chars.length)]\n passCode.push(String.fromCharCode(random));\n }\n return passCode.join(\"\");\n}", "title": "" }, { "docid": "a6ce3be36a6d0cc7a6fadf06e1ffd342", "score": "0.69537723", "text": "function generatePassword() {\n \n for (let i = 0; i < charLength; i++) {\n passChar = charCode[Math.floor(Math.random() * charCode.length)]\n passArray.push(passChar)\n }\n return passArray.join('')\n \n }", "title": "" }, { "docid": "d34e1c721a76f63acd339e5acc1920c8", "score": "0.69506675", "text": "function generatePassword() {\n let symbolFirst = getSymbol();\n let symbolSecond = getSymbol();\n let nameStr = encryptWord(name.value);\n let finalName = nameStr.slice(0,slider.value-4);\n let pinStr = encryptPin(pin.value);\n defautPssd.innerHTML = finalName + symbolFirst + pinStr + symbolSecond ;\n \n for (var i = 0; i < accounts.length; i++) {\n accounts[i].innerHTML = finalName + symbolAcc(pin.value) + accountsName[i].innerHTML.slice(0,2);\n}\n\n}", "title": "" }, { "docid": "40218cddd31a0aa2f649829abef9efa4", "score": "0.6947185", "text": "function generatePassword(){\n let passwordGenerated;\n\n passwordGenerated = getRandomString(6);\n \n $('#password').val(passwordGenerated);\n $('#repeat-password').val(passwordGenerated);\n $('.send-mail-box').show();\n}", "title": "" }, { "docid": "22f09b1f10c3b21f8a4d598e99618996", "score": "0.69438505", "text": "function generatePassword(){\n\n // sets variable for password and verify meets length criteria\n var passwordlength = Number(prompt(\"Choose password length must be between 8-128 characters\"));\n \n if( passwordlength <8 || passwordlength >128) {\n alert(\"password must be between 8 and 128\");\n location.reload()\n }\n else{\n //start of paramters for special characters\n\n var passwordLowercase = prompt(\"do you want your password to include lowercase yes or no\");\n \n var passwordUppercase = prompt(\"do you want your password to include uppercase yes or no\");\n\n var passwordNumerical = prompt(\"do you want you password to include numbers yes or no\");\n\n var passwordSpecial = prompt(\"do you want your password to include special characters yes or no\");\n\n var Lowercase = \"abcdefghijklmnopqrstuvwxyz\";\n\n var Uppercase = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\n var Numerical = \"0123456789\";\n\n var Special = \" !#$%&'()*+,-./:;<=>[^_`{|}~\";\n\n var allTogether = \"\";\n }\n\n if (passwordLowercase === \"yes\") {\n allTogether += Lowercase;\n }\n if (passwordUppercase === \"yes\") {\n allTogether += Uppercase;\n }\n if (passwordNumerical === \"yes\") {\n allTogether += Numerical;\n }\n if(passwordSpecial === \"yes\") {\n allTogether += Special;\n }\n if(allTogether === \"\") {\n alert(\"password must have at least one critera!\");\n location.reload()\n }\n \n var newpass =\"\";\n\n \n for (var i = 0; i < passwordlength; i++) {\n newpass += allTogether.charAt(Math.floor(Math.random() * allTogether.length));\n }\n return newpass\n \n }", "title": "" }, { "docid": "3b1543d937902b9cb21ad43aff1cb6df", "score": "0.6936503", "text": "function generatePassword() {\n\n //empty variable for password characters\n var pChars = ('');\n //how long the user would want the password\n var pLength = window.prompt('choose how many characters you would like your password to be 10-50')\n // if passowrd is not within limits send prompt \n if (pLength < 10 || pLength > 50) {\n window.alert('please choose adequate length')\n };\n //prompt for symbols\n var symbChars = window.confirm('Include symbols?')\n if (symbChars) {\n pChars += symbChars\n }\n //prompt for numbers\n var numChars = window.confirm('Include numbers?')\n if (numChars) {\n pChars += symbChars\n }\n //lowercase letter prompt\n var lowChars = window.confirm('Include lowercase letters?')\n if (lowChars) {\n pChars += lowChars\n }\n //Uppercase letter prompt\n var upChars = window.confirm('Include uppercase letters?')\n if (upChars) {\n pChars += upChars\n }\n //need to select at least one character type or else!\n if (upChars != true && lowChars != true && numChars != true && symbChar != true) {\n window.alert('Please select on character type')\n }\n //generate random password according to specification \n var pGen = (\"\");\n for (let i = 0; i <pLength; i++) {\n pGen += pChars[Math.floor(Math.random() * pChars.length)]\n }\n //return password\n return pGen;\n}", "title": "" }, { "docid": "d6626875cde8893c9b6dd6c58e03bd2a", "score": "0.6934401", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n // var character = lowercase + uppercase + numeric +special \n // let promtLength = i;\n // for ( var i = 8; i < 129; i++) {\n // password = Math.floor((Math.random()*i.character);\n // }\n\n passwordText.value = password;\n\n}", "title": "" }, { "docid": "8d1836b14a2f359d4ad83c6d5de12390", "score": "0.69211876", "text": "function generatePassword() {\n \n inputObj.passLength = prompt(\"what's the length?\");\n inputObj.asciiLower.length = prompt(\"how many ascii lower case characters?\");\n inputObj.asciiUpper.length = prompt(\"how many ascii upper case characters\");\n inputObj.numArg.length = prompt(\"how many numbers?\");\n inputObj.specialArg.length = prompt(\"how many special characters?\");\n\n if (validateLength(inputObj)) {\n delete inputObj.passLength;\n listOfChars = getChars(inputObj);\n randomChars = randomize(listOfChars);\n } else {\n //return \"You must ask for a combination of characters between 8 and 128 characters in length\";\n return 0;\n }\n // test code ////////////////////////////////\n\n // console.log(\"continued code\");\n // console.log('here');\n // console.log(\"random\" + randomChars);\n return randomChars;\n}", "title": "" }, { "docid": "921e4392c843ee27ee2a33c5ab17b81a", "score": "0.6917234", "text": "function generatePassword() {\n var stringLength = (prompt(\"How many characters would you like your password? Choose between 8 and 128\"));\n\n // Cancels the action and returns to the main page\n if (stringLength == null) {\n alert(\"Click the Generate Password button to restart the generator\");\n Return;\n }\n\n // Loops the user to select a valid string length value \n while(stringLength <= 8 || stringLength >= 128) {\n alert(\"Password length must be between 8 and 128 characters. Try selecting a different value\");\n var stringLength = (prompt(\"How many characters would you like your password? Choose between 8 and 128\"));\n }\n\n // Confirm users password criteria\n var includeNumericCharacter = confirm(\"Would you like your password to include numbers\"); \n var includeSpecialCharacter = confirm(\"Would you like your password to include special characters\");\n var includeLowerCase = confirm(\"Would you like your password to include lowercase characters\");\n var includeUpperCase = confirm(\"Would you like your password to include uppercase characters\");\n\n // Loop password critera if none are confirmed\n while (includeUpperCase === false && includeLowerCase === false && includeSpecialCharacter === false && includeNumericCharacter === false) {\n alert(\"You must choose at one of the four criteria's (Numbers, Special Characters, Lowercase or Uppercase) for your password\");\n\n var includeSpecialCharacter = confirm(\"Would you like your password to include numbers\");\n var includeNumericCharacter = confirm(\"Would you like your password to include special characters\"); \n var includeLowerCase = confirm(\"Would you like your password to include lowercase characters\");\n var includeUpperCase = confirm(\"Would you like your password to include uppercase characters\"); \n } \n\n // Stores the variable declarations for the password criteria variables\n var passwordCreate = []\n \n // if user specifies including special characters concatinate specialCaracter variable with passwordCreate\n if (includeSpecialCharacter) {\n passwordCreate = passwordCreate.concat(specialCharacter)\n }\n\n // if user specifies including numbers concatinate numeriCharacter variable with passwordCreate\n if (includeNumericCharacter) {\n passwordCreate = passwordCreate.concat(number)\n }\n \n // if user specifies including numbers concatinate lowerCase variable with passwordCreate\n if (includeLowerCase) {\n passwordCreate = passwordCreate.concat(lowerCase)\n }\n\n // if user specifies including numbers concatinate upperCase variable with passwordCreate\n if (includeUpperCase) {\n passwordCreate = passwordCreate.concat(upperCase)\n }\n\n console.log(passwordCreate)\n\n // newPassword string to be filled based on a for loop to selection of random characters from the specified arrays\n var newPassword = \"\"\n \n // for loop increment characters by 1 up to a max of the variable stringLength specifed by the user. Randomly generate password based on users selection stored in passwordCreate\n for (var i = 0; i < stringLength; i++) {\n newPassword = newPassword + passwordCreate[Math.floor(Math.random() * passwordCreate.length)];\n }\n return newPassword;\n}", "title": "" }, { "docid": "86ab0e87497d9e39134f789376df68f3", "score": "0.6911732", "text": "function generatePassword() {\n //add variables\n var options = userInput()\n var chars = {\n lower : \"abcdefghijklmnopqrstuvwxyz\".split(\"\"),\n upper : \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".split(\"\"),\n num : \"0123456789\".split(\"\"),\n spec : \"!#$%&'()*+,-./:;<=>?@[^_`{|}~\".split(\"\"),\n }\n\n //empty arrays for adding desired characters and then final result\n var result = []\n var possibleChars = []\n\n //create if statements to append desired characters onto result\n if (options.wantsLower) {\n possibleChars = possibleChars.concat(chars.lower);\n }\n \n if (options.wantsUpper) {\n possibleChars = possibleChars.concat(chars.upper);\n }\n if (options.wantsNumeric) {\n possibleChars = possibleChars.concat(chars.num);\n }\n if (options.wantsSpecial) {\n possibleChars = possibleChars.concat(chars.spec);\n }\n \n //while loop to append random desired characters to desired length\n while (result.length < options.length) {\n result.push(getRandom(possibleChars))\n }\n\n\n return result.join(\"\")\n}", "title": "" }, { "docid": "1d1e97adb489a35997434510f5b65a24", "score": "0.69108975", "text": "function generatePassword() {\n // Set arrays for lowercase, uppercase, numbers, and special characters\n var lowercaseString = 'abcdefghijklmnopqrstuvwxyz';\n var uppercaseString = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n var numbersString = '123456789';\n var specialCharactersString = '!@#$%^&*()_+-=';\n \n // Set passwordString to be the final string to iterate over given user parameters. \n var passwordString ='';\n\n // Prompt user for number of characters and validates response\n var passwordLength = prompt(\"How many characters would you like this password to be? Please choose between 8 and 128.\");\n\n while (Number.isInteger(Number(passwordLength)) === false || passwordLength < 8 || passwordLength > 128) {\n var passwordLength = prompt(\"Please choose a valid password length between 8 and 128.\");\n }\n\n // Prompt user to include uppercase letters and validates response\n var uppercase = prompt(\"Include uppercase letters? (y/n)\").toLowerCase();\n\n while (uppercase !== 'y' && uppercase !== 'n') {\n var uppercase = prompt(\"Please choose y or n\").toLowerCase();\n }\n\n // Prompt user to include numbers and validates response \n var numbers = prompt(\"Include numbers? (y/n)\").toLowerCase();\n\n while (numbers !== 'y' && numbers !== 'n') {\n var numbers = prompt(\"Please choose y or n\").toLowerCase();\n }\n\n // Prompt user to include special characters and validates response\n var specialCharacters = prompt(\"Include special characters? (y/n)\").toLowerCase();\n\n while (specialCharacters !== 'y' && specialCharacters !== 'n') {\n var specialCharacters = prompt(\"Please choose y or n\").toLowerCase();\n }\n\n // Concatenates strings for uppercase, numbers, and special characters if user chooses to do so\n if (uppercase === 'y') {\n passwordString = lowercaseString.concat(uppercaseString);\n }\n else {\n passwordString = lowercaseString;\n }\n\n if (numbers === 'y') {\n passwordString = passwordString.concat(numbersString);\n }\n\n if (specialCharacters === 'y') {\n passwordString = passwordString.concat(specialCharactersString);\n }\n\n // Defines password variable that will be returned\n var password = '';\n\n // Outputs random characters in the array matching the user's inputted password length\n for (i = 0; i < passwordLength; i++) {\n var iteration = passwordString.charAt(Math.floor(Math.random() * passwordString.length));\n password += iteration;\n }\n\n return password;\n}", "title": "" }, { "docid": "f117e38208264bc8144cbe7fa461ce48", "score": "0.69080603", "text": "function generatePassword() {\r\n userPassword = [];\r\n const passwordLength = userLength();\r\n if (passwordLength !== undefined) {\r\n userUppercase();\r\n userLowercase();\r\n userSepcialChar();\r\n userNumbers();\r\n randomPassword(passwordLength);\r\n }\r\n}", "title": "" }, { "docid": "d4b413abd1c34cd3432710e983a96cae", "score": "0.6904226", "text": "function writePassword() {\n init(); \n generatePassword();\n \n \n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = randompassword.join('');\n \n\n}", "title": "" }, { "docid": "355baa56111c03faadcc07523345f902", "score": "0.68948746", "text": "function generatePassword(){\n //prompts user for password length.\n var passOptionLen = window.prompt(\"How many characters would you like your password length? (8\\-128)\");\n while((parseInt(passOptionLen) < 8 ) || (passOptionLen !== parseInt(passOptionLen, 10).toString()) || (parseInt(passOptionLen) > 128 )){\n alert (\"You did not enter a valid number.\");\n passOptionLen = window.prompt(\"How many characters would you like your password length? (8\\-128)\");\n }\n // Creating variables for if statements to create randomized password based on user selections.\n var upChars = hasUpper();\n var lowChars = hasLower();\n var specChars = hasSpec();\n var numChars = hasNum();\n password = \"\";\n //Chooses random character from the upperCaseChar string.\n if (upChars) {\n keyChar= keyChar + upperCaseChar;\n password = password + upperCaseChar[(Math.floor(Math.random()*upperCaseChar.length))];\n }\n //Chooses random character from the lowerCaseChar string.\n if (lowChars) {\n keyChar= keyChar + lowerCaseChar;\n password = password + lowerCaseChar[(Math.floor(Math.random()*lowerCaseChar.length))];\n }\n //Chooses random character from the specialChar string.\n if (specChars) {\n keyChar= keyChar + specialChar;\n password = password + specialChar[(Math.floor(Math.random()*specialChar.length))];\n }\n //Chooses random character from the numberChar string.\n if (numChars) {\n keyChar= keyChar + numberChar;\n password = password + numberChar[(Math.floor(Math.random()*numberChar.length))];\n }\n // runs through each of the listed if statements and increments until passOptionlen user is met.\n for (let index = password.length; index < passOptionLen; index++) {\n //Choose nothing increments on each ot the prompts if a user selects 'ok'. If user did not make a selection, this alerts the user that it is required.\n if (chooseNothing === 0 ) {\n alert (\"You must make a selection from the character prompts.\");\n generatePassword();\n }\n password = password + keyChar[(Math.floor(Math.random()*keyChar.length))];\n document.querySelector(\"#password\").innerHTML = password;\n } return password;\n\n}", "title": "" }, { "docid": "6023ea99d214e38ad256114fa798221a", "score": "0.68890166", "text": "function genPasswd(req,res){\n let password = generator.generate({\n length: 14,\n numbers: true,\n symbols: true\n });\n \n res.send(`\"${password}\"`);\n}", "title": "" }, { "docid": "08ff0a32d5fe26061a20d5779b5e0f34", "score": "0.6886778", "text": "function makePassword(){\n createdPassword = \"\";\n for (i = 0; i < passwordLength; i++){\n if(hasLowercase === true){\n lowerPass();\n }\n if (hasUppercase === true){\n upperPass();\n }\n if(hasNumbers === true){\n numberPass();\n }\n if(hasSpecial === true){\n specialPass();\n }\n \n }\n}", "title": "" }, { "docid": "5aef33411324a906390d3c747a2aca6b", "score": "0.68837655", "text": "generatePassword() {\n var numericCharacters = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\n var specialCharacters = [\n '@',\n '%',\n '+',\n '\\\\',\n '/',\n \"'\",\n '!',\n '#',\n '$',\n '^',\n '?',\n ':',\n ',',\n ')',\n '(',\n '}',\n '{',\n ']',\n '[',\n '~',\n '-',\n '_',\n '.'\n ];\n var lowerCasedCharacters = [\n 'a',\n 'b',\n 'c',\n 'd',\n 'e',\n 'f',\n 'g',\n 'h',\n 'i',\n 'j',\n 'k',\n 'l',\n 'm',\n 'n',\n 'o',\n 'p',\n 'q',\n 'r',\n 's',\n 't',\n 'u',\n 'v',\n 'w',\n 'x',\n 'y',\n 'z'\n ];\n var upperCasedCharacters = [\n 'A',\n 'B',\n 'C',\n 'D',\n 'E',\n 'F',\n 'G',\n 'H',\n 'I',\n 'J',\n 'K',\n 'L',\n 'M',\n 'N',\n 'O',\n 'P',\n 'Q',\n 'R',\n 'S',\n 'T',\n 'U',\n 'V',\n 'W',\n 'X',\n 'Y',\n 'Z'\n ];\n let options = this.getPasswordOptions();\n // Variable to store password as it's being concatenated\n let result = [];\n \n // Array to store types of characters to include in password\n let possibleCharacters = [];\n \n // Array to contain one of each type of chosen character to ensure each will be used\n let guaranteedCharacters = [];\n \n // Conditional statement that adds array of special characters into array of possible characters based on user input\n // Push new random special character to guaranteedCharacters\n if (options.hasSpecialCharacters) {\n possibleCharacters = possibleCharacters.concat(specialCharacters);\n guaranteedCharacters.push(this.getRandom(specialCharacters));\n }\n \n // Conditional statement that adds array of numeric characters into array of possible characters based on user input\n // Push new random special character to guaranteedCharacters\n if (options.hasNumericCharacters) {\n possibleCharacters = possibleCharacters.concat(numericCharacters);\n guaranteedCharacters.push(this.getRandom(numericCharacters));\n }\n \n // Conditional statement that adds array of lowercase characters into array of possible characters based on user input\n // Push new random lower-cased character to guaranteedCharacters\n if (options.hasLowerCasedCharacters) {\n possibleCharacters = possibleCharacters.concat(lowerCasedCharacters);\n guaranteedCharacters.push(this.getRandom(lowerCasedCharacters));\n }\n \n // Conditional statement that adds array of uppercase characters into array of possible characters based on user input\n // Push new random upper-cased character to guaranteedCharacters\n if (options.hasUpperCasedCharacters) {\n possibleCharacters = possibleCharacters.concat(upperCasedCharacters);\n guaranteedCharacters.push(this.getRandom(upperCasedCharacters));\n }\n \n // For loop to iterate over the password length from the options object, selecting random indices from the array of possible characters and concatenating those characters into the result variable\n for (let i = 0; i < options.length; i++) {\n let possibleCharacter = this.getRandom(possibleCharacters);\n \n result.push(possibleCharacter);\n }\n \n // Mix in at least one of each guaranteed character in the result\n for (let i = 0; i < guaranteedCharacters.length; i++) {\n result[i] = guaranteedCharacters[i];\n }\n \n // Transform the result into a string and pass into writePassword\n let passw = result.join('');\n if(passw !== undefined){\n let updatePass = this.state.user \n updatePass.password = passw\n this.setState({user:updatePass})\n this.setState({passwordSaved:false})\n }\n }", "title": "" }, { "docid": "1d1e8299e775859b14075f55ba241992", "score": "0.6882782", "text": "function generatePassword() {\n let pass = \"\";\n let str =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" + \"abcdefghijklmnopqrstuvwxyz0123456789@#$\";\n\n for (let i = 1; i < 16; i += 1) {\n let char = Math.floor(Math.random() * str.length + 1);\n pass += str.charAt(char);\n }\n return pass;\n}", "title": "" }, { "docid": "790bcfed5c97e8a342e0e38302c8039b", "score": "0.6882559", "text": "function generatePassword() {\n\n var initiate = beginPassword();\n var potentialCharacters = [];\n var characterChoices = [];\n var newPassword = [];\n\n if (initiate.askAlpha) {\n potentialCharacters = potentialCharacters.concat(alphaCharacters);\n }\n if (initiate.askUpper) {\n potentialCharacters = potentialCharacters.concat(upperCharacters);\n }\n if (initiate.askNum) {\n potentialCharacters = potentialCharacters.concat(numCharacters);\n }\n if (initiate.askSpecial) {\n potentialCharacters = potentialCharacters.concat(specialCharacters);\n }\n\n // Retrieves random character from newly merged array of potential characters\n function getCharacterFrom() {\n var randIdx = Math.floor(Math.random() * potentialCharacters.length);\n var result = potentialCharacters[randIdx];\n return result;\n }\n\n // Loop will iterate function to retrieve characters for password as necessary to satisfy password length based on users' inputs\n // Retrieved random characters are placed into new array\n for (var i = 0; i < initiate.askLength; i++) {\n var characterChoices = getCharacterFrom(potentialCharacters);\n newPassword.push(characterChoices);\n }\n \n // Joins random characters into final password\n return newPassword.join(\"\");\n\n}", "title": "" }, { "docid": "da1a611467a0fd569b007918d5d5982f", "score": "0.68787086", "text": "function generateP() {\n var password = '';\n var str = '0ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@#$';\n\n for (i = 1; i <= 8; i++) {\n\n var randomNumber = Math.floor(Math.random()\n * str.length + 1);\n\n password += str.charAt(randomNumber)\n }\n\n return password;\n }", "title": "" }, { "docid": "9bacaeeb3bba9cd74c19319c51f9c262", "score": "0.68767875", "text": "function generatePassword() {\n getPasswordCriteria();\n\n let availableChars = [];\n if (useUppercaseChars) {\n availableChars = availableChars.concat(uppercaseChars);\n }\n if (useLowercaseChars) {\n availableChars = availableChars.concat(lowercaseChars);\n }\n if (useNumericChars) {\n availableChars = availableChars.concat(numericChars);\n }\n if (useSpecialChars) {\n availableChars = availableChars.concat(specialChars);\n }\n\n for (let i = 0; i < passwordLength; i++) {\n const randomIndex = Math.floor(Math.random() * availableChars.length);\n generatedPassword += availableChars[randomIndex];\n }\n}", "title": "" }, { "docid": "15f88f4a48b5be2b4642e89831a106ac", "score": "0.6871605", "text": "function writePassword() {\n var password = generatePassword();//define generatePassword by completing generatePassword function\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "title": "" }, { "docid": "03b04396f5426e1419551b516042dd71", "score": "0.6863714", "text": "function generatePassword(length, lower, upper, number, symbol) {\n // 1 - Inicializar pw var\n // 2 - Filtrar tipos a serem gerados\n // 3 - Loop de chamadas de geracao\n // 4 - Retornar password gerada\n\n let generatedPassword = '';\n\n // Cria um vetor somente com as flags true\n const typesArr = [{\n lower\n }, {\n upper\n }, {\n number\n }, {\n symbol\n }].filter(\n item => Object.values(item)[0]\n );\n\n // Retorna nada se nao houver flags marcadas\n if (typesArr.length == 0) {\n return ''\n };\n\n // Loop de geracao\n for (let i = 0; i < length; i += typesArr.length) {\n typesArr.forEach(type => {\n const funcName = Object.keys(type)[0];\n generatedPassword += randomFunc[funcName]();\n })\n }\n\n // Garante que retornara mesmo que o length seja menor que o tamanho do typesArr\n return generatedPassword.slice(0, length);\n}", "title": "" }, { "docid": "941191dd8a1fb2c899a0671279a180af", "score": "0.68571943", "text": "function writePassword() {\n //var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = pCreate();\n}", "title": "" }, { "docid": "9abb04a786658da00aaf7a82627b9664", "score": "0.68522716", "text": "function generatePassword() {\n\n newPassword = \"\";\n newPasswordLength = getPasswordLength();\n // console.log(\"newPasswordLength: \" + newPasswordLength);\n newSpecialChars = getSpecialChars();\n\n //todo: only add password char types the user wants\n // loop through newPasswordLength\n for (var i = 0; i < newPasswordLength; i++) {\n // select randomly one of the four password char TYPES (special | numbers | lower | upper)\n var nextCharType = Math.floor(Math.random() * passwordCharTypes.length);\n // select randomly one CHAR from that TYPE\n var nextChar = Math.floor(Math.random() * (passwordCharTypes[nextCharType]).length);\n // console.log(i+1 + \": next char type: \" + nextCharType + \", next char: \" + passwordCharTypes[nextCharType][nextChar]);\n newPassword += (passwordCharTypes[nextCharType])[nextChar];\n }\n\n //todo: replace alert with populating page content\n // console.log(newPassword);\n // alert(\"Your password is \" + newPassword);\n var securePassword = document.querySelector(\"#securePassword\");\n securePassword.textContent = newPassword;\n //todo: change copy button state; toggle not working correctly, should reset when clicking 'generate' button\n btnCopyPassword.classList.remove(\"btn-secondary\");\n btnCopyPassword.classList.add(\"btn-danger\");\n}", "title": "" }, { "docid": "ed8b99027969fa9c04a1a4679a95bd5b", "score": "0.6852032", "text": "function newClick(){\n generateBtn = document.querySelector(\"#generate\");\n lowerCaseLetters = [\"a\", \"b\", \"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\"];\n upperCaseLetters = [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\",\"G\", \"H\", \"I\", \"J\", \"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"];\n numbers = [\"0\", \"1\", \"2\", \"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"];\n specialCharacters = [\"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\"];\n passwordArray =[];\n randomPasswordArray =[];\n charactersAlreadyAdded = 0;\n includeLowerCase = false;\n includeUpperCase = false;\n includeSpecial = false;\n includeNumber = false;\n numPasswordCharacters = 0;\n }", "title": "" }, { "docid": "51f9dc370bddbd03eaa57b34e31d237f", "score": "0.6838815", "text": "generatePassword(length, options) {\r\n const numbers = options.indexOf ('numbers') !== -1;\r\n const symbols = options.indexOf ('symbols') !== -1;\r\n let uppercase = options.indexOf ('uppercase') !== -1;\r\n let lowercase = options.indexOf ('lowercase') !== -1;\r\n if (uppercase === false && lowercase === false) {\r\n lowercase = true;\r\n }\r\n console.log (`length ${length}, symbols: ${symbols}, numbers: ${numbers}, uc: ${uppercase}, lc: ${lowercase}`)\r\n return generator.generate({\r\n\t length: length,\r\n\t numbers: numbers,\r\n symbols: symbols,\r\n uppercase: uppercase,\r\n lowercase: lowercase\r\n });\r\n }", "title": "" }, { "docid": "521ca6d7b5ed3326eb1c48130b2abe90", "score": "0.68377364", "text": "function generatePassword() {\n pwLength = prompt(\"How many characters would you like your password to be?\");\n\n if (pwLength <= 128 && pwLength >= 8) {\n uppercase = confirm(\"Would you like to use uppercase letters?\");\n lowercase = confirm(\"Would you like to use lowercase letters?\");\n special = confirm(\"Would you like to use special characters?\");\n number = confirm(\"Would you like to use numbers?\");\n\n var pwCharSet = '';\n\n if (uppercase === true) {\n pwCharSet += 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n }\n if (lowercase === true) {\n pwCharSet += 'abcdefghijklmnopqrstuvwxyz';\n }\n if (special === true) {\n pwCharSet += '!@#$%^&*()-_+={}[]<>?~`';\n }\n if (number === true) {\n pwCharSet += '0123456789';\n }\n var pwCharSetLength = pwCharSet.length;\n pw = '';\n for (var i = 0; i < pwLength; i++) {\n pw += pwCharSet.charAt(Math.floor(Math.random() * pwCharSetLength));\n }\n } else {\n\n alert(\"Please choose a number between 8 and 128.\");\n generatePassword();\n }\n\n return pw;\n}", "title": "" }, { "docid": "f84f0e11c52d5679142043e31866c952", "score": "0.68317705", "text": "function generatePassword() {\n\n while (!upperCaseSelect && !lowerCaseSelect && !numberSelect && !specialchars) {\n window.alert(\"Plase select the criteria from the prompts to generate your password.\");\n var upperCaseSelect = confirm(\"Do you want any upper case letters in your password?\");\n var lowerCaseSelect = confirm(\"Do you want any lower case letters in your password?\");\n var numberSelect = confirm(\"Do you want any numbers in your password\");\n var charSelect = confirm(\"Do you want any special characters in your password\");\n }\n\n\n // obtain password length at least 8 characters and no more than 128 characters\n var passwordLength = parseInt(prompt(\"What should be the length of your password\", \"8-128\"));\n console.log(passwordLength);\n\n while (passwordLength < 8 || passwordLength > 128 || isNaN(passwordLength)) {\n passwordLength = prompt(\"pleae enter a valid number. Any number between 8-128\");\n\n }\n\n // if (passwordLength < 8 || passwordLength > 128 || isNaN(passwordLength)) {\n // prompt(\"pleae enter a valid number 8-128\");\n // } else {\n // var passwordLength = passwordLength;\n\n // };\n\n //creating the password\n\n var newPword = [];\n var newPwordStng = \"\";\n\n if (upperCaseSelect) newPwordStng = newPwordStng.concat(upperCase);\n if (lowerCaseSelect) newPwordStng = newPwordStng.concat(lowerCase);\n if (numberSelect) newPwordStng = newPwordStng.concat(numbers);\n if (charSelect) newPwordStng = newPwordStng.concat(specialChar);\n\n while (newPword.length < passwordLength) {\n var specialchars = newPwordStng[Math.floor(Math.random() * newPwordStng.length)];\n newPword.push(specialchars);\n }\n var joinPass = newPword.join(\"\");\n return joinPass;\n}", "title": "" }, { "docid": "0e197ea419ddf930f7a190c2c2dba507", "score": "0.68297374", "text": "function generatePassword() {\n\t//Get the length of the password from user input\n\tvar getLength = prompt('How many characters would you like your password to be? Pick a number between 8 and 128.');\n\n\t//Validate user entry length and reset page if conditions are not met\n\tif (getLength < 8 || getLength > 128) {\n\t\talert(\"I'm sorry, please select a value between 8 & 128.\");\n\t\tlocation.reload();\n\t} else {\n\t\tvar lowerCase = confirm('Would you like to include lower case letters?');\n\t\tvar upperCase = confirm('Would you like to include uppercase letters?');\n\t\tvar numbers = confirm('Would you like to include numbers?');\n\t\tvar specials = confirm('Would you like to include special characters?');\n\t\tvar passwordStr = '';\n\t\tvar letterLArray = 'abcdefghijklmnopqrstuvwxyz';\n\t\tvar letterUArray = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\tvar numberArray = '0123456789';\n\t\tvar specialArray = '!@#$%^&*()';\n\t\tvar bigArray = '';\n\t\t//Decide which character strings to add to final output\n\t\tif (lowerCase) {\n\t\t\tpasswordStr = passwordStr + letterLArray[Math.floor(Math.random() * letterLArray.length)];\n\t\t\tbigArray = bigArray + letterLArray;\n\t\t}\n\t\tif (upperCase) {\n\t\t\tpasswordStr = passwordStr + letterUArray[Math.floor(Math.random() * letterUArray.length)];\n\t\t\tbigArray = bigArray + letterUArray;\n\t\t}\n\t\tif (numbers) {\n\t\t\tpasswordStr = passwordStr + numberArray[Math.floor(Math.random() * numberArray.length)];\n\t\t\tbigArray = bigArray + numberArray;\n\t\t}\n\t\tif (specials) {\n\t\t\tpasswordStr = passwordStr + specialArray[Math.floor(Math.random() * specialArray.length)];\n\t\t\tbigArray = bigArray + specialArray;\n\t\t}\n\t\t//Loop through array of all possible characters and return a randomized output meeting the length of the user's input\n\t\tvar total = getLength - passwordStr.length;\n\t\tfor (var i = 0; i < total; i++) {\n\t\t\tpasswordStr = passwordStr + bigArray[Math.floor(Math.random() * bigArray.length)];\n\t\t}\n\t\treturn passwordStr;\n\t}\n}", "title": "" }, { "docid": "f8efd756f3e649678f86becc1567b590", "score": "0.6827258", "text": "function generatePassword() {\n var pwLength = prompt(\"How long would you like your password to be?\");\n console.log(\"Length: \" + pwLength);\n\n // Ensure proper validation\n if ((isNaN(pwLength)) || (pwLength < 8 || pwLength > 128)) {\n alert('Invalid entry. Must enter a number between 8 and 128.');\n return \"\";\n }\n\n // Prompt for user PW requirements\n var sc = confirm('Would you like to use $peci@l characters?');\n var lc = confirm('Would you like to use lower case letters?');\n var uc = confirm('Would you like to use Upper Case Letters?');\n var nc = confirm('Would you like to use numb3rs?');\n\n // Strings for character types\n var scString = '!@#$%^&*()_+/?[]{}\\|';\n var lcString = 'abcdefghijklmnopqrstuvwxyz';\n var ucString = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n var ncString = '0123456789';\n\n\n // Create the final library of characters based on user choices\n var finalString = '';\n\n function finalStringConcat() {\n\n if (sc === true) {\n finalString = finalString.concat(scString);\n console.log(\"Include Special Characters\");\n }\n\n if (lc === true) {\n finalString = finalString.concat(lcString);\n console.log(\"Include lower case characters\");\n }\n\n if (uc === true) {\n finalString = finalString.concat(ucString);\n console.log(\"Include upper case characters\");\n }\n\n if (nc === true) {\n finalString = finalString.concat(ncString);\n console.log(\"Include numbers\");\n }\n }\n\n finalStringConcat();\n\n // Generate a random PW based on user requirements\n var pwResult = '';\n function makePW() {\n for (i=0 ; i < pwLength; i++) {\n pwResult += finalString.charAt(Math.floor(Math.random() * finalString.length));\n }\n }\n\n makePW();\n return pwResult;\n\n}", "title": "" }, { "docid": "27902808af4f6dac82824b87c07220ef", "score": "0.6826332", "text": "function CreatePassword() {\n\nvar RunCharacters = []\n \nif (RequestUppercase()) {\n RunCharacters = RunCharacters.concat(ThemUppercase)\n \n}\n\nif (RequestLowercase()) {\n RunCharacters = RunCharacters.concat(ThemLowercase)\n \n}\n\nif (RequestNumbers()) {\n RunCharacters = RunCharacters.concat(ThemNumbers)\n}\n \nif (RequestSpecialchar()) {\n RunCharacters = RunCharacters.concat(ThemSpecchar)\n \n}\n\nif (RunCharacters.length < 1) {\n alert(\"You must select at least one password criteria!\");\n return \"\"\n}\n \nRequestPasswordLength();\n\n//Code below creates desired password//\n\nvar RunPassword = \"\";\n\nfor (i = 0; i < PasswordLength; i++) {\n var number = Math.floor(Math.random() * (RunCharacters.length - 1));\n RunPassword = RunPassword + RunCharacters[number];\n}\n\nreturn RunPassword\n\n}", "title": "" }, { "docid": "d9364cb39fb6f93d09b69bfa369b3f78", "score": "0.6822196", "text": "function generatePassword () {\n pwChar = '';\n for (let i = 0; i < numOfCharacters; i++) {\n var nextChar = Math.floor(Math.random()*availableChar.length + 1);\n console.log(nextChar);\n pwChar += availableChar.charAt(nextChar) \n }\n console.log(pwChar);\n recordPassword();\n }", "title": "" }, { "docid": "3c6fb71c1a3e50bf18042368f668d458", "score": "0.68199974", "text": "function buildPassword() {\n for (var i = 0; i < (inputLength); i++) {\n //builds a combined string with the different vars depending on user confirmation, then adds a character\n combined = lowerSet + upperSet + numSet + specSet;\n passwordString += combined.charAt(Math.floor(Math.random() * combined.length))\n }\n }", "title": "" }, { "docid": "f3f8e75975780511494556f488e012eb", "score": "0.68199396", "text": "function generatePassword() {\n var options = getPasswordOptions();// calling this function\n // declaring result array\n var result = [];\n\n // declaring array of character which is included in password\n var possibleCharacters = [];\n\n //declaring array of chosed one character of each type\n var guaranteedCharacters = [];\n\n // add array of special character and save in guranteed character\n if (options.specchars) {\n possibleCharacters = possibleCharacters.concat(specchars);\n guaranteedCharacters.push(getRandom(specchars));\n }\n//add array of numeric character and save in guranteed character\n if (options.numchars) {\n possibleCharacters = possibleCharacters.concat(numchars);\n guaranteedCharacters.push(getRandom(numchars));\n }\n\n //add array of lowercase character and save in guranteed character\n if (options.lowerchars) {\n possibleCharacters = possibleCharacters.concat(lowerchars);\n guaranteedCharacters.push(getRandom(lowerchars));\n }\n\n // add array of uppercase character and save in guranteed character\n if (options.upperchars) {\n possibleCharacters = possibleCharacters.concat(upperchars);\n guaranteedCharacters.push(getRandom(upperchars));\n }\n\n // using loop generate random possible character and save in posssible character\n for (var i = 0; i < options.length; i++) {\n var possibleCharacter = getRandom(possibleCharacters);\n\n result.push(possibleCharacter);\n }\n\n // mix atleastt one character of geach type in guranteed character\n for(var i = 0; i < guaranteedCharacters.length; i++) {\n result[i] = guaranteedCharacters[i];\n }\n\n // Transform the result into a string and pass into writePassword\n return result.join('');\n}", "title": "" }, { "docid": "346e614667b88828e41bda8bdaa7ea20", "score": "0.68138385", "text": "function generatePassword() {\n\n // create object to keep track of which options were selected\n var responses = {\n lowerCase: false,\n upperCase: false,\n number: false,\n specialChar: false\n }\n\n const minLen = 8;\n const maxLen = 128;\n var pswd = \"\";\n var allTypesArray = [];\n var pswdLen = 0;\n var lenLeft = 0;\n\n // keep in a loop until at least one option is selected for password generation\n while (!CheckForAtLeastOne(responses)) {\n\n // make sure a valid password length is selected\n while (pswdLen < minLen || pswdLen > maxLen) {\n pswdLen = prompt(\"How many characters do you want for your password? Enter a number from 8 to 128.\", \"8\");\n lenLeft = pswdLen;\n }\n\n // ask if lower case chars are desired\n if (confirm(\"Would you like your password to include lowercase letters?\")) {\n responses.lowerCase = true;\n }\n \n // ask if upper case chars are desired\n if (confirm(\"Would you like your password to include uppercase letters?\")) {\n responses.upperCase = true;\n }\n\n // ask if lower numbers are desired\n if (confirm(\"Would you like your password to include numbers?\")) {\n responses.number = true;\n }\n \n // ask if special chars are desired\n if (confirm(\"Would you like your password to include special characters?\")) {\n responses.specialChar = true;\n }\n }\n\n // make sure we get at least one char or each type selected\n if (responses.lowerCase) {\n pswd = lowerArray[Math.floor(Math.random()*lowerArray.length)];\n allTypesArray.push(...lowerArray);\n lenLeft --;\n }\n if (responses.upperCase) {\n pswd += upperArray[Math.floor(Math.random()*upperArray.length)];\n allTypesArray.push(...upperArray);\n lenLeft --;\n }\n if (responses.number) {\n pswd += numberArray[Math.floor(Math.random()*numberArray.length)];\n allTypesArray.push(...numberArray);\n lenLeft --;\n }\n if (responses.specialChar) {\n pswd += specialArray[Math.floor(Math.random()*specialArray.length)];\n allTypesArray.push(...specialArray);\n lenLeft --;\n }\n\n // now get the rest out of the pool of types selected\n for (var i=0; i < lenLeft; i++) {\n pswdRandom = allTypesArray[Math.floor(Math.random()*allTypesArray.length)];\n pswd += pswdRandom;\n }\n\n return pswd;\n}", "title": "" }, { "docid": "3cfd235ce43afe0e85b5207db77218b1", "score": "0.68129545", "text": "function generatePassword() {\n\t// Stores the length of the password to create\n\tvar passwordLength = askPasswordLength();\n\t// Check if the password length fits the constraints and is a number\n\tif ( passwordLength < 8 || passwordLength > 128 || isNaN( passwordLength ) ) {\n\t\t// Alert informs the user that the input was invalid\n\t\talert( 'Password length must be a number between 8 and 128 characters.' );\n\t\t// A blank string is sent back to the textbox and the user starts again\n\t\treturn '';\n\t}\n\n\t// The user's choices as to which character sets to use are stored here\n\tvar userCharacterSetChoices = chooseCharacterSets( characterSetNames.length );\n\n\t// Stores the value of `userCharacterSetChoices` as a sum total\n\tvar sumOfUserCharacterSetChoices = sumOfArray( userCharacterSetChoices );\n\t// Triggers if no character sets were selected\n\tif ( sumOfUserCharacterSetChoices === 0 ) {\n\t\t// Alert informs the user that they need to include at least one set of characters\n\t\talert( 'Please include at least one set of characters to use.' );\n\t\t// A blank string is sent back to the textbox and the user starts again\n\t\treturn '';\n\t}\n\n\t// One string holding all requested character sets\n\tvar combinedCharacterSets = combineRequestedCharacterSets( userCharacterSetChoices );\n\n\t// The randomized password string to return once guaranteed\n\tvar randomizedPasswordCharacters = assignRandomCharacters( passwordLength, combinedCharacterSets );\n\n\t// Check if the password needs to guarantee that each choosen character set was used\n\tif ( sumOfUserCharacterSetChoices === 1 ) {\n\t\t// If one character set was used a guarantee is not needed and the randomized string is returned to `password` in writePassword()\n\t\treturn randomizedPasswordCharacters;\n\t\t// Othersiwe more than one set was used\n\t} else {\n\t\t// The randomized string needs to guarantee that at least one character from each set has been included\n\t\trandomizedPasswordCharacters = guaranteePasswordContainsCharacterSets( passwordLength, sumOfUserCharacterSetChoices, userCharacterSetChoices, randomizedPasswordCharacters );\n\t\t// The randomized characters are returned to `password` in writePassword()\n\t\treturn randomizedPasswordCharacters;\n\t}\n}", "title": "" }, { "docid": "b6e8a203f2dc075f70e6f3aa8243a887", "score": "0.6809274", "text": "function btnGen_Click() {\n var passGeneratorSettings=readPassGenSettings();\n var pswd=\"\";\n if (isValid(passGeneratorSettings)){\n pswd= GeneratePassword(passGeneratorSettings);\n document.getElementById(\"txtPassword\").value=pswd;\n }\n //document.getElementById(\"txtPassword\").value=pswd;\n}", "title": "" }, { "docid": "7808ad69d48cae3af6b9a03fefdb5ed3", "score": "0.6808255", "text": "function writePassword() {\n // I needed to create a generatePassword function!**\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "title": "" }, { "docid": "f5ac9ec054ba3e5928bda64ee7b370dd", "score": "0.680102", "text": "generate_passwordInstance() {\n const password = randomString(8);\n\n ['password', 'password2'].forEach((field) => {\n this.commitMutation('setFieldValue', { field, value: password });\n });\n }", "title": "" }, { "docid": "01eb1136ca9dc03e8ca4fe68fdcc4bcf", "score": "0.6796478", "text": "function generatePassword() {\n //parseInt will turn the string into a numeric value.\n var pwdLength = parseInt(\n prompt(\n \"How long do you want your password to be? Enter a number from 8-128.\"\n )\n );\n // Alert the user if they enter a password length that is less than 8, greater than 128, or not a Number.\n console.log(pwdLength);\n // if it's not between 8-128, tell them that they have to start over. if it's not numeric tell them to start over\n //consolidated this code into one.\n if (pwdLength > 128 || pwdLength < 8 || isNaN(pwdLength)) {\n console.log(pwdLength);\n alert(\"Please enter a number 8-128!\");\n return;\n }\n\n // Ask the user the series of questions to decide if they want lower case letters, upper case letters, numbers, and/or special characters in their password.\n var lowerCase = confirm(\n \"Do you want to include lower case letters in your password?\"\n );\n console.log(lowerCase);\n\n var upperCase = confirm(\n \"Do you want to include Upper Case letters in your password?\"\n );\n console.log(upperCase);\n\n var nuMeric = confirm(\n \"Do you want to include numeric characters in your password?\"\n );\n console.log(nuMeric);\n\n var specialChar = confirm(\n \"Do you want to include special characters in your password?\"\n );\n console.log(specialChar);\n\n // Alert if the user does not select any of the password character options.\n if (!lowerCase && !upperCase && !nuMeric && !specialChar) {\n alert(\"You have to pick something! Try again.\");\n return;\n }\n\n // Creating the 'possible characters' array for the script to choose from based on which parameters the user selects.\n var possibleChar = \"\";\n\n if (lowerCase) {\n possibleChar = possibleChar + lowerCaseChar;\n [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\",\n ];\n }\n\n //removed lower case letters\n if (upperCase) {\n possibleChar = possibleChar + upperCaseChar;\n [\n \"A\",\n \"B\",\n \"C\",\n \"D\",\n \"E\",\n \"F\",\n \"G\",\n \"H\",\n \"I\",\n \"J\",\n \"K\",\n \"L\",\n \"M\",\n \"N\",\n \"O\",\n \"P\",\n \"Q\",\n \"R\",\n \"S\",\n \"T\",\n \"U\",\n \"V\",\n \"W\",\n \"X\",\n \"Y\",\n \"Z\",\n ];\n }\n\n if (nuMeric) {\n possibleChar = possibleChar + numericChar;\n [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];\n }\n\n if (specialChar) {\n possibleChar = possibleChar + specialCaseChar;\n [\"!\", \"&\", \"#\", \"+\", \"/\", \"-\", \"$\", \"@\", \"*\", \"%\"];\n }\n\n console.log(possibleChar);\n\n console.log(possibleChar.length);\n\n console.log(\"Password Length\", pwdLength);\n\n // to write the generatePassword function, create a for loop that while cycle through the 'possibleChar' string based on what the user selected. \n\n for (var i = 0; i < parseInt(pwdLength); i++) {\n var randomChoice = Math.floor(Math.random() * possibleChar.length);\n console.log(randomChoice);\n //generate the password based on the possibleChar and the length of password the user initially inputted.\n var randomChar = possibleChar[randomChoice];\n console.log(randomChar);\n //concatenation of two variables together and saving back to password\n password = password + randomChar;\n console.log(password);\n }\n return password;\n}", "title": "" }, { "docid": "6074d7d3bf4ff7ab5792621704a583ba", "score": "0.6790133", "text": "function generatePassword() {\n var createdPassword = \"\";\n var i = 0;\n //for loop to add random characters\n while (i < characterCount) {\n createdPassword += selectedCharacters[Math.floor(Math.random()* selectedCharacters.length)];\n i++;\n }\n return createdPassword;\n}", "title": "" }, { "docid": "b56fa15296f24fb624185344bc7f2529", "score": "0.6785541", "text": "function generatePassword () {\n // Declare Variable for new password and store it in the global memory \n var newPassword = \"\"\n console.log(passLength)\n // if statment to have the password length to be between (8 & 128)\n if(passLength > 7 && passLength <129) {\n // Prompt users to chooce which charactors type would like to include (4)\n var includeLower = confirm(\"Include Lowercase letters?\")\n var includeUpper = confirm(\"Include Uppercase letters?\")\n var includeNumber = confirm(\"Include Numbers?\")\n var includeSymbole = confirm(\"Include Symboles?\")\n // For loop with the length od Charactors users like to have\n for(var i = 0; i < passLength; i++) {\n // Declare var result with an array to be stored in the Golbal memory\n var randomResult = []\n if (includeLower) {\n randomResult.push(getRandomLower())\n }\n if (includeUpper) {\n randomResult.push(getRandomUpper())\n }\n if (includeNumber) {\n randomResult.push(getRandomNumber())\n }\n if (includeSymbole) {\n randomResult.push(getRandomSymbole())\n }\n newPassword = newPassword + randomResult.join('')\n newPassword = newPassword.substring(0, passLength);\n \n console.log(newPassword)\n }\n} //If input isnt a number between 8 and 128 alert to try again with right input\n else {\n alert(\"Please enter only numbers between 8 - 128.\\nClick generate Password one more time\")\n // passLength = parseInt(prompt(\"Enter the length of the passowrk you wish to creat (Choose between 8 & 128)\"));\n }\n return newPassword;\n}", "title": "" }, { "docid": "6bdc6392f2770006ebfbfb0f7d5ab56b", "score": "0.6784165", "text": "function generatePassword(){\n var pwLength = parseInt(prompt(\"Please choose how many characters you would like your password to be. (Between 8-128 characters)\"));\n\n // Making sure the password length is within specified values\n if (pwLength < 8 || pwLength > 128) {\n alert(\"Password needs to be between 8 to 128 characters long\");\n return;\n }\n \n // array of possible characters\n var lowerCaseLetter = [\"q\", \"w\", \"e\", \"r\", \"t\", \"y\", \"u\", \"i\", \"o\", \"p\", \"a\", \"s\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"z\", \"x\", \"c\", \"v\", \"b\", \"n\", \"m\"];\n var upperCaseLetter = [\"Q\", \"W\", \"E\", \"R\", \"T\", \"Y\", \"U\", \"I\", \"O\", \"P\", \"A\", \"S\", \"D\", \"F\", \"G\", \"H\", \"J\", \"K\", \"L\", \"Z\", \"X\", \"C\", \"V\", \"B\", \"N\", \"M\"];\n var specialChar = [\" \", \"!\", \"#\", \"$\", \"%\", \"&\", \"*\", \"+\", \"-\", \".\", \"/\", \":\", \";\", \"<\", \"=\", \">\", \"?\", \"@\", \"]\", \"[\", \"^\", \"_\", \"`\", \"{\", \"|\", \"}\", \"~\"];\n var numbers = [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"0\"];\n var pwChar = [];\n\n // Prompts for choosing what kind of characters needed in password\n var needLowerCase = confirm(\"Would you like lowercase characters in your password? (Ok for yes or Cancel for no)\");\n var needUpperCase = confirm(\"Would you like uppercase characters in your password? (Ok for yes or Cancel for no)\");\n var needSpecialChar = confirm(\"Would you like special characters in your password? (Ok for yes or Cancel for no)\");\n var needNumber = confirm(\"Would you like number characters in your password? (Ok for yes or Cancel for no)\");\n\n // Making sure at least one option is chosen\n if (needLowerCase === false && needUpperCase === false && needSpecialChar === false && needNumber === false){\n alert(\"Password needs at least one of the options.\");\n return;\n }\n // adding characters to the password if needed from promnpts\n if (needLowerCase) {\n pwChar = pwChar.concat(lowerCaseLetter);\n }\n if (needUpperCase) {\n pwChar = pwChar.concat(upperCaseLetter);\n }\n if (needSpecialChar) {\n pwChar = pwChar.concat(specialChar);\n }\n if (needNumber) {\n pwChar = pwChar.concat(numbers);\n }\n\n // storing generated password\n var newPassword = \"\";\n\n // takes the choices and generates the password\n for (var i = 0; i < pwLength; i++){\n newPassword = newPassword + pwChar[Math.floor(Math.random() * pwChar.length)];\n console.log(newPassword);\n }\n\n // shows password in a pop up notification\n alert(\"Your password is \" + newPassword);\n \n // shows the generated password in the text box\n return newPassword;\n}", "title": "" }, { "docid": "05bc7357cf3351bdb4ee925f654ca9b0", "score": "0.6784108", "text": "function writePassword() {\n var passwordText = document.querySelector(\"#password\");\n\n // reset the variables so generator can be used multiple times without refreshing\n finalString = \"\"\n passwordLength = \"\"\n finalPassword = \"\"\n numberOfOptionsSelected = 0\n\n\n// run the function to prompt the user for option selections and generate password\n var password = promptPassword();\n \n// make the text on the page equal the generated password\n passwordText.value = password;\n\n}", "title": "" }, { "docid": "69b9c21dd40a755d5c9de85650772581", "score": "0.6777793", "text": "function generatePassword() {\r\n var pass = '';\r\n var str = passwordCharacters();\r\n\r\n // Prompts user for password length\r\n var passLength = prompt(\"Enter a password character length between 8 - 128\", \"8\");\r\n\r\n // Checks if the password length is valid\r\n while (passLength > 128 || passLength < 8) {\r\n var passLength = prompt(\"ERROR: Please input a length between 8 - 128\", \"8\");\r\n }\r\n\r\n // Generates password using Math.random based on the string length\r\n for (i = 1; i <= passLength; i++) {\r\n var char = Math.floor(Math.random() * str.length + 1);\r\n pass += str.charAt(char)\r\n }\r\n\r\n console.log(pass);\r\n return pass;\r\n}", "title": "" }, { "docid": "4c71fb1bf381458ba3edf9c5189dbedd", "score": "0.67775995", "text": "function generatePassword(){\n var firstQuestion = confirm ('Do you want to create a new password?');\n if (firstQuestion){\n var capitalCharacter = confirm ('Do you want to include Uppercase characters?');\n var lowercaseCharacter = confirm ('Do you want to include Lowercase characters?');\n var numberCharacter = confirm ('Do you want to include Numbers?');\n var specialCharacter = confirm ('Do you want to include Special characters?');\n // Ensure user enter a valid length for the password before continuing\n var lenghtPassword = 0;\n while((lenghtPassword<8 ) || (lenghtPassword>125)){\n lenghtPassword = prompt ('Choose the lenght of your password. Password should be between 8-125 characters');\n // If user clicks cancel, exit function\n if(lenghtPassword == null){\n return \"\";\n }\n }\n\n // Validate at least one option is selected. If not, ask user to try again\n if ((capitalCharacter==false)&&(lowercaseCharacter==false)&&(numberCharacter==false)&&(specialCharacter==false)){\n // If user did nto select at least one option, exit function and ask to try again\n alert('You have not selected any of the options. Plese try agin and select one of the options to generate password');\n return \"\";\n }\n var newPassword = \"\";\n\n // While loop will stay generating valid characters \n // until it reaches the desired password length\n while (newPassword.length<lenghtPassword ){\n var randType =Math.floor(Math.random()*4)+1;\n switch(randType){\n case 1: // Upper case\n if(capitalCharacter){\n newPassword = newPassword + getUpperCharacter();\n }\n break;\n case 2: //lowercase\n if (lowercaseCharacter){\n newPassword = newPassword + getLowerCharacter();\n }\n break;\n case 3: // number\n if ( numberCharacter){\n newPassword = newPassword + getNumberCharacter();\n }\n break;\n case 4: // Special charaxter\n if (specialCharacter){\n newPassword = newPassword + getSpecialCharacter();\n }\n break;\n }\n }\n \n return newPassword;\n }\n else{\n alert ('gracias')\n return \"\";\n }\n\n}", "title": "" }, { "docid": "e788c9967a0bfe13e4246c2aa87aab7d", "score": "0.6776114", "text": "function generatePassword() {\n //\n readInputs();\n //\n var nCharTypes = 0; // Number of character types\n var rndIndex = 0;\n var rndCharType = 0;\n var arrCharTypes = [];\n var arrPassword = [];\n var strPassword = \"\";\n\n // Push the selection of character types into an array\n if (lowerCharSel) {\n arrCharTypes.push(0);\n nCharTypes++;\n }\n\n if (upperCharSel) {\n arrCharTypes.push(1);\n nCharTypes++;\n }\n\n if (numberCharSel) {\n arrCharTypes.push(2);\n nCharTypes++;\n }\n\n if (specialCharSel) {\n arrCharTypes.push(3);\n nCharTypes++;\n }\n\n //\n for (var i = 0; i < intPassLength; i++) {\n // Generate a random number between 0 and nCharTypes\n // 0 = lowercase\n // 1 = uppercase\n // 2 = number\n // 3 = special character\n rndCharType = Math.floor(Math.random() * nCharTypes);\n\n // Case lowercase and uppercase\n if (arrCharTypes[rndCharType] == 0 || arrCharTypes[rndCharType] == 1) {\n // Generate a random number between 0 and 25\n rndIndex = Math.floor(Math.random() * 26);\n\n if (arrCharTypes[rndCharType] == 0) {\n // Pick a lowercase character\n arrPassword.push(lowerCharacters.charAt(rndIndex));\n } else {\n // Pick an uppercase character\n arrPassword.push(upperCharacters.charAt(rndIndex));\n }\n } else if (arrCharTypes[rndCharType] == 2) {\n // Generate a random number between 0 and 9\n rndIndex = Math.floor(Math.random() * 10);\n\n // Pick a number character\n arrPassword.push(numberCharacters.charAt(rndIndex));\n } else {\n // Generate a random number between 0 and 29\n rndIndex = Math.floor(Math.random() * 30);\n\n // Pick an special character\n arrPassword.push(specialCharacters.charAt(rndIndex));\n }\n }\n\n // Convert the array into a string\n arrPassword.forEach(function (key) {\n strPassword += key;\n });\n\n return strPassword;\n}", "title": "" }, { "docid": "d1390e86c4e88b500d0f1c5c39bd8269", "score": "0.6771996", "text": "function generatePassword() {\n var passwordLength = prompt(\"Please enter the number of characters you want your password to be. Must be between 8 and 128\");\n\n var numbers = confirm(\"Do you want numbers in your password?\");\n\n var lowerCases = confirm(\"Do you want lowercases in your password?\");\n\n var upperCases = confirm(\"Do you want uppercases in your password?\");\n\n var Special = confirm(\"Do you want special characters in your password?\");\n\n// Minimum character count\n var minimumCount = 0;\n\n var minimumNumbers = \"\";\n var minimumLowerCases = \"\";\n var minimumUpperCases = \"\";\n var minimumSpecialCharacters = \"\";\n\n// Generate Code\n\n var functionArray = {\n getNumbers: function() {\n return String.fromCharCode(Math.floor(Math.random() * 10 + 48));\n },\n\n getLowerCases: function() {\n return String.fromCharCode(Math.floor(Math.random() * 26 + 97));\n },\n\n getUpperCases: function() {\n return String.fromCharCode(Math.floor(Math.random() * 26 + 65));\n },\n\n getSpecialCharacters: function() {\n return specialCharacters[Math.floor(Math.random() * specialCharacters.length)]\n }\n\n };\n\n // if select check\n\n if (numbers === true) {\n minimumNumbers = functionArray.getNumbers();\n }\n\n if (lowerCases === true) {\n minimumLowerCases = functionArray.getLowerCases();\n minimumCount++;\n }\n\n if (upperCases === true) {\n minimumUpperCases = functionArray.getUpperCases();\n minimumCount++;\n }\n\n if (Special = true) {\n minimumSpecialCharacters = functionArray.getSpecialCharacters();\n minimumCount++;\n }\n\n // variable for loop below\n var randomPasswordGenerated = \"\";\n\n // random character loop\n for (var i = 0; i < (parseInt(passwordLength) - minimumCount); i++) {\n var randomNumberPicked = Math.floor(Math.random() * 4);\n\n randomPasswordGenerated += randomNumberPicked;\n\n }\n // character adding to password assurance\n\n randomPasswordGenerated += minimumNumbers;\n randomPasswordGenerated += minimumLowerCases;\n randomPasswordGenerated += minimumUpperCases;\n randomPasswordGenerated += minimumSpecialCharacters;\n\n return randomPasswordGenerated;\n\n}", "title": "" }, { "docid": "6a089752a5b0413e54d6b35c0e9c357d", "score": "0.6769316", "text": "function generatePassword() {\n\n //set complecity of password and variables\n let comp = document.getElementById(\"slider\").value;\n let symbBox = document.getElementById(\"symbol\");\n let numBox = document.getElementById(\"number\");\n let uppCase = document.getElementById(\"upper\");\n let lowCase = document.getElementById(\"lower\");\n\n const symbols = \"~!@#$%^&*()_+{}:?><;.,\";\n const numb = \"1234567890\";\n const upperCase = \"ABCDEFGHIJKLMNOPRSTUVWXYZ\";\n const lowerCase = \"abcdefghijklmnoprstuvwxyz\";\n let password = \"\";\n\n\n\n var char = \"\";\n (symbBox.checked) ? char += symbols : \"\";\n (numBox.checked) ? char += numb : \"\";\n (uppCase.checked) ? char += upperCase : \"\";\n (lowCase.checked) ? char += lowerCase : \"\";\n\n for (var i = 0; i < comp; i++) {\n password = password + char.charAt(Math.floor(Math.random() * (char.length - 1)));\n }\n //add password to display\n document.getElementById(\"display\").value = password;\n\n //add password to lastPasswords\n document.getElementById(\"lastPasswords\").innerHTML += password + \"<br/>\";\n\n}", "title": "" } ]
1a02fe080649138f68e9a3024fd1a407
initialise the problem space build array of arrays up to NUM cut into chunks of size SPLIT
[ { "docid": "6a7d7b5f51f627d47667e83e7028598f", "score": "0.7089963", "text": "function init() {\r\n const elves = [];\r\n\r\n let chunk = [];\r\n for (let i = 0; i < NUM; i += 1) {\r\n chunk.push(i + 1);\r\n if (chunk.length === SPLIT) {\r\n elves.push(chunk);\r\n chunk = [];\r\n }\r\n }\r\n elves.push(chunk);\r\n\r\n return elves;\r\n}", "title": "" } ]
[ { "docid": "5f40e60bd955e99543d1e9ed3eb448b1", "score": "0.64815474", "text": "function chunkArrayInGroups(arr, size) {\n\t \n\t var k=0, i, j, newArr=[[]],\n\t arrSize = arr.length,\n\t row = Math.ceil(arr.length/size);\n\n\t\tif(k < arrSize) {\n\n\t\t for (i = 0; i < row; i+=1){\n\t\t \tnewArr[i]=[];\n\n\t\t\t\tfor (j = 0; j < size; j+=1) {\n\t\t\t\t\tif(arr[k] == null){\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconsole.log(i,j);\n\t\t\t\t\tnewArr[i][j]=arr[k];\n\t\t\t\t\t++k;\n\t\t\t\t}\t\t\t\n\n\t\t\t}\n\t\t}\n\t return newArr;\n\t}", "title": "" }, { "docid": "404ec0bb0b466aab8ba65eaeebb88de7", "score": "0.64693654", "text": "function chunkArrayInGroups(arr, size) {\n let newArr=[],insideArr=[]\n let noOfArray=arr.length/size\n for(let j=0;j<noOfArray;j++){\n for(let i=0;i<size;i++){\n let elem=arr.shift()\n if(typeof elem !== 'undefined'){\n insideArr.push(elem)\n }\n }\n newArr.push(insideArr);\n insideArr=[];\n }\n return newArr;\n}", "title": "" }, { "docid": "fdfe9998ac92b7004fab56b68ce8592d", "score": "0.64531606", "text": "function chunk(array, size) {\n let noviArr = [];\n let numOfSubbarays = parseInt(array.length / size);\n\n if (array.length % size !== 0) {\n numOfSubbarays += 1;\n }\n\n for (let i = 0; i < numOfSubbarays * size; i += size) {\n noviArr.push(array.slice(i, i + size));\n }\n return noviArr;\n}", "title": "" }, { "docid": "0129f419cba363e02185c265e17d3cf9", "score": "0.6323386", "text": "function chunkArrayInGroups(arr, size) {\r\n//\tconsole.log(arr); debugging only\r\n//\tconsole.log(size);\r\n//\tconsole.log(arr.length);\r\n var x=0;\r\n var nArr=[];\r\n//console.log(arr.slice(0,2));\r\n for(var i=0;i<arr.length;i+=size)\r\n {\r\n nArr.push(arr.slice(i,size+i));\r\n x=i;\r\n }\r\n//garbage collector\r\n for(var a=0;a<=x;a++)\r\n {\r\n arr.shift();\r\n }\r\n\r\n//console.log(nArr); check condition\r\n//console.log(arr); check if garbage removed\r\n return nArr;\r\n}", "title": "" }, { "docid": "e7d62eb6664d0960ec10b29890830ac9", "score": "0.6229181", "text": "function splitArray(array) {\n let i,j,temparray,chunk = 10;\n let newArray = [];\n for (i=0,j=array.length; i<j; i+=chunk) {\n temparray = array.slice(i,i+chunk);\n newArray.push(temparray);\n }\n return newArray;\n }", "title": "" }, { "docid": "f95fd303d4245b2d91e83d0d370afc4f", "score": "0.6226693", "text": "function splitIntoChunk(arr, chunk) {\n\n for (i=0; i < arr.length; i += chunk) {\n\n let tempArray;\n tempArray = arr.slice(i, i + chunk);\n console.log(tempArray);\n }\n\n}", "title": "" }, { "docid": "aa4e926129b027d2c412cbb72822bca1", "score": "0.6224483", "text": "createChunks () {\n for (var i = 1; i <= Math.pow(this.mapSize, 2); i++) {\n this['chunk' + i] = []\n for (var j = 1; j <= Math.pow(this.chunkSize, 2); j++) {\n this['chunk' + i].push(0)\n }\n }\n }", "title": "" }, { "docid": "977afa1d8cd5c643e056aece085762c8", "score": "0.6197597", "text": "function chunk(arr, size) {\n\tconst result = []\n let temp = []\n\n for (let i = 0; i < arr.length; i++) {\n temp.push(arr[i])\n\n if (temp.length === size) {\n result.push(temp)\n temp = []\n }\n }\n\n if (temp.length) {\n result.push(temp)\n }\n\n return result\n}", "title": "" }, { "docid": "fc3bf72ce7a42950596495d12aafea4d", "score": "0.6197421", "text": "function chunkArrayInGroups(arr, size) {\n let tempArr = [];\n for (let i = 0; i < arr.length; i += size) {\n tempArr.push(arr.slice(i, i + size));\n }\n arr = tempArr;\n console.log(tempArr);\n return arr;\n }", "title": "" }, { "docid": "9074d53ad3d1c51c99debb1921dba0dd", "score": "0.6195073", "text": "function chunkArrayInGroups(arr, size) {\n var final_array = [];\n\tvar arr_length = arr.length;\n var start_number = 0;\n var new_sub_array = [];\n\tfor (var i = 1; i<=arr_length; i=i+size) {\n\t\tnew_slice = arr.slice(start_number,start_number+size);\n\t\tnew_sub_array.push(new_slice);\n start_number = start_number + size;\n\t}\n return new_sub_array;\n}", "title": "" }, { "docid": "fdcb3c64e6685a0683ca022f8d0fb68d", "score": "0.6175666", "text": "function chunkArrayInGroups(arr, size) {\n var newArr = [[]];\n var count = 0;\n for (var i = 0; i < arr.length ; i++) {\n if (newArr[count].length === size){\n count += 1;\n newArr.push([]);\n }\n newArr[count].push(arr[i]);\n }\n return newArr;\n}", "title": "" }, { "docid": "10a8c51a82c6ca15a89a5125d4ee3ad6", "score": "0.61724734", "text": "function chunk(arr, size) {\n // Break it up.\n var result = [],\n counter = 0;\n \n for(i=0; i < arr.length; i+=size) {\n var segment = [];\n \n for(var x=0; x<size; x++) {\n var index = counter+x;\n \n if(index < arr.length) {\n segment.push(arr[index]);\n }\n }\n \n result.push(segment);\n counter += size;\n }\n return result;\n}", "title": "" }, { "docid": "15806958aff349e3f7d7cc4095b0f1b0", "score": "0.61636585", "text": "function chunk(array, size) {\n \n //// MY SOLUTION:\n // let chunk = [[],[]];\n // for (let i = 0; i < array.length; i++) {\n // for (let j = 0; j < size; j++) {\n // if (array[i+j] !== undefined){\n // // console.log('===> '+array[i+j]);\n // console.log('===> '+chunk[i][j]+' - '+array[i+j]+' - '+i+' - '+j+' - '+size);\n // chunk[i][j] = array[i+j];\n // }\n // }\n // if(array[size+i] !== undefined) i=(size+i)-1;\n // }\n // return chunk;\n\n //// SOLUTION #1:\n const chunked = [];\n for(let element of array){\n const last = chunked[chunked.length - 1];\n if(!last || last.length === size){\n chunked.push([element]);\n }else{\n last.push(element);\n }\n }\n return chunked;\n}", "title": "" }, { "docid": "e59dddaa4342a23be1eedb6df3e1256f", "score": "0.61617464", "text": "function split(arr, size) {\n var arrays = [];\n while (arr.length > 0) {\n arrays.push(arr.splice(0, size));\n }\n return arrays;\n }", "title": "" }, { "docid": "e59dddaa4342a23be1eedb6df3e1256f", "score": "0.61617464", "text": "function split(arr, size) {\n var arrays = [];\n while (arr.length > 0) {\n arrays.push(arr.splice(0, size));\n }\n return arrays;\n }", "title": "" }, { "docid": "003f9db2186e3cffde103b759f481bf8", "score": "0.61564094", "text": "function chunk(arr, chunkSize) {\n return Array(Math.ceil(arr.length / chunkSize)).fill(undefined)\n .map((_, i) => arr.slice(i * chunkSize, (i + 1) * chunkSize));\n }", "title": "" }, { "docid": "3fcd77bf11148093741dde73a9b475c0", "score": "0.6143633", "text": "function chunkArrayInGroups(arr, size) {\n // Break it up.\n var tempArr = []; //temporary array\n var finalArray = []; //final two-dimensional array\n var k = size; //starting arr[] right index\n var n = 0; //starting arr[] left index \n while (k<=arr.length){\n tempArr = arr.slice(n, k);\n n+=size;\n k+=size;\n finalArray.push(tempArr);\n }\n /*when k index is bigger than the length of arr, stop incrementing k and n, \n slice the remaining members starting from the current n position and push them \n to finalArray */\n tempArr = arr.slice(n);\n if (tempArr.length !== 0){\n finalArray.push(tempArr);\n }\n \n return finalArray; \n}", "title": "" }, { "docid": "aaebaad0fb378c8e4a89d9d6741b6e28", "score": "0.6134514", "text": "function chunkArrayInGroups(arr, size) {\n let answer = [];\n\n let i =0;\n while (i < arr.length) {\n answer.push(arr.slice(i, i+size));\n i += size;\n }\n return answer;\n }", "title": "" }, { "docid": "2f3b8c207b74facfa56d5dc00fa74b38", "score": "0.6132511", "text": "function chunk(array, size) {\n var outerArr = [];\n for(let element of array){\n const innerArr = outerArr[outerArr.length - 1];\n if(!innerArr || innerArr.length === size){\n outerArr.push([element]);\n }else{\n innerArr.push(element);\n }\n }\n return outerArr;\n\n // or\n // var outerArr = [];\n // var idx = 0;\n // while(idx < array.length){\n // outerArr.push(array.slice(index, index + size));\n // idx = idx + size;\n // }\n\n}", "title": "" }, { "docid": "0d6b43917bedb60c09ce64479fa8d7ce", "score": "0.61297166", "text": "function split(arr, size) {\n var arrays = [];\n while(arr.length > 0) {\n arrays.push(arr.splice(0, size));\n }\n return arrays;\n }", "title": "" }, { "docid": "5aa4b1f28539b629f7f7f8b6638c2461", "score": "0.61277306", "text": "function arr(N){\n let newArray = [];\n let count = 0;\n while(count < N){\n newArray.push(count);\n count += 1;\n }\n return newArray;\n}", "title": "" }, { "docid": "c3066a8452573892e89b61015403e825", "score": "0.61273044", "text": "function chunk(array,size){\n let newArr=[]\n let i=0;\n while(i<array.length){\n console.log(\"value of i\",i)\n const spliced = array.slice(i,i+size)\n console.log(spliced)\n newArr.push(spliced)\n i+=size;\n }\n return newArr\n }", "title": "" }, { "docid": "d75623de2bad3d997f9083cd0743b09a", "score": "0.61245596", "text": "function chunk(array, size) {\n const results = [[]]\n\n for(let i = 0; i < array.length; i++) {\n if (results[results.length - 1].length === size) {\n results.push([])\n }\n \n results[results.length - 1].push(array[i])\n }\n\n return results\n}", "title": "" }, { "docid": "d583fd16572c4363f5d876da7a73b4b9", "score": "0.60932404", "text": "function chunkArrayInGroups(arr, size) {\n let cnt, reminder;\n let i;\n var arrR = [];\n\n cnt = Math.floor(arr.length/size);//NOTE: should floor, otherwise, 5/2 = 2.5, wrong\n reminder = arr.length%size;\n console.log(cnt);\n\n for(i=0; i< cnt; i++){\n arrR.push(arr.splice(0,size));\n }\n if(reminder){\n arrR.push(arr);\n }\n\n return arrR;\n}", "title": "" }, { "docid": "cc5b60b554300b358b3ef0ec5bae9fe0", "score": "0.60913783", "text": "function chunkArr(arr) {\n\n}", "title": "" }, { "docid": "a244488b316c9ec1973f8d73ed41bb67", "score": "0.6079564", "text": "function chunkArrayInGroups(arr, size) {\n\tconst newArr = [];\n\tconst initLength = arr.length / size;\n\tfor (var i = 0; i < initLength; i++) {\n\t\tnewArr.push(arr.slice(0, size));\n\t\tarr.splice(0, size);\n\t}\n\treturn newArr;\n}", "title": "" }, { "docid": "f9367a9041cfd50a50a351956719a3c9", "score": "0.60716414", "text": "function chunk(arr, size) {\n\n\tvar newArray = [];\n\tvar newSubArray = [];\n\t\n\tarr.forEach(function(elem) {\n\t\tif (newSubArray.length < size) {\n\t\t\tnewSubArray.push(elem);\n\t\t}\n\t\telse {\n\t\t\tnewArray.push(newSubArray);\n\t\t\tnewSubArray = [];\n\t\t\tnewSubArray.push(elem);\n\t\t}\n\t})\n\n\tif (newSubArray.length != 0) {\n\t\tnewArray.push(newSubArray);\n\t}\n\n\tarr = newArray;\n\n\treturn arr;\n}", "title": "" }, { "docid": "c8650090b57aef11265025b3bb063974", "score": "0.6065708", "text": "function arrayMaker(num, xLength, yLength) {\n let grid = [];\n for (let x = 0; x < xLength; x++) {\n grid.push([]);\n for (let y = 0; y < yLength; y++) {\n grid[x].push(num);\n }\n }\n return grid;\n}", "title": "" }, { "docid": "c8650090b57aef11265025b3bb063974", "score": "0.6065708", "text": "function arrayMaker(num, xLength, yLength) {\n let grid = [];\n for (let x = 0; x < xLength; x++) {\n grid.push([]);\n for (let y = 0; y < yLength; y++) {\n grid[x].push(num);\n }\n }\n return grid;\n}", "title": "" }, { "docid": "49b7029fe349f58b5ae4134183f27021", "score": "0.60558575", "text": "function chunkArrayInGroups(arr, size) {\n var result = [];\n console.log(arr.length)\n while (arr.length > size) {\n result.push(arr.splice(0, size))\n }\n console.log(arr.length)\n if (arr.length)\n result.push(arr);\n\n return console.log(result);\n}", "title": "" }, { "docid": "45846b75f99ae3ddcd8ead0e8cb0dcb5", "score": "0.60510343", "text": "function chunkArrayInGroups(arr, size) {\n let a = [];\n while(arr.length >0 ) {\n a.push(arr.splice(0, size))\n }\n return console.log(a)\n}", "title": "" }, { "docid": "7d8519331763e7affa67432b7203ccd3", "score": "0.6026728", "text": "function chunkArray(arr, len) {\n let newArr = [];\n let temp = [];\n let count = 0;\n for (let i = 0; i < arr.length; i++) {\n temp.push(arr[i]);\n count++;\n if (count === len) {\n newArr.push(temp);\n temp = [];\n count = 0;\n }\n }\n return newArr;\n}", "title": "" }, { "docid": "0cb217db9d446154560882f79e6eb592", "score": "0.6026145", "text": "function chunkArrayInGroups(arr, size) {\n let masterArr = []\n\n let item = 0;\n\n while(item < arr.length) {\n masterArr.push(arr.slice(item, item += size))\n }\n return masterArr;\n\n}", "title": "" }, { "docid": "3c5d1de6cabc221098fdbe5aec4e91a5", "score": "0.602411", "text": "function chunk(array, size) {\n\tvar r = [];\n\tvar limit = 1;\n\tvar subArray = [];\n\tfor (a of array) {\n\t\tif (limit < size) {\n\t\t\tsubArray.push(a);\n\t\t\tlimit++;\n\t\t} else if (limit === size) {\n\t\t\tsubArray.push(a);\n\t\t\tr.push(subArray);\n\t\t\tsubArray = [];\n\t\t\tlimit = 1;\n\t\t}\n\t}\n\n\tif (subArray.length > 0) {\n\t\tr.push(subArray);\n\t}\n\treturn r;\n}", "title": "" }, { "docid": "45c06aa44fd904c9f697019762a9b6ce", "score": "0.59988856", "text": "function chunkArrayInGroups(arr, size) {\n let newArray = [];\n for (let i = 0; i < arr.length; i = i + size) {\n newArray.push(arr.slice(i, i + size));\n }\n return newArray;\n }", "title": "" }, { "docid": "b20a784408247c401f9a41690e114ea4", "score": "0.5992003", "text": "function exports(arr, size) {\n\t var ret = [];\n\n\t size = size || 1;\n\n\t for (var i = 0, len = Math.ceil(arr.length / size); i < len; i++) {\n\t var start = i * size,\n\t end = start + size;\n\n\t ret.push(arr.slice(start, end));\n\t }\n\n\t return ret;\n\t }", "title": "" }, { "docid": "cde062d747b7284da72c7bccb66ff96e", "score": "0.59885424", "text": "function chunk(arr, size) {\n var newArr = [];\n for (var i = 0; i < arr.length; i += size) {\n newArr.push(arr.slice(i, i + size));\n }\n return newArr;\n }", "title": "" }, { "docid": "ad88f77502b118411793ba79db97f1c0", "score": "0.5985786", "text": "chunk(array, size = 1) {\n let arrayChunks = [];\n for (let i = 0; i < array.length; i += size) {\n let arrayChunk = array.slice(i, i + size);\n arrayChunks.push(arrayChunk);\n }\n return arrayChunks;\n }", "title": "" }, { "docid": "32f8c2ffa343c073b324cf83d0fd71c9", "score": "0.5976773", "text": "function chunkArrayInGroups(arr, size) {\n // Break it up.\n var tempArr = [];\n var sliced;\n\n for (var i = 0; i < arr.length; i += size ){\n sliced = arr.slice(i,i+size);\n tempArr.push(sliced);\n console.log( 's: ' + sliced);\n console.log( 'a: ' + tempArr);\n }\n console.log(tempArr);\n\n\n return tempArr;\n}", "title": "" }, { "docid": "7e3f1a14d4e889266867b61d1dd09b6b", "score": "0.5976107", "text": "function chunkArrayInGroups(arr, size) {\r\n let newArray = [];\r\n while (arr.length > 0) {\r\n // chops the array by the size parameter, in this case 2\r\n // [\"a\", \"b\", \"c\", \"d\"] becomes [\"c\", \"d\"]\r\n // arr.splice(0, size) is equal to [\"a\", \"b\"]\r\n let cutArray = arr.splice(0, size);\r\n // pieces of array will be sent to newArray, until the arr is completely cut through (arr.length < 0)\r\n newArray.push(cutArray);\r\n }\r\n return newArray;\r\n}", "title": "" }, { "docid": "9c4f7b197daa9ccf8564aebbd760a964", "score": "0.59745604", "text": "function chunkArrayInGroups(arr, size) {\n let arr2 = [];\n for (let i = 0; i < arr.length; i += size) {\n arr2.push(arr.slice(i, i + size));\n }\n return arr2;\n}", "title": "" }, { "docid": "a8502dbb223477a5b11014020408d0de", "score": "0.59610254", "text": "function chunkArrayInGroups(arr, size) {\r\n var newArr = [];\r\n while (arr.length) {\r\n newArr.push(arr.splice(0,size));\r\n }\r\n return newArr;\r\n}", "title": "" }, { "docid": "ddf387a31d2f5428c3b8f924bfe4e526", "score": "0.5959471", "text": "make2Darray(n){\n let array = [];\n for(let i=0; i<n; i++){\n array[i] = [];\n }\n return array;\n }", "title": "" }, { "docid": "4813af449429e0d9e3711cd9915fae7b", "score": "0.59527266", "text": "function arrayChunk(myArr,size){\n\tlet arrayChunk = [];\n\tlet index = 0;\n\twhile(index < myArr.length){\n\t\tarrayChunk.push(myArr.slice(index,index+size));\n\t\tindex = index + size;\n\t}\n\treturn arrayChunk;\n}", "title": "" }, { "docid": "bb2c607d83c68e4210e981607a1c1604", "score": "0.5931934", "text": "function chunk(arr, size) {\n var newArr = [];\n for (var i = 0; i < arr.length; i += size) {\n newArr.push(arr.slice(i, i + size));\n }\n return newArr;\n }", "title": "" }, { "docid": "614115540c01dda8c07112450bb7bf95", "score": "0.5928883", "text": "function chunk1(array, size) {\n newArray = []\n for (let i of array) {\n const last = newArray[newArray.length - 1]\n\n if (!last || last.length === size) {\n newArray.push([i])\n } else {\n last.push(i)\n }\n\n }\n return newArray\n}", "title": "" }, { "docid": "aa03ec7283633b53a4c6242afec3c2c0", "score": "0.5921142", "text": "function chunkArrayInGroups(arr, size) {\n return null;\n}", "title": "" }, { "docid": "c2f5390e109c6da29576d82a9a0895b0", "score": "0.59063923", "text": "function chunkArrayInGroups(arr, size) {\n\tvar output = [];\n\tvar count = 0;\n\twhile (count < arr.length) {\n\t\t// while our count is less than array length, take the sub array by slicing\n\t\tvar slice = arr.slice(count, count + size);\n\t\t// add this sub array to the output array\n\t\toutput.push(slice);\n\t\t// increment count by size\n\t\tcount += size;\n\t}\n\treturn output;\n}", "title": "" }, { "docid": "af8c3766999a3d22a6ed631747b44a95", "score": "0.59039646", "text": "function chunkArray(arr, len) {\n\n const q = [];\n\n for (let i = 0; i < arr.length; i+= len) {\n const l = arr.slice(i, i+len);\n q.push(l);\n console.log(l);\n }\n return q;\n}", "title": "" }, { "docid": "8b2a915ec2c4da937f03f0140636c88e", "score": "0.589779", "text": "function chunk(arr, size) {\n\tvar newArr = [];\n\tfor (var i=0; i<arr.length; i+=size) {\n\t\tnewArr.push(arr.slice(i, i+size));\n\t}\n\treturn newArr;\n}", "title": "" }, { "docid": "549f97118ba8b012ca71d110f0c12e66", "score": "0.5887535", "text": "function chunkyArrayInGroups(arr, size) {\n var temp = [];\n var result = [];\n\n for (var a = 0; a < arr.length; a++) {\n if (a % size !== size - 1) {\n temp.push(arr[a]); \n } else {\n temp.push(arr[a]);\n result.push(temp);\n temp = [];\n } \n }\n\n if (temp.length !== 0) {\n result.push(temp);\n }\n\n return result;\n}", "title": "" }, { "docid": "16bbf056715e4aeccd59086be2661552", "score": "0.588345", "text": "splitEvery(array, length) {\n\t\tlet retVal = [];\n\t\tif (array && array.length > 0) {\n\t\t\tfor (let i = 0; i < array.length; i += length) {\n\t\t\t\tretVal.push(i + length < array.length ? array.slice(i, i + length) : array.slice(i));\n\t\t\t}\n\t\t}\n\t\treturn retVal;\n\t}", "title": "" }, { "docid": "8fdc2391a1d5b94b2d45be76f1482ca3", "score": "0.58777726", "text": "function chunkArrayInGroups(arr, size) {\n let newArr = [];\n for(let i = 0; i < arr.length; i+=size) {\n newArr.push(arr.slice(i,size + i))\n }\n return newArr;\n}", "title": "" }, { "docid": "9239615d40e48dc11b5b53f085e01a6c", "score": "0.587768", "text": "function chunkArray(arr, len) {\n let newArr = [];\n let tinyArr = [];\n for (let i = 0; i < arr.length; i++) {\n tinyArr.push(arr[i]);\n if ((i + 1) % len === 0) {\n newArr.push(tinyArr);\n tinyArr = [];\n } else if ((i + 1) % len !== 0 && i === arr.length - 1) {\n newArr.push(tinyArr);\n }\n }\n return newArr;\n}", "title": "" }, { "docid": "31923eb4488fa1f01797b48170e838e3", "score": "0.58710915", "text": "function splitArray(arr, num) {\n let count = 0;\n for (i=0; i < arr.length; i = i+num) {\n let arr2 = [...arr].splice(i, i+num);\n arr[count] = arr2;\n count++;\n }\n let remainder = arr.length - count;\n for (j = 0; j < remainder; j++){\n arr.pop();\n }\n return arr;\n}", "title": "" }, { "docid": "d584983cd00c1d30ceeade26e2d189e2", "score": "0.58654493", "text": "function chunkArrayInGroups(arr, size) {\n\n var temp = [];\n var result = [];\n\n for (var a = 0; a < arr.length; a++) {\n if (a % size !== size - 1)\n temp.push(arr[a]);\n else {\n temp.push(arr[a]);\n result.push(temp);\n temp = [];\n }\n }\n\n if (temp.length !== 0)\n result.push(temp);\n return result;\n}", "title": "" }, { "docid": "2dc5ebd3d578400288d8b313d7093507", "score": "0.58610445", "text": "function chunk1(arr, size) {\n return arr.slice(0, (arr.length + size - 1)/size | 0)\n .map((c, i) => arr.slice(size * i, size * i + size));\n }", "title": "" }, { "docid": "198f84ef302f9ff36c0135503c60f0e9", "score": "0.58488864", "text": "function chunkArrayInGroups(arr, size) {\n var answer = [];\n var i = 0;\n\n while ( i < arr.length ) {\n answer.push(arr.slice(i, i + size));\n i += size;\n }\n return answer;\n}", "title": "" }, { "docid": "7fddd71469449e1bb55fd268e5eccf58", "score": "0.5847", "text": "function chunk(array, groupSize) {\n const groups = []\n for (let i = 0; i < array.length; i += groupSize) {\n groups.push(array.slice(i, i + groupSize))\n }\n return groups\n }", "title": "" }, { "docid": "acf4f4c792bd00a4c58c9f3f675ace6f", "score": "0.5841581", "text": "function chunkArrayInGroups(arr, size) {\n var newArr = [];\n var i = 0;\n\n while (i < arr.length) {\n newArr.push(arr.slice(i, i+size));\n i += size;\n }\n return newArr;\n}", "title": "" }, { "docid": "ee4eb6c3a9e89a1e60847726142cc1fb", "score": "0.58393025", "text": "function splitIntoChunk(arr, chunk) {\n let small = [];\n let i =0\n while (i < arr.length) {\n small.push(arr[i]);\n if (small.length == chunk){\n console.log(small);\n small = [];\n }\n i++; \n }\n\n}", "title": "" }, { "docid": "b2e5c31512de6103ec3cc8ac0604a0b0", "score": "0.58339745", "text": "function chunk( arr, size ) {\n var res = [];\n var len = arr === null ? 0 : arr.length;\n if ( size <= 0 || !len ) {\n return res;\n }\n\n size = size || 1;\n var index = 0;\n while ( index < len ) {\n var subArr = arr.slice( index, index + size );\n res.push( subArr );\n index += size;\n }\n return res;\n }", "title": "" }, { "docid": "5ce7053c1ca306d54c3d17ad84af2152", "score": "0.58296484", "text": "function chunk(array, size) {\n const res = [];\n let step = 0;\n\n while(array.length > step && size > 0) {\n res.push([...array.slice(step, step + size)]);\n step += size;\n }\n\n return res;\n}", "title": "" }, { "docid": "f0d61e640e13d0117895dffb3e75c3b5", "score": "0.5829278", "text": "function chunk(array, count) {\n if (count == null || count < 1) return [];\n var result = [];\n var i = 0, length = array.length;\n while (i < length) {\n result.push(slice.call(array, i, i += count));\n }\n return result;\n }", "title": "" }, { "docid": "f0d61e640e13d0117895dffb3e75c3b5", "score": "0.5829278", "text": "function chunk(array, count) {\n if (count == null || count < 1) return [];\n var result = [];\n var i = 0, length = array.length;\n while (i < length) {\n result.push(slice.call(array, i, i += count));\n }\n return result;\n }", "title": "" }, { "docid": "f0d61e640e13d0117895dffb3e75c3b5", "score": "0.5829278", "text": "function chunk(array, count) {\n if (count == null || count < 1) return [];\n var result = [];\n var i = 0, length = array.length;\n while (i < length) {\n result.push(slice.call(array, i, i += count));\n }\n return result;\n }", "title": "" }, { "docid": "f0d61e640e13d0117895dffb3e75c3b5", "score": "0.5829278", "text": "function chunk(array, count) {\n if (count == null || count < 1) return [];\n var result = [];\n var i = 0, length = array.length;\n while (i < length) {\n result.push(slice.call(array, i, i += count));\n }\n return result;\n }", "title": "" }, { "docid": "f0d61e640e13d0117895dffb3e75c3b5", "score": "0.5829278", "text": "function chunk(array, count) {\n if (count == null || count < 1) return [];\n var result = [];\n var i = 0, length = array.length;\n while (i < length) {\n result.push(slice.call(array, i, i += count));\n }\n return result;\n }", "title": "" }, { "docid": "f0d61e640e13d0117895dffb3e75c3b5", "score": "0.5829278", "text": "function chunk(array, count) {\n if (count == null || count < 1) return [];\n var result = [];\n var i = 0, length = array.length;\n while (i < length) {\n result.push(slice.call(array, i, i += count));\n }\n return result;\n }", "title": "" }, { "docid": "1f88d18be124572ffbebf141668df98d", "score": "0.58156824", "text": "function chunk1(array, size) {\n const container = [];\n while (array.length) {\n container.push(array.splice(0, size));\n }\n return container;\n}", "title": "" }, { "docid": "f904b47f2e04b3b32f1c613b49afd0e4", "score": "0.5813286", "text": "function chunk(arr, size){\n\tvar tempArray = [];\n\n return arr.map(function(item){\n if (tempArray.length < size){\n \ttempArray.push(item);\n }\n else{\n \treturn tempArray.splice(0, size);\n }\n })\n}", "title": "" }, { "docid": "1502c0fcccceee3eda2d5ea79d669eb2", "score": "0.5807804", "text": "function splitIntoGrids() {\n create3Darray();\n\n molecules.forEach(molecule => {\n const currentRow = Math.floor(molecule.position.x / colWidth);\n const currentCol = Math.floor(molecule.position.y / rowHeight);\n moleculeKey[currentCol][currentRow].push(molecule.moleculeId);\n });\n}", "title": "" }, { "docid": "ab2bf5ecbe96e4c2c369f10d45f48525", "score": "0.5805623", "text": "function chunkArrayInGroups(arr, size) {\n // Break it up.\n let result = []\n for (let i = 0; i < arr.length; i += size) {\n result.push(arr.slice(i, size + i))\n }\n return result\n}", "title": "" }, { "docid": "d00852e13fbf0f43a8bdd8ef9af88358", "score": "0.58036983", "text": "function chunkArrayInGroups(arr, size) {\n \n var result = [];\n \n for (var i = 0; i < arr.length; i += size) {\n \n result.push(arr.slice(i, i + size));\n }\n\n return result;\n}", "title": "" }, { "docid": "c38192d83e47dd63c890fcef492fd2a3", "score": "0.5803252", "text": "function chunk(arr, chunkSize) {\n var R = [];\n for (var i = 0, len = arr.length; i < len; i += chunkSize)\n R.push(arr.slice(i, i + chunkSize));\n return R;\n}", "title": "" }, { "docid": "f80ffc4e8a009d5df56e69c71dc27296", "score": "0.580212", "text": "function chunk(arr, len) {\n var chunks = [], i = 0, n = arr.length;\n while (i < n) {\n chunks.push(arr.slice(i, i += len));\n }\n return chunks;\n }", "title": "" }, { "docid": "1e9b421b86cf2c1534735a59b0e58bbb", "score": "0.58010405", "text": "function chunk(array, size) {\n var chunkedArray = [];\n // if(size===0 || array.length === size){\n // return array;\n // }\n\n for(let traverse = 0; traverse<array.length; traverse++){\n var innerArray = [];\n for(let init = 0; init<size;init++){\n if(array[traverse+init]){\n innerArray.push(array[traverse+init]);\n }else{\n break;\n }\n }\n traverse+=size-1;\n \n \n chunkedArray.push(innerArray);\n }\n return chunkedArray;\n}", "title": "" }, { "docid": "f592750f2f4c9a0457ec21a9c4bc2554", "score": "0.5793178", "text": "function createArrays(arr, arrays) {\n arrays = arrays || [];\n if (arr.length > 31) {\n arrays.push(arr.slice(0, 31));\n return createArrays(arr.slice(31), arrays);\n }\n arrays.push(arr);\n return arrays;\n }", "title": "" }, { "docid": "1e0acae2b8f6ebb06400d3634e3924e2", "score": "0.5785721", "text": "function buildArrays(rows, cols) {\n //creates an empty array that is rows x cols\n currentGen = new Array(rows);\n for (i = 0; i < rows; i++) {\n currentGen[i] = new Array(cols);\n }\n\n //fills the array with 0\n for(i = 0; i < rows; i++) {\n for(j = 0; j < cols; j++) {\n currentGen[i][j] = 0;\n }\n }\n \n //creates copies of the arrays\n nextGen = currentGen.map(function (arr) {\n return arr.slice();\n })\n startingGen = currentGen.map(function (arr) {\n return arr.slice();\n })\n}", "title": "" }, { "docid": "a53129a25bcf51ae08400884614c1b15", "score": "0.57823503", "text": "function chunkArrayInGroups(arr, size) {\n var totalArray = [];\n for (var i = 0; i < arr.length; i += size) {\n var slicedArray = arr.slice(i, i + size);\n totalArray.push(slicedArray);\n }\n return totalArray;\n}", "title": "" }, { "docid": "6602a353d5f8a350515608d22780c4c0", "score": "0.5782049", "text": "function makeBatches(size, batchSize) {\n const output = [];\n let batchStart = 0;\n let batchEnd = null;\n while (batchStart < size) {\n batchEnd = batchStart + batchSize;\n if (batchEnd >= size) {\n batchEnd = size;\n }\n output.push([batchStart, batchEnd]);\n batchStart = batchEnd;\n }\n return output;\n }", "title": "" }, { "docid": "1e9c0c943d17c7fcf5e8640972079e3d", "score": "0.57812786", "text": "function chunkArray (arr, len) {\n\tlet results = [];\n\tlet i = 0;\n\n\twhile (i < arr.length) {\n\t\tresults.push(arr.slice(i, i + len));\n\t\ti = i + len;\n\t}\n\treturn results;\n}", "title": "" }, { "docid": "4a8985d47248e3e89f1dc15c14455d22", "score": "0.5780884", "text": "function chunkArrayInGroups(arr, size) {\n let newArr = [];\n if (arr.length % size === 0) {\n for (let i = arr.length - 1; i > 0; i--) {\n let splice = arr.splice(arr.length - size);\n newArr.push(splice);\n }\n console.log(newArr);\n\n let finalArr = newArr.filter(e => e[0] !== undefined);\n return finalArr.reverse();\n } else {\n let remainder = arr.length % size;\n console.log(remainder);\n for (let i = 1; i > 0; i--) {\n let splice = arr.splice(arr.length - remainder);\n newArr.push(splice);\n }\n for (let i = arr.length - 1; i > 0; i--) {\n let splice = arr.splice(arr.length - size);\n newArr.push(splice);\n }\n let finalArr = newArr.filter(e => e[0] !== undefined);\n return finalArr.reverse();\n }\n}", "title": "" }, { "docid": "ddfbf366a29935a79b87bc5538afbd64", "score": "0.57804006", "text": "function chunkArrayInGroups(arr, size) {\n\tvar chunkedArr = [];\n\tfor (var i = 0; i < arr.length; i += size) {\n\t\tvar chunk = arr.slice(i, size + i);\n\t\tchunkedArr.push(chunk);\n\t}\n return chunkedArr;\n}", "title": "" }, { "docid": "73c262a07eb03b6e563d50601f5690e7", "score": "0.5777599", "text": "function cutArray(array, n) {\n return [array.slice(0, n), array.slice(n, array.length)]\n}", "title": "" }, { "docid": "f5d4138a5329f4a14d4feaf791d631be", "score": "0.57747614", "text": "function separate(array, noOfElements){\n console.log(\"started..\"); \n var result = _.chunk(array, noOfElements);\n // logic\n console.log(\"got result..\", result);\n}", "title": "" }, { "docid": "02af4f33e4efc0e9caa5014f992d9ac2", "score": "0.5764965", "text": "function chunkArrayInGroups(arr, size) {\n const result = [];\n const arrCopy = [...arr];\n while (arrCopy.length !== 0) {\n result.push(arrCopy.splice(0, size));\n }\n return result;\n}", "title": "" }, { "docid": "02b7117005d67fcf76f2c3e683f81137", "score": "0.57619673", "text": "function split(array, n) {\n var length = array.length\n var bins = [];\n var i = 0;\n\n while (i < length) {\n var size = Math.ceil((length - i) / n--);\n bins.push(array.slice(i, i + size));\n i += size;\n }\n\n return bins;\n}", "title": "" }, { "docid": "33453e7cf502c0546fe5cf4d2be3bf3b", "score": "0.5761405", "text": "function chunkArrayInGroups(arr, size) {\n const newArr = [];\n\n for (let i = 0; i < arr.length; i += size) {\n let copy = arr.slice(i, i + size);\n\n newArr.push(copy);\n }\n\n return newArr;\n}", "title": "" }, { "docid": "1bf6667ba330e43ef0aedafa44fba788", "score": "0.5746572", "text": "function chunkArrayInGroups(arr, size) {\n var result = [];\n for (var i = 0; i < arr.length; i += size) {\n result.push(arr.slice(i, i + size));\n }\n return result;\n}", "title": "" }, { "docid": "8dd2a57a890fcd6fed3e30ca1f6685bf", "score": "0.5744965", "text": "function chunkArr(myArray, chunkSize) {\n let tempArr = [];\n for (i = 0; i < myArray.length; i += chunkSize) {\n myChunk = myArray.slice(i, i + chunkSize);\n tempArr.push(myChunk);\n }\n\n return tempArr;\n}", "title": "" }, { "docid": "a18b114ad3bd21d508dc7fff88b1c92c", "score": "0.5734783", "text": "function chunk(array, size) {\n const result = []\n let index = 0\n\n while (index < array.length) {\n result.push(array.slice(index, index + size))\n index += size\n }\n\n return result\n}", "title": "" }, { "docid": "9d26bc6d48b8c173f852dafd89208a9d", "score": "0.57344615", "text": "function chunk(array, size) {\n return array.reduce((acc, el) => {\n const lastChunk = acc[acc.length - 1];\n if (lastChunk.length >= size) {\n acc.push([el]);\n } else {\n lastChunk.push(el);\n }\n return acc;\n }, [[]]);\n}", "title": "" }, { "docid": "f241af00c54d7af8c67c2c9537599809", "score": "0.57305914", "text": "static array_chunk(total, size = 5)\r\n\t{ \r\n \tif (isNaN(size)) {\r\n \t\tthrow new InvalidArgumentException('Common.array_chunk() expects the second parameter to be a number, but ' + typeof size + ' passed instead.')\r\n \t}\r\n\r\n \tsize = parseInt(size);\r\n \r\n \tlet i;\r\n \tlet collection = [];\r\n\r\n // add each chunk to the result\r\n for (i = 0; i < Math.ceil(total.length / size); i++) {\r\n \r\n var start = i * size;\r\n var end = start + size;\r\n \r\n collection.push(total.slice(start, end));\r\n \r\n }\r\n \r\n return collection;\r\n\t}", "title": "" }, { "docid": "e8afc360766661ae2285f173e635d4de", "score": "0.5722162", "text": "function splitToChunks(array, parts) {\n let result = [];\n for (let i = parts; i > 0; i--) {\n result.push(array.splice(0, Math.ceil(array.length / i)));\n }\n return result;\n}", "title": "" }, { "docid": "4b4a2140c3576aced82ab8afc6fa1fc5", "score": "0.5717865", "text": "function makeBatches(size, batchSize) {\n var output = [];\n var batchStart = 0;\n var batchEnd = null;\n while (batchStart < size) {\n batchEnd = batchStart + batchSize;\n if (batchEnd >= size) {\n batchEnd = size;\n }\n output.push([batchStart, batchEnd]);\n batchStart = batchEnd;\n }\n return output;\n}", "title": "" }, { "docid": "9b1dabd672205260dc8c6da1bc043986", "score": "0.5716777", "text": "static unpackNumbersToNestedArrays(data, numPerBlock) {\n const result = [];\n const n = data.length;\n let i = 0;\n let i1 = 0;\n while (i < n) {\n // there is at least one more value for a block\n const row = [];\n i1 = i + numPerBlock;\n if (i1 > n)\n i1 = n;\n for (; i < i1; i++) {\n row.push(data[i]);\n }\n result.push(row);\n }\n return result;\n }", "title": "" }, { "docid": "fb04c073b19df6f111569bd43fba02e3", "score": "0.5716471", "text": "function chunk(array, size) {\n return array.reduce((rows, currentValue, index) => {\n if (index % size === 0) {\n rows.push([currentValue]);\n } else {\n rows[rows.length - 1].push(currentValue);\n }\n\n return rows;\n }, []);\n}", "title": "" }, { "docid": "fb04c073b19df6f111569bd43fba02e3", "score": "0.5716471", "text": "function chunk(array, size) {\n return array.reduce((rows, currentValue, index) => {\n if (index % size === 0) {\n rows.push([currentValue]);\n } else {\n rows[rows.length - 1].push(currentValue);\n }\n\n return rows;\n }, []);\n}", "title": "" }, { "docid": "5e2483c78a95a0258d4263c1e5a94b8d", "score": "0.5716424", "text": "function splitToChunks(array, parts) {\n let chunkedArr = [];\n for (let i = parts; i > 0; i--) {\n chunkedArr.push(array.splice(0, Math.ceil(array.length / i)));\n }\n return chunkedArr;\n}", "title": "" } ]
6117c4843134c35dc00d338d608eddf5
Match the current native node against the predicate.
[ { "docid": "2867df944b6a3e91bff6584b0a63b251", "score": "0.546291", "text": "function _addQueryMatchR3(nativeNode, predicate, matches, elementsOnly, rootNativeNode) {\n if (rootNativeNode !== nativeNode) {\n const debugNode = getDebugNode$1(nativeNode);\n if (!debugNode) {\n return;\n }\n // Type of the \"predicate and \"matches\" array are set based on the value of\n // the \"elementsOnly\" parameter. TypeScript is not able to properly infer these\n // types with generics, so we manually cast the parameters accordingly.\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n }\n}", "title": "" } ]
[ { "docid": "367e2a148026d889ab9d5490e7130b4c", "score": "0.6198796", "text": "function _addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode) {\n if (rootNativeNode !== nativeNode) {\n const debugNode = getDebugNode(nativeNode);\n if (!debugNode) {\n return;\n }\n // Type of the \"predicate and \"matches\" array are set based on the value of\n // the \"elementsOnly\" parameter. TypeScript is not able to properly infer these\n // types with generics, so we manually cast the parameters accordingly.\n if (elementsOnly && (debugNode instanceof DebugElement) && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n }\n}", "title": "" }, { "docid": "ca58153913f7716152a496da3ce99a32", "score": "0.6006261", "text": "visitRegexpPredicate(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "798cb46d3224357d5d20ba323afe23b8", "score": "0.59008193", "text": "function matchNode (rule, node, nodeIndex, parent, props) {\n return matchType(rule, node) &&\n matchAttrs(rule, node) &&\n matchPseudos(rule, node, nodeIndex, parent, props);\n}", "title": "" }, { "docid": "60a3021966c0c01c47a42c1e66cae6f6", "score": "0.58656245", "text": "matches(selector){const el=this.node;return(el.matches||el.matchesSelector||el.msMatchesSelector||el.mozMatchesSelector||el.webkitMatchesSelector||el.oMatchesSelector).call(el,selector)}", "title": "" }, { "docid": "b387f86bec579aa25b1499f50aafa0b9", "score": "0.57376677", "text": "visitExpressionAtomPredicate(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "fa83fc003a7df7f017e34cdd9862ac74", "score": "0.5607232", "text": "function _nodeMatch(state, pattern, value, flags) {\n if(!('@id' in value)) {\n return false;\n }\n const nodeObject = state.subjects[value['@id']];\n return nodeObject && _filterSubject(state, nodeObject, pattern, flags);\n}", "title": "" }, { "docid": "fa83fc003a7df7f017e34cdd9862ac74", "score": "0.5607232", "text": "function _nodeMatch(state, pattern, value, flags) {\n if(!('@id' in value)) {\n return false;\n }\n const nodeObject = state.subjects[value['@id']];\n return nodeObject && _filterSubject(state, nodeObject, pattern, flags);\n}", "title": "" }, { "docid": "5ccd55df9ce95b2ea08690c49a15c947", "score": "0.5575026", "text": "match (predicate) {\n const outStream = new ReadableStream({ objectMode: true })\n outStream._read = IGNORE\n const fn = (typeof predicate === 'function')\n ? predicate\n : deepEqual.bind(null, predicate)\n this._matches.push([fn, outStream])\n return outStream\n }", "title": "" }, { "docid": "aa109a33c1eeccfdfe6e55facb8d8d3f", "score": "0.5567726", "text": "function _nodeMatch(state, pattern, value, flags) {\n if (!('@id' in value)) {\n return false;\n }\n\n const nodeObject = state.subjects[value['@id']];\n return nodeObject && _filterSubject(state, nodeObject, pattern, flags);\n}", "title": "" }, { "docid": "7b09166156c824d115a3f6319206d5d8", "score": "0.5504141", "text": "visitPredicateExpression(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "6cfdef2faa953c6b6cc1a5ed61a28f56", "score": "0.5496523", "text": "function _addQueryMatchR3(nativeNode, predicate, matches, elementsOnly, rootNativeNode) {\n if (rootNativeNode !== nativeNode) {\n var debugNode = getDebugNode(nativeNode);\n if (!debugNode) {\n return;\n }\n // Type of the \"predicate and \"matches\" array are set based on the value of\n // the \"elementsOnly\" parameter. TypeScript is not able to properly infer these\n // types with generics, so we manually cast the parameters accordingly.\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n }\n}", "title": "" }, { "docid": "a09573805ccc57f834217eee66212054", "score": "0.5468799", "text": "function _addQueryMatchR3(nativeNode, predicate, matches, elementsOnly, rootNativeNode) {\n if (rootNativeNode !== nativeNode) {\n var debugNode = getDebugNode$1(nativeNode);\n if (!debugNode) {\n return;\n }\n // Type of the \"predicate and \"matches\" array are set based on the value of\n // the \"elementsOnly\" parameter. TypeScript is not able to properly infer these\n // types with generics, so we manually cast the parameters accordingly.\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n }\n}", "title": "" }, { "docid": "d5ab41f9810c93dfb14b7701c3fbeac2", "score": "0.5412934", "text": "function matches(node, selector) {\n if (!matchesImpl) {\n var body = document.body;\n var nativeMatch = body.matches || body.matchesSelector || body.webkitMatchesSelector || body.mozMatchesSelector || body.msMatchesSelector;\n\n matchesImpl = function matchesImpl(n, s) {\n return nativeMatch.call(n, s);\n };\n }\n\n return matchesImpl(node, selector);\n}", "title": "" }, { "docid": "d5ab41f9810c93dfb14b7701c3fbeac2", "score": "0.5412934", "text": "function matches(node, selector) {\n if (!matchesImpl) {\n var body = document.body;\n var nativeMatch = body.matches || body.matchesSelector || body.webkitMatchesSelector || body.mozMatchesSelector || body.msMatchesSelector;\n\n matchesImpl = function matchesImpl(n, s) {\n return nativeMatch.call(n, s);\n };\n }\n\n return matchesImpl(node, selector);\n}", "title": "" }, { "docid": "5db472106fe85cf8afca00b496a840ca", "score": "0.5410173", "text": "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode$1(node);\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "title": "" }, { "docid": "5db472106fe85cf8afca00b496a840ca", "score": "0.5410173", "text": "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode$1(node);\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "title": "" }, { "docid": "5db472106fe85cf8afca00b496a840ca", "score": "0.5410173", "text": "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode$1(node);\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "title": "" }, { "docid": "5db472106fe85cf8afca00b496a840ca", "score": "0.5410173", "text": "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode$1(node);\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "title": "" }, { "docid": "5db472106fe85cf8afca00b496a840ca", "score": "0.5410173", "text": "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode$1(node);\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "title": "" }, { "docid": "5db472106fe85cf8afca00b496a840ca", "score": "0.5410173", "text": "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode$1(node);\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "title": "" }, { "docid": "5db472106fe85cf8afca00b496a840ca", "score": "0.5410173", "text": "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode$1(node);\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "title": "" }, { "docid": "5db472106fe85cf8afca00b496a840ca", "score": "0.5410173", "text": "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode$1(node);\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "title": "" }, { "docid": "5db472106fe85cf8afca00b496a840ca", "score": "0.5410173", "text": "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode$1(node);\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "title": "" }, { "docid": "5db472106fe85cf8afca00b496a840ca", "score": "0.5410173", "text": "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode$1(node);\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "title": "" }, { "docid": "b04282230ec9e47dc9b6ff7b3cfb5b53", "score": "0.53950214", "text": "function Predicate() {}", "title": "" }, { "docid": "b04282230ec9e47dc9b6ff7b3cfb5b53", "score": "0.53950214", "text": "function Predicate() {}", "title": "" }, { "docid": "fa37fed237449c8021beb4499eee9ac8", "score": "0.5326162", "text": "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode(node);\n if (debugNode) {\n if (elementsOnly && (debugNode instanceof DebugElement) && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "title": "" }, { "docid": "42a1548a0cefd3b747d14d6006cec334", "score": "0.53053844", "text": "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n var nodes = parentNode.childNodes;\n var length = nodes.length;\n for (var i = 0; i < length; i++) {\n var node = nodes[i];\n var debugNode = getDebugNode(node);\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "title": "" }, { "docid": "0a31aaac926f4733c930383091ac744e", "score": "0.5298873", "text": "visitInPredicate(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "c2e95c760b3c2bf56785afc292963272", "score": "0.52940494", "text": "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n var nodes = parentNode.childNodes;\n var length = nodes.length;\n for (var i = 0; i < length; i++) {\n var node = nodes[i];\n var debugNode = getDebugNode$1(node);\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "title": "" }, { "docid": "086f23f4b7fab18cffb370d53e2bab59", "score": "0.5264243", "text": "enterRegexpPredicate(ctx) {\n\t}", "title": "" }, { "docid": "8fecd5555408ae5571e10b883d2a4f59", "score": "0.5255379", "text": "visitLikePredicate(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "739cc3dce8f2011e6a10cbd2945ce9a5", "score": "0.51918936", "text": "function Predicate(){}", "title": "" }, { "docid": "af0d896a791935ca8e27f390615d2f5d", "score": "0.5174553", "text": "matches(selector) {\n const el = this.node;\n const matcher =\n el.matches ||\n el.matchesSelector ||\n el.msMatchesSelector ||\n el.mozMatchesSelector ||\n el.webkitMatchesSelector ||\n el.oMatchesSelector ||\n null;\n return matcher && matcher.call(el, selector);\n }", "title": "" }, { "docid": "5dcf5c2ed4979073bf367da440ee1fdf", "score": "0.5166753", "text": "function predicate(lhs, stream, a) {\n if (null == stream.trypop(\"[\")) return null;\n var expr = orExpr(stream, a);\n if (null == expr) throw new XPathException(XPathException.INVALID_EXPRESSION_ERR, \"Position \" + stream.position() + \": Expected expression after [\");\n if (null == stream.trypop(\"]\")) throw new XPathException(XPathException.INVALID_EXPRESSION_ERR, \"Position \" + stream.position() + \": Expected ] after expression.\");\n return a.node(\"Predicate\", lhs, expr);\n }", "title": "" }, { "docid": "f55ce36aae4cfaa15c27d4681b9b2518", "score": "0.5152527", "text": "function Predicate() { }", "title": "" }, { "docid": "f55ce36aae4cfaa15c27d4681b9b2518", "score": "0.5152527", "text": "function Predicate() { }", "title": "" }, { "docid": "f55ce36aae4cfaa15c27d4681b9b2518", "score": "0.5152527", "text": "function Predicate() { }", "title": "" }, { "docid": "f55ce36aae4cfaa15c27d4681b9b2518", "score": "0.5152527", "text": "function Predicate() { }", "title": "" }, { "docid": "5af8d8ef2321d74a41cf9d95982c656d", "score": "0.51384616", "text": "function findOne(tree, predicate) {\n var node;\n walk(tree, function (child) {\n if (predicate(child)) {\n predicate = function () {};\n node = child;\n }\n });\n return node;\n}", "title": "" }, { "docid": "c294ff64b0d782ec6e004d29bb8f57e3", "score": "0.51167613", "text": "_readPredicate(token) {\n const type = token.type;\n\n switch (type) {\n case 'inverse':\n this._inversePredicate = true;\n\n case 'abbreviation':\n this._predicate = this.ABBREVIATIONS[token.value];\n break;\n\n case '.':\n case ']':\n case '}':\n // Expected predicate didn't come, must have been trailing semicolon\n if (this._predicate === null) return this._error(`Unexpected ${type}`, token);\n this._subject = null;\n return type === ']' ? this._readBlankNodeTail(token) : this._readPunctuation(token);\n\n case ';':\n // Additional semicolons can be safely ignored\n return this._predicate !== null ? this._readPredicate : this._error('Expected predicate but got ;', token);\n\n case 'blank':\n if (!this._n3Mode) return this._error('Disallowed blank node as predicate', token);\n\n default:\n if ((this._predicate = this._readEntity(token)) === undefined) return;\n } // The next token must be an object\n\n\n return this._readObject;\n }", "title": "" }, { "docid": "1b8a88467465389a90f5b7695e31f5d3", "score": "0.5110519", "text": "_readPredicate(token) {\n const type = token.type;\n switch (type) {\n case 'inverse':\n this._inversePredicate = true;\n case 'abbreviation':\n this._predicate = this.ABBREVIATIONS[token.value];\n break;\n case '.':\n case ']':\n case '}':\n // Expected predicate didn't come, must have been trailing semicolon\n if (this._predicate === null)\n return this._error(`Unexpected ${type}`, token);\n this._subject = null;\n return type === ']' ? this._readBlankNodeTail(token) : this._readPunctuation(token);\n case ';':\n // Additional semicolons can be safely ignored\n return this._predicate !== null ? this._readPredicate :\n this._error('Expected predicate but got ;', token);\n case 'blank':\n if (!this._n3Mode)\n return this._error('Disallowed blank node as predicate', token);\n default:\n if ((this._predicate = this._readEntity(token)) === undefined)\n return;\n }\n // The next token must be an object\n return this._readObject;\n }", "title": "" }, { "docid": "d3145f2baeac838e8be3d48986500462", "score": "0.5086616", "text": "_readPredicate(token) {\n var type = token.type;\n switch (type) {\n case 'inverse':\n this._inversePredicate = true;\n case 'abbreviation':\n this._predicate = this.ABBREVIATIONS[token.value];\n break;\n case '.':\n case ']':\n case '}':\n // Expected predicate didn't come, must have been trailing semicolon\n if (this._predicate === null)\n return this._error('Unexpected ' + type, token);\n this._subject = null;\n return type === ']' ? this._readBlankNodeTail(token) : this._readPunctuation(token);\n case ';':\n // Additional semicolons can be safely ignored\n return this._predicate !== null ? this._readPredicate :\n this._error('Expected predicate but got ;', token);\n case 'blank':\n if (!this._n3Mode)\n return this._error('Disallowed blank node as predicate', token);\n default:\n if ((this._predicate = this._readEntity(token)) === undefined)\n return;\n }\n // The next token must be an object\n return this._readObject;\n }", "title": "" }, { "docid": "0f81cb6e0bb3029590b2594d1baf7358", "score": "0.5077283", "text": "visitBinaryComparasionPredicate(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "9501f951a3460632c74b592fc90f3731", "score": "0.5074353", "text": "_readPredicate(token) {\n var type = token.type;\n switch (type) {\n case 'inverse':\n this._inversePredicate = true;\n case 'abbreviation':\n this._predicate = this.ABBREVIATIONS[token.value];\n break;\n case '.':\n case ']':\n case '}':\n // Expected predicate didn't come, must have been trailing semicolon\n if (this._predicate === null)\n return this._error('Unexpected ' + type, token);\n this._subject = null;\n return type === ']' ? this._readBlankNodeTail(token) : this._readPunctuation(token);\n case ';':\n // Additional semicolons can be safely ignored\n return this._predicate !== null ? this._readPredicate :\n this._error('Expected predicate but got ;', token);\n case 'blank':\n if (!this._n3Mode)\n return this._error('Disallowed blank node as predicate', token);\n default:\n if ((this._predicate = this._readEntity(token)) === undefined)\n return;\n }\n // The next token must be an object\n return this._readObject;\n }", "title": "" }, { "docid": "53678d70a5955b8c081aee52f2a2898a", "score": "0.5067978", "text": "_readPredicate(token) {\n var type = token.type;\n\n switch (type) {\n case 'inverse':\n this._inversePredicate = true;\n\n case 'abbreviation':\n this._predicate = this.ABBREVIATIONS[token.value];\n break;\n\n case '.':\n case ']':\n case '}':\n // Expected predicate didn't come, must have been trailing semicolon\n if (this._predicate === null) return this._error('Unexpected ' + type, token);\n this._subject = null;\n return type === ']' ? this._readBlankNodeTail(token) : this._readPunctuation(token);\n\n case ';':\n // Additional semicolons can be safely ignored\n return this._predicate !== null ? this._readPredicate : this._error('Expected predicate but got ;', token);\n\n case 'blank':\n if (!this._n3Mode) return this._error('Disallowed blank node as predicate', token);\n\n default:\n if ((this._predicate = this._readEntity(token)) === undefined) return;\n } // The next token must be an object\n\n\n return this._readObject;\n }", "title": "" }, { "docid": "8e81408b67d37e7656077922f1e9f0c1", "score": "0.5046886", "text": "selector(node) {\n return true;\n }", "title": "" }, { "docid": "399fe1e197b7be65cbce9f3ae1547d67", "score": "0.5021191", "text": "function is(node, selector) {\n\t return (node.matches || node.webkitMatchesSelector || node.mozMatchesSelector || node.msMatchesSelector || node.oMatchesSelector).call(node, selector);\n\t}", "title": "" }, { "docid": "13f1d1ffb78a9e210fdbc3ea331019bd", "score": "0.49748972", "text": "function predicate(lhs, stream, a) {\n if (null == stream.trypop('[')) return null;\n var expr = orExpr(stream, a);\n if (null == expr)\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected expression after [');\n if (null == stream.trypop(']'))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected ] after expression.');\n return a.node('Predicate', lhs, expr);\n }", "title": "" }, { "docid": "13f1d1ffb78a9e210fdbc3ea331019bd", "score": "0.49748972", "text": "function predicate(lhs, stream, a) {\n if (null == stream.trypop('[')) return null;\n var expr = orExpr(stream, a);\n if (null == expr)\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected expression after [');\n if (null == stream.trypop(']'))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected ] after expression.');\n return a.node('Predicate', lhs, expr);\n }", "title": "" }, { "docid": "f8ac62dfeef60e59d889f7a9add62db2", "score": "0.49361846", "text": "enterPredicateExpression(ctx) {\n\t}", "title": "" }, { "docid": "c17cd28b2954674949ab13d6b3350855", "score": "0.4935173", "text": "visitSoundsLikePredicate(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "67c38fde13c25bf70198298ae5fc9534", "score": "0.48704252", "text": "static findAnyNode(body, callback) {\n\t\tthis.doesTypeObjectExist(body.labelName, function(bool, list) {\n\t\t\tlet didAddReturn = false\n\t\t\tif (bool) {\n\t\t\t\tlet session = db.session()\n\t\t\t\tlet stmt = \"MATCH (m:\" + body.labelName + \") \"\n\t\t\t\tif (body.contains && body.propertyName) {\n\t\t\t\t\tif (body.not) {\n\t\t\t\t\t\tstmt += \"WHERE NOT toUpper(m.\" + body.propertyName.toLowerCase() + \") CONTAINS('\" + body.contains.toUpperCase() + \"') \"\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstmt += \"WHERE toUpper(m.\" + body.propertyName.toLowerCase() + \") CONTAINS('\" + body.contains.toUpperCase() + \"') \"\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (body.contains && !body.propertyName) {\n\t\t\t\t\tif (body.not) {\n\t\t\t\t\t\tstmt += \"WHERE (none(prop in keys(m) where toUpper(toString(m[prop])) CONTAINS('\" + body.contains.toUpperCase() + \"'))) \"\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstmt += \"WHERE (any(prop in keys(m) where toUpper(toString(m[prop])) CONTAINS('\" + body.contains.toUpperCase() + \"'))) \"\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tstmt += \"RETURN ID(m)\"\n\t\t\t\t\tdidAddReturn = true\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif (!didAddReturn) {\n\t\t\t\t\tif (body.returnType) {\n\t\t\t\t\t\tif (body.returnType == \"everything\") {\n\t\t\t\t\t\t\tstmt += \"RETURN (m)\"\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tstmt += \"RETURN m.\" + body.returnType\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstmt += \"RETURN ID(m)\"\n\t\t\t\t\t\tdidAddReturn = true\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlet resultPromise = session.readTransaction(function(transaction) {\n\t\t\t\t\treturn transaction.run(stmt)\n\t\t\t\t})\n\t\t\t\tresultPromise.then(function(result) {\n\t\t\t\t\tsession.close()\n\t\t\t\t\tcallback(null, result)\n\t\t\t\t}).catch(function(result) {\n\t\t\t\t\tsession.close()\n\t\t\t\t\tcallback(errorMessages.neo4jError + result, null)\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tcallback(errorMessages.unknownLabel + list, null)\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "d50ae7dbc267714b73ab57bd269cb0e6", "score": "0.48639432", "text": "enterExpressionAtomPredicate(ctx) {\n\t}", "title": "" }, { "docid": "6031e0b21049b400fde0acc9727255c1", "score": "0.4861578", "text": "match(string, metadata = {depth: 0, parent: null}){\n var newMatchNode = new MatchNode()\n\n //matches, matchFound and matchLength need to be set in each case\n var matches = []\n var matchFound = false\n var matchLength = 0\n switch(this['friendly node type name']){\n case 'rule list':\n {\n //newMatchNode will be used as the parent node for all matches that are initiated by the current node\n //It is referred to at the end of the function\n let matchInfo = this.rules[0].match(string, {depth: 1, parent: newMatchNode})\n matchLength = matchInfo.matchLength\n matches = [matchInfo]\n matchFound = matchInfo.matchFound\n }\n break\n case 'rule':\n {\n let matchInfo = this.pattern.match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n matchLength = matchInfo.matchLength\n matches = [matchInfo]\n matchFound = matchInfo.matchFound\n\n newMatchNode.setProperties({name: this.name})\n }\n break\n case 'rule name':\n {\n let rule = this.parser.getRule(this.value)\n let matchInfo = rule.match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n matches = [matchInfo]\n matchFound = matchInfo.matchFound\n matchLength = matchInfo.matchLength\n newMatchNode.setProperties({value: this.value})\n }\n break\n case 'not':\n {\n let matchInfo = this['pattern'].match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n \n matchFound = !matchInfo.matchFound\n if (matchFound){\n matchLength = string.length\n }\n matches = [matchInfo]\n }\n break\n case 'ws allow both':\n {\n let leadingWhitespace = Strings.headMatch(string, Strings.whitespace_characters)\n \n let remainderString = string.substring(leadingWhitespace.length)\n let matchInfo = this['inner pattern'].match(remainderString,{depth: metadata.depth + 1, parent: newMatchNode})\n if (matchInfo.matchFound){\n let afterInnerPattern = remainderString.substring(matchInfo.matchLength)\n let trailingWhitespace = Strings.headMatch(afterInnerPattern, Strings.whitespace_characters)\n matchLength = leadingWhitespace.length + matchInfo.matchLength + trailingWhitespace.length\n }\n matches = [matchInfo]\n matchFound = matchInfo.matchFound\n }\n break\n case 'sequence':\n {\n let tempString = string\n let totalMatchLength = 0\n \n let matchInfo\n for (let i = 0; i < this['patterns'].length; i++){\n matchInfo = this['patterns'][i].match(tempString,{depth: metadata.depth + 1, parent: newMatchNode})\n matches.push(matchInfo)\n if (!matchInfo.matchFound){\n break;\n }else{\n totalMatchLength = totalMatchLength + matchInfo.matchLength\n tempString = tempString.substring(matchInfo.matchLength)\n }\n }\n matchFound = matchInfo.matchFound\n matchLength = totalMatchLength\n }\n break\n case 'or':\n {\n let matchInfo\n for (let i = 0; i < this.patterns.length; i++){\n matchInfo = this['patterns'][i].match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n matches.push(matchInfo)\n if (matchInfo.matchFound){\n break\n }\n }\n matchFound = matchInfo.matchFound\n matchLength = matchInfo.matchLength\n }\n break\n case 'and':\n {\n let matchInfo\n let andDetected = true\n \n for (let i = 0; i < this.patterns.length; i++){\n matchInfo = this['patterns'][i].match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n matches.push(matchInfo)\n if (!matchInfo.matchFound){\n andDetected = false\n matchLength = 0\n break\n }else{\n matchLength = matchInfo.matchLength\n }\n }\n \n //matchLength will be equal to the shortest match, or 0 if there was no match\n matchLength = match.matchLength\n\n matchFound = andDetected\n }\n break\n case 'multiple':\n {\n let tempString = string\n let totalMatchLength = 0\n \n let matchInfo = this.pattern.match(tempString,{depth: metadata.depth + 1, parent: newMatchNode})\n if (matchInfo.matchFound){\n matches.push(matchInfo)\n }\n while(matchInfo.matchFound){\n totalMatchLength = totalMatchLength + matchInfo.matchLength\n tempString = tempString.substring(matchInfo.matchLength)\n matchInfo = this.pattern.match(tempString,{depth: metadata.depth + 1, parent: this})\n matches.push(matchInfo)\n }\n\n if (matches.length > 0){\n matchFound = true\n }\n matchLength = totalMatchLength\n }\n break\n case 'quoted string':\n {\n //matches if the string starts with the quoted string\n let internalString = this['string']\n \n if (string.substring(0, internalString.length) == internalString){\n matchFound = true\n }\n \n if (matchFound){\n matchLength = internalString.length\n }\n newMatchNode.setProperties({string: this.string})\n }\n break\n case 'character class':\n {\n //matches if the string starts with characters from the character class\n let matchingString = ''\n //i is the number of characters to take for comparison\n //i goes from 1, 2, 3, ... to the length of the string\n for (let i = 1; i <= string.length; i++){\n let headString = string.substring(0,i)\n if (Strings.contains_only(headString,this['string'])){\n matchingString = headString\n }else{\n break\n }\n }\n \n if (matchingString.length > 0){\n matchFound = true\n matchLength = matchingString.length\n }\n }\n break\n case 'optional':\n {\n let matchInfo = this.pattern.match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n matches.push(matchInfo)\n matchLength = matchInfo.matchLength\n matchFound = true\n }\n break\n case 'exact':\n {\n let matchInfo = this.pattern.match(string,{depth: metadata.depth + 1, parent: newMatchNode})\n matches.push(matchInfo)\n if (matchInfo.matchFound && matchInfo.matchLength == string.length){\n matchLength = matchInfo.matchLength\n matchFound = true \n }\n }\n }\n\n let matchString = string.substring(0, matchLength)\n newMatchNode.setProperties({parent: metadata.parent, string, type: this['friendly node type name'], id: this.id, serial: this.parser.getMatchCount(), depth: metadata.depth, matchFound, matchLength, matchString, matches})\n return newMatchNode\n }", "title": "" }, { "docid": "08f92f3231ab43a4758872caa0115a1c", "score": "0.48558646", "text": "function match() {\n return true;\n}", "title": "" }, { "docid": "9c776ecd91a22d7843d0f8b0d19af66c", "score": "0.48522636", "text": "function createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) {\nvar shouldMatchPrimitives = isObject(expression) && (anyPropertyKey in expression);\nvar predicateFn;\n\nif (comparator === true) {\ncomparator = equals;\n} else if (!isFunction(comparator)) {\ncomparator = function(actual, expected) {\n if (isUndefined(actual)) {\n // No substring matching against `undefined`\n return false;\n }\n if ((actual === null) || (expected === null)) {\n // No substring matching against `null`; only match against `null`\n return actual === expected;\n }\n if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {\n // Should not compare primitives against objects, unless they have custom `toString` method\n return false;\n }\n\n actual = lowercase('' + actual);\n expected = lowercase('' + expected);\n return actual.indexOf(expected) !== -1;\n};\n}\n\npredicateFn = function(item) {\nif (shouldMatchPrimitives && !isObject(item)) {\n return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false);\n}\nreturn deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n};\n\nreturn predicateFn;\n}", "title": "" }, { "docid": "bb488603fe88067019f596569934feec", "score": "0.48499", "text": "function query(ast, selector) {\n return match(ast, parse(selector));\n }", "title": "" }, { "docid": "7df38addb369142f76be0ce4f03227fe", "score": "0.4839498", "text": "match(originalInput) {\r\n return this.attr('match', originalInput);\r\n }", "title": "" }, { "docid": "009ffad18fba8e7315a966878a00a3b6", "score": "0.48371992", "text": "matches(tree) {\r\n return this._matcher.match(tree, this).succeeded;\r\n }", "title": "" }, { "docid": "b7d1c1fbffd15aa7b65dbc49ba3fd4f9", "score": "0.48139602", "text": "visitLogicPredicate(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "42b03af453e6ffbce1d612a8e19cdd98", "score": "0.47747046", "text": "function InternalMatch(/*Node*/node, /*number*/ strength) {\r\n this.node = node;\r\n this.strength = strength;\r\n}", "title": "" }, { "docid": "d4d9e9d0d4cda2b895c80d45e79d75b4", "score": "0.4723644", "text": "function _queryNodeChildren(tNode, lView, predicate, matches, elementsOnly, rootNativeNode) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n const nativeNode = getNativeByTNodeOrNull(tNode, lView);\n // For each type of TNode, specific logic is executed.\n if (tNode.type & (3 /* TNodeType.AnyRNode */ | 8 /* TNodeType.ElementContainer */)) {\n // Case 1: the TNode is an element\n // The native node has to be checked.\n _addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode);\n if (isComponentHost(tNode)) {\n // If the element is the host of a component, then all nodes in its view have to be processed.\n // Note: the component's content (tNode.child) will be processed from the insertion points.\n const componentView = getComponentLViewByIndex(tNode.index, lView);\n if (componentView && componentView[TVIEW].firstChild) {\n _queryNodeChildren(componentView[TVIEW].firstChild, componentView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n else {\n if (tNode.child) {\n // Otherwise, its children have to be processed.\n _queryNodeChildren(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode);\n }\n // We also have to query the DOM directly in order to catch elements inserted through\n // Renderer2. Note that this is __not__ optimal, because we're walking similar trees multiple\n // times. ViewEngine could do it more efficiently, because all the insertions go through\n // Renderer2, however that's not the case in Ivy. This approach is being used because:\n // 1. Matching the ViewEngine behavior would mean potentially introducing a dependency\n // from `Renderer2` to Ivy which could bring Ivy code into ViewEngine.\n // 2. It allows us to capture nodes that were inserted directly via the DOM.\n nativeNode && _queryNativeNodeDescendants(nativeNode, predicate, matches, elementsOnly);\n }\n // In all cases, if a dynamic container exists for this node, each view inside it has to be\n // processed.\n const nodeOrContainer = lView[tNode.index];\n if (isLContainer(nodeOrContainer)) {\n _queryNodeChildrenInContainer(nodeOrContainer, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n else if (tNode.type & 4 /* TNodeType.Container */) {\n // Case 2: the TNode is a container\n // The native node has to be checked.\n const lContainer = lView[tNode.index];\n _addQueryMatch(lContainer[NATIVE], predicate, matches, elementsOnly, rootNativeNode);\n // Each view inside the container has to be processed.\n _queryNodeChildrenInContainer(lContainer, predicate, matches, elementsOnly, rootNativeNode);\n }\n else if (tNode.type & 16 /* TNodeType.Projection */) {\n // Case 3: the TNode is a projection insertion point (i.e. a <ng-content>).\n // The nodes projected at this location all need to be processed.\n const componentView = lView[DECLARATION_COMPONENT_VIEW];\n const componentHost = componentView[T_HOST];\n const head = componentHost.projection[tNode.projection];\n if (Array.isArray(head)) {\n for (let nativeNode of head) {\n _addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n else if (head) {\n const nextLView = componentView[PARENT];\n const nextTNode = nextLView[TVIEW].data[head.index];\n _queryNodeChildren(nextTNode, nextLView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n else if (tNode.child) {\n // Case 4: the TNode is a view.\n _queryNodeChildren(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode);\n }\n // We don't want to go to the next sibling of the root node.\n if (rootNativeNode !== nativeNode) {\n // To determine the next node to be processed, we need to use the next or the projectionNext\n // link, depending on whether the current node has been projected.\n const nextTNode = (tNode.flags & 2 /* TNodeFlags.isProjected */) ? tNode.projectionNext : tNode.next;\n if (nextTNode) {\n _queryNodeChildren(nextTNode, lView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}", "title": "" }, { "docid": "7af032acf04aa1cffdeac153d5f9b511", "score": "0.4718268", "text": "enterLikePredicate(ctx) {\n\t}", "title": "" }, { "docid": "3064729bdb0c10d54a6091c201b97883", "score": "0.46929803", "text": "function createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) {\n var shouldMatchPrimitives = isObject(expression) && anyPropertyKey in expression;\n var predicateFn;\n if (comparator === true) {\n comparator = equals;\n } else if (!isFunction(comparator)) {\n comparator = function (actual, expected) {\n if (isUndefined(actual)) {\n // No substring matching against `undefined`\n return false;\n }\n if (actual === null || expected === null) {\n // No substring matching against `null`; only match against `null`\n return actual === expected;\n }\n if (isObject(expected) || isObject(actual) && !hasCustomToString(actual)) {\n // Should not compare primitives against objects, unless they have custom `toString` method\n return false;\n }\n actual = lowercase('' + actual);\n expected = lowercase('' + expected);\n return actual.indexOf(expected) !== -1;\n };\n }\n predicateFn = function (item) {\n if (shouldMatchPrimitives && !isObject(item)) {\n return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false);\n }\n return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n };\n return predicateFn;\n }", "title": "" }, { "docid": "38985b1978dc120c617b7189f521c76c", "score": "0.468432", "text": "matches(tree) {\n return this._matcher.match(tree, this).succeeded;\n }", "title": "" }, { "docid": "38985b1978dc120c617b7189f521c76c", "score": "0.468432", "text": "matches(tree) {\n return this._matcher.match(tree, this).succeeded;\n }", "title": "" }, { "docid": "40b61249b0bc57c2f98450b2a9c5cf85", "score": "0.46818006", "text": "function applyXPathRule_(rule, path, options) {\n return path.indexOf(rule) == 0;\n}", "title": "" }, { "docid": "18d636b76a4d830a85deefff4d394f00", "score": "0.4680865", "text": "function find(predicate, thisArg) {\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate is not a function');\n }\n return function (source) { return source.lift(new FindValueOperator(predicate, source, false, thisArg)); };\n}", "title": "" }, { "docid": "9b187645872663d22ae70931372fa39c", "score": "0.4680034", "text": "function createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) {\n\t var shouldMatchPrimitives = isObject(expression) && (anyPropertyKey in expression);\n\t var predicateFn;\n\n\t if (comparator === true) {\n\t comparator = equals;\n\t } else if (!isFunction(comparator)) {\n\t comparator = function(actual, expected) {\n\t if (isUndefined(actual)) {\n\t // No substring matching against `undefined`\n\t return false;\n\t }\n\t if ((actual === null) || (expected === null)) {\n\t // No substring matching against `null`; only match against `null`\n\t return actual === expected;\n\t }\n\t if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {\n\t // Should not compare primitives against objects, unless they have custom `toString` method\n\t return false;\n\t }\n\n\t actual = lowercase('' + actual);\n\t expected = lowercase('' + expected);\n\t return actual.indexOf(expected) !== -1;\n\t };\n\t }\n\n\t predicateFn = function(item) {\n\t if (shouldMatchPrimitives && !isObject(item)) {\n\t return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false);\n\t }\n\t return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n\t };\n\n\t return predicateFn;\n\t}", "title": "" }, { "docid": "9b187645872663d22ae70931372fa39c", "score": "0.4680034", "text": "function createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) {\n\t var shouldMatchPrimitives = isObject(expression) && (anyPropertyKey in expression);\n\t var predicateFn;\n\n\t if (comparator === true) {\n\t comparator = equals;\n\t } else if (!isFunction(comparator)) {\n\t comparator = function(actual, expected) {\n\t if (isUndefined(actual)) {\n\t // No substring matching against `undefined`\n\t return false;\n\t }\n\t if ((actual === null) || (expected === null)) {\n\t // No substring matching against `null`; only match against `null`\n\t return actual === expected;\n\t }\n\t if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {\n\t // Should not compare primitives against objects, unless they have custom `toString` method\n\t return false;\n\t }\n\n\t actual = lowercase('' + actual);\n\t expected = lowercase('' + expected);\n\t return actual.indexOf(expected) !== -1;\n\t };\n\t }\n\n\t predicateFn = function(item) {\n\t if (shouldMatchPrimitives && !isObject(item)) {\n\t return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false);\n\t }\n\t return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n\t };\n\n\t return predicateFn;\n\t}", "title": "" }, { "docid": "6f707c57f5b2b07a5805d0de5f8a6e59", "score": "0.4676276", "text": "function matches(element, selector) {\n return Private$1.protoMatchFunc.call(element, selector);\n }", "title": "" }, { "docid": "dbb3fb66036b02ce8b74ed5948b92565", "score": "0.46545413", "text": "function onPredicate(predicate, convertPredicate, convertIntegerExpression, convertVariable) {\n if (/*your axiom does not cover this case*/ (true)) {\n return null // and it will be handled further by the system\n }\n /* Here you can convert all the predicate parts\n * you need by the means of `convertPredicate`,\n * `convertIntegerExpression`, and `convertVariable`\n * functions. The functions take only one argument,\n * which is either a predicate, an expression, or a variable.\n * The axiom set used by the functions is the one of the calling code.\n * Be cautious not to call `convertPredicate(predicate)`\n * here, as it will result in endless recursion.\n * To find out more about predicate representation struture\n * make sure to check the documentation (docs/ folder).\n */\n return '<predicate-simplify-representation>'\n}", "title": "" }, { "docid": "0be364faa6a577f1309d30aa8e9c6a00", "score": "0.46472558", "text": "function NodeMatcher(nodeTypeNum, nodeName, shouldLowerCase) {\n this.nodeTypeNum = nodeTypeNum;\n this.nodeName = nodeName;\n this.shouldLowerCase = shouldLowerCase;\n this.nodeNameTest =\n null == nodeName ? this._alwaysTrue :\n shouldLowerCase ? this._nodeNameLowerCaseEquals :\n this._nodeNameEquals;\n }", "title": "" }, { "docid": "0be364faa6a577f1309d30aa8e9c6a00", "score": "0.46472558", "text": "function NodeMatcher(nodeTypeNum, nodeName, shouldLowerCase) {\n this.nodeTypeNum = nodeTypeNum;\n this.nodeName = nodeName;\n this.shouldLowerCase = shouldLowerCase;\n this.nodeNameTest =\n null == nodeName ? this._alwaysTrue :\n shouldLowerCase ? this._nodeNameLowerCaseEquals :\n this._nodeNameEquals;\n }", "title": "" }, { "docid": "4f26b2b562187cac1fb4b8c741a3f222", "score": "0.46467876", "text": "function matches(element, selector) {\n return Private.protoMatchFunc.call(element, selector);\n }", "title": "" }, { "docid": "c0cda2bb5060df5a0befa633ccd1cf2d", "score": "0.46122065", "text": "function matchFromPredicateList(store, subject, predicates) {\n for (const predicate of predicates) {\n const match = store.getQuads(subject, predicate)\n\n if (match.length) return match\n }\n\n return null;\n}", "title": "" }, { "docid": "ee1977e5f25c2236560ec616bfef4982", "score": "0.46112815", "text": "function createPredicateFn(expression, comparator, matchAgainstAnyProp) {\n\t var shouldMatchPrimitives = isObject(expression) && ('$' in expression);\n\t var predicateFn;\n\n\t if (comparator === true) {\n\t comparator = equals;\n\t } else if (!isFunction(comparator)) {\n\t comparator = function(actual, expected) {\n\t if (isUndefined(actual)) {\n\t // No substring matching against `undefined`\n\t return false;\n\t }\n\t if ((actual === null) || (expected === null)) {\n\t // No substring matching against `null`; only match against `null`\n\t return actual === expected;\n\t }\n\t if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {\n\t // Should not compare primitives against objects, unless they have custom `toString` method\n\t return false;\n\t }\n\n\t actual = lowercase('' + actual);\n\t expected = lowercase('' + expected);\n\t return actual.indexOf(expected) !== -1;\n\t };\n\t }\n\n\t predicateFn = function(item) {\n\t if (shouldMatchPrimitives && !isObject(item)) {\n\t return deepCompare(item, expression.$, comparator, false);\n\t }\n\t return deepCompare(item, expression, comparator, matchAgainstAnyProp);\n\t };\n\n\t return predicateFn;\n\t}", "title": "" }, { "docid": "ee1977e5f25c2236560ec616bfef4982", "score": "0.46112815", "text": "function createPredicateFn(expression, comparator, matchAgainstAnyProp) {\n\t var shouldMatchPrimitives = isObject(expression) && ('$' in expression);\n\t var predicateFn;\n\n\t if (comparator === true) {\n\t comparator = equals;\n\t } else if (!isFunction(comparator)) {\n\t comparator = function(actual, expected) {\n\t if (isUndefined(actual)) {\n\t // No substring matching against `undefined`\n\t return false;\n\t }\n\t if ((actual === null) || (expected === null)) {\n\t // No substring matching against `null`; only match against `null`\n\t return actual === expected;\n\t }\n\t if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {\n\t // Should not compare primitives against objects, unless they have custom `toString` method\n\t return false;\n\t }\n\n\t actual = lowercase('' + actual);\n\t expected = lowercase('' + expected);\n\t return actual.indexOf(expected) !== -1;\n\t };\n\t }\n\n\t predicateFn = function(item) {\n\t if (shouldMatchPrimitives && !isObject(item)) {\n\t return deepCompare(item, expression.$, comparator, false);\n\t }\n\t return deepCompare(item, expression, comparator, matchAgainstAnyProp);\n\t };\n\n\t return predicateFn;\n\t}", "title": "" }, { "docid": "f26ca5cb109e7a4a4d715f6d58cb1aa6", "score": "0.46061623", "text": "async matchNode(path, criteria, options) {\n var _a;\n const tid = (_a = options === null || options === void 0 ? void 0 : options.tid) !== null && _a !== void 0 ? _a : acebase_core_1.ID.generate();\n const checkNode = async (path, criteria) => {\n if (criteria.length === 0) {\n return Promise.resolve(true); // No criteria, so yes... It matches!\n }\n const criteriaKeys = criteria.reduce((keys, cr) => {\n let key = cr.key;\n if (typeof key === 'string' && key.includes('/')) {\n // Descendant key criterium, use child key only (eg 'address' of 'address/city')\n key = key.slice(0, key.indexOf('/'));\n }\n if (keys.indexOf(key) < 0) {\n keys.push(key);\n }\n return keys;\n }, []);\n const unseenKeys = criteriaKeys.slice();\n let isMatch = true;\n const delayedMatchPromises = [];\n try {\n await this.getChildren(path, { tid, keyFilter: criteriaKeys }).next(childInfo => {\n var _a;\n const keyOrIndex = (_a = childInfo.key) !== null && _a !== void 0 ? _a : childInfo.index;\n unseenKeys.includes(keyOrIndex) && unseenKeys.splice(unseenKeys.indexOf(childInfo.key), 1);\n const keyCriteria = criteria\n .filter(cr => cr.key === keyOrIndex)\n .map(cr => ({ op: cr.op, compare: cr.compare }));\n const keyResult = keyCriteria.length > 0 ? checkChild(childInfo, keyCriteria) : { isMatch: true, promises: [] };\n isMatch = keyResult.isMatch;\n if (isMatch) {\n delayedMatchPromises.push(...keyResult.promises);\n const childCriteria = criteria\n .filter(cr => typeof cr.key === 'string' && cr.key.startsWith(`${typeof keyOrIndex === 'number' ? `[${keyOrIndex}]` : keyOrIndex}/`))\n .map(cr => {\n const key = cr.key.slice(cr.key.indexOf('/') + 1);\n return { key, op: cr.op, compare: cr.compare };\n });\n if (childCriteria.length > 0) {\n const childPath = acebase_core_1.PathInfo.getChildPath(path, childInfo.key);\n const childPromise = checkNode(childPath, childCriteria)\n .then(isMatch => ({ isMatch }));\n delayedMatchPromises.push(childPromise);\n }\n }\n if (!isMatch || unseenKeys.length === 0) {\n return false; // Stop iterating\n }\n });\n if (isMatch) {\n const results = await Promise.all(delayedMatchPromises);\n isMatch = results.every(res => res.isMatch);\n }\n if (!isMatch) {\n return false;\n }\n // Now, also check keys that weren't found in the node. (a criterium may be \"!exists\")\n isMatch = unseenKeys.every(keyOrIndex => {\n const childInfo = new node_info_1.NodeInfo(Object.assign(Object.assign(Object.assign({}, (typeof keyOrIndex === 'number' && { index: keyOrIndex })), (typeof keyOrIndex === 'string' && { key: keyOrIndex })), { exists: false }));\n const childCriteria = criteria\n .filter(cr => typeof cr.key === 'string' && cr.key.startsWith(`${typeof keyOrIndex === 'number' ? `[${keyOrIndex}]` : keyOrIndex}/`))\n .map(cr => ({ op: cr.op, compare: cr.compare }));\n if (childCriteria.length > 0 && !checkChild(childInfo, childCriteria).isMatch) {\n return false;\n }\n const keyCriteria = criteria\n .filter(cr => cr.key === keyOrIndex)\n .map(cr => ({ op: cr.op, compare: cr.compare }));\n if (keyCriteria.length === 0) {\n return true; // There were only child criteria, and they matched (otherwise we wouldn't be here)\n }\n const result = checkChild(childInfo, keyCriteria);\n return result.isMatch;\n });\n return isMatch;\n }\n catch (err) {\n this.debug.error(`Error matching on \"${path}\": `, err);\n throw err;\n }\n }; // checkNode\n /**\n *\n * @param child\n * @param criteria criteria to test\n */\n const checkChild = (child, criteria) => {\n const promises = [];\n const isMatch = criteria.every(f => {\n let proceed = true;\n if (f.op === '!exists' || (f.op === '==' && (typeof f.compare === 'undefined' || f.compare === null))) {\n proceed = !child.exists;\n }\n else if (f.op === 'exists' || (f.op === '!=' && (typeof f.compare === 'undefined' || f.compare === null))) {\n proceed = child.exists;\n }\n else if ((f.op === 'contains' || f.op === '!contains') && f.compare instanceof Array && f.compare.length === 0) {\n // Added for #135: empty compare array for contains/!contains must match all values\n proceed = true;\n }\n else if (!child.exists) {\n proceed = false;\n }\n else {\n if (child.address) {\n if (child.valueType === node_value_types_1.VALUE_TYPES.OBJECT && ['has', '!has'].indexOf(f.op) >= 0) {\n const op = f.op === 'has' ? 'exists' : '!exists';\n const p = checkNode(child.path, [{ key: f.compare, op }])\n .then(isMatch => {\n return { key: child.key, isMatch };\n });\n promises.push(p);\n proceed = true;\n }\n else if (child.valueType === node_value_types_1.VALUE_TYPES.ARRAY && ['contains', '!contains'].indexOf(f.op) >= 0) {\n // TODO: refactor to use child stream\n const p = this.getNode(child.path, { tid })\n .then(({ value: arr }) => {\n // const i = arr.indexOf(f.compare);\n // return { key: child.key, isMatch: (i >= 0 && f.op === \"contains\") || (i < 0 && f.op === \"!contains\") };\n const isMatch = f.op === 'contains'\n // \"contains\"\n ? f.compare instanceof Array\n ? f.compare.every(val => arr.includes(val)) // Match if ALL of the passed values are in the array\n : arr.includes(f.compare)\n // \"!contains\"\n : f.compare instanceof Array\n ? !f.compare.some(val => arr.includes(val)) // DON'T match if ANY of the passed values is in the array\n : !arr.includes(f.compare);\n return { key: child.key, isMatch };\n });\n promises.push(p);\n proceed = true;\n }\n else if (child.valueType === node_value_types_1.VALUE_TYPES.STRING) {\n const p = this.getNode(child.path, { tid })\n .then(node => {\n return { key: child.key, isMatch: this.test(node.value, f.op, f.compare) };\n });\n promises.push(p);\n proceed = true;\n }\n else {\n proceed = false;\n }\n }\n else if (child.type === node_value_types_1.VALUE_TYPES.OBJECT && ['has', '!has'].indexOf(f.op) >= 0) {\n const has = f.compare in child.value;\n proceed = (has && f.op === 'has') || (!has && f.op === '!has');\n }\n else if (child.type === node_value_types_1.VALUE_TYPES.ARRAY && ['contains', '!contains'].indexOf(f.op) >= 0) {\n const contains = child.value.indexOf(f.compare) >= 0;\n proceed = (contains && f.op === 'contains') || (!contains && f.op === '!contains');\n }\n else {\n let ret = this.test(child.value, f.op, f.compare);\n if (ret instanceof Promise) {\n promises.push(ret);\n ret = true;\n }\n proceed = ret;\n }\n }\n return proceed;\n }); // fs.every\n return { isMatch, promises };\n }; // checkChild\n return checkNode(path, criteria);\n }", "title": "" }, { "docid": "116e8f497f039b5665e5c85aea3c0bb8", "score": "0.4605835", "text": "function NodeMatcher(nodeTypeNum, nodeName, shouldLowerCase) {\n this.nodeTypeNum = nodeTypeNum;\n this.nodeName = nodeName;\n this.shouldLowerCase = shouldLowerCase;\n this.nodeNameTest = null == nodeName ? this._alwaysTrue : shouldLowerCase ? this._nodeNameLowerCaseEquals : this._nodeNameEquals;\n }", "title": "" }, { "docid": "3d8a741068f5b13d43a4c99322eff811", "score": "0.45950332", "text": "function createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) {\n var shouldMatchPrimitives = isObject(expression) && (anyPropertyKey in expression);\n var predicateFn;\n\n if (comparator === true) {\n comparator = equals;\n } else if (!isFunction(comparator)) {\n comparator = function(actual, expected) {\n if (isUndefined(actual)) {\n // No substring matching against `undefined`\n return false;\n }\n if ((actual === null) || (expected === null)) {\n // No substring matching against `null`; only match against `null`\n return actual === expected;\n }\n if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {\n // Should not compare primitives against objects, unless they have custom `toString` method\n return false;\n }\n\n actual = lowercase('' + actual);\n expected = lowercase('' + expected);\n return actual.indexOf(expected) !== -1;\n };\n }\n\n predicateFn = function(item) {\n if (shouldMatchPrimitives && !isObject(item)) {\n return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false);\n }\n return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n };\n\n return predicateFn;\n}", "title": "" }, { "docid": "3d8a741068f5b13d43a4c99322eff811", "score": "0.45950332", "text": "function createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) {\n var shouldMatchPrimitives = isObject(expression) && (anyPropertyKey in expression);\n var predicateFn;\n\n if (comparator === true) {\n comparator = equals;\n } else if (!isFunction(comparator)) {\n comparator = function(actual, expected) {\n if (isUndefined(actual)) {\n // No substring matching against `undefined`\n return false;\n }\n if ((actual === null) || (expected === null)) {\n // No substring matching against `null`; only match against `null`\n return actual === expected;\n }\n if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {\n // Should not compare primitives against objects, unless they have custom `toString` method\n return false;\n }\n\n actual = lowercase('' + actual);\n expected = lowercase('' + expected);\n return actual.indexOf(expected) !== -1;\n };\n }\n\n predicateFn = function(item) {\n if (shouldMatchPrimitives && !isObject(item)) {\n return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false);\n }\n return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n };\n\n return predicateFn;\n}", "title": "" }, { "docid": "3d8a741068f5b13d43a4c99322eff811", "score": "0.45950332", "text": "function createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) {\n var shouldMatchPrimitives = isObject(expression) && (anyPropertyKey in expression);\n var predicateFn;\n\n if (comparator === true) {\n comparator = equals;\n } else if (!isFunction(comparator)) {\n comparator = function(actual, expected) {\n if (isUndefined(actual)) {\n // No substring matching against `undefined`\n return false;\n }\n if ((actual === null) || (expected === null)) {\n // No substring matching against `null`; only match against `null`\n return actual === expected;\n }\n if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {\n // Should not compare primitives against objects, unless they have custom `toString` method\n return false;\n }\n\n actual = lowercase('' + actual);\n expected = lowercase('' + expected);\n return actual.indexOf(expected) !== -1;\n };\n }\n\n predicateFn = function(item) {\n if (shouldMatchPrimitives && !isObject(item)) {\n return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false);\n }\n return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n };\n\n return predicateFn;\n}", "title": "" }, { "docid": "3d8a741068f5b13d43a4c99322eff811", "score": "0.45950332", "text": "function createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) {\n var shouldMatchPrimitives = isObject(expression) && (anyPropertyKey in expression);\n var predicateFn;\n\n if (comparator === true) {\n comparator = equals;\n } else if (!isFunction(comparator)) {\n comparator = function(actual, expected) {\n if (isUndefined(actual)) {\n // No substring matching against `undefined`\n return false;\n }\n if ((actual === null) || (expected === null)) {\n // No substring matching against `null`; only match against `null`\n return actual === expected;\n }\n if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {\n // Should not compare primitives against objects, unless they have custom `toString` method\n return false;\n }\n\n actual = lowercase('' + actual);\n expected = lowercase('' + expected);\n return actual.indexOf(expected) !== -1;\n };\n }\n\n predicateFn = function(item) {\n if (shouldMatchPrimitives && !isObject(item)) {\n return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false);\n }\n return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n };\n\n return predicateFn;\n}", "title": "" }, { "docid": "3d8a741068f5b13d43a4c99322eff811", "score": "0.45950332", "text": "function createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) {\n var shouldMatchPrimitives = isObject(expression) && (anyPropertyKey in expression);\n var predicateFn;\n\n if (comparator === true) {\n comparator = equals;\n } else if (!isFunction(comparator)) {\n comparator = function(actual, expected) {\n if (isUndefined(actual)) {\n // No substring matching against `undefined`\n return false;\n }\n if ((actual === null) || (expected === null)) {\n // No substring matching against `null`; only match against `null`\n return actual === expected;\n }\n if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {\n // Should not compare primitives against objects, unless they have custom `toString` method\n return false;\n }\n\n actual = lowercase('' + actual);\n expected = lowercase('' + expected);\n return actual.indexOf(expected) !== -1;\n };\n }\n\n predicateFn = function(item) {\n if (shouldMatchPrimitives && !isObject(item)) {\n return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false);\n }\n return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n };\n\n return predicateFn;\n}", "title": "" }, { "docid": "3d8a741068f5b13d43a4c99322eff811", "score": "0.45950332", "text": "function createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) {\n var shouldMatchPrimitives = isObject(expression) && (anyPropertyKey in expression);\n var predicateFn;\n\n if (comparator === true) {\n comparator = equals;\n } else if (!isFunction(comparator)) {\n comparator = function(actual, expected) {\n if (isUndefined(actual)) {\n // No substring matching against `undefined`\n return false;\n }\n if ((actual === null) || (expected === null)) {\n // No substring matching against `null`; only match against `null`\n return actual === expected;\n }\n if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {\n // Should not compare primitives against objects, unless they have custom `toString` method\n return false;\n }\n\n actual = lowercase('' + actual);\n expected = lowercase('' + expected);\n return actual.indexOf(expected) !== -1;\n };\n }\n\n predicateFn = function(item) {\n if (shouldMatchPrimitives && !isObject(item)) {\n return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false);\n }\n return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n };\n\n return predicateFn;\n}", "title": "" }, { "docid": "3d8a741068f5b13d43a4c99322eff811", "score": "0.45950332", "text": "function createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) {\n var shouldMatchPrimitives = isObject(expression) && (anyPropertyKey in expression);\n var predicateFn;\n\n if (comparator === true) {\n comparator = equals;\n } else if (!isFunction(comparator)) {\n comparator = function(actual, expected) {\n if (isUndefined(actual)) {\n // No substring matching against `undefined`\n return false;\n }\n if ((actual === null) || (expected === null)) {\n // No substring matching against `null`; only match against `null`\n return actual === expected;\n }\n if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {\n // Should not compare primitives against objects, unless they have custom `toString` method\n return false;\n }\n\n actual = lowercase('' + actual);\n expected = lowercase('' + expected);\n return actual.indexOf(expected) !== -1;\n };\n }\n\n predicateFn = function(item) {\n if (shouldMatchPrimitives && !isObject(item)) {\n return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false);\n }\n return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n };\n\n return predicateFn;\n}", "title": "" }, { "docid": "3d8a741068f5b13d43a4c99322eff811", "score": "0.45950332", "text": "function createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) {\n var shouldMatchPrimitives = isObject(expression) && (anyPropertyKey in expression);\n var predicateFn;\n\n if (comparator === true) {\n comparator = equals;\n } else if (!isFunction(comparator)) {\n comparator = function(actual, expected) {\n if (isUndefined(actual)) {\n // No substring matching against `undefined`\n return false;\n }\n if ((actual === null) || (expected === null)) {\n // No substring matching against `null`; only match against `null`\n return actual === expected;\n }\n if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {\n // Should not compare primitives against objects, unless they have custom `toString` method\n return false;\n }\n\n actual = lowercase('' + actual);\n expected = lowercase('' + expected);\n return actual.indexOf(expected) !== -1;\n };\n }\n\n predicateFn = function(item) {\n if (shouldMatchPrimitives && !isObject(item)) {\n return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false);\n }\n return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n };\n\n return predicateFn;\n}", "title": "" }, { "docid": "3d8a741068f5b13d43a4c99322eff811", "score": "0.45950332", "text": "function createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) {\n var shouldMatchPrimitives = isObject(expression) && (anyPropertyKey in expression);\n var predicateFn;\n\n if (comparator === true) {\n comparator = equals;\n } else if (!isFunction(comparator)) {\n comparator = function(actual, expected) {\n if (isUndefined(actual)) {\n // No substring matching against `undefined`\n return false;\n }\n if ((actual === null) || (expected === null)) {\n // No substring matching against `null`; only match against `null`\n return actual === expected;\n }\n if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {\n // Should not compare primitives against objects, unless they have custom `toString` method\n return false;\n }\n\n actual = lowercase('' + actual);\n expected = lowercase('' + expected);\n return actual.indexOf(expected) !== -1;\n };\n }\n\n predicateFn = function(item) {\n if (shouldMatchPrimitives && !isObject(item)) {\n return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false);\n }\n return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n };\n\n return predicateFn;\n}", "title": "" }, { "docid": "3d8a741068f5b13d43a4c99322eff811", "score": "0.45950332", "text": "function createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) {\n var shouldMatchPrimitives = isObject(expression) && (anyPropertyKey in expression);\n var predicateFn;\n\n if (comparator === true) {\n comparator = equals;\n } else if (!isFunction(comparator)) {\n comparator = function(actual, expected) {\n if (isUndefined(actual)) {\n // No substring matching against `undefined`\n return false;\n }\n if ((actual === null) || (expected === null)) {\n // No substring matching against `null`; only match against `null`\n return actual === expected;\n }\n if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {\n // Should not compare primitives against objects, unless they have custom `toString` method\n return false;\n }\n\n actual = lowercase('' + actual);\n expected = lowercase('' + expected);\n return actual.indexOf(expected) !== -1;\n };\n }\n\n predicateFn = function(item) {\n if (shouldMatchPrimitives && !isObject(item)) {\n return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false);\n }\n return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n };\n\n return predicateFn;\n}", "title": "" } ]
0c15629a21d71ecbf9e69b1684511369
Store the db connection and start listening on a port.
[ { "docid": "439ea3533aaf623699fe4c60fe01c061", "score": "0.6027432", "text": "function startExpress(connection) {\n app._rdbConn = connection;\n app.listen(config.express.port);\n console.log('Listening on port ' + config.express.port);\n}", "title": "" } ]
[ { "docid": "230fb7660dfbe8af6e888035446407ce", "score": "0.6879286", "text": "function startServer() {\r\n\r\n\tconsole.log('Listening on port ' + port);\r\n\r\n\tdb.connect('./db/aston_events.sqlite3');\r\n\r\n}", "title": "" }, { "docid": "b0ae39dfe33c07acd5a2189a873e06b4", "score": "0.6581767", "text": "async function start() {\n try {\n await connectToDb();\n app.listen(port, () => console.log(`server listerning to port ${port}`) )\n } catch (error) {\n console.log(error)\n }\n}", "title": "" }, { "docid": "8f3c3d15052e31e05c57f4d0ee88e98e", "score": "0.6530887", "text": "function startServer() {\n let port = process.env.PORT || 3000;\n database.connect()\n .then(() => app.listen(port))\n .then(() => console.log(`Server Listening on ${port}`))\n .catch(err => console.error(err));\n}", "title": "" }, { "docid": "ac164c5c9dafeac1c63df6c08b76d084", "score": "0.6346515", "text": "function start(port) \n{\n //Create a server\n var service = http.createServer(handle);\n \n //Populate news stories\n try { database.serialize(populateNews); }\n catch(err) {}\n \n //Set a timer to keep news stories up to date\n setInterval(populateNews, 1000 * 60 * 60 * 12);\n \n //Start listening\n service.listen(port, 'localhost'); \n console.log(\"Server running at localhost:\" + port);\n}", "title": "" }, { "docid": "e2dfd2f4a27f2850b4e659651c09169c", "score": "0.63432217", "text": "function onListening(){\r\n var addr = server.address();\r\n var bind = typeof addr === 'string'\r\n ?'pipe' + addr\r\n :'port' + addr.port;\r\n ('Listening on' + bind);\r\n logger.info('server listening on port' + addr.port, 'serverOnListeningHandler',10);\r\n ///imp note the options in mongoose\r\n let db = mongoose.connect(appConfig.db.uri,{useNewUrlParser:true});//{ useMongoClient:true},\r\n}", "title": "" }, { "docid": "f96faee26723ac6b802cd920b2d3bdc2", "score": "0.63016516", "text": "function listen(conn) {\n if (conn.db._listening) {\n return;\n }\n conn.db._listening = true;\n\n conn.db.on('close', function(force) {\n if (conn._closeCalled) return;\n\n // the driver never emits an `open` event. auto_reconnect still\n // emits a `close` event but since we never get another\n // `open` we can't emit close\n if (conn.db.serverConfig.autoReconnect) {\n conn.readyState = STATES.disconnected;\n conn.emit('close');\n return;\n }\n conn.onClose(force);\n });\n conn.db.on('error', function(err) {\n conn.emit('error', err);\n });\n conn.db.on('reconnect', function() {\n conn.readyState = STATES.connected;\n conn.emit('reconnect');\n conn.emit('reconnected');\n conn.onOpen();\n });\n conn.db.on('timeout', function(err) {\n conn.emit('timeout', err);\n });\n conn.db.on('open', function(err, db) {\n if (STATES.disconnected === conn.readyState && db && db.databaseName) {\n conn.readyState = STATES.connected;\n conn.emit('reconnect');\n conn.emit('reconnected');\n }\n });\n conn.db.on('parseError', function(err) {\n conn.emit('parseError', err);\n });\n}", "title": "" }, { "docid": "1bbfb77b87dd0cd116af70df40accb8b", "score": "0.62390053", "text": "function listen(conn) {\n\t if (conn.db._listening) {\n\t return;\n\t }\n\t conn.db._listening = true;\n\n\t conn.db.on('close', function() {\n\t if (conn._closeCalled) return;\n\n\t // the driver never emits an `open` event. auto_reconnect still\n\t // emits a `close` event but since we never get another\n\t // `open` we can't emit close\n\t if (conn.db.serverConfig.autoReconnect) {\n\t conn.readyState = STATES.disconnected;\n\t conn.emit('close');\n\t return;\n\t }\n\t conn.onClose();\n\t });\n\t conn.db.on('error', function(err) {\n\t conn.emit('error', err);\n\t });\n\t conn.db.on('reconnect', function() {\n\t conn.readyState = STATES.connected;\n\t conn.emit('reconnected');\n\t });\n\t conn.db.on('timeout', function(err) {\n\t var error = new Error(err && err.err || 'connection timeout');\n\t conn.emit('error', error);\n\t });\n\t conn.db.on('open', function(err, db) {\n\t if (STATES.disconnected === conn.readyState && db && db.databaseName) {\n\t conn.readyState = STATES.connected;\n\t conn.emit('reconnected');\n\t }\n\t });\n\t conn.db.on('parseError', function(err) {\n\t conn.emit('parseError', err);\n\t });\n\t}", "title": "" }, { "docid": "54d20186352d5ae7d6202983cd1d432a", "score": "0.61000705", "text": "function startServer(){\n\t// Define a porta 8080 onde será executada nossa aplicação\n\tvar server = app.listen(27017, function(){\n\t\tvar port = server.address().port;\n\t\t// Imprime uma mensagem no console na porta em que a aplicação está rodando\n\t\tconsole.log(\"Aplicação executada na porta: \"+port);\n\t});\n}", "title": "" }, { "docid": "61fada6526652f577e7d6899013f1a89", "score": "0.6059293", "text": "function onHttpStart() {\n console.log(\"Express http server listening on: \" + HTTP_PORT);\n //connect to mongoDB database\n mongoose.connect(uri || connectionString, { useCreateIndex: true, useNewUrlParser: true, useUnifiedTopology: true });\n mongoose.connection.on(\"open\", () => {\n console.log(\"Database connection open.\");\n });\n}", "title": "" }, { "docid": "d3bbf4c652de2aa626d80c831804e67a", "score": "0.60551345", "text": "async function startServer() {\n try {\n await db.sync()\n app.listen(PORT, () => {\n console.log(`Getting swole on port ${PORT}`)\n })\n } catch (err) {\n console.error(err)\n }\n}", "title": "" }, { "docid": "47e1032635e63c8f63a8ec0b783b4814", "score": "0.60343724", "text": "function onDBListening() {\n console.log(\"Connected correctly to server\");\n}", "title": "" }, { "docid": "943e730a7075134937d1f5829260b708", "score": "0.6003819", "text": "function setConnection( _host, _port ) {\n\n\t// Set mongo options\n\thost = (typeof(_host) !== \"string\") ? DEFAULT_HOST : _host;\n\tport = (typeof(_port) !== \"number\") ? DEFAULT_PORT : _port;\n\n\t// Set connection to database\n\tconnection = new couchbase.Cluster(host+\":\"+port);\n}", "title": "" }, { "docid": "0e4701a4d45d04bd9a40d8a0d8d09249", "score": "0.599426", "text": "function listen() {\n var port = server.address().port;\n}", "title": "" }, { "docid": "460baa8319f8843d250093fd78171dcd", "score": "0.59823906", "text": "function BeginListening() {\n EndListening();\n isListening = true;\n myDB.on(\"data\", HandleListening);\n }", "title": "" }, { "docid": "d20cc51a7b90e36336c9433c3eafaed9", "score": "0.597474", "text": "function listen(publicPort) {\n var server = Net.createServer();\n server.on('connection', function(socket) {\n var containerPort = publicToContainer[publicPort];\n connect(socket, containerPort);\n });\n // Typically EADDRINUSE\n server.on('error', console.error);\n server.listen(publicPort);\n}", "title": "" }, { "docid": "0b3682cd0e165d64f9929fd89cac7ac6", "score": "0.59729505", "text": "listen(port) {\r\n this._server.listen(port);\r\n }", "title": "" }, { "docid": "3c43070dd7484477ab1525810e5b3eb9", "score": "0.59411293", "text": "async function start() {\n await mongoose.connect(process.env.DATABASE_URL, {\n useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true\n });\n\n app.listen(process.env.PORT || 3036, () => {\n console.log('Server is running');\n });\n}", "title": "" }, { "docid": "13fd9d146e9938159547908b4836e073", "score": "0.5925227", "text": "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string' ? 'pipe' + addr : 'port' + addr.port;\n debug('Acessível em ' + bind);\n}", "title": "" }, { "docid": "f8db3068fe7f07c1f26c92c89fa46b72", "score": "0.59149635", "text": "function serverListen() {\n server.listen(port, HOST_NAME, serverListen.connect);\n}", "title": "" }, { "docid": "e24c4bfde290e87ad16b5fc655234d42", "score": "0.59142554", "text": "function runServer(databaseUrl, port = PORT) {\n return new Promise((resolve, reject) => {\n mongoose.connect(\n databaseUrl,\n { useNewUrlParser: true },\n err => {\n if (err) {\n return reject(err);\n }\n server = app\n .listen(port, () => {\n console.log(`Your app is listening on port ${port}`);\n resolve();\n })\n .on(\"error\", err => {\n mongoose.disconnect();\n reject(err);\n });\n }\n );\n });\n}", "title": "" }, { "docid": "bfd53b7164d247927f839b95560e1709", "score": "0.5910616", "text": "function runServer(databaseUrl = DATABASE_URL, port = PORT) {\n return new Promise((resolve, reject) => {\n mongoose.connect(databaseUrl, err => {\n if (err) {\n return reject(err);\n }\n server = app\n .listen(port, () => {\n console.log(`Your app is listening on port ${port}`);\n resolve();\n })\n .on(\"error\", err => {\n mongoose.disconnect();\n reject(err);\n });\n });\n });\n}", "title": "" }, { "docid": "f30cd417a35ad85359d9e7bf0199aabf", "score": "0.59094316", "text": "start() {\n this.server = this.app.listen(this.config.server.port, () => {\n this.logger.info('Server started on port ' + this.config.server.port);\n });\n }", "title": "" }, { "docid": "9d75203dad4741cb02dcdeac22ed7e7b", "score": "0.59060174", "text": "async start() {\n const server = await this.server\n const url = server.getUri()\n console.log('DB Helper : ', url)\n await connect(url)\n }", "title": "" }, { "docid": "79129b2efc06458e24c5b1e581e1be49", "score": "0.58993864", "text": "async function start() {\r\n\ttry {\r\n\t\tawait mongoose.connect(process.env.SOCKET_MONGO_DB, {\r\n\t\t\tuseCreateIndex: true,\r\n\t\t\tuseNewUrlParser: true,\r\n\t\t\tuseFindAndModify: false,\r\n\t\t\tuseUnifiedTopology: true,\r\n\t\t});\r\n\r\n\t\tio.listen(port);\r\n\t\tconsole.log('listening on port ', port);\r\n\t} catch (error) {\r\n\t\tconsole.log(error);\r\n\t}\r\n}", "title": "" }, { "docid": "98251d8c7e2d90d01e323c77686ffea8", "score": "0.58916044", "text": "function listen() {\n app.listen(port);\n console.log(`Listening on port ${port}.`);\n}", "title": "" }, { "docid": "0988ccced1afe5ab4fe9286e4682d445", "score": "0.58775485", "text": "function runServer(databaseUrl = DATABASE_URL, port = PORT) {\n return new Promise((resolve, reject) => {\n mongoose.connect(databaseUrl, { }, err => {\n if (err) {\n return reject(err);\n }\n server = app.listen(port, () => {\n console.log(`Your app is listening on port ${port}`);\n resolve();\n })\n .on('error', err => {\n mongoose.disconnect();\n reject(err);\n });\n });\n });\n}", "title": "" }, { "docid": "c96e74a0eccbc232a6ee185b101bc51c", "score": "0.587614", "text": "configureDatabase() {\n database.connect();\n }", "title": "" }, { "docid": "e49271fc0f3ebe6a7c13c9370a990a23", "score": "0.5868966", "text": "function startServer() {\r\n\tconst app = require('../app');\r\n\tconst debug = require('debug')('express:server');\r\n\tconst http = require('http');\r\n\r\n\t/**\r\n\t * Get port from environment and store in Express.\r\n\t */\r\n\tvar port = normalizePort(process.env.PORT || '3000');\r\n\tapp.set('port', port);\r\n\r\n\t/**\r\n\t * Create HTTP server.\r\n\t */\r\n\tvar server = http.createServer(app);\r\n\r\n\t/**\r\n\t * Listen on provided port, on all network interfaces.\r\n\t */\r\n\tserver.listen(port);\r\n\tserver.on('error', onError);\r\n\tserver.on('listening', onListening);\r\n\r\n\t/**\r\n\t * Normalize a port into a number, string, or false.\r\n\t */\r\n\tfunction normalizePort(val) {\r\n\t \tvar port = parseInt(val, 10);\r\n\r\n\t \tif (isNaN(port)) {\r\n\t\t\t// named pipe\r\n\t\t\treturn val;\r\n\t\t}\r\n\r\n\t\tif (port >= 0) {\r\n\t\t\t// port number\r\n\t\t\treturn port;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t* Event listener for HTTP server \"error\" event.\r\n\t*/\r\n\tfunction onError(error) {\r\n\t\tif (error.syscall !== 'listen') {\r\n\t\t\tthrow error;\r\n\t\t}\r\n\r\n\t\tvar bind = typeof port === 'string'\r\n\t\t\t? 'Pipe ' + port\r\n\t\t\t: 'Port ' + port;\r\n\r\n\t\t// handle specific listen errors with friendly messages\r\n\t\tswitch (error.code) {\r\n\t\t\tcase 'EACCES':\r\n\t\t\t\tconsole.error(bind + ' requires elevated privileges');\r\n\t\t\t\tprocess.exit(1);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'EADDRINUSE':\r\n\t\t\t\tconsole.error(bind + ' is already in use');\r\n\t\t\t\tprocess.exit(1);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tthrow error;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t* Event listener for HTTP server \"listening\" event.\r\n\t*/\r\n\tfunction onListening() {\r\n\t\tvar addr = server.address();\r\n\t\tvar bind = typeof addr === 'string'\r\n\t\t\t? 'pipe ' + addr\r\n\t\t\t: 'port ' + addr.port;\r\n\t\tconsole.log('Listening for connections on ' + bind);\r\n\t}\r\n}", "title": "" }, { "docid": "1c761d20e326b232367ab13955f12e3b", "score": "0.586329", "text": "function runServer(databaseUrl = DATABASE_URL, port=PORT) {\n return new Promise((resolve, reject) => {\n mongoose.connect(databaseUrl, {useNewUrlParser: true}, err => {\n if (err) {\n return reject(err);\n }\n server = app.listen(port, () => {\n console.log(`Your app is listening on port ${port}`);\n resolve();\n })\n .on('error', err => {\n mongoose.disconnect();\n reject(err);\n });\n });\n });\n}", "title": "" }, { "docid": "6644fde5e615051f954d30204082445f", "score": "0.58626354", "text": "function runServer(databaseUrl = DATABASE_URL, port = PORT) {\n return new Promise((resolve, reject) => {\n mongoose.connect(databaseUrl, err => {\n if (err) {\n return reject(err);\n }\n server = app.listen(port, () => {\n console.log(`Your app is listening on port ${port}`);\n resolve();\n })\n .on('error', err => {\n mongoose.disconnect();\n reject(err);\n });\n });\n });\n}", "title": "" }, { "docid": "0b664da6538b04a2f2f7cdf780b08d5e", "score": "0.58572376", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n console.log(\"listening on port 3001\");\n}", "title": "" }, { "docid": "493c51d76899e8af0898bd8668a38a85", "score": "0.58478713", "text": "listen() {\n this.app.listen(this.port, () => {\n console.log(`Server running on port ${this.port}`)\n })\n }", "title": "" }, { "docid": "5a6ad652e949d18b274fd5286ec8e0d1", "score": "0.58418363", "text": "function runServer(databaseUrl, port = PORT) {\n return new Promise((resolve, reject) => {\n mongoose.connect(\n databaseUrl,\n err => {\n if (err) {\n return reject(err);\n }\n server = app\n .listen(port, () => {\n console.log(`Your app is listening on port ${port}`);\n resolve();\n })\n .on(\"error\", err => {\n mongoose.disconnect();\n reject(err);\n });\n }\n );\n });\n}", "title": "" }, { "docid": "d16794510afb385b5560386545771c63", "score": "0.58331186", "text": "listen()\n\t{\n\t\tthis.server.listen(this.port);\n\t\tconsole.log(`Listening on port ${this.port}...`);\n\t}", "title": "" }, { "docid": "0c4414b452e444f082f7cc37e7213eba", "score": "0.5825263", "text": "function onConnect(callback) {\n r.connect({host: dbConfig.host, port: dbConfig.port }, function(err, connection) {\n assert.ok(err === null, err);\n connection['_id'] = Math.floor(Math.random()*10001);\n callback(err, connection);\n });\n}", "title": "" }, { "docid": "cc14f51259912b18bc2b6a04ecdda04f", "score": "0.58219665", "text": "function listen() {\n return app.listen(port, () => {\n console.log(`PSM : Promo Server started at port :: ${port}`);\n })\n}", "title": "" }, { "docid": "8161f87b43a5703bb90ce5eab2105457", "score": "0.58178794", "text": "start() {\n const port = this.properties.get('main.app.port');\n const logger = this.loggger;\n this.server = this.expressApp.listen(port, () => {\n logger.info(\"The application has been launched on port \" + port)\n });\n }", "title": "" }, { "docid": "757965add0e435d22904a224e0e74338", "score": "0.58178276", "text": "listen() {\n this.app.listen(this.port, () => {\n console.log(`Example app listening on port: ${this.port}!`);\n });\n }", "title": "" }, { "docid": "b1cf7aeed095d53a45e7f1e0b4031f35", "score": "0.5808642", "text": "listen(){\n this.app.listen(this.port,() => {\n console.log('Servidor escuchando en el puerto '+ this.port || '3000');\n })\n }", "title": "" }, { "docid": "7caa2d6be43e1cb478bf493e44c16ab0", "score": "0.58046937", "text": "function runServer(databaseUrl, port = PORT) {\n return new Promise((resolve, reject) => {\n mongoose.connect(databaseUrl, err => {\n if (err) {\n return reject(err);\n }\n server = app\n .listen(port, () => {\n console.log(`Your app is listening on port ${port}`);\n resolve();\n })\n .on(\"error\", err => {\n mongoose.disconnect();\n reject(err);\n });\n });\n });\n}", "title": "" }, { "docid": "86f5458c2d634e1e491117b191cce324", "score": "0.5803422", "text": "start() {\n this.app.listen(this.app.get('port'), () => {\n console.log('Servidor arrancado en le puerto ', this.app.get('port'));\n });\n }", "title": "" }, { "docid": "cbc6755b9ad2859d468a69b879dfe0d8", "score": "0.5802806", "text": "function runServer(databaseUrl = DATABASE_URL, port = PORT) {\n return new Promise((resolve, reject) => {\n mongoose.connect(databaseUrl, { useMongoClient: true }, err => {\n if (err) {\n return reject(err);\n }\n server = app.listen(port, () => {\n console.log(`Your app is listening on port ${port}`);\n resolve();\n })\n .on('error', err => {\n mongoose.disconnect();\n reject(err);\n });\n });\n });\n}", "title": "" }, { "docid": "cbc6755b9ad2859d468a69b879dfe0d8", "score": "0.5802806", "text": "function runServer(databaseUrl = DATABASE_URL, port = PORT) {\n return new Promise((resolve, reject) => {\n mongoose.connect(databaseUrl, { useMongoClient: true }, err => {\n if (err) {\n return reject(err);\n }\n server = app.listen(port, () => {\n console.log(`Your app is listening on port ${port}`);\n resolve();\n })\n .on('error', err => {\n mongoose.disconnect();\n reject(err);\n });\n });\n });\n}", "title": "" }, { "docid": "b5ebefb9d9cc5f43ac7da0d13f762b85", "score": "0.5794246", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.log(`App is running on port ${addr.port}`)\n}", "title": "" }, { "docid": "598cb9874b82cc802d407dd732e5a0e2", "score": "0.5789594", "text": "function onListening() {\n console.log(\"listeneing on port............\"+JSON.stringify(server.address()))\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "1671ffcd100776734924b5a29d16f3e4", "score": "0.5775591", "text": "function autoPortServer (cb) {\n let port = start\n start += 1\n const server = http.createServer(app.callback())\n\n server.listen(port, err => {\n server.once('close', () => {\n app.listen(port, err => {\n if (err) {\n ctx.log(err)\n return\n }\n cb(port)\n })\n })\n server.close()\n })\n server.on('error', err => {\n ctx.log(`port ${port} is already in used`)\n autoPortServer(cb)\n })\n}", "title": "" }, { "docid": "f6ffb5704d8d58920bfc9dc8181bf602", "score": "0.5769623", "text": "function runServer(databaseUrl, port = PORT) {\n return new Promise((resolve, reject) => {\n mongoose.connect(databaseUrl, err => {\n if (err) {\n return reject(err);\n }\n server = app.listen(port, () => {\n console.log(`Your app is listening on port ${port}`);\n resolve();\n })\n .on('error', err => {\n mongoose.disconnect();\n reject(err);\n });\n });\n });\n}", "title": "" }, { "docid": "59c24c56e543cd13629b505a997cb1be", "score": "0.57656026", "text": "listen(){\n \n //traer le puerto desde las variables de enotrno\n this.app.listen(this.port,()=> {\n console.log(colors.blue('Servidor corriendo en puerto... '),this.port );\n });\n }", "title": "" }, { "docid": "046226914fd84aa4ce0b37f28ad8c771", "score": "0.5760729", "text": "function onListening() {\n Event.emit(\"app.started\");\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n console.log('Listening on ' + bind);\n}", "title": "" }, { "docid": "4485ff8abc6ae2f039d3ca952afae3e0", "score": "0.5760695", "text": "function listen() {\n var host = '';\n var port = server.address().port;\n console.log('React app live at localhost' + host + ':' + port);\n}", "title": "" }, { "docid": "ceeed7f5d676a482c9c9240f8437c4d5", "score": "0.57546395", "text": "function startToConnect() {\n db.hget('config', pricingipaddress, function(err, ipaddress) {\n if (err) {\n console.log(err);\n return;\n }\n\n if (ipaddress == null || ipaddress == 0) {\n console.log(\"Error: no ip address found - add key 'config', 'pricingip'\");\n return;\n }\n console.log(' Price server Ip address', ipaddress);\n host = ipaddress;\n\n db.hget('config', pricingport, function(err, port) {\n if (err) {\n console.log(err);\n return;\n }\n\n if (port == null || port == 0) {\n console.log(\"Error: no port found - add key 'config', 'pricingport'\");\n return;\n }\n console.log(' Price server port', port);\n messageport = port;\n\n // we have connection details, so we can try to connect\n tryToConnect();\n });\n });\n}", "title": "" }, { "docid": "74a8992e0a14515d1112d51db6d7ca17", "score": "0.57337093", "text": "function onListening() {\n\tconst addr = server.address();\n\tconst bind = typeof addr === 'string'\n\t\t? 'pipe ' + addr\n\t\t: 'port ' + addr.port;\n\tdebug('Listening on port' + bind);\n}", "title": "" }, { "docid": "d0391a41a2f2c761f7ced5bc80b7b5f5", "score": "0.5723983", "text": "listen() {\r\n this.app.listen(this.httpPort, () => {\r\n console.log('Running server on port %s', this.httpPort);\r\n });\r\n }", "title": "" }, { "docid": "70b926bcb2579f0b1a2b19202c33c5de", "score": "0.5717999", "text": "function serverStart() {\n var port = this.address().port;\n console.log('Server listening on port ' + port);\n}", "title": "" }, { "docid": "64f983da6f8990fc9cd1892ce7c5618b", "score": "0.5706301", "text": "function startServer() {\n // listen to requests\n app.listen(port, () => {\n console.log(`server started on port ${port} (${env})`);\n app.emit('app_started');\n\n });\n}", "title": "" }, { "docid": "bdf780059ff7df1fa1205e209939767d", "score": "0.5701406", "text": "function runServer(databaseUrl=DATABASE_URL, port=PORT) {\n return new Promise((resolve, reject) => {\n mongoose.connect(databaseUrl, err => { // NEW\n if (err) {\n return reject(err);\n }\n \n server = app.listen(port, () => {\n console.log(`Your app is listening on port ${port}`);\n resolve();\n })\n .on('error', err => {\n reject(err);\n });\n });\n });\n}", "title": "" }, { "docid": "99e5ac77b71a7cf23c76ad17b701e401", "score": "0.569696", "text": "function startClient() {\n self.log(\n 'Restarting into client mode due to server already bound to port.');\n ioClient = require('socket.io-client')(\n self.common.isRelease ? 'http://localhost:8011' :\n 'http://localhost:8013',\n {path: '/www.spikeybot.com/socket.io/hg/'});\n clientSocketConnection(ioClient);\n }", "title": "" }, { "docid": "1a7890a479d355dceb2245e1a0782144", "score": "0.56953174", "text": "function serverStart() {\n let port = this.address().port;\n console.log('Server listening on port ' + port);\n}", "title": "" }, { "docid": "61a99122aa1b13a6ce92ea0ea8436b38", "score": "0.5694917", "text": "function runServer(databaseUrl=DATABASE_URL, port=PORT) {\n return new Promise((resolve, reject) => {\n mongoose.connect(databaseUrl, err => {\n if (err) {\n return reject(err);\n } else {\n console.log(`Connected to ${databaseUrl}`);\n }\n server = app.listen(port, () => {\n console.log(`Your app is listening on port ${port}`);\n resolve();\n })\n .on('error', err => {\n mongoose.disconnect();\n reject(err);\n });\n });\n });\n}", "title": "" }, { "docid": "42afcc310fb702722061dc823a368abb", "score": "0.5694421", "text": "function onConnect(callback) {\n r.connect({ host: dbConfig.host, port: dbConfig.port }, function(err, connection) {\n if (err) throw err;\n connection['_id'] = Math.floor(Math.random() * 10001);\n callback(err, connection)\n })\n}", "title": "" }, { "docid": "0eb437fdaf5c0693590aee049eac0ffb", "score": "0.56938505", "text": "function onListening() {\n const addr = httpServer.address();\n const bind = _.isString(addr)\n ? `pipe ${addr}`\n : `port ${addr.port}`;\n\n logger.info(`Listening on ${bind}`);\n\n // open it only in development mode if (config.nodeEnv === 'development') {\n // util.opnIf(`http://localhost:${port}`, 90); }\n}", "title": "" }, { "docid": "893ff4061c3ba5b6e1bce01ac6945471", "score": "0.56872827", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n}", "title": "" }, { "docid": "f2f4e561ca89872555c6b22ad1530139", "score": "0.56856066", "text": "listen() {\n this.io.on('connection', (socket) => {\n this.events.forEach((event, key) => {\n socket.on(key, event.execute(this.io, socket));\n });\n });\n this.io.listen(this.port);\n this.onReady();\n }", "title": "" }, { "docid": "dca4700b5b47dfad4fffbe34c334c583", "score": "0.5679806", "text": "function onListening() {\n\tvar addr = server.address();\n\tvar bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\tdebug('Listening on ' + bind);\n}", "title": "" }, { "docid": "dca4700b5b47dfad4fffbe34c334c583", "score": "0.5679806", "text": "function onListening() {\n\tvar addr = server.address();\n\tvar bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\tdebug('Listening on ' + bind);\n}", "title": "" }, { "docid": "ef634b83aec25d6d0f238cd75d222f60", "score": "0.5675995", "text": "connect() {\n return new Promise((resolve, reject) => {\n if (this.server !== null) {\n resolve();\n }\n db.open(this.options).then((server) => {\n this.server = server;\n resolve();\n }).catch(function(err) {\n if (err.type === 'blocked') {\n oldConnection.close();\n return err.resume;\n }\n reject(err);\n });\n });\n }", "title": "" }, { "docid": "e550b77146ed73e2af0454fce9aaa964", "score": "0.56698763", "text": "function runServer(port, databaseUrl) {\n return new Promise((resolve, reject) => {\n mongoose.connect(databaseUrl, response => {\n //se regresa response vacio si fue existoso\n //por eso se da reject si tiene definido un valor\n if (response) {\n return reject(response);\n }\n else {\n server = app.listen(port, () => {\n console.log(\"App is running on port \" + port);\n resolve();\n })\n .on('error', err => {\n mongoose.disconnect();\n return reject(err);\n })\n }\n });\n });\n}", "title": "" }, { "docid": "b1f34ccfb2cae0a615c3a1bf6ef73860", "score": "0.5668879", "text": "function startServer(){\n\tvar server = app.listen(3000, function(){\n\t\tvar port = server.address().port;\n\t\tconsole.log(\"Listening on port \" + port);\n\t})\n}", "title": "" }, { "docid": "d1ad0fb4e15abdb0ff416a11f543e73b", "score": "0.5668505", "text": "function setUpPort(port){ \n server.listen(port, () => console.log(`Listening on port ${port}...`));\n}", "title": "" }, { "docid": "919349bb8352210584896a8108629742", "score": "0.56630445", "text": "function onListening() {\n if(cfg.enableNotifier){\n var notifier = require('../utils/notifier');\n if(notifier.cron){\n notifier.cron.start();\n }\n }\n\n var msg = {\n env: cfg.env,\n port: server.address().port,\n notifier: cfg.enableNotifier,\n database_location: cfg.mongo.uri,\n database_name: cfg.mongo.db\n };\n logger.info(msg);\n}", "title": "" }, { "docid": "f0eb018b43e3c315c8f4433463d967f5", "score": "0.5661293", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n}", "title": "" }, { "docid": "2446cf9dddb20026e753ac891b19ebf9", "score": "0.5655788", "text": "function connectToDataBase () {\n\n var pool = mysql.createPool({\n connectionLimit: null,\n host: 'localhost',\n user: 'root',\n password: '',\n database: 'hashdatabase',\n debug: false\n });\n pool.getConnection(function (err, connection) {\n if (err) {\n stopServer(err);\n } else {\n configureExpress(connection);\n }\n });\n}", "title": "" }, { "docid": "a2036cbaad1bd6980bfecccd899507a6", "score": "0.5654677", "text": "function listen() {\n app.listen(process.env.PORT, () => {\n console.log(`Node app is running on port`, process.env.PORT);\n });\n}", "title": "" }, { "docid": "191cb06950d3b3d2ceab60e5944a7866", "score": "0.5654228", "text": "listen() {\n this.server.listen(this.port, () =>\n console.log(`Server is listenning on port ${this.port}`)\n )\n }", "title": "" }, { "docid": "d01950aad7370c5a6ddb66e10851872f", "score": "0.56396824", "text": "function initApp() {\n app.set('port', config.get('App.port')); //Set port from config\n let dbConfig = config.get('Mongo.dbConfig'); //Get mongo database config\n logger.initializeLogger(app);\n logger.log(\"info\",\"Server running in \" + app.get('env') + \" mode.\");\n\n mongoose.connect(dbConfig.host+\":\"+dbConfig.port+'/'+dbConfig.database_name, { useMongoClient: true }); // Connect to development- or production database);\n}", "title": "" }, { "docid": "4db2f181732942db8ec5b9d16cb692e8", "score": "0.56375057", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "title": "" }, { "docid": "2be1cb9417845f55766ba64ebd024126", "score": "0.5636992", "text": "function onListening() {\n\tvar addr = server.address();\n\tvar bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\tDEBUG('Listening on ' + bind);\n}", "title": "" }, { "docid": "78715fb323681a8e10085b078a02909b", "score": "0.56330633", "text": "function onListening() {\n var addr = server_app.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n log.Trace('Listening on ' + bind); \n}", "title": "" }, { "docid": "aa79bfd645da61b8cb253d83c4e77859", "score": "0.5631162", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "aa79bfd645da61b8cb253d83c4e77859", "score": "0.5631162", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "919c42f8549c9910b04dace808b4f837", "score": "0.5630429", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n console.log(\"Listening on http://localhost:\" + port);\n debug(\"Listening on \" + bind);\n}", "title": "" }, { "docid": "a18b693900b7fd0fa43d6c0f3dbf7272", "score": "0.56297094", "text": "function startListening() {\n\tapp.listen(8080, function() {\n\t\tconsole.log(\"Sever started at http://localhost:8080\");\n\t});\n}", "title": "" }, { "docid": "5724a6c023a693cfed2712384a267c3b", "score": "0.5626715", "text": "setPort(listenPort) {\n if (this.isListening) {\n this.closeServer();\n }\n this.server.listen(listenPort, () => {\n cout(`Listening on port ${listenPort}`).info();\n this.isListening = true;\n });\n }", "title": "" }, { "docid": "e5cbd3639aa66041ae06b6e95071606f", "score": "0.5626344", "text": "function runServer(databaseUrl=DATABASE_URL, port=PORT) {\n return new Promise((resolve, reject) => {\n // Connect to DB, if fail, stop function and return error\n mongoose.connect(databaseUrl);\n mongoose.connection.on('error', err => {\n return reject(err);\n });\n\n // Start the app\n server = app.listen(port, () => {\n console.log(`Listening on ${port}`);\n resolve();\n })\n .on('error', err => {\n mongoose.disconnect();\n reject(err);\n });\n });\n}", "title": "" }, { "docid": "6f71602ff775bbb451e3ffad2460d5f3", "score": "0.5623825", "text": "function startServer()\n{\n console.log( \"app: starting http server.\" );\n // Binding interface is \"localhost\" for security reasons.\n server.listen( ServerPort, \"localhost\" )\n}", "title": "" }, { "docid": "edac8f894f3ba5a95d5034175be9830b", "score": "0.56190753", "text": "start() {\n this.app.listen(this.port, () => {\n process.stdout.write(`We are live on ${this.port}\\n`);\n });\n }", "title": "" }, { "docid": "b04d2d81a7c515140056eb6c451084f9", "score": "0.56188786", "text": "listen() {\n this.server.listen(this.port, () => {\n console.log(`Servidor corriendo en el puerto ${this.port}`);\n });\n }", "title": "" }, { "docid": "7a798abf60c089e24e7b00d60da511f0", "score": "0.56159663", "text": "initDb() {\n const pgOptions = utils.deepCopyTo({}, lumServer.config.database);\n lumServer.logger.info(`initializing pgclient(${JSON.stringify(pgOptions, utils.hidePass)})...`);\n lumServer.pgPool = new pg.Pool(pgOptions);\n }", "title": "" }, { "docid": "7a554d3d5d37bdf185e6346afe6f3bda", "score": "0.5615051", "text": "function listen(port) {\n\t\tvar server, count = 0, secure = !!securePorts[port];\n\n\t\tif (secure) {\n\t\t\tserver = createSecureServer(port, securePorts[port]);\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tserver = new ServerSocket(port);\n\t\t\t} catch (error) {\n\t\t\t\tprint('Could not listen on port ' + port + ': ' + error.message);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tprint('Listening on port ' + port + ' (HTTP' + ((secure && 'S') || '') + ')');\n\t\twhile (true) {\n\t\t\t(function (client) {\n\t\t\t\tprint('[' + port + '] Client ' + client.id + ' connected');\n\t\t\t\tvar thread = spawn(function () {\n\t\t\t\t\ttry {\n\t\t\t\t\t\thandleRequest(client);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tprint(e.message);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\tprint('[' + port + '] Client ' + client.id + ' disconnected');\n\t\t\t\t\t\tthread.join(1000);\n\t\t\t\t\t\tclient.socket.close();\n\t\t\t\t\t\tthread = null;\n\t\t\t\t\t\tclient = null;\n\t\t\t\t\t} catch (err) {}\n\t\t\t\t\tgc();\n\t\t\t\t});\n\t\t\t}({socket: server.accept(), id: count += 1, port: port}));\n\t\t}\n\t}", "title": "" }, { "docid": "eb49582d506f7be4dbbafe2649880562", "score": "0.5610408", "text": "function listen() {\n var host = socketserver.address().address;\n var port = socketserver.address().port;\n console.log('Example app listening at http://' + host + ':' + port);\n}", "title": "" }, { "docid": "0c8e019681bdc5c39069d9f670c894f6", "score": "0.56076056", "text": "function onListening() {\n\tconst addr = server.address()\n\tconst bind = typeof addr === 'string'\n\t\t? `pipe ${addr}`\n\t\t: `port ${addr.port}`\n\tdebug(`Listening on ${bind}`)\n}", "title": "" }, { "docid": "0c2f0027244fe8cae6fc84efe2517b34", "score": "0.56060976", "text": "function runServer(databaseUrl=DATABASE_URL, port=PORT) {\n\n return new Promise((resolve, reject) => {\n mongoose.connect(databaseUrl, err => {\n if (err) {\n return reject(err);\n }\n server = app.listen(port, () => {\n console.log(`Your app is listening on port ${port}`);\n resolve();\n })\n .on(\"error\", err => {\n mongoose.disconnect();\n reject(err);\n });\n });\n });\n}", "title": "" }, { "docid": "1ad19bb5a9c74020912e9d7f5c07610f", "score": "0.5605628", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log(\"Application is running on localhost:3000\");\n}", "title": "" }, { "docid": "19c9b2a3b4dbfe451a35b291c23a94da", "score": "0.56045157", "text": "function onListening() {\r\n const addr = app.server.address();\r\n const bind = (typeof addr === 'string')\r\n ? 'pipe ' + addr\r\n : 'port ' + addr.port;\r\n\r\n logger.log('WEB Side started on ' + bind);\r\n}", "title": "" }, { "docid": "094f644d0917dfa16fa4e289e220a170", "score": "0.5601961", "text": "function onListening() {\n var addr = server.address()\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n debug('Listening on ' + bind)\n}", "title": "" }, { "docid": "8acb80778b9c92ff0e0fa0218c92130c", "score": "0.56010175", "text": "function listen() {\n var host = server.address().address;\n var port = server.address().port;\n console.log('Example app listening at http://' + host + ':' + port);\n}", "title": "" }, { "docid": "062918a481f9cbf26090ccb1206ec155", "score": "0.55991405", "text": "function connectionDB(run_server){\n MongoClient.connect(url, function(err, db) {\n if(err) throw err;\n console.log(\"Connected successfully to server\");\n obj=db;\n run_server();\n });\n}", "title": "" }, { "docid": "8bbfca76f87a2fa6e6b0f5828d919012", "score": "0.5595509", "text": "function listen() {\n var host = server.address().address;\n var port = server.address().port;\n console.log('Example app listening at http://' + host + ':' + port);\n //miniblobs = createMiniBlobs(10);\n}", "title": "" }, { "docid": "912a58e546f6ec665f229fc8a07978c8", "score": "0.5593785", "text": "function onListening() {\n let addr = server.address();\n let bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log(`---\\n 服务器启动成功 >>> https://127.0.0.1:${addr.port}\\n 时间:${new Date().toLocaleString()}\\n---`);\n // opn(`http://127.0.0.1:${addr.port}`)\n}", "title": "" }, { "docid": "faf3ce1028914bcab048ed869b01aca9", "score": "0.5593718", "text": "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n}", "title": "" } ]
7f328315d4dfecd2b14205a777329e34
Memoize an expensive function by storing its results.
[ { "docid": "8a3f2e8fab9317edaeaa5fc794805449", "score": "0.6816127", "text": "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!(0,_has_js__WEBPACK_IMPORTED_MODULE_0__.default)(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n}", "title": "" } ]
[ { "docid": "deb75c56f7f9c78d038f2061b389d2e3", "score": "0.7651198", "text": "function memoize(func) {\n var cache = {};\n\n return function(args) {\n\n if (cache[args]) {\n return cache[args];\n }\n\n var output = func.apply(null, args);\n cache[args] = output;\n return output;\n }\n}", "title": "" }, { "docid": "9682e74b6baa8e580efb04fc0c4a1d29", "score": "0.75739855", "text": "function memoize(fn) {\n const cache = {};\n return function (...args) {\n if (cache[args]) {\n return cache[args];\n }\n const value = fn.apply(this, args);\n cache[args] = value;\n return value;\n }\n}", "title": "" }, { "docid": "476280ace0a600f7954efd2612a4923b", "score": "0.7573092", "text": "function memoize(fn) {\n const cache = {};\n return function (...args) {\n if (cache[args]) {\n return cache[args];\n }\n\n const result = fn.apply(this, args);\n cache[args] = result;\n\n return result;\n };\n}", "title": "" }, { "docid": "29c965c7318068bbff2e19d4ac1938db", "score": "0.756775", "text": "function memoize(fn) {\n const cache = {};\n return function (...args) {\n if (cache[args]) {\n return cache[args];\n }\n const result = fn.apply(this, args);\n cache[args] = result;\n return result;\n };\n}", "title": "" }, { "docid": "a0655ae92fe25b79f4089ba4f4bcad24", "score": "0.754642", "text": "function memoize(fn) {\n const cache = {};\n\n return function (...args) {\n if (cache[args]) {\n return cache[args];\n }\n\n const result = fn.apply(this, args);\n cache[args] = result;\n return result;\n }\n}", "title": "" }, { "docid": "7efbfb5e0c4b85d9d2f3f1d7645aff2b", "score": "0.74144846", "text": "function memoize(fn) {\n const cache = {};\n return function(...args) { // I don't know how many arguments we gonna receive, ES6 or ES2015 code, to help make this function generic\n if (cache[args]) {\n return cache[args]; // Actual caching mechanism right there\n }\n\n const result = fn.apply(this, args);// Whenever we call a function with an array of arguments, use the Apply helper\n cache[args] = result;\n\n return result;\n }\n}", "title": "" }, { "docid": "fd94cc5e5330806eb8822d6fec53bdff", "score": "0.7337911", "text": "function expensiveFunction(a) {\n expensiveFunction.cache = expensiveFunction.cache || {}\n if (expensiveFunction.cache[a]) {\n return expensiveFunction.cache[a]\n }\n //waitSync(4000) // runs long time\n return expensiveFunction.cache[a] = a * 34;\n}", "title": "" }, { "docid": "8bc7aaff5053d8fe93a48bdfaa086528", "score": "0.73149586", "text": "function memoize(func) {\n const cache = {} // Declare a const variable cache. \n\n return function(...args) { // rest parameter --> multiple arguments.\n if(cache[args]) { // IF cache has been called \n return cache[args] // RETURN that argument.\n }\n\n const result = func(...args) // individual calls \n cache[args] = result; // Set value to of cache args\n\n return result; // return result. \n \n }\n}", "title": "" }, { "docid": "e26b60ec001186c8f9565b8ed4c59fc5", "score": "0.72776806", "text": "function memo(fun) {\n const cache = new Map();\n return function () {\n const args = [...arguments];\n const key = JSON.stringify(args);\n if (cache.has(key)) {\n console.log(`returning from cache key:: ${key} :: value :: ${cache.get(key)}`);\n return cache.get(key);\n } else {\n const val = fun.apply(this, args);\n cache.set(key, val);\n console.log(`calculating result:: key :: ${key} :: val :: ${val}`);\n return val;\n }\n }\n}", "title": "" }, { "docid": "2b5a36f74daecdfc698f2165df060b9b", "score": "0.7218334", "text": "function memoFunc() {\n var map = cache;\n for (var argn = 0; argn < arguments.length; ++argn) {\n var arg = arguments[argn];\n var ndx = map.k.indexOf(arg);\n if (ndx < 0) {\n map.k.push(arg);\n map.v.push( map = { k: [], v: [] });\n } else {\n map = map.v[ndx];\n }\n }\n map.fresh = true;\n return ('value' in map\n ? map.value\n : (map.value = func.apply(map, arguments)));\n }", "title": "" }, { "docid": "1d8f3d092aa851853b8ff954a4f04a21", "score": "0.7215396", "text": "function memoize(fn) {\n var result = null;\n\n var memoized = function memoized() {\n if (result == null) {\n result = fn();\n }\n\n return result;\n };\n\n return memoized;\n}", "title": "" }, { "docid": "3a2039b6f1ef53118655d7dd2e3ddf3c", "score": "0.7210194", "text": "function lruMemoize(f) {\n const cache = []\n\n return function (input) {\n for (let i = 0; i < cache.length; i++) {\n if (cache[i].input === input) {\n const temp = cache[0]\n cache[0] = cache[i]\n cache[i] = temp\n return cache[0].result\n }\n }\n\n const result = f(input)\n\n cache.unshift({\n input,\n result,\n })\n\n if (cache.length > MAX_CACHED_INPUTS) {\n cache.pop()\n }\n\n return result\n }\n}", "title": "" }, { "docid": "bc0eccc903c98024acb8e7f9e263d307", "score": "0.7209503", "text": "function memo(fn) {\n var cache = {};\n return function(n) {\n if (n in cache) {\n return cache[n];\n } else {\n result = fn(n);\n cache[n] = result;\n return result;\n }\n };\n}", "title": "" }, { "docid": "70a722c597c54c3cfe8a9cde27c6f294", "score": "0.72019273", "text": "function lruMemoize(f) {\n var cache = [];\n\n return function(input) {\n for (var i = 0; i < cache.length; i++) {\n if (cache[i].input === input) {\n var temp = cache[0];\n cache[0] = cache[i];\n cache[i] = temp;\n return cache[0].result;\n }\n }\n\n var result = f(input);\n\n cache.unshift({\n input,\n result,\n });\n\n if (cache.length > MAX_CACHED_INPUTS) {\n cache.pop();\n }\n\n return result;\n };\n}", "title": "" }, { "docid": "4dc16129821e5582ad9195deb0126643", "score": "0.71872544", "text": "function memoizeWrapper(fn) {\n\n}", "title": "" }, { "docid": "005cac930ac8932cd9f5125c108af3ed", "score": "0.7174298", "text": "function lruMemoize(f) {\n const cache = [];\n\n return function(input) {\n for (let i = 0; i < cache.length; i++) {\n if (cache[i].input === input) {\n const temp = cache[0];\n cache[0] = cache[i];\n cache[i] = temp;\n return cache[0].result;\n }\n }\n\n const result = f(input);\n\n cache.unshift({\n input,\n result,\n });\n\n if (cache.length > MAX_CACHED_INPUTS) {\n cache.pop();\n }\n\n return result;\n };\n}", "title": "" }, { "docid": "005cac930ac8932cd9f5125c108af3ed", "score": "0.7174298", "text": "function lruMemoize(f) {\n const cache = [];\n\n return function(input) {\n for (let i = 0; i < cache.length; i++) {\n if (cache[i].input === input) {\n const temp = cache[0];\n cache[0] = cache[i];\n cache[i] = temp;\n return cache[0].result;\n }\n }\n\n const result = f(input);\n\n cache.unshift({\n input,\n result,\n });\n\n if (cache.length > MAX_CACHED_INPUTS) {\n cache.pop();\n }\n\n return result;\n };\n}", "title": "" }, { "docid": "005cac930ac8932cd9f5125c108af3ed", "score": "0.7174298", "text": "function lruMemoize(f) {\n const cache = [];\n\n return function(input) {\n for (let i = 0; i < cache.length; i++) {\n if (cache[i].input === input) {\n const temp = cache[0];\n cache[0] = cache[i];\n cache[i] = temp;\n return cache[0].result;\n }\n }\n\n const result = f(input);\n\n cache.unshift({\n input,\n result,\n });\n\n if (cache.length > MAX_CACHED_INPUTS) {\n cache.pop();\n }\n\n return result;\n };\n}", "title": "" }, { "docid": "005cac930ac8932cd9f5125c108af3ed", "score": "0.7174298", "text": "function lruMemoize(f) {\n const cache = [];\n\n return function(input) {\n for (let i = 0; i < cache.length; i++) {\n if (cache[i].input === input) {\n const temp = cache[0];\n cache[0] = cache[i];\n cache[i] = temp;\n return cache[0].result;\n }\n }\n\n const result = f(input);\n\n cache.unshift({\n input,\n result,\n });\n\n if (cache.length > MAX_CACHED_INPUTS) {\n cache.pop();\n }\n\n return result;\n };\n}", "title": "" }, { "docid": "005cac930ac8932cd9f5125c108af3ed", "score": "0.7174298", "text": "function lruMemoize(f) {\n const cache = [];\n\n return function(input) {\n for (let i = 0; i < cache.length; i++) {\n if (cache[i].input === input) {\n const temp = cache[0];\n cache[0] = cache[i];\n cache[i] = temp;\n return cache[0].result;\n }\n }\n\n const result = f(input);\n\n cache.unshift({\n input,\n result,\n });\n\n if (cache.length > MAX_CACHED_INPUTS) {\n cache.pop();\n }\n\n return result;\n };\n}", "title": "" }, { "docid": "841576cf738af8adb00e596bf723c0e8", "score": "0.71333784", "text": "function memoizeFunction(fn) {\n var memo = {}, counter = 0;\n\n return function(key) {\n if (hasOwn(memo, key)) {\n return memo[key];\n }\n if (counter === INTERNAL_MEMOIZE_LIMIT) {\n memo = {};\n counter = 0;\n }\n counter++;\n return memo[key] = fn(key);\n };\n }", "title": "" }, { "docid": "e93acc89167f468a30f7dda16977ee76", "score": "0.7070083", "text": "function memoize_memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n}", "title": "" }, { "docid": "e93acc89167f468a30f7dda16977ee76", "score": "0.7070083", "text": "function memoize_memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n}", "title": "" }, { "docid": "917fe745053b5984d762d79ae26693a6", "score": "0.7036651", "text": "function revisedMemoAddTo80(){\n let cache = {}\n //our top level function returns the child function below\n return function(n){\n if(n in cache){\n //just return the value at cache.n\n return cache[n];\n //otherwise assign the value of n + 80 to cache.n and then return that value\n } else {\n console.log('this calculation hypothetically takes a long time')\n cache[n] = n + 80\n return cache[n];\n }\n }\n}", "title": "" }, { "docid": "2f63fae421efee6fc3c59cc4f420f57b", "score": "0.7029134", "text": "function memoize(fun) {\n var result;\n var called = false;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (called) {\n return result;\n }\n result = fun.apply(void 0, args);\n called = true;\n return result;\n };\n}", "title": "" }, { "docid": "57ce40dd9bb62d3cfb1495d6ddb7e911", "score": "0.7024175", "text": "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "title": "" }, { "docid": "57ce40dd9bb62d3cfb1495d6ddb7e911", "score": "0.7024175", "text": "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "title": "" }, { "docid": "57ce40dd9bb62d3cfb1495d6ddb7e911", "score": "0.7024175", "text": "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "title": "" }, { "docid": "57ce40dd9bb62d3cfb1495d6ddb7e911", "score": "0.7024175", "text": "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "title": "" }, { "docid": "f580d9bd787525331f2e16e9f9dcee3f", "score": "0.70226806", "text": "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has$1(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "title": "" }, { "docid": "f580d9bd787525331f2e16e9f9dcee3f", "score": "0.70226806", "text": "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has$1(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "title": "" }, { "docid": "f580d9bd787525331f2e16e9f9dcee3f", "score": "0.70226806", "text": "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has$1(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "title": "" }, { "docid": "cdaa76074558e3f81a4b2cb7f021a4c5", "score": "0.7018917", "text": "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n}", "title": "" }, { "docid": "59a90ffba3623daeda7000187fa7b0c7", "score": "0.7003505", "text": "function memoize(func, hasher) {\n var memoize = function (key) {\n var cache = memoize.cache;\n var address = \"\" + (hasher ? hasher.apply(this, arguments) : key);\n if (!has$1(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n}", "title": "" }, { "docid": "0c1dd7b45a0128e59d37793f75646d23", "score": "0.70026183", "text": "function memoizedAddTo80Plus(){\n let cache = {};\n return function(n) {\n if(n in cache){\n return cache[n];\n }else{\n console.log(\"This takes long time!---Memoization PLUS\");\n cache[n] = n + 80;\n return cache[n]\n }\n }\n}", "title": "" }, { "docid": "f98e5864b07b434f495df96e7ff77957", "score": "0.69382256", "text": "function memoized() {\n exec({\n context: this,\n fn: fn,\n args: Array.prototype.slice.call(arguments),\n options: options\n });\n }", "title": "" }, { "docid": "375ea3c9da826d7e386c01aa28e198ec", "score": "0.69321966", "text": "function memoizedAddTo80(){\n \n let cache={};\n\n return function(n){\n if(n in cache){\n return cache[n];\n }else{\n console.log('long time')\n cache[n]= 80+n;\n }\n }\n\n}", "title": "" }, { "docid": "2128fde7c8a0b4ae3efd609c7deb409e", "score": "0.69022423", "text": "function memoize(fn) {\n let cache = {};\n // Expands iterables in place too\n // Spread op : in a function call\n return function(...args) {\n argString = (args).toString()\n // console.log(args)\n // console.log(...args)\n if(argString in cache) {\n return cache[argString]\n } else {\n let val = fn(...args)\n cache[argString] = val\n return val\n }\n \n }\n}", "title": "" }, { "docid": "c783e7bad8de57adb291cac970b099aa", "score": "0.68844974", "text": "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!Object(_has_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n}", "title": "" }, { "docid": "c783e7bad8de57adb291cac970b099aa", "score": "0.68844974", "text": "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!Object(_has_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n}", "title": "" }, { "docid": "c783e7bad8de57adb291cac970b099aa", "score": "0.68844974", "text": "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!Object(_has_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n}", "title": "" }, { "docid": "5270da22262d865786c8a2124245448b", "score": "0.68727964", "text": "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!(0,_has_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n}", "title": "" }, { "docid": "faf2e3231b9197ef1f66701e3ca2b240", "score": "0.67856055", "text": "function memoizedAddTo256(){\n var cache = {};\n\n return function(num){\n if(num in cache){\n console.log(\"cached value\");\n return cache[num]\n\n }\n else{\n cache[num] = num + 256;\n return cache[num];\n }\n }\n}", "title": "" }, { "docid": "2903e9ee0c9a86cefca19f08730cbe9a", "score": "0.6662508", "text": "function memoizeOutput(workerFunc, equalityFunc) {\n var cachedRes = null;\n return function () {\n var newRes = workerFunc.apply(this, arguments);\n if (cachedRes === null || !(cachedRes === newRes || equalityFunc(cachedRes, newRes))) {\n cachedRes = newRes;\n }\n return cachedRes;\n };\n}", "title": "" }, { "docid": "bf2175e55a85200965a1a2eba248e5c4", "score": "0.6656027", "text": "function memoizeOutput(workerFunc, equalityFunc) {\n var cachedRes = null;\n return function () {\n var newRes = workerFunc.apply(this, arguments);\n if (cachedRes === null || !(cachedRes === newRes || equalityFunc(cachedRes, newRes))) {\n cachedRes = newRes;\n }\n return cachedRes;\n };\n }", "title": "" }, { "docid": "269f3a446ac72e057168dc042b1aa942", "score": "0.66509014", "text": "function memoizedAddTo802(){\n let cache2 = {};\n return function(n) {\n if(n in cache2) {\n return cache2[n];\n } else {\n console.log('long time');\n cache2[n] = n + 80;\n return cache2[n];\n }\n }\n}", "title": "" }, { "docid": "8b6aa9a054ff97970673944770306db8", "score": "0.65932965", "text": "function memoize(fn) {\n\tlet argsTree = new MapTree();\n\n\tfunction memoized() {\n\t\tlet args = Array.prototype.slice.call(arguments);\n\t\tlet argNode = args.reduce(function getBranch(parentBranch, arg) {\n\t\t\treturn parentBranch.resolveBranch(arg);\n\t\t}, argsTree);\n\t\tif (argNode.hasValue) {\n\t\t\treturn argNode.value;\n\t\t}\n\t\tlet value = fn.apply(null, args);\n\t\treturn argNode.setValue(value);\n\t}\n\n\tmemoized.clear = argsTree.clear.bind(argsTree);\n\n\treturn memoized;\n}", "title": "" }, { "docid": "8ce493d5b0262762bcd77db4f4c890e7", "score": "0.65927255", "text": "function memoizeWithArgsHash(fn, hashFunction) {\n let cache;\n return (...args) => {\n if (!cache) {\n cache = {};\n }\n\n const key = hashFunction(...args);\n\n if (!Object.hasOwnProperty.call(cache, key)) {\n cache[key] = fn(...args);\n }\n\n return cache[key];\n };\n}", "title": "" }, { "docid": "d7302de584bbd6dcdf68104a1f317f5b", "score": "0.65814126", "text": "function memoize(fn, c = new WeakMap(), keyFn = i => i) {\n return (...args) => {\n let key = keyFn(...args)\n if(c.has(key)) {\n return c.get(key)\n }\n c.set(key, fn(...args))\n return c.get(key)\n }\n}", "title": "" }, { "docid": "dd198825fe23fcda630c19996c9d1eb2", "score": "0.6579682", "text": "function memoize3(fn) {\n var cache0;\n return function memoized(a1, a2, a3) {\n if (!cache0) {\n cache0 = new WeakMap();\n }\n\n var cache1 = cache0.get(a1);\n var cache2;\n\n if (cache1) {\n cache2 = cache1.get(a2);\n\n if (cache2) {\n var cachedValue = cache2.get(a3);\n\n if (cachedValue !== undefined) {\n return cachedValue;\n }\n }\n } else {\n cache1 = new WeakMap();\n cache0.set(a1, cache1);\n }\n\n if (!cache2) {\n cache2 = new WeakMap();\n cache1.set(a2, cache2);\n }\n\n var newValue = fn(a1, a2, a3);\n cache2.set(a3, newValue);\n return newValue;\n };\n}", "title": "" }, { "docid": "baadd9366b72b2796c3f9f204209783e", "score": "0.6567492", "text": "function memoizedAddTo80 (){\n let cache = {};\n return function(n){\n if (n in cache){\n return cache[n];\n } else {\n console.log('Time');\n cache[n] = n + 80;\n return cache[n];\n }\n}\n}", "title": "" }, { "docid": "7a062a8493f4075d342806f1923bf5db", "score": "0.6547625", "text": "function memoized(fn) {\n m = {};\n return function (x) {\n var args = [].slice.call(arguments),\n strKey = args.join('-');\n\n v = m[strKey];\n if ('u' === (typeof v)[0])\n m[strKey] = v = fn.apply(null, args);\n return v;\n }\n }", "title": "" }, { "docid": "48a74b2ba1ca70ee4e5a9c33b69ada61", "score": "0.65394783", "text": "function memoize(fn, timeout, context) {\n var store = {};\n return function() {\n var key = hashCode(arguments);\n if (key && store[key]) return store[key];\n if (!isNaN(timeout) && timeout !== null) {\n setTimeout(function() {\n delete store[key];\n }, timeout);\n }\n return (store[key] = fn.apply(\n context || this,\n Array.prototype.slice.call(arguments)\n ));\n };\n}", "title": "" }, { "docid": "69a32d7cb095b1543233fc839b8c8576", "score": "0.6535557", "text": "function memoize3(fn) {\n var cache0;\n\n function memoized(a1, a2, a3) {\n if (!cache0) {\n cache0 = new WeakMap();\n }\n\n var cache1 = cache0.get(a1);\n var cache2;\n\n if (cache1) {\n cache2 = cache1.get(a2);\n\n if (cache2) {\n var cachedValue = cache2.get(a3);\n\n if (cachedValue !== undefined) {\n return cachedValue;\n }\n }\n } else {\n cache1 = new WeakMap();\n cache0.set(a1, cache1);\n }\n\n if (!cache2) {\n cache2 = new WeakMap();\n cache1.set(a2, cache2);\n }\n\n var newValue = fn(a1, a2, a3);\n cache2.set(a3, newValue);\n return newValue;\n }\n\n return memoized;\n}", "title": "" }, { "docid": "69a32d7cb095b1543233fc839b8c8576", "score": "0.6535557", "text": "function memoize3(fn) {\n var cache0;\n\n function memoized(a1, a2, a3) {\n if (!cache0) {\n cache0 = new WeakMap();\n }\n\n var cache1 = cache0.get(a1);\n var cache2;\n\n if (cache1) {\n cache2 = cache1.get(a2);\n\n if (cache2) {\n var cachedValue = cache2.get(a3);\n\n if (cachedValue !== undefined) {\n return cachedValue;\n }\n }\n } else {\n cache1 = new WeakMap();\n cache0.set(a1, cache1);\n }\n\n if (!cache2) {\n cache2 = new WeakMap();\n cache1.set(a2, cache2);\n }\n\n var newValue = fn(a1, a2, a3);\n cache2.set(a3, newValue);\n return newValue;\n }\n\n return memoized;\n}", "title": "" }, { "docid": "69a32d7cb095b1543233fc839b8c8576", "score": "0.6535557", "text": "function memoize3(fn) {\n var cache0;\n\n function memoized(a1, a2, a3) {\n if (!cache0) {\n cache0 = new WeakMap();\n }\n\n var cache1 = cache0.get(a1);\n var cache2;\n\n if (cache1) {\n cache2 = cache1.get(a2);\n\n if (cache2) {\n var cachedValue = cache2.get(a3);\n\n if (cachedValue !== undefined) {\n return cachedValue;\n }\n }\n } else {\n cache1 = new WeakMap();\n cache0.set(a1, cache1);\n }\n\n if (!cache2) {\n cache2 = new WeakMap();\n cache1.set(a2, cache2);\n }\n\n var newValue = fn(a1, a2, a3);\n cache2.set(a3, newValue);\n return newValue;\n }\n\n return memoized;\n}", "title": "" }, { "docid": "d1376fcdbed057b7199e0e0615adeeaa", "score": "0.64994377", "text": "function memoize3(fn) {\n var cache0;\n\n function memoized(a1, a2, a3) {\n if (!cache0) {\n cache0 = new WeakMap();\n }\n\n var cache1 = cache0.get(a1);\n var cache2;\n\n if (cache1) {\n cache2 = cache1.get(a2);\n\n if (cache2) {\n var cachedValue = cache2.get(a3);\n\n if (cachedValue !== undefined) {\n return cachedValue;\n }\n }\n } else {\n cache1 = new WeakMap();\n cache0.set(a1, cache1);\n }\n\n if (!cache2) {\n cache2 = new WeakMap();\n cache1.set(a2, cache2);\n }\n\n var newValue = fn.apply(this, arguments);\n cache2.set(a3, newValue);\n return newValue;\n }\n\n return memoized;\n}", "title": "" }, { "docid": "d1376fcdbed057b7199e0e0615adeeaa", "score": "0.64994377", "text": "function memoize3(fn) {\n var cache0;\n\n function memoized(a1, a2, a3) {\n if (!cache0) {\n cache0 = new WeakMap();\n }\n\n var cache1 = cache0.get(a1);\n var cache2;\n\n if (cache1) {\n cache2 = cache1.get(a2);\n\n if (cache2) {\n var cachedValue = cache2.get(a3);\n\n if (cachedValue !== undefined) {\n return cachedValue;\n }\n }\n } else {\n cache1 = new WeakMap();\n cache0.set(a1, cache1);\n }\n\n if (!cache2) {\n cache2 = new WeakMap();\n cache1.set(a2, cache2);\n }\n\n var newValue = fn.apply(this, arguments);\n cache2.set(a3, newValue);\n return newValue;\n }\n\n return memoized;\n}", "title": "" }, { "docid": "d1376fcdbed057b7199e0e0615adeeaa", "score": "0.64994377", "text": "function memoize3(fn) {\n var cache0;\n\n function memoized(a1, a2, a3) {\n if (!cache0) {\n cache0 = new WeakMap();\n }\n\n var cache1 = cache0.get(a1);\n var cache2;\n\n if (cache1) {\n cache2 = cache1.get(a2);\n\n if (cache2) {\n var cachedValue = cache2.get(a3);\n\n if (cachedValue !== undefined) {\n return cachedValue;\n }\n }\n } else {\n cache1 = new WeakMap();\n cache0.set(a1, cache1);\n }\n\n if (!cache2) {\n cache2 = new WeakMap();\n cache1.set(a2, cache2);\n }\n\n var newValue = fn.apply(this, arguments);\n cache2.set(a3, newValue);\n return newValue;\n }\n\n return memoized;\n}", "title": "" }, { "docid": "75d48e42065327d20ec402e327ef5542", "score": "0.64430946", "text": "function memoizeOneWithArgsHashAndInvalidation(fn, hashFunction) {\n let lastKey;\n let lastResult; // breaking cache when arguments change\n\n const memoizedFn = (...args) => {\n const key = hashFunction(...args);\n\n if (lastKey === key) {\n return lastResult;\n }\n\n lastKey = key;\n lastResult = fn(...args);\n return lastResult;\n };\n\n const invalidate = () => {\n lastKey = null;\n };\n\n return [memoizedFn, invalidate];\n}", "title": "" }, { "docid": "c6522349d79f0da66f07852e6532d5dd", "score": "0.6416965", "text": "function cachedResult(f) {\n let value;\n return () => {\n if (typeof value === 'undefined') {\n value = f();\n }\n return value;\n };\n}", "title": "" }, { "docid": "246576602375dcea88f9fad1c2445a41", "score": "0.641597", "text": "function cacheFn(fn) {\n var cache = {};\n return function(arg) {\n if (cache[arg]) {\n return cache[arg];\n } else {\n cache[arg] = fn(arg);\n return cache[arg];\n }\n };\n}", "title": "" }, { "docid": "cd167cde66745d2d477b182805b1f461", "score": "0.6414408", "text": "function cachingDecorator(func) {\n let cache = new Map();\n return function(x) {\n if (cache.has(x)) {\n return cache.get(x);\n }\n let result = func(x); // (**)\n cache.set(x, result);\n return result;\n };\n}", "title": "" }, { "docid": "342bddcf540326d807c8425f61356323", "score": "0.63966006", "text": "function memoize(fn, mem) {\n \tmem = mem || {};\n \treturn function (k) {\n \t\treturn hasOwnProperty.call(mem, k) ? mem[k] : mem[k] = fn(k);\n \t};\n }", "title": "" }, { "docid": "7ab8dce7fa8d404145f349a3bd78165c", "score": "0.63817704", "text": "function memoize(concurrency) {\n const locks = {};\n const limit = concurrency && pLimit(concurrency);\n return function (key, fn) {\n if (locks[key])\n return locks[key];\n locks[key] = limit && limit(fn) || fn();\n return locks[key];\n };\n}", "title": "" }, { "docid": "a54e9ff38fac8488a3ca5c0e4825ac43", "score": "0.63618565", "text": "function cached(fn, hash) {\n\tlet map = new Map();\n\tif (!hash) hash = ident;\n\treturn function(...args) {\n\t\tlet key = hash(...args);\n\t\tif (map.has(key)) return map.get(key);\n\t\tlet result = fn.apply(this, args);\n\t\tmap.set(key, result);\n\t\treturn result;\n\t};\n}", "title": "" }, { "docid": "507ee7f5331bbc4d0d212e3145e7afe7", "score": "0.6351662", "text": "function weaklyCached(fn) {\n\tlet map = new WeakMap();\n\treturn function(key) {\n\t\tif (map.has(key)) return map.get(key);\n\t\tlet result = fn.call(this, key);\n\t\tmap.set(key, result);\n\t\treturn result;\n\t};\n}", "title": "" }, { "docid": "bd266ee13030390060205e7574f75198", "score": "0.63486785", "text": "function memoize(func) {\n var cache = { k: [], v: [] };\n\n // Memoized version of `func`\n //\n function memoFunc() {\n var map = cache;\n for (var argn = 0; argn < arguments.length; ++argn) {\n var arg = arguments[argn];\n var ndx = map.k.indexOf(arg);\n if (ndx < 0) {\n map.k.push(arg);\n map.v.push( map = { k: [], v: [] });\n } else {\n map = map.v[ndx];\n }\n }\n map.fresh = true;\n return ('value' in map\n ? map.value\n : (map.value = func.apply(map, arguments)));\n }\n\n // Return `true` if map should be discarded\n //\n function flushMap(map) {\n var values = map.v;\n var keys = map.k;\n\n for (var ndx = values.length; --ndx >= 0; ) {\n if (flushMap(values[ndx])) {\n // remove map\n var v = values.pop();\n var k = keys.pop();\n if (ndx < values.length) {\n values[ndx] = v;\n keys[ndx] = k;\n }\n }\n }\n\n if (map.fresh) {\n map.fresh = false;\n return false;\n }\n if ('value' in map) {\n // remove entry\n if (map.onflush) {\n map.onflush();\n map.onflush = null;\n }\n delete map.value;\n }\n return !values.length;\n }\n\n memoFunc.flush = flushMap.bind(null, cache);\n\n return memoFunc;\n}", "title": "" }, { "docid": "22dc7d0389971f41a933061e292798ff", "score": "0.6340594", "text": "function m1(f) {\n if (!SUPPORTED) {\n return f;\n }\n var results = new WeakMap();\n return function (a) {\n var result = results.get(a);\n if (result !== undefined) {\n //console.log('cache hit');\n return result;\n }\n //console.log('cache miss');\n result = f(a);\n results.set(a, result);\n return result;\n };\n}", "title": "" }, { "docid": "5007c436342da0ac8228403265911b69", "score": "0.63392395", "text": "function memoize(fn, options) {\n var cache = options && options.cache || new _tuplemap2.default(options);\n\n var memoized = void 0;\n\n // Memoizer for functions that accept a single argument\n if (/^\\[object (Weak|LRU|NamedTuple)?Map\\]$/.test(cache.toString())) {\n memoized = function memoized(arg) {\n if (!cache.has(arg)) {\n var result = fn.call(this, arg);\n cache.set(arg, result);\n return result;\n }\n return cache.get(arg);\n };\n }\n\n // Memoizer for functions that accept multiple arguments\n else {\n memoized = function memoized() {\n if (!cache.has(arguments)) {\n var result = fn.apply(this, arguments);\n cache.set(arguments, result);\n return result;\n }\n return cache.get(arguments);\n };\n }\n\n // Give a meaningful displayName to the memoized function\n if (fn.name) {\n memoized.displayName = fn.name + 'Memoized';\n }\n\n return memoized;\n}", "title": "" }, { "docid": "a0c76359f5bda25c80766836d89b9a4a", "score": "0.63311017", "text": "function memoize(a) {\n let b = !1,\n c;\n\n return (...d) => {\n return b || (c = a(...d), b = !0), c;\n };\n}", "title": "" }, { "docid": "d4598a57967c5cc74a35548eb21908db", "score": "0.6277105", "text": "memoize() {\n return this.get;\n }", "title": "" }, { "docid": "3daea80e9ec5eac6b9b642e32943a2b7", "score": "0.6251981", "text": "function cache(fn) {\n var map = new Map();\n\n return function cache(object) {\n\n if (map.has(object)) {\n return map.get(object);\n }\n\n var value = fn(object);\n map.set(object, value);\n return value;\n };\n}", "title": "" }, { "docid": "321fa2211812ed2a7f684f215a287be7", "score": "0.6244214", "text": "function memoize(func, resolver) {\n if (!isFunction(func))\n throw new TypeError(\"Memoize's first argument must be a function\")\n\n if (resolver != null && !isFunction(resolver))\n throw new TypeError(\"Memoize's second argument must be a function\")\n\n const memoized = function (...args) {\n const key = resolver ? resolver.apply(this, args) : args[0]\n\n const cache = memoized.cache\n\n if (cache.has(key)) return cache.get(key)\n\n const result = func.apply(this, args)\n\n memoized.cache = cache.set(key, result) || cache\n\n return result\n }\n\n memoized.cache = new (memoize.Cache || Map)()\n\n return memoized\n}", "title": "" }, { "docid": "1539b9a97641bd3e1f95d490cef05537", "score": "0.6185458", "text": "function memoizeOneWithArgsHash(fn, hashFunction) {\n let lastKey;\n let lastResult; // breaking cache when arguments change\n\n return (...args) => {\n const key = hashFunction(...args);\n\n if (lastKey === key) {\n return lastResult;\n }\n\n lastKey = key;\n lastResult = fn(...args);\n return lastResult;\n };\n}", "title": "" }, { "docid": "9f3dcdf57fa910b58bbb5335b6d05383", "score": "0.6178133", "text": "function example2() {\n const anotherCachedFunction = cache.withCache('ADDITION', slowAddition);\n\n anotherCachedFunction(1, 2, 3)\n .then((result) => {\n console.log(result);\n })\n}", "title": "" }, { "docid": "c5715d6d78f8c4eaf968cd1bcbb9a306", "score": "0.61641425", "text": "function memoizedFibonacci() {\n let cache = {};\n return function fib(n) {\n // calculations++;\n if (n in cache) {\n return cache[n];\n } else {\n if (n < 2) {\n return n;\n } else {\n cache[n] = fib(n - 1) + fib(n - 2);\n return cache[n];\n }\n }\n };\n}", "title": "" }, { "docid": "70408569acfcdaf8d951db009a1051be", "score": "0.6104628", "text": "function memoize(method) {\n\n var results = {};\n\n return function () {\n\n var cacheKey = void 0;\n\n try {\n cacheKey = JSON.stringify(Array.prototype.slice.call(arguments), function (key, val) {\n\n if (typeof val === 'function') {\n return 'xcomponent:memoize[' + (0, _util.getObjectID)(val) + ']';\n }\n\n return val;\n });\n } catch (err) {\n throw new Error('Arguments not serializable -- can not be used to memoize');\n }\n\n if (!results.hasOwnProperty(cacheKey)) {\n results[cacheKey] = method.apply(this, arguments);\n }\n\n return results[cacheKey];\n };\n}", "title": "" }, { "docid": "23de471d43571f6396c29cda05f9ce46", "score": "0.6074907", "text": "function memoizeFunction(cb, maxCacheSize) {\n if (maxCacheSize === void 0) { maxCacheSize = 100; }\n // Avoid breaking scenarios which don't have weak map.\n if (!_weakMap) {\n return cb;\n }\n var rootNode;\n var cacheSize = 0;\n var localResetCounter = _resetCounter;\n // tslint:disable-next-line:no-function-expression\n return function memoizedFunction() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var currentNode = rootNode;\n if (rootNode === undefined || localResetCounter !== _resetCounter || (maxCacheSize > 0 && cacheSize > maxCacheSize)) {\n rootNode = _createNode();\n cacheSize = 0;\n localResetCounter = _resetCounter;\n }\n currentNode = rootNode;\n // Traverse the tree until we find the match.\n for (var i = 0; i < args.length; i++) {\n var arg = _normalizeArg(args[i]);\n if (!currentNode.map.has(arg)) {\n currentNode.map.set(arg, _createNode());\n }\n currentNode = currentNode.map.get(arg);\n }\n if (!currentNode.hasOwnProperty('value')) {\n currentNode.value = cb.apply(void 0, args);\n cacheSize++;\n }\n return currentNode.value;\n };\n}", "title": "" }, { "docid": "23de471d43571f6396c29cda05f9ce46", "score": "0.6074907", "text": "function memoizeFunction(cb, maxCacheSize) {\n if (maxCacheSize === void 0) { maxCacheSize = 100; }\n // Avoid breaking scenarios which don't have weak map.\n if (!_weakMap) {\n return cb;\n }\n var rootNode;\n var cacheSize = 0;\n var localResetCounter = _resetCounter;\n // tslint:disable-next-line:no-function-expression\n return function memoizedFunction() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var currentNode = rootNode;\n if (rootNode === undefined || localResetCounter !== _resetCounter || (maxCacheSize > 0 && cacheSize > maxCacheSize)) {\n rootNode = _createNode();\n cacheSize = 0;\n localResetCounter = _resetCounter;\n }\n currentNode = rootNode;\n // Traverse the tree until we find the match.\n for (var i = 0; i < args.length; i++) {\n var arg = _normalizeArg(args[i]);\n if (!currentNode.map.has(arg)) {\n currentNode.map.set(arg, _createNode());\n }\n currentNode = currentNode.map.get(arg);\n }\n if (!currentNode.hasOwnProperty('value')) {\n currentNode.value = cb.apply(void 0, args);\n cacheSize++;\n }\n return currentNode.value;\n };\n}", "title": "" }, { "docid": "670b2568689d6b54ae501529f5f4c84a", "score": "0.60632485", "text": "function example1() {\n const cachedFunction = cache.withCache('SLOW_FUNCTION', slowFunction);\n\n cachedFunction('Jacob')\n .then((greeting) => {\n console.log(greeting);\n })\n}", "title": "" }, { "docid": "89067d4e805ad6235d9bb6b4f2db5962", "score": "0.60402274", "text": "function recurseMemoized(i, size) {\n let answer = cache[i][size];\n\n if (!answer) {\n answer = recurse(i, size);\n // make a copy of the answer we got \n cache[i][size] = Object.assign({}, answer);\n }\n\n return answer;\n }", "title": "" }, { "docid": "220971a997893e0870b11950dba55bdb", "score": "0.60024166", "text": "function memoizeFunction(cb, maxCacheSize) {\n if (maxCacheSize === void 0) { maxCacheSize = 100; }\n var rootNode;\n var cacheSize = 0;\n // Avoid breaking scenarios which don't have weak map.\n if (!_weakMap) {\n return cb;\n }\n // tslint:disable-next-line:no-function-expression\n return function memoizedFunction() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var currentNode = rootNode;\n if (rootNode === undefined || (maxCacheSize > 0 && cacheSize > maxCacheSize)) {\n rootNode = _createNode();\n cacheSize = 0;\n }\n currentNode = rootNode;\n // Traverse the tree until we find the match.\n for (var i = 0; i < args.length; i++) {\n var arg = _normalizeArg(args[i]);\n if (!currentNode.map.has(arg)) {\n currentNode.map.set(arg, _createNode());\n }\n currentNode = currentNode.map.get(arg);\n }\n if (!currentNode.hasOwnProperty('value')) {\n currentNode.value = cb.apply(void 0, args);\n cacheSize++;\n }\n return currentNode.value;\n };\n}", "title": "" }, { "docid": "1e99f99576e267d75f1426a610e3287f", "score": "0.5990998", "text": "function memoize(fn) {\n let lastArgs = null;\n let lastResult = null;\n return function() {\n const args = [...arguments];\n // if args and lastArgs are the same\n if(lastArgs && lastArgs.every((arg, i) => arg === args[i])) {\n console.log('from last result');\n return lastResult;\n }\n console.log('invoke again');\n // return lastResult\n\n // otherwise\n // store lastArgs\n lastArgs = args;\n // invoke fn and store lastResult\n // fn.apply(null, args);\n lastResult = fn(... args);\n // return result\n return lastResult;\n };\n}", "title": "" }, { "docid": "08338638bd6838990a0830d7334eed50", "score": "0.59906447", "text": "function memoize(type, pattern, options, fn) {\n var key = utils.createKey(type + '=' + pattern, options);\n\n if (options && options.cache === false) {\n return fn(pattern, options);\n }\n\n if (cache.has(type, key)) {\n return cache.get(type, key);\n }\n\n var val = fn(pattern, options);\n cache.set(type, key, val);\n return val;\n}", "title": "" }, { "docid": "08338638bd6838990a0830d7334eed50", "score": "0.59906447", "text": "function memoize(type, pattern, options, fn) {\n var key = utils.createKey(type + '=' + pattern, options);\n\n if (options && options.cache === false) {\n return fn(pattern, options);\n }\n\n if (cache.has(type, key)) {\n return cache.get(type, key);\n }\n\n var val = fn(pattern, options);\n cache.set(type, key, val);\n return val;\n}", "title": "" }, { "docid": "08338638bd6838990a0830d7334eed50", "score": "0.59906447", "text": "function memoize(type, pattern, options, fn) {\n var key = utils.createKey(type + '=' + pattern, options);\n\n if (options && options.cache === false) {\n return fn(pattern, options);\n }\n\n if (cache.has(type, key)) {\n return cache.get(type, key);\n }\n\n var val = fn(pattern, options);\n cache.set(type, key, val);\n return val;\n}", "title": "" }, { "docid": "08338638bd6838990a0830d7334eed50", "score": "0.59906447", "text": "function memoize(type, pattern, options, fn) {\n var key = utils.createKey(type + '=' + pattern, options);\n\n if (options && options.cache === false) {\n return fn(pattern, options);\n }\n\n if (cache.has(type, key)) {\n return cache.get(type, key);\n }\n\n var val = fn(pattern, options);\n cache.set(type, key, val);\n return val;\n}", "title": "" }, { "docid": "08338638bd6838990a0830d7334eed50", "score": "0.59906447", "text": "function memoize(type, pattern, options, fn) {\n var key = utils.createKey(type + '=' + pattern, options);\n\n if (options && options.cache === false) {\n return fn(pattern, options);\n }\n\n if (cache.has(type, key)) {\n return cache.get(type, key);\n }\n\n var val = fn(pattern, options);\n cache.set(type, key, val);\n return val;\n}", "title": "" }, { "docid": "08338638bd6838990a0830d7334eed50", "score": "0.59906447", "text": "function memoize(type, pattern, options, fn) {\n var key = utils.createKey(type + '=' + pattern, options);\n\n if (options && options.cache === false) {\n return fn(pattern, options);\n }\n\n if (cache.has(type, key)) {\n return cache.get(type, key);\n }\n\n var val = fn(pattern, options);\n cache.set(type, key, val);\n return val;\n}", "title": "" }, { "docid": "08338638bd6838990a0830d7334eed50", "score": "0.59906447", "text": "function memoize(type, pattern, options, fn) {\n var key = utils.createKey(type + '=' + pattern, options);\n\n if (options && options.cache === false) {\n return fn(pattern, options);\n }\n\n if (cache.has(type, key)) {\n return cache.get(type, key);\n }\n\n var val = fn(pattern, options);\n cache.set(type, key, val);\n return val;\n}", "title": "" }, { "docid": "08338638bd6838990a0830d7334eed50", "score": "0.59906447", "text": "function memoize(type, pattern, options, fn) {\n var key = utils.createKey(type + '=' + pattern, options);\n\n if (options && options.cache === false) {\n return fn(pattern, options);\n }\n\n if (cache.has(type, key)) {\n return cache.get(type, key);\n }\n\n var val = fn(pattern, options);\n cache.set(type, key, val);\n return val;\n}", "title": "" }, { "docid": "aff96e32e732a94708d2cfad7e89f06f", "score": "0.59697545", "text": "function memoize(type, pattern, options, fn) {\n var key = utils.createKey(type + ':' + pattern, options);\n var disabled = options && options.cache === false;\n if (disabled) {\n braces.clearCache();\n return fn(pattern, options);\n }\n\n if (cache.hasOwnProperty(key)) {\n return cache[key];\n }\n\n var res = fn(pattern, options);\n cache[key] = res;\n return res;\n}", "title": "" }, { "docid": "aff96e32e732a94708d2cfad7e89f06f", "score": "0.59697545", "text": "function memoize(type, pattern, options, fn) {\n var key = utils.createKey(type + ':' + pattern, options);\n var disabled = options && options.cache === false;\n if (disabled) {\n braces.clearCache();\n return fn(pattern, options);\n }\n\n if (cache.hasOwnProperty(key)) {\n return cache[key];\n }\n\n var res = fn(pattern, options);\n cache[key] = res;\n return res;\n}", "title": "" }, { "docid": "aff96e32e732a94708d2cfad7e89f06f", "score": "0.59697545", "text": "function memoize(type, pattern, options, fn) {\n var key = utils.createKey(type + ':' + pattern, options);\n var disabled = options && options.cache === false;\n if (disabled) {\n braces.clearCache();\n return fn(pattern, options);\n }\n\n if (cache.hasOwnProperty(key)) {\n return cache[key];\n }\n\n var res = fn(pattern, options);\n cache[key] = res;\n return res;\n}", "title": "" }, { "docid": "00c13ccab261867cd2a039a2e7a8da28", "score": "0.59641904", "text": "function cacheOnTarget() {\n var target = {x:42};\n var proxy = createProxy(target);\n\n var getX = function(o) { return o.x; };\n noInline(getX);\n\n var sum = 0;\n for (var i = 0; i < niters; ++i)\n sum += getX(proxy);\n\n if (sum != 42 * niters)\n throw new Error(\"Incorrect result\");\n}", "title": "" }, { "docid": "8d0ecb0fd76d92c6eebd5fff5b6d268b", "score": "0.59497374", "text": "function cached(fn) {\n\t var cache = new Map();\n\t return function cachedFn() {\n\t var key = arguments.length <= 0 ? undefined : arguments[0];\n\t if (!cache.has(key)) cache.set(key, fn.apply(void 0, arguments));\n\t return cache.get(key);\n\t };\n\t }", "title": "" }, { "docid": "75184b21a0aef4875f3da6c40c47c261", "score": "0.5946726", "text": "function memoized(...newArgs) {\n const transformedArgs = transformArgs(...newArgs);\n if (calledOnce && lastThis === this && isEqual(transformedArgs, lastArgs)) {\n return lastResult;\n }\n\n // Throwing during an assignment aborts the assignment: https://codepen.io/alexreardon/pen/RYKoaz\n // Doing the lastResult assignment first so that if it throws\n // nothing will be overwritten\n lastResult = resultFn.apply(this, transformedArgs);\n calledOnce = true;\n lastThis = this;\n lastArgs = transformedArgs;\n return lastResult;\n }", "title": "" }, { "docid": "73b1185428e3a1e4b6139b9dc4036b54", "score": "0.5946076", "text": "function memoize(type, pattern, options, fn) {\n var key = utils.createKey(type + ':' + pattern, options);\n var disabled = options && options.cache === false;\n\n if (disabled) {\n braces.clearCache();\n return fn(pattern, options);\n }\n\n if (cache.hasOwnProperty(key)) {\n return cache[key];\n }\n\n var res = fn(pattern, options);\n cache[key] = res;\n return res;\n}", "title": "" }, { "docid": "f2b443efd8ccd36c2981752bfcb5bd20", "score": "0.59059167", "text": "function memoizer(memo, formula) {\n var recur = function(n) {\n if (typeof result !== 'number') {\n result = formula(recur, n);\n memo[n] = result;\n }\n return result;\n };\n return recur;\n}", "title": "" } ]
7e8a23fe0f82ce66b185a0ee1a5d1fec
Become the master peer if the position is still available.
[ { "docid": "9a526e0878b9530e076177ccdb4bebe2", "score": "0.5505409", "text": "becomeMaster_() {\n var key = this.getMasterKey_();\n if (!this.storage_.getItem(key)) {\n this.storage_.setItem(key, this.id_);\n events.DISPATCHER.dispatchEvent(new GoogEvent(\n events.EventType.forGroup(events.EventType.MASTER_APPOINTED, this.group_)));\n }\n }", "title": "" } ]
[ { "docid": "c5c3b438ec5f0253f02dec4f6d82ea9c", "score": "0.7096274", "text": "doEstablishMaster_() {\n if (this.isPeerAlive_(this.getId())) {\n // get others\n var peerIds = this.getPeers();\n // add self\n peerIds.push(this.getId());\n // sort, \"smallest\" peer ID becomes master\n googArray.sort(peerIds);\n if (peerIds[0] === this.getId()) {\n // it's me!\n this.becomeMaster_();\n }\n }\n this.establishMasterDelay_.stop();\n this.establishMasterDelay_.dispose();\n this.establishMasterDelay_ = null;\n }", "title": "" }, { "docid": "c52690ac6cb09433cf40f7b215c365ac", "score": "0.56420785", "text": "establishMaster_() {\n if (this.establishMasterDelay_) {\n return;\n }\n this.establishMasterDelay_ = new Delay(this.doEstablishMaster_, 25, this);\n this.establishMasterDelay_.start();\n }", "title": "" }, { "docid": "0ed3367d9732c5b62e174152e4e63fc6", "score": "0.54087865", "text": "function maybeStartV() {\n if (!started && $rootScope.localStream) {\n\n createPeerConnection();\n pc.addStream($scope.localStream);\n started = true;\n // Caller initiates offer to peer.\n doCallV();\n\n }\n }", "title": "" }, { "docid": "baac8008f071bdf6e7d6beb6b7b07c4c", "score": "0.52501273", "text": "function success(position) {\n if (!inited)\n init(position)\n else {\n var loc = mymarker.getLatLng();\n var latLong = getLatLong(position)\n mymarker.moveTo(latLong, 5000)\n socket.emit('servicelocChanged', {\n latLong: latLong\n });\n }\n}", "title": "" }, { "docid": "05e61afc4eff374a01de50a699cb61f4", "score": "0.5230886", "text": "function OnStartLocalPlayer(){\n\t\tif(!isServer){ //the server doesn't need to send updates to himself. he knows where he is\n\t\t\tInvokeRepeating(\"SendStateToServer\", 0, sendRate);\n\t\t}\n\t}", "title": "" }, { "docid": "ec92a6f6259cb5e0faeb92fb91caae6f", "score": "0.52259433", "text": "function pingRet (peer) {\n if (peer.UDPping == null || peer.TCPping == null) return;\n if (peer.UDPping.resp != null && peer.TCPping.resp != null) {\n if (peer.UDPping.resp == \"VISIBLE\" && peer.TCPping.resp == \"VISIBLE\" && !ip.isPrivate(peer.address)) {\n peer.connectability = 2;\n updatePeer(peer);\n var o = {type: \"PEERS\", data: [peer.server]};\n announce(o, true, [peer.ident]); //We avoid telling a node about itself by adding its ID to the ignore list\n if (debug) console.log(\"Peer is connectable!\"); // This is when we should share peers with this node\n } else if (!ip.isPrivate(peer.address)) {\n peer.connectability = 1;\n //We tell the other peer we are having trouble with connecting to them\n peer.socket.sendSign({type: \"REMOTEFAILURE\"});\n if (debug) console.log(\"Peer is public but not connectable!\");\n } else {\n peer.connectability = 0;\n if (debug) console.log(\"Peer is private!\");\n }\n peer.UDPping = null;\n peer.TCPping = null;\n }\n}", "title": "" }, { "docid": "61abcea199739904a62db6e5ebb42f51", "score": "0.5214577", "text": "function maybeStartA() {\n if (!started && $rootScope.localStream) {\n\n createPeerConnection();\n pc.addStream($scope.localStream);\n started = true;\n // Caller initiates offer to peer.\n doCallA();\n }\n }", "title": "" }, { "docid": "442abeeae4e2f6f02712715b1d54ae5f", "score": "0.521333", "text": "function sendPosition() {\n\n // If the player position is dirty since last iteration, send it\n if (positionToBroadcast != null) {\n\n // Send location to the server\n socket.emit('move', positionToBroadcast);\n\n // Mark position as clean\n positionToBroadcast = null;\n }\n}", "title": "" }, { "docid": "f2cda6ea5c7d7a20ec484156d6eac4c8", "score": "0.52008325", "text": "maybeStart() {\n console.log('>>>>>>> maybeStart() ', this.state.isStarted, localStream, this.state.isChannelReady);\n if (!this.state.isStarted && typeof localStream !== 'undefined' && this.state.isChannelReady) {\n console.log('>>>>>> creating peer connection');\n this.createPeerConnection();\n pc.addStream(localStream);\n this.setState({\n isStarted: true\n });\n console.log('This is the second time so isInitiator should still be true', this.state.isInitiator);\n if (this.state.isInitiator) {\n this.doCall();\n }\n }\n }", "title": "" }, { "docid": "6fd7dbe1b06571ea4e5884c5eee652d7", "score": "0.517224", "text": "announceProof() {\n this.net.broadcast(Blockchain.PROOF_FOUND, this.currentBlock);\n }", "title": "" }, { "docid": "4c0742b8456eefd0d58c454ddab827a0", "score": "0.51507384", "text": "function checkIfSendDone(){\n sendDone = true\n }", "title": "" }, { "docid": "00890291f583344fd1feca86db41ca3d", "score": "0.5138962", "text": "function check () {\n if ('polling' === self.transport.name && self.transport.writable) {\n debug('writing a noop packet to polling for fast upgrade');\n self.transport.send([{ type: 'noop' }]);\n }\n }", "title": "" }, { "docid": "00890291f583344fd1feca86db41ca3d", "score": "0.5138962", "text": "function check () {\n if ('polling' === self.transport.name && self.transport.writable) {\n debug('writing a noop packet to polling for fast upgrade');\n self.transport.send([{ type: 'noop' }]);\n }\n }", "title": "" }, { "docid": "e6c6d9b196d363b2e71ab81770a91254", "score": "0.51287633", "text": "function check() {\n if (\"polling\" === self.transport.name && self.transport.writable) {\n debug$3(\"writing a noop packet to polling for fast upgrade\");\n self.transport.send([{ type: \"noop\" }]);\n }\n }", "title": "" }, { "docid": "fb643671493007f0a3367d2a9d3b3850", "score": "0.51181936", "text": "isMaster() {\n return this.master;\n }", "title": "" }, { "docid": "37522036ea17cde3de2a308b2c0b91c9", "score": "0.5011634", "text": "async stabilize() {\n // console.log('Make sure it starts...');\n // Make sure both successor and predecessor are valid and alive\n if (this.predecessor !== HEAD) {\n try {\n await this.execChordRpc(this.predecessor, 'ping', { originator: this.address });\n } catch (e) {\n console.log(`Tried pinging ${this.predecessor} failed, so set predecessor to HEAD`);\n this.predecessor = HEAD;\n }\n }\n if (this.successor !== TAIL) {\n try {\n await this.execChordRpc(this.successor, 'ping', { originator: this.address });\n } catch (e) {\n console.log(`Tried pinging ${this.successor} failed, so set successor to TAIL`);\n this.successor = TAIL;\n }\n }\n // Updates is joined status\n this.isJoined = this.testIsJoined();\n }", "title": "" }, { "docid": "a1e37e66c9a289ac2f29a54d4c29c528", "score": "0.5010924", "text": "function geolocationSuccesful(position) {\n\tsocket.emit('location', {\n\t\tlatitude: position.coords.latitude,\n\t\tlongitude: position.coords.longitude\n\t});\n}", "title": "" }, { "docid": "06ce182249641bd603e9e65b344f928a", "score": "0.4995695", "text": "recvPropose(fromUID, slot_num, decree) {\n console.log('recv propose', fromUID, slot_num, decree, this.leaderProposals, this.leaderProposals[slot_num])\n // new proposal or overwriting null decree\n if (!this.leaderProposals[slot_num] || this.leaderProposals[slot_num] === null) {\n console.log('new proposal for slot_num')\n this.leaderProposals[slot_num] = decree\n // if the size is 1, acquire leadership\n if (this.quorumSize === 1) {\n this.isLeader = true\n this.onLeaderChange(this.isLeader)\n }\n if (this.isLeader) {\n // TODO: spawn commander\n this.send('accept', this.ballotID, slot_num, decree)\n }\n }\n else {\n // slot already known - send decision\n console.log(this.leaderProposals[slot_num])\n this.send('decided', fromUID, slot_num, this.leaderProposals[slot_num])\n }\n }", "title": "" }, { "docid": "bca0c29e87a37d707b9a85428621a889", "score": "0.4949227", "text": "_toggleLookingForClient() {\n var sharing = this.state.sharing;\n var data = this.state.treeData;\n var lookingForClient = !this.state.lookingForClient;\n var receiving = this.state.receiving;\n var deleting = this.state.deleting;\n\n if (this.state.lookingForClient) {\n stopUDPBroadcast();\n closeTCPServer();\n }\n if (this.state.sharing) {\n sharing = false;\n }\n\n this.setState({\n treeData: data,\n sharing: sharing,\n lookingForClient: lookingForClient,\n receiving: receiving,\n deleting: deleting\n });\n }", "title": "" }, { "docid": "7566badaf98ab044a21e0192feebbe12", "score": "0.4940057", "text": "async initPeer (toSelf) {\n const initRes = await this.server.peers.get(toSelf)\n if (!initRes.ok) {\n const errRes = await initRes.text()\n if (errRes === 'no available peers') {\n return false\n }\n throw new Error(errRes)\n }\n const initData = await initRes.json()\n\n const peer = new InitiatingPeer(initData.userId)\n this._attachCommonPeerEventHandlers(peer)\n\n this.peers.push(peer)\n\n return true\n }", "title": "" }, { "docid": "ea5a04d2b91807ffb78a57e68121db55", "score": "0.4917065", "text": "enterResetSlave(ctx) {\n\t}", "title": "" }, { "docid": "3b0ca767926d3db3bddefe6664c0d787", "score": "0.49087876", "text": "function sendToMaster(event, data, callback)\n{\n // notify master\n if (master)\n {\n master.emit(event, data, callback);\n }\n else\n {\n masterQueue.push(function(master)\n {\n master.emit(event, data, callback);\n });\n }\n}", "title": "" }, { "docid": "cf9278c2e24f6e749bb06f12091284d8", "score": "0.4896861", "text": "async join(host) {\n console.log('joining...');\n if (this.isJoined) { return false; }\n\n if (!isAddress(host)) { throw new Error('Host is not an IPv4 address.'); }\n\n if (host === this.address) { throw new Error('Cannot join to the peer'); }\n\n // Should stop maintenance\n const lookupResponse = await this.execChordRpc(host, 'lookup', {\n name: sha1(this.address),\n });\n console.log(`Lookup response is: ${JSON.stringify(lookupResponse)}`);\n const {\n predecessor: newPredecessor,\n successor: newSuccessor,\n } = lookupResponse;\n const newSuccessorFlag = isAddress(newSuccessor);\n const newPredecessorFlag = isAddress(newPredecessor);\n\n if (!newSuccessorFlag && !newPredecessorFlag) {\n throw new Error('Failed to find any joinable node');\n }\n if (newSuccessorFlag) {\n this.successor = newSuccessor;\n }\n if (newPredecessorFlag) {\n this.predecessor = newPredecessor;\n }\n try {\n if (newPredecessorFlag) {\n await this.execChordRpc(this.predecessor, 'notify', {\n originator: this.address,\n role: 'successor',\n });\n }\n if (newSuccessorFlag) {\n await this.execChordRpc(this.successor, 'notify', {\n originator: this.address,\n role: 'predecessor',\n });\n }\n } catch (e) {\n console.log(`Notify error: ${JSON.stringify(e)}`);\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "90edbaa2d72062e74efb788cc5747046", "score": "0.4893575", "text": "async _return_to_leader() {\n\t\tLogging.info(`Returning to ${this.leader_name}`);\n\t\tconst leader = maincode.character;\n\t\tif (!leader) {\n\t\t\t// Leader has gone missing!\n\t\t\treturn null;\n\t\t}\n\n\t\ttry {\n\t\t\tawait character.xmove(leader.x, leader.y, leader.map);\n\t\t} catch (e) {\n\t\t\tLogging.warn('Movement failed', e);\n\t\t\tawait this._sleep();\n\t\t}\n\t}", "title": "" }, { "docid": "e6d088a6e4082cfe9d0ac6399f410bea", "score": "0.4890849", "text": "function onNewPositionToServer(){\n\tsocket.emit(\"newPositionToServer\",{\n\t\tx: localPlayer.getX(),\n\t\ty: localPlayer.getY()\n\t});\n}", "title": "" }, { "docid": "7c25c1babb86ccf97287f9ece1b42668", "score": "0.48794046", "text": "function checkAndStart(){\n if(!isStarted && isChannelReady) {\n createPeerConnection();\n isStarted = true;\n if(isInitiator) {\n doCall(); //TODO check this calling method\n }\n }\n}", "title": "" }, { "docid": "92f68ef835de37bd433c240aa7329aae", "score": "0.48703545", "text": "handlePlayerReady() {\n if (this.status == PlayerStatus.Setup) {\n logger.error(`Player ${this.userId} is still setuping...`)\n return\n }\n let { map } = this.state.get('location')\n this.status = PlayerStatus.Exploring\n logger.info(`${this.userId} is ready on map ${map}`)\n this.currentMap = this.server.maps.get(map, this)\n this.currentMap.addPlayer(this)\n }", "title": "" }, { "docid": "120376794f9bf515d9a49109c361d5a1", "score": "0.48525923", "text": "_isPeerSocketOpen(){\n return peerSocket.readyState === peerSocket.OPEN\n }", "title": "" }, { "docid": "0a05c346b8eac630d6b915ac56cec815", "score": "0.48361465", "text": "start(){\n console.log(\"start\");\n\n /**\n * Client x tells server to repeat the word it just said\n */\n this.socket.on(\"client:repeatWord\", (function(data){\n console.log(\"repeat Word\", data);\n if(data === \"human\"){\n this.master.naoComm.repeat();\n }else{\n this.master.naoComm.start().say(\"Please repeat!\").finish().send();\n }\n\n }).bind(this));\n\n\n /**\n * Client x tells server it wants to move\n * This practically means the client clicked\n * on a object\n */\n this.socket.on(\"client:movePlayer\", (function(data){\n console.log(\"clientMovePlayer -- E\");\n this.master.clientMovePlayer(data.name, data.hintNr);\n }).bind(this));\n\n /**\n * The client is asking for the current player list\n */\n this.socket.on(\"client:playerList\", (function(){\n console.log(\"ask for player list\");\n this.socket.emit(\"server:playerList\", this.master.players); //will send message to the connector\n\n }).bind(this));\n\n /**\n * The client is asking for the current player list. This function will return the data directly\n * It is an abuse of socket.io and represent a REST call.\n */\n this.socket.on(\"client:getPlayerList\", (function(fd){\n console.log(\"ask for player list\");\n fd(this.master.players);\n }).bind(this));\n\n /**\n * Client asks for new level\n */\n this.socket.on(\"client:changeLevel\", (function(level){\n this.master.serverGetLevel(level);\n }).bind(this));\n\n /**\n * A client is logging in\n */\n this.socket.on(\"client:signOn\", (function(playerName){\n this.master.logIn(playerName);\n this.io.emit(\"server:playerList\", this.master.players); //will send message to the connector\n }).bind(this));\n\n /**\n * Listens to what the participant said (The wizard selected) and if it was correct\n */\n this.socket.on(\"client:multiPartSaid\", (function(data){\n this.master.clientMultiParticipantSaid(data.transmitter, data.receiver, data.correctness, data.answer, data.dictionary);\n }).bind(this));\n\n\n /**\n * Listens to the client when to generate a multiPlayerCondition\n */\n this.socket.on(\"client:generateMultiPlayerConditionDictionary\", (function(data){\n this.master.clientGenerateMultiPlayerConditionDictionary();\n }).bind(this));\n\n this.socket.on(\"client:init\",(function(data){\n this.master.clientInit();\n }).bind(this));\n\n this.socket.on(\"client:trustgame\",(function(data){\n //this.master.naoComm.start().volume(70).trustgame().finish().send();\n this.master.naoComm.start().volume(0).finish().send();\n }).bind(this));\n\n this.socket.on(\"client:initPosition\",(function(data){\n this.master.naoComm.start().initSit().finish().send();\n }).bind(this));\n\n this.socket.on(\"client:robotSay\",(function(data){\n this.master.naoComm.start().volume(70).say(data).finish().send();\n }).bind(this));\n\n }", "title": "" }, { "docid": "e3399e74c09a9966af4b98ce97c49a7f", "score": "0.4826353", "text": "createPeer() {\n try{\n var peer = new Peer(); \n peer.on('open', () => {\n this.props.setLocal(peer); \n });\n }\n catch(error){\n this.setState({ errorMessage : \"Impossible to create a new peer\"})\n }\n }", "title": "" }, { "docid": "93724275267dabf9c6a103016ef61361", "score": "0.48240975", "text": "async function gainPosition(balance, lastPeakPrice, lastValleyPrice, positionInfo, productInfo, tradingConfig) {\r\n try {\r\n while (positionInfo.positionExists === false) {\r\n await sleep(250); //Let price update\r\n\r\n if (lastPeakPrice < currentPrice) {\r\n //New peak hit, track peak price and check buy conditions\r\n lastPeakPrice = currentPrice;\r\n\r\n const target = lastValleyPrice + (lastValleyPrice * buyPositionDelta);\r\n\r\n if (lastPeakPrice >= target) {\r\n\r\n //Create a new authenticated client to prevent it from expiring or hitting API limits\r\n authedClient = new CoinbasePro.AuthenticatedClient(\r\n key,\r\n secret,\r\n passphrase,\r\n apiURI\r\n );\r\n\r\n console.log(\"Entering buy position.\");\r\n await buyPosition(balance, positionInfo, lastPeakPrice, authedClient, productInfo, tradingConfig);\r\n }\r\n } else if (lastValleyPrice > currentPrice) {\r\n //New valley hit, reset values\r\n\r\n lastPeakPrice = currentPrice;\r\n lastValleyPrice = currentPrice;\r\n\r\n }\r\n }\r\n } catch (err) {\r\n const message = \"Error occurred in gainPosition method.\";\r\n const errorMsg = new Error(err);\r\n console.log({ message, errorMsg, err });\r\n throw err;\r\n }\r\n}", "title": "" }, { "docid": "7d58bc5e0e6ab1e5be71b102d35340fc", "score": "0.48099542", "text": "sendPing() {\n\t if (!this.isAlive()) {\n\t this.emit('noPong');\n\t if (this.state === CONST.STATE.CONNECTED) {\n\t this.state = CONST.STATE.NOT_CONNECTED;\n\t }\n\t return;\n\t }\n\t this.setHalfDead();\n\t this.ping();\n\t }", "title": "" }, { "docid": "4853b88667ccc8d59a7bd0c560ba58d0", "score": "0.48035654", "text": "processConnection(room, incomingDoors) { return false; /* returns true if traversal should continue through this room */ }", "title": "" }, { "docid": "9271fa0eccf423efb36fb24acd614079", "score": "0.47921497", "text": "function updateCurrentPosition(position) {\n latLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n\n // Move the currentPosition marker to the new position\n currentPosition.setPosition(latLng);\n\n if (distance(destination.getPosition(), currentPosition.getPosition()) <= 0.5) {\n // TODO: issues with audio element\n //var alarm = document.getElementById('alarm');\n //alarm.play();\n alert(\"Your close to your stop!\");\n }\n}", "title": "" }, { "docid": "db9d15e7a3d20e929df688a6373e0eb1", "score": "0.47857255", "text": "keepConflict() {\n this.guardCurrentPhase('setup');\n this.eachPlayerInFirstPlayerOrder(player => player.clickPrompt('Done'));\n }", "title": "" }, { "docid": "d9f3e9dc3d73631745e4bf491a9458f2", "score": "0.47843838", "text": "function sendCandidate(connection, message){\n var client = getClient(message.target); \n if(client){\n send(connection, {type:'ack-send-candidate', username:message.target});\n send(client, message);\n } else {\n send(connection, {type:'ack-send-candidate', username:message.target, success:false, error:'not found'});\n }\n }", "title": "" }, { "docid": "eb82e31cf6bfb2f1bf63af78dd8fe3bc", "score": "0.47777963", "text": "process() {\n this.connect();\n this.select();\n this.disconnect();\n return true;\n }", "title": "" }, { "docid": "991012d985c4b3d89dc4eefe4bb21948", "score": "0.47740582", "text": "_checkPlayer() {\n // calculate absolute difference of original position vecgtor to player mesh to know if player is close\n const dist = Vector3.Distance(this.originalPosition, this.playerMesh.position);\n if (dist < 15) {\n // calculate if the player is in the same platform / level\n // player might be close but above the npc\n const yDistance = Math.abs(this.originalPosition.y - this.playerMesh.position.y);\n // if it is not above or on a different level / higher platform of the game \n // then return the player position indicating NPC detect player\n if (yDistance < 2) {\n return this.playerMesh.position;\n }\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "f41a801ffb9c18087a395de679242a10", "score": "0.4771232", "text": "function onNewPositionToClient(data){\n\t\tvar index = searchIndexById(data.id);\n\t\tremotePlayers[index].setX(data.x);\n\t\tremotePlayers[index].setY(data.y);\n\t}", "title": "" }, { "docid": "6f7c11fdf58b417f2b8a9bd9e8cf5f11", "score": "0.47602278", "text": "function MakePeer() {\n client.gotAnswer = false\n let peer = InitPeer('init')\n peer.on('signal', function (data) {\n if (!client.gotAnswer) {\n socket.emit('Offer', data)\n }\n })\n client.peer = peer\n }", "title": "" }, { "docid": "0d49d2ef75f78bc3c9e1b1637f7ab575", "score": "0.47409782", "text": "function createPeer() {\n\t\t\tclient.getAnswer = false //setting initial ans to false\n\t\t\tlet peer = newPeer('init') //getting our peer from the NewPeer() created \n\t\t\t\t//Fired when the peer wants to send signaling data to the remote peer.\n\t\t\tpeer.on('signal', data => {\n\t\t\t\tif(!client.getAnswer) //if ans is true\n\t\t\t\t\tsocket.emit('offer', data) //event is offer here and offer will be made by send data to signaling fn\n\t\t\t})\n\t\t\tclient.peer = peer //setting property of client as peer type\n\t\t}", "title": "" }, { "docid": "b1132e65dd1ff78a5417226aa64ca310", "score": "0.4723031", "text": "function checkIfMarkerFound() {\n\t\tif (!dataSent) {\n\t\t\tlet obj = {\n\t\t\t\ttype: \"marker\",\n\t\t\t\ttime: new Date().getTime(),\n\t\t\t\tsequence: ++positionSequence,\n\t\t\t\tmax: 0,\n\t\t\t\tx: 0,\n\t\t\t\ty: 0,\n\t\t\t\tcount: 0\n\t\t\t};\n\t\t\t//Sender.add(obj)\n\t\t}\n\t\tdataSent = false;\n\t}", "title": "" }, { "docid": "25f4b6a1a27d05e9def82f91fe02e4d3", "score": "0.47207254", "text": "function check() {\n\t if (atTop()) {\n\t\tif (!isStuck)\n\t\t stick();\n\t } else {\n\t\tif (isStuck)\n\t\t unstick();\n\t }\n\t}", "title": "" }, { "docid": "2eb91394c89dc1c7fa44ced64d28cede", "score": "0.47127843", "text": "function startServer(options) {\n if (options.master) {\n remote(options, function() {\n server(options);\n });\n } else {\n console.log('lack of option master');\n }\n}", "title": "" }, { "docid": "5f1424f46c4885f5c6a7fd9cb44ad7fb", "score": "0.47109526", "text": "enterResetMaster(ctx) {\n\t}", "title": "" }, { "docid": "fc6df09aba76493d27289a95f3a3b16d", "score": "0.4701823", "text": "function onXmppConnected(client) {\n client.connection.xmpp = true;\n client.emit('connection', client.connection);\n client.xmpp.getRoster(function (err, resp) {\n if (err) {\n client.emit('xmpp:error', err);\n } else {\n if (resp.items) {\n resp.items.map(function (i) {\n self.connection.roster[i.from.full] = { remoteUser: i.from.full, presence: 'unavailable' };\n });\n }\n }\n client.xmpp.sendPresence();\n });\n}", "title": "" }, { "docid": "cf9d21cd878baacd675fa215277a8b68", "score": "0.4697503", "text": "function LocalMaster(game) {\n var clientCallbacks = {};\n\n var send = function send(_ref) {\n var type = _ref.type,\n playerID = _ref.playerID,\n args = _ref.args;\n var callback = clientCallbacks[playerID];\n\n if (callback !== undefined) {\n callback.apply(null, [type].concat(_toConsumableArray(args)));\n }\n };\n\n var sendAll = function sendAll(arg) {\n for (var playerID in clientCallbacks) {\n var _arg = arg(playerID),\n type = _arg.type,\n args = _arg.args;\n\n send({\n type: type,\n playerID: playerID,\n args: args\n });\n }\n };\n\n var master = new Master(game, new InMemory(), {\n send: send,\n sendAll: sendAll\n }, false);\n master.executeSynchronously = true;\n\n master.connect = function (gameID, playerID, callback) {\n clientCallbacks[playerID] = callback;\n };\n\n return master;\n}", "title": "" }, { "docid": "d98bec606d7aae05e990c8abe9cd61bb", "score": "0.46966407", "text": "boot() {\n if (this.status == PlayerStatus.Setup) {\n logger.info(`Sending setup request for ${this.userId}`)\n this.localEvents.emit('remote:startSetup', this.state.get('name'))\n } else {\n this.removeFromCurrentMap()\n let location = this.state.get('location')\n logger.info(`Teleporting ${this.userId} to last location at ${JSON.stringify(location)}`)\n this.localEvents.emit('remote:boot', location)\n }\n }", "title": "" }, { "docid": "d9b43eb753ec454a4e65ddf3f97da382", "score": "0.4678151", "text": "update() {\n\t\t// The player wins - has arrived to the river\n\t\t// Bring the player to the start position\n\t\tif (this.y <= -15) {\n\t\t\tthis.resetPlayerPosition();\n\t\t}\n\n\t\t// Check if there is a collision\n\t\tthis.checkCollisions();\n\t}", "title": "" }, { "docid": "575d15d79b1face7e77ca8d8aefb8776", "score": "0.46760362", "text": "addPeer(peer) { \n console.log(\"Attempting to add peer: \" + peer.address)\n\n \n\n if(this.peers.filter(e => e.address == peer.address).length == 0 && this.pendingPeers.filter(e => e.address == peer.address).length == 0) { \n this.pendingPeers.push(peer)\n peer.isValid()\n .then(valid => {\n if (valid) {\n this.peers.push(peer)\n this.resolvePeer(peer)\n peer.addPeer(this.localPeer)\n } \n else {\n console.log(this.peers)\n console.log(\"Could not find peer: \" + peer.address)\n this.peers.splice(this.peers.indexOf(peer), 1)\n }\n\n this.pendingPeers.splice(this.pendingPeers.indexOf(peer), 1)\n })\n }\n }", "title": "" }, { "docid": "6c79f9b7b356756e2e1ca38d1e12f23f", "score": "0.46725553", "text": "function master_merchant() {\n if (character.name == merchant_name) {\n open_close_stand(); // this opens and closes our stand depending on if moving or not\n if (merchant_idle[0]) { // check our const for true or false value\n merchant_handle_location_idle(); // control where merchant hangs out in their downtime\n }\n var potion_seller = get_npc_by_id('fancypots');\n if (character.map == potion_seller.map) { // if we are on the same map as the potion seller\n var distance = distance_to_point(potion_seller.x, potion_seller.y, character.real_x, character.real_y);\n if (distance <= 300) { // if we are close enough to the potion seller\n sell_items(); // refer to function for details\n buy_potions(); // refer to function for details\n }\n }\n exchange_items();\n }\n}", "title": "" }, { "docid": "74365198cf0b58d6bff7a390de13b190", "score": "0.46685702", "text": "function C101_KinbakuClub_SlaveTwin_BondageComplimentDone() {\n\tif (C101_KinbakuClub_SlaveTwin_BondageCompliment) ActorChangeAttitude(0, 1)\n\tC101_KinbakuClub_SlaveTwin_BondageCompliment = false;\n}", "title": "" }, { "docid": "24b09d2437e8c7b07e69197bda8434e2", "score": "0.46665335", "text": "function startMaster() {\n console.log(`Started master`);\n\n process.on('beforeExit', () => {\n // `throng.shutdownSignal` will be `undefined` if the cluster exited without\n // being killed e.g. if the workers exited by themselves and `lifetime` is 0.\n console.log(`Master exiting in response to ${throng.shutdownSignal}...`);\n // Making async calls will keep the master alive.\n console.log('(master cleanup would happen here)');\n });\n}", "title": "" }, { "docid": "a7464461aec8a000a6564f6587d73b1a", "score": "0.46567577", "text": "enterStartSlave(ctx) {\n\t}", "title": "" }, { "docid": "8913664e942327427f269ed6dd81128c", "score": "0.4654017", "text": "function onSuccess(position) {\n callback(true, position);\n }", "title": "" }, { "docid": "5b8e50d0f60294103a622673e9ed76ec", "score": "0.46489242", "text": "function onDone() {\n masterCallback(req, res);\n }", "title": "" }, { "docid": "05e4339b73f62484dc0e7caa14cb4a96", "score": "0.4635231", "text": "isPeerCanSendData(peer) {\n return true;\n }", "title": "" }, { "docid": "33b73376a7dfaaab9d454cf2a07f67e8", "score": "0.4634195", "text": "isSeatAvailable(position) {\n const isGameOn = this.state.playing\n const isLeftSeatAvailable = this.props.leftPlayer.id === null\n const isRightSeatAvailable = this.props.rightPlayer.id === null\n\n const isSeatAvailable = position === 'left' ? isLeftSeatAvailable : isRightSeatAvailable\n\n return isSeatAvailable && !isGameOn\n }", "title": "" }, { "docid": "a420b50b00165624b2b45d66a1d5de6c", "score": "0.4620183", "text": "nextPosition() {\n\n // Loop through behaviors to apply forces\n this.flock();\n\n // Update position\n this.position = this.position.add(this.velocity);\n\n // Collision detection if enabled\n if ( collisions ) { this.detectCollision(); }\n\n // Check edges for walls or overruns\n this.edgeCheck();\n\n }", "title": "" }, { "docid": "bb6af2ad4eb4dc8c80da2ea4f866f4db", "score": "0.46199825", "text": "onPeerConnect (peer) {}", "title": "" }, { "docid": "03cc4f74911de8312e92393a062a15c5", "score": "0.4619718", "text": "enterChangeMaster(ctx) {\n\t}", "title": "" }, { "docid": "2312c1e701b02ee7d5e180b39ceee172", "score": "0.4619488", "text": "function goNext() {\n RoomSocketClient.emit('status:next');\n }", "title": "" }, { "docid": "1cba873d4cda9d70dfa758d79260104e", "score": "0.46170104", "text": "announceCheck() {\n let room = Room.getRoom(this.room_id);\n\n // Let all user know the other player\n // is currently getting checked\n room.broadcastMessage({\n type: \"in_check\",\n checked_color: this.players[this.player_checked].color,\n checked_moves: this.checked_moves\n })\n }", "title": "" }, { "docid": "d9b8832789bc607dc341ce6b9b2f093d", "score": "0.46149346", "text": "finishTrigger() {\n this.server.emit('player:winning');\n }", "title": "" }, { "docid": "b45f1980b85fa4ee06668bdb343dfb9b", "score": "0.4613434", "text": "connectedCallback() {\n super.connectedCallback();\n let root = this;\n root.__observe = false;\n root.__manager = window.AbsolutePositionStateManager.requestAvailability();\n if (root.auto !== false) root.setPosition();\n }", "title": "" }, { "docid": "b719cf2fc58690690bf26ad1bbd46078", "score": "0.4595584", "text": "function standBy(client, p_num){\n\tpassport = getMyPassport(p_num);\n\tchannel = client.join();\n\tvar pp_pack = common.pack(common.MSG_TYPE.MSG_JOIN, passport, passport.sID);\n\tconst msg = common.protobuf_msg_serializer(PULL_MERGER_PROTO_PATH, \"Merger.Identity\", pp_pack);\n\tchannel.write(msg);\n\n\tchannel.on(\"data\", doSign);\n\tchannel.on(\"end\", ()=>{\n\t\tlogger.info (\"the channel has closed by the server\");\n\t})\n\tchannel.on(\"error\", ()=>{\n\t\tlogger.error (\"the server is DEAD... please call 911... \");\n\t});\n}", "title": "" }, { "docid": "df2dde34b05d921e7227e1d400231509", "score": "0.45926213", "text": "function C101_KinbakuClub_SlaveTwin_ComplimentDone() {\n\tC101_KinbakuClub_SlaveTwin_Compliment = false;\n}", "title": "" }, { "docid": "533b1b525c63074c91b4889979e58a53", "score": "0.45879632", "text": "isEaten(){\n //when this colision happens it makes statment true triggering listener in sketch\n if(this.loc.x === head.loc.x && this.loc.y === head.loc.y){\n return true;\n }\n //when its not true its defaultly false, not triggering the function in sketch \n return false;\n }", "title": "" }, { "docid": "835364ebd4715fad05e82e98800227a1", "score": "0.45817804", "text": "function masterSendMode(mode) {\n var p = prot.parts.mode;\n var out = new DataView(new ArrayBuffer(p.length));\n out.setUint32(0, prot.ids.mode, true);\n out.setUint32(p.mode, mode, true);\n masterSock.send(out.buffer);\n}", "title": "" }, { "docid": "7bac2594f7e05e2c4d7dc0f4b32ff346", "score": "0.45789045", "text": "acquireTarget() {\n let targets = Game.rooms[this.room].find(FIND_HOSTILE_CREEPS, {\n filter: function(object) {\n return object.getActiveBodyparts(ATTACK) == 0;\n }\n });\n if (targets && targets.length > 0) {\n this.target = this.pos.findClosestByRange(targets);\n this.memory.target = this.target.id;\n } else this.memory.target = \"none\";\n }", "title": "" }, { "docid": "4de7373e0a7b95584d3cced5488e7932", "score": "0.4577467", "text": "startInterval() {\n debug.message('GPS is available, asking for position.');\n this.update();\n config.interval = this.setInterval(this.update, config.refreshRate);\n ET.addListener(config.positionUpdated, this.check);\n }", "title": "" }, { "docid": "5007a0ebcad80e6c65c5248c3d27f313", "score": "0.45761144", "text": "function waitForJoin(){\n // console.log(\"ROOMS2\");\n // console.log(io.sockets.adapter.rooms);\n io.sockets.in(data[\"lobbyID\"]).emit('playerEnteredLobby', data);\n }", "title": "" }, { "docid": "0d2d76c32c8a9b0623fbe30f8aa414d0", "score": "0.45690995", "text": "function geolocationSuccess(position) {\n server.getLocalGames(position.coords.latitude, position.coords.longitude, handleGames);\n }", "title": "" }, { "docid": "7d0d9f0911ef7f17739332e1f967f0da", "score": "0.45672488", "text": "function checkAnchor() {\r\n if (ASC.Files && ASC.Files.MediaPlayer && ASC.Files.MediaPlayer.isView) {\r\n ASC.Files.MediaPlayer.closePlayer();\r\n }\r\n\r\n if (isInvalidPage()) {\r\n moveToInbox();\r\n }\r\n }", "title": "" }, { "docid": "c9d1e884c9b1a4578c6c88be08363dde", "score": "0.4560053", "text": "function join() {\n // Close old connection\n if (conn) {\n conn.close();\n }\n\n // Create connection to destination peer specified in the input field\n conn = peer.connect(recvIdInput.value, {\n reliable: true\n });\n\n conn.on('open', function () {\n status.innerHTML = \"Connected to: \" + conn.peer;\n console.log(\"Connected to: \" + conn.peer);\n\n // Check URL params for comamnds that should be sent immediately\n var command = getUrlParam(\"command\");\n if (command)\n conn.send(command);\n });\n // Handle incoming data (messages only since this is the signal sender)\n conn.on('data', function (data) {\n addMessagePeer(data);\n });\n conn.on('close', function () {\n status.innerHTML = \"Connection closed\";\n });\n }", "title": "" }, { "docid": "fb05639ba77858db547f076186d7ab7e", "score": "0.45595843", "text": "function ConnectedPosition() { }", "title": "" }, { "docid": "fb05639ba77858db547f076186d7ab7e", "score": "0.45595843", "text": "function ConnectedPosition() { }", "title": "" }, { "docid": "264ead9720249015aa20f73a37e09b9b", "score": "0.4552762", "text": "validateCurrentPosition() {\n return this.room.isValidPosition(this.xPos, this.yPos)\n }", "title": "" }, { "docid": "3779716fe6eea66c6b464091cb4d810e", "score": "0.45505026", "text": "async start() {\n const positionUpdates = await this.getPositionUpdates();\n positionUpdates.forEach((positionUpdate) => {\n this.createMarker_(positionUpdate);\n });\n if (this.getBroadcastPositionUpdates) {\n this.getBroadcastPositionUpdates(this.updateMarkerPositions_.bind(this));\n } else {\n this.pollServer_();\n };\n if (this.getUserDisconnects) {\n this.getUserDisconnects(this.disposeMarker_.bind(this));\n };\n }", "title": "" }, { "docid": "d09edcca222284d9498ae1531b55d07f", "score": "0.45486858", "text": "moveToNextPos() {\n if (this.options.nextPos) {\n let nextPos = helpers_1.derefRoomPosition(this.options.nextPos);\n // return this.creep.moveTo(nextPos);\n return this.creep.travelTo(nextPos); // <- switch if you use Traveler\n }\n }", "title": "" }, { "docid": "863b732a60ae189de236b58c42b1ecb2", "score": "0.454534", "text": "function keepAlive(){\n\tvar persistant = new XHConn();\n\tpersistant.connect(\"user/keepalive\", \"POST\", \"x=\"+mySize.myX+\"&y=\"+mySize.myY, confirmAlive);\n}", "title": "" }, { "docid": "1abeba93741949b3d6415d519c304ceb", "score": "0.45449907", "text": "begin() {\n this.pc = new PeerConnection(this.pcConfig, {\n optional: [\n {\n DtlsSrtpKeyAgreement: true\n },\n {\n RtpDataChannels: false\n }\n ]\n });\n this.pc.onicecandidate = (evt) => {\n // Browser sends a null candidate once the ICE gathering completes.\n if (null === evt.candidate) {\n // TODO: Use a promise.all to tell Snowflake about all offers at once,\n // once multiple proxypairs are supported.\n dbg('Finished gathering ICE candidates.');\n return snowflake.broker.sendAnswer(this.id, this.pc.localDescription);\n }\n };\n // OnDataChannel triggered remotely from the client when connection succeeds.\n return this.pc.ondatachannel = (dc) => {\n var channel;\n channel = dc.channel;\n dbg('Data Channel established...');\n this.prepareDataChannel(channel);\n return this.client = channel;\n };\n }", "title": "" }, { "docid": "6fb0b279170f00a612c3d8651ad47c35", "score": "0.45409867", "text": "async _find_next_target() {\n\t\t// Return to home range\n\t\tif (!this.is_home()) {\n\t\t\tawait this._return_home();\n\t\t}\n\n\t\t// See if we can find a target nearby\n\t\tthis._pick_target();\n\t\tif (this.target) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Keep searching for a target\n\t\tawait this.loop_until_interrupted(async () => {\n\t\t\tthis._pick_target();\n\t\t\tif (this.target) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Go find our leader\n\t\t\tif (this.is_lost()) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tawait this._sleep();\n\t\t});\n\t}", "title": "" }, { "docid": "130e6e6fb84c783067f94b8e512e6e32", "score": "0.45259264", "text": "handleSetLeader(name) {\n if (name.toLowerCase() === this.username.toLowerCase()) {\n this.isLeader = true;\n loopThroughWaiting(this, 'settime');\n } else {\n this.isLeader = false;\n }\n }", "title": "" }, { "docid": "559025aeb5cd2ec027125342fcaa392b", "score": "0.45256165", "text": "get isConnected() {\n return this._sender != null;\n }", "title": "" }, { "docid": "163d00fd9db3cd35a1dbc3b0d4edd382", "score": "0.4523062", "text": "function check() {\n var tickInactive = (Date.now() - (delay * 4)); //doesnt always work\n\n var currentlyConnected = ignoreDisconnection ? ignoreDisconnection : (lastping >= tickInactive);\n // If we have changed connection state, flag the change\n if (connected !== currentlyConnected) {\n heartbeat(currentlyConnected ? 'connected' : 'disconnected');\n heartbeat('signalling:state', currentlyConnected);\n connected = currentlyConnected;\n }\n }", "title": "" }, { "docid": "b22e63d23024b14e2ce636daf3f6d728", "score": "0.45202005", "text": "function setMouthStateFromClient(isOpen) {\n var puppet = getPlayerPuppet(this.id);\n if (puppet) {\n puppet.isOpeningMouth = !!isOpen;\n }\n}", "title": "" }, { "docid": "7b6fbce1df0b9871c6531d75a0309c49", "score": "0.4514051", "text": "async ping(callback = undefined){\n this.online = await this.API.pingServer();\n this.emit('online', this.online, `${this.url} is ${this.online}`);\n if (validateTypes$1.isFunction(callback)) callback(this.online);\n return this.online\n }", "title": "" }, { "docid": "5b962131c922334d7a7d2e1f8b1b53bb", "score": "0.45133442", "text": "isConnected (id) {\n return this._peers[id] && this._peers[id]._isConnected\n }", "title": "" }, { "docid": "b6a402fde80bc2f1377a86b3c54ccc62", "score": "0.45121828", "text": "function hangUpPrivateCall(target, name) {\n MediaAccess.stopMedia();\n var peer = PeerConnection.getPeer(target);\n console.log('hangUpPrivateCall, peer: ' , peer);\n if(peer.stream && peer.connected) {\n PeerConnection.disconnectFromClient(target);\n $timeout(function () {\n //new version of simplepeer will support adding and removing streams\n startCommunication(target, name, \"chat\", true);\n }, 500);\n }\n }", "title": "" }, { "docid": "9eddbaec7b5edf2d42cdfb75e0931fa9", "score": "0.4507548", "text": "function incercetpBlock (position) {\n const block = bot.blockAt(position)\n if (!block) { return false }\n if (block.boundingBox !== 'empty') { // OLD check block.name !== 'air'\n return false\n }\n return true\n}", "title": "" }, { "docid": "27ce3a116260348ac5727c6192c7fc30", "score": "0.45041832", "text": "function hangup() {\n hangupButton.disabled = true;\n sendChannel.close(); // Closes the data channel instance on one of the peers\n if (caller) {\n getVideoButton.disabled = false;\n sendButton.disabled = true;\n } else {\n stop();\n }\n pc.close(); // Closes the RTCPeerConnection instance on one of the peers\n pc = null;\n dataChannelSend.value = \"\";\n dataChannelReceive.value = \"\";\n dataChannelSend.disabled = true;\n dataChannelSend.placeholder = \"Call ended, please reload the page.\";\n if (!hangUpReceiver) {\n socket.emit('hangup', {clientRoom: clientRoom, clientId: clientId}); // Signal the hang up to the other peer\n }\n }", "title": "" }, { "docid": "71861654b9f96886c162f104cf827482", "score": "0.45028785", "text": "_monitorPosition() {\n if (this.player.running)\n this._monitorPositionRafId = requestAnimationFrame(this._monitorPosition);\n\n const position = this.player.position;\n const duration = this.player.duration;\n this.emitPosition(position);\n\n if (position > duration)\n return this.ended(position); // player stops the playControl\n\n this.player.monitorPosition();\n }", "title": "" }, { "docid": "644a673add28cf94d0769f901fd483bb", "score": "0.44968152", "text": "onopen(event) {\n client.isConnected = true;\n client.emit('connection',event);\n }", "title": "" }, { "docid": "d6eb60f27bb6310122a837f211b59ecf", "score": "0.449593", "text": "sendHeartbeat() {\n\t\t\tif (!this.transit) return this.Promise.resolve();\n\t\t\treturn this.transit.sendHeartbeat(this.localNode);\n\t\t}", "title": "" }, { "docid": "6d5652aa5ebe816b8a8da7fb0d5bd048", "score": "0.4495281", "text": "async function losePosition(balance, lastPeakPrice, lastValleyPrice, positionInfo, productInfo, tradingConfig) {\r\n try {\r\n while (positionInfo.positionExists === true) {\r\n await sleep(250); //Let price update\r\n\r\n if (lastPeakPrice < currentPrice) {\r\n //New peak hit, reset values\r\n lastPeakPrice = currentPrice;\r\n lastValleyPrice = currentPrice;\r\n\r\n } else if (lastValleyPrice > currentPrice) {\r\n //New valley hit, track valley and check sell conditions\r\n lastValleyPrice = currentPrice;\r\n\r\n const target = lastPeakPrice - (lastPeakPrice * sellPositionDelta);\r\n const lowestSellPrice = lastValleyPrice - (lastValleyPrice * orderPriceDelta);\r\n const receivedValue = (lowestSellPrice * balance) - ((lowestSellPrice * balance) * tradingConfig.highestFee);\r\n\r\n if ((lastValleyPrice <= target) && (receivedValue > positionInfo.positionAcquiredCost)) {\r\n\r\n //Create a new authenticated client to prevent it from expiring or hitting API limits\r\n authedClient = new CoinbasePro.AuthenticatedClient(\r\n key,\r\n secret,\r\n passphrase,\r\n apiURI\r\n );\r\n \r\n console.log(\"Entering sell position.\");\r\n await sellPosition(balance, positionInfo, lastValleyPrice, authedClient, productInfo, tradingConfig);\r\n }\r\n }\r\n }\r\n } catch (err) {\r\n const message = \"Error occurred in losePosition method.\";\r\n const errorMsg = new Error(err);\r\n console.log({ message, errorMsg, err });\r\n throw err;\r\n }\r\n}", "title": "" }, { "docid": "08ee4ee1b560d31ca2361faf5e9f5672", "score": "0.44917583", "text": "function tellServerLockon(object)\n{\n if(object == null)\n socket.emit('lockon');\n else\n socket.emit('lockon', { dest : object.id }); \n}", "title": "" }, { "docid": "3e33ba2b0b142eb4e02babbfd4f9a881", "score": "0.44906342", "text": "switchPlayer() {\n if (this._currentPlayer === this._firstPlayer) {\n this._currentPlayer = this._secondPlayer;\n //console.log(\"switched to second player in core\");\n return true;\n } else {\n this._currentPlayer = this._firstPlayer;\n //console.log(\"switched to first player in core\");\n return true;\n }\n }", "title": "" }, { "docid": "374fbc36b5dd1072a769c8a721d1498a", "score": "0.44887444", "text": "newPeer(peer) {\r\n heartbeater = makePeerHeartbeater(this.peer);\r\n\r\n // callbacks\r\n this.peer.on(\"open\", // called when server connection established\r\n (id) => {\r\n RRDebug(\"Peer onOpen -> My peer ID is: \" + id);\r\n statusReport(\"Connected to Remote Radio server\");\r\n setStudioConnectionStatus(ConnectionStatus.PEER);\r\n }\r\n ); // open\r\n this.peer.on(\"call\", // when we get an incoming call - i.e. remote guest\r\n (mediaConnection) => {\r\n chatButton.disabled = false;\r\n talkbackButton.disabled = false;\r\n RRDebug(\"peer.onCall -> Answering incoming call from: \" + mediaConnection.peer);\r\n mediaConnection.answer(outgoingRemoteStreamBuss.stream, {sdpTransform: doSdpTransform});\r\n // send audio pgm or talk buss\r\n mediaConnection.on(\"stream\", (remoteStream) => { // incoming stream\r\n onCallStreamIncoming(remoteStream);\r\n //connectedPeers[mediaConnection.peer].setIncomingStream(incomingRemoteStreamGain.stream);\r\n //connectedPeers[mediaConnection.peer].setIncomingStream(remoteStream);\r\n }\r\n );\r\n\r\n mediaConnection.on(\"close\", () => { // call is ended\r\n hangUp();\r\n RRDebug(\"Stream closed from \" + mediaConnection.peer);\r\n statusReport(\"Lost stream connection with \" + mediaConnection.peer);\r\n // TODO try and reconnect to peer\r\n // setStudioConnectionStatus(ConnectionStatus.PEER);\r\n\r\n delete connectedPeers[mediaConnection.peer];\r\n }\r\n );\r\n }\r\n ); // call\r\n this.peer.on(\"connection\", // incoming data connection\r\n (c) => {\r\n RRDebug(\"peer.onConnection -> Established data connection to \" + c.peer);\r\n chatButton.disabled = false;\r\n if (!connectedPeers[c.peer]) {\r\n RRDebug(\"Peer doesn't exist\");\r\n connectedPeers[c.peer] = new PeerToPeerConnection(c.peer);\r\n }\r\n connectedPeers[c.peer].setConnectionStatus(ConnectionStatus.CONNECTED);\r\n if (c.peer == STUDIO_ID) {\r\n //studioConnection.setConnection(c);\r\n setStudioConnectionStatus(ConnectionStatus.CONNECTED);\r\n } else {\r\n //connectedPeers[c.peer].setConnection(c);\r\n }\r\n isConnected = true;\r\n\r\n c.on(\"data\",\r\n // received data\r\n (data) => {\r\n RRDebug(\"Received data: \" + data);\r\n if (data.startsWith(RRCommand.TALKBACK)) {\r\n RRDebug(\"Talkback message received...\" + data);\r\n if (data.includes(\"true\")) {\r\n // this is not very elegant or intuitive but it works\r\n talkingBack = false;\r\n onTalkbackButtonClick(null);\r\n } else {\r\n talkingBack = true;\r\n onTalkbackButtonClick(null);\r\n }\r\n } else {\r\n statusReport(\"Message from \" + c.peer + \": <br /> \" + data);\r\n chatDiv.innerHTML += \"<span class='incomingText'>\" + c.peer + \" : \" + data + \"</span><br />\";\r\n chatDiv.scrollTop = chatDiv.scrollHeight;\r\n }\r\n }); // data\r\n c.on(\"close\",\r\n () => {\r\n isConnected = false;\r\n statusReport(\"Connection lost to \"+c.peer);\r\n RRDebug(\"Connection lost to \"+c.peer);\r\n if (c.peer == STUDIO_ID) {\r\n setStudioConnectionStatus(ConnectionStatus.PEER);\r\n }\r\n else {\r\n connectedPeers[c.peer].setConnectionStatus[ConnectionStatus.DISCONNECTED];\r\n }\r\n delete connectedPeers[c.peer];\r\n }\r\n ); // close\r\n // }\r\n // );\r\n c.on(\"open\", // connection is ready to use\r\n () => {\r\n RRDebug (\"open\");\r\n connectedPeers[c.peer].setConnectionStatus(ConnectionStatus.CONNECTED);\r\n if (c.peer == STUDIO_ID)\r\n setStudioConnectionStatus(ConnectionStatus.CONNECTED);\r\n }\r\n );\r\n c.on(\"error\",\r\n (err) => {\r\n RRError(\"Connection error: \" + err);\r\n statusReport(err);\r\n connectedPeers[c.peer].setConnectionStatus(ConnectionStatus.DISCONNECTED);\r\n delete connectedPeers[c.peer];\r\n }\r\n );\r\n }\r\n );\r\n this.peer.on(\"close\",\r\n // peer is destroyed\r\n () => {\r\n RRDebug(\"Peer onClose -> Peer destroyed\");\r\n statusReport(\"Not connected - check internet connection\");\r\n this.peer = null;\r\n // delete all connections - or retry\r\n setStudioConnectionStatus(ConnectionStatus.DISCONNECTED);\r\n }\r\n );\r\n this.peer.on(\"error\",\r\n (err) => {\r\n RRError(\"peer.onError: \" + err);\r\n statusReport(err);\r\n switch (err.type) {\r\n case 'browser-incompatable':\r\n break;\r\n case 'socket-error':\r\n default: \r\n break;\r\n }\r\n hangUp();\r\n setStudioConnectionStatus(ConnectionStatus.PEER);\r\n }\r\n );\r\n this.peer.on(\"disconnected\",\r\n // disconnnected from server\r\n () => {\r\n statusReport(\"Disconnected from server... retrying...\");\r\n RRDebug(\"Peer onDisconnected -> Lost connection to server. Attempting reconnect\");\r\n setStudioConnectionStatus(ConnectionStatus.DISCONNECTED);\r\n isConnected = false;\r\n /* if (this.peer) {\r\n setTimeout(this.reconnect, reconnectInterval);\r\n } else {\r\n */\r\n RRDebug(\"No peer - attempting to recreate...\");\r\n // this.peer = new Peer({ host: SERVER, port:'', debug: debugLevel });\r\n this.reconnect();\r\n //peerHandler = new PeerHandler(peer);\r\n //}\r\n // disconnect from connections???\r\n }\r\n );\r\n }", "title": "" }, { "docid": "c5dd65fdbc3d9b27e30982395c85301b", "score": "0.44877246", "text": "completeConnection(from, payload) {\n if (this.Peers[from].connection != null) {\n console.log(\"already connected to \"+from)\n return\n }\n this.Peers[from].peerInfo = payload.peerInfo\n this.Peers[from].initiator.signal(payload.signaling)\n }", "title": "" } ]
c54ff8842d2e19670fa01e190f4fab5e
! moment.js locale configuration
[ { "docid": "9e7bfa066204d510821acfc3f1de4b5d", "score": "0.0", "text": "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "title": "" } ]
[ { "docid": "99ccb5862776433d2ec74e9576fe0564", "score": "0.80555266", "text": "function ni(e,t,n){var a={ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"};return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}(a[n],+e)}", "title": "" }, { "docid": "711f074bb99a3aa673cbd30e090d0738", "score": "0.7763291", "text": "function Ki(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "title": "" }, { "docid": "157f60aa42f6cc835675896915a22a65", "score": "0.7548106", "text": "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "title": "" }, { "docid": "157f60aa42f6cc835675896915a22a65", "score": "0.7548106", "text": "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "title": "" }, { "docid": "d35e8419b4ea5252a03f05b4e963d403", "score": "0.73769677", "text": "function xd(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c]}//! moment.js locale configuration", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71984273", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71984273", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71984273", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.71708643", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "d455a45fc49181379dc1a8784dc96a09", "score": "0.71282613", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key)}else{data=defineLocale(key,values)}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data}else{if(\"undefined\"!==typeof console&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn(\"Locale \"+key+\" not found. Did you forget to load it?\")}}}return globalLocale._abbr}", "title": "" }, { "docid": "ac7af0e62ca67c3cded5907f4217c1bf", "score": "0.71231383", "text": "function Qa(e,t,n){var r={mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"};return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Ukrainian [uk]\n//! author : zemlanin : https://github.com/zemlanin\n//! Author : Menelion Elensúle : https://github.com/Oire\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}(r[n],+e)}", "title": "" }, { "docid": "f619fe7c32d9997fd0720a00170897bc", "score": "0.6982797", "text": "function getSetGlobalLocale(key,values){var data;\n// moment.duration._locale = moment._locale = data;\nreturn key&&(data=isUndefined(values)?getLocale(key):defineLocale(key,values))&&(globalLocale=data),globalLocale._abbr}", "title": "" }, { "docid": "4d130ea41d5e4d847737b082b0ef6e38", "score": "0.692715", "text": "function ue(e,t,n,r){var a={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return r?a[n][0]:a[n][1]}//! moment.js locale configuration", "title": "" }, { "docid": "f1307362c66d5698b7eabf78c9623281", "score": "0.69148284", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\n\tglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "d3fbfa3239ceea082f45435d9661b7b5", "score": "0.65888846", "text": "function handleLocaleChange(locale) {\n i18n.locale = locale\n moment.locale(locale)\n}", "title": "" }, { "docid": "d252e19be518329d10c10006b572f344", "score": "0.65586287", "text": "function setLocaleDateTime () {\n\t var days = [\n\t $.localise.tr(\"Sunday\"),\n\t $.localise.tr(\"Monday\"),\n\t $.localise.tr(\"Tuesday\"),\n\t $.localise.tr(\"Wednesday\"),\n\t $.localise.tr(\"Thursday\"),\n\t $.localise.tr(\"Friday\"),\n\t $.localise.tr(\"Saturday\")\n\t ],\n\t months = [\n\t $.localise.tr(\"January\"),\n\t $.localise.tr(\"February\"),\n\t $.localise.tr(\"March\"),\n\t $.localise.tr(\"April\"),\n\t $.localise.tr(\"May\"),\n\t $.localise.tr(\"June\"),\n\t $.localise.tr(\"July\"),\n\t $.localise.tr(\"August\"),\n\t $.localise.tr(\"September\"),\n\t $.localise.tr(\"October\"),\n\t $.localise.tr(\"November\"),\n\t $.localise.tr(\"December\")\n\t ],\n\t days_abbrev = [\n\t $.localise.tr(\"Sun\"),\n\t $.localise.tr(\"Mon\"),\n\t $.localise.tr(\"Tue\"),\n\t $.localise.tr(\"Wed\"),\n\t $.localise.tr(\"Thu\"),\n\t $.localise.tr(\"Fri\"),\n\t $.localise.tr(\"Sat\")\n\t ],\n\t months_abbrev = [\n\t $.localise.tr(\"Jan\"),\n\t $.localise.tr(\"Feb\"),\n\t $.localise.tr(\"Mar\"),\n\t $.localise.tr(\"Apr\"),\n\t $.localise.tr(\"May\"),\n\t $.localise.tr(\"Jun\"),\n\t $.localise.tr(\"Jul\"),\n\t $.localise.tr(\"Aug\"),\n\t $.localise.tr(\"Sep\"),\n\t $.localise.tr(\"Oct\"),\n\t $.localise.tr(\"Nov\"),\n\t $.localise.tr(\"Dec\")\n\t ];\n\t wialon.util.DateTime.setLocale(days, months, days_abbrev, months_abbrev);\n\t}", "title": "" }, { "docid": "c18bbc280ab7aa310d8256fe0054cf7a", "score": "0.6492452", "text": "setLocale(momentInstance) {\n if (this.props.locale) {\n momentInstance.locale(this.props.locale.name);\n }\n return momentInstance;\n }", "title": "" }, { "docid": "fe8cccfeb08a82911f2984d5a476dcd7", "score": "0.62765163", "text": "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "title": "" }, { "docid": "95692ec680e62aa339fff1328a355241", "score": "0.6214133", "text": "get localeText() {\n switch (this._config.locale) {\n case \"fr\" :\n return {\n\t feelsLike: \"Ressenti:\",\n maxToday: \"Max. du jour:\",\n minToday: \"Min. du jour:\",\n windMore: \"Rafales à\",\n }\n default :\n return {\n feelsLike: \"Feels like\",\n maxToday: \"Today's High\",\n minToday: \"Today's Low\",\n windMore: \"Wind gust\",\n }\n }\n }", "title": "" }, { "docid": "4a6f10cf3c829e810d9763057a3eee1b", "score": "0.6203053", "text": "function ApexLocale() {}", "title": "" }, { "docid": "964b814e9555cf556ce599f5fd6f98b5", "score": "0.6196645", "text": "function getSetGlobalLocale (key, values) {\n\t\t var data;\n\t\t if (key) {\n\t\t if (isUndefined(values)) {\n\t\t data = getLocale(key);\n\t\t }\n\t\t else {\n\t\t data = defineLocale(key, values);\n\t\t }\n\t\t\n\t\t if (data) {\n\t\t // moment.duration._locale = moment._locale = data;\n\t\t globalLocale = data;\n\t\t }\n\t\t }\n\t\t\n\t\t return globalLocale._abbr;\n\t\t}", "title": "" }, { "docid": "f5578f4ca2594b9463cdcfda88867a1b", "score": "0.6187693", "text": "function test_automated_locale_switching() {}", "title": "" }, { "docid": "cf395bb0083ba1ea07b9d05bf01925ac", "score": "0.6183774", "text": "function ApexLocale() { }", "title": "" }, { "docid": "cf395bb0083ba1ea07b9d05bf01925ac", "score": "0.6183774", "text": "function ApexLocale() { }", "title": "" }, { "docid": "b229aede18b54e3415ef4fe77b418058", "score": "0.61563", "text": "function getMomentLocaleData(localeCode){return moment.localeData(localeCode)||moment.localeData(\"en\")}", "title": "" }, { "docid": "3c6cc1ca2d0c58e71df7b7c04bf75cdb", "score": "0.6154931", "text": "function load(localeName, callback) {\n if (!localeName || localeName === \"en\") {\n // Default moment is for English. Note that there is no external file for it!\n let moment = require('moment');\n moment.locale('en');\n callback(moment);\n }\n else {\n let moment = require('moment');\n require('moment/locale/' + localeName);\n moment.locale(localeName);\n callback(moment);\n }\n}", "title": "" }, { "docid": "b72a5716b34780008675aafc3129fe1a", "score": "0.61443317", "text": "function getSetGlobalLocale(key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t } else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "2529afb11d1894571496d02dc7eba097", "score": "0.61418235", "text": "function setLocaleLanguage(locale) {\n let fetch = false\n if(locale == 'en') {\n dateFormatter.locale = 'en'\n fetch = true\n }\n else dateFormatter.locale = 'ko-Kore_KR'\n\n localeJSON.year = !fetch ? 'yy년' : 'y,'\n localeJSON.day = !fetch ? 'EEEE' : 'E'\n localeJSON.calendar = !fetch ? '일정' : 'Calendar'\n localeJSON.reminder = !fetch ? '미리알림' : 'Reminder'\n\n localeJSON.sun = !fetch ? '일' : 'S'\n localeJSON.mon = !fetch ? '월' : 'M'\n localeJSON.tue = !fetch ? '화' : 'T'\n localeJSON.wen = !fetch ? '수' : 'W'\n localeJSON.thu = !fetch ? '목' : 'T'\n localeJSON.fri = !fetch ? '금' : 'F'\n localeJSON.sat = !fetch ? '토' : 'S'\n}", "title": "" }, { "docid": "9c0d0ea8dd2f120115abd8f0b67c7bdd", "score": "0.6134753", "text": "function configureGlobalMomentLocale(localeOverride = \"system-default\", weekStart = \"locale\") {\n var _a;\n const obsidianLang = localStorage.getItem(\"language\") || \"en\";\n const systemLang = (_a = navigator.language) === null || _a === void 0 ? void 0 : _a.toLowerCase();\n let momentLocale = langToMomentLocale[obsidianLang];\n if (localeOverride !== \"system-default\") {\n momentLocale = localeOverride;\n }\n else if (systemLang.startsWith(obsidianLang)) {\n // If the system locale is more specific (en-gb vs en), use the system locale.\n momentLocale = systemLang;\n }\n const currentLocale = window.moment.locale(momentLocale);\n console.debug(`[Calendar] Trying to switch Moment.js global locale to ${momentLocale}, got ${currentLocale}`);\n overrideGlobalMomentWeekStart(weekStart);\n return currentLocale;\n}", "title": "" }, { "docid": "73d22ab8f995621a741e2135a4ca6d40", "score": "0.6096749", "text": "function getSetGlobalLocale(key, values) {\n\t var data;\n\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t } else {\n\t data = defineLocale(key, values);\n\t }\n\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t } else {\n\t if (typeof console !== 'undefined' && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "20c04ccea0a22e09f4c67e63cd045b45", "score": "0.6094649", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" } ]
8e4ff4c916e06e4482a53dc8f448a718
This function will load locale and then set the global locale. If no arguments are passed in, it will simply return the current global locale key.
[ { "docid": "1af8a6f663441b788462ffcb57a66bce", "score": "0.0", "text": "function Za(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" } ]
[ { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "dbe9fec18b4a877a22f6ec4b24224e62", "score": "0.7241694", "text": "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "03a22c3595a9f2f696df1bef3838fabc", "score": "0.72104096", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "03a22c3595a9f2f696df1bef3838fabc", "score": "0.72104096", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "03a22c3595a9f2f696df1bef3838fabc", "score": "0.72104096", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "fe475f8018713e87edec3e2c7662e345", "score": "0.7209526", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "4d53b911913b2316b6c668eb99580a34", "score": "0.7206585", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn(\n 'Locale ' + key + ' not found. Did you forget to load it?'\n );\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "e005f5e164f32ba7b442b72f3314ac95", "score": "0.72061193", "text": "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "e005f5e164f32ba7b442b72f3314ac95", "score": "0.72061193", "text": "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "e005f5e164f32ba7b442b72f3314ac95", "score": "0.72061193", "text": "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "e005f5e164f32ba7b442b72f3314ac95", "score": "0.72061193", "text": "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" } ]
88ab9a1af71970a3e973c0077dd6689e
better for read without decimal
[ { "docid": "0c4c0e726ab47ff3846032e9281f713a", "score": "0.0", "text": "function get_date_str() {\r\n function fill_length(str, length) {\r\n str += '';\r\n while (str.length < length) {\r\n str = '0' + str;\r\n }\r\n return str;\r\n }\r\n date = new Date();\r\n date_FullYear = fill_length(date.getFullYear(), 4);\r\n date_Month = fill_length((1 + date.getMonth()), 2);\r\n date_Date = fill_length(date.getDate(), 2);\r\n date_Hours = fill_length(date.getHours(), 2);\r\n date_Minutes = fill_length(date.getMinutes(), 2);\r\n date_Seconds = fill_length(date.getSeconds(), 2);\r\n date = date_FullYear + '-' + date_Month + '-' + date_Date + ' ' + date_Hours + ':' + date_Minutes + ':' + date_Seconds;\r\n return date;\r\n}", "title": "" } ]
[ { "docid": "fce7d76a3741a0a89c129995858110c9", "score": "0.634151", "text": "function humanReadInt(val) {\n var suffix;\n if (val >= 1000000) {\n val /= 1000000;\n suffix = \"M\";\n } else if (val >= 1000) {\n val /= 1000;\n suffix = \"K\";\n } else\n return val;\n\n if (val > 100)\n return val.toFixed(0)+suffix;\n else\n return val.toFixed(1)+suffix;\n }", "title": "" }, { "docid": "218635a0afc456d68475010481b4fcaa", "score": "0.6282114", "text": "function readNumber(numb){\r\nnumb=numb.toString().replace(/^0+/,\"\");\r\nvar wrd;\r\n\tif(/[^\\d]/.test(numb)) throw new Error(\"You can only pass in a number value into this function\");\r\n\tif(numb.length>12) throw new Error(\"You can not pass in a number with more than 12 digits\");\r\n\r\n\tswitch(numb.length){\r\n\tcase 1: wrd= readUnit(numb);break;\r\n\tcase 2: wrd= read2Digi(numb);break;\r\n\tcase 3: wrd= read3Digi(numb); break;\r\n\tcase 4: wrd= readUnit(numb.charAt(0)) + \" thousand \" + read3Digi(numb.substr(1)); break;\r\n\tcase 5: wrd= read2Digi(numb.substr(0,2)) + \" thousand \" + read3Digi(numb.substr(2)); break;\r\n\tcase 6:wrd= read3Digi(numb.substr(0,3)) + \" thousand \" + read3Digi(numb.substr(3)); break;\t\r\n\tcase 7:\twrd=readUnit(numb.charAt(0)) + \" million \" + readNumber(numb.substr(1)); break;\r\n\tcase 8:\twrd=read2Digi(numb.substr(0,2)) + \" million \" + readNumber(numb.substr(2)); break;\r\n\tcase 9:\twrd=read3Digi(numb.substr(0,3)) + \" million \" + readNumber(numb.substr(3)); break;\r\n\tcase 10:wrd=readUnit(numb.charAt(0)) + \" billion \" + readNumber(numb.substr(1)); break;\r\n\tcase 11:wrd=read2Digi(numb.substr(0,2)) + \" billion \" + readNumber(numb.substr(2)); break;\r\n\tcase 12:wrd=read3Digi(numb.substr(0,3)) + \" billion \" + readNumber(numb.substr(3)); break;\r\n\tdefault:wrd=\"\" //default basically is intended to return \"\" in cases where only zeros were passed in as argument // this is beneficial in cases 7 and below of the switch label above\r\n\t}\r\n\r\nvar pat=/\\s{2,}/g;\r\nreturn wrd.replace(pat, \" \").replace(/ and\\s?$/,\"\");\r\n}", "title": "" }, { "docid": "ba9e3f8a0c1026600fa42841d8cbc84c", "score": "0.6213531", "text": "function parse_decimal () {\n // reset decimal value\n decimal = 0;\n // get the integer portion of the source number\n var whole = source.split (base_source.delim) [0].split (\"\");\n whole.reverse ();\n // loop over whole number characters\n for (var i = 0; i < whole.length; i++) {\n // add the proper amount to decimal\n decimal += Math.pow (base_source.num, i) * base_source.chars.indexOf (whole [i]);\n }\n // check that we have a decimal\n if (source.split (base_source.delim).length == 1) return;\n // get the fractional portion of the source number\n var fract = source.split (base_source.delim) [1].split (\"\");\n fract.reverse ();\n // loop over fractional values\n for (var i = 0; i < fract.length; i++) {\n // add the proper amount to decimal\n decimal += Math.pow (base_source.num, - i - 1) * base_source.chars.indexOf (fract [i]);\n }\n}", "title": "" }, { "docid": "e632f865748a3d1543c875778cc00de3", "score": "0.6169345", "text": "getDecimal(val) {\n return val.replace(/[^0-9.]/g, '');\n }", "title": "" }, { "docid": "fd66e586076f9119904c0cd38bca16c9", "score": "0.61273056", "text": "function readNumber(value) {\n const num = Number(value.replace(/[^0-9.-]+/g,\"\"));\n return isNaN(num) ? null : num;\n}", "title": "" }, { "docid": "fd36eb8050bc48cbf4fc169e5d5a8429", "score": "0.6122329", "text": "function preserveDecimal(n){\n return parseFloat(n)\n}", "title": "" }, { "docid": "5f0405b1c9d688fece0a181d1827091a", "score": "0.6019293", "text": "function preserveDecimal(n) {\n parseFloat('sldkjflksjf', 10);\n return n;\n}", "title": "" }, { "docid": "65fb6ce226794b3e50900a6c48f8c180", "score": "0.60155183", "text": "function parseInput(res) {\n return parseFloat(res.substring(2).slice(0, -2)).toFixed(2) * 100;\n}", "title": "" }, { "docid": "ce732c40a55c58e124d30590714e5e66", "score": "0.5997203", "text": "parseDecimalDigits() {\n let n = '';\n if (!isDecimalDigit(this.peek())) {\n this.raise('Invalid decimal digits');\n }\n while (isDecimalDigit(this.peek())) {\n n += this.next();\n }\n return n;\n }", "title": "" }, { "docid": "263abb8343a5b61138337092f68fbab0", "score": "0.5964204", "text": "function preserveDecimal(n) {\n return parseFloat(n)\n}", "title": "" }, { "docid": "e59aaed421765b2657ca6c1c0ffd4fcf", "score": "0.59589565", "text": "function preserveDecimal(n){\n var f = parseFloat(n, 10);\n return f;\n}", "title": "" }, { "docid": "ed78a43631a81ca447a64c455bf5cbef", "score": "0.59368867", "text": "function preserveDecimal (n) {\n return parseFloat (n)\n}", "title": "" }, { "docid": "8946877ed16ec4aa1185c86c573d6bb3", "score": "0.59332746", "text": "function readNumber(startsWithDot) {\n let isBigInt = false;\n let isDecimal = false;\n\n if (!startsWithDot) {\n readInt();\n }\n\n let nextChar = input.charCodeAt(state.pos);\n if (nextChar === charCodes.dot) {\n ++state.pos;\n readInt();\n nextChar = input.charCodeAt(state.pos);\n }\n\n if (nextChar === charCodes.uppercaseE || nextChar === charCodes.lowercaseE) {\n nextChar = input.charCodeAt(++state.pos);\n if (nextChar === charCodes.plusSign || nextChar === charCodes.dash) {\n ++state.pos;\n }\n readInt();\n nextChar = input.charCodeAt(state.pos);\n }\n\n if (nextChar === charCodes.lowercaseN) {\n ++state.pos;\n isBigInt = true;\n } else if (nextChar === charCodes.lowercaseM) {\n ++state.pos;\n isDecimal = true;\n }\n\n if (isBigInt) {\n finishToken(TokenType.bigint);\n return;\n }\n\n if (isDecimal) {\n finishToken(TokenType.decimal);\n return;\n }\n\n finishToken(TokenType.num);\n}", "title": "" }, { "docid": "7dd543ad08e2a354d90a6d64eab7b422", "score": "0.5906158", "text": "function decimalCheck(){\n var dec = document.getElementById('loan-amount').value;\n if(dec.includes(\".\")){\n var res = dec.substring(dec.indexOf(\".\")+1);\n var kl = res.split(\"\");\n if(kl.length > 1){\n document.getElementById('loan-amount').value=(parseInt(dec * 100) / \n 100).toFixed(2);\n }\n }\n }", "title": "" }, { "docid": "054b2bc45ba2a0926a42630cc9306633", "score": "0.5835386", "text": "function ReadGainValue(text) {\n return parseFloat(text.substring(5));\n }", "title": "" }, { "docid": "ba56820cfa2acf98ad9680a9c5589ebf", "score": "0.5794515", "text": "function decimales(n) { //no me pertenece\n let t = n.toString(); //ni la escribi yo\n let regex = /(\\d*.\\d{0,6})/; //la utilizo sin fines comerciales\n return t.match(regex)[0];\n}", "title": "" }, { "docid": "9faceae3d243e5cb83a526e7088f272a", "score": "0.57508874", "text": "function readToken_dot() {\n var next = input.charCodeAt(tokPos + 1);\n if (next >= 48 && next <= 57) return readNumber(true);\n ++tokPos;\n return finishToken(_dot);\n }", "title": "" }, { "docid": "0278171eab2a956bd6fabd7b893156a7", "score": "0.57377374", "text": "_tokenizeNumber() {\n var c = this._currch();\n var out = \"\";\n var isFloat = false;\n if (c == \"-\") {\n out += c;\n this._advance();\n this._skipSpaces();\n }\n\n if (\".0123456789\".indexOf(this._currch()) < 0) {\n var msg = \"Expected digit or '.' but found \" + currch + \".\";\n this._throw(this._currLine, this._currRow, msg);\n }\n // get all digits if we can\n out += this._readDigits();\n if (this._currch() == \".\") {\n this._advance();\n out += \".\";\n isFloat = true;\n }\n out += this._readDigits();\n\n // read the exponent\n var c = this._currch();\n if (c == \"e\" || c == \"E\") {\n out += c;\n this._advance();\n if (this._currch() == \"-\") {\n this._advance();\n out += \"-\";\n }\n out += this._readDigits();\n isFloat = true;\n }\n return isFloat ? parseFloat(out) : parseInt(out);\n }", "title": "" }, { "docid": "0d3b52941003b006a44512182ec4d6db", "score": "0.5683421", "text": "function number(sample) {\n\t function signDigitsDecimalPlaces(num, sig) {\n\t if (num === 0) { return 0; }\n\t return Math.round(sig - Math.ceil(Math.log(Math.abs(num)) / Math.LN10));\n\t }\n\n\t var format;\n\t var errors = 0;\n\t var knownFormats = {\n\t '-.': /^ *[-–—−]?[0-9]*(\\.[0-9]+)?(e[+-][0-9]+)?%? *$/,\n\t '-,': /^ *[-–—−]?[0-9]*(,[0-9]+)?%? *$/,\n\t ',.': /^ *[-–—−]?[0-9]{1,3}(,[0-9]{3})*(\\.[0-9]+)?%? *$/,\n\t '.,': /^ *[-–—−]?[0-9]{1,3}(\\.[0-9]{3})*(,[0-9]+)?%? *$/,\n\t ' .': /^ *[-–—−]?[0-9]{1,3}( [0-9]{3})*(\\.[0-9]+)?%? *$/,\n\t ' ,': /^ *[-–—−]?[0-9]{1,3}( [0-9]{3})*(,[0-9]+)?%? *$/,\n\t // thin spaces\n\t ' .': /^ *[-–—−]?[0-9]{1,3}( [0-9]{3})*(\\.[0-9]+)?%? *$/,\n\t ' ,': /^ *[-–—−]?[0-9]{1,3}( [0-9]{3})*(,[0-9]+)?%? *$/,\n\t // excel sometimes produces a strange white-space:\n\t ' .': /^ *[-–—−]?[0-9]{1,3}( [0-9]{3})*(\\.[0-9]+)?%? *$/,\n\t ' ,': /^ *[-–—−]?[0-9]{1,3}( [0-9]{3})*(,[0-9]+)?%? *$/,\n\t \"'.\": /^ *[-–—−]?[0-9]{1,3}('[0-9]{3})*(\\.[0-9]+)?%? *$/\n\t };\n\t var formatLabels = {\n\t '-.': '1234.56',\n\t '-,': '1234,56',\n\t ',.': '1,234.56',\n\t '.,': '1.234,56',\n\t ' .': '1 234.56',\n\t ' ,': '1 234,56',\n\t // excel sometimes produces a strange white-space:\n\t ' .': '1 234.56',\n\t ' ,': '1 234,56',\n\t ' .': '1 234.56',\n\t ' ,': '1 234,56'\n\t };\n\t // a list of strings that are recognized as 'not available'\n\t var naStrings = {\n\t na: 1,\n\t 'n/a': 1,\n\t '-': 1,\n\t ':': 1\n\t };\n\n\t var matches = {};\n\t var bestMatch = ['-.', 0];\n\n\t sample = sample || [];\n\n\t underscore.each(sample, function(n) {\n\t underscore.each(knownFormats, function(regex, fmt) {\n\t if (matches[fmt] === undefined) { matches[fmt] = 0; }\n\t if (regex.test(n)) {\n\t matches[fmt] += 1;\n\t if (matches[fmt] > bestMatch[1]) {\n\t bestMatch[0] = fmt;\n\t bestMatch[1] = matches[fmt];\n\t }\n\t }\n\t });\n\t });\n\t format = bestMatch[0];\n\n\t // public interface\n\t var type = {\n\t parse: function(raw) {\n\t if (underscore.isNumber(raw) || underscore.isUndefined(raw) || underscore.isNull(raw)) { return raw; }\n\t // replace percent sign, n-dash & m-dash\n\t var number = raw\n\t .replace('%', '')\n\t .replace('−', '-')\n\t .replace('–', '-')\n\t .replace('—', '-');\n\t // normalize number\n\t if (format[0] !== '-') {\n\t // remove kilo seperator\n\t number = number.replace(new RegExp(format[0] === '.' ? '\\\\.' : format[0], 'g'), '');\n\t }\n\t if (format[1] !== '.') {\n\t // replace decimal char w/ point\n\t number = number.replace(format[1], '.');\n\t }\n\t if (isNaN(number) || number === '') {\n\t if (!naStrings[number.toLowerCase()] && number !== '') { errors++; }\n\t return raw;\n\t }\n\t return Number(number);\n\t },\n\t toNum: function(i) {\n\t return i;\n\t },\n\t fromNum: function(i) {\n\t return i;\n\t },\n\t errors: function() {\n\t return errors;\n\t },\n\t name: function() {\n\t return 'number';\n\t },\n\n\t // returns a function for formatting numbers\n\t formatter: function(config) {\n\t var format = config['number-format'] || '-';\n\t var div = Number(config['number-divisor'] || 0);\n\t var append = (config['number-append'] || '').replace(/ /g, '\\u00A0');\n\t var prepend = (config['number-prepend'] || '').replace(/ /g, '\\u00A0');\n\t return function(val, full, round) {\n\t if (isNaN(val)) { return val; }\n\t var _fmt = format;\n\t if (div !== 0 && _fmt === '-') { _fmt = 'n1'; }\n\t if (div !== 0) { val = Number(val) / Math.pow(10, div); }\n\t if (_fmt.substr(0, 1) === 's') {\n\t // significant figures\n\t var sig = +_fmt.substr(1);\n\t _fmt = 'n' + Math.max(0, signDigitsDecimalPlaces(val, sig));\n\t }\n\t if (round) { _fmt = 'n0'; }\n\t if (_fmt === '-') {\n\t // guess number format based on single number\n\t _fmt = equalish(val, Math.round(val))\n\t ? 'n0'\n\t : equalish(val, Math.round(val * 10) * 0.1)\n\t ? 'n1'\n\t : equalish(val, Math.round(val * 100) * 0.01)\n\t ? 'n2'\n\t : equalish(val, Math.round(val * 1000) * 0.001)\n\t ? 'n3'\n\t : equalish(val, Math.round(val * 10000) * 0.0001)\n\t ? 'n4'\n\t : equalish(val, Math.round(val * 100000) * 0.00001)\n\t ? 'n5'\n\t : 'n6';\n\t }\n\t val = Globalize.format(val, _fmt !== '-' ? _fmt : null);\n\t return full ? prepend + val + append : val;\n\t };\n\t },\n\n\t isValid: function(val) {\n\t return (\n\t val === '' || naStrings[String(val).toLowerCase()] || underscore.isNumber(type.parse(val))\n\t );\n\t },\n\n\t ambiguousFormats: function() {\n\t var candidates = [];\n\t underscore.each(matches, function(cnt, fmt) {\n\t if (cnt === bestMatch[1]) {\n\t candidates.push([fmt, formatLabels[fmt]]); // key, label\n\t }\n\t });\n\t return candidates;\n\t },\n\n\t format: function(fmt) {\n\t if (arguments.length) {\n\t format = fmt;\n\t return type;\n\t }\n\t return format;\n\t }\n\t };\n\t return type;\n\t}", "title": "" }, { "docid": "57eec782b253eb08ba24247e2d96be48", "score": "0.56734467", "text": "function addZeroes(num) {\n if (!num)\n return '?';\n var value = Number(num);\n var res = num.split(\".\");\n if(num.indexOf('.') === -1) {\n value = value.toFixed(2);\n num = value.toString();\n } else if (res[1].length < 3) {\n value = value.toFixed(2);\n num = value.toString();\n }\n return num\n}", "title": "" }, { "docid": "9510b3f9c4b9cfcb4008cd1c0a24e25b", "score": "0.56703585", "text": "function readNumber(startsWithDot) {\n let isBigInt = false;\n\n if (!startsWithDot) {\n readInt();\n }\n\n let nextChar = input.charCodeAt(state.pos);\n if (nextChar === charCodes.dot) {\n ++state.pos;\n readInt();\n nextChar = input.charCodeAt(state.pos);\n }\n\n if (nextChar === charCodes.uppercaseE || nextChar === charCodes.lowercaseE) {\n nextChar = input.charCodeAt(++state.pos);\n if (nextChar === charCodes.plusSign || nextChar === charCodes.dash) {\n ++state.pos;\n }\n readInt();\n nextChar = input.charCodeAt(state.pos);\n }\n\n if (nextChar === charCodes.lowercaseN) {\n ++state.pos;\n isBigInt = true;\n }\n\n if (isBigInt) {\n finishToken(TokenType$2.bigint);\n return;\n }\n finishToken(TokenType$2.num);\n}", "title": "" }, { "docid": "67426f62e323159db20e3e2bd6a1717f", "score": "0.5665956", "text": "function converter(text){\n return parseFloat(text)\n}", "title": "" }, { "docid": "a7da4fc2d3d8ca81a2ce1c74a9f2ca9b", "score": "0.5647989", "text": "function readDecimal(headerBuffer) {\n var sum = 0;\n for(var i = 0; i < headerBuffer.length; i++)\n sum |= headerBuffer[i] << (i*8);\n return sum;\n }", "title": "" }, { "docid": "49b76af6f4892a003391de0aea30c5d4", "score": "0.56323296", "text": "maybeParseDecimalEscape() {\n if (isDecimalDigit(this.source[this.position]) && this.source[this.position] !== '0') {\n const start = this.position;\n let buffer = this.source[this.position];\n this.position += 1;\n while (isDecimalDigit(this.source[this.position])) {\n buffer += this.source[this.position];\n this.position += 1;\n }\n const node = {\n type: 'DecimalEscape',\n position: start,\n value: Number.parseInt(buffer, 10),\n };\n this.decimalEscapes.push(node);\n return node;\n }\n return undefined;\n }", "title": "" }, { "docid": "d83e78ed4aa5a82d5820bee8510646d8", "score": "0.56318355", "text": "function esDecimal(cadena) {\r\n\t\tvar cont = 0;\r\n\t\tfor (var i = 0; i < cadena.length; i++) {\r\n\t\t\tvar c = cadena.charAt(i);\r\n\t\t\tif ( (c==\".\") && (cont==0) ) {\r\n\t\t\t\tcont = cont + 1;\r\n\t\t\t}\r\n\t\t\telse if ( (c==\".\") && (cont>0) ) {\r\n\t\t\t\treturn false;\r\n\t\t\t} \r\n\t\t\telse if (!((c >= \"0\") && (c <= \"9\"))) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "title": "" }, { "docid": "235dd1e83e8377be3be45edd6d158718", "score": "0.5618947", "text": "function strToFloat(fieldName){\n const fieldValue = document.getElementById(fieldName).innerText;\n const extraPrice = parseFloat(fieldValue);\n return extraPrice;\n}", "title": "" }, { "docid": "462646922e2e527858a0026083e9fa76", "score": "0.5618462", "text": "function readToken_dot() {\n\t var next = input.charCodeAt(tokPos + 1);\n\t if (next >= 48 && next <= 57) return readNumber(true);\n\t ++tokPos;\n\t return finishToken(_dot);\n\t }", "title": "" }, { "docid": "af2f8e9ca219e52f9402a02e4fad54c9", "score": "0.5615584", "text": "function onDecimal() {\n if (calc.cur === 0 && calc.state === 1) {\n calc.cur = this.innerText;\n out.innerText = calc.cur;\n }\n\n if (calc.state === 2) {\n calc.cur = this.innerText;\n out.innerText = calc.cur;\n calc.state = 1;\n }\n\n // does not allow decimals within decimals\n if (calc.cur.includes(\".\")) {\n\n }\n // design choice to limit length to 8 which means only allowing decimals if\n // there will be at least one extra space after it\n else if (calc.cur.length < 7) {\n calc.cur = calc.cur + this.innerText;\n out.innerText = calc.cur;\n }\n }", "title": "" }, { "docid": "f3b2120afa980e300acc16f90cebce16", "score": "0.56129926", "text": "function measureToNumber(str){\n\tvar parts = str.split(\"p\");\n\tvar val = parts[0];\n\tval = Number(val);\n\treturn val;\n}", "title": "" }, { "docid": "79952e2eac457e34e70aa93a85953087", "score": "0.5605979", "text": "function decimalPoint() {\r\n variables.eq = 0;\r\n let v = variables.current.length;\r\n let m = variables.current.slice(v-1);\r\n if(m === '-'){\r\n variables.current += '0.';\r\n variables.d = 1;\r\n variables.decimal = 1;\r\n document.getElementById('ans').value = variables.current;\r\n }else if (variables.decimal === 0){\r\n variables.current += '.';\r\n variables.d = 1;\r\n variables.decimal = 1;\r\n document.getElementById('ans').value = variables.current;\r\n }\r\n}", "title": "" }, { "docid": "7bacedb8969e7eca6a3c267ec8ac3839", "score": "0.559842", "text": "function readNumberFromFieldViaId(id) {\n\tvar str = readStringFromFieldViaId(id);\n\tif(null != str && str.length > 0 && isFinite(str)) {\n\t\treturn +str;\n\t} else {\n\t\treturn 0.0;\n\t}\n}", "title": "" }, { "docid": "f00e8e612b4820d73f992e6f8d5647ed", "score": "0.5598101", "text": "function readToken_dot() {\n var next = input.charCodeAt(tokPos + 1);\n if (next >= 48 && next <= 57) return readNumber(true);\n ++tokPos;\n return finishToken(_dot);\n }", "title": "" }, { "docid": "f00e8e612b4820d73f992e6f8d5647ed", "score": "0.5598101", "text": "function readToken_dot() {\n var next = input.charCodeAt(tokPos + 1);\n if (next >= 48 && next <= 57) return readNumber(true);\n ++tokPos;\n return finishToken(_dot);\n }", "title": "" }, { "docid": "f00e8e612b4820d73f992e6f8d5647ed", "score": "0.5598101", "text": "function readToken_dot() {\n var next = input.charCodeAt(tokPos + 1);\n if (next >= 48 && next <= 57) return readNumber(true);\n ++tokPos;\n return finishToken(_dot);\n }", "title": "" }, { "docid": "06199a99a677fe736a8db75e7e57208a", "score": "0.55836105", "text": "function convertToNum(text) {\n text = text.replace(/,/g, \"\");\n let last = text[text.length - 1];\n switch(last) {\n case \"T\":\n text = Number(text.slice(0,-1)) * 1000000000000;\n break;\n case \"B\":\n text = Number(text.slice(0,-1)) * 1000000000;\n break;\n case \"M\":\n text = Number(text.slice(0,-1)) * 1000000;\n break;\n case \"k\":\n text = Number(text.slice(0,-1)) * 1000;\n break;\n case \"%\":\n text = Number(text.slice(0,-1)) / 100.0;\n break;\n case \"A\":\n text = 0;\n break;\n default:\n text = Number(text);\n }\n return text;\n}", "title": "" }, { "docid": "b779d9554c32b3c7e1093a65b8b0b6af", "score": "0.5580346", "text": "function isDecimalFor42(field, name) \r\n\t{\r\n\t\t\r\n\t\tfield1=trim(field)\r\n\t\tfield1 = field.value;\r\n\t\tfield2 = trim(field)\r\n\t\tvar isValidField = \"true\";\r\n\t\tvar valid = \"0123456789.\"\r\n\t\tvar ok = \"yes\";\r\n\t\tvar temp;\r\n\t\t// Iterates through the field to check each character is numeric or not\r\n\t\tfor (var i=0; i<field.value.length; i++)\r\n\t\t{\r\n\t\t\ttemp = \"\" + field.value.substring(i, i+1);\r\n\t\t\t// If any character is non-numeric assigns \"no\" to ok\r\n\t\t\tif (valid.indexOf(temp) == \"-1\") ok = \"no\";\r\n\r\n\t\t}\r\n\r\n\t\t// If ok equals \"yes\" returns true\r\n\t\t// Otherwise returns false\r\n\t\tif (ok == \"yes\")\r\n\t\t{\r\n\t\t\tvar hr=field.value;\r\n\t\t\tvar st = new String(hr);\r\n\t\t\tvar i = st.indexOf(\".\");\r\n\t\t\tif (i == field.value.length - 1) {\r\n\t\t\t\talert(\"Invalid \"+name+\" :Should be of 00.00 format\");\r\n\t\t\t\tfield.focus();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif (i > 2) {\r\n\t\t\t\talert(\"Invalid \"+name+\" :Should be of 00.00 format\");\r\n\t\t\t\tfield.focus();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t var mm=st.substring(i+1,hr.length);\r\n\t\t mm = trim(mm);\r\n\t\t if(mm.length == 1){\r\n\t\t\t\tmm = \"0\" + mm;\r\n\t\t\t}\r\n\t\t \tvar m=parseInt(mm);\r\n\t\t\tvar hh='';\r\n\t\t\tif (i==2){\r\n\t\t \thh=st.substring(0,2);\t\r\n\t\t }\r\n\t\t hh = trim(hh);\r\n\t\t\tif (i==1){ \r\n\t\t\t\thh=st.substring(0,1);\r\n\t\t \thh = \"0\" + hh;\r\n\t\t }\t \r\n\t\t \r\n\t\t var h=parseInt(hh);\r\n\t\t \r\n\t\t\tfield=hh+'.'+mm;\r\n\t\t\t\r\n\t\t\tfield1 = field;\r\n\t\t\tif ((field1.indexOf(\".\") == (field1.length-1)) && (field1 != \"\")) {\r\n\t\t\t\talert(\"Invalid \"+name+\" :Should be of 00.00 format\");\r\n\t\t\t\tisValidField = \"false\";\r\n\t\t\t\tfield.focus();\r\n\t\t\t\treturn false\r\n\t\t\t}\r\n\t\t\tif (field1.indexOf(\".\") == -1 && field.length > 2) { \r\n\t\t\t\talert(\"Invalid \"+name+\" :Should be of 00.00 format\");\r\n\t\t\t\tisValidField = \"false\";\r\n\t\t\t\tfield.focus();\r\n\t\t\t\treturn false\t\t\t\r\n\t\t\t}\r\n\t\t\tif (field1.indexOf(\".\") == 0 && field.length > 3) { \r\n\t\t\t\talert(\"Invalid \"+name+\" :Should be of 00.00 format\");\r\n\t\t\t\tisValidField = \"false\" ;\r\n//\t\t\t\tfield.focus();\r\n\t\t\t\treturn false\t\t\t\r\n\t\t\t}\r\n\t\t\t// Checks if session rate is a whole number and within the given range\t\t\t\r\n\t\t\tif (field1.indexOf(\".\") == -1 && isValidField == \"true\") {\r\n\t\t\t\t// If field is not empty then adds \".0\" to field\t\t\r\n\t\t\t\tif (field != \"\") { \r\n\t\t\t\t\tfield.value += \".00\";\r\n\t\t\t\t}\r\n\t\t\t\t// Otherwise sets the focus to field field\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\tfield.focus();\r\n\t\t\t\t}\r\n\t\t\t\treturn true\r\n\t\t\t}\r\n\r\n\t\t\tif (field1.indexOf(\".\") == 0 && isValidField == \"true\") {\r\n\t\t\t\t// If field is not empty then adds \"0.\" to field\t\t\r\n\t\t\t\tif (field != \"\") {\r\n\t\t\t\t\tfield.value = \"00\" + field.value;\r\n\t\t\t\t}\r\n\t\t\t\t// Otherwise sets the focus to session rate field\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\tfield.focus();\r\n\t\t\t\t}\r\n\t\t\t\treturn true\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\tif(field1 <= \"99.99\"){\r\n\t\t\t\treturn true\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\talert(\"Invalid \"+name+\" :Should be of 00.00 format\");\r\n\t\t\tfield.focus();\r\n\t\t\treturn false\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "7ce6b3996848aae95fe90c4e89c0c17a", "score": "0.5579244", "text": "function redondeo1decimales(numero)\r\n {\r\n var original=parseFloat(numero);\r\n var result=Math.round(original*100)/100 ;\r\n return result;\r\n }", "title": "" }, { "docid": "05a52a716aeea38766032817298b84de", "score": "0.55720013", "text": "function stringToNumber(str, base) {\n var sanitized, isDecimal;\n sanitized = str.replace(NumberNormalizeReg, function(chr) {\n var replacement = NumberNormalizeMap[chr];\n if(replacement === HalfWidthPeriod) {\n isDecimal = true;\n }\n return replacement;\n });\n return isDecimal ? parseFloat(sanitized) : parseInt(sanitized, base || 10);\n }", "title": "" }, { "docid": "aa464acae34da0a96e3a9ab0a2038958", "score": "0.5568879", "text": "function setDecimal(element) {\n\t\t\n\t\tvar textlong=element.value.length;\n\t\tvar text=element.value.replace(/\\./g,\"\");\n\t\tvar number=\"\"+text;\n\t\tvar longNumber=number.length;\n\t\tvar newNumbwe=\"\";\n\t\tvar cont=0;\n\n\t\tfor(var i=longNumber;i>=1;i--){\n\t\t\tvar res = number.slice(i-1,i);\n\t\t\tif(cont==3){\n\t\t\t\tres+=\".\";\n\t\t\t\tcont=0;\n\t\t\t}\n\t\t\tnewNumbwe=res+newNumbwe;\n\n\t\t\tcont++;\n\t\t\t\n\t\t}\n\t\t\n\t\telement.value=newNumbwe;\n\t\t}", "title": "" }, { "docid": "5ea430bc68e08d4b8012388adad045bd", "score": "0.5564325", "text": "determineDecimals (input = '') {\n const parts = input.replace('%', '').split('.')\n\n if (parts[1]) {\n this.props.decimals = Math.min(parts[1].length, 2);\n } else {\n this.props.decimals = 0;\n }\n }", "title": "" }, { "docid": "9e40dd46e1b8bee8a661338a968b3ec9", "score": "0.5562799", "text": "function handleDecimalPointNum(num) {\n let decimalPos = String(num).indexOf('.') + 1;\n let decimalNum = String(num).length - decimalPos;\n if (decimalNum > 3) {\n return num.toFixed(3);\n }\n return num;\n}", "title": "" }, { "docid": "a8bcd8fb8a3954a0ccc10bb228a4c3c5", "score": "0.5551811", "text": "function setNumero(num_formateado) {\r\n\tvar num = num_formateado.toString();\r\n\tnum = num.replace(/[.]/gi, \"\");\r\n\tnum = num.replace(/[,]/gi, \".\");\r\n\tvar numero = new Number(num);\r\n\treturn parseFloat(numero);\r\n}", "title": "" }, { "docid": "e8516aee732b92f99b1b1d5d819f9340", "score": "0.55469704", "text": "function line_to_decimal(rawInput) {\n let converterFn = () => false\n\n switch (getLineType(rawInput)) {\n case LINE_TYPE.CENTS:\n converterFn = cents_to_decimal\n break\n\tcase LINE_TYPE.DECIMAL:\n\t converterFn = commadecimal_to_decimal\n\t break\n case LINE_TYPE.N_OF_EDO:\n converterFn = n_of_edo_to_decimal\n break\n case LINE_TYPE.RATIO:\n converterFn = ratio_to_decimal\n break\n }\n\n return converterFn(rawInput)\n}", "title": "" }, { "docid": "9fdfc59e5bb2d641ff7832708c9101f9", "score": "0.5540612", "text": "function specNoteTest() {\n print((1000000000000000128).toString());\n print((1000000000000000128).toFixed());\n}", "title": "" }, { "docid": "8752b5b220ff95fd4533b35ec08adf60", "score": "0.5535399", "text": "readFloat() {\n const numStr = this.readStringLower();\n\n if ((numStr.length == 0) || (numStr !== \"nan\" && isNaN(numStr))) {\n throw new Error(`Invalid float \"${numStr}\"`);\n }\n\n const numVal = parseFloat(numStr);\n\n return numVal;\n }", "title": "" }, { "docid": "811ebb566378aec250d9fc08b1274922", "score": "0.55316144", "text": "function parseF(s) {\n const x =parseFloat(s)\n if( x>=0){\n return x\n }else return null\n}", "title": "" }, { "docid": "a1c71a2dd5da8d100c2a87fa786c16f5", "score": "0.5529545", "text": "function e(e){var t=parseFloat(e);return-1==e.indexOf(\"%\")&&!isNaN(t)&&t}", "title": "" }, { "docid": "61fffd4720bc04ae2efc309b3cf08218", "score": "0.5528718", "text": "function parseIso(inp, sign) {\n // We'd normally use ~~inp for this, but unfortunately it also\n // converts floats to ints.\n // inp may be undefined, so careful calling replace on it.\n var res = inp && parseFloat(inp.replace(',', '.'));\n // apply sign while we're at it\n return (isNaN(res) ? 0 : res) * sign;\n}", "title": "" }, { "docid": "ccc238cfae7a96fa2b8ae158906d6160", "score": "0.54986346", "text": "function parseDecimals(str) {\r\n var temp = [];\r\n for (var i = 0; i < str.length; i++) {\r\n temp[i] = parseFloat(str[i]);\r\n }\r\n return temp;\r\n }", "title": "" }, { "docid": "fede48aaffdc9ca99cbef6b36038b4e3", "score": "0.54899114", "text": "function reaisNaoAceitaDecimal(obj, event, tam) {\r\n\r\n\tvar strCheck = '0123456789';\r\n\tvar whichCode;\r\n\tif (event.srcElement)\r\n\t\twhichCode = event.keyCode;\r\n\telse if (event.target)\r\n\t\twhichCode = event.which;\r\n\r\n\tif (whichCode == 8 && !document.all) {\r\n\t\tif (event.preventDefault) { //standart browsers \r\n\t\t\tevent.preventDefault();\r\n\t\t} else { // internet explorer \r\n\t\t\tevent.returnValue = false;\r\n\t\t}\r\n\r\n\t\tvar x;\r\n\t\tif (obj.value.length <= 4) {\r\n\t\t\tx = '0,00';\r\n\t\t} else {\r\n\t\t\t// retira o último caracter e os zeros do fim \r\n\t\t\tx = obj.value.substring(0, obj.value.length - 4) + ',00';\r\n\t\t}\r\n\t\tobj.value = _demask(x, true).formatValor();\r\n\t\treturn false;\r\n\t}\r\n\tif (whichCode == 0)\r\n\t\treturn true;\r\n\tif (whichCode == 9)\r\n\t\treturn true; //tab \r\n\tif (whichCode == 13)\r\n\t\treturn true; //enter \r\n\tif (whichCode == 16)\r\n\t\treturn true; //shift\r\n\tif (whichCode == 17)\r\n\t\treturn true; //control\r\n\tif (whichCode == 27)\r\n\t\treturn true; //esc \r\n\tif (whichCode == 34)\r\n\t\treturn true; //end \r\n\tif (whichCode == 35)\r\n\t\treturn true;//end \r\n\tif (whichCode == 36)\r\n\t\treturn true; //home \r\n\r\n\tif (event.preventDefault) {\r\n\t\tevent.preventDefault()\r\n\t} else {\r\n\t\tevent.returnValue = false\r\n\t}\r\n\tvar key = String.fromCharCode(whichCode);\r\n\tif (strCheck.indexOf(key) == -1)\r\n\t\treturn false;\r\n\tif (obj.value.length >= tam)\r\n\t\treturn false;\r\n\r\n\tif (obj.value.length < 1) {\r\n\t\tobj.value = key + ',00';\r\n\t} else {\r\n\t\tvar valor = obj.value;\r\n\t\t// sem os zeros do fim \r\n\t\tvar x = valor.substring(0, valor.length - 3);\r\n\t\tobj.value = x + key + ',00';\r\n\t}\r\n\r\n\tvar bodeaux = _demask(obj.value, true).formatValor();\r\n\tobj.value = bodeaux;\r\n\r\n\t/* \r\n\t Move o cursor para o final no opera. \r\n\t */\r\n\tif (obj.createTextRange) {\r\n\t\tvar range = obj.createTextRange();\r\n\t\trange.collapse(false);\r\n\t\trange.select();\r\n\t} else if (obj.setSelectionRange) {\r\n\t\tobj.focus();\r\n\t\tvar length = obj.value.length;\r\n\t\tobj.setSelectionRange(length, length);\r\n\t}\r\n\r\n\treturn false;\r\n}", "title": "" }, { "docid": "32b27b0be33fe3b47edf54922f8f6276", "score": "0.54798836", "text": "function parseDecimal(x, str) {\r\n\t var e, i, len;\r\n\r\n\t // Decimal point?\r\n\t if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n\t // Exponential form?\r\n\t if ((i = str.search(/e/i)) > 0) {\r\n\r\n\t // Determine exponent.\r\n\t if (e < 0) e = i;\r\n\t e += +str.slice(i + 1);\r\n\t str = str.substring(0, i);\r\n\t } else if (e < 0) {\r\n\r\n\t // Integer.\r\n\t e = str.length;\r\n\t }\r\n\r\n\t // Determine leading zeros.\r\n\t for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n\t // Determine trailing zeros.\r\n\t for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n\t str = str.slice(i, len);\r\n\r\n\t if (str) {\r\n\t len -= i;\r\n\t x.e = e = e - i - 1;\r\n\t x.d = [];\r\n\r\n\t // Transform base\r\n\r\n\t // e is the base 10 exponent.\r\n\t // i is where to slice str to get the first word of the digits array.\r\n\t i = (e + 1) % LOG_BASE;\r\n\t if (e < 0) i += LOG_BASE;\r\n\r\n\t if (i < len) {\r\n\t if (i) x.d.push(+str.slice(0, i));\r\n\t for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n\t str = str.slice(i);\r\n\t i = LOG_BASE - str.length;\r\n\t } else {\r\n\t i -= len;\r\n\t }\r\n\r\n\t for (; i--;) str += '0';\r\n\t x.d.push(+str);\r\n\r\n\t if (external) {\r\n\r\n\t // Overflow?\r\n\t if (x.e > x.constructor.maxE) {\r\n\r\n\t // Infinity.\r\n\t x.d = null;\r\n\t x.e = NaN;\r\n\r\n\t // Underflow?\r\n\t } else if (x.e < x.constructor.minE) {\r\n\r\n\t // Zero.\r\n\t x.e = 0;\r\n\t x.d = [0];\r\n\t // x.constructor.underflow = true;\r\n\t } // else x.constructor.underflow = false;\r\n\t }\r\n\t } else {\r\n\r\n\t // Zero.\r\n\t x.e = 0;\r\n\t x.d = [0];\r\n\t }\r\n\r\n\t return x;\r\n\t}", "title": "" }, { "docid": "b02e5c6977e6a35811c7562487851105", "score": "0.5479344", "text": "function rozdelFloat(poleStr) {\n\tvar pole = poleStr.split(\" \"); //split(delim ? delim : \",\");\n\tfor (var i = 0; i < pole.length; i++) {\n\t\tpole[i]=parseFloat(pole[i]);\n\t}\n\treturn pole;\n}", "title": "" }, { "docid": "5dacf3a2cb175ce493a5b144b8564130", "score": "0.5473338", "text": "_decimals(x) {\n let pTemp = Number.parseFloat(x * 1.8 + 32).toPrecision(4);\n return Number.parseFloat(pTemp).toFixed(0);\n }", "title": "" }, { "docid": "a1e478baa2862fc270ee667a9ab15b52", "score": "0.5472381", "text": "function decimalinator() {\n for(var i = 0; i < $scope.lines.length; i++) {\n price = ($scope.lines[i].price * $scope.lines[i].quantity) + \"\";\n if(price.substring(price.length - 3, price.length - 2) != \".\") {\n\n if(price.substring(price.length - 2, price.length - 1) == \".\") { // if there is one decimal place (ex: 1.5)\n price += \"0\";\n } else { // if it is a round number (ex: 36)\n price += \".00\";\n }\n }\n $scope.lines[i].displayPrice = price;\n }\n }", "title": "" }, { "docid": "89687f69d8b4eee6ad0cd10109867098", "score": "0.5469867", "text": "function parseDecimal(x, str) {\n\t\t\tvar e, i, len;\n\n\t\t\t// Decimal point?\n\t\t\tif ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\n\n\t\t\t// Exponential form?\n\t\t\tif ((i = str.search(/e/i)) > 0) {\n\n\t\t\t\t// Determine exponent.\n\t\t\t\tif (e < 0) e = i;\n\t\t\t\te += +str.slice(i + 1);\n\t\t\t\tstr = str.substring(0, i);\n\t\t\t} else if (e < 0) {\n\n\t\t\t\t// Integer.\n\t\t\t\te = str.length;\n\t\t\t}\n\n\t\t\t// Determine leading zeros.\n\t\t\tfor (i = 0; str.charCodeAt(i) === 48; i++);\n\n\t\t\t// Determine trailing zeros.\n\t\t\tfor (len = str.length; str.charCodeAt(len - 1) === 48; --len);\n\t\t\tstr = str.slice(i, len);\n\n\t\t\tif (str) {\n\t\t\t\tlen -= i;\n\t\t\t\tx.e = e = e - i - 1;\n\t\t\t\tx.d = [];\n\n\t\t\t\t// Transform base\n\n\t\t\t\t// e is the base 10 exponent.\n\t\t\t\t// i is where to slice str to get the first word of the digits array.\n\t\t\t\ti = (e + 1) % LOG_BASE;\n\t\t\t\tif (e < 0) i += LOG_BASE;\n\n\t\t\t\tif (i < len) {\n\t\t\t\t\tif (i) x.d.push(+str.slice(0, i));\n\t\t\t\t\tfor (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\n\t\t\t\t\tstr = str.slice(i);\n\t\t\t\t\ti = LOG_BASE - str.length;\n\t\t\t\t} else {\n\t\t\t\t\ti -= len;\n\t\t\t\t}\n\n\t\t\t\tfor (; i--;) str += '0';\n\t\t\t\tx.d.push(+str);\n\n\t\t\t\tif (external) {\n\n\t\t\t\t\t// Overflow?\n\t\t\t\t\tif (x.e > x.constructor.maxE) {\n\n\t\t\t\t\t\t// Infinity.\n\t\t\t\t\t\tx.d = null;\n\t\t\t\t\t\tx.e = NaN;\n\n\t\t\t\t\t\t// Underflow?\n\t\t\t\t\t} else if (x.e < x.constructor.minE) {\n\n\t\t\t\t\t\t// Zero.\n\t\t\t\t\t\tx.e = 0;\n\t\t\t\t\t\tx.d = [0];\n\t\t\t\t\t\t// x.constructor.underflow = true;\n\t\t\t\t\t} // else x.constructor.underflow = false;\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Zero.\n\t\t\t\tx.e = 0;\n\t\t\t\tx.d = [0];\n\t\t\t}\n\n\t\t\treturn x;\n\t\t}", "title": "" }, { "docid": "44e94ac6c0f8d5f3dd9ad4fa7ec1ac79", "score": "0.54601556", "text": "function parseRate (div) {\n var s = $(div).val();\n \n s = s.replace(/,|\\$|\\%/g, \"\");\n \n var parsed = parseFloat(s);\n \n return parsed;\n}", "title": "" }, { "docid": "910b58b3f9630a7675b9173f197036aa", "score": "0.5458131", "text": "function stripUnits(x) {\n return Number(x.replace(/[^0-9.-]+/g, \"\"));\n}", "title": "" }, { "docid": "088381b86fb6cc51085fc5877857178b", "score": "0.54569155", "text": "function parseDecimal(x, str) {\n\t var e, i, len;\n\t\n\t // Decimal point?\n\t if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\n\t\n\t // Exponential form?\n\t if ((i = str.search(/e/i)) > 0) {\n\t\n\t // Determine exponent.\n\t if (e < 0) e = i;\n\t e += +str.slice(i + 1);\n\t str = str.substring(0, i);\n\t } else if (e < 0) {\n\t\n\t // Integer.\n\t e = str.length;\n\t }\n\t\n\t // Determine leading zeros.\n\t for (i = 0; str.charCodeAt(i) === 48;) ++i;\n\t\n\t // Determine trailing zeros.\n\t for (len = str.length; str.charCodeAt(len - 1) === 48;) --len;\n\t str = str.slice(i, len);\n\t\n\t if (str) {\n\t len -= i;\n\t e = e - i - 1;\n\t x.e = mathfloor(e / LOG_BASE);\n\t x.d = [];\n\t\n\t // Transform base\n\t\n\t // e is the base 10 exponent.\n\t // i is where to slice str to get the first word of the digits array.\n\t i = (e + 1) % LOG_BASE;\n\t if (e < 0) i += LOG_BASE;\n\t\n\t if (i < len) {\n\t if (i) x.d.push(+str.slice(0, i));\n\t for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\n\t str = str.slice(i);\n\t i = LOG_BASE - str.length;\n\t } else {\n\t i -= len;\n\t }\n\t\n\t for (; i--;) str += '0';\n\t x.d.push(+str);\n\t\n\t if (external && (x.e > MAX_E || x.e < -MAX_E)) throw Error(exponentOutOfRange + e);\n\t } else {\n\t\n\t // Zero.\n\t x.s = 0;\n\t x.e = 0;\n\t x.d = [0];\n\t }\n\t\n\t return x;\n\t }", "title": "" }, { "docid": "bc57f0b04617635ef8c775bde2428977", "score": "0.54565305", "text": "function stringToNumber(str, base) {\n var sanitized, isDecimal;\n sanitized = str.replace(fullWidthNumberReg, function(chr) {\n var replacement = getOwn(fullWidthNumberMap, chr);\n if (replacement === HALF_WIDTH_PERIOD) {\n isDecimal = true;\n }\n return replacement;\n });\n return isDecimal ? parseFloat(sanitized) : parseInt(sanitized, base || 10);\n }", "title": "" }, { "docid": "bc57f0b04617635ef8c775bde2428977", "score": "0.54565305", "text": "function stringToNumber(str, base) {\n var sanitized, isDecimal;\n sanitized = str.replace(fullWidthNumberReg, function(chr) {\n var replacement = getOwn(fullWidthNumberMap, chr);\n if (replacement === HALF_WIDTH_PERIOD) {\n isDecimal = true;\n }\n return replacement;\n });\n return isDecimal ? parseFloat(sanitized) : parseInt(sanitized, base || 10);\n }", "title": "" }, { "docid": "bc57f0b04617635ef8c775bde2428977", "score": "0.54565305", "text": "function stringToNumber(str, base) {\n var sanitized, isDecimal;\n sanitized = str.replace(fullWidthNumberReg, function(chr) {\n var replacement = getOwn(fullWidthNumberMap, chr);\n if (replacement === HALF_WIDTH_PERIOD) {\n isDecimal = true;\n }\n return replacement;\n });\n return isDecimal ? parseFloat(sanitized) : parseInt(sanitized, base || 10);\n }", "title": "" }, { "docid": "bc57f0b04617635ef8c775bde2428977", "score": "0.54565305", "text": "function stringToNumber(str, base) {\n var sanitized, isDecimal;\n sanitized = str.replace(fullWidthNumberReg, function(chr) {\n var replacement = getOwn(fullWidthNumberMap, chr);\n if (replacement === HALF_WIDTH_PERIOD) {\n isDecimal = true;\n }\n return replacement;\n });\n return isDecimal ? parseFloat(sanitized) : parseInt(sanitized, base || 10);\n }", "title": "" }, { "docid": "13f24ca50dfdc6a2b1d0bf60e0641898", "score": "0.5456152", "text": "function redondear_decimales(cadena, nro_decimales){\n\tcadena = cadena+''; //para cambiar el tipo de dato ya que puede entrar como numerico\n\tif (cadena.length ==0) {return 0} //el numero encontrado se asume como cero\n\tvar acum_pos\t\t=\t0; //acumula cada 3 numeros\n\tvar pos_punto\t\t=\t'none';\t//no tiene punto\n\tvar cad\t\t\t\t=\t\"\";\n\tvar encontro_punto = false; //bandera que indica si se encontro o no un punto\n\tnro_decimales\t= Number(nro_decimales);\n\t\n\t//--------------- para buscar la posicion del punto ------------------\n\tpos_cad = 0; //para evitar el valor del i\n\tfor (i=0; i < cadena.length ; i++)\t\n\t{\n\t\tletra = cadena.charAt(i); //obtiene el ascii \t\n\t\tif(letra ==',')\t{\n\t\t\ti++; //salta el caracter ','\n\t \tletra = cadena.charAt(i); //obtiene el ascii \t\t\t\n\t\t}\n\t\tif(letra == '.' && encontro_punto == false)\t\n\t\t{\n\t\t\tencontro_punto = true;\n\t\t\tpos_punto = pos_cad;\n\t\t}\n\t\tcad = cad+letra;\t\t\t//alert(cadena+\"---\"+letra+\"--\"+i);\t\t\n\t\tpos_cad++; \n\t}\n\tif(pos_punto==0) \n\t{\n\t\tpos_punto++;\t//mueve el punto una posicion\n\t\tcad = '0'+cad; //para casos cd .55 lo coloque a 0.55\n\t}\n\tcadena = cad;\n\t\n\t//si encontro un punto y la cantidad de decimales amerita formatear 1.1 no formatearia 2 decimales\n\tif(pos_punto!='none'\t&& \t(pos_punto+nro_decimales+1)<=cadena.length ) { \n\t\tpos_redondeo \t= pos_punto+nro_decimales+1;//numero despues de la cantidad de decimales\n\t\tvlr_redondeo\t=\tcadena.charAt(pos_redondeo)\n\t\tif( cadena.charAt(pos_redondeo)>=5)\t\t\tinc = 1\t//incremento de ceimales \n\t\telse\t\t\t\t\t\t\t\t\t\tinc = 0 // \t\n\t\tif( cadena.charAt(pos_redondeo-1)=='.') \tretroceso = 2 ;// si debe dejar cero decimales\n\t\telse\t\t\t\t\t\t\t\t\t\tretroceso = 1\n\t\tif(pos_redondeo-retroceso<0)\t\t\t\tcadena= inc; //para un Nro como .4564 con Nro decimales = 0\n\t\telse \t\t//cadena.charAt(pos_redondeo-retroceso) = cadena.charAt(pos_redondeo-retroceso)+inc\t\n\t\t{\n\t\t\tcad = ''; //almacenara temporalmente el numero\n\t\t\tfor(i=0; i<pos_redondeo; i++) \n\t\t\t{\n\t\t\t\tif(i== pos_redondeo-retroceso)\n\t\t\t\t{\n\t\t\t\t vlr = Number(cadena.charAt(pos_redondeo-retroceso))+Number(inc)// Valor de la posicion a redondear \t\n\t\t\t\t}\n\t\t\t\telse\tvlr =\tcadena.charAt(i)\n\t\t\t\tif(i== pos_punto && nro_decimales == 0)//para evitar numeros como 54646. <- quita el punto final\n\t\t\t\t{}\n\t\t\t\telse\n\t\t\t\tif(vlr==10 && i<pos_punto){\n\t\t\t\t\tcad\t= Number(cad)+Number(1);\n\t\t\t\t\tcad = cad+'0';\n\t\t\t\t}else if(vlr==10 && i>pos_punto){\n\t\t\t\t\tnum_decimales_redondeo \t= i-pos_punto;\n\t\t\t\t\tdivisor\t\t\t\t\t= 1;\n\t\t\t\t\tfor(k=1;k<num_decimales_redondeo; k++) divisor = divisor/10;//divide el 1 para que de 0.1 o 0.01 o 0.001 o 0.0001\n\t\t\t\t\tcad\t= Number(cad)+Number(divisor);\n\t\t\t\t\tcad = cad+'0';\n\t\t\t\t}else\n\t\t\t\t\tcad = cad+''+vlr;\n\t\t\t}\t\n\t\t\tcadena = cad;\t\t\n\t\t}\n\t}\n\tcad = '';\t\n\treturn cadena;\n}", "title": "" }, { "docid": "70081f56ffe2da1f0e2f12677278ebd8", "score": "0.5454491", "text": "function v(val) {\n\t\tif(val == \".\")\n\t\t\tvar decimal = true;\n\t\tdocument.getElementById(\"d\") .value += val;\n}", "title": "" }, { "docid": "190d883600b2711e426ded0972f69863", "score": "0.5450074", "text": "function formatearDato(total){\n \n// var tipoMonedaColombiana = $(\"#tipoMonedaColombiana\").val();\n// \n// if(tipoMonedaColombiana == \"tradicional\"){\n// total = Math.round(total);\n// return total;\n// \n// } else {\n var cantidadDecimales = $(\"#cantidadDecimales\").val();\n var datos = total.toString().split(\".\");\n \n if(datos.length > 1){\n var primerDato = datos[0];\n var segundoDato = datos[1];\n \n if(segundoDato.length > cantidadDecimales){\n segundoDato = segundoDato.substr(0, parseInt(cantidadDecimales));\n } \n \n total = primerDato+\".\"+segundoDato; \n \n }\n\n return total;\n// }\n \n}", "title": "" }, { "docid": "4301204fb0e8e8a1c8ff4b674cf0c765", "score": "0.5447501", "text": "function readNumber(startsWithDot) {\n var start = tokPos, isFloat = false, octal = input.charCodeAt(tokPos) === 48;\n if (!startsWithDot && readInt(10) === null) raise(start, \"Invalid number\");\n if (input.charCodeAt(tokPos) === 46) {\n ++tokPos;\n readInt(10);\n isFloat = true;\n }\n var next = input.charCodeAt(tokPos);\n if (next === 69 || next === 101) {\n // 'eE'\n next = input.charCodeAt(++tokPos);\n if (next === 43 || next === 45) ++tokPos;\n // '+-'\n if (readInt(10) === null) raise(start, \"Invalid number\");\n isFloat = true;\n }\n if (isIdentifierStart(input.charCodeAt(tokPos))) raise(tokPos, \"Identifier directly after number\");\n var str = input.slice(start, tokPos), val;\n if (isFloat) val = parseFloat(str); else if (!octal || str.length === 1) val = parseInt(str, 10); else if (/[89]/.test(str) || strict) raise(start, \"Invalid number\"); else val = parseInt(str, 8);\n return finishToken(_num, val);\n }", "title": "" }, { "docid": "30c822ec7a22e1c4a875eaaa9acf53b8", "score": "0.5437321", "text": "_parse(value) {\n const f = parseFloat(value);\n if (!Number.isNaN(f)) {\n if (f >= 100) {\n return Math.round(f);\n }\n return (f / 1000.0).toFixed(3);\n }\n return value;\n }", "title": "" }, { "docid": "d8dbfee5a4566477e8204b673d51a62c", "score": "0.54352343", "text": "function setNumeroFormato(num, dec, sep_mil, sep_dec) {\r\n\tnum = parseFloat(num);\r\n\tdec = parseInt(dec);\r\n\tif (num < 0) var Signo = \"-\"; else Signo = \"\";\r\n\t//var numero = String(redondear(num, dec));\r\n\tvar numero = String(Math.abs(num.toFixed(dec)));\r\n\tvar partes = numero.split(\".\");\r\n\tvar entera = parseInt(partes[0]);\r\n\tif (partes[1]) {\r\n\t\tvar nro_dec = parseInt(partes[1].length);\r\n\t\tvar veces = dec - nro_dec;\r\n\t\tif (veces > 0) var ceros = str_repeat(\"0\", veces); else var ceros = \"\";\r\n\t\tvar decimal = String(partes[1]) + ceros;\r\n\t} else {\r\n\t\tvar veces = dec;\r\n\t\tvar ceros = str_repeat(\"0\", veces);\r\n\t\tvar decimal = ceros;\r\n\t}\r\n\tvar cadena = \"\";\r\n\tvar aux;\r\n\tvar cont = 1, m, k;\r\n\tif (entera < 0) aux = 1; else aux = 0;\r\n\tentera = String(entera);\r\n\tfor(m=entera.length-1; m>=0; m--) {\r\n\t\tcadena = entera.charAt(m) + cadena;\r\n\t\tif(cont%3 == 0 && m > aux) cadena = sep_mil + cadena; else cadena = cadena;\r\n\t\tif(cont == 3) cont = 1; else cont++;\r\n\t}\r\n\tcadena = Signo + cadena + sep_dec + String(decimal);\r\n\treturn cadena;\r\n}", "title": "" }, { "docid": "f88759e87b483cd179b02960c2c0d160", "score": "0.5432749", "text": "function format(input){\n var num = input.value.replace(/\\./g,'');\n if(!isNaN(num)){\n num = num.toString().split('').reverse().join('').replace(/(?=\\d*\\.?)(\\d{3})/g,'$1.');\n num = num.split('').reverse().join('').replace(/^[\\.]/,'');\n input.value = num;\n }\n }", "title": "" }, { "docid": "b81687dc6e4bc9f478a76d438bae1d0a", "score": "0.54314935", "text": "function convert(value,fromUnit,toUnit,commas=true) {\n\n var str = (value * fromUnit / toUnit).toString();\n var x = str.length;\n var i = str.lastIndexOf(\".\");\n\n //console.log(\"strLength: \"+ x);\n \n if(commas){\n \n if (i != -1) {\n\n var fixedLength = x - i;\n str = (value * fromUnit / toUnit).toFixed(fixedLength);\n \n var array = str.split(\".\");\n array[0] = array[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n array = array.join(\".\");\n\n str = array;\n\n } else {\n\n str = (value * fromUnit / toUnit).toFixed(0);\n str = str.replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n\n }\n\n //console.log(\"index of \\\".\\\": \" + i);\n }\n\n return str;\n\n}", "title": "" }, { "docid": "10931296e1faee28b1549a7d3bf8de36", "score": "0.5429638", "text": "function stripUnits(x) {\n return Number(x.replace(/[^0-9.-]+/g, ''));\n}", "title": "" }, { "docid": "c3326b5fc7321d4ccc0b5534dbbf1ec8", "score": "0.54222643", "text": "function parseDecimal(x, str) {\n var e, i, len; // Decimal point?\n\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); // Exponential form?\n\n if ((i = str.search(/e/i)) > 0) {\n // Determine exponent.\n if (e < 0) e = i;\n e += +str.slice(i + 1);\n str = str.substring(0, i);\n } else if (e < 0) {\n // Integer.\n e = str.length;\n } // Determine leading zeros.\n\n\n for (i = 0; str.charCodeAt(i) === 48;) ++i; // Determine trailing zeros.\n\n\n for (len = str.length; str.charCodeAt(len - 1) === 48;) --len;\n\n str = str.slice(i, len);\n\n if (str) {\n len -= i;\n e = e - i - 1;\n x.e = mathfloor(e / LOG_BASE);\n x.d = []; // Transform base\n // e is the base 10 exponent.\n // i is where to slice str to get the first word of the digits array.\n\n i = (e + 1) % LOG_BASE;\n if (e < 0) i += LOG_BASE;\n\n if (i < len) {\n if (i) x.d.push(+str.slice(0, i));\n\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\n\n str = str.slice(i);\n i = LOG_BASE - str.length;\n } else {\n i -= len;\n }\n\n for (; i--;) str += '0';\n\n x.d.push(+str);\n if (external && (x.e > MAX_E || x.e < -MAX_E)) throw Error(exponentOutOfRange + e);\n } else {\n // Zero.\n x.s = 0;\n x.e = 0;\n x.d = [0];\n }\n\n return x;\n }", "title": "" }, { "docid": "8bd274417714f5591471b2dd1200b682", "score": "0.54215986", "text": "function bmExtractNumber(obj, decimalPlaces, allowNegative) {\r\n\tvar temp = obj.value;\r\n\r\n\t// avoid changing things if already formatted correctly\r\n\tvar reg0Str = '[0-9]*';\r\n\tif (decimalPlaces > 0) {\r\n\t\treg0Str += '\\\\.?[0-9]{0,' + decimalPlaces + '}';\r\n\t} else if (decimalPlaces < 0) {\r\n\t\treg0Str += '\\\\.?[0-9]*';\r\n\t}\r\n\treg0Str = allowNegative ? '^-?' + reg0Str : '^' + reg0Str;\r\n\treg0Str = reg0Str + '$';\r\n\t\r\n\tvar reg0 = new RegExp(reg0Str);\r\n\r\n\tif (reg0.test(temp))\r\n\t\treturn true;\r\n\r\n\t// first replace all non numbers\r\n\tvar reg1Str = '[^0-9' + (decimalPlaces != 0 ? '.' : '') + (allowNegative ? '-' : '') + ']';\r\n\tvar reg1 = new RegExp(reg1Str, 'g');\r\n\t\r\n\ttemp = temp.replace(reg1, '');\r\n\r\n\tif (allowNegative) {\r\n\t\t// replace extra negative\r\n\t\tvar hasNegative = temp.length > 0 && temp.charAt(0) == '-';\r\n\t\tvar reg2 = /-/g;\r\n\t\ttemp = temp.replace(reg2, '');\r\n\t\tif (hasNegative) temp = '-' + temp;\r\n\t}\r\n\r\n\tif (decimalPlaces != 0) {\r\n\t\tvar reg3 = /\\./g;\r\n\t\tvar reg3Array = reg3.exec(temp);\r\n\t\tif (reg3Array != null) {\r\n\t\t\t// keep only first occurrence of .\r\n\t\t\t// and the number of places specified by decimalPlaces or the entire string if decimalPlaces < 0\r\n\t\t\tvar reg3Right = temp.substring(reg3Array.index + reg3Array[0].length);\r\n\t\t\treg3Right = reg3Right.replace(reg3, '');\r\n\t\t\treg3Right = decimalPlaces > 0 ? reg3Right.substring(0, decimalPlaces) : reg3Right;\r\n\t\t\ttemp = temp.substring(0, reg3Array.index) + '.' + reg3Right;\r\n\t\t}\r\n\t}\r\n\r\n\tobj.value = temp;\r\n}", "title": "" }, { "docid": "c87c0f5e636dbbf4d103a5e847a60813", "score": "0.54153883", "text": "readable(format) {\n\t\tif (format == this.FULL) {\n\t\t\tthis.baseKDigits.reverse()\n\t\t\tlet value = this.baseKDigits.join(\",\");\n\t\t\tthis.baseKDigits.reverse();\n\t\t\treturn value;\n\t\t}\n\t\t// digits is being set to how many sets of 3 digits there are.\n\t\tlet digits = this.baseKDigits.length - 1;\n\t\t// number is being set to the apropriate unit of weight, along with 3 decimal places from the former unit of weight,\n\t\tlet number = Heavy.fixMe(this.baseKDigits[digits] + (digits > 0 ? this.baseKDigits[digits - 1] / 1000 : 0));\n\t\t/*\n\t\t * This is returning the amount of mass there is, along with what unit it is.\n\t\t * It is using the short-hand way of writing weight by using the array shNamesPerKilo[].\n\t\t */\n\t\tif (format == this.SHORT) return number + this.shNamesPerKilo[digits];\n\t\t/*\n\t\t * This is returning the amount of mass there is, along with what unit it is.\n\t\t * It is returning the full name of the weight unit by using the array namesPerKilo[].\n\t\t */\n\t\tif (format == this.LONG) return number + \" \" + this.namesPerKilo[digits] + (Heavy.hasFriends(number) ? \"s\" : \"\");\n\t\tthrow new Error(\"format is not a valid Heavy.(FORMAT)\");\n\t}", "title": "" }, { "docid": "49b34c36e41938df91e0bdafd332627d", "score": "0.5409947", "text": "function format(input){\nvar num = input.value.replace(/\\./g,'');\n if(!isNaN(num)){\n num = num.toString().split('').reverse().join('').replace(/(?=\\d*\\.?)(\\d{3})/g,'$1.');\n num = num.split('').reverse().join('').replace(/^[\\.]/,'');\n input.value = num;\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n }\n}", "title": "" }, { "docid": "0a600887a5793e1a0787df4779f25369", "score": "0.54081994", "text": "function convert(binary) { \n let decimal = parseInt((binary + '').replace(/[^01]/gi, ''), 2);\n console.log (decimal);\n}", "title": "" }, { "docid": "c6a59d00e588122e3164e535ae69a669", "score": "0.54049855", "text": "parseNumbers(n) {\n var n = ('' + n).split('.');\n var num = n[0];\n var dec = n[1];\n var r, s, t;\n\n if (num.length > 3) {\n s = num.length % 3;\n\n if (s) {\n t = num.substring(0,s);\n num = t + num.substring(s).replace(/(\\d{3})/g, \",$1\");\n } else {\n num = num.substring(s).replace(/(\\d{3})/g, \",$1\").substring(1);\n }\n }\n\n if (dec && dec.length > 3) {\n dec = dec.replace(/(\\d{3})/g, \"$1 \");\n }\n\n return num + (dec? '.' + dec : '');\n }", "title": "" }, { "docid": "2f15309348b4abe545523ddb03022ae9", "score": "0.5401862", "text": "setNumberDecimalValue(value) {\n let numberOnlyStr = value\n if (typeof value === 'string') {\n let numberOnlyStr = value.replace(/[^0-9.]+/g, \"\")\n }\n // check last charactor if '.' will add 00\n if (typeof numberOnlyStr == 'string' && numberOnlyStr.substr(numberOnlyStr.length - 1) == '.') {\n numberOnlyStr += '00'\n }\n this.setState({\n showValue: _.isNil(numberOnlyStr) || numberOnlyStr === '' ? '' : numeral(numberOnlyStr).format('0,0[.]00')\n })\n }", "title": "" }, { "docid": "661dde7b20ba471e21f62f1c5925f6f4", "score": "0.5401254", "text": "function format_money(Obj, e) {\n var theKey = e.keyCode;\n var theLen = Obj.value.length;\n var theStringNum = Obj.value;\n theSecondStringNum = \"\";\n // Neu ki tu dau tien la \".\" thi bo qua\n if (theStringNum == \".\") {\n Obj.value = \"\";\n return;\n }\n pos = theStringNum.indexOf(\".\", 0)\n if (pos > 0) {\n arr_numstr = theStringNum.split(\".\");\n theFirstStringNum = theStringNum.substr(0, pos);\n theSecondStringNum = theStringNum.substr(pos + 1, theStringNum.length - pos);\n if (theSecondStringNum.substr(theSecondStringNum.length - 1, 1) == \".\") {\n Obj.value = theStringNum.substr(0, theStringNum.length - 1);\n return;\n }\n theStringNum = theFirstStringNum;\n }\n //Chi nhan cac ky tu la so\n if ((theKey >= 48 && theKey <= 57) || (theKey >= 96 && theKey <= 105) || (theKey == 8) || (theKey == 46)) {\n var theNewString;\n var theSubString;\n var LastIndex;\n LastIndex = 0;\n theSubString = \"\"\n // Thay the ky tu \",\"\n for (var i = 0; i < theStringNum.length; i++) {\n if (theStringNum.substring(i, i + 1) == _DECIMAL_DELIMITOR)\t\t// Tim ky tu \",\"\n {\n theSubString = theSubString + theStringNum.substring(LastIndex, i)\n LastIndex = i + 1;\n }\n }\n theSubString = theSubString + theStringNum.substring(LastIndex, theStringNum.length) // Lay mot doan cuoi cung (vi doan cuoi cung khong co ky tu \",\")\n theStringNum = theSubString;\n\n theNewString = \"\"\n if (theStringNum.length > 3)\n while (theStringNum.length > 3) {\n theSubString = theStringNum.substring(theStringNum.length - 3, theStringNum.length);\n theStringNum = theStringNum.substring(0, theStringNum.length - 3);\n theNewString = _DECIMAL_DELIMITOR + theSubString + theNewString;\n }\n if (pos > 0)\n theNewString = theStringNum + theNewString + \".\" + theSecondStringNum;\n else\n theNewString = theStringNum + theNewString;\n\n if (theLen > 3)\n Obj.value = theNewString;\n }\n}", "title": "" }, { "docid": "e5f113602643f23f090293092609a4f7", "score": "0.53989613", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }", "title": "" }, { "docid": "e5f113602643f23f090293092609a4f7", "score": "0.53989613", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }", "title": "" }, { "docid": "e5f113602643f23f090293092609a4f7", "score": "0.53989613", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }", "title": "" }, { "docid": "e5f113602643f23f090293092609a4f7", "score": "0.53989613", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }", "title": "" }, { "docid": "e5f113602643f23f090293092609a4f7", "score": "0.53989613", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }", "title": "" }, { "docid": "e5f113602643f23f090293092609a4f7", "score": "0.53989613", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }", "title": "" }, { "docid": "e5f113602643f23f090293092609a4f7", "score": "0.53989613", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }", "title": "" }, { "docid": "e5f113602643f23f090293092609a4f7", "score": "0.53989613", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }", "title": "" }, { "docid": "e465ec0425a45a2ee455af7b78229a0a", "score": "0.53957176", "text": "function parseDecimal(x, str) {\n var e, i, len;\n\n // Decimal point?\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\n\n // Exponential form?\n if ((i = str.search(/e/i)) > 0) {\n\n // Determine exponent.\n if (e < 0) e = i;\n e += +str.slice(i + 1);\n str = str.substring(0, i);\n } else if (e < 0) {\n\n // Integer.\n e = str.length;\n }\n\n // Determine leading zeros.\n for (i = 0; str.charCodeAt(i) === 48; i++);\n\n // Determine trailing zeros.\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\n str = str.slice(i, len);\n\n if (str) {\n len -= i;\n x.e = e = e - i - 1;\n x.d = [];\n\n // Transform base\n\n // e is the base 10 exponent.\n // i is where to slice str to get the first word of the digits array.\n i = (e + 1) % LOG_BASE;\n if (e < 0) i += LOG_BASE;\n\n if (i < len) {\n if (i) x.d.push(+str.slice(0, i));\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\n str = str.slice(i);\n i = LOG_BASE - str.length;\n } else {\n i -= len;\n }\n\n for (; i--;) str += '0';\n x.d.push(+str);\n\n if (external) {\n\n // Overflow?\n if (x.e > x.constructor.maxE) {\n\n // Infinity.\n x.d = null;\n x.e = NaN;\n\n // Underflow?\n } else if (x.e < x.constructor.minE) {\n\n // Zero.\n x.e = 0;\n x.d = [0];\n // x.constructor.underflow = true;\n } // else x.constructor.underflow = false;\n }\n } else {\n\n // Zero.\n x.e = 0;\n x.d = [0];\n }\n\n return x;\n }", "title": "" }, { "docid": "a2acb718b51f87939cdff0dec9d5e68f", "score": "0.5395271", "text": "function toNumber(s) {\n return Number(s.replace(/[^0-9\\.]/g, \"\"));\n}", "title": "" }, { "docid": "7d0e1d70d5800078987cfd12baefaa4b", "score": "0.5394106", "text": "number() {\n let value\n let string = ''\n\n if (this.ch === '-') {\n string = '-'\n this.next('-')\n\n // can't have a period after a negative\n if (this.ch === '.') this.error('Bad number')\n }\n\n const leadingZero = this.ch === '0'\n let seenDelim = false\n\n while (this.ch >= '0' && this.ch <= '9') {\n string += this.ch\n this.next()\n if (this.ch === '0' && leadingZero) this.error('Bad number')\n }\n\n if (this.ch === '.') {\n seenDelim = true\n string += '.'\n this.next()\n\n // exponents cant follow a period.\n if (this.ch === 'e' || this.ch === 'E') this.error('Bad number')\n\n string += this.ch\n while (this.next() && this.ch >= '0' && this.ch <= '9') string += this.ch\n }\n\n if (this.ch === 'e' || this.ch === 'E') {\n seenDelim = true\n string += this.ch\n this.next()\n if (this.ch === '-' || this.ch === '+') {\n string += this.ch\n this.next()\n }\n while (this.ch >= '0' && this.ch <= '9') {\n string += this.ch\n this.next()\n }\n }\n\n // at this point we have a number in `string`\n // look for a few edge cases here,\n // otherwise use type coersion to turn it into a number.\n if (\n (leadingZero && !seenDelim && string !== '0' && string !== '-0') ||\n string.endsWith('.')\n ) {\n this.error('Bad number')\n }\n\n value = +string\n\n if (!isFinite(value)) {\n this.error('Bad number')\n } else {\n this.append(value)\n return value\n }\n }", "title": "" }, { "docid": "f693c0d35192f2f487e7592fb5edd74a", "score": "0.53855366", "text": "function textToFloat(text){\n\t\n\tvar valor = text.replace(\"R$ \", \"\").replace(\",\",\".\");\n\treturn parseFloat(valor);\n}", "title": "" }, { "docid": "cc1a4e3f12e59f81323c01f075941fe5", "score": "0.5379467", "text": "constructor(props) {\n super(props);\n\n /* Add spaces every 3 digits */\n let [left, right] = String(props.value).split('.');\n left = left.split('');\n for (var i = 0; i < Math.ceil(left.length / 3) - 1; i++) {\n left.splice(left.length - (i + ((i+1)*3)), 0, ' ');\n }\n left = left.join('');\n let number = [left].concat([right]).filter((e) => e).join('.');\n\n this.state = {\n number: number,\n romaji: convert.web_convert(props.value, 'R'),\n kanji: convert.web_convert(props.value, 'K'),\n hiragana: convert.web_convert(props.value, 'H'),\n isFront: true,\n }\n }", "title": "" }, { "docid": "33e01a7ef6c9872f39d5e718eaecb80a", "score": "0.5375254", "text": "function valNumericoFloat(texto) {\r\n\tvar checkOK = \"0123456789.,\";\r\n\tvar checkStr = texto;\r\n\tvar allValid = true;\r\n\tfor(var i=0; i < checkStr.length; i++) {\r\n\t\tch = checkStr.charAt(i);\r\n\t\tfor (j=0; j<checkOK.length; j++)\r\n\t\t\tif (ch == checkOK.charAt(j)) break;\r\n\t\tif (j == checkOK.length) {\r\n\t\t\tallValid = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\treturn allValid;\r\n}", "title": "" }, { "docid": "ace6ba1a9e232fa523d02df617ddd68c", "score": "0.5375093", "text": "function jsEsNumeroDecimal(evento) {\n key = evento.keyCode;\n return (key >= 48 && key <= 57) || (key == 46);\n}", "title": "" }, { "docid": "8893ff1ebff93e4b6ff0e399815d870d", "score": "0.5374748", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48;) ++i;\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48;) --len;\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n e = e - i - 1;\r\n x.e = mathfloor(e / LOG_BASE);\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external && (x.e > MAX_E || x.e < -MAX_E)) throw Error(exponentOutOfRange + e);\r\n } else {\r\n\r\n // Zero.\r\n x.s = 0;\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }", "title": "" }, { "docid": "8893ff1ebff93e4b6ff0e399815d870d", "score": "0.5374748", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48;) ++i;\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48;) --len;\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n e = e - i - 1;\r\n x.e = mathfloor(e / LOG_BASE);\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external && (x.e > MAX_E || x.e < -MAX_E)) throw Error(exponentOutOfRange + e);\r\n } else {\r\n\r\n // Zero.\r\n x.s = 0;\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }", "title": "" }, { "docid": "8893ff1ebff93e4b6ff0e399815d870d", "score": "0.5374748", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48;) ++i;\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48;) --len;\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n e = e - i - 1;\r\n x.e = mathfloor(e / LOG_BASE);\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external && (x.e > MAX_E || x.e < -MAX_E)) throw Error(exponentOutOfRange + e);\r\n } else {\r\n\r\n // Zero.\r\n x.s = 0;\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }", "title": "" }, { "docid": "42ea73589f9dc76cf7e98e181d02b83f", "score": "0.53701544", "text": "function parseNumOne(){\n firstNumTotal = firstNum.join(\"\");\n console.log(firstNumTotal);\n return parseFloat(firstNumTotal);\n}", "title": "" }, { "docid": "e6450174ee8f4dc665d009d0ed1db0e7", "score": "0.53641444", "text": "function controlImporte (valor){\r\n\t//alert(\"Controlar Importe(\" + valor + \")\")\r\n \t//Remplazo coma por punto dado que los numeros solo aceptan punto. \t\r\n \tvalor = valor.replace(/\\,/,\".\");\r\n if (controlNumero(valor)) { \t\r\n\t\tvar aux = valor.indexOf(\".\");\r\n \tif (aux != -1) {\r\n \t\tif (valor.length > (aux + 3)) return false\r\n \t}\r\n \treturn true\r\n }\r\n return false;\r\n \r\n}", "title": "" }, { "docid": "6053bff5f291f32fef6eb9801571454b", "score": "0.5363287", "text": "votation(val) {\r\n var number = Math.round(parseFloat(val) / 2 );\r\n return number\r\n }", "title": "" }, { "docid": "434bdf71c4b739368f6a162f574a2e57", "score": "0.5362548", "text": "function lengthValue(){\n var b = document.getElementById(\"screen\").value.replace(/\\,|\\./gi,'');\n if(!isNaN(b)){ \n b = b.toString().split('').reverse().join('').replace(/(?=\\d*\\.?)(\\d{3})/g,'$1.');\n b = b.split('').reverse().join('').replace(/^[\\.]/,'');\n lengthVal = b;\n } \n}", "title": "" } ]
8daa402f8c8cd4bf608672371dbf2b2b
normalize possible array / string values into Object
[ { "docid": "0a6c9b9a52899e9e9ba9bf15b141278b", "score": "0.0", "text": "function normalizeStyleBinding (bindingStyle) {\n if (Array.isArray(bindingStyle)) {\n return toObject(bindingStyle)\n }\n if (typeof bindingStyle === 'string') {\n return parseStyleText(bindingStyle)\n }\n return bindingStyle\n}", "title": "" } ]
[ { "docid": "ec78f72cad507324de8e95086f4c1121", "score": "0.6344631", "text": "static convertArraysToObjects(obj) {\n return _.reduce(obj, (acc, value, key) => {\n if (_.isDate(value)) {\n // Don't let the Date object hit the general Object case below.\n acc[key] = value;\n } else if (_.isArray(value)) {\n acc[key] = value.reduce((acc, value, key) => {\n acc[key] = _.isObject(value) ? AmqpTransport.convertArraysToObjects(value) : value;\n return acc;\n }, {});\n } else if (_.isObjectLike(value)) {\n acc[key] = AmqpTransport.convertArraysToObjects(value);\n } else {\n acc[key] = value;\n }\n return acc;\n }, {});\n }", "title": "" }, { "docid": "22f4f37ca819caa40a604ab1f040a327", "score": "0.60788167", "text": "function array_to_object ( a )\r\n{\r\n var o = {};\r\n for ( var i = 0; i < a.length; i++ )\r\n {\r\n o[ a[ i ] ] = \"\";\r\n }\r\n return o;\r\n}", "title": "" }, { "docid": "0ddcb032e561d14be987475ac19bb5c4", "score": "0.59336305", "text": "function prepare(arr) {\n\t\t\tif (arr && arr.value) {\n\t\t\t\tarr = arr.value.split(' ');\n\t\t\t\tfor (val in arr) {\n\t\t\t\t\tarr[val] = arr[val].trim();\n\t\t\t\t}\n\t\t\t\treturn arr;\t\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "e5fcca1fb33c87b9beb18e50ce15364e", "score": "0.58268934", "text": "function toObject(arr){var res={};for(var i=0;i<arr.length;i++){if(arr[i]){extend(res,arr[i]);}}return res;}", "title": "" }, { "docid": "e97d319316bd502692390d5ecd34ebaa", "score": "0.57873183", "text": "function toObject(value) {\n if (!Array.isArray(value)) {\n return value;\n }\n\n const map = {};\n\n for (let i = 0; i < value.length; i++) {\n map[value[i]] = true;\n }\n\n return map;\n} // for keepFnName", "title": "" }, { "docid": "468119f5709457ced7cfbdaaf85dd542", "score": "0.5740558", "text": "function toObject(arr) { var res = {}; for (var i = 0; i < arr.length; i++) { if (arr[i]) { extend(res, arr[i]); } } return res; }", "title": "" }, { "docid": "b4d963e8c901949863a7c68451077206", "score": "0.5729155", "text": "function normaliseParams(params) {\n\t\t\tif (typeof params == 'string') {\n\t\t\t\tparams = params.split(' ');\n\t\t\t}\n\t\t\telse if (!$.isArray(params)) {\n\t\t\t\tvar opts = [];\n\t\t\t\tfor (var name in params) {\n\t\t\t\t\topts[0] = name;\n\t\t\t\t\topts[1] = params[name];\n\t\t\t\t}\n\t\t\t\tparams = opts;\n\t\t\t}\n\t\t\treturn params;\n\t\t}", "title": "" }, { "docid": "bbe91c4446eaf255b92bb2eb2492fd08", "score": "0.5724754", "text": "function toObject(value) {\n if (!Array.isArray(value)) {\n return value;\n }\n\n const map = {};\n for (let i = 0; i < value.length; i++) {\n map[value[i]] = true;\n }\n return map;\n}", "title": "" }, { "docid": "cafda04ca15c5b1bac4989214f3e3eda", "score": "0.5723482", "text": "function convertHookData(input) {\n const result = {};\n if (Array.isArray(input)) {\n result.all = input;\n }\n else if (typeof input !== 'object') {\n result.all = [input];\n }\n else {\n for (const key of Object.keys(input)) {\n const value = input[key];\n result[key] = Array.isArray(value) ? value : [value];\n }\n }\n return result;\n}", "title": "" }, { "docid": "51cfcd7340639a4eea79501550ecadfc", "score": "0.5703726", "text": "function normalizeData(data) {\n\n if(!data)\n return [];\n\n var _collection = options.groupKey ? {} : [],\n display;\n\n // if string split to array.\n if(angular.isString(data))\n data = $helpers.trim(data).split(',');\n //if data object is object literal\n //convert to an array of objects.\n\n if(angular.isObject(data) && !angular.isArray(data)){\n var tmpData = [];\n angular.forEach(data, function (v,k) {\n var obj = {};\n obj[options.text] = v;\n obj[options.value] = k;\n tmpData.push(obj);\n });\n data = tmpData;\n }\n\n if(options.allowNull !== false && angular.isArray(_collection))\n _collection.push(nullItem);\n\n if(options.allowNull !== false && angular.isObject(_collection))\n _collection._placeholder = {\n key: 'placeholder',\n display: false,\n hidden: false,\n items: [nullItem]\n };\n\n angular.forEach(data, function (v,k) {\n if(angular.isString(v)) {\n display = v = $helpers.trim(v);\n if(options.capitalize !== false)\n display = v.charAt(0).toUpperCase() + v.slice(1);\n // simple string just push to collection.\n _collection.push({ text: v, value: v, display: display });\n }\n\n if(angular.isObject(v)) {\n\n var item = v,\n displayKey = options.display || options.text;\n\n item.text = v[options.text];\n item.text = item.text.charAt(0).toUpperCase() + item.text.slice(1);\n item.value = v[options.value] || item.text;\n item.display = v[displayKey];\n\n if(options.capitalize !== false)\n item.display = item.display.charAt(0).toUpperCase() + item.display.slice(1);\n\n if(!options.groupKey) {\n _collection.push(item);\n }\n\n else {\n var groupKey = $helpers.findByNotation(v, options.groupKey),\n groupDisplay = $helpers.findByNotation(v, options.groupDisplay || options.groupKey);\n if(groupKey === undefined)\n return console.error('Cannot initialize ai.list using groupKey of ' + groupKey);\n if(options.capitalize !== false)\n groupDisplay = groupDisplay.charAt(0).toUpperCase() + groupDisplay.slice(1);\n _collection[groupKey] = _collection[groupKey] ||\n { key: groupKey, display: groupDisplay, hidden: false };\n _collection[groupKey].items = data.filter(function(i) {\n return $helpers.findByNotation(i, options.groupKey) === groupKey;\n });\n }\n\n }\n\n });\n\n return _collection;\n }", "title": "" }, { "docid": "4287e3e8cf4ab7deaad560148ef0f838", "score": "0.56884515", "text": "function normalizeStyleData(data){var style=normalizeStyleBinding(data.style);// static style is pre-processed into an object during compilation\n// and is always a fresh object, so it's safe to merge into it\nreturn data.staticStyle?extend(data.staticStyle,style):style;}// normalize possible array / string values into Object", "title": "" }, { "docid": "14ba187efc4848eabde0f88d3d327ffd", "score": "0.5678613", "text": "function arrayToObject(array, extractor) {\n return array.reduce(function (result, item, i) {\n var nameAndValue = extractor(item, i);\n if (nameAndValue) result[nameAndValue[0]] = nameAndValue[1];\n return result;\n }, {});\n }", "title": "" }, { "docid": "587b23e3be927d2e28f68174cdcb68d5", "score": "0.5648184", "text": "function normalizeAarray(arr = []) {\n if (typeof arr === 'string') {\n arr = [arr]\n }\n return arr\n}", "title": "" }, { "docid": "59e20935bf5c429dcb771bbe9a52b12b", "score": "0.5639166", "text": "function convert(value, insideArr) {\n if (value !== null && ! checkAtomicTypes(value)) {\n return convertFromJS(value, insideArr, hasDeclaredType);\n }\n return value;\n }", "title": "" }, { "docid": "7e1a089fb049c1a3c55efaf2f4577318", "score": "0.56186515", "text": "function clean(input) {\n\t return Array.isArray(input) ? cleanArray(input) : cleanObject(input);\n\t}", "title": "" }, { "docid": "7e1a089fb049c1a3c55efaf2f4577318", "score": "0.56186515", "text": "function clean(input) {\n\t return Array.isArray(input) ? cleanArray(input) : cleanObject(input);\n\t}", "title": "" }, { "docid": "e7b2660cd683123177952a4e68cfd3e4", "score": "0.5611058", "text": "function x(o) {\n if (!o) return;\n if (Array.isArray(o)) return o.map(x(o));\n\n var ret = Object.assign({}, o);\n ret.currency = {\n code: ret.currency, \n symbol: ret.currency_symbol, \n decimal: ret.currency_decimal\n };\n ret.code = {iso2: ret.iso2, iso3: ret.iso3}\n for (var k of 'iso2|iso3|currency_symbol|currency_decimal'.split('|'))\n delete ret[k];\n return ret; \n}", "title": "" }, { "docid": "f59226974a8cb66b35c3dbb17d60e73d", "score": "0.5609863", "text": "function clean(input) {\n return Array.isArray(input) ? cleanArray(input) : cleanObject(input);\n}", "title": "" }, { "docid": "f59226974a8cb66b35c3dbb17d60e73d", "score": "0.5609863", "text": "function clean(input) {\n return Array.isArray(input) ? cleanArray(input) : cleanObject(input);\n}", "title": "" }, { "docid": "f59226974a8cb66b35c3dbb17d60e73d", "score": "0.5609863", "text": "function clean(input) {\n return Array.isArray(input) ? cleanArray(input) : cleanObject(input);\n}", "title": "" }, { "docid": "f59226974a8cb66b35c3dbb17d60e73d", "score": "0.5609863", "text": "function clean(input) {\n return Array.isArray(input) ? cleanArray(input) : cleanObject(input);\n}", "title": "" }, { "docid": "f59226974a8cb66b35c3dbb17d60e73d", "score": "0.5609863", "text": "function clean(input) {\n return Array.isArray(input) ? cleanArray(input) : cleanObject(input);\n}", "title": "" }, { "docid": "f59226974a8cb66b35c3dbb17d60e73d", "score": "0.5609863", "text": "function clean(input) {\n return Array.isArray(input) ? cleanArray(input) : cleanObject(input);\n}", "title": "" }, { "docid": "1613aa80908dc9339ed79edcc07cbd80", "score": "0.560097", "text": "function sanitize(input, schema, opts = { setDefault: true }) {\n switch (schema.type) {\n case 'object': {\n const output = {};\n if (!schema.properties) return input;\n Object.keys(schema.properties).forEach((key) => {\n if (_.isPlainObject(input)) {\n const result = sanitize(input[key], schema.properties[key], opts);\n if (result !== undefined) output[key] = result;\n }\n });\n return _.merge(input, output);\n }\n case 'array': {\n if (opts.setDefault && input === undefined && schema.defaultValue) {\n return setDefault(schema, input);\n }\n if (_.isArray(input) && schema.items) {\n return input.map(item => sanitize(item, schema.items, opts));\n }\n return input;\n }\n case 'string':\n case 'number':\n case 'boolean':\n case 'date': {\n if (opts.setDefault && (input === null || input === undefined) && schema.defaultValue !== undefined) {\n return setDefault(schema, input);\n }\n // TODO: use typecheck function\n if (input !== undefined && schema.cast && !typeCheck(input, schema.type)) {\n return schema.cast(input);\n }\n return input;\n }\n default:\n throw new Error('Not supported type');\n }\n}", "title": "" }, { "docid": "5d120c373ecf2b1106ba76e29b833c50", "score": "0.5596453", "text": "function arrayToObject(array, extractor) {\n\t return array.reduce(function (result, item, i) {\n\t var nameAndValue = extractor(item, i);\n\t if (nameAndValue) result[nameAndValue[0]] = nameAndValue[1];\n\t return result;\n\t }, {});\n\t}", "title": "" }, { "docid": "fe526638dbcb9f57eee8b4e0c9220a92", "score": "0.55676216", "text": "function createPpObjects(input) {\n const newInput = input.map(i => i.trim().split(' '));\n// console.log(newInput)\n const splitArr = newInput.map(item => item.map(arr => arr.split(\",\").join(\"\")));\n// console.log(splitArr)\n const flattenedArr = splitArr.map(item => item.flat());\n// console.log(flattenedArr)\n const obj = flattenedArr.map(item => item.reduce((obj, str, index) => {\n let strParts = str.split(':');\n if (strParts[0] && strParts[1]) {\n obj[strParts[0]] = strParts[1];\n }\n return obj\n }, {})\n );\n return obj;\n}", "title": "" }, { "docid": "bd1c7a3a9e7a5b7f48ac3ae69bb7bfa5", "score": "0.55578756", "text": "function collectionConverter(input) {\n if(Array.isArray(input)) {\n if(input.length % 2 === 1) {\n throw new Error(\"Bad input\");\n }\n const obj = {};\n for(let i = 0; i < input.length; i += 2) {\n obj[input[i]] = input[i+1];\n }\n console.log(obj);\n } else {\n const arr = [];\n Object.keys(input).forEach(item => {\n arr.push(item, input[item]);\n })\n console.log(arr);\n }\n}", "title": "" }, { "docid": "869d28844a7f0a08817a3d6b7571eafc", "score": "0.5531626", "text": "function normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}", "title": "" }, { "docid": "869d28844a7f0a08817a3d6b7571eafc", "score": "0.5531626", "text": "function normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}", "title": "" }, { "docid": "ae14fbcd68d6ec464b5eb8dca2135550", "score": "0.55284435", "text": "function toObject(arr1,arr2) {\n var rv = {};\n for (var i = 0; i < arr1.length; ++i){\n \t//skip blanks and '.' values\n \tif(arr2[i] && !arr2[i].match(/^\\.$/) ){\n \t\trv[arr1[i]]=numberOrStringSingle(arr2[i])\n \t}\n }\n return rv;\n}", "title": "" }, { "docid": "7fd066efc537bb0265de74b8e7d5b9d0", "score": "0.55203277", "text": "function CreateToArrayToObject(inputArray) {\n var obj = {};\n inputArray.map(function (val, key) {\n obj[val.FieldName] = val.value;\n });\n return obj;\n }", "title": "" }, { "docid": "40a4a2e44f6cce1ca4f97f7b7f52f732", "score": "0.55108076", "text": "function cleanup(value) {\n switch(getType(value)){\n case \"array\": \n value = $.map(value, function(v) {\n return cleanup(v);\n });\n if (value.length === 0)\n return null;\n if (value.length === 1)\n return value[0];\n return value;\n case \"object\":\n var clone = {};\n for (var key in value) {\n var v = cleanup(value[key]);\n if (v === null || v === undefined)\n continue;\n clone[key] = v;\n }\n if (isObjectEmpty(clone))\n return null;\n return clone;\n default:\n return value;\n }\n }", "title": "" }, { "docid": "e11ab100fcdd8471ea9585ccbb7b0d52", "score": "0.5504652", "text": "function stringsToObjects(strings){\n return _.mapObject(strings, (val, key) => _.isObject(val) ? stringsToObjects(val) : $(val) );\n }", "title": "" }, { "docid": "3942749ceceb63dc925fb6a550e8fe9d", "score": "0.5504486", "text": "function separateTypes(input) {\r\n let finalAnswer = { \r\n number: [],\r\n string: [],\r\n boolean: [],\r\n };\r\n \r\n for(let i = 0; i < input.length; i++){\r\n if(typeof input[i] == \"number\"){\r\n finalAnswer.number.push(input[i]);\r\n }\r\n else if(typeof input[i] == \"string\"){\r\n finalAnswer.string.push(input[i]);\r\n }\r\n else if(typeof input[i] == \"boolean\"){\r\n finalAnswer.boolean.push(input[i]);\r\n }\r\n }\r\n \r\n return finalAnswer;\r\n }", "title": "" }, { "docid": "ce4d5cb23e5c4c1481e6033cdde73ddb", "score": "0.55031383", "text": "function arrayToObject(array, extractor) {\n return array.reduce(function (result, item, i) {\n var nameAndValue = extractor(item, i);\n if (nameAndValue) result[nameAndValue[0]] = nameAndValue[1];\n return result;\n }, {});\n}", "title": "" }, { "docid": "ce4d5cb23e5c4c1481e6033cdde73ddb", "score": "0.55031383", "text": "function arrayToObject(array, extractor) {\n return array.reduce(function (result, item, i) {\n var nameAndValue = extractor(item, i);\n if (nameAndValue) result[nameAndValue[0]] = nameAndValue[1];\n return result;\n }, {});\n}", "title": "" }, { "docid": "ce4d5cb23e5c4c1481e6033cdde73ddb", "score": "0.55031383", "text": "function arrayToObject(array, extractor) {\n return array.reduce(function (result, item, i) {\n var nameAndValue = extractor(item, i);\n if (nameAndValue) result[nameAndValue[0]] = nameAndValue[1];\n return result;\n }, {});\n}", "title": "" }, { "docid": "458cf7c47972ddc10a5628d68228bed3", "score": "0.5499148", "text": "function sanitizeType(typeName, values, typeMapping) {\n // For each key in the 'values' object...\n Object.keys(values).forEach(key => {\n // Find the type name associated from the mapping\n const type = typeMapping[typeName][key];\n\n if (type === undefined) {// Do nothing if we don't have a type for this key\n } else if (isArray(type)) {\n // find the base type (left side of the brackets)\n const baseType = type.split('[')[0];\n\n if (typeof values[key].length === 'undefined') {\n throw new TypeError(\"Could not parse \".concat(values[key], \" for type \").concat(type, \". Expected array.\"));\n } // If base type is a struct, iterate through each instance of struct\n\n\n if (typeMapping[baseType]) {\n // values[key] is expected to be an array, where each element\n // is an object that represents the struct named baseType.\n values[key].forEach(itemValues => {\n sanitizeType(baseType, itemValues, typeMapping);\n });\n } else if (baseType.startsWith('uint') || baseType.startsWith('int')) {\n // If we have an array of primitive types that are numbers, we need to encode the numbers as hex\n const numberValues = values[key].map(numberValue => {\n return parse_utils_1.encodeNumber(numberValue, baseType, true);\n });\n values[key] = numberValues;\n } else {// Do nothing with regular array values\n // int8[], etc should already be strings\n }\n } else if (typeMapping[type]) {\n // If type name is a custom struct, it should live in the type mapping\n // We need to recursively check the custom types until we get to primitive values\n sanitizeType(type, values[key], typeMapping);\n } else if (type.startsWith('uint') || type.startsWith('int')) {\n // Finally, if we have a primitive type that is a number, we need to encode the numbers as hex\n values[key] = parse_utils_1.encodeNumber(values[key], type, true);\n }\n });\n }", "title": "" }, { "docid": "ebc79b13726319bd9bbf8cac09d3ddcb", "score": "0.5490724", "text": "function normalization(obj) {\n Object.keys(obj).forEach(function (el) {\n normalizeObj(input[el]);\n });\n}", "title": "" }, { "docid": "6c7c1ca8d113a8f4d0a116dfc0ee30ef", "score": "0.54893607", "text": "function normalize(o) {\n _.each(o, function(v, k) {\n if (RE_FLAGS.test(k)) {\n o[k] = normalizeEntry(v);\n } else if (_.isObject(v)) {\n normalize(v);\n }\n });\n}", "title": "" }, { "docid": "4fece851b5f680619388c5f2b057494e", "score": "0.5474326", "text": "function s_to_a(s) {\n if (Array.isArray(s))\n return s;\n else\n return JSON.parse(s);\n}", "title": "" }, { "docid": "1a5b08ac9ddd7344284f62680d9cbd6d", "score": "0.5469963", "text": "function toObject(arr) {\n var toReturn = {};\n $.each(arr, function(i, val) {toReturn[val.name] = val.value;}); \n return toReturn;\n }", "title": "" }, { "docid": "99c550ba78b2917c1f971db8644286c6", "score": "0.54599845", "text": "function sanitizeArrays(body){\n traverseObject(body,function(item){\n if (Array.isArray(item)){\n\n item = item.filter(function(element,index) {\n return (element!='' && element!=null && (item.indexOf(element)==index || typeof(element)=='number'));\n });\n }\n return item;\n });\n}", "title": "" }, { "docid": "3dc879ef746816ee97eef157120ee057", "score": "0.54405856", "text": "makeMultiLanguageValue(type = \"string\"){\n let tmp = {};\n for(let langKey in this.languages){\n let slug = this.languages[langKey].slug;\n if(type == \"string\"){\n tmp[slug] = \"\";\n }else if(type == \"array\"){\n tmp[slug] = [];\n }else if(type == \"object\"){\n tmp[slug] = {};\n }\n }\n return tmp;\n }", "title": "" }, { "docid": "ad631aeb2a7cca6683d9f8b753fa2c24", "score": "0.543257", "text": "function toCollectorArrayValue(values) {\n return {\n values: values.map(value => toCollectorAnyValue(value)),\n };\n}", "title": "" }, { "docid": "654149e236d10d6f4c2f51916d39b2ed", "score": "0.54254913", "text": "function arrToObject(array) {\r\n let obj = {};\r\n for(let i = 0; i < array.length; i++) {\r\n let temp = (typeof array[i]).toString() + \"s\";\r\n\r\n if(obj.hasOwnProperty(temp)) {\r\n obj[temp].push(array[i]);\r\n }\r\n else {\r\n obj[temp] = [];\r\n obj[temp].push(array[i]);\r\n }\r\n }\r\n return \"var result = \" + JSON.stringify(obj, null, 4);\r\n}", "title": "" }, { "docid": "5a758f2f52231b651119a435d9b4328d", "score": "0.53988165", "text": "function normalizeData(value) {\n if (value === 'true') {\n return true;\n }\n\n if (value === 'false') {\n return false;\n }\n\n if (value === Number(value).toString()) {\n return Number(value);\n }\n\n if (value === '' || value === 'null') {\n return null;\n }\n\n if (typeof value !== 'string') {\n return value;\n }\n\n try {\n return JSON.parse(decodeURIComponent(value));\n } catch (_unused) {\n return value;\n }\n}", "title": "" }, { "docid": "a89f90541e7aa7210cfde2cac676feab", "score": "0.53841335", "text": "static objectify(value, mode = 'options')\n {\n if ( Any.isObject(value) ) {\n return value;\n }\n\n if ( mode === 'params' ) {\n return Str.fromParams(value);\n }\n\n if ( mode === 'options' ) {\n return Str.fromOptions(value);\n }\n\n return JSON.parse(value);\n }", "title": "" }, { "docid": "b3201af981c3e57df5582b56d92e243a", "score": "0.5381927", "text": "function toObject(arr) {\n var obj = {};\n arr.forEach(function(e) {\n obj[e[0]] = e[1];\n });\n return obj;\n}", "title": "" }, { "docid": "9c3a9590daa64c57ba09c957937d5a3d", "score": "0.5380681", "text": "function toObject(arr) {\n const res = {};\n\n for (let i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n\n return res;\n }", "title": "" }, { "docid": "7d5ec073ab602349a0c3e698377bab68", "score": "0.53767455", "text": "convert(value) {\n return Object.entries(value).reduce((headers, [key, value]) => {\n return Object.assign(Object.assign({}, headers), { [key]: value instanceof adaptive_expressions_1.StringExpression ? value : new adaptive_expressions_1.StringExpression(value) });\n }, {});\n }", "title": "" }, { "docid": "3777b91df666671c467d4b60d1116b53", "score": "0.53558105", "text": "function arrayToObject(a) {\n return expandArray(a, true);\n }", "title": "" }, { "docid": "a3dbc26ada9be9ff39e1318aaa5c9caa", "score": "0.53525996", "text": "toOptions(instanceArr) {\n // console.log(instanceArr);\n return instanceArr.map((item) => {\n if(typeof item === 'object') {\n return {\n label: item.code,\n value: item.code\n }\n }else {\n return {\n label:item,\n value:item\n }\n }\n\n });\n }", "title": "" }, { "docid": "ac1ed34f3eaff89f07b6417653e44ca1", "score": "0.53419054", "text": "static fromOptions(value)\n {\n if ( Any.isEmpty(value) ) {\n return {};\n }\n\n let matches = value.match(/(^|;)(\\s*(.*?)\\s*:\\s*(\".*?\"|'.*?'|.*?)\\s*)(?=;|$)/g);\n\n return Arr.reduce(matches || [], (result, match) => {\n\n // Get key and value from match\n let attr = match.match( /^;?\\s*(.*?)\\s*:\\s*(\".*?\"|'.*?'|.*?)\\s*$/);\n\n // Skip if length does not match\n if ( attr.length === 3 ) {\n Obj.set(result, attr[1], Str.real(attr[2].replace(/(^[\"']*|[\"']*$)/g, '')));\n }\n\n return result;\n }, {});\n }", "title": "" }, { "docid": "2f6228bc49c267e6f864bd0ee38467fe", "score": "0.5330096", "text": "function ae(e){return Array.isArray(e)?e.length>1?{$or:[].concat(e.map(e=>Object.assign({},e)))}:Object.assign({},e[0]):Object.assign({},e)}", "title": "" }, { "docid": "e905d4c2ff65b315d5193abd0f4238eb", "score": "0.53242505", "text": "function U(a,b){var c,d,e,f,g,h,i={};if(b)for(c=0;c<b.length;c++){\n// collect the trailing object values, stopping when a non-object is discovered\nfor(d=b[c],e=[],f=a.length-1;f>=0;f--)if(g=a[f][d],\"object\"==typeof g)e.unshift(g);else if(void 0!==g){i[d]=g;// if there were no objects, this value will be used\nbreak}\n// if the trailing values were objects, use the merged value\ne.length&&(i[d]=U(e))}\n// copy values into the destination, going from last to first\nfor(c=a.length-1;c>=0;c--){h=a[c];for(d in h)d in i||(// if already assigned by previous props or complex props, don't reassign\ni[d]=h[d])}return i}", "title": "" }, { "docid": "c5b740966b14c2193b2a017edd890713", "score": "0.53032094", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "c5b740966b14c2193b2a017edd890713", "score": "0.53032094", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "c39bec57a292524e238c3dde3474fa6a", "score": "0.53026193", "text": "function fixObjectValueTypes (o) {\n for (var k in o) {\n var v = o[k];\n\n if (v === 'undefined') o[k] = undefined;\n if (v === 'false') o[k] = false;\n if (v === 'null') o[k] = null;\n if (v === 'true') o[k] = true;\n if (v === 'NaN') o[k] = NaN;\n\n if ((+v) == v && v !== '') o[k] = (+v);\n }\n return o;\n}", "title": "" }, { "docid": "f7555ed8e43c5bc959ef0a86ef9efd70", "score": "0.52982837", "text": "function toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "0d928d63482878e0044e0b857deed634", "score": "0.52961797", "text": "function me(e){return Array.isArray(e)?e.length>1?{$or:[].concat(e.map(e=>Object.assign({},e)))}:Object.assign({},e[0]):Object.assign({},e)}", "title": "" }, { "docid": "c7f0a76e33e9a99883b7a1fb3422b0f2", "score": "0.52955115", "text": "function normalizeArguments( args ) {\n if (args.length > 3 ) {\n throw new Error(\"Unexpected number of arguments.\");\n }\n\n if (args.length == 0) {\n return {deep: false, name: \"\", value: \"\" });\n }\n\n if (args.length === 3) {\n return {deep: !!args[2], name: args[0], value: args[1]});\n }\n\n var lastValue = Array.prototype.pop.call(args);\n\n if ((lastValue === true) || (lastValue === false)) {\n if (!args.length) {\n return {deep: lastValue, name: \"\", value: \"\" };\n }\n\n if (args.length === 1 ) {\n return {deep: lastValue, name: \"\", value: args[0]};\n }\n\n if ( args.length === 2 ) {\n return {deep: lastValue, name: args[ 0 ], value: args[ 1 ]};\n }\n }\n\n if (args.length === 0) {\n return {deep: false, name: \"\", value: lastValue };\n }\n\n if ( args.length === 1 ) {\n return {deep: false, name: args[0], value: lastValue};\n }\n\n if ( args.length === 2 ) {\n return {deep: false, name: args[1], value: lastValue};\n }\n }", "title": "" }, { "docid": "9bf77a8674f0c36cd0d8a9492b0b222c", "score": "0.5290641", "text": "function processArrays(obj){\n for (var k in obj) {\n if (!obj.hasOwnProperty(k)) {\n continue;\n } else if (obj[k] instanceof Array){\n if ((obj[k].length == 2) && (typeof(obj[k][0]) == 'object') && ((typeof(obj[k][1])!='undefined') && (typeof(obj[k][1])!='object'))){\n obj[k][0][(k == 'audio' || k == 'image' || k == 'video') ? 'url' : 'value'] = obj[k][1];\n obj[k] = obj[k][0];\n }\n } else if (typeof obj[k] == \"object\"){\n processArrays(obj[k]);\n }\n }\n }", "title": "" }, { "docid": "de01038fbc0bcd14222825b17cd01254", "score": "0.5263919", "text": "function toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res;\n }", "title": "" }, { "docid": "de01038fbc0bcd14222825b17cd01254", "score": "0.5263919", "text": "function toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res;\n }", "title": "" }, { "docid": "4a4fbe3b616fa43b744d22e763d265de", "score": "0.5262803", "text": "function toObject(arr) {\n const res = {};\n for (let i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res;\n}", "title": "" }, { "docid": "bc657ddc792c9c5f295494c232a4887d", "score": "0.52578753", "text": "function createArrayFromObject() {\n var origSrc = originalSource($scope);\n $scope.$uisSource = Object.keys(origSrc).map(function(v) {\n var result = {};\n result[ctrl.parserResult.keyName] = v;\n result.value = origSrc[v];\n return result;\n });\n }", "title": "" }, { "docid": "9228a19819c84713cd32ef07ea0d3c53", "score": "0.5248099", "text": "function toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res;\n }", "title": "" }, { "docid": "49b4375de3897638a2bea5ac0f3478fa", "score": "0.5246258", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend$1(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "5cd9403278bca343b8406e9410e880b7", "score": "0.52454203", "text": "function getAsValueObject(resultMap) {\n let resultMapKeys =_.keys(resultMap.map());\n let primaryArrayValueKeys = resultMapKeys.filter(key => isPrimaryArrayValueKey(key, resultMap.map()));\n // if resultMap consists of only primary NCs with array value types\n // wrap in object and combine all into single csv for key and value (nc and nameSrc)\n if (resultMapKeys.length === primaryArrayValueKeys.length) {\n\tlet key = resultMapKeys.sort().toString();\n\t// [0] to extract the \"first element\" (nc) from something that looks like: [{ name: 'bean', count: 11 }]\n\tlet value = resultMapKeys.map(key => resultMap.map()[key][0].toString()).sort().toString();\n\treturn { [key]: [`${value}`] };\n }\n // if resultMap consists of one or more primary NCs + at least one compound NCs (we could/should confirm this)\n // wrap each primary array-value-type NC in an object\n return resultMapKeys.reduce((obj, key) => {\n\tif (isPrimaryArrayValueKey(key, resultMap.map())) {\n\t obj[key] = { [key]: resultMap.map()[key] };\n\t} else {\n\t obj[key] = resultMap.map()[key];\n\t}\n\treturn obj;\n }, {});\n}", "title": "" }, { "docid": "8ff25df171cce0842fbad9fbbc838620", "score": "0.52439237", "text": "normalizeFilesArray(files) {\n const result = [];\n for (let i = 0; i < files.length; i++) {\n let entry = files[i];\n //skip falsey and blank entries\n if (!entry) {\n continue;\n //string entries\n }\n else if (typeof entry === 'string') {\n result.push(entry);\n //objects with src: (string | string[])\n }\n else if ('src' in entry) {\n //validate dest\n if (entry.dest !== undefined && entry.dest !== null && typeof entry.dest !== 'string') {\n throw new Error(`Invalid type for \"dest\" at index ${i} of files array`);\n }\n //objects with src: string\n if (typeof entry.src === 'string') {\n result.push({\n src: util_1.util.standardizePath(entry.src),\n dest: util_1.util.standardizePath(entry.dest)\n });\n //objects with src:string[]\n }\n else if ('src' in entry && Array.isArray(entry.src)) {\n //create a distinct entry for each item in the src array\n for (let srcEntry of entry.src) {\n result.push({\n src: util_1.util.standardizePath(srcEntry),\n dest: util_1.util.standardizePath(entry.dest)\n });\n }\n }\n else {\n throw new Error(`Invalid type for \"src\" at index ${i} of files array`);\n }\n }\n else {\n throw new Error(`Invalid entry at index ${i} in files array`);\n }\n }\n return result;\n }", "title": "" }, { "docid": "c74de00ccd54f9e0d51fe0d62e484103", "score": "0.5239053", "text": "valuesToParams(values) {\n return values.reduce((params, val, i) => {\n if (val === undefined) return params\n return Object.assign(params, {\n [this.keys[i].name]: decodeURIComponent(val)\n })\n }, {})\n }", "title": "" }, { "docid": "1b524b7b89008d176ca8af2905399eef", "score": "0.52387506", "text": "function arrayToSet(xs) {\n var s = {};\n for (var i = 0; i < xs.length; i++) {\n\ts[JSON.stringify(xs[i])] = xs[i];\n }\n return s;\n}", "title": "" }, { "docid": "be3e7ab17c71e60bfa9522be43ca7330", "score": "0.5237004", "text": "function toObject(arr: any) {\n const obj = {};\n for (let pair of arr) {\n obj[pair[0]] = pair[1];\n }\n return obj;\n}", "title": "" }, { "docid": "367ef4eb39959eadd8ee0a1a9174f4af", "score": "0.5231956", "text": "static arrayToObject(arr, fieldname, obj) {\n obj = obj || {};\n fieldname = fieldname || 'id';\n if( Array.isArray(arr) && !BaseUtils.isEmpty(arr)) {\n for( let i = 0; i < arr.length; i ++ ) {\n let item = arr[i];\n if( item && item[fieldname]) {\n obj[fieldname] = item;\n }\n }\n }\n return obj;\n }", "title": "" }, { "docid": "4501f748cb4d1ca983a88e78a190373b", "score": "0.5212658", "text": "function toObject(arr) {\n\t var res = {};\n\t for (var i = 0; i < arr.length; i++) {\n\t if (arr[i]) {\n\t extend(res, arr[i]);\n\t }\n\t }\n\t return res;\n\t}", "title": "" }, { "docid": "734abb90c634593a6f60581fb1dde8b9", "score": "0.52118343", "text": "function convertToObject(unknownTypedInput, valueFunc = undefined) {\n let obj = {};\n if (typeof unknownTypedInput !== 'undefined') {\n if (typeof unknownTypedInput === 'string') {\n unknownTypedInput = [unknownTypedInput];\n }\n if (_.isArray(unknownTypedInput)) {\n for (const element of unknownTypedInput) {\n let value;\n if (typeof valueFunc !== 'undefined') {\n value = valueFunc(element);\n }\n else {\n value = undefined;\n }\n obj[element] = value;\n }\n }\n else {\n obj = _.cloneDeep(unknownTypedInput);\n }\n }\n return obj;\n}", "title": "" }, { "docid": "a41e11de94a12a584e0fa7ed00606ef4", "score": "0.5211048", "text": "function flatten( res ) {\n return res.map( function( entry ){\n var keys = Object.keys( entry ),\n res = {}\n for( var i=0; i<keys.length; i++ ) {\n \n // convert types, if given\n switch( entry[ keys[i] ]['datatype'] ) {\n\n // boolean\n case 'http://www.w3.org/2001/XMLSchema#boolean':\n res[ keys[i] ] = entry[ keys[i] ]['value'] == 'true';\n break;\n\n // number\n case 'http://www.w3.org/2001/XMLSchema#integer':\n res[ keys[i] ] = parseInt( entry[ keys[i] ]['value'], 10 );\n break;\n\n case 'http://www.w3.org/2001/XMLSchema#float':\n res[ keys[i] ] = parseFloat( entry[ keys[i] ]['value'] );\n break;\n\n // nothing found\n default:\n res[ keys[i] ] = entry[ keys[i] ]['value'];\n\n }\n }\n \n return res;\n })\n}", "title": "" }, { "docid": "43f667a724811cd1f0f11795bb1912b2", "score": "0.5210985", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "c4e5491f891a12c010efb563536b7b79", "score": "0.52054983", "text": "function createObject(array) {\n const result = {\n numbers: [],\n booleans: [],\n strings: []\n }\n for (let i = 0; i < array.length; i++) {\n const v = array[i];\n if (typeof v === \"number\") {\n result.numbers.push(v);\n } else if (typeof v === \"boolean\") {\n result.booleans.push(v);\n } else if (typeof v === \"string\") {\n result.strings.push(v);\n }\n }\n return result;\n}", "title": "" }, { "docid": "649cfa218c679d411337f6bf1585f4c4", "score": "0.5205163", "text": "function clean(obj) {\n var newObj = Array.isArray(obj) ? [] : {};\n Object.keys(obj).forEach(function (key) {\n if (obj[key] && typeof obj[key] === 'object') {\n var newVal = clean(obj[key]);\n if (!_isObjectEmpty_1[\"default\"](newVal) && newVal.length !== 0) {\n newObj[key] = newVal;\n }\n }\n else if (obj[key] !== null) {\n newObj[key] = obj[key];\n }\n });\n return newObj;\n}", "title": "" }, { "docid": "e097c764bd6912984f248a41ae77f257", "score": "0.5204732", "text": "function processParams(params) {\r\n var newParams = {};\r\n Object.keys(params).forEach(function (key) {\r\n var param = params[key];\r\n if (param && param.toParam) {\r\n param = param.toParam();\r\n }\r\n if (!param &&\r\n param !== 0 &&\r\n typeof param !== \"boolean\" &&\r\n typeof param !== \"string\") {\r\n return;\r\n }\r\n var type = param.constructor.name;\r\n var value;\r\n // properly encodes objects, arrays and dates for arcgis.com and other services.\r\n // ported from https://github.com/Esri/esri-leaflet/blob/master/src/Request.js#L22-L30\r\n // also see https://github.com/Esri/arcgis-rest-js/issues/18:\r\n // null, undefined, function are excluded. If you want to send an empty key you need to send an empty string \"\".\r\n switch (type) {\r\n case \"Array\":\r\n // Based on the first element of the array, classify array as an array of objects to be stringified\r\n // or an array of non-objects to be comma-separated\r\n value =\r\n param[0] &&\r\n param[0].constructor &&\r\n param[0].constructor.name === \"Object\"\r\n ? JSON.stringify(param)\r\n : param.join(\",\");\r\n break;\r\n case \"Object\":\r\n value = JSON.stringify(param);\r\n break;\r\n case \"Date\":\r\n value = param.valueOf();\r\n break;\r\n case \"Function\":\r\n value = null;\r\n break;\r\n case \"Boolean\":\r\n value = param + \"\";\r\n break;\r\n default:\r\n value = param;\r\n break;\r\n }\r\n if (value || value === 0 || typeof value === \"string\") {\r\n newParams[key] = value;\r\n }\r\n });\r\n return newParams;\r\n }", "title": "" }, { "docid": "4c72282f98a94de0c6f801883ae26bcd", "score": "0.5202586", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "4c72282f98a94de0c6f801883ae26bcd", "score": "0.5202586", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "4c72282f98a94de0c6f801883ae26bcd", "score": "0.5202586", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "4c72282f98a94de0c6f801883ae26bcd", "score": "0.5202586", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "4c72282f98a94de0c6f801883ae26bcd", "score": "0.5202586", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "4c72282f98a94de0c6f801883ae26bcd", "score": "0.5202586", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "4c72282f98a94de0c6f801883ae26bcd", "score": "0.5202586", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "4c72282f98a94de0c6f801883ae26bcd", "score": "0.5202586", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "4c72282f98a94de0c6f801883ae26bcd", "score": "0.5202586", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "4c72282f98a94de0c6f801883ae26bcd", "score": "0.5202586", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "223a635a666de0185db8caaa242605ab", "score": "0.519187", "text": "getTransformedData(variable, data) {\n const operationResult = variable.operation + 'Result'; // when output is only string it is available as oprationNameResult\n const tempResponse = data[operationResult];\n // in case data received is value as string then add that string value to object and convert object into array\n if (tempResponse) {\n const tempObj = {};\n _.set(tempObj, operationResult, tempResponse);\n data = [tempObj]; // convert data into an array having tempObj\n }\n else {\n // in case data received is already an object then convert it into an array\n data = [data];\n }\n return data;\n }", "title": "" }, { "docid": "288722339d0151efac51c0ff3eb1c70c", "score": "0.51916075", "text": "transformValues(values) {\n const newObj = {}\n\n for (let key in values) {\n const rawValue = values[key]\n const transform = this.settings.transforms[rawValue]\n const value = this.settings.transforms.hasOwnProperty(rawValue)\n ? typeof transform === 'function' ? transform(rawValue, values) : transform\n : this.escape(rawValue)\n\n newObj[key] = value\n }\n\n return newObj\n }", "title": "" }, { "docid": "2bfa503a2c9660206fa8fe69c44c423f", "score": "0.51848733", "text": "function condenseArray(data) {\n // goes though and colapses the objects into arrays\n return data.map(function (info) {\n return [info.key, info.value];\n }).reduce(function (a, b) {\n //takes the arrays and throws it into an object matching each arrays key with its value\n var keyItem = a[b[0]];\n // determines if there is already a value in that key.\n // if there is no existing value, it inputs the matching item\n // if a value already exists it appends this item to an array with the other existing value(s); \n if (keyItem !== undefined) {\n if (Array.isArray(keyItem)) {\n a[b[0]].push(b[1]);\n } else {\n a[b[0]] = [a[b[0]], b[1]];\n }\n\n } else {\n a[b[0]] = b[1]\n }\n return a;\n\n }, {});\n}", "title": "" }, { "docid": "8a5a4711139b57a7be3e06446cabc2ca", "score": "0.5177015", "text": "prepArr(arr) {\n\t\t// convert the string array to an array of four arrays\n\t\treturn arr.map(val => val.match(/\\d/g));\n\t}", "title": "" }, { "docid": "18ec3e8d4302f2594a5ca8fa97a82b12", "score": "0.51755524", "text": "static fromParams(value)\n {\n if ( Any.isEmpty(value) ) {\n return {};\n }\n\n let matches = value.match(/(^|&)(\\s*(.*?)\\s*=\\s*(\".*?\"|'.*?'|.*?)\\s*)(?=&|$)/g);\n\n return Arr.reduce(matches || [], (result, match) => {\n\n // Get key and value from match\n let attr = match.match( /^&?\\s*(.*?)\\s*=\\s*(\".*?\"|'.*?'|.*?)\\s*$/);\n\n // Skip if length does not match\n if ( attr.length === 3 ) {\n Obj.set(result, attr[1].replace(/(\\]\\[|\\[|\\])/g, '.').replace(/\\.$/, ''),\n Str.real(attr[2].replace(/(^[\"']*|[\"']*$)/g, '')));\n }\n\n return result;\n }, {});\n }", "title": "" }, { "docid": "a407a720fe0c22ccd0bf49beb900b873", "score": "0.5172405", "text": "function solve(input) {\n let propList = JSON.parse(input);\n\n let result = propList.reduce((a, x) => ({...a, ...x}), {});\n \n return result;\n}", "title": "" }, { "docid": "f131eb263a2d7037993e236171217040", "score": "0.5165646", "text": "transformToArray(value) {\n let result = [];\n if (value) {\n switch (typeof value) {\n case 'number':\n result = this.transformNumberToArray(value);\n break;\n case 'string':\n result = this.transformStringToArray(value);\n break;\n case 'object':\n result = this.transformObjectToArray(value);\n break;\n }\n }\n return result;\n }", "title": "" }, { "docid": "57258af74097deab5aa5222e324bf9ba", "score": "0.5160595", "text": "function separateTypes(input) {\n let x = {number : [], string : [], boolean : []};\n for (let i=0; i<input.length; i++){\n if (typeof input[i] == 'number' ){\n x.number.push(input[i])\n }\n if (typeof input[i] == 'string'){\n x.string.push(input[i])\n }\n if (typeof input[i] == 'boolean'){\n x.boolean.push(input[i])\n }\n }\n for (let key in x)\n if(x[key].length == 0){\n delete(x[key])\n } \n return x\n }", "title": "" }, { "docid": "28eb69899f7e0c9469eb196c1d1807e6", "score": "0.5147544", "text": "_normalizeObject(rules) {\n const validations = {};\n Object.keys(rules).forEach(rule => {\n let params = [];\n if (rules[rule] === true) {\n params = [];\n } else if (Array.isArray(rules[rule])) {\n params = rules[rule];\n } else {\n params = [rules[rule]];\n }\n validations[rule] = params;\n if (date.installed && this._isADateRule(rule)) {\n validations[rule].push(this._getDateFormat(validations));\n }\n });\n\n return validations;\n }", "title": "" } ]
9f3bc4c428073232941cdc4b2f0c6de8
Clients Show Assign For Allows the teacher to assign a client to a student. Disables the assign button.
[ { "docid": "0cc1e484c10a2cb51e487c43767eb1fd", "score": "0.57795215", "text": "function dState(){ if ($(\"#assignClient\").is(\":enabled\")) $(\"#assignClient\").prop(\"disabled\", true); }", "title": "" } ]
[ { "docid": "5a30c3b852107f53e35901e5d74b070f", "score": "0.55670047", "text": "function eState(enable){\r\n enable = typeof enable !== 'undefined' ? enable : -1;\r\n if ($(\"#assignClient\").is(\":disabled\") && enable != 0)\r\n $(\"#assignClient\").prop(\"disabled\", false);\r\n }", "title": "" }, { "docid": "c7a479200f00ff7d0274dd53ba732d69", "score": "0.5532952", "text": "function selectClient(evt) {\n\t\t\tmnuEditClient.set(\"disabled\", false);\n\t\t\tmnuMoveClient.set(\"disabled\", false);\n\t\t\tmnuDeleteClient.set(\"disabled\", false);\n\t\t\tctxMnuEditClient.set(\"disabled\", false);\n\t\t\tctxMnuMoveClient.set(\"disabled\", false);\n\t\t\tctxMnuDeleteClient.set(\"disabled\", false);\n\n\t\t\trefreshDataSection();\n\t\t}", "title": "" }, { "docid": "18af7eb74539f3020a375f9a7d418969", "score": "0.5129688", "text": "function displayStudentModalPrefect() {\n if (student.isPrefect === true) {\n clone.querySelector(\".prefect\").textContent = \"Revoke prefect\";\n modalCredentials.querySelector(\"p:nth-child(6)\").textContent = `Prefect status: ${student.firstName} is prefect!`;\n } else {\n modalCredentials.querySelector(\"p:nth-child(6)\").textContent = `Prefect status: ${student.firstName} is not prefect!`;\n clone.querySelector(\".prefect\").textContent = \"Prefect student\";\n }\n }", "title": "" }, { "docid": "f554c107168bfa1afdf94fe1af3c68ef", "score": "0.50992227", "text": "function showCadCliente() {\n\t\tif (document.frmCadCliente.txtCepConsultaPonto.value == \"\") {\n\t\t\talert(\"Por favor preencha o campo de Cep para Busca dos Pontos de Coleta!\");\n\t\t\treturn false;\n\t\t}\n\t\tif (checkChangePontoColeta()) {\n\t\t\tdocument.getElementById('tableCadClientePontoColeta').style.display = 'none';\n\t\t\tdocument.getElementById('tableCadCliente').style.display = 'block';\n\t\t} else {\n\t\t\talert(\"Escolha um Ponto de Coleta para que seja feita a Solicitação!\");\n\t\t}\n\t}", "title": "" }, { "docid": "56b4bdc746286f5007b68ea99745dd0c", "score": "0.50742096", "text": "function enable() {\n buttonReservation.removeAttribute(\"disabled\");\n }", "title": "" }, { "docid": "11f3473b3ac82e0b209e7436c907d711", "score": "0.50604224", "text": "function approved(e) {\n var parentElement = e.target.parentElement,\n courseID = parentElement.getAttribute(\"data-courseid\");\n\n database.ref(`Mark's Tool/${courseID}`).update({\n status: \"Designer Approved\"\n })\n\n e.target.style.display = \"none\";\n }", "title": "" }, { "docid": "41fd36fb3d9e197107ea3dde0eb96445", "score": "0.50248355", "text": "function showEdit(){\n\tdocument.getElementById(\"editProfileSec\").style.display = \"block\";\n\tdocument.getElementById(\"showCltProfile\").style.display = \"none\";\n\n\tvar currCltUsername = document.getElementById(\"clientUname\").innerHTML;\n\tvar currCltEmail = document.getElementById(\"clientEmail\").innerHTML;\n\tvar currCltAccType = document.getElementById(\"accType\").innerHTML;\n\tvar currCltFullName= document.getElementById(\"clientName\").innerHTML;\n\tvar currCltPassportIC = document.getElementById(\"clientPassportIC\").innerHTML;\n var currCltAbt = document.getElementById(\"clientAbout\").innerHTML;\n var currCltPhone = document.getElementById(\"clientPhone\").innerHTML;\n var currCltAddress = document.getElementById(\"clientAddress\").innerHTML;\n\tdocument.getElementById(\"clientUname2\").innerHTML = currCltUsername; \n\tdocument.getElementById(\"clientEmail2\").innerHTML = currCltEmail; \n\tdocument.getElementById(\"accType2\").innerHTML = currCltAccType;\t\n\tdocument.getElementById(\"clientName2\").innerHTML = currCltFullName; \n document.getElementById(\"clientPassportIC2\").innerHTML = currCltPassportIC; \n\tdocument.getElementById(\"clientAbout2\").innerHTML = currCltAbt; \n\tdocument.getElementById(\"clientPhone2\").innerHTML = currCltPhone; \n\tdocument.getElementById(\"clientAddress2\").innerHTML = currCltAddress; \n}", "title": "" }, { "docid": "837c2305d2d2ea24d05a3576ab67a271", "score": "0.50046456", "text": "function openClientsOrganizer() {\n organizerClientsOpen=false;\n}", "title": "" }, { "docid": "271131c2bf62a2301f8b68acfe2d555c", "score": "0.49912295", "text": "function setLimitTimeAndExpensesFalseClient(type, name)\n{\n\tif (isAdvancedJobsOn())\n\t{\n\t\tif (name == 'custentity_oa_export_to_openair')\n\t\t{\n\t\t\tif (nlapiGetFieldValue('custentity_oa_export_to_openair') == 'T')\n\t\t\t{\n\t\t\t\tnlapiSetFieldValue('limittimetoassignees', 'F', false, true);\n\t\t\t nlapiDisableField('limittimetoassignees', true);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t nlapiDisableField('limittimetoassignees', false);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2a5da40391b6d7539bd2e9d518f9532d", "score": "0.49630907", "text": "function displaySignUp() {\n document.getElementById('id01').style.display='block';\n document.getElementById(\"signupbtn\").disabled = true;\n document.getElementById('id01').style.display='block';\n}", "title": "" }, { "docid": "a82c4b871f0c48a9e5cc66aad06d6b38", "score": "0.49190214", "text": "function displayE(){\n document.getElementById(\"easyAssignments\").style.display = \"block\";\n document.getElementById(\"mediumAssignments\").style.display = \"none\";\n}", "title": "" }, { "docid": "8fd4ccdb0399262f729912a181494705", "score": "0.4911088", "text": "function showDoctorEditDisplay()\n {\n $scope.reset();\n staffControllerVM.isVisibleDoctorEditDisplay = true;\n staffControllerVM.isVisibleDoctorEdit = false;\n\n }", "title": "" }, { "docid": "0a152f32106a85a0fad08968d5a65f29", "score": "0.4893791", "text": "function discourage_edit(){\n var count = document.getElementById('usercount');\n if (count != undefined){\n alert(\"There are people using this stage -- don't edit it now!\");\n\n var elements = document.forms[0].elements;\n var i, e;\n for (i = 0; i < elements.length; i++){\n e = elements[i];\n e.disabled = true;\n }\n var enable = document.createElement(\"a\");\n enable.href = \"#\";\n enable.innerHTML = \" <b>Ignore users and edit this stage</b>\";\n enable.onclick = function(){\n for (i = 0; i < elements.length; i++){\n e = elements[i];\n e.disabled = false;\n }\n enable.style.display = 'none';\n return false;\n }\n count.appendChild(enable);\n }\n}", "title": "" }, { "docid": "c7a41aa801a1f25285f983f7fd85a2b1", "score": "0.4876612", "text": "function showSubjectListForm() {\r\n document.getElementById('TB_overlay').style.display = 'block';\r\n document.getElementById('subjectlistdiv').style.display = 'block';\r\n document.getElementById('subjectlistdiv').style.visibility = 'visible';\r\n }", "title": "" }, { "docid": "8e064f048b078f5275dca8624380acb4", "score": "0.48744875", "text": "function careerClick() {\n if (core || all || chosen) { // If any other tab is currently open, set them to false and show career specific courses\n setAll(false);\n setCore(false);\n setCareer(true);\n setChosen(false);\n }\n }", "title": "" }, { "docid": "104bb43d0e273f2f9705fd88014086a1", "score": "0.48726618", "text": "function toggleRecommencerBtn()\n {\n if (polylineForSelectSelectedArray.length > 0)\n btnRecommencer.disabled = false; \n else\n btnRecommencer.disabled = true;\n }", "title": "" }, { "docid": "e23d6fda392bab3692deb4dd2ec110e6", "score": "0.48266774", "text": "function feedbackButton() {\n $( '#age-selector-response .thank-you' ).show();\n $( '#age-selector-response .helpful-btn' )\n .attr( 'disabled', true )\n .addClass( 'btn__disabled' ).hide();\n}", "title": "" }, { "docid": "ed4ea284d3ef7db8bbaba352e5626065", "score": "0.4817655", "text": "function toggleSendRegistrationKeysConfirmation(courseID) {\n return confirm(\"Usually, there is need to use this feature because TEAMMATES\" +\n \" sends an automatic invite to students at the opening time of\" +\n \" each session. Send a join request to all yet-to-join students in \" +\n courseID + \" anyway?\");\n}", "title": "" }, { "docid": "92bf7f99c2260eafe12fa1257359c130", "score": "0.4796242", "text": "function showRole() {\n $ctrl.player = $ctrl.players[$ctrl.index];\n }", "title": "" }, { "docid": "02d5b38ca3fee70a48be08792a32544b", "score": "0.4793106", "text": "showButtons(valutation, assignment) {\n\n let stateCurrentAssignment = '';\n //Set stateCurrentAssignment to the current state of the assignment\n this.state.assignments.forEach(assignment => {\n if (valutation.assignment_id === assignment.id) {\n stateCurrentAssignment = assignment.state;\n }\n })\n\n if (stateCurrentAssignment === 'Booked') {\n return (\n <div style={{ position: 'relative', right: '50px' }}>\n <CustomButton\n block\n bsStyle='success'\n onClick={\n () => {\n\n this.setState({\n operationToConfirm: 'Assegna incarico',\n selectedValutation: valutation,\n selectedAssignment: assignment,\n })\n\n this.setShowConfirm();\n\n\n }\n }\n >\n Assegna incarico\n </CustomButton>\n </div>\n )\n }\n else if (stateCurrentAssignment === 'Unassigned') {\n let showSendRequestButton = false;\n \n this.state.assignments.forEach(el => {\n \n if (el.id === assignment.id) {\n console.log('Ciao')\n if (el.student == null || el.student === '') {\n \n showSendRequestButton = true;\n }\n }\n })\n if (showSendRequestButton) {\n return (\n <div style={{ position: 'relative', right: '50px' }}>\n <CustomButton\n block\n bsStyle='success'\n onClick={\n () => {\n\n this.setState({\n operationToConfirm: 'Invia richiesta',\n selectedValutation: valutation,\n selectedAssignment: assignment,\n })\n\n this.setShowConfirm();\n\n\n }\n }\n\n >\n Invia richiesta\n </CustomButton>\n </div>\n )\n }\n else {\n return (\n <div style={{ position: 'relative', right: '50px' }}>\n <CustomButton\n block\n bsStyle='warning'\n disabled\n >\n Nessun operazione\n </CustomButton>\n </div>\n )\n }\n\n }\n else {\n return (\n <div style={{ position: 'relative', right: '50px' }}>\n <CustomButton\n block\n bsStyle='warning'\n disabled\n >\n Nessun operazione\n </CustomButton>\n </div>\n )\n }\n }", "title": "" }, { "docid": "947b4c3e11d19bc828bddef8d445c4fb", "score": "0.47918543", "text": "function displayPendingClient(req, res, next){\n var db = require('../../lib/database')();\n db.query(\"SELECT *, CONCAT(strFName,' ', strLName) AS strName FROM tbluser WHERE strType='Client' AND strStatus = 'Unregistered' \", function (err, results) {\n if (err) return res.send(err);\n req.displayPendingClient = results;\n return next();\n });\n}", "title": "" }, { "docid": "4066d33f7619d466d4b39091ec535537", "score": "0.47700462", "text": "function showMyOffers() {\n\t// reset selectedID (account could have been deleted in meantime)\n\t// selectedOffer mit selectedItem ersetzt, da es sich um Offer UND Applicant\n\t// handelt\n\tselectedItem = null;\n\ttoggleWarning(\"error_noOfferSelected\", true, \"Kein Angebot selektiert!\");\n\tprepareButton();\n\tconnect(\"/hiwi/Clerk/js/showMyOffers\", \"\", handleShowMyOffersResponse);\n}", "title": "" }, { "docid": "906c2246fd456aa2dc9ac31d6a2e8df5", "score": "0.476915", "text": "function allowUserToEdit() {\n // console.log('user to edit:', usersShow.user.id);\n // console.log('currentUser:', currentUserId);\n if (usersShow.user.id === currentUserId) {\n usersShow.editable = true;\n }\n }", "title": "" }, { "docid": "4133177c3f8e43aa36cf21c28ca871e1", "score": "0.47536528", "text": "function togglePrefect() {\n // the long version of the toggle:\n /* if (student.prefect === true) {\n student.prefect = false;\n } else {\n student.prefect = true;\n } */\n // the short version of the code above\n activeModalStudent.prefect = !activeModalStudent.prefect;\n // refresh the modal\n openModal();\n}", "title": "" }, { "docid": "142a79aaddbef479939335ac61c75794", "score": "0.4750347", "text": "enable() {\n\t\tthis.toggle(true);\n\t}", "title": "" }, { "docid": "15852455d74dedc5b7766fd8bf0a0da4", "score": "0.47502577", "text": "function handleSelection(choice) {\n // document.getElementById('usertype').disabled=false;\n document.getElementById(choice).style.display=\"block\";\n \n}", "title": "" }, { "docid": "62c82f5216b2344f7a1a0ca0d4ea5c19", "score": "0.47413653", "text": "function toggleSendRegistrationKey(courseID, email) {\n return confirm(\"Usually, there is need to use this feature because TEAMMATES \" +\n \"sends an automatic invite to students at the opening time of each\" +\n \" session. Send a join request anyway?\");\n}", "title": "" }, { "docid": "b3761e47f274feeff23673db68afab73", "score": "0.4737013", "text": "function toggle(on){\n assign(document.getElementById(\"btn-edit\"), on ? \"none\":\"block\");\n assign(document.getElementById(\"btn-submit\"), on ? \"none\":\"block\");\n assign(document.getElementById(\"btn-update\"), on ? \"block\":\"none\");\n assign(document.getElementById(\"btn-cancel\"), on ? \"block\":\"none\");\n assign(document.getElementById(\"btn-delete\"), on ? \"block\":\"none\");\n}", "title": "" }, { "docid": "82f60d7fe91dfb6be84af34a270a0d71", "score": "0.47269207", "text": "function handleSelection(choice) {\r\n document.getElementById('usertype').disabled=true;\r\n document.getElementById(choice).style.display=\"block\";\r\n}", "title": "" }, { "docid": "777fdf5ba6cf954198953252e68da793", "score": "0.47215283", "text": "function handleClick() {\n setShowUserProfile((!showUserProfile))\n }", "title": "" }, { "docid": "4c408449d60e0040ccb262acdbd08dba", "score": "0.47032318", "text": "function displayClientRoles() {\n var list = '';\n if(vm.clientmanagement.clientrolesFoster)\n list += 'Foster, ';\n if(vm.clientmanagement.clientrolesStaff)\n list += 'Staff, ';\n if(vm.clientmanagement.clientrolesSponsor)\n list += 'Sponsor, ';\n if(vm.clientmanagement.clientrolesVeteran)\n list += 'Veteran, ';\n if(vm.clientmanagement.clientrolesVolunteer)\n list += 'Volunteer, ';\n return list.slice(0,list.length-2);\n }", "title": "" }, { "docid": "4c8679a0ce84d3e5ac827fba611fc95a", "score": "0.46975732", "text": "async function getAssignment(event) {\n setIsLoading(true);\n setMessageView(true);\n const bodyParam = {\n body: {\n oid: config.aws_org_id,\n pid: pid,\n bpid: bpid,\n bcid: ttitle[event.target.value].bcid,\n cid: ttitle[event.target.value].tid,\n quiztype: \"assign\",\n eid: userDetails.eid,\n },\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\",\n },\n };\n try {\n const response = await API.post(\n config.aws_cloud_logic_custom_name,\n Constants.GET_USER_ASSIGN_ASSESS,\n bodyParam\n );\n if (response === undefined || response === null || response[\"errorType\"] === \"TypeError\" || Object.keys(response).length === 0) {\n setCourseData(null);\n setIsLoading(false);\n }\n else {\n setCourseData(response);\n setIsLoading(false);\n }\n } catch (error) {\n console.error(error);\n }\n }", "title": "" }, { "docid": "dbf319bfa3f05bf7e0bd58e9c15b0c58", "score": "0.46966267", "text": "function toggleClientUsersFromAssignedToFields (e) {\n var self = $(this);\n var isChecked = self.is(':checked');\n\n var user_id = self.val();\n\n var fields = $('#post select.o-select2[name$=\"[assigned_to][]\"]');\n var existentOptions = fields.find('option[value=\"' + user_id + '\"]');\n\n if (isChecked) {\n if (existentOptions.length === 0) {\n var user_name = $('label', self.parent()).text().trim();\n\n var newOption = new Option(user_name, user_id, false, false);\n\n fields.append(newOption).trigger('change');\n }\n } else {\n if (existentOptions.length > 0) {\n existentOptions.remove();\n fields.trigger('change');\n }\n }\n }", "title": "" }, { "docid": "68158e1f5175fbe903d439e6b9a5f066", "score": "0.46763012", "text": "function enabledDisableCompareBtn(){\n showCompareCount();\n if(srvObj.selSrv.length > 1){\n $('#goToComparePage').prop('disabled',false);\n }else\n //$('#compareCounter').hide();\n $('#goToComparePage').prop('disabled',true);\n}", "title": "" }, { "docid": "69957d590fe5d858f5646f0fe3e56d7a", "score": "0.4666914", "text": "function setAssignName()\n\t{\n\t\tvar name = 'Student and Overall Grade Report';\n\n\t\tvw.drawList.setParam('aName', 'text', name);\n\t}", "title": "" }, { "docid": "5cf319c981b973043567ef45def55a1a", "score": "0.4655631", "text": "function renderClientsPending(req,res){\n if(req.valid==0)\n res.render('admin/views/client_maintenance/pending',\n {\n usertab: req.user,\n itemtab: req.displayPendingClient,\n requirementtab: req.requirement\n });\n else if(req.valid==1)\n res.render('admin/views/invalidpages/normalonly');\n else\n res.render('login/views/invalid');\n\n}", "title": "" }, { "docid": "eea72f95b7d3d04e3c002689cf3b3698", "score": "0.46485725", "text": "function ShowCommunityButton() {\n\tvar community_panel = $.GetContextPanel().FindChildTraverse(\"CommunityPanel\");\n\t\n\tcommunity_panel.ToggleClass('invisible')\n}", "title": "" }, { "docid": "4b91dbef5bb3dc330f616641aa0240a4", "score": "0.46478757", "text": "function renderOtherJobRole(enable = true) {\n if (enable) {\n document.querySelector(\"#other-job-role\").style.display = \"\";\n } else {\n document.querySelector(\"#other-job-role\").style.display = \"none\";\n }\n \n}", "title": "" }, { "docid": "7abffe8781514f709318f7ee765889de", "score": "0.46469826", "text": "function OnAutoAssignPressed()\n{\n\t// Assign all of the currently unassigned players to a team, trying\n\t// to keep any players that are in a party on the same team.\n\tGame.AutoAssignPlayersToTeams();\n}", "title": "" }, { "docid": "f88a683661feffe17a47860c5d33971e", "score": "0.46317336", "text": "function chosenClick() {\n if (core || all || career) { // If any other tab is currently open, set them to false and show user's chosen courses\n setAll(false);\n setCore(false);\n setCareer(false);\n setChosen(true);\n }\n }", "title": "" }, { "docid": "b861be7ea86220dc8d8c8b07371dd7e2", "score": "0.46233177", "text": "function denyTournament() {\n\tdocument.getElementById('askTournament').style.display = \"none\";\n\tvar data = JSON.stringify({\n\t\t'name' : PlayerName,\n\t\t'participate_tournament' : false\n\t});\n\tsocketConn.send(data);\n\tvar serverMsg = document.getElementById('serverMsg');\n\tserverMsg.value += (\"\\n> waiting for other players to finish tournament\");\n}", "title": "" }, { "docid": "6993c48f2ebb8ba70af662747a5711ed", "score": "0.46211147", "text": "disableSharing(){\n\t\tthis.props.actions.disableSharing(this.props.selectedWorkstations);\n\t}", "title": "" }, { "docid": "ade2fc25c9c8b9636f58076b0d3b937e", "score": "0.46109682", "text": "changeMode() {\n this.attendBooths = !this.attendBooths;\n }", "title": "" }, { "docid": "86fd764ce66f0f2d3627374e14096eb1", "score": "0.4604586", "text": "function showComMove(computerSelection) {\n\tvar textBox = document.getElementById(\"p\")\n textBox.textContent = '';\n\tif(computerSelection === 1){\n\t\tcpuPaperObject.setAttribute('id', 'show');\n\t}\n\telse if (computerSelection === 2) {\n\t\tcpuRockObject.setAttribute('id', 'show');\n\t}\n\telse {\n\t\tcpuScissorObject.setAttribute('id', 'show');\n\t}\n}", "title": "" }, { "docid": "0737c114ef70a7e2cc46bca2692b653e", "score": "0.4603362", "text": "function doEditClient(e) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tif (this.isValid()) {\n\t\t\t\tclientRest.put(editClientForm.getValues()).then(function (data) {\n\t\t\t\t\tif (data.success) {\n\t\t\t\t\t\tif (data.new_client) {\n\t\t\t\t\t\t\tokDialog.set(\"title\", \"Cliente incluído com sucesso\");\n\t\t\t\t\t\t\tokDialogMsg.innerHTML = \"O cliente foi incluído com sucesso.\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tokDialog.set(\"title\", \"Cliente alterado com sucesso\");\n\t\t\t\t\t\t\tokDialogMsg.innerHTML = \"O cliente foi alterado com sucesso.\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar treeSel, group;\n\t\t\t\t\t\ttreeSel = groupsTree.get(\"selectedItem\");\n\t\t\t\t\t\tif (treeSel) {\n\t\t\t\t\t\t\tgroup = treeSel;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tgroup = { id: 0 };\n\t\t\t\t\t\t}\n\t\t\t\t\t\trefreshClientsGrid(group);\n\n\t\t\t\t\t\teditClientDialog.hide();\n\t\t\t\t\t\tokDialog.show();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (data.new_client) {\n\t\t\t\t\t\t\tokDialog.set(\"title\", \"Erro incluindo o cliente\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tokDialog.set(\"title\", \"Erro alterando o cliente\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tokDialogMsg.innerHTML = data.error;\n\t\t\t\t\t\tokDialog.show();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "8aa421320b876fd8d5e18d92a95cace1", "score": "0.45976794", "text": "function disable() {\n $scope.placeholderText = 'Sorry, I\\'m Temporarily Unavailable';\n $scope.idea = '';\n $scope.engineInfo = '';\n $scope.engineUrl = '';\n $scope.getFailed = true;\n }", "title": "" }, { "docid": "6f0d374076091478cd430abe23144fc5", "score": "0.45948416", "text": "function disappearAssign() {\n if (document.getElementById(\"modal1\").style.display == \"\") {\n document.getElementById(\"modal1\").style.display = \"none\";\n }else{\n document.getElementById(\"modal1\").style.display = \"\";\n }\n }", "title": "" }, { "docid": "2f588642182e2f02de0d3b43c990410d", "score": "0.45887145", "text": "function waitToggle() {\n subscriptionSwitch.disabled = true;\n subscriptionLabel.classList.add('is-disabled');\n}", "title": "" }, { "docid": "2462cd6dc24c453973b84b2890d5e1ae", "score": "0.4584078", "text": "enablePick() {\n this.pickEnabeled = true;\n }", "title": "" }, { "docid": "a3ccb06d4403c50283e8cddccae4ee8f", "score": "0.45834675", "text": "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}", "title": "" }, { "docid": "9e99c189e80377c782676d575ad93f9d", "score": "0.4581363", "text": "enable() {\n this._readonly = false;\n }", "title": "" }, { "docid": "77422e09055bc6b65dca60dd1f6351bf", "score": "0.45696545", "text": "function on_select_client(serial) {\n clear_div();\n //hide_div();\n $('#life_police_flg').val(\"\");\n $('#documents_flg').val(\"\");\n $('#communication_flg').val(\"\");\n // $('#conversation_follow_flg').val(\"\");\n $('#kupa_gemel_flg').val(\"\");\n client_details(serial);\n }", "title": "" }, { "docid": "302e3e8c93fd0d3ec37bd40f63a5125b", "score": "0.456851", "text": "function ReturningCustomer() {\n document.getElementById('ReturningCustomer').style.display = 'block';\n document.getElementById('ReturningButton').style.display = 'none'; \n document.getElementById('RegisterButton').style.display = 'none'; \n}", "title": "" }, { "docid": "f0828c028145b27e27352b0a03347d80", "score": "0.4567759", "text": "function clickPrefect() {\n if (student.prefect === true) {\n student.prefect = false;\n } else {\n tryToMakePrefect(student);\n }\n buildList();\n }", "title": "" }, { "docid": "db922d647d9e1bd0e8d68b63da348223", "score": "0.456723", "text": "function formEnable() {\n document.getElementById(\"fieldsetProfile\").removeAttribute(\"disabled\");\n document.getElementById(\"editProfileBtn\").classList.add(\"visually-hidden\");\n document.getElementById(\"updateProfileBtn\").classList.remove(\"visually-hidden\");\n }", "title": "" }, { "docid": "c17bef85ca418436891ab21fdbe09d09", "score": "0.4565633", "text": "function UpdateAttendee() {\n\tvar btnAddAttendee = document.getElementById(\"btnAddAttendee\");\n\tvar x = document.getElementById(\"UpdateAttendee\");\n\tif (x.style.display === \"none\") {\n\t\tx.style.display = \"block\";\n\t\tbtnAddAttendee.disabled = true;\n\t} else {\n\t\tx.style.display = \"\";\n\t\tbtnAddAttendee.disabled = false;\n\t}\n}", "title": "" }, { "docid": "4faf6febc783d9742537193fb689eacf", "score": "0.4565612", "text": "disable() {\n this._readonly = true;\n }", "title": "" }, { "docid": "1ea3f8165788399ff04dea7be401a724", "score": "0.45625117", "text": "function toggleCreateRoomForm() {\n $scope.showCreateRoomForm = !$scope.showCreateRoomForm;\n }", "title": "" }, { "docid": "bf60ff217b6550231b6432655c65cee6", "score": "0.45614132", "text": "function generateOn() {\n handleClearButton.disabled = true;\n handleReadTextButton.disabled = true;\n handleSubmitButton.disabled = false;\n}", "title": "" }, { "docid": "0c2a0dca7d701a84b902360a4932f9ee", "score": "0.4559873", "text": "function hidePopup(event) {\n props.setShowClients(false);\n }", "title": "" }, { "docid": "35b67a1706bc3bc3afdb4cdc34a01b16", "score": "0.45587698", "text": "enableConnectButton () {\n this.rsConnectButton.disabled = false;\n this.rsConnectButton.textContent = 'Connect';\n this.rsConnectButton.classList.remove('rs-connecting');\n }", "title": "" }, { "docid": "59585c8607f9ea0ca9db58490e0b8562", "score": "0.45521736", "text": "function deleteClient() {\n\t\t\tconfirmDialog(\"Confirma a exclusão\", \"Confirma a exclusão do cliente?\", function (btn) {\n\t\t\t\tif (btn) {\n\t\t\t\t\tvar client, clientId, clientName;\n\t\t\t\t\tclient = clientsGrid.selection.getSelected()[0];\n\t\t\t\t\tclientId = client.cf_codigo;\n\t\t\t\t\tclientName = client.pe_nome.trim();\n\n\t\t\t\t\tclientRest.remove(clientId).then(function (data) {\n\t\t\t\t\t\tif (data.success) {\n\t\t\t\t\t\t\tvar treeSel, group;\n\t\t\t\t\t\t\ttreeSel = groupsTree.get(\"selectedItem\");\n\t\t\t\t\t\t\tif (treeSel) {\n\t\t\t\t\t\t\t\tgroup = treeSel;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tgroup = { id: 0 };\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trefreshClientsGrid(group);\n\n\t\t\t\t\t\t\tokDialog.set(\"title\", \"Cliente excluído com sucesso\");\n\t\t\t\t\t\t\tokDialogMsg.innerHTML = \"O cliente <strong>\" + clientName + \"</strong> foi excluído com sucesso.\";\n\t\t\t\t\t\t\tokDialog.show();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tokDialog.set(\"title\", \"Erro excluindo o cliente\");\n\t\t\t\t\t\t\tokDialogMsg.innerHTML = data.error;\n\t\t\t\t\t\t\tokDialog.show();\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}", "title": "" }, { "docid": "d2b1de6556472648c3d5783e9be317fb", "score": "0.45504078", "text": "function cancelDeleteButton() {\n document.getElementById(\"sensitiveAccountsData\").style.display = \"block\";\n document.getElementById(\"addNewButton\").style.display = \"none\";\n }", "title": "" }, { "docid": "cd12679b92ac9ceee9f42fa3c1b239ce", "score": "0.45494527", "text": "function toggleSubmitAs(bShow)\n{\n if (bShow)\n { \n _SubmitAs.enabled();\n }\n else\n {\n _SubmitAs.append(\" \");\n _SubmitAs.disable();\n }\n}", "title": "" }, { "docid": "c3c15288ebd5aa4fdd17c6caeaabbaa6", "score": "0.4548758", "text": "function buttonText() {\n if (vm.clientmanagement.inactive) {\n return 'Activate';\n }\n else {\n return 'Deactivate';\n }\n }", "title": "" }, { "docid": "25ca6a242de98bf664fdd0ac657f3303", "score": "0.45483667", "text": "function funShowClients() {\n for (let i = 0; i < global.aryClients.length; i++) {\n try {\n mRU.funUpdateServerMonitor(\"Connection Code: \" + global.aryClients[i].strSocketID + \"&nbsp;&nbsp;&nbsp;User ID: \" + aryClients[i].userId, true);\n } catch (err) {\n //\n }\n }\n mRU.funUpdateServerMonitor(\"Total No. of Clients Connected: \" + global.aryClients.length, true);\n\n setTimeout(funShowClients, config.cintFunShowClients);\n}", "title": "" }, { "docid": "abe99f5147349435a6c2a13db112052f", "score": "0.4547987", "text": "function toggleDeleteStudentConfirmation(courseId, studentName) {\n return confirm(\"Are you sure you want to remove \" + studentName + \" from \" +\n \"the course \" + courseId + \"?\");\n}", "title": "" }, { "docid": "ffa6a491c5b93c45c85cdc5f16aeb1bf", "score": "0.4546542", "text": "unlock() {\n document.getElementById('blocker').style.display = 'block';\n document.getElementById('instructions').style.display = '';\n }", "title": "" }, { "docid": "6ea6081adce0a0eb41d73fdf8f1900b1", "score": "0.45453227", "text": "function displayIsInClientInfo() {\n if (liff.isInClient()) {\n document.getElementById('liffLoginButton').classList.toggle('hidden');\n document.getElementById('liffLogoutButton').classList.toggle('hidden');\n document.getElementById('isInClient').textContent = 'You are opening the app in the in-app browser of LINE.';\n } else {\n //document.getElementById('shareMeTargetPicker').classList.toggle('hidden');\n }\n}", "title": "" }, { "docid": "6f1a9014f876b5e33be8ae2129df9119", "score": "0.45441893", "text": "function disableConway() {\n\tconwayOn = false;\n\tconwayB.textContent = \"run\";\n\tbirthForm.disabled = false;\n\tsurvivalForm.disabled = false;\n\turlB.disabled = false;\n\tGB.disabled = false;\n\tDB.disabled = false;\n }", "title": "" }, { "docid": "ad11254b20c71caf777856834766cb8a", "score": "0.45421064", "text": "function forbiden(){\n\tdocument.getElementById(\"sub\").disabled = true;\n\tdocument.getElementById(\"A_choice\").disabled = true;\n\tdocument.getElementById(\"B_choice\").disabled = true;\n\tdocument.getElementById(\"C_choice\").disabled = true;\n\tdocument.getElementById(\"D_choice\").disabled = true;\n}", "title": "" }, { "docid": "43b742063a2bf2021577a76cfca196e2", "score": "0.4535495", "text": "function control_consent() {\n if (refUser.get('state').get('consentResponse') == 'agree'){\n // The user already gave his consent\n return true;\n } else{\n // Get user's consent or remind him that we need it\n if (refUser.get('state').get('consentResponse') == 'disagree'){\n $scope.showConsent = true;\n } else{\n $scope.showConsentForm();\n }\n return false;\n }\n\n }", "title": "" }, { "docid": "c5212b0367db7859ab1ff4d02978747f", "score": "0.4535218", "text": "function joinCommunity() {\n if (document.getElementById('join-community')) {\n let join = document.getElementById('join-community');\n join.innerHTML = `<i class=\"fas fa-check\" aria-hidden=\"true\"></i>&nbsp;Subscribe`;\n join.classList.remove('btn-orange');\n join.classList.add('btn-success');\n join.removeAttribute('onclick');\n join.disabled = true;\n }\n}", "title": "" }, { "docid": "2cdb4488ec56e584372a587dde687e93", "score": "0.45350388", "text": "function showAssignedUserTasks() {\n\t// alert(\"Inside Reassign\");\n\t$.ajax({\n\t\ttype : \"GET\",\n\t\turl : \"adminTemplate/getUsers\",\n\t\tcache : false,\n\t\tsuccess : function(data) {\n\t\t\t$(\"#showDynamicContent\").html(\"\");\n\t\t\t$(\"#dynamicContent\").html(data);\n\t\t\t$(\"#trayLabelDiv\").hide();\n\t\t}\n\t});\n\n}", "title": "" }, { "docid": "d74b34d97b539c12965e59d88101b3eb", "score": "0.45293513", "text": "function disableInsConsButton() {\t\t\n\tvar xbutton = document.getElementById(\"insconsbutton\");\n\tif( xbutton != undefined ){\n\t\tdocument.getElementById(\"insconsbutton\").setAttribute('hidden', 'true');\n\t\tacceptButton = false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "4e2ae835346f08979113f2e65104ba39", "score": "0.45285863", "text": "function cancelUpdate(){\n\tdocument.getElementById(\"editProfileSec\").style.display = \"none\";\n\tdocument.getElementById(\"showCltProfile\").style.display = \"block\";\n\t\n}", "title": "" }, { "docid": "278ef83617f922e61aebbd96cf1dec04", "score": "0.4528512", "text": "function disableButtons() {\r\n voyageDetailsBtn.disabled = true;\r\n newRecordBtn.disabled = true;\r\n shipDetailsBtn.disabled = true;\r\n}", "title": "" }, { "docid": "1d3deb00e9b49f30e1dd6db43a599a64", "score": "0.45256007", "text": "function showBoardEditForm() {\n vm.isBoardEditFormVisible = true;\n }", "title": "" }, { "docid": "524416a91fdd5668c1696bbeb1053868", "score": "0.45246246", "text": "function h_disableActionButtons()\n{\n\tdocument.getElementById(\"choose_buyd\").disabled = true;\t\t// disable buy button\n\tdocument.getElementById(\"choose_selld\").disabled = true;\t// disable sell shark\n\tdocument.getElementById(\"choose_city\").disabled = true;\t\t// disable travel button\n\tdocument.getElementById(\"choose_loan\").disabled = true;\t\t// disable loan shark\n}", "title": "" }, { "docid": "b195d0e346418dd46e5eb16a02c663eb", "score": "0.45234227", "text": "function displayIsInClientInfo() {\n if (liff.isInClient()) {\n document.getElementById('liffLoginButton').classList.toggle('hidden');\n document.getElementById('liffLogoutButton').classList.toggle('hidden');\n document.getElementById('isInClientMessage').textContent = 'Membuka aplikasi di dalam aplikasi LINE';\n } else {\n document.getElementById('isInClientMessage').textContent = 'Membuka aplikasi di browser eksternal';\n document.getElementById('openWindowButton').classList.toggle('hidden');\n document.getElementById('closeWindowButton').classList.toggle('hidden');\n document.getElementById('sendMessageButton').classList.toggle('hidden');\n }\n}", "title": "" }, { "docid": "e9aa0204bf48cb0088f2b31b53c46c47", "score": "0.4520504", "text": "function display(user)\n{\n\tif (user == \"P\") document.getElementById(\"participant\").style.visibility = \"visible\";\n\telse document.getElementById(\"experimenter\").style.visibility = \"visible\";\n}", "title": "" }, { "docid": "4b063edbf7ffc78d1195ef66a321efb0", "score": "0.45103657", "text": "function setAttemptTextVisible() {\n attemptTracker.style.visibility = \"visible\";\n}", "title": "" }, { "docid": "589b0804efd12868ef0e2cabb4e984c6", "score": "0.45088357", "text": "onRender()\n {\n var disabledDelete = this.model.get('origin') !== null;\n $(this.ui.buttonDelete).attr('disabled', disabledDelete); \n var disabledDownload = this.model.get('download') === null;\n $(this.ui.buttonDownload).attr('disabled', disabledDownload); \n var disableView = this.model.get('viewer_url') === null || disabledDownload;\n $(this.ui.buttonView).attr('disabled', disableView);\n }", "title": "" }, { "docid": "e9a2c2699467cfb29f6398eb8a4c1738", "score": "0.45074362", "text": "function denyQuestParticipate() {\n\tdocument.getElementById(\"merlin\").style.display = \"none\";\n\tdocument.getElementById('acceptQuest').style.display = \"none\";\n\tvar data = JSON.stringify({\n\t\t'name' : PlayerName,\n\t\t'participate_quest' : false\n\t});\n\tsocketConn.send(data);\n\tvar serverMsg = document.getElementById('serverMsg');\n\tserverMsg.value += (\"\\n> waiting for other players to finish quest\");\n}", "title": "" }, { "docid": "57d24a5d5f15f192ed4b1238994cc320", "score": "0.45063302", "text": "function enableButtons()\n {\n //show buttons for updating and creating new workflow\n $(\"#perc-update-wf-save-cancel-block\").show();\n $(\"#perc-new-wf-save-cancel-block\").show();\n }", "title": "" }, { "docid": "ba3402df60e0397faa0cb66c525facb5", "score": "0.4505962", "text": "function disableSubmitButton() {\n\tdocument.getElementById(\"submit-button\").disabled = true;\n\tdocument.getElementById(\"save-button\").style.visibility = \"visible\";\n\tdocument.getElementById(\"submission-message\").style.visibility = \"hidden\";\n\n}", "title": "" }, { "docid": "dfc306439e3bad947477785e97cd8fa3", "score": "0.4505845", "text": "showHideNewPassword() {\n this.showHideNew = this.showHideNew === false;\n }", "title": "" }, { "docid": "042721c1281b8c3f40ee14b107a72870", "score": "0.4504257", "text": "function enableConway() {\n\tconwayOn = true;\n\tconwayB.textContent = \"stop\";\n\tbirthForm.disabled = true;\n\tsurvivalForm.disabled = true;\n\turlB.disabled = true;\n\tGB.disabled = true;\n\tDB.disabled = true;\n }", "title": "" }, { "docid": "ae08e5de99afbf4452b584dc9649f624", "score": "0.4498246", "text": "function showOldOrY(){\n\t\t$(\"button\").attr(\"disabled\",true);\n\t\t$(\"#op\").attr('disabled', false);\n\t\t$(\"#yp\").attr('disabled', false);\n\t}", "title": "" }, { "docid": "23a1c65be2d5d1499c672adaf6246dc2", "score": "0.4493483", "text": "function changeStatus() {\n if ($window.confirm('Are you sure you want to change this client\\'s activity?')) {\n vm.clientmanagement.inactive = !vm.clientmanagement.inactive;\n vm.clientmanagement.$update(vm.clientmanagement)\n .then(function () {\n $state.go('clientmanagements.view');\n });\n }\n }", "title": "" }, { "docid": "c633f8f253aa1022d5fa005a86c2a188", "score": "0.4492889", "text": "enable() {\n this.disabled = false;\n }", "title": "" }, { "docid": "c633f8f253aa1022d5fa005a86c2a188", "score": "0.4492889", "text": "enable() {\n this.disabled = false;\n }", "title": "" }, { "docid": "c633f8f253aa1022d5fa005a86c2a188", "score": "0.4492889", "text": "enable() {\n this.disabled = false;\n }", "title": "" }, { "docid": "f885b5ec44dcb85c1e82b0c61f05eb54", "score": "0.4492428", "text": "function buttonDisabledTrue(){\n document.getElementById(\"A\").setAttribute(\"disabled\", true);\n document.getElementById(\"B\").setAttribute(\"disabled\", true);\n document.getElementById(\"C\").setAttribute(\"disabled\", true);\n}", "title": "" }, { "docid": "ddba8317bccbd9deda58aa6b442a4e24", "score": "0.44912404", "text": "function handleAssign(event, data) {\n event.preventDefault();\n console.log(\"Selected:\", data.value);\n setAssignedState({ asignee: data.value });\n }", "title": "" }, { "docid": "ba81bb562f1786c40f2cafc2dc1d16f0", "score": "0.4482378", "text": "function masquerClient(){\n \n document.getElementById(\"masquer\").style.display = \"none\";\n document.getElementById(\"identifiant\").style.display=\"block\";\n document.getElementById(\"nouveau\").checked = false;\n}", "title": "" }, { "docid": "ba81bb562f1786c40f2cafc2dc1d16f0", "score": "0.4482378", "text": "function masquerClient(){\n \n document.getElementById(\"masquer\").style.display = \"none\";\n document.getElementById(\"identifiant\").style.display=\"block\";\n document.getElementById(\"nouveau\").checked = false;\n}", "title": "" }, { "docid": "345a832d8786f9fc67c3cac982932742", "score": "0.44733763", "text": "function EditUser() {\n\tdocument.getElementById(\"EditUser\").style.display = \"block\";\n}", "title": "" }, { "docid": "f7ae5140bcd8808f28606298bc94d4ce", "score": "0.4470697", "text": "function deny(req, res, requester, username) {\n \toracle.connect(connectData, function(err, connection) {\n if ( err ) {\n \tconsole.log(err);\n } else { \t\n \tchange_status(requester, username);\n }\n});\n}", "title": "" }, { "docid": "024539ac3fbe22d0b6ea5888f8b1d8c7", "score": "0.44704", "text": "set DontShow(value) {}", "title": "" } ]
34911f4bf94e429884175f1acb53c4ec
todo //////////////////////////////////////////////////////////////////////// todo ///////////////////////////////////////////////////////////////////////// Allows to add new ingredient through button
[ { "docid": "b7106689b3055e38c9d035a3043c7817", "score": "0.78150874", "text": "addIngredient(id, ingredient) {\n const recipes = this.savedItem\n\n const recipe = recipes.find((recipe) => recipe.id === id)\n \n recipe.ingredients.push(ingredient)\n this.saveRecipe()\n \n }", "title": "" } ]
[ { "docid": "399f0aab888cc643954b6305714a99ab", "score": "0.8139438", "text": "function setup_add_new_my_ingredient() {\n\n\t\tvar name = my_ingredients.new_ingredient_default_name;\n\t\tvar id = struct_add_ingredient(my_menu, name);\n\t\tvar html = tmpl_render_list_item(tmpl_get_content(\"edit_ingredient_list_item\"), {\"id\": id, \"name\": name});\n\t\t$(\"#my-ingredients-list-wrapper\").append(html);\n\n\t\t$(\"#my-ingredients-list-wrapper [data-id=\" +id+ \"].item .action.edit\").click();\n\t}", "title": "" }, { "docid": "1637c6d9c7375e3c71bcc18f4bd1f24d", "score": "0.8121785", "text": "function setup_add_new_ingredient() {\n\n\t\tvar name = edit_ingredients.new_ingredient_default_name;\n\t\tvar id = struct_add_ingredient(current_menu, name);\n\t\tvar html = tmpl_render_list_item(tmpl_get_content(\"edit_ingredient_list_item\"), {\"id\": id, \"name\": name});\n\t\t$(\"#ingredients-list-wrapper\").append(html);\n\n\t\t$(\"#ingredients-list-wrapper [data-id=\" +id+ \"].item .action.edit\").click();\n\t}", "title": "" }, { "docid": "1105573e583ed38e91dabc1056775d63", "score": "0.78236353", "text": "AddIngredient() {\n\t\t\tthis.recipe.ingredients.push({\n\t\t\t\tquantity: 0,\n\t\t\t\tmeasurement: \"\",\n\t\t\t\tname: \"\",\n\t\t\t\topt: \"\"\n\t\t\t});\n\t\t\tthis.ingredients++;\n\t\t\tthis.recipe.numberOfIngreds++;\n\t\t\tthis.topStatus = \"<p class=\\\"success\\\">Added ingredient.</p>\";\n\t\t}", "title": "" }, { "docid": "e800bbcacf26120ccd25d47ad63f0ed6", "score": "0.7458825", "text": "function addNewInput(){\n props.changeIngredients([...ingredients, {ingredient: \"\", amount: \"\"}])\n }", "title": "" }, { "docid": "5dae03df165261ff97c9b1d41257f380", "score": "0.7323606", "text": "function addIngredient(thisObj) {\n // 'destroy' is required to clone <select> elements\n $(\"select\").formSelect(\"destroy\");\n // clone and remove existing values\n $(\".new-ingredient:first\").clone(true, true).insertAfter(thisObj).find(\"input[type='text'], select, textarea\").val(\"\").addClass(\"invalid\");\n $(\"select\").formSelect();\n ingredientCount += 1;\n // custom Materialize validation (not built-in natively)\n let thisMeasurement = thisObj.closest(\"div\").find(\".dropdown-trigger\").dropdown();\n let classInvalid = {\"border-bottom\": \"1px solid #f44336\", \"box-shadow\": \"0 1px 0 0 #f44336\"};\n let classValid = {\"border-bottom\": \"1px solid #4caf50\", \"box-shadow\": \"0 1px 0 0 #4caf50\"};\n if ($(thisMeasurement).val() != \"unit of measurement\") {\n $(thisMeasurement).css(classValid);\n } else {\n $(thisMeasurement).css(classInvalid);\n }\n thisObj.closest(\"div\").find(\"input\").focus();\n thisObj.next(\"div\").find(\".dropdown-trigger\").dropdown().css(classInvalid);\n disableRemoveIngredient();\n validateMaterializeSelect();\n thisObj.next(\"div\").find(\"input:first\").focus();\n // end custom validation\n }", "title": "" }, { "docid": "bc8f45ed0a019510b3ca6eea6bedb0d6", "score": "0.72146565", "text": "function handleAddIng(e) {\n e.preventDefault();\n const ing = {\n ingTitle: \"\",\n amount: \"\",\n unit: \"\",\n };\n setRecipeIngs((prev) => [...prev, ing]);\n }", "title": "" }, { "docid": "75dc6ef1ba3bfde26a83f09a4b197a52", "score": "0.71419966", "text": "function addIngredient(input) {\n var ingredient = $(input).parents('.ingredient');\n var copy = ingredient.clone();\n copy.find('.deleter').show();\n copy.find('.adder').remove();\n ingredient.find(':text').val('');\n ingredient.before(copy);\n $(input).parents('tr').find(':text')[0].focus();\n}", "title": "" }, { "docid": "84cdb4007f3a5e53250a62b73fb8bbfb", "score": "0.7124722", "text": "function addIngredient(ingred) {\n return db('ingredients').insert(ingred, 'id');\n}", "title": "" }, { "docid": "42d2a8544bab7792b815c431941bda27", "score": "0.71080357", "text": "function addIngredient(){\n const ingredient = document.createElement('li');\n const ingredientInput = document.getElementById('ingredient-input');\n ingredient.innerText = ingredientInput.value;\n \n const doneBtn = document.createElement('button');\n doneBtn.innerText = 'Done';\n doneBtn.addEventListener('click', function(event){\n event.target.parentNode.remove();\n })\n ingredient.appendChild(doneBtn);\n\n document.getElementById('shopping-list').appendChild(ingredient);\n ingredientInput.value = '';\n}", "title": "" }, { "docid": "ac48ede312c6694d4e113c272a60b8d5", "score": "0.7091988", "text": "function addIngredientRow() {\n vm.recipe.ingredients.push({_id: (new Date).getTime()});\n }", "title": "" }, { "docid": "be33800f54499d4403bc3faa57481cb0", "score": "0.7068799", "text": "function addIngredientRow() {\n vm.ingredients.push({_id: (new Date).getTime()});\n }", "title": "" }, { "docid": "8625cf8acfd4c6290a2b54b116b2b0bf", "score": "0.7030854", "text": "ingredientPickup(ingredientToAdd){\n this.burgerStation.addIngredient(ingredientToAdd.ingredientKey);\n this.burgerStation.buildBurger();\n ingredientToAdd.destroy();\n this.sound.play('pickup');\n }", "title": "" }, { "docid": "3c4d64dff062dbfc5ada6581c08999bf", "score": "0.7027097", "text": "function newCustomIngredient() {\n\n // set what we've checked so far otherwise we lose it\n const { checked, unchecked } = getCheckedItems();\n\n setCheckedIngredients(mealPlan._id, checked, unchecked)\n .then(() => {\n // now forward the new custom ingredient\n let customIngredients = mealPlan.customIngredients;\n for (let ing of customIngredients) {\n if (checked.filter(key => key === ing.name).length > 0) {\n ing.checked = true;\n } else {\n ing.checked = false;\n }\n }\n customIngredients.push(customList);\n updateCustomIngredients(customIngredients);\n setCustomList({\n name: \"\",\n price: \"\",\n amount: \"\",\n unit: \"\"\n });\n })\n }", "title": "" }, { "docid": "60966dca9ae3a19791353259b010aa94", "score": "0.6942341", "text": "function editRecipeAddIngredientModal(select) {\n addIngredient(select, '#editModal');\n}", "title": "" }, { "docid": "781847acdee683c3392fa7c53430fdfe", "score": "0.6909739", "text": "function addIngredient(select, modalId) {\n\n const ingredientId = $($('#recipe-ingredients').find(\"option\")[select.selectedIndex]).attr(\"id\");\n const ingredientPrice = $($('#recipe-ingredients').find(\"option\")[select.selectedIndex]).attr('price');\n\n let html1 = '<div class=\\\"ingredient-item\\\" price=\\\"' + ingredientPrice + '\\\" data-ingredient-id=\\\"' + ingredientId + '\\\" id=\"ingredient-item-' + ingredientId + '\"></div>';\n const html2 = '<label for=\\\"ingredient\\\" class=\\\"col-form-label\\\">' + $(modalId).find('#recipe-ingredients').val() + '</label>';\n const html4 = '<input type=\\\"number\\\" step=\\\"1\\\" min=\\\"0\\\" max=\"9999\" lang=\\\"en\\\" class=\\\"form-control input-volume\\\" value=0>';\n const html5 = '<label class=\\\"col-form-label label-volume\\\"> mL </label>';\n const deleteBtn = '<button type=\"button\" class=\"btn btn-light btn-remove\" onclick=\"removeIngredient(' + ingredientId + ')\">X</button>';\n\n html1 = $(html1).append(html2, html4, html5, deleteBtn);\n $(modalId).find('#ingredients').append(html1);\n}", "title": "" }, { "docid": "c0c0d77a5a4eab310ebe96c8caca0af0", "score": "0.6899947", "text": "addRow() {\n this.setState(state => {\n const ingredients = this.state.ingredients.concat({\n id: this.state.numIngredients + 1,\n name: '',\n unit: '',\n qty: null\n });\n\n return {\n ingredients: ingredients,\n numIngredients: this.state.numIngredients + 1\n }\n });\n }", "title": "" }, { "docid": "474f96900fecfc8c417357a84f2b956f", "score": "0.68900454", "text": "addIngredient(e) {\n e.preventDefault();\n let ingredientObj = {};\n ingredientObj.name = \"\";\n ingredientObj.quantity = 0;\n ingredientObj.unit = \"\";\n ingredientObj.calories = 0;\n ingredientObj.expiration = \"\";\n this.setState({\n ingredients: [...this.state.ingredients, ingredientObj],\n });\n }", "title": "" }, { "docid": "76931e94a4ff4aed714515c2105661be", "score": "0.6856194", "text": "function addRecipe() {\n // reset ingredientList\n ingredientList = [];\n $('#recipe_form_title').html(\"Add Recipe\");\n $('#recipe_add_edit_submit').html('Submit');\n resetRecipeForm();\n listCategories();\n $(\".eachIngredient\").empty();\n addIngredient();\n\n // reset recipeId to -1\n $(\"#saveRecipe-content\").attr(\"data-recipeId\", \"-1\");\n\n show('add-edit-recipe');\n $(\"#recipe_add_edit_submit\").prop('disabled', false);\n}", "title": "" }, { "docid": "2b0f2c747e2747bbbc442cd50ecc8729", "score": "0.6845645", "text": "function addIngredient(name){\r\n var ingredientTemplate = Handlebars.templates.ingredient;\r\n\r\n var ingredientHTML = ingredientTemplate ({\r\n ingredientName: name\r\n });\r\n\r\n var ingredientsContainer = document.querySelector('#ingredients-container');\r\n \r\n ingredientsContainer.insertAdjacentHTML('beforeend', ingredientHTML);\r\n \r\n //adds delete listener to X \r\n var xbutton = ingredientsContainer.getElementsByClassName(\"remove-ingredient-button\");\r\n var xl = xbutton.length;\r\n xbutton[xl - 1].addEventListener('click', function(){removeIngredient(name);});\r\n \r\n}", "title": "" }, { "docid": "b7d7e39115efbf8a9bc098c7ec126947", "score": "0.6830305", "text": "function addRecipeAddIngredientModal(select) {\n addIngredient(select, '#addModal');\n}", "title": "" }, { "docid": "d476dd5236eba4e879a1318151bf93a8", "score": "0.6825106", "text": "setIngredients(newIngredients){\r\n this.ingredientList = newIngredients;\r\n }", "title": "" }, { "docid": "675fed8200fbb92cad392b283da28dc3", "score": "0.6819455", "text": "onRecipeAdd(name, ingr, instructions) {\n const recipeObj = {\n id: Date.now().toString(),\n name,\n ingredients: [...ingr.split(',').filter(igr => igr.length).map(igr => igr.trim())],\n instructions,\n };\n\n addRecipe(recipeObj); // Add recipe using storageAPI.\n this.setState({ recipes: [...getRecipes()] }); // Set state with updated data.\n }", "title": "" }, { "docid": "2e2c7945e9840eafc17256257acc6b8a", "score": "0.68188804", "text": "function setup_edit_my_ingredients() {\n\n\t\t// enable the button in the main menu\n\t\tenable_my_ingredients_mm_button();\n\n\t\t// render\n\t\tvar ingredients_list_items = tmpl_compile_list_item(tmpl_get_content(\"edit_ingredient_list_item\"), my_menu.content.ingredients);\n\n\t\t// put into the DOM\n\t\t$(\"#my-ingredients-list-wrapper\").html(ingredients_list_items);\n\t}", "title": "" }, { "docid": "50be8d060a5ccd35bfd803ff2ce7f2e3", "score": "0.6807783", "text": "function addIngredientToList(e, index) {\n const {name, value} = e.target\n const ingredientsList = [...ingredients]\n ingredientsList[index][name] = value;\n props.changeIngredients(ingredientsList)\n }", "title": "" }, { "docid": "fc97ac896c9fe317723d0935d0f2ebe1", "score": "0.6780189", "text": "function struct_add_ingredient(source, ingredient_name) {\n\n\t\tvar ingredient_id = source.ingredient_counter++;\n\n\t\t// add the new ingredient structure\n\t\tsource.content.ingredients.push({\n\t\t\t\"id\" : ingredient_id,\n\t\t\t\"name\" : ingredient_name,\n\t\t\t\"price\" : 0\n\t\t});\n\n\t\treturn ingredient_id;\n\t}", "title": "" }, { "docid": "cd6685546fb026817a0bc94a3c1910db", "score": "0.67605996", "text": "function ajaxAddIngredientField() {\n\n\tingredient_id++;\n\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"/food/newingredientfield\",\n\t\tdata: \"ingredient_sort_id=\" + ingredient_id,\n\t\tsuccess: function(newElement) {\n\t\t\n\t\t\tif (ingredient_id == 2) {\n\t\t\t\t$('#removeIngredientElement').toggle();\n\t\t\t}\n\t\t\n\t\t\t// Insert new element before the Add button\n\t\t\t$(\"#addIngredientElement\").before(newElement);\n\n\t\t\t// Increment and store ingredient_id\n\t\t\t$(\"#ingredient_sort_id\").val(ingredient_id);\n\t\t},\n\t\terror: function (request, status, error) {\n\t\t}\n\t});\n}", "title": "" }, { "docid": "819e400a9aaae709c93a585bed33b9c3", "score": "0.6754275", "text": "function addToRecipe(ingredient) {\n return db('recipe_ingredients')\n .insert(ingredient);\n}", "title": "" }, { "docid": "0005b17dcc6db4a65edea47058fd9948", "score": "0.67478824", "text": "function displayAddedIngredients() {\n const ingredients = queryArray.map((item, index) => renderIngrButton(item, index));\n $('.js-added-ingredient-list').html(ingredients);\n}", "title": "" }, { "docid": "e60fdd7bbb68dc957515f6a52f9b8605", "score": "0.67262584", "text": "function handleIngredientClick(event) {\n if (!selectedIngredients.includes(event.target.name)) {\n setSelectedIngredients([...selectedIngredients, event.target.name])\n } else {\n setSelectedIngredients(selectedIngredients.filter(ingredient => ingredient !== event.target.name))\n }\n }", "title": "" }, { "docid": "21c99049dd5afa75da81f08ded52086f", "score": "0.67175806", "text": "addIngredient() {\n this.props.addIngredient('');\n }", "title": "" }, { "docid": "3ca03751d1fa40a9ada138e818c03f90", "score": "0.67048836", "text": "addRecipe(title, ingredients, instructions, img) {\n\t\tconst data = this.state.data,\n\t\t\t newCounter = this.state.counter + 1;\n\n\t\tthis.setState({counter: newCounter});\n\n\t\tconst newRecipe = {\n\t\t\tkey: this.state.counter,\n\t\t\ttitle: title,\n\t\t\tingredients: ingredients,\n\t\t\tinstructions: instructions,\n\t\t}\n\t\tif ( img ) {\n\t\t\tnewRecipe.img = img;\n\t\t}\n\t\tthis.state.data.push(newRecipe);\n\t\tthis.forceUpdate();\t\t\n\t}", "title": "" }, { "docid": "12f35ac8282f2b48650cb2852ad5f309", "score": "0.66735816", "text": "function displayIngredient(localIngredient) {\r\n \r\n var displayLocalIngredients = document.createElement('p'); //create the element\r\n displayLocalIngredients.innerHTML = localIngredient; //declare the content of the element\r\n document.getElementById('ingredientsDisplay').appendChild(displayLocalIngredients); // add created HTML element to document\r\n var createRemoveButton = document.createElement()\r\n}", "title": "" }, { "docid": "663b5be104215e114571954ef5b43f37", "score": "0.6670212", "text": "function handleIngredientChange(id, ingredient) {\n const newIngredients = [...selectedRecipe.ingredients]\n const index = newIngredients.findIndex(ingredient => ingredient.id === id)\n newIngredients[index] = ingredient\n //setting the ingredients to a newIngredients value\n handleChange({ingredients: newIngredients})\n }", "title": "" }, { "docid": "c799118a2dbff6a791e660b31fd3099d", "score": "0.6605714", "text": "function setup_edit_ingredients() {\n\n\t\t// render\n\t\tvar ingredients_list_items = tmpl_compile_list_item(tmpl_get_content(\"edit_ingredient_list_item\"), current_menu.content.ingredients);\n\n\t\t// put into the DOM\n\t\t$(\"#ingredients-list-wrapper\").html(ingredients_list_items);\n\t}", "title": "" }, { "docid": "ff47819f17a3d245f2372c4a59db92f3", "score": "0.6569717", "text": "addIngredient(ingredient, quantity) {\n this.isValid(ingredient, quantity);\n\n let inventoryIngredient = this.getCorrespondingIngredientObject(ingredient.name)\n\n if (!inventoryIngredient) {\n inventoryIngredient = ingredient;\n this.#inventoryMap.set(inventoryIngredient, 0);\n }\n\n this.#inventoryMap.set(\n inventoryIngredient,\n this.#inventoryMap.get(inventoryIngredient) + quantity\n );\n }", "title": "" }, { "docid": "e0f18bae2bbc23cbdf22ea52944404c6", "score": "0.6558544", "text": "editIngredient(id, name) {\n this.props.editIngredient(id, name);\n }", "title": "" }, { "docid": "f702eae1ff2881675f7058a2c92823d6", "score": "0.65486", "text": "function addIngredient(ingredient) {\n const ingredients = getIngredients();\n //push updates to the original array\n ingredients.fruit.push(ingredient);\n fs.writeFileSync(path.join(__dirname, \"./db/smoothie.json\"), JSON.stringify(ingredients));\n return ingredients;\n}", "title": "" }, { "docid": "eeef2302453088a9e2439a34fc17cd92", "score": "0.6536606", "text": "function ingredientsNewAndEdit(ctx) {\n if (ctx == null || ctx.CurrentFieldValue == null)\n return '';\n\n var formCtx = SPClientTemplates.Utility.GetFormContextForCurrentField(ctx);\n if (formCtx == null || formCtx.fieldSchema == null)\n return '';\n\n //register callback functions that SharePoint will call at appropriate times\n RegisterCallBacks(formCtx);\n\n //render the Input controls for the ingredient\n var html = RenderInputFields();\n\n //render a reminder for user experience\n html += '<b>Current Ingredients:</b>';\n\n //render existing values\n html += RenderExistingValues(ctx, true);\n\n return html;\n}", "title": "" }, { "docid": "43f8d054f519d54d5e9c8cde86eef4d2", "score": "0.65281665", "text": "addFromSearch(target) {\n if (target.className === 'fa fa-plus') { \n \n const tr = target.parentElement.parentElement.parentElement; \n console.log(tr);\n const food = new Food(tr.children[0].innerHTML, tr.children[1].innerHTML, tr.children[2].innerHTML, tr.children[3].innerHTML, tr.children[4].innerHTML);\n //Instantiate UI\n const ui = new UI();\n //Call add function\n ui.add(food);\n \n Storage.save(food);\n \n \n }\n }", "title": "" }, { "docid": "4418c1896530839849c41330a33aed0e", "score": "0.650717", "text": "function addIng() {\n let newRow = document.createElement(\"div\");\n newRow.className = \"row\";\n\n let newIngredient = document.createElement(\"div\");\n newIngredient.className = \"input-field col s12 m4\";\n newIngredient.innerHTML = `\n <input id=\"ingredient_name\" name=\"ingredient_name\" type=\"text\" class=\"validate\" pattern=\"^[a-zA-Z][a-zA-Z\\\\s']+$\" title=\"The ingredient name can only contain alphabetic characters, apostrophe and whitespace. The ingredient name can only start with a alphabetic character\" required>\n <label for=\"ingredient_name\">Name</label>`;\n\n let newQuantity = document.createElement(\"div\");\n newQuantity.className = \"input-field col s12 m4\";\n newQuantity.innerHTML = `\n <input id=\"quantity\" name=\"quantity\" type=\"text\" class=\"validate\" pattern=\"\\\\d+\" title=\"Please enter a number\" required>\n <label for=\"quantity\">Quantity</label>`;\n\n let newUnit = document.createElement(\"div\");\n newUnit.className = \"input-field col s12 m4\";\n newUnit.innerHTML = `\n <select id=\"unit\" name=\"unit\" class=\"browser-default unit-select\" required>\n <option value=\"\" disabled selected>Units</option>\n <option value=\"Ml\">Ml</option>\n <option value=\"Litre\">Litre</option>\n <option value=\"Ounce\">Ounce</option>\n <option value=\"Gram\">Gram</option>\n <option value=\"Teaspoon\">Teaspoon</option>\n <option value=\"Tablespoon\">Tablespoon</option>\n <option value=\"Pinch\">Pinch</option>\n <option value=\"None\">None</option>\n </select>\n <label for=\"Unit\"></label>`;\n\n //Append columns to row\n newRow.appendChild(newIngredient);\n newRow.appendChild(newQuantity);\n newRow.appendChild(newUnit);\n //Append row to container\n ingredientsContainer.appendChild(newRow);\n}", "title": "" }, { "docid": "399e161a40567b0ff4fd1f4a10bda238", "score": "0.65005165", "text": "function update_addition_my_ingredients(source, addition_data) {\n\n\t\tvar ingredients_data_source = get_ingredients_data(source.ingredients, addition_data.ingredients);\n\t\tvar ingredients_data = tmpl_compile_ingredient_items(source.ingredients, ingredients_data_source);\n\t\t$(\"#my-menu .addition-edit-ingredients\").html(ingredients_data);\n\t}", "title": "" }, { "docid": "59fd73a60854ad2f77117febad07790e", "score": "0.6489277", "text": "function addItemToTableFromForm(e){\r\n e.preventDefault();\r\n\r\n console.log('e.target.id - table');\r\n console.log(e.target.id);\r\n console.log('>>');\r\n \r\n // Get input value\r\n var newItem = inputForm.value;\r\n inputForm.value = null;\r\n\r\n console.log(`>newItem ${newItem} - ${newItem.trim().length} [${newItem.trim()}]`);\r\n\r\n // break it into constituents \r\n ingredientLineArray = splitLineIntoQtyAndIngredient(newItem); // return [qty, units, modifier, ingredient];\r\n\r\n // timestamp it \r\n if (ingredientLineArray[TRACK_NIX_TIME] === null) {\r\n ingredientLineArray[TRACK_NIX_TIME] = timeNixTimeInms(); \r\n }\r\n\r\n // create html ID for it\r\n ingredientLineArray[HTML_ID] = idFromIngredient(ingredientLineArray);\r\n \r\n //atomic, qty, sevings, item, timestamp, img_id, html_id\r\n // ['1', '180g', '(0)', 'steak', 1568927767066, tag_id]\r\n \r\n dtk['dtk_rcp']['ingredients'].push(ingredientLineArray); \r\n \r\n // reset yield to zero so it's recalculated\r\n invalidateYield();\r\n\r\n // all print exaclty the same thing\r\n console.log( `dtk['dtk_rcp'] ingredientLineArray - ${ingredientLineArray}` ); // => [[ingredient_arr]]\r\n //console.log( `dtk['dtk_rcp']['ingredients'][lastIngredient] - ${dtk['dtk_rcp']['ingredients'][lastIngredient]}` );// => [ingredient_arr]\r\n \r\n //addRowToTable( tableWithFocus, dtk['dtk_rcp']['ingredients'][lastIngredient]);\r\n addRowToTable( tableWithFocus, ingredientLineArray);\r\n\r\n console.log(dtk['dtk_rcp']['ingredients']);\r\n \r\n}", "title": "" }, { "docid": "bc94ec2891569a8e44ee0a32de79957f", "score": "0.64781606", "text": "function displayIngredients(ingredients) {\n\n for (let i = 0; i < ingredients.length; i++) {\n\n let html1 = '<div class=\\\"ingredient-item\\\" data-ingredient-id=\\\"' + ingredients[i].id + '\\\" id=\"ingredient-item-' + ingredients[i].id + '\"></div>';\n const html2 = '<label for=\\\"ingredient\\\" class=\\\"col-form-label\\\">' + ingredients[i].name + '</label>';\n const html4 = '<input type=\\\"number\\\" step=\\\"1\\\" min=\\\"0\\\" max=\"9999\" lang=\\\"en\\\" class=\\\"form-control input-volume\\\"' +\n 'value=\\\"' + Number(ingredients[i].volumeUsed) + '\\\" disabled>';\n const html5 = '<label class=\\\"col-form-label label-volume\\\"> mL </label>';\n const deleteBtn = '<button type=\"button\" class=\"btn btn-light btn-remove\" onclick=\"removeIngredient(' + ingredients[i].id + ')\" disabled>X</button>';\n\n html1 = $(html1).append(html2, html4, html5, deleteBtn);\n $('#editModal').find('#ingredients').append(html1);\n }\n}", "title": "" }, { "docid": "2abec54ba01eabe3273689bc0606a372", "score": "0.647102", "text": "setNewIngredient(newIngredient) {\n let temp = this.state.ingredients.concat(newIngredient);\n this.setState({ingredients: temp});\n }", "title": "" }, { "docid": "8776d03561f76ba6858d469ab8b4918d", "score": "0.6465911", "text": "handleNewIngredient(e) {\n const {ingredients} = this.state;\n this.setState({ingredients: [...ingredients, '']});\n }", "title": "" }, { "docid": "fa6b132c8aa4f74c82153c98f3293c33", "score": "0.6454673", "text": "function handleAdd(){\n addFruit(inputFruit);\n }", "title": "" }, { "docid": "561d712f783b87aae248841761fd7d12", "score": "0.64501864", "text": "addRecipe(name,ingredients,instructions)\n {\n const recipe = {\n id : ++this._currentId,\n name: name,\n ingredients: ingredients,\n instructions: instructions, \n };\n console.log(\"in add recipe\")\n console.log(this._recipes)\n\n //push to array\n this._recipes.push(recipe);\n\n }", "title": "" }, { "docid": "108085818259ffbcf19121cffbb8fff6", "score": "0.644703", "text": "onChangeNewIngredient(e){\n this.setState({\n ingredientName : e.target.value \n });\n }", "title": "" }, { "docid": "7c4b10e489a696aef4a4b8c0f7c3b769", "score": "0.64448035", "text": "function showChosenIngredients() {\n // add a header to the ingredients area\n $(\"#ingredients-area\").empty();\n if (chosenIngredients.length > 0) {\n var header = $(\"<h3>\");\n header.text(\"Chosen Ingredients\").addClass(\"chosen-ingredients-header\");\n $(\"#ingredients-area\").append(header);\n }\n // add each ingredient as a button to the ingredients area\n $(\"filters-area\").append(header);\n for (var i = 0; i < chosenIngredients.length; i++) {\n var button = $(\"<button>\");\n button.text(chosenIngredients[i]).addClass(\"filter-button fas fa-trash chosen-ingredient\");\n $(\"#ingredients-area\").append(button);\n }\n}", "title": "" }, { "docid": "bedbaf2e32edcf965abb379f4e0ee59a", "score": "0.64368147", "text": "function addIngredientToRecipeSearchIngredientsList(state = initialState, action) {\n return state.concat({\n id: state.reduce((maxID, ingredient) =>\n Math.max(ingredient.id, maxID), 0\n ) + 1,\n name: action.payload.name,\n bought: false\n });\n}", "title": "" }, { "docid": "1a2ebcffa367d80d761a4eecde1da9ca", "score": "0.64363194", "text": "addIngredient() {\n // Send data to Redux state\n store.dispatch({\n type: ADD_INGREDIENT,\n payload: this.state.input\n });\n this.setState({\n input: ''\n });\n }", "title": "" }, { "docid": "f97d75bebb1e7b8ed3148cc1da48e972", "score": "0.64080805", "text": "addIngredient(ingredient) {\n ingredient = ingredient.toLowerCase().trim();\n if (this.state.ingredients.indexOf(ingredient) > -1) {\n this.setState({ error: 'This ingredient is already on the list' });\n } else {\n this.setState((prevState) => {\n return {\n ingredients: prevState.ingredients.concat(ingredient)\n };\n });\n }\n }", "title": "" }, { "docid": "9aaca7d1e71b770b535e8c387911a7f2", "score": "0.64016336", "text": "function additem_button() {\n additem(\"new item\");\n}", "title": "" }, { "docid": "6350a202f36398d9a7753a26d7dbdcae", "score": "0.6365817", "text": "function addToCarritoItem(e){\n const button = e.target\n const item = button.closest('.box-img')\n const itemTitle = item.querySelector('.card-title').textContent;\n const itemTitle2 = item.querySelector(\".card-title2\").textContent;\n const itemPrice = item.querySelector('.price').textContent;\n const itemImg = item.querySelector('.img-fluid').src;\n \n const newItem = {\n title: itemTitle,\n title2: itemTitle2,\n price: itemPrice,\n img: itemImg,\n cantidad: 1\n }\n\n addItemCarrito(newItem)\n}", "title": "" }, { "docid": "1a140bba7d13ab16a8f4a19803cb8904", "score": "0.63646513", "text": "addIngredients(quantity,value){\r\n\t\t//Below is one of the method to update an object using setState()\r\n\t\t// Create a copy of the object , update desired property and then reassign the state object with the newly update copy using setState()\r\n\t\tlet newrecipe = this.state.Recipe;\r\n\t\t//Since ingredient is an array, we have to use push method and we are pushing an object in the Ingredient array\r\n\t\tnewrecipe.Ingredients.push({quantity: quantity, ingredient: value});\r\n\t\tthis.setState({\r\n\t\t\tRecipe: newrecipe\r\n\t\t});\r\n\t\t\r\n\r\n\t}", "title": "" }, { "docid": "295b0ec57bde8f9b807eb556c14858ab", "score": "0.63637286", "text": "displayChangedIngredients(recipe) {\r\n const servingsVal = this.getElement('#servingsVal');\r\n servingsVal.innerHTML = recipe.servings\r\n const col = this.getElement('#ingredientCol')\r\n col.innerHTML = '';\r\n const ingLbl = this.createElement('h4')\r\n ingLbl.innerHTML = 'Ingredients'\r\n const ingLst = this.createElement('ul')\r\n ingLst.id = \"ingredientList\";\r\n recipe.ingredients.forEach(ingredient => {\r\n const item = this.createElement('li')\r\n item.innerHTML = ingredient.qty + ' ' + ingredient.unit + ' ' + ingredient.item\r\n ingLst.append(item)\r\n })\r\n col.append(ingLbl, ingLst)\r\n }", "title": "" }, { "docid": "fbcb1ca51ca94a98498e38a2dd642717", "score": "0.6359995", "text": "render(){\n\t\treturn(\n\t\t\t<Button \n\t\t\tcolor=\"blue\"\n\t\t\ttype=\"Submit\"\n\t\t\tonClick={this.props.addRecipeIngredients}\n\t\t\t>Select Recipe</Button>\n\t\t\t)\n\t}", "title": "" }, { "docid": "f83fb8e37dd338be1a2b1ffa947197ce", "score": "0.6353418", "text": "function removeIngredient(){\n var num = $(this).attr(\"id\").split(\"_\")[1];\n\n // Let's delete it if the user is positive that's what they want\n if (confirm(\"Are you sure you want to remove this ingredient?\")){\n $(\"#ingredient_\" + num).slideUp('slow', function () {\n $(this).remove();\n\n // Now, it's unfortunately necessary to go through each of\n // the other ingredients in the form and update their actual number\n var currentNumber = 0;\n $(\"#edit_recipe_form_ingredients_list\").children(\"fieldset\").each(function(){\n var numStr = $(this).attr(\"id\").split('_')[1];\n var num = new Number(parseInt(numStr));\n if (num != currentNumber){\n // this needs to be changed from 'num' to 'currentNum'\n\n // First, change the fieldset id\n $(this).attr(\"id\", \"ingredient_\" + currentNumber);\n\n //// Now start changing children\n // legend\n $(this).children(\"legend\").text(\"Ingredient \" + (currentNumber+1));\n // inputs (text)\n $(this).children(\"input\").each(function() {\n // Get the current name\n var name = $(this).attr(\"name\");\n\n if (name != undefined){\n // Split the string\n var name_sub = name.split('_')\n\n // Now name_sub[0] contains the attribute and\n // name_sub[1] contains the number\n // Just build the new string using newNum\n $(this).attr(\"name\", name_sub[0] + \"_\" + currentNumber);\n }else{\n // Check if this is a button\n if ($(this).attr(\"type\") == \"button\"){\n // Update the text of the 'id' field\n var id_sub = $(this).attr(\"id\").split('_');\n $(this).attr(\"id\", id_sub[0] + \"_\" + currentNumber);\n }\n }\n });\n }\n currentNumber++;\n });\n // Now we need to update our hidden field containing the total\n // count of recipes\n $(\"#hidden_total_ingredients\").attr(\"value\", currentNumber);\n });\n }\n\n }", "title": "" }, { "docid": "aa32ee7e2dd71226764aa4d79d5960fd", "score": "0.6342607", "text": "addRecipe(inputData) {\n // Increment id\n let id = this.currentId++;\n inputData['id'] = id;\n // Push to recipes array\n this.recipes.push(inputData);\n }", "title": "" }, { "docid": "aa8053e600601163d15604229cc4876c", "score": "0.63408023", "text": "function update_mm_addition_ingredients(source, addition_data) {\n\n\t\tvar ingredients_data_source = get_ingredients_data(source.ingredients, addition_data.ingredients);\n\t\tvar ingredients_data = tmpl_compile_ingredient_items(source.ingredients, ingredients_data_source);\n\t\t$(\"#my-menu .addition-edit-ingredients\").html(ingredients_data);\n\t}", "title": "" }, { "docid": "8b278dcee7c2bd2b1a3fb54c3106df4f", "score": "0.63085365", "text": "function update_addition_ingredients(source, addition_data) {\n\n\t\tvar ingredients_data_source = get_ingredients_data(source.ingredients, addition_data.ingredients);\n\t\tvar ingredients_data = tmpl_compile_ingredient_items(source.ingredients, ingredients_data_source);\n\t\t$(\"#current-menu .addition-edit-ingredients\").html(ingredients_data);\n\t}", "title": "" }, { "docid": "67f960c8e4bee946d2282431ad2d1ef2", "score": "0.630793", "text": "addIngredient(ingrId, active) {\n fetch(`${location.protocol}//${process.env.API_HOST}/get-recipes?ingr=${ingrId}`)\n .then(res => res.json()).then(newRecipesInfo => {\n this.setState(state => {\n let ingredients = { ...state.ingredients };\n let recipes = { ...state.recipes };\n for (let recipeId in newRecipesInfo) {\n var recipe;\n if (recipeId in recipes) {\n // copy existing recipe object\n recipe = { ...recipes[recipeId] }\n } else {\n // create new recipe object\n recipe = { info: newRecipesInfo[recipeId], active: {}, available: {} };\n }\n if (active) {\n recipe.active[ingrId] = true;\n }\n recipe.available[ingrId] = true;\n recipes[recipeId] = recipe;\n }\n ingredients[ingrId] = { active: active, recipeIds: Object.keys(newRecipesInfo) };\n\n if (state.username != null) {\n // add ingredient to current account in database\n fetch(`${location.protocol}//${process.env.API_HOST}/add-ingredients`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ username: state.username, ingredients: [ingrId] })\n });\n }\n return { ingredients: ingredients, recipes: recipes };\n });\n });\n }", "title": "" }, { "docid": "826884befa5730f51caaa69e57dcdc9d", "score": "0.6301156", "text": "function addInput() {\n str =\n \"<div class='container pt-1'>\" +\n \"<input type='text' name='ingredient' required>\" +\n \"<button id='delete_ingredient\" + counter.toString() +\n \"' class='btn btn-danger' type='button' name='button'>Eliminar</button>\" +\n \"</div>\"\n list_ingredients.insertAdjacentHTML('beforeend', str);\n newButton = document.getElementById('delete_ingredient' + counter.toString());\n newButton.addEventListener('click', deleteInput)\n counter++;\n}", "title": "" }, { "docid": "7df882ef69a3e00ab89a7638750197c5", "score": "0.62729585", "text": "render() {\n //console.log(this.state.ingredients);\n return (\n <div>\n <div className=\"closeButton\">\n <button className=\"btn\" onClick={this.props.closeModal}>Close</button>\n </div>\n\n <h1><input type=\"text\" value={this.state.recipeName} onChange={this.handleNameChange}/></h1>\n <br/><br/>\n <form onSubmit={this.addIngredient} >\n <input type=\"text\" value={this.state.currentIngredient} onChange={this.handleIngredientChange}/>\n </form>\n <br/><br/>\n <form onSubmit={this.addInstruction}>\n <input type=\"text\" value={this.state.currentInstruction} onChange={this.handleInstructionChange}/>\n </form>\n\n\n <ItemList title={\"Ingredients\"} items={this.state.ingredients}/>\n\n <OrderedList title={\"Instructions\"} items={this.state.instructions}/>\n <form onSubmit={this.addRecipe}>\n <input type=\"submit\" className=\"btn\" value=\"Save\"/>\n </form>\n </div>\n );\n }", "title": "" }, { "docid": "bacecf63341fd4186d6f1769c610914d", "score": "0.6269433", "text": "function ingredientListener (){\n $('.ingredientClassBtn').on(\"click\", function(e){\n e.preventDefault();\n $('#deleteBtn').data('ingredientId', $(this)[0].id) // once the update button clicked, we add to the delete button the object ID\n $('#saveChangesBtn').data('saveChangesId', $(this)[0].id)\n // console.log($(this)[0].id) // this gets the specific id from the button click\n $.ajax({\n url: \"/profile/ingredient/\"+$(this)[0].id, //req.params\n method: \"GET\",\n // data: $(this)[0].id could also do it this way\n success: function(response){\n $('.modal-title').empty().append(\"Update\")\n $('.modal-body').empty().append('<form id=\"inputForm\" class=\"input\">Ingredient: <input type=\"text\" class=\"updateBox1\"> <br><br> Amount: <input type=\"text\" class=\"updateBox2\"></form>')\n // create form on the fly, 3 inputs in form - ingredient name, amount, hidden input w/ the ingredient id as value - then append to modal\n }\n })\n })\n}", "title": "" }, { "docid": "6a2fb021735c2e075ef21279f1d8d33b", "score": "0.62576365", "text": "function addIngredient() {\n //get the container div\n var container = document.getElementById(ingredientsContainer);\n var qtyInput = document.getElementById(ingredientQty);\n var unitInput = document.getElementById(ingredientUnit);\n var descInput = document.getElementById(ingredientDescription);\n var prodIdInput = document.getElementById(ingredientProductId);\n\n //create a new list item \n var li = document.createElement('LI');\n //add to the unordered list parent\n container.appendChild(li);\n\n //add the html to the li\n li.innerHTML = getLIInnerHtml(qtyInput.value, unitInput.value, descInput.value, prodIdInput.value, true);;\n\n //clear input controls\n qtyInput.value = \"\";\n unitInput.value = \"\";\n descInput.value = \"\";\n prodIdInput.value = \"\";\n\n //focus back to the quantity text box\n qtyInput.focus();\n}", "title": "" }, { "docid": "d87cdf99697b45e4377763a15f8ea61e", "score": "0.62565494", "text": "function addItem(e) {\n\tif (e.target.classList.contains(\"shopping\")) {\n\t\tlet item = e.target.parentElement.parentElement;\n\n\t\t/*Only once per item */\n\t\tlet button = e.target;\n\t\tbutton.setAttribute(\"disabled\", \"\");\n\t\tdataEntry(item, button.getAttribute(\"data-id\"));\n\t}\n}", "title": "" }, { "docid": "c4d2623963e1e6b4a6f9b0d3340c245c", "score": "0.6256457", "text": "function addRecipeToDOM(recipe) {\n const ingredients = [];\n for (let i = 0; i < recipe.ingredientNames.length; i++) {\n if (recipe.ingredientQtys[i] === undefined) {\n ingredients.push(`\n ${recipe.ingredientNames[i]}\n `);\n } else {\n ingredients.push(`\n ${recipe.ingredientNames[i]} - ${recipe.ingredientQtys[i]}\n `);\n }\n }\n single_mealEl.innerHTML = `\n <div class=\"meal-header\">\n <span id=\"recipeId\" style=\"display:none\">${recipe.id}</span>\n <div class=\"meal-btn\">\n <button id='edit-recipe' onclick='editRecipe()'>Edit</button>\n <button id='delete-recipe' onclick='deleteRecipe()'>Delete</button>\n <button class=\"close-meal-btn\" id=\"close-meal-btn\" onclick=\"closeMeal()\">&times;</button>\n </div>\n </div>\n <div class=\"meal-title\" id=\"meal-title\">\n ${recipe.title}\n </div>\n <div class=\"meal-body\" id=\"sgl-meal\">\n <div class=\"single-meal-category\">\n ${checkCategory(recipe.category)}\n </div>\n <div class=\"recipe-time-serves\">\n <h5>Prep time: ${recipe.prepTime} Serves: ${recipe.serves}</h5>\n </div>\n <div class=\"single-meal-types\">\n ${recipe.vegan ? '<span class=\"vegan-card\">Vegan</span>' : ''}\n ${\n recipe.glutenFree ? '<span class=\"gluten-card\">Gluten Free</span>' : ''\n }\n </div>\n <div class=\"main\">\n <h2 class=\"ingregients\">Ingregients</h2>\n <ul>\n ${ingredients.map((ing) => `<li>${ing}</li>`).join('')}\n </ul>\n <h2 class=\"directions\">Directions</h2>\n <p>${recipe.directions}</p>\n <h2 class=\"notes\" id=\"note-heading\">${\n recipe.notes ? 'Notes' : ''\n }</h2>\n <p>${recipe.notes}</p> \n </div>\n </div>\n`;\n if (recipe.notes) {\n document.getElementById('note-heading').style.borderBottom =\n '1px solid #727070';\n } else {\n document.getElementById('note-heading').style.borderBottom = '';\n }\n single_mealEl.classList.add('active');\n}", "title": "" }, { "docid": "248025f563b3459ca6234e3f4d34f0b9", "score": "0.62519485", "text": "function addIngred(){\n\t\tvar y = document.getElementById(\"ingList\").value;\n\n\t\t\tif(y != \"\"){\n\n\t\t\t\t/*Initialize x image*/\n\t\t\t\tvar myImages = document.createElement(\"IMG\");\n\t\t\t\tmyImages.src=\"Images/x.png\";\n\n\t\t\t\t/*Give id to x image*/\n\t\t\t\tmyImages.id = \"myImage2\" + counter;\n\n\t\t\t\t/*Append image with input element*/\n\t\t\t\tdocument.getElementById('ingredientList').appendChild(myImages);\n\t\t\t\tmyImages.style.cssFloat = \"right\";\n\t\t\t\tmyImages.style.marginRight = \"10px\";\n\n\t\t\t\tmyImages.style.marginTop = \"20px\";\n\n\t\t\t\t/*Calls function to remove item when image is clicked*/\n\t\t\t\tmyImages.onclick = function(){removeInput(myImages.id)};\n\n\n\n\t\t\t\tvar newDiv2 = document.createElement('div');\n\t\t\t\tvar id2 = \"newLine2\" + counter;\n\n\t\t\t\t/*assign newDiv2 an id*/\n\t\t\t\tnewDiv2.id = id2;\n\n\t\t\t\t/*Appends input element with new div*/\n\t\t\t\tdocument.getElementById('ingredientList').appendChild(newDiv2);\n\n\n\t\t\t\t/*make value of textbox innerHTML*/\n\t\t\t\tnewText2 = document.createElement('textarea');\n\t\t\t\tnewText2.id = \"newTextArea2\" + counter;\n\t\t\t\tnewText2.value = y;\n\n\t\t\t\tdocument.getElementById('ingredientList').appendChild(newText2);\n\n\t\t\t\tnewText2.style.resize = \"none\";\n\t\t\t\tnewText2.style.width = \"95%\";\n\t\t\t\tnewText2.rows = \"1\";\n\t\t\t\tnewText2.style.border = \"1px solid black\";\n\t\t\t\tnewText2.style.borderRadius = \"25px\";\n\t\t\t\tnewText2.style.padding = \"8px 0 8px 5px\";\n\t\t\t\tnewText2.style.fontSize = \"18px\";\n\t\t\t\tnewText2.style.fontWeight = 100;\n\t\t\t\tdocument.getElementById('ingredientList').style.letterSpacing = \"1px\";\n\n\n\n\t\t\t\t/*calls clearBar function to clear textbox*/\n\t\t\t\tclearBar('ingList');\n\t\t\t\tcounter++\n\t\t\t}\n\t}", "title": "" }, { "docid": "3b9d6d0ace34c1ca95acfeb4f934491f", "score": "0.6234289", "text": "function addDrug(){\n $('#results-list').on('click', '.add-item', function(event) {\n let newEntry = $(event.currentTarget).closest('li').find('.list-item').text();\n displayInteractionBox(newEntry);\n getGroup(newEntry);\n $(event.currentTarget).fadeOut('medium');\n $(event.currentTarget).closest('li').find('#check').fadeIn('slow');\n});\n}", "title": "" }, { "docid": "78b4ec8f8f4e672d8b6bacf4479433b5", "score": "0.6228406", "text": "addItems(count, unit, ingredient) {\n const item = {\n id: uniqid(),\n count,\n unit,\n ingredient\n };\n this.items.push(item);\n return item;\n }", "title": "" }, { "docid": "0b38b6ee7999a3b066e6a8bc5315d9f1", "score": "0.6212069", "text": "function renderIngredients() {\n document.id(\"currentIngredientsList\").empty();\n for (var i = 0; i < ingredientList.length; i++) {\n var li = new Element(\"li\");\n li.textContent = ingredientList[i];\n\n var deleteButton = new Element(\"button.saveButton\");\n deleteButton.addClass(\"btn deleteButton\")\n deleteButton.textContent = \"delete\";\n deleteButton.id = i;\n deleteButton.set(\"type\", \"button\");\n\n li.grab(deleteButton);\n document.id(\"currentIngredientsList\").grab(li);\n }\n}", "title": "" }, { "docid": "3a8880106ddfa7062c2cc747f5264fae", "score": "0.62069976", "text": "handleNew(event){\n event.preventDefault();\n\n //check to see if the user has filled out all the fields\n for(var i=0; i <= event.target.elements.length; i++){\n\n if (i <= 4 || i === 6) {\n if(event.target.elements[i].value === \"\") {\n console.log(\"here\", event.target.elements[i]);\n return alert('You must fill out all fields before creating a recipe, including at least Ingredient #1 and Instruction #1.');\n }\n }\n\n }\n\n //get ingredients into an array of objects with amount, label, and name properties \n var rawAmounts = [];\n var rawLabels = [];\n var rawNames = [];\n\n var ingredientBox = document.body.querySelector('.ingredientBox');\n\n var isOdd = function(x) { return x & 1; };\n\n for(var g=0; g < ingredientBox.children.length; g++){\n for(var x=0; x < ingredientBox.children[g].children.length; x++){\n if(x === 0) {\n rawAmounts.push(Number(ingredientBox.children[g].children[x].value));\n } else {\n if(isOdd(x)) {\n rawLabels.push(ingredientBox.children[g].children[x].value);\n } else {\n rawNames.push(ingredientBox.children[g].children[x].value);\n }\n } \n }\n }\n\n //put objects into the array\n var ingredients = [];\n\n for(var y = 0; y < rawAmounts.length; y++){\n var ingredientObj = {\n amount: rawAmounts[y],\n label: rawLabels[y],\n name: rawNames[y]\n }\n ingredients.push(ingredientObj);\n }\n\n //get the instructions in an array\n var instructions = [];\n\n var instructionBox = document.body.querySelector('.instructions');\n\n for(var z = 0; z < instructionBox.children.length; z++){\n instructions.push(instructionBox.children[z].value);\n }\n\n //get the recipe image link or set the default\n var imgHolder = document.getElementById(\"fileBox\").childElementCount;\n\n var recipeImg;\n\n if(imgHolder === 0) {\n recipeImg = \"https://firebasestorage.googleapis.com/v0/b/kitchen-control-panel.appspot.com/o/recipeImages%2Fdefault.jpg?alt=media&token=9abb9b44-48f6-4af1-a4b5-074d31976cc2\";\n } else {\n recipeImg = document.getElementById(\"urlPreview\").href;\n }\n\n var recipeObj;\n\n //create custom id for recipe\n var randId = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);\n\n if(this.props.type === \"new\") {\n \n //create the recipe object that will be sent to the database\n recipeObj = {\n id: randId,\n name: event.target.elements[0].value,\n description: event.target.elements[1].value,\n instructions: instructions,\n ingredients: ingredients,\n image: recipeImg \n }\n\n this.addRecipe(recipeObj);\n\n } else if(this.props.type === \"edit\") {\n console.log(event.target.id);\n //create the recipe object that will be sent to the database\n recipeObj = {\n id: event.target.id,\n name: event.target.elements[0].value,\n description: event.target.elements[1].value,\n instructions: instructions,\n ingredients: ingredients,\n image: recipeImg \n }\n\n this.updateRecipe(recipeObj);\n\n }\n \n\n }", "title": "" }, { "docid": "75872f50eb4241392300fd39de1cef48", "score": "0.6198875", "text": "function removeIngredient(ingredientId) {\n $('#ingredient-item-' + ingredientId).remove();\n}", "title": "" }, { "docid": "841de91d8a0d62951bbb23046e671e71", "score": "0.6180529", "text": "exposeIngredients (recipeId) {\n const recipes = this.savedItem\n const recipe = recipes.find( recipe => recipe.id === recipeId )\n console.log(recipe)\n const ingredients = recipe.ingredients\n return ingredients\n }", "title": "" }, { "docid": "072a082eed35048107fe1ad45ac0f3e5", "score": "0.6154813", "text": "function addIngredientsToBasket(callback) {\n tescoGroceries.login(function(sessionkey){\n kraft.getRecipe(function(result){\n var recipeArray = parseJson.parseIngredients(result);\n tescoAPI.searchIngredients(recipeArray, [], function(message, productIDs){\n productIDs.map(function(element){\n tescoGroceries.addProduct(element.toString(), sessionkey.toString());\n if (iterator === productIDs.length) {\n callback(sessionkey.toString());\n }\n });\n });\n });\n});\n}", "title": "" }, { "docid": "88112c5cc1af67b123deb4e5d319d478", "score": "0.61509776", "text": "addRecipe() {\n const recipeItem = {\n 'id': uuidv4(),\n 'title': this.title,\n 'steps':this.steps,\n 'ingredients': this.ingredients\n }\n \n if (typeof recipeItem.title === 'string') {\n this.loadRecipe() //get from storage\n this.savedItem.push(recipeItem) //\n this.saveRecipe()\n }\n return recipeItem\n }", "title": "" }, { "docid": "b403688adf47dc5dd0b45f413661904a", "score": "0.6150234", "text": "function addKitten(event) {\n event.preventDefault();\n let form = event.target;\n\n let kitten = {\n id: generateId(),\n name: form.name.value,\n affection: 7,\n mood: \"Happy\"\n }\n kittens.push(kitten);\n saveKittens();\n form.reset();\n}", "title": "" }, { "docid": "e0d2fe9c55357d641874023d3289405c", "score": "0.6140519", "text": "function addIngredient() {\n var input = document.getElementById(\"input-ingr\").value;\n if (!!input) {\n document.getElementById(\"optionNew\").classList.remove(\"invisible\");\n document.getElementById(\"optionNew\").innerHTML = input;\n }\n}", "title": "" }, { "docid": "1795b721d16c02d030762571ffea2ff8", "score": "0.6136244", "text": "async function addIngredient() {\n // Add an ingredient ID (random), amount, measurement, and name field (all empty).\n // Fetch the existing list of ingredients.\n // Add the new one to the existing list.\n // Patch request.\n let recipeID = $('.recipe-details').attr('data-id');\n\n await fetch(`http://localhost:3001/recipes/${recipeID}`)\n .then((response) => response.json())\n .then((data) => {\n if (data) {\n let newIngredients = {\n ingredients: [\n ...data.ingredients,\n {\n uuid: createRandomID(),\n amount: '',\n measurement: '',\n name: '',\n },\n ],\n };\n\n fetch(`http://localhost:3001/recipes/${recipeID}`, {\n method: 'PATCH',\n body: JSON.stringify(newIngredients),\n headers: {\n 'Content-type': 'application/json; charset=UTF-8',\n },\n })\n .then((response) => response.json())\n .then((response) => {\n console.log(\n 'recipe ingredient add response:',\n response\n );\n createRecipeModal(response);\n document.getElementById('tab-ingredients').click();\n })\n .catch((err) => console.log('Patch error:', err));\n }\n });\n}", "title": "" }, { "docid": "de760b7004e1c5ed4aafd4adba079b0d", "score": "0.6133656", "text": "function eachIngredient(ingredient, elementId) {\n var eachIng = \"\";\n eachIng += `\n <tr>\n <td><img src=\"${ingredient.iconUrl}\" width=\"50\"></td>\n <td>${ingredient.name}</td>\n <td>${ingredient.quantity}</td>\n <td>${ingredient.unit[0]}</td>\n </tr>\n `;\n $('#' + elementId).append(eachIng);\n}", "title": "" }, { "docid": "92b06f3c37c2c723f76cd8efeecf96d8", "score": "0.6122601", "text": "function saveRecipe(){\n\tvar jsonRecipe = {\n\t\t\"title\": document.getElementById(\"recipeTitle\").value,\n\t\t\"recipeType\": document.getElementById(\"recipeType\").value,\n\t\t\"img\": \"/assets/defaultRecipe.gif\",\n\t\t\"description\": document.getElementById(\"recipeDescription\").value,\n\t\t\"ingredients\": \n\t\t\t[{\n\t\t\t\t\"name\": document.getElementById(\"Principal\").value,\n\t\t\t\t\"met\": document.getElementById(\"disabledSelect1\").value,\n\t\t\t\t\"dishType\": \"Principal\"\n\t\t\t},{\n\t\t\t\t\"name\": document.getElementById(\"Guarnición\").value,\n\t\t\t\t\"met\": document.getElementById(\"disabledSelect2\").value,\n\t\t\t\t\"dishType\": \"Guarnición\"\n\t\t\t},{\n\t\t\t\t\"name\": document.getElementById(\"Salsas\").value,\n\t\t\t\t\"met\": document.getElementById(\"disabledSelect3\").value,\n\t\t\t\t\"dishType\": \"Salsas\"\n\t\t\t}]\n\t}\n\t$.post( \"/sendIngredients\", JSON.stringify(jsonRecipe), createAlert());\n\n\tresetFields();\n}", "title": "" }, { "docid": "ae57c5f15d40092ef3d7048894f493f5", "score": "0.61046606", "text": "function onEdit(dd) {\n foodObject = foodArray[dd];\n $(\"#dish\").val(foodArray[dd].dish);\n $(\"#step\").val(foodArray[dd].step);\n $(\"#url\").val(foodArray[dd].url);\n $(\"#btn\").val(dd);\n $(\"#form\").show();\n $(\"#tbl\").hide()\n $(\"#btn\").hide();\n $(\"#update\").show();\n $(\"#Search\").hide();\n $(\"#Add\").hide();\n $(\"#ingredientData\").show();\n insertIngredient(foodObject.ingredients);\n}", "title": "" }, { "docid": "9dc91ae06a9bd53fa25e209fc7ee8e91", "score": "0.60941386", "text": "function addMeal(item){\n let update = props.meal.concat([item]);\n props.updateMeal(update);\n }", "title": "" }, { "docid": "45e11fad5aa823f536102ce8ee5e1cfc", "score": "0.6089774", "text": "function addProduct() {\n inquirer\n .prompt({\n type: \"list\",\n name: \"add\",\n message: \"Select from the following: \",\n choices: [\"Add New Product\", \"Exit\"]\n })\n .then(function(response) {\n switch (response.add) {\n case \"Add New Product\":\n newProduct();\n break;\n\n case \"Exit\":\n connection.end();\n break;\n }\n });\n}", "title": "" }, { "docid": "490135276fc3ddbb3f04751520d1f780", "score": "0.6074854", "text": "function addKitten(event) {\n event.preventDefault()\n let form = event.target\n\n\n let kitten = {\n id: generateId(),\n name: form.name.value,\n mood: possibleMoods[1],\n affection: 5,\n }\n\n kittens.push(kitten)\n saveKittens()\n form.reset()\n}", "title": "" }, { "docid": "69f024916bd16e256abac4e2cff9fd44", "score": "0.6067219", "text": "function removeElement(e) {\n let button = e.target;\n let field = button.previousSibling;\n let div = button.parentElement;\n let br = button.nextSibling;\n div.removeChild(button);\n div.removeChild(field);\n div.removeChild(br);\n \n let allElements = document.getElementById(\"ingredients\");\n let inputs = allElements.getElementsByTagName(\"input\");\n for(i = 0; i < inputs.length; i++){\n \tinputs[i].setAttribute('id', 'ingredients' + (i+1));\n \tinputs[i].setAttribute('placeholder', \"Enter Ingredient\");\n inputs[i].nextSibling.setAttribute('id', 'ingredients_r' + (i+1));\n }\n}", "title": "" }, { "docid": "6409e48b727a22c169cfcdf8086f4c9f", "score": "0.60639346", "text": "function addGrocery(text) {\n if(groceryList[text]) {\n window.alert(\"This Item already exist\");\n return;\n }\n groceryList[text] = text;\n\n // Get the items\n const list = document.getElementById('Additem');\n\n // New list item element\n const item = document.createElement('li');\n item.setAttribute('id', 'myid');\n item.setAttribute('value', text);\n\n // Input field element\n const input = document.createElement('input');\n input.setAttribute('value', text); // set the attribute of input text to text\n input.readOnly = true; // set read mode on for the default type.\n\n const buttons = document.createElement('div');\n buttons.classList.add('buttons');\n\n const remove = document.createElement('button');\n remove.classList.add('remove');\n const RemoveButtonText = document.createTextNode(\"Remove\");\n remove.appendChild(RemoveButtonText);\n // Css for remove button\n remove.style.color = 'red';\n remove.addEventListener('click', removeitem);\n\n const edit = document.createElement('button');\n edit.classList.add('edit');\n const EditButtonText = document.createTextNode(\"Edit\");\n edit.appendChild(EditButtonText);\n // Css for edit button \n edit.style.color = 'blue'\n edit.addEventListener('click', editItem);\n\n const complete = document.createElement('button');\n complete.classList.add('complete');\n const completetButtonText = document.createTextNode(\"Complete\");\n complete.appendChild(completetButtonText);\n // Css for complete button\n complete.style.color = 'green';\n complete.addEventListener('click', completeItem);\n\n buttons.appendChild(remove);\n buttons.appendChild(edit);\n buttons.appendChild(complete);\n item.appendChild(buttons);\n item.appendChild(input);\n item.style.textAlign = 'center';\n\n list.insertBefore(item, list.childNodes[0]);\n}", "title": "" }, { "docid": "7114bcaf2d0437ab6c3e96d161e18844", "score": "0.60639036", "text": "function addAllIngredientsToRecipe(recipeId, ingredients) {\n for (ingredient of ingredients) {\n addRecipeIngredient(ingredient, recipeId);\n }\n}", "title": "" }, { "docid": "da99b064fd25b2afca4ea764dfb37255", "score": "0.60611004", "text": "makeIngredient(x, y, ingredientVariable){\n\t\tlet ingredient = this.ingredients.create(x, y, ingredientVariable[\"image\"]);\n\t\tthis.physics.world.enable(ingredient);\n\t\tingredient.body.gravity.y = 1000;\n\t\tingredient.body.bounce.y = 0.3 + Math.random() * 0.2;\n\t\tingredient.name = ingredientVariable[\"name\"];\n\t}", "title": "" }, { "docid": "50935344ccad1c074396fd9e72a2c115", "score": "0.6056504", "text": "save() {\n\t\tthis._cloudObj.save({\n\t\t\tsuccess: (obj) => {\n\t\t\t\tconsole.log(\"saved ingredient: \" + this._cloudObj.get(\"name\"))\n\t\t\t},\n\t\t\terror: (err) => {\n\t\t\t\tconsole.log(err);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "c46494326d057b760fd25857a1b38ad6", "score": "0.6056464", "text": "orderIngredient(){\n\t\treturn axios.post('/order',{\n\t\t\tid: `${this.state.detailedIngredient}`,\n\t\t\tuserName: this.state.userName,\n\t\t\tuserPass: this.state.userPass\n\t\t});\n\t}", "title": "" }, { "docid": "1568926522a2a5c0c453da42d1e22560", "score": "0.6054695", "text": "function addNewItem (food) {\n ListService.addItem(food).then((response) => {\n console.log(response);\n $scope.$broadcast('newfood');\n });\n $scope.food = {};\n }", "title": "" }, { "docid": "b05a8b8e73b06713ab43abfdedd46eb2", "score": "0.6050655", "text": "function addInventory() {\n // Dynamic list of products.\n const productList = [];\n connection.query(\"SELECT * FROM products\", (err, res) => {\n for (i = 0; res[i]; i++) { productList.push(res[i].product_name); }\n // Prompt user with which item, and quantity\n inquirer.prompt([{\n message: \"Which product?\",\n type: \"list\",\n choices: productList,\n name: \"name\",\n },\n {\n message: \"Added quantity?\",\n type: \"input\",\n name: \"quantity\"\n }\n ]).then(input => {\n connection.query(\"UPDATE products SET stock_quantity= stock_quantity + ? WHERE product_name=?\", [input.quantity, input.name], (err, res) => {\n if (err) throw err;\n connection.end();\n });\n });\n });\n}", "title": "" }, { "docid": "63c2f799d14ed85d99f722ca360b4818", "score": "0.6047205", "text": "function addKitten(event) {\n event.preventDefault()\n let form = event.target\n let kittenName = form.name.value\n console.log(kittens)\n for (x = 0; x < kittens.length; x++) {\n\n if (kittens[x]['name'] == kittenName) {\n if (kittens[x]['affection'] == 0) {\n window.alert(\"This cat will never forgive you.\")\n return\n }\n else {\n window.alert(\"You already have this cat!\")\n return\n }\n }\n }\n let kittenId = \"\"\n kittenId += generateId()\n\n\n let kittenAffection = 5\n let kittenImage = \"https://robohash.org/\" + kittenName + \"?set=set4\"\n kittens.push({ \"name\": kittenName, \"affection\": kittenAffection, \"image\": kittenImage, \"id\": kittenId })\n console.log(kittenId)\n form.reset()\n saveKittens()\n}", "title": "" }, { "docid": "1cd46fecf9a352ff4c1b6cfcaff8a2e8", "score": "0.60464907", "text": "function addNewItem(){\n var newItem = {\n \"name\": props.search,\n \"source\": \"User Created\",\n \"nutrition\": {\n \"calories\": calories !== '' ? parseInt(calories) : 0,\n \"totalFat\": totalFat !== '' ? parseInt(totalFat) : 0,\n \"cholesterol\": cholesterol !== '' ? parseInt(cholesterol) : 0,\n \"sodium\": sodium !== '' ? parseInt(sodium) : 0,\n \"potasium\": potasium !== '' ? parseInt(potasium) : 0,\n \"carbs\": carbs !== '' ? parseInt(carbs) : 0,\n \"fiber\": fiber !== '' ? parseInt(fiber) : 0,\n \"sugars\": sugars !== '' ? parseInt(sugars) : 0,\n \"protein\": protein !== '' ? parseInt(protein) : 0,\n \"vita\": vita !== '' ? parseInt(vita) : 0,\n \"vitc\": vitc !== '' ? parseInt(vitc) : 0,\n \"calcium\": calcium !== '' ? parseInt(calcium) : 0,\n \"iron\": iron !== '' ? parseInt(iron) : 0\n }\n\n }\n props.actionCall(newItem);\n }", "title": "" }, { "docid": "8acb9b561d940b12e6d7d88060005497", "score": "0.6045542", "text": "function addAnotherIngredientField(){\n var url = '/allingredients';\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if(this.readyState == 4 && this.status == 200){\n setNewIngredientField(JSON.parse(this.response));\n }\n }\n xhttp.open('GET', url, true);\n xhttp.setRequestHeader('X-CSRF-TOKEN', $('meta[name=\"csrf-token\"]').attr('content'));\n xhttp.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n xhttp.send();\n}", "title": "" }, { "docid": "a9ce0e2f04eb9fa8b954a48572be20b7", "score": "0.60434157", "text": "render() {\n const { id, title, label } = this.props;\n\n return (\n <div className='Ingredient'>\n <h2 className='Ingredient__title'>\n <Link to={`/ingredient/${id}`}>\n {title}\n </Link>\n </h2>\n <article className='Ingredient__body group-row'>\n <div className='Ingredient__details item-triple'>\n <p className='Ingredient__label'>\n Label: {label}\n </p>\n </div>\n <div className='Ingredient__actions item group-column'>\n <button \n className='Ingredient__delete item'\n type='button'\n onClick={this.handleClickDelete}\n >\n {' '}\n Remove\n </button>\n </div>\n </article>\n </div>\n );\n }", "title": "" }, { "docid": "b073f386ab92c9fd7c0e2376eb860cc0", "score": "0.6039317", "text": "function makeButton() {\n $(\"#button-holder\").empty();\n\n for (var i=0; i < ingredients.length; i++) {\n var createButton = $(`<button class='btn btn-success'>${ingredients[i]}</button>`);\n createButton.addClass(\"addIngredient\")\n createButton.attr(\"data-name\", ingredients[i]);\n createButton.attr(\"isAdded\", false);\n $(\"#button-holder\").append(createButton);\n }\n}", "title": "" }, { "docid": "127c5c863c87a8c774699e7ae612c167", "score": "0.60080105", "text": "function setQuantity(ingredient){\n ingredient.getProductQuantity().then(function(data){\n ingredient.product.quantity = data.quantity;\n });\n }", "title": "" } ]
9fc3546704b0ca564845432a94285d44
Spell check the Ace editor contents.
[ { "docid": "f35a9cef169b75d89424a7f9efd39b24", "score": "0.67911464", "text": "function spell_check(check_right_click) {\n // Wait for the dictionary to be loaded.\n\tif ($('#' + editor).length) {\n\t\tif (dictionary == null) {\n\t return;\n\t }\n\t if (currently_spellchecking) {\n\t \treturn;\n\t }\n\n\t if (!contents_modified) {\n\t \treturn;\n\t }\n\t currently_spellchecking = true;\n\t var session = ace.edit(editor).getSession();\n\n\t // Clear the markers.\n\t for (var i in markers_present) {\n\t session.removeMarker(markers_present[i]);\n\t }\n\t markers_present = [];\n\t try {\n\t\t var Range = ace.require('ace/range').Range;\n\t\t var lines = session.getDocument().getAllLines();\n\t\t for (var i in lines) {\n\t\t \t// Clear the gutter.\n\t\t session.removeGutterDecoration(i, 'misspelled');\n\t\t // Check spelling of this line.\n\t\t var misspellings = misspelled(lines[i]);\n\t\t // Add markers and gutter markings.\n\t\t if (misspellings.length > 0) {\n\t\t session.addGutterDecoration(i, 'misspelled');\n\t\t }\n\t\t for (var j in misspellings) {\n\t\t var range = new Range(i, misspellings[j][0], i, misspellings[j][1]);\n\t\t markers_present[markers_present.length] = session.addMarker(range, 'misspelled', 'typo', true);\n\t\t }\n\t\t }\n\t\t} finally {\n\t\t\tcurrently_spellchecking = false;\n\t\t\tcontents_modified = false;\n\t\t}\n\t}\n}", "title": "" } ]
[ { "docid": "4162dc47567dd18f0601c1dac3e030c2", "score": "0.6154855", "text": "function spellCheck() {\n let textEntered = translationArea.value;\n let EngWordMatch = FindWord(textEntered);\n let EngSubWordMatch = FindSubWord(textEntered);\n\n if (EngWordMatch) {\n clearInterval(interval);\n translationWrapper.style.borderColor = \"#388E3C\";\n } else {\n if (EngSubWordMatch) {\n translationWrapper.style.borderColor = \"#FBC02D\";\n } else {\n translationWrapper.style.borderColor = \"#E64A19\";\n\n }\n }\n}", "title": "" }, { "docid": "620bc47a0f968fb7cb5ec38ab29a5a6d", "score": "0.606095", "text": "check (args, text) {\n this.deferredInit()\n return this.spellchecker.checkSpellingAsync(text).then(incorrect => ({\n invertIncorrectAsCorrect: true,\n incorrect\n }))\n }", "title": "" }, { "docid": "e0233da0dc840faacc1cdf06fe8a7872", "score": "0.60358524", "text": "function spellCheck () {\n\t\n\tlet textEnterd = testArea.value;\n\t\n\tlet originTextMatch = txType.innerHTML.substring(0,textEnterd.length);\n\t\t\n\tif(textEnterd == txType.innerHTML) {\n\t\t\n\t\tclearInterval(interval);\n\t\ttestWrapper.style.borderColor = \"#429890\";\t\t\n\t} else {\n\t\tif(textEnterd == originTextMatch) {\n\t\t\ttestWrapper.style.borderColor = \"#65CCf3\";\n\t\t} else {\n\t\t\ttestWrapper.style.borderColor = \"#E95D0F\";\n\t\t\t\t\t\t\n\t\t} \n\t}\n\t//console.log(textEnterd);\n}", "title": "" }, { "docid": "c259dabf02be3f4be23e8186a452ba49", "score": "0.59903234", "text": "checkSpelling() {\n return this.peekWord().toLowerCase() == this.input.toLowerCase();\n }", "title": "" }, { "docid": "1cc9907f15b656d24c79ee4051073f71", "score": "0.5905009", "text": "function PureSpellChecker(textAreaID, languageName, imgPath, dicWordsPath) {\n if (textAreaID == null || languageName == null) return;\n this.textAreaId = textAreaID;\n this.spellCheckId = \"Checker\" + Math.floor(Math.random() * 200);\n this.preferredLanguage = languageName.toLowerCase();\n this.webmasterEmail = \"[email protected]\";\n this.checkGrammar = true;\n this.imgPath = imgPath;\n this.dicWordsPath = dicWordsPath;\n this.vWinChrWidth = 550;\n this.vWinChrHeight = 240;\n var vvWinChrParam = \"width=\" + this.vWinChrWidth + \",height=\" + this.vWinChrHeight;\n vvWinChrParam = vvWinChrParam + \",status=no,resizable=no,top=200,left=200\";\n this.vWinChrParam = vvWinChrParam;\n this.vWinChr = \"\";\n this.docText = \"\";\n this.progressInterval = 0;\n this.progressTotal = 0;\n this.progressCounter = 1;\n this.processStarted = false;\n this.lan = \"\";\n this.cylinder = document.getElementById(\"cylinder\");\n this.mySplitTxt = Array();\n this.currIdx = 0;\n this.errorsFound = 0;\n this.wordsCorrected = 0;\n this.totalWords = 0;\n this.SrcCylinder = \"\";\n this.dicLength = 0;\n\n this.preloadDic = false;\n\n //pattern declaration\n if (this.preferredLanguage == 'english') {\n this.pattA = /[^a-zA-Z 0-9]/g; this.pattB = /[a-z 0-9]/; this.pattC = /[A-Z]/;\n this.pattD = /[a-zA-Z]/; this.pattE = /[a-z]/; this.pattF = \"[^a-zA-Z 0-9]*\";\n this.pattG = /[^a-zA-Z 0-9 \\' \\- \\, \\. \\( \\) \\\" \\; \\: \\? \\!]+/g;\n }\n if (this.preferredLanguage == 'spanish') {\n this.pattA = /[^a-zA-Z \\ñ \\á \\é \\í \\ó \\ú \\Ñ \\Á \\É \\Í \\Ó \\Ú 0-9]/g; this.pattB = /[a-z \\ñ \\á \\é \\í \\ó \\ú 0-9]/;\n this.pattC = /[A-Z \\Ñ \\Á \\É \\Í \\Ó \\Ú]/; this.pattD = /[a-zA-Z \\ñ \\á \\é \\í \\ó \\ú \\Ñ \\Á \\É \\Í \\Ó \\Ú]/;\n this.pattE = /[a-z \\ñ \\á \\é \\í \\ó \\ú]/; this.pattF = \"[^a-zA-Z \\ñ \\á \\é \\í \\ó \\ú \\Ñ \\Á \\É \\Í \\Ó \\Ú 0-9]*\";\n this.pattG = /[^a-zA-Z \\ñ \\á \\é \\í \\ó \\ú \\Ñ \\Á \\É \\Í \\Ó \\Ú 0-9 \\' \\- \\, \\. \\( \\) \\\" \\; \\: \\? \\!]+/g;\n }\n if (this.preferredLanguage == 'portuguese') {\n this.pattA = /[^a-zA-Z \\á \\ã \\à \\â \\ê \\é \\è \\í \\ó \\ô \\õ \\ô \\ú \\ç \\Á \\à \\À \\ \\Ê \\É \\È \\Í \\Ó \\Ô \\Õ \\Ô \\Ú \\Ç 0-9]/g;\n this.pattB = /[a-z \\á \\ã \\à \\â \\ê \\é \\è \\í \\ó \\ô \\õ \\ô \\ú \\ç 0-9]/; this.pattC = /[A-Z \\Á \\à \\À \\ \\Ê \\É \\È \\Í \\Ó \\Ô \\Õ \\Ô \\Ú \\Ç]/;\n this.pattD = /[a-zA-Z \\á \\ã \\à \\â \\ê \\é \\è \\í \\ó \\ô \\õ \\ô \\ú \\ç \\Á \\à \\À \\ \\Ê \\É \\È \\Í \\Ó \\Ô \\Õ \\Ô \\Ú \\Ç]/;\n this.pattE = /[a-z \\á \\ã \\à \\â \\ê \\é \\è \\í \\ó \\ô \\õ \\ô \\ú \\ç]/;\n this.pattF = \"[^a-zA-Z \\á \\ã \\à \\â \\ê \\é \\è \\í \\ó \\ô \\õ \\ô \\ú \\ç \\Á \\à \\À \\ \\Ê \\É \\È \\Í \\Ó \\Ô \\Õ \\Ô \\Ú \\Ç 0-9]*\";\n this.pattG = /[^a-zA-Z \\á \\ã \\à \\â \\ê \\é \\è \\í \\ó \\ô \\õ \\ô \\ú \\ç \\Á \\à \\À \\ \\Ê \\É \\È \\Í \\Ó \\Ô \\Õ \\Ô \\Ú \\Ç 0-9 \\' \\- \\, \\. \\( \\) \\\" \\; \\: \\? \\!]+/g;\n }\n if (this.preferredLanguage == 'french') {\n this.pattA = /[^a-zA-Z \\à \\â \\ç \\é \\è \\ê \\ë \\î \\ï \\ô \\û \\ù \\ü \\ÿ \\æ \\œ \\À \\ \\Ç \\É \\È \\Ê \\Ë \\Î \\Ï \\Ô \\Û \\Ù \\Ü \\Ÿ \\Æ \\Œ 0-9]/g;\n this.pattB = /[a-z \\à \\â \\ç \\é \\è \\ê \\ë \\î \\ï \\ô \\û \\ù \\ü \\ÿ \\æ \\œ 0-9]/; this.pattC = /[A-Z \\À \\ \\Ç \\É \\È \\Ê \\Ë \\Î \\Ï \\Ô \\Û \\Ù \\Ü \\Ÿ \\Æ \\Œ]/;\n this.pattD = /[a-zA-Z \\à \\â \\ç \\é \\è \\ê \\ë \\î \\ï \\ô \\û \\ù \\ü \\ÿ \\æ \\œ \\À \\ \\Ç \\É \\È \\Ê \\Ë \\Î \\Ï \\Ô \\Û \\Ù \\Ü \\Ÿ \\Æ \\Œ]/;\n this.pattE = /[a-z \\à \\â \\ç \\é \\è \\ê \\ë \\î \\ï \\ô \\û \\ù \\ü \\ÿ \\æ \\œ]/;\n this.pattF = \"[^a-zA-Z \\à \\â \\ç \\é \\è \\ê \\ë \\î \\ï \\ô \\û \\ù \\ü \\ÿ \\æ \\œ \\À \\ \\Ç \\É \\È \\Ê \\Ë \\Î \\Ï \\Ô \\Û \\Ù \\Ü \\Ÿ \\Æ \\Œ 0-9]*\";\n this.pattG = /[^a-zA-Z \\à \\â \\ç \\é \\è \\ê \\ë \\î \\ï \\ô \\û \\ù \\ü \\ÿ \\æ \\œ \\À \\ \\Ç \\É \\È \\Ê \\Ë \\Î \\Ï \\Ô \\Û \\Ù \\Ü \\Ÿ \\Æ \\Œ 0-9 \\' \\- \\, \\. \\( \\) \\\" \\; \\: \\? \\!]+/g;\n }\n if (this.preferredLanguage == 'dutch') {\n this.pattA = /[^a-zA-Z \\ä \\à \\â \\è \\é \\ë \\ê \\ï \\î \\ö \\ó \\ô \\ü \\û \\ç \\Ä \\À \\ \\È \\É \\Ë \\Ê \\Ï \\Î \\Ö \\Ó \\Ô \\Ü \\Û \\Ç 0-9]/g;\n this.pattB = /[a-z \\ä \\à \\â \\è \\é \\ë \\ê \\ï \\î \\ö \\ó \\ô \\ü \\û \\ç 0-9]/; this.pattC = /[A-Z \\Ä \\À \\ \\È \\É \\Ë \\Ê \\Ï \\Î \\Ö \\Ó \\Ô \\Ü \\Û \\Ç]/;\n this.pattD = /[a-zA-Z \\ä \\à \\â \\è \\é \\ë \\ê \\ï \\î \\ö \\ó \\ô \\ü \\û \\ç \\Ä \\À \\ \\È \\É \\Ë \\Ê \\Ï \\Î \\Ö \\Ó \\Ô \\Ü \\Û \\Ç]/;\n this.pattE = /[a-z \\ä \\à \\â \\è \\é \\ë \\ê \\ï \\î \\ö \\ó \\ô \\ü \\û \\ç]/;\n this.pattF = \"[^a-zA-Z \\ä \\à \\â \\è \\é \\ë \\ê \\ï \\î \\ö \\ó \\ô \\ü \\û \\ç \\Ä \\À \\ \\È \\É \\Ë \\Ê \\Ï \\Î \\Ö \\Ó \\Ô \\Ü \\Û \\Ç 0-9]*\";\n this.pattG = /[^a-zA-Z \\ä \\à \\â \\è \\é \\ë \\ê \\ï \\î \\ö \\ó \\ô \\ü \\û \\ç \\Ä \\À \\ \\È \\É \\Ë \\Ê \\Ï \\Î \\Ö \\Ó \\Ô \\Ü \\Û \\Ç 0-9 \\' \\- \\, \\. \\( \\) \\\" \\; \\: \\? \\!]+/g;\n }\n if (this.preferredLanguage == 'deutsch') {\n this.pattA = /[^a-zA-Z \\á \\à \\ä \\â \\å \\é \\ê \\è \\ë \\í \\î \\ó \\ô \\ö \\ú \\ü \\û \\œ \\ñ \\ø \\ç \\Á \\À \\Ä \\ \\Å \\É \\Ê \\È \\Ë \\Í \\Î \\Ó \\Ô \\Ö \\Ú \\Ü \\Û \\Œ \\Ñ \\Ø \\Ç \\ß 0-9]/g;\n this.pattB = /[a-z \\á \\à \\ä \\â \\å \\é \\ê \\è \\ë \\í \\î \\ó \\ô \\ö \\ú \\ü \\û \\œ \\ñ \\ø \\ç \\ß 0-9]/;\n this.pattC = /[A-Z \\Á \\À \\Ä \\ \\Å \\É \\Ê \\È \\Ë \\Í \\Î \\Ó \\Ô \\Ö \\Ú \\Ü \\Û \\Œ \\Ñ \\Ø \\Ç \\ß]/;\n this.pattD = /[a-zA-Z \\á \\à \\ä \\â \\å \\é \\ê \\è \\ë \\í \\î \\ó \\ô \\ö \\ú \\ü \\û \\œ \\ñ \\ø \\ç \\Á \\À \\Ä \\ \\Å \\É \\Ê \\È \\Ë \\Í \\Î \\Ó \\Ô \\Ö \\Ú \\Ü \\Û \\Œ \\Ñ \\Ø \\Ç \\ß]/;\n this.pattE = /[a-z \\á \\à \\ä \\â \\å \\é \\ê \\è \\ë \\í \\î \\ó \\ô \\ö \\ú \\ü \\û \\œ \\ñ \\ø \\ç \\ß]/;\n this.pattF = \"[^a-zA-Z \\á \\à \\ä \\â \\å \\é \\ê \\è \\ë \\í \\î \\ó \\ô \\ö \\ú \\ü \\û \\œ \\ñ \\ø \\ç \\Á \\À \\Ä \\ \\Å \\É \\Ê \\È \\Ë \\Í \\Î \\Ó \\Ô \\Ö \\Ú \\Ü \\Û \\Œ \\Ñ \\Ø \\Ç \\ß 0-9]*\";\n this.pattG = /[^a-zA-Z \\á \\à \\ä \\â \\å \\é \\ê \\è \\ë \\í \\î \\ó \\ô \\ö \\ú \\ü \\û \\œ \\ñ \\ø \\ç \\Á \\À \\Ä \\ \\Å \\É \\Ê \\È \\Ë \\Í \\Î \\Ó \\Ô \\Ö \\Ú \\Ü \\Û \\Œ \\Ñ \\Ø \\Ç \\ß 0-9 \\' \\- \\, \\. \\( \\) \\\" \\; \\: \\? \\!]+/g;\n }\n if (this.preferredLanguage == 'italian') {\n this.pattA = /[^a-zA-Z 0-9]/g; this.pattB = /[a-z 0-9]/; this.pattC = /[A-Z]/;\n this.pattD = /[a-zA-Z]/; this.pattE = /[a-z]/; this.pattF = \"[^a-zA-Z 0-9]*\";\n this.pattG = /[^a-zA-Z 0-9 \\' \\- \\, \\. \\( \\) \\\" \\; \\: \\? \\!]+/g;\n }\n //end of pattern declaration\n\n}", "title": "" }, { "docid": "454058c3475d0bccaedae6217fa16608", "score": "0.5865777", "text": "function checkSpelling() {\n\t\t\t\t\tif (attrs.checkSpelling != null && attrs.checkSpelling != undefined) {\n\t\t\t\t\t\tif (attrs.isadding !== null && attrs.isadding === 'true') {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar invoker = $parse(attrs.checkSpelling);\n\t\t\t\t\t\tinvoker(scope);\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "454058c3475d0bccaedae6217fa16608", "score": "0.5865777", "text": "function checkSpelling() {\n\t\t\t\t\tif (attrs.checkSpelling != null && attrs.checkSpelling != undefined) {\n\t\t\t\t\t\tif (attrs.isadding !== null && attrs.isadding === 'true') {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar invoker = $parse(attrs.checkSpelling);\n\t\t\t\t\t\tinvoker(scope);\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "f517f47f2a03d1d423e63d486d32f36c", "score": "0.58625203", "text": "function spellCheck() {\n let textEntered = testArea.value;\n let originTextMatch = originText.substring(0, textEntered.length);\n switch (textEntered) {\n case originText :\n hasError = false;\n clearInterval(interval);\n testWrapper.style.borderColor = '#429890';\n\t\t\t\tvar wpm = countWPM();\n\t\t\t\tvar currentScore = parseInt(sessionStorage.getItem(\"score\"));\n\t\t\t\tif(isNaN(currentScore))\n\t\t\t\t\tsessionStorage.setItem(\"score\",5);\n wpmElement.innerHTML = \"Words Per Minute: \" + wpm;\n\t\t\t\tif(wpm<10)\n\t\t\t\t\tsessionStorage.setItem(\"score\", currentScore+2);\n\t\t\t\telse if(wpm>= 10 && wpm<20)\n\t\t\t\t\tsessionStorage.setItem(\"score\", currentScore+5);\n\t\t\t\telse if(wpm>= 20 && wpm<30)\n\t\t\t\t\tsessionStorage.setItem(\"score\", currentScore+6);\n\t\t\t\telse if(wpm>= 30 && wpm<40)\n\t\t\t\t\tsessionStorage.setItem(\"score\", currentScore+8);\n\t\t\t\telse if(wpm>= 40)\n\t\t\t\t\tsessionStorage.setItem(\"score\", currentScore+10);\n\n testArea.disabled = true;\n break;\n case originTextMatch :\n hasError = false;\n testWrapper.style.borderColor = '#00e031';\n counterElement.style.color = \"#429890\";\n break;\n default :\n testWrapper.style.borderColor = \"#E95D0F\";\n counterElement.style.color = \"#E95D0F\";\n if (!hasError && timerRunning) incErrors();\n hasError = true;\n }\n }", "title": "" }, { "docid": "d5596598cf92806d6aa7ae72f0b115fa", "score": "0.5844456", "text": "function checkWord() {\n\tgo_to_fullscreen();\n\t// clears the pos array so that a player cannot highlight the same word twice\n\tfunction clearPos(p) {\n\t\tp.start = p.end = 0;\n\t\treturn true;\n\t}\n\t// user highlights from first letter to last\n\tif (pos.some(function(o) { return o.start === click.startPos &&\n\t\t\t\t\t\t\t o.end === click.endPos && clearPos(o); })) {\n\t\treturn true;\n\t}\n\t// if user highlights from last letter to first\n\telse if (pos.some(function(o) { return o.start === click.endPos &&\n\t\t\t\t\t\t\t\t\to.end === click.startPos && clearPos(o); })) {\n\t\treturn true;\n\t}\n\telse return false;\n}", "title": "" }, { "docid": "97cf2b7612bde05fca01c10523b71b3b", "score": "0.5692721", "text": "function spellCheck() {\n let textEntered = testArea.value;\n let originTextmatch = originText.substring(0,textEntered.length);\n\n if (textEntered == originText){\n clearInterval(interval);\n testWrapper.style.borderColor = \"#3ee084\";\n } else {\n if (textEntered == originTextmatch){\n testWrapper.style.borderColor = \"#1105f0\";\n } else {\n testWrapper.style.borderColor = \"#E95D0F\";\n }\n }\n}", "title": "" }, { "docid": "e104d37b25ae849049d647e1a5707320", "score": "0.56899595", "text": "function spellCheck(){\n //let textEntered = String(testArea.value).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;');\n let textEntered = String(testArea.value);\n let originTextMatch = temp.substring(0,textEntered.length);\n\n if (textEntered == temp){\n testWrapper.style.borderColor = 'green';\n clearInterval(interval);\n inputtime.value=theTimer.innerHTML;\n inputerror.value = errorcount;\n\n } else {\n if(textEntered == originTextMatch){\n testWrapper.style.borderColor = 'orange';\n }\n else {\n testWrapper.style.borderColor = 'red';\n errorcount++;\n }\n }\n}", "title": "" }, { "docid": "0afc1cc1179c97fc2c31ef67f5e8ffab", "score": "0.56889606", "text": "function insideWord(check, state, from, to) {\n return check(state.sliceDoc(from, from + 1)) == _codemirror_state__WEBPACK_IMPORTED_MODULE_1__.CharCategory.Word\n && check(state.sliceDoc(to - 1, to)) == _codemirror_state__WEBPACK_IMPORTED_MODULE_1__.CharCategory.Word;\n}", "title": "" }, { "docid": "66d401ee095d4bb95f138f9b67b52136", "score": "0.5679107", "text": "function activeSpellCheck() {\n\tif (timeFrozen) {\n\t\tfrozeTimer--;\n\t\t$('#error').html('Time Frozen: ' + frozeTimer);\n\t\tif (frozeTimer == 0) {\n\t\t\ttimeFrozen = false;\n\t\t}\n\t}\n\tif (shieldUsed) {\n\t\tshieldTimer--;\n\t\t$('#error').html('Shield Left: ' + shieldTimer);\n\t\tif (shieldTimer == 0) {\n\t\t\tshieldUsed = false;\n\t\t\tplayer.reduction = oldReduction;\n\t\t}\n\t} \n\tif (berserkUsed) {\n\t\tberserkTimer--;\n\t\t$('#error').html('Berserk Left: ' + berserkTimer);\n\t\tif (berserkTimer == 0) {\n\t\t\tberserkUsed = false;\n\t\t\tplayer.power = oldPower;\n\t\t}\n\t}\n\tif (potionUsed) {\n\t\tpotionCD--;\n\t\t$('#potionCDText').html(\"Potion Cooldown: \" + potionCD);\n\t\tif (potionCD == 0) {\n\t\t\tpotionUsed = false;\n\t\t\t$('#error').html('');\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ba59119dccc87417f44a26c23a8ee2d7", "score": "0.5677057", "text": "function spellCheck() {\n let textEntered = testArea.value;\n let originTextMatch = originText.substring(0, textEntered.length);\n // console.log(testArea.value);\n console.log(originText.value);\n\n if (textEntered == originText) { // if text completed and correct, turn green\n clearInterval(interval);\n testWrapper.style.borderColor = \"#429890\";\n }\n else {\n if (textEntered == originTextMatch) { // if text entered so far matches original text up to that length, turn blue\n testWrapper.style.borderColor = \"#64CCF3\";\n }\n else { // if text entered does not match original text, turn orange\n testWrapper.style.borderColor = \"#E95D0F\";\n }\n }\n console.log(textEntered);\n}", "title": "" }, { "docid": "3deeb7154f1562c6740fbc54ae393160", "score": "0.55965257", "text": "function spellCheck() {\n let textEntered = testArea.value;\n // substring 1st argument is where in array we want to start, 2nd argument is how many characters to return.\n let originTextMatch = originText.substring(0, textEntered.length);\n if (textEntered == originText) {\n // stop the timer\n clearInterval(interval);\n testWrapper.style.borderColor = \"#429890\"; // green\n } else {\n if (textEntered == originTextMatch) {\n testWrapper.style.borderColor = \"#65CCF3\"; // blue\n } else {\n testWrapper.style.borderColor = \"#E95D0F\"; // orange\n }\n }\n}", "title": "" }, { "docid": "b11784e85dbc9cc1aa87a7834dad8e61", "score": "0.5589515", "text": "function spellCheck() {\r\n let text = INPUT_TEXT.value;\r\n let originTextMatch = originText.substring(0, text.length);\r\n if (text === originText) {\r\n ORIGIN_PARENT.className = 'd-flex justify-content-between align-items-center p-4 mb-3 alert alert-success';\r\n clearInterval(interval);\r\n } else if (text === originTextMatch) {\r\n ORIGIN_PARENT.className = 'd-flex justify-content-between align-items-center p-4 mb-3 alert alert-primary';\r\n } else {\r\n ORIGIN_PARENT.className = 'd-flex justify-content-between align-items-center p-4 mb-3 alert alert-danger';\r\n }\r\n}", "title": "" }, { "docid": "797611505ed01a8a868ac71f7487870f", "score": "0.55364996", "text": "function initResumeHero(){\n $(function() {\n\t\t$( \"#sortable\" ).sortable({\n\t\t\trevert: true\n\t\t});\n\t\t$( \"#draggable\" ).draggable({\n\t\t\tconnectToSortable: \"#sortable\",\n\t\t\thelper: \"clone\",\n\t\t\trevert: \"invalid\"\n\t\t});\n\t\t$( \"ul, li\" ).disableSelection();\n\t});\n\t\n\t(function() {\n\t\tvar element = $('.textarea');\n\n\t\telement.wysihtml5({\n\t\ttoolbar: {\n\t\t \"spellchecker\":\n\t\t\t \"<li>\" +\n\t\t\t\t \"<a class='btn' data-wysihtml5-command='spellcheck'>\" + \n\t\t\t\t \"<i class='icon-spellchecker spellchecker-button-icon'></i></a>\" +\n\t\t\t \"</li>\"\n\t\t},\n\t\tstylesheets: [\n\t\t \"./css/jquery.spellchecker.css\"\n\t\t], \n\t\t});\n\n\t\tvar wysihtml5 = element.data('wysihtml5');\n\t\tvar body = $(wysihtml5.editor.composer.iframe).contents().find('body');\n\n\t\tvar toggle = (function() {\n\n\t\tvar spellchecker = null;\n\n\t\tfunction create() {\n\n\t\t spellchecker = new $.SpellChecker(body, {\n\t\t\tlang: 'en',\n\t\t\tparser: 'html',\n\t\t\twebservice: {\n\t\t\t path: \"../Career/php/SpellChecker.php\",\n\t\t\t driver: 'pspell'\n\t\t\t},\n\t\t\tsuggestBox: {\n\t\t\t position: 'below'\n\t\t\t}\n\t\t });\n\n\t\t spellchecker.on('check.success', function() {\n\t\t\talert('There are no incorrectly spelt words.');\n\t\t });\n\n\t\t spellchecker.check();\n\t\t}\n\n\t\tfunction destroy() {\n\t\t spellchecker.destroy();\n\t\t spellchecker = null;\n\t\t}\n\n\t\tfunction toggle() {\n\t\t (!spellchecker) ? create() : destroy();\n\t\t}\n\n\t\treturn toggle;\n\t\t})();\n\n\t\twysihtml5.toolbar.find('[data-wysihtml5-command=\"spellcheck\"]').click(toggle);\n\t})();\n}", "title": "" }, { "docid": "5266a1e3cf257f5083659c71353de16f", "score": "0.5477324", "text": "function spellCheck() {\n let textEntered = testArea.value;\n let text = originText.innerHTML;\n let originTextMatch = text.substring(0,textEntered.length);\n if (textEntered == text) {\n clearInterval(interval);\n testWrapper.style.borderColor = \"#429890\";\n alert(\"well done!\");\n } else {\n if (textEntered == originTextMatch) {\n testWrapper.style.borderColor = \"#65CCf3\";\n } else {\n testWrapper.style.borderColor = \"#E95D0F\";\n }\n }\n\n}", "title": "" }, { "docid": "f2f9b8b3eedb898445a2256014df874f", "score": "0.54487646", "text": "function spellCheck() {\n let enteredText = testArea.value;\n let textMatch = originText.substring(0, enteredText.length);\n\n if (enteredText == originText) {\n testWrapper.style.borderColor = \"#429890\";\n clearInterval(interval);\n } else if (enteredText == textMatch) {\n testWrapper.style.borderColor = \"blue\";\n } else {\n testWrapper.style.borderColor = \"orange\";\n }\n}", "title": "" }, { "docid": "0b2a14f3ef559c659879bf6d7b7974b1", "score": "0.544171", "text": "function spellCheck(){\n let textAdded = testArea.value;\n let originMatchText = originText.substring (0,textAdded.length);\n\n if(textAdded == originText){\n clearInterval(interval);\n testWrapper.style.borderColor = \"green\";\n } else {\n if (textAdded == originMatchText){\n testWrapper.style.borderColor = \"blue\";\n } else{\n testWrapper.style.borderColor = \"red\";\n }\n } \n}", "title": "" }, { "docid": "fdd6cfa2ca42fc2faa2d39987f33952f", "score": "0.54379797", "text": "function AjaxSpellCheckController(editor)\r\n\t\t{\t\r\n\t\t\tthis.Editor = editor;\r\n\t\t\t\r\n\t\t\tthis._protectedData = [];\r\n\t\t\tthis._ignoreTags = new RegExp(\"(<!--)([\\\\s\\\\S]*?)(-->)\", \"gi\");\r\n\r\n\t\t\t//Variable to store original HTML\r\n\t\t\tthis.OriginalHtml = null;\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t//Localized messages\r\n\t\t\tthis.StartCheckMessage = editor.GetLocalizedString(\"SpellCheck\", \"Check spelling\");\r\n\t\t\tthis.FinalCheckMessage = editor.GetLocalizedString(\"SpellCheckEnd\", \"Finish spellchecking\");\t\t\t\r\n\t\t\tthis.CompleteMessage = editor.GetLocalizedString(\"SpellCheckComplete\", \"Spellchecking complete!\");\r\n\t\t\tthis.CancelMessage = editor.GetLocalizedString(\"Cancel\", \"Cancel\");\r\n\t\t\t\r\n\t\t\t//New messages\t\t\t\t\t\t\t\r\n\t\t\tthis.AddWordSuccessMessage = editor.GetLocalizedString(\"AddCustomWordSuccess\");\r\n\t\t\tthis.SpellingInProgressMessage = editor.GetLocalizedString(\"SpellingInProgress\");\r\n\t\t\tthis.SpellingModeMessage = editor.GetLocalizedString(\"SpellingMode\");\r\n\t\t\tthis.NoSpellingMistakesMessage = editor.GetLocalizedString(\"NoSpellingMistakes\", \"No mistakes found.\");\r\n\t\t\t\t\t\t\t\r\n\t\t\tthis.LoadingIcon = editor.GetImageUrl(\"../Img/loadingspell.gif\");\r\n\t\t\t\r\n\t\t\t//Create UI\t\t\t\t\r\n\t\t\tthis.CreateUI();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t}", "title": "" }, { "docid": "fdd6cfa2ca42fc2faa2d39987f33952f", "score": "0.54379797", "text": "function AjaxSpellCheckController(editor)\r\n\t\t{\t\r\n\t\t\tthis.Editor = editor;\r\n\t\t\t\r\n\t\t\tthis._protectedData = [];\r\n\t\t\tthis._ignoreTags = new RegExp(\"(<!--)([\\\\s\\\\S]*?)(-->)\", \"gi\");\r\n\r\n\t\t\t//Variable to store original HTML\r\n\t\t\tthis.OriginalHtml = null;\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t//Localized messages\r\n\t\t\tthis.StartCheckMessage = editor.GetLocalizedString(\"SpellCheck\", \"Check spelling\");\r\n\t\t\tthis.FinalCheckMessage = editor.GetLocalizedString(\"SpellCheckEnd\", \"Finish spellchecking\");\t\t\t\r\n\t\t\tthis.CompleteMessage = editor.GetLocalizedString(\"SpellCheckComplete\", \"Spellchecking complete!\");\r\n\t\t\tthis.CancelMessage = editor.GetLocalizedString(\"Cancel\", \"Cancel\");\r\n\t\t\t\r\n\t\t\t//New messages\t\t\t\t\t\t\t\r\n\t\t\tthis.AddWordSuccessMessage = editor.GetLocalizedString(\"AddCustomWordSuccess\");\r\n\t\t\tthis.SpellingInProgressMessage = editor.GetLocalizedString(\"SpellingInProgress\");\r\n\t\t\tthis.SpellingModeMessage = editor.GetLocalizedString(\"SpellingMode\");\r\n\t\t\tthis.NoSpellingMistakesMessage = editor.GetLocalizedString(\"NoSpellingMistakes\", \"No mistakes found.\");\r\n\t\t\t\t\t\t\t\r\n\t\t\tthis.LoadingIcon = editor.GetImageUrl(\"../Img/loadingspell.gif\");\r\n\t\t\t\r\n\t\t\t//Create UI\t\t\t\t\r\n\t\t\tthis.CreateUI();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t}", "title": "" }, { "docid": "c127d9a5ef5c570dcefa4b9393b47d72", "score": "0.54201216", "text": "function correctWord() {\n\tif ($(\"#errTypeC\" + num_corr).val() == \"None\") {\n\t\tdisplayWarning();\n\t} else {\n\t\t$(\"#commentBox\").before(getTrackChangesTable(num_corr));\n\t\ttrackChanges(num_corr, span_start);\n\t\tif (moving_phrase) {\n\t\t\tcommitMove();\n\t\t} else if (highlighting_mode == \"insert\") {\n\t\t\tcommitInsert();\n\t\t} else {\n\t\t\tcommitChange();\n\t\t}\n\t\tcleanUpUI();\n\t}\n\treturn false; // to stop MTurk from submitting the form early\n}", "title": "" }, { "docid": "4b562f460e15e9fc3a0259f422c458e7", "score": "0.54018956", "text": "function spellCheck() {\n let textEntered = testArea.value;\n let originTextMatch = originText.substring(0,textEntered.length);\n\n\n if (textEntered == originText) {\n clearInterval(interval);\n clearInterval(wpmInterval);\n testWrapper.style.borderColor = \"#429890\"; //Green\n } else {\n if (textEntered == originTextMatch) {\n testWrapper.style.borderColor = \"#65CCf3\"; //Blue\n } else {\n errors++;\n if (!(event.keyCode === 8)) {\n testWrapper.style.borderColor = \"#E95D0F\"; //Orange\n } else {\n errors--;\n }\n }\n }\n}", "title": "" }, { "docid": "03cd89e23e2781274fd639d097ec68e0", "score": "0.5396804", "text": "function checkContents(check,allowedImportCharacters ) {\r\n\r\n if (check.length === 1 && check === '#') {\r\n return false;\r\n }\r\n else {\r\n var re = /^[a-zA-Z0-9#\\-]*$/gi;\r\n if (allowedImportCharacters === true) {\r\n re = /^[a-zA-Z0-9#; \\-\\r\\n\\t\\*]*$/gi;\r\n }\r\n return re.test(check);\r\n }\r\n\r\n \r\n \r\n\r\n}", "title": "" }, { "docid": "2e05f17efa7abc45e90f338c94989687", "score": "0.5393965", "text": "spell(){\n //Keep Background:\n background(backgroundImg);\n whisper.display();\n hatch.display();\n imellia.display();\n ace.display();\n boss.display();\n\n //Open up book:\n if (this.attackPhase === 1){\n image(qImg[1], this.x, this.y);\n if (frameCount - startAttack > 60){\n this.attackPhase = 2;\n }\n return false;\n }\n //React to spell:\n if (this.attackPhase === 2){\n image(qImg[1], this.x, this.y);\n fill(255, 0, 0);\n text(\"-\" + this.sDamage, width/2, height/2);\n }\n if (frameCount - startAttack > 160){\n this.attackPhase = 1;\n return true;\n }\n }", "title": "" }, { "docid": "0bf51b4aba16dd66c798d1474d969ad6", "score": "0.5390184", "text": "function insideWordBoundaries(check, state, from, to) {\n return (from == 0 || check(state.sliceDoc(from - 1, from)) != _codemirror_state__WEBPACK_IMPORTED_MODULE_1__.CharCategory.Word) &&\n (to == state.doc.length || check(state.sliceDoc(to, to + 1)) != _codemirror_state__WEBPACK_IMPORTED_MODULE_1__.CharCategory.Word);\n}", "title": "" }, { "docid": "fe8143967b813caa7585b674abe510a1", "score": "0.53898156", "text": "function editorCheck(){\n if (document.htmlareas==undefined) {\n return true;\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "3a39551c8719cd4757d30f4a24ddec3a", "score": "0.5376389", "text": "function Misspelling(id, content, cb)\n\t\t\t{\n\t\t\t\tvar showcheckedmis = document.getElementById(id+\"_missp\")\n\t\t\t\t\t var realcontent = document.getElementById(id+\"_savecontentms\")\n\t\t\t\tif(showcheckedmis.innerHTML == \"\")\n\t\t\t\t{\n\t\t\t\t\tTranslate_or_Misspelling(\"/languageex/user/checkmisspelling\", \n\t\t\t\t\t\tMYPRIOEX , null, realcontent.value, function(data){\n\n\t\t\t\t\t\t\t if(typeof cb == \"function\")\n\t\t\t\t\t\t\t\t\t cb(data);//tra ve du lieu\n\n\t\t\t\t\t\tif(data.content.error == null){\n\t\t\t\t\t\t\tif(data.content.value == \"\"){\n\t\t\t\t\t\t\t\tif(data.content.language == MYPRIOEX)\n\t\t\t\t\t\t\t\t\t\t\t\tshowcheckedmis.innerHTML = \"Tin nhắn không lỗi.\"\n\t\t\t\t\t\t\t\t\t\t else\n\t\t\t\t\t\t\t\t\t\t\t\tshowcheckedmis.innerHTML = \"Tin nhắn không lỗi. Nhưng không đúng ngôn ngữ trao đổi.\"\n\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(id+\"_check\").style.color = \"#337ab7\"\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tif(data.content.language == MYPRIOEX){\n\t\t\t\t\t\t\t\t\tshowcheckedmis.innerHTML = \"Ý bạn là: \" + matchMisspelling(realcontent.value, data.content.value)\n\t\t\t\t\t\t\t\t\tdocument.getElementById(id+\"_check\").style.color = \"red\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tshowcheckedmis.innerHTML = \"Phát hiện ngôn ngữ: \" + data.content.language +\"(symbol)\"\n\t\t\t\t\t\t\t\t\tdocument.getElementById(id+\"_check\").style.color = \"yellow\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else\n\t\t\t\t\t\t\tshowcheckedmis.innerHTML = \"Không phù hợp với ngôn ngữ của bạn. Lỗi chính tả.\"\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "bb5e105c707ea7da7e0f6d04f6fa03bc", "score": "0.5368183", "text": "function spellCheck() {\n \n let textEntered = testArea.value;\n let originTextMatch = originText.substring(0, textEntered.length);\n var length=textEntered.length;\n\n \n if(textEntered == originText) {\n \n clearInterval(interval);\n this.removeEventListener('keypress',disable);\n var typeSpeed= Math.floor(length/(timer[0]*60 + timer[1]));\n p.innerHTML='Your typing speed is '+ typeSpeed+' characters per second.';\n div.appendChild(p);\n \n } else {\n \n if(textEntered == originTextMatch) {\n this.removeEventListener('keypress',disable);\n var remaining =originText.slice(length);\n var newhtml='<span class=\"highlight-green\">'+originTextMatch+'</span>' + remaining;\n document.querySelector(\"#origin-text p\").innerHTML=newhtml;\n \n \n } else { this.addEventListener('keypress',disable); \n \n var remaining2 =originText.slice(length);\n var newhtml2='<span class=\"highlight-green\">'+originTextMatch.slice(0,length-1)+'</span><span class=\"highlight-red\">'+originTextMatch.slice(length-1,length)+'</span>' + remaining2;\n document.querySelector(\"#origin-text p\").innerHTML=newhtml2; \n \n \n }\n }\n \n}", "title": "" }, { "docid": "7348400a927afff430ff01fa88975f9f", "score": "0.536271", "text": "check() {\n const cluesRegistry = this.cluesRegistry;\n let correct = 0;\n for (let clueCode in cluesRegistry) {\n const clueRegistry = cluesRegistry[clueCode];\n if (!clueRegistry.isCorrect) {\n break;\n }\n correct++;\n }\n if (correct == Object.keys(cluesRegistry).length) {\n this.element.trigger(CrosswordEvents.onSolved, [this]);\n }\n }", "title": "" }, { "docid": "c564089da9699755e128aea324384fb4", "score": "0.53371614", "text": "function spellCheck()\n{\n let textEntered=testArea.value;\n let originTextMatch=originText.substring(0,textEntered.length); //we want those number of characters of the origin text as we have entered in the text area to match both of these\n if(textEntered == originText) { //typing is complete\n clearInterval(interval); //to stop the timer\n testWrapper.style.borderColor = \"#33ff33\";\n let speed= Math.floor(4/(timer[1]/60));\n theResult.innerHTML=\"Speed in words per minute is \" + speed;\n theIncorrect.innerHTML=\"Number of letters you typed incorrectly is \" + errno;\n\n }\n else {\n if(textEntered == originTextMatch){ //if user is typing correctly\n testWrapper.style.borderColor= \"#65ccf3\";\n }\n else { //some error occurs while typing\n errno =errno +1;\n testWrapper.style.borderColor= \"#e95d0f\";\n }\n\n }\n \n}", "title": "" }, { "docid": "c77505a30ae9c1833991592371711cb4", "score": "0.53187543", "text": "function spellCheckInput() {\n let words = $('#wordinput').val().toLowerCase().split(' ');\n\n // Check all the words that have been fully typed, and must be in the dictionary\n let completeWords = words.slice(0, -1);\n for (word of completeWords) {\n let spelling = checkWord(word);\n if (!spelling.valid) {\n showSuggestion(word, spelling.suggestion);\n return;\n }\n }\n\n // Check the last word, that is possibly still being typed, and just needs to conform to a prefix\n let lastWord = words.slice(-1)[0];\n let spelling = checkWord(lastWord, /*isPartial*/ true);\n if (!spelling.valid) {\n showSuggestion(lastWord, spelling.suggestion);\n return;\n }\n\n // If we haven't returned out of the function by now, then all the words are good, and we reset the suggestion\n resetToValid();\n}", "title": "" }, { "docid": "42cd3049d50465b828c354c2734d950a", "score": "0.5283224", "text": "function spellCheck (word) {\n // have a real implementation.\n console.log(word)\n return ['Suggestion 1', 'Suggestion 2']\n}", "title": "" }, { "docid": "1f9fac38e0799c0c6b3393774107a943", "score": "0.52366465", "text": "spell(){\n //Keep background:\n background(backgroundImg);\n whisper.display();\n hatch.display();\n quill.display();\n ace.display();\n boss.display();\n\n //Prepare magic bubbles:\n if (this.attackPhase === 1){\n image(iImg[1], this.x, this.y);\n if (frameCount - startAttack > 60){\n this.attackPhase = 2;\n }\n return false;\n }\n //React to magic bubbles:\n if (this.attackPhase === 2){\n image(iImg[1], this.x, this.y);\n fill(255, 0, 0);\n text(\"-\" + this.sDamage, width/2, height/2);\n }\n if (frameCount - startAttack > 160){\n this.attackPhase = 1;\n return true;\n }\n }", "title": "" }, { "docid": "9d08bd44430fcce3185f77834b4ebf6f", "score": "0.5228127", "text": "function checkEditQuestValidation(){\n var contentCheck;\n var subCheck;\n var subcontent = $('#editsubject').val();\n var subData = ($('<div/>').html(subcontent).text()).trim();\n \n if(subData==\"\"){\n var subCheck = 0;\n $('#editsubject').addClass('content-error');\n $('#editsubjectMsg').html('*Subject required');\n }else{\n var subCheck = 1;\n $('#editsubject').removeClass('content-error');\n $('#editsubjectMsg').html('');\n }\n var content = CKEDITOR.instances['ForumEditComment'].getData();\n var data = content.replace(/<\\/?([a-z][a-z0-9])\\b[^>]>?/gi, '');\n var contentData = ($('<div/>').html(data).text()).trim();\n if(contentData==\"\"){\n var contentCheck = 0;\n $('#cke_ForumEditComment').addClass('content-error');\n $('#editcommentMsg').html('*Comment required');\n }else{\n var contentCheck = 1;\n $('#cke_ForumEditComment').removeClass('content-error');\n $('#editcommentMsg').html('');\n }\n\n if(subCheck && contentCheck){\n\t$('#loader', window.parent.document).show();\nreturn true;\n }\n return false;\n}", "title": "" }, { "docid": "c99cc976e53b06d76b20dd2a4c3cc7c7", "score": "0.5220768", "text": "function spellCheck() {\n let textEntered = textArea.value;\n let originTextMatch = originText.substring(0, textEntered.length);\n console.log(textEntered);\n console.log(originTextMatch);\n if(textEntered == originText) {\n clearInterval(interval);\n textWrapper.style.borderColor = \"#008000\";\n } else {\n if(textEntered == originTextMatch) {\n textWrapper.style.borderColor = \"#65CCF3\";\n } else\n textWrapper.style.borderColor = \"#E95D0f\";\n }\n\n // console.log(textEntered);\n}", "title": "" }, { "docid": "fc3d459bc35b8b2ab64c1f08ba356e26", "score": "0.52200484", "text": "function insideWord(check, state, from, to) {\n return check(state.sliceDoc(from, from + 1)) == CharCategory.Word\n && check(state.sliceDoc(to - 1, to)) == CharCategory.Word;\n }", "title": "" }, { "docid": "fa45e0ddf1c1617e40cd24cfdf1d0fe8", "score": "0.51587206", "text": "hasTexts(editor, element) {\n return element.children.every(n => Text.isText(n));\n }", "title": "" }, { "docid": "bc913fa4d8e65a6a4cc5ad7931765513", "score": "0.5153521", "text": "function CheckForChanges()\n{\n if( textChanged ) {\n var line = edit.GetCursorLine();\n if( lastLine != line ) SetEditorColours();\n lastLine = line;\n }\n //xx timer = setTimeout( \"CheckForChanges()\", 500 );\n}", "title": "" }, { "docid": "6b24c82521e6ef320668830b2712bdc4", "score": "0.5134613", "text": "function isExplicit (toDoText){\n\n if(!filterIsOn)\n return false;\n\n return Dictionary.badWords.some(function (item){\n return toDoText.toLowerCase().indexOf(item.toLowerCase()) > -1\n });\n }", "title": "" }, { "docid": "dffb7bc1e5188f430a114e9efd32b0bd", "score": "0.51194054", "text": "function checkWord(user_data) {\n $.post(\"/api/aussi/\", {\n feeling: user_data.emotion\n }).then(function(data) {\n word = (data.words[0].word)\n definition = (data.words[0].definition)\n console.log(word)\n console.log(definition)\n displayMatches()\n // If there's an error, log the error\n }).catch(function(err) {\n console.log(err);\n });\n }", "title": "" }, { "docid": "4ec26f7f743f6563cd64467e841333c0", "score": "0.51179755", "text": "function check(e){\n var words = e.val().split(' ');\n var numWords = words.length;\n //console.log(numWords);\n\n if (numWords === 1 && words[0]){ // less than 2 words?\n $('#issues').html('<span class=\"red\">Must be longer than 1 word</span>');\n $(\"#submit\").addClass(\"disabled\");\n }\n \n else if (numWords === 2 && words[0] && twoWords(\" \"+words[0]+\" \")){ // contains a bad 1st word in 2 word phrase\n $('#issues').html('<span class=\"red\">2 word invocation starts with an article or preposition</span>');\n $(\"#submit\").addClass(\"disabled\");\n }\n\n else if (words[0] && problemWords(\" \"+e.val()+\" \")){\n $('#issues').html('<span class=\"red\">Contains a keyword that often causes issues</span>');\n $(\"#submit\").addClass(\"disabled\");\n }\n\n else if (words[0] && alexaKeywords(\" \"+e.val()+\" \")){\n $('#issues').html('<span class=\"red\">Contains a reserved keyword</span>');\n $(\"#submit\").addClass(\"disabled\");\n }\n\n else {\n $('#issues').html('&nbsp;');\n $(\"#submit\").removeClass(\"disabled\");\n }\n \n}", "title": "" }, { "docid": "88a839014ce856183fd2635804726986", "score": "0.51049966", "text": "function grabDidYouMeanInput(doc) {\r\n\t\t\treturn $(doc).find(\".spell\").filter('a').eq(0).text();\r\n\t\t}", "title": "" }, { "docid": "d084b146ac99023d29836205f19c7fb6", "score": "0.5090235", "text": "function spellCheck(sentence, timeout, check, end, error) {\n // due to PNU server's weired logic\n const data = split(sentence.replace(/\\n/g, \"\\n \"), PUSAN_UNIV_MAX_WORDS);\n var count = data.length;\n\n const getResponse = function (err, response, body) {\n count--;\n if (!err && response.statusCode == 200) {\n if (body.indexOf(\"<title>한국어 맞춤법/문법 검사기</title>\") == -1) {\n console.error(\"-- 한스펠 오류: \" +\n \"부산대 서비스가 유효하지 않은 양식을 반환했습니다. (\" +\n PUSAN_UNIV_URL + \")\");\n if (error) error(err);\n } else {\n check(getJSON(body));\n }\n } else {\n console.error(\"-- 한스펠 오류: \" +\n \"부산대 서버의 접속 오류로 일부 문장 교정에 실패했습니다.\");\n if (error) error(err);\n }\n if (count == 0 && end != null) end();\n };\n\n for (var i = 0; i < data.length; ++i) {\n request.post({\n url: PUSAN_UNIV_URL,\n timeout: timeout,\n form: {\n text1: data[i]\n }\n }, getResponse);\n }\n}", "title": "" }, { "docid": "3d0ac50b59bf42d72c6bf34b872ce985", "score": "0.508367", "text": "function spellCheckFile(file, options, settings) {\n const doc = {\n uri: vscode_uri_1.URI.file(file).toString(),\n };\n return spellCheckDocument(doc, options, settings);\n}", "title": "" }, { "docid": "66518627f75301decc2f3640ac1a939f", "score": "0.50806713", "text": "async function axe2ace(spineItem, axeResults, lang) {\n\n return new Promise((resolve, reject) => {\n\n winston.verbose(`Converting aXe results to ace for ${spineItem.relpath}`);\n\n function l10nDoneCallback() {\n \n const kbMap = axeRulesKbMapping;\n \n // the content doc-level assertion\n const assertion = new builders.AssertionBuilder()\n .withSubAssertions()\n .withTestSubject(spineItem.relpath, spineItem.title);\n // process axe's individual checks for a single content document\n // console.log(\"axe2ace ------- \", JSON.stringify(axeResults, null, 4));\n axeResults.violations.forEach((violation) => {\n \n const kbURL = (kbMap.map.hasOwnProperty(violation.id))\n ? kbMap.baseUrl + kbMap.map[violation.id].url\n : kbMap.baseUrl;\n let kbTitle = (kbMap.map.hasOwnProperty(violation.id))\n ? kbMap.map[violation.id].title\n : '??';\n if (kbTitle == '??') {\n winston.verbose(`Couldn’t find KB key for rule '${violation.id}'`);\n kbTitle = localize(\"nokb\");\n }\n const test = new builders.TestBuilder()\n .withImpact(violation.impact)\n .withTitle(violation.id)\n .withDescription(violation.description)\n .withHelp(kbURL, kbTitle, violation.help)\n .withRulesetTags(violation.tags)\n .build();\n \n violation.nodes.forEach((node) => {\n \n let description = node.failureSummary;\n \n // https://github.com/dequelabs/axe-core/blob/v3.2.2/lib/core/reporters/helpers/failure-summary.js\n // // https://github.com/dequelabs/axe-core/blob/v3.2.2/lib/misc/none-failure-summary.json#L4\n // Fix all of the following:\n // // https://github.com/dequelabs/axe-core/blob/v3.2.2/locales/fr.json#L664\n // Corriger tous les éléments suivants :\n // // https://github.com/dequelabs/axe-core/blob/v3.2.2/lib/misc/any-failure-summary.json#L4\n // Fix any of the following:\n // // https://github.com/dequelabs/axe-core/blob/v3.2.2/locales/fr.json#L656\n // Corriger l’un des éléments suivants :\n \n // TODO: this is a hacky way to fix the Axe bug that forces the wrong language (en) into `failureSummary`.\n description = description.replace(/Fix any of the following:/g, \"\");\n description = description.replace(/Fix all of the following:/g, \"\");\n description = description.trim();\n description = description.replace(/[\\n]+/g, \"\\n\");\n description = description.replace(/\\n/g, \" --- \");\n description = description.replace(/\\s+/g, \" \");\n description = description.replace(/ --- /g, \"\\n\");\n \n let target = node.target;\n let targetCFI = node.targetCFI;\n let html = node.html;\n \n const allAnyArrayItems = [];\n if (node.any) {\n node.any.forEach((anyItem) => {\n allAnyArrayItems.push(anyItem);\n });\n }\n if (node.all) {\n node.all.forEach((allItem) => {\n allAnyArrayItems.push(allItem);\n });\n }\n allAnyArrayItems.forEach((item) => {\n if (item.relatedNodes) {\n item.relatedNodes.forEach((relatedNode) => {\n if (relatedNode.html && relatedNode.target && relatedNode.target.length && relatedNode.targetCFI && relatedNode.targetCFI.length) {\n html += \" <!--##--> \";\n html += relatedNode.html;\n \n target.push(relatedNode.target[0]);\n targetCFI.push(relatedNode.targetCFI[0]);\n }\n });\n }\n });\n \n assertion.withAssertions(\n new builders.AssertionBuilder()\n .withAssertedBy('aXe')\n .withMode('automatic')\n .withTest(test)\n .withResult(\n new builders.ResultBuilder('fail')\n .withDescription(description)\n .withPointer(target, targetCFI)\n .withHTML(html)\n .build())\n .build());\n });\n });\n \n const ass = assertion.build();\n resolve(ass);\n }\n if (lang) {\n setCurrentLanguage(lang, l10nDoneCallback);\n } else {\n l10nDoneCallback();\n }\n });\n}", "title": "" }, { "docid": "6625ff122cb3cfd3c292937a228c6f16", "score": "0.5057713", "text": "function initAce() {\n langtools.addCompleter({\n getCompletions: function(editor, session, pos, prefix, callback) {\n let results = [];\n const mode = session.getMode().$id;\n if ( mode === 'ace/mode/javascript' ) {\n const token = session.getTokenAt(pos.row, pos.column);\n if ( token && token.type === 'identifier' ) {\n const forPrefix = function() {\n if ( /^[a-z2]$/.test(token.value) ) {\n results = emlc.acePrefixesSjs;\n }\n };\n if ( token.index < 2 ) {\n forPrefix();\n }\n else {\n const tokens = session.getTokens(pos.row);\n const dot = tokens[token.index - 1];\n const prefix = tokens[token.index - 2];\n if ( dot.type === 'punctuation.operator' && dot.value === '.' && prefix.type === 'identifier' ) {\n results = emlc.aceFunctionsSjs[prefix.value];\n }\n else {\n forPrefix();\n }\n }\n }\n }\n else if ( mode === 'ace/mode/xquery' ) {\n const token = session.getTokenAt(pos.row, pos.column);\n if ( token && token.type === 'support.function' ) {\n const tok = token.value;\n if ( tok.length === prefix.length ) {\n if ( /^[a-z2]$/.test(tok) ) {\n results = emlc.acePrefixesXqy;\n }\n }\n else {\n const parts = tok.split(':');\n if ( parts.length === 2 ) {\n results = emlc.aceFunctionsXqy[parts[0]];\n }\n }\n }\n }\n callback(null, results);\n }\n // getDocTooltip: function(item) {\n // item.docHTML = '<b>Foobar</b><hr></hr><em>Blabla</em>';\n // }\n });\n }", "title": "" }, { "docid": "0f47dee38713ad04fba575a7375ca79d", "score": "0.5054181", "text": "function validateWords(){\r\n animateSubmitButton();\r\n disableUserInput();\r\n const fetchedWord = wordToType.innerText;\r\n\r\n const fetchedWordConsonants = fetchedWord\r\n .split(\"\")\r\n .map(letter => letter.replace(/[aeiou]/g, ''))\r\n .join(\"\")\r\n .toLowerCase();\r\n\r\n if (fetchedWordConsonants === userInput.value.toLowerCase()) {\r\n userWins();\r\n } else {\r\n userLoses();\r\n }\r\n}", "title": "" }, { "docid": "625a9edc8d70b012a9e66e27e3da14dd", "score": "0.50457764", "text": "function lintCode() {\n lint(editor.getValue());\n editorChanged = true;\n }", "title": "" }, { "docid": "2ff85098fcd570af24f3ea21db3b962b", "score": "0.5042782", "text": "function spellCheck() {\n let textEntered = testArea.value;\n let originTextMatch = paragragh_text.substring(0, textEntered.length);\n\n if (textEntered == paragragh_text) {\n let flashInterval = setInterval(flashTimer, 200);\n\n showAlertSuccess();\n\n theTimer.classList.add('green');\n theTimer.classList.add('flash')\n theTimer.style.cssText = \"color: #FFFFFF\"\n originTextContainer.classList.toggle('matched');\n\n setTimeout(() => {\n result();\n clearInterval(flashInterval);\n flashInterval = null;\n }, 1000);\n\n clearInterval(my_interval)\n testWrapper.style.borderColor = \"#008000\";\n\n } else if (textEntered == originTextMatch) {\n testWrapper.style.borderColor = \"#008000\";\n theTimer.style.cssText = \"color: #FFFFFF\"\n\n } else {\n testWrapper.style.borderLeftColor = \"#f32424\";\n testWrapper.style.borderRightColor = \"#f32424\";\n theTimer.style.cssText = \"color: #750d0d\"\n testWrapper.style.transition = \".4s\";\n }\n}", "title": "" }, { "docid": "a28d4dcbbb774f59c1765356b77106bd", "score": "0.5021365", "text": "check_if_passed() {\n const script = document.getElementById(\"inline-script\");\n if (script.textContent.search(\"inline_script_value\") < 0) {\n console.error(this.describe() + \" failed, failed to find normal ASCII text in script\");\n return false;\n }\n if (script.textContent.search(\"🆃\") < 0) {\n console.error(this.describe() + \" failed, failed to find boxed T in script\");\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "e0382f4bb9bdac376ae5b30d92a3c85c", "score": "0.5021065", "text": "checkAnswer(btnArticle) {\n const answerIndex = this.words.findIndex(word => this.currentWord.word === word.word);\n const activeWord = this.words[answerIndex];\n if (btnArticle === this.currentWord.art) {\n ui.displayAnswer('correct');\n this.nextQuestion();\n if (activeWord.prio !== 1) activeWord.prio -= 1;\n } else {\n ui.displayAnswer('wrong');\n if (activeWord.prio !== 5) activeWord.prio += 1;\n }\n console.table(this.words);\n }", "title": "" }, { "docid": "13a434ee351c4e184cb15a953c65091f", "score": "0.50189394", "text": "function spellCity(){\n var city = document.getElementById(\"city\").value;\n // Make sure the first letter is capitalized\n if(city === \"Detroit\"){\n rightCount++;\n document.getElementById(\"spellResult\").innerHTML = \"Right!\";\n console.log(\"City spelled right\");\n console.log(\"Right: \" + rightCount + \" Wrong: \" + wrongCount);\n\n // Hide previous question and display the next after a correct answer\n $(\"#hometownSpell\").hide();\n $(\"#result1\").hide();\n $(\"#spellResult\").hide();\n $(\"#correct1\").show();\n $(\"#band\").show();\n } else {\n wrongCount++;\n document.getElementById(\"spellResult\").innerHTML = \"Wrong! Try again...\";\n console.log(\"City spelled wrong\");\n console.log(\"Right: \" + rightCount + \" Wrong: \" + wrongCount);\n }\n // if(city.substring(0,1) === city.substring(0,1).toLowerCase){\n // console.log(\"lower case\");\n // }\n // document.getElementById(\"rightCount\").innerHTML = rightCount;\n // document.getElementById(\"wrongCount\").innerHTML = wrongCount;\n}", "title": "" }, { "docid": "e32bc6dac43822727e2186fa58ea3fa8", "score": "0.50074583", "text": "function updateSpell(in_element) {\n var spell_element = in_element.parentNode.parentNode;\n getSpellData(spell_element, function(data) {\n runQuery(\"update\", \"spell\", data, false, true);\n });\n}", "title": "" }, { "docid": "9bb8caea39425575a2798df65f050f43", "score": "0.5001586", "text": "_enableTypingHandling() {\n\t\tconst editor = this.editor;\n\n\t\tconst watcher = new TextWatcher( editor.model, text => {\n\t\t\t// 1. Detect <kbd>Space</kbd> after a text with a potential link.\n\t\t\tif ( !isSingleSpaceAtTheEnd( text ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// 2. Check text before last typed <kbd>Space</kbd>.\n\t\t\tconst url = getUrlAtTextEnd( text.substr( 0, text.length - 1 ) );\n\n\t\t\tif ( url ) {\n\t\t\t\treturn { url };\n\t\t\t}\n\t\t} );\n\n\t\tconst input = editor.plugins.get( 'Input' );\n\n\t\twatcher.on( 'matched:data', ( evt, data ) => {\n\t\t\tconst { batch, range, url } = data;\n\n\t\t\tif ( !input.isInput( batch ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst linkEnd = range.end.getShiftedBy( -1 ); // Executed after a space character.\n\t\t\tconst linkStart = linkEnd.getShiftedBy( -url.length );\n\n\t\t\tconst linkRange = editor.model.createRange( linkStart, linkEnd );\n\n\t\t\tthis._applyAutoLink( url, linkRange );\n\t\t} );\n\n\t\twatcher.bind( 'isEnabled' ).to( this );\n\t}", "title": "" }, { "docid": "950c36d5ea07ebe0ddb636a00dd3c770", "score": "0.49720144", "text": "function processEnteredText()\n//input of text area\n{\n currentInput=input.value;\n //splitting it\n currentInputArray=currentInput.split(\"\");\n //increment character typed\n characterTyped++;\n errors=0;\n //getting the current quote span array\n quoteSpanArray=quote.querySelectorAll(\"span\");\n for(let i=0;i<quoteSpanArray.length;i++) {\n //quote character\n let char=quoteSpanArray[i]\n //typed character\n let typedChar=currentInputArray[i];\n //if null\n if(typedChar==null){\n //remove classes\n char.classList.remove('correct-char')\n char.classList.remove('incorrect-char')\n \n }\n //if matches\n else if(typedChar==char.innerText){\n char.classList.add(\"correct-char\")\n char.classList.remove(\"incorrect-char\")\n \n }\n //if not matches\n else{\n char.classList.remove(\"correct-char\")\n char.classList.add(\"incorrect-char\")\n errors++\n }\n }\n //displaying the errors\n error.innerText=totalErros+errors;\n //correct charcters typed\n let correctCharacters=(characterTyped-(totalErros+errors));\n //accuracy level \n let accuracyVal=((correctCharacters/characterTyped)*100)\n //displayi accuracy\n accuracy.innerText=Math.round(accuracyVal)\n //current array and input text length matches change the quote\n if(currentInput.length==currentQuote.length){\n updateQuote()\n //update total eros\n totalErros=totalErros+errors\n //reset text field\n input.value=\"\"\n }\n}", "title": "" }, { "docid": "24b3975c0e4734edcdb7976f393997fd", "score": "0.494685", "text": "function updateSearchSpellCheck(data) {\n $('#searchSpellCheck').hide();\n if (!data.spellCheck.empty) {\n var $link = $('#searchSpellCheck a');\n $link.html(data.spellCheck.markup);\n $link.off('click');\n $link.click(function () {\n currentPage = 1;\n $('#terms').val(data.spellCheck.query);\n search();\n return false;\n });\n $('#searchSpellCheck').show();\n }\n}", "title": "" }, { "docid": "611f18496bd9b1909d3cf5ad70d14122", "score": "0.4935918", "text": "function check(editor) {\n if (!editor) {\n return false;\n }\n\n var mode = editor._getModeFromDocument();\n if (mode !== \"gfm\" && mode !== \"markdown\") {\n return false;\n }\n\n var cursor = editor.getCursorPos(false, \"to\");\n if (!cursor.line) {\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "a085fdf7ad6b33263a6fd2a18e350b4a", "score": "0.49313307", "text": "function check(qwerty) {\n countdown = false\n for (i = 0; i < currentWord.length; i++) {\n // console.log(qwerty); console.log(currentWord);\n\n if (qwerty === currentWord[i].toLowerCase()) {\n countdown = true\n \n answer[i] = qwerty;\n degrassi.innerHTML = answer.join(\" \");\n targetHint();\n checkWord();\n } else {\n // console.log(lives)\n checkWord();\n }\n\n }\n}", "title": "" }, { "docid": "fa70acca6a3207501ada927fafd5ff84", "score": "0.49288985", "text": "function insideWordBoundaries(check, state, from, to) {\n return (from == 0 || check(state.sliceDoc(from - 1, from)) != CharCategory.Word) &&\n (to == state.doc.length || check(state.sliceDoc(to, to + 1)) != CharCategory.Word);\n }", "title": "" }, { "docid": "f0fdccc82f91e7e8c8de500066cab6a2", "score": "0.4927774", "text": "function checkAll() {\r\n $('#error_ans').html('');\r\n var error=0;\r\n // check ck editor contents..\r\n if (CKEDITOR.instances.ckeditor.getData() == '') {\r\n // here, ckeditor denotes class..\r\n $('#error_ans').css('color','#ff0000').append('<br><b>Please fill shirt fabric description</b>');\r\n error=1;\r\n } \r\n if(error==0) {\r\n return true;\r\n } \r\n else {\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "d68f585ad11d502b972525034d6014ad", "score": "0.49229273", "text": "function checkValidation(id) {\n\tvar sid = 'quest' + id;\n\tvar content = CKEDITOR.instances[sid].getData();\n\tvar data = content.replace(/<\\/?([a-z][a-z0-9]*)\\b[^>]*>?/gi, '');\n\tvar contentData = ($('<div/>').html(data).text()).trim();\n\tif (contentData == \"\") {\n\t\t$('#cke_quest' + id).addClass('content-error');\n\t\t$('#reply1').html('*Comment required');\n\t\treturn false;\n\t}\n\t$('#loader', window.parent.document).show();\n}", "title": "" }, { "docid": "8149a429266816031915984181d4c78b", "score": "0.4909329", "text": "CheckCanEdit() {\n }", "title": "" }, { "docid": "cab51cebc4ac81859ba7c4d936289af7", "score": "0.49078125", "text": "function spellCheck(sentence, timeout, check, end, error) {\n if (sentence.length === 0) {\n if (end !== null) {\n end();\n }\n return;\n }\n\n // Removes HTML tags.\n sentence = sentence.replace(/<[^ㄱ-ㅎㅏ-ㅣ가-힣>]+>/g, '');\n const data = split(sentence, '.,\\n', DAUM_MAX_CHARS);\n let count = data.length;\n\n const getResponse = (err, response, body) => {\n count -= 1;\n if (!err && response.statusCode === 200) {\n if (body.indexOf('=\"screen_out\">맞춤법 검사기 본문</h2>') === -1) {\n console.error(\n `-- 한스펠 오류: 다음 서비스가 유효하지 않은 양식을 반환했습니다. (${DAUM_URL})`,\n );\n console.log(body);\n if (error) error(err);\n } else {\n check(parseJSON(body));\n }\n } else {\n console.error(\n '-- 한스펠 오류: 다음 서버의 접속 오류로 일부 문장 교정에 실패했습니다.',\n );\n if (error) error(err);\n }\n if (count === 0 && end !== null) end();\n };\n\n let i = 0;\n\n function post() {\n request.post(\n {\n url: DAUM_URL,\n timeout,\n form: {\n sentence: data[i],\n },\n },\n getResponse,\n );\n\n i += 1;\n if (i < data.length) {\n setTimeout(post, DAUM_MIN_INTERVAL);\n }\n }\n\n post();\n}", "title": "" }, { "docid": "7c0cb0aae9e5a37fe8698f7f7e83ccd4", "score": "0.48869327", "text": "function spellCheck() {\n let textEntered = testArea.value;\n let originTextMatch = originText.substring(0, textEntered.length);\n\n if (textEntered == originText) {\n clearInterval(interval);//this will stop the timer when the test is done correctly.\n testWrapper.style.borderColor = \"black\";//if test is done perfectly it gives black.\n } else {\n if (textEntered == originTextMatch) {\n testWrapper.style.borderColor = \"green\";// if the subString matches it gives green\n } else {\n testWrapper.style.borderColor = \"red\";//else it will give red\n }\n }\n}", "title": "" }, { "docid": "78b7753f157d147c224ec4032f3360d8", "score": "0.4874777", "text": "function check(){\r\n get_answer = document.getElementById('word').value;\r\n answer = get_answer.toLowerCase();\r\n console.log(\"User's answer in lowercase \" + answer);\r\n if(answer == word){\r\n score()\r\n }\r\n question_turn()\r\n answer_turn()\r\n \r\n \r\n}", "title": "" }, { "docid": "33e942bfcd5a98b6547e14320eb6dd70", "score": "0.48746163", "text": "spell(){\n //Keep background:\n background(backgroundImg);\n quill.display();\n hatch.display();\n imellia.display();\n ace.display();\n whisper.display();\n\n //Prepare shadow balls for spell:\n if (this.attackPhase === 1){\n boss.display();\n for (let i = 0; i <= SBAMOUNT; i++){\n sbArray.push(new ShadowBall(width/2, height/2));\n }\n for (let c = 0; c < sbArray.length; c++){\n sbArray[c].resetPos();\n }\n\n if (frameCount - startAttack > 2){\n this.attackPhase = 2;\n }\n return false;\n }\n\n //Cast the magic on characters:\n if (this.attackPhase === 2){\n\n image(bImg[1], this.x, this.y);\n for (let c = 0; c < sbArray.length; c++){\n sbArray[c].cast(c);\n }\n\n if (frameCount - startAttack > 120){\n this.attackPhase = 3;\n }\n return false;\n }\n\n //React to magic:\n if (this.attackPhase === 3){\n image(bImg[1], this.x, this.y);\n\n if (whisper.status() > 0){\n if (defence === 1){\n fill(200);\n text(\"DEFENDED\", width/5, height/6.5 - height/20);\n }\n else{\n fill(255, 0, 0);\n text(\"-\" + this.sDamage1, width/5, height/6.5);\n }\n } if (quill.status() > 0){\n if (defence === 2){\n fill(200);\n text(\"DEFENDED\", width/25, height/4 - height/20);\n }\n else{\n fill(255, 0, 0);\n text(\"-\" + this.sDamage2, width/25, height/4);\n }\n } if (hatch.status() > 0){\n if (defence === 3){\n fill(200);\n text(\"DEFENDED\", hatch.getLocation(1), hatch.getLocation(2) - height/20);\n }\n else{\n fill(255, 0, 0);\n text(\"-\" + this.sDamage1, hatch.getLocation(1), hatch.getLocation(2));\n }\n } if (imellia.status() > 0){\n if (defence === 4){\n fill(200);\n text(\"DEFENDED\", width/25, height/2 - height/20);\n }\n else{\n fill(255, 0, 0);\n text(\"-\" + this.sDamage2, width/25, height/2);\n }\n } if (ace.status() > 0){\n if (defence === 5){\n fill(200);\n text(\"DEFENDED\", width/5, height/1.6 - height/20);\n }\n else{\n fill(255, 0, 0);\n text(\"-\" + this.sDamage1, width/5, height/1.6);\n }\n }\n }\n\n if (frameCount - startAttack > 180){\n this.attackPhase = 1;\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "b4c771f958cf2b383b08214007d6146a", "score": "0.48722467", "text": "function lintContent(ruleList, name, content, config, frontMatter, noInlineConfig, resultVersion, callback) {\n // Remove UTF-8 byte order marker (if present)\n content = content.replace(/^\\ufeff/, \"\");\n // Remove front matter\n var removeFrontMatterResult = removeFrontMatter(content, frontMatter);\n var frontMatterLines = removeFrontMatterResult.frontMatterLines;\n // Ignore the content of HTML comments\n content = shared.clearHtmlCommentText(removeFrontMatterResult.content);\n // Parse content into tokens and lines\n var tokens = md.parse(content, {});\n var lines = content.split(shared.newLineRe);\n annotateTokens(tokens, lines);\n var aliasToRuleNames = mapAliasToRuleNames(ruleList);\n var effectiveConfig = getEffectiveConfig(ruleList, config, aliasToRuleNames);\n var enabledRulesPerLineNumber = getEnabledRulesPerLineNumber(ruleList, lines, frontMatterLines, noInlineConfig, effectiveConfig, aliasToRuleNames);\n // Create parameters for rules\n var params = {\n name: name,\n tokens: tokens,\n lines: lines,\n frontMatterLines: frontMatterLines\n };\n shared.makeTokenCache(params);\n // Function to run for each rule\n var result = (resultVersion === 0) ? {} : [];\n function forRule(rule) {\n // Configure rule\n var ruleNameFriendly = rule.names[0];\n var ruleName = ruleNameFriendly.toUpperCase();\n params.config = effectiveConfig[ruleName];\n function throwError(property) {\n throw new Error(\"Property '\" + property + \"' of onError parameter is incorrect.\");\n }\n var errors = [];\n function onError(errorInfo) {\n if (!errorInfo ||\n !errorInfo.lineNumber ||\n !shared.isNumber(errorInfo.lineNumber)) {\n throwError(\"lineNumber\");\n }\n if (errorInfo.detail &&\n !shared.isString(errorInfo.detail)) {\n throwError(\"detail\");\n }\n if (errorInfo.context &&\n !shared.isString(errorInfo.context)) {\n throwError(\"context\");\n }\n if (errorInfo.range &&\n (!Array.isArray(errorInfo.range) ||\n (errorInfo.range.length !== 2) ||\n !shared.isNumber(errorInfo.range[0]) ||\n !shared.isNumber(errorInfo.range[1]))) {\n throwError(\"range\");\n }\n errors.push({\n \"lineNumber\": errorInfo.lineNumber + frontMatterLines.length,\n \"detail\": errorInfo.detail || null,\n \"context\": errorInfo.context || null,\n \"range\": errorInfo.range || null\n });\n }\n // Call (possibly external) rule function\n rule[\"function\"](params, onError);\n // Record any errors (significant performance benefit from length check)\n if (errors.length) {\n errors.sort(lineNumberComparison);\n var filteredErrors = errors\n .filter(uniqueFilterForSortedErrors)\n .filter(function removeDisabledRules(error) {\n return enabledRulesPerLineNumber[error.lineNumber][ruleName];\n })\n .map(function formatResults(error) {\n if (resultVersion === 0) {\n return error.lineNumber;\n }\n var errorObject = {};\n errorObject.lineNumber = error.lineNumber;\n if (resultVersion === 1) {\n errorObject.ruleName = ruleNameFriendly;\n errorObject.ruleAlias = rule.names[1] || rule.names[0];\n }\n else {\n errorObject.ruleNames = rule.names;\n }\n errorObject.ruleDescription = rule.description;\n errorObject.errorDetail = error.detail;\n errorObject.errorContext = error.context;\n errorObject.errorRange = error.range;\n return errorObject;\n });\n if (filteredErrors.length) {\n if (resultVersion === 0) {\n result[ruleNameFriendly] = filteredErrors;\n }\n else {\n Array.prototype.push.apply(result, filteredErrors);\n }\n }\n }\n }\n // Run all rules\n try {\n ruleList.forEach(forRule);\n }\n catch (ex) {\n shared.makeTokenCache(null);\n return callback(ex);\n }\n shared.makeTokenCache(null);\n callback(null, result);\n}", "title": "" }, { "docid": "d61108d0a316118909d8941dd67cf79b", "score": "0.4838499", "text": "constructor() {\n this.spellCheckHandler = new SpellCheckHandler();\n }", "title": "" }, { "docid": "1f583e5bf85b025b3350d0b7d757695a", "score": "0.48204142", "text": "function checkAllMarked(){\r\n\t\tconst box1 = upperLeft.innerText;\r\n\t\tconst box2 = upperCenter.innerText;\r\n\t\tconst box3 = upperRight.innerText;\r\n\t\tconst box4 = middleLeft.innerText;\r\n\t\tconst box5 = middleCenter.innerText;\r\n\t\tconst box6 = middleRight.innerText;\r\n\t\tconst box7 = bottomLeft.innerText;\r\n\t\tconst box8 = bottomCenter.innerText;\r\n\t\tconst box9 = bottomRight.innerText;\r\n\t\t\r\n\t\tif(box1 !==\"*\" && box2!==\"*\" &&\r\n\t\tbox3!== \"*\" && box4!== \"*\" &&\r\n\t\tbox5 !== \"*\" && box6!== \"*\" &&\r\n\t\tbox7!== \"*\" && box8!== \"*\"){\r\n\t\t\t\r\n\t\t\talert(\"Cat's game!\");\r\n\t\t\tresetGame();\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "4dac6c91e888df9e902281b510b25f32", "score": "0.48172098", "text": "function checkAskValidation(){\n\tvar variable = 0;\n\tvar variable1 = 0;\n\tvar subjectData = $('#subject').val().trim();\n\tif(subjectData == \"\"){\n\t\t$('#subject').addClass('content-error');\n\t\t$('#subject-error-msg').html('*Subject required');\n\t\tvariable = 0;\n\t\t}else{\n\t\t\t$('#subject').removeClass('content-error');\n\t\t\t$('#subject-error-msg').html('');\n\t\t\tvariable = 1;\n\t\t}\n\tvar content = CKEDITOR.instances[\"content\"].getData();\n\tvar data = content.replace(/<\\/?([a-z][a-z0-9]*)\\b[^>]*>?/gi, '');\n\tvar contentData = ($('<div/>').html(data).text()).trim();\n\tif (contentData == \"\") {\n\t\t$('#cke_content').addClass('content-error');\n\t\t$('#content-error-msg').html('*Comment required');\n\t\tvariable1 = 0;\n\t}else{\n\t\t$('#cke_content').removeClass('content-error');\n\t\t$('#content-error-msg').html('');\n\t\tvariable1 = 1;\n\t}\n\tif(variable && variable1){\n\t\t$('#loader', window.parent.document).show();\n\t\treturn true;\n\t\t}\n\t return false;\n\n}", "title": "" }, { "docid": "cf10976b23e87b46b8ec5a2c760f7479", "score": "0.47974545", "text": "function difficultyChecker() {\n\tlet lettersDisplay = document.querySelectorAll('.hidden-word .hidden-letter');\n\n\tif (difficultyBtn.classList.contains('easy')) {\n\t\thiddenWord.forEach((letter, index) => {\n\t\t\tif (isVowel(letter)) {\n\t\t\t\tcorrectLettersList.push(letter);\n\t\t\t\tlettersDisplay[index].textContent = letter;\n\t\t\t}\n\t\t});\n\t}\n\n\treturn lettersDisplay;\n}", "title": "" }, { "docid": "3c3f640b60593c55721d10fd38539f66", "score": "0.4795801", "text": "function main(){\n if(app.selection.length != 0){\n mS = myDoc.selection[0];\n if(mS.constructor.name == \"Text\" || mS.constructor.name == \"Word\"){\n //see if they’re words or spaces\n try{\n var spaces = mS.contents.match(/\\s/g).length;\n if(mS.contents.length <= 3){\n letters(mS);\n } else {\n words(mS,spaces);\n }\n } catch(err) {\n //No spaces found\n letters(mS);\n }\n }else{\n alert(app.activeDocument.selection[0].constructor.name+\"\\nPlease select some text\");\n exit();\n }\n }else{\n alert(\"Nothing selected\\nPlease select some text\");\n }\n}", "title": "" }, { "docid": "28de5b66fce38b317edfd5ce08dffa83", "score": "0.47907498", "text": "function wordCheck(word, standard) {\n var arrayCharacters = [];\n wordToArray(word, arrayCharacters);\n testIfAlpha(standard, arrayCharacters);\n return alphaCheck;\n }", "title": "" }, { "docid": "534eb30c7d30c6878e464664365f972e", "score": "0.47689226", "text": "function checkSpellingErrorAnswer() {\n\t//total number of spelling errors on the page\n\tvar errorCount = 8;\n\tvar count = document.getElementById('errorCount');\n\tvar errorDiv = document.querySelector(\"#spellingErrors .errorMessage\");\n\tcount.style.background = \"\";\n\terrorDiv.innerHTML = \"\";\n\terrorDiv.style.display = \"none\";\n\ttry {\n\t\tif (isNaN(count.value) || count.value === \"\") {\n\t\t\tthrow \"Enter a number.\";\n\t\t}\n\t\tif (count < 0) {\n\t\t\tthrow \"Enter positive number\";\n\t\t}\n\t\tif (count.value != errorCount) {\n\t\t\tthrow \"That is incorrect\";\n\t\t}\n\t}\n\tcatch (msg) {\n\t\tcount.style.background = invColor;\n\t\terrorDiv.style.display = \"block\";\n\t\terrorDiv.innerHTML = msg;\n\t\tformValidity = false;\n\t}\n}", "title": "" }, { "docid": "894c894ae07614d3ad44ad61d512e5ac", "score": "0.47651613", "text": "function checkTakla() {\n\t\ttaklaInput = input.split(' ');\n\t\tfor (var i = 0; i < taklaInput.length; i++) {\n\t\t\tif (takla.indexOf(taklaInput[i]) > -1) {\n\t\t\t found = true;\n\t\t\t break;\n\t\t\t}\n\t\t}\n\t\tif (found) {\n\t\t\t$('.message').text('Takla!!!').css('color', 'red');\n\t\t\t$('.lh').removeClass('hide');\n\t\t\t$('.main').addClass('hide');\n\t\t}\n\t\telse {\n\t\t\tcheckEnglish();\n\t\t}\n\t}", "title": "" }, { "docid": "0ca57a1f865b54fd452944b39979ec4e", "score": "0.4764098", "text": "function lintContent(\n ruleList,\n name,\n content,\n md,\n config,\n frontMatter,\n noInlineConfig,\n resultVersion,\n callback) {\n // Remove UTF-8 byte order marker (if present)\n content = content.replace(/^\\ufeff/, \"\");\n // Remove front matter\n const removeFrontMatterResult = removeFrontMatter(content, frontMatter);\n const frontMatterLines = removeFrontMatterResult.frontMatterLines;\n // Ignore the content of HTML comments\n content = shared.clearHtmlCommentText(removeFrontMatterResult.content);\n // Parse content into tokens and lines\n const tokens = md.parse(content, {});\n const lines = content.split(shared.newLineRe);\n annotateTokens(tokens, lines);\n const aliasToRuleNames = mapAliasToRuleNames(ruleList);\n const effectiveConfig =\n getEffectiveConfig(ruleList, config, aliasToRuleNames);\n const enabledRulesPerLineNumber = getEnabledRulesPerLineNumber(\n ruleList, lines, frontMatterLines, noInlineConfig,\n effectiveConfig, aliasToRuleNames);\n // Create parameters for rules\n const params = {\n name,\n tokens,\n lines,\n frontMatterLines\n };\n shared.makeTokenCache(params);\n // Function to run for each rule\n const result = (resultVersion === 0) ? {} : [];\n function forRule(rule) {\n // Configure rule\n const ruleNameFriendly = rule.names[0];\n const ruleName = ruleNameFriendly.toUpperCase();\n params.config = effectiveConfig[ruleName];\n function throwError(property) {\n throw new Error(\n \"Property '\" + property + \"' of onError parameter is incorrect.\");\n }\n const errors = [];\n function onError(errorInfo) {\n if (!errorInfo ||\n !errorInfo.lineNumber ||\n !shared.isNumber(errorInfo.lineNumber)) {\n throwError(\"lineNumber\");\n }\n if (errorInfo.detail &&\n !shared.isString(errorInfo.detail)) {\n throwError(\"detail\");\n }\n if (errorInfo.context &&\n !shared.isString(errorInfo.context)) {\n throwError(\"context\");\n }\n if (errorInfo.range &&\n (!Array.isArray(errorInfo.range) ||\n (errorInfo.range.length !== 2) ||\n !shared.isNumber(errorInfo.range[0]) ||\n !shared.isNumber(errorInfo.range[1]))) {\n throwError(\"range\");\n }\n errors.push({\n \"lineNumber\": errorInfo.lineNumber + frontMatterLines.length,\n \"detail\": errorInfo.detail || null,\n \"context\": errorInfo.context || null,\n \"range\": errorInfo.range || null\n });\n }\n // Call (possibly external) rule function\n rule.function(params, onError);\n // Record any errors (significant performance benefit from length check)\n if (errors.length) {\n errors.sort(lineNumberComparison);\n const filteredErrors = errors\n .filter(uniqueFilterForSortedErrors)\n .filter(function removeDisabledRules(error) {\n return enabledRulesPerLineNumber[error.lineNumber][ruleName];\n })\n .map(function formatResults(error) {\n if (resultVersion === 0) {\n return error.lineNumber;\n }\n const errorObject = {};\n errorObject.lineNumber = error.lineNumber;\n if (resultVersion === 1) {\n errorObject.ruleName = ruleNameFriendly;\n errorObject.ruleAlias = rule.names[1] || rule.names[0];\n } else {\n errorObject.ruleNames = rule.names;\n }\n errorObject.ruleDescription = rule.description;\n errorObject.ruleInformation =\n rule.information ? rule.information.href : null;\n errorObject.errorDetail = error.detail;\n errorObject.errorContext = error.context;\n errorObject.errorRange = error.range;\n return errorObject;\n });\n if (filteredErrors.length) {\n if (resultVersion === 0) {\n result[ruleNameFriendly] = filteredErrors;\n } else {\n Array.prototype.push.apply(result, filteredErrors);\n }\n }\n }\n }\n // Run all rules\n try {\n ruleList.forEach(forRule);\n } catch (ex) {\n shared.makeTokenCache(null);\n return callback(ex);\n }\n shared.makeTokenCache(null);\n return callback(null, result);\n}", "title": "" }, { "docid": "20b1f62281483949118e9e5791a7ec5f", "score": "0.47498083", "text": "function checktagsContent() {\n\t\ttree.resetIndexText();\n\t \tvar susp = -1;\n\t\twhile(x = tree.getNextNodeText()){\n\t\t \tif(x){\n\t\t\t\tx = x.textContent;\n\t\t\t\tvar temp = x.substring(0,5);\n\t\t\t\t//Suspicious content if the length is more than 128 characters and the percentage of whitespaces to the respect of the content is less than 0.05\n\t\t\t\tif(temp != \"<!--\" && HTMLHEU.isSuspiciousTagContent(x.textContent)){\n\t\t\t\t\tsusp= 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t\treport.susptagcontent = susp;\n\t\t//console.log(\"suspicious tags content: \"+susp);\n}", "title": "" }, { "docid": "9c3c2ff3c8f9c8b7ccc9336c40352765", "score": "0.47353008", "text": "onActionButtonClick_() {\n this.languageCodesToAdd_.forEach(code => {\n this.languageHelper.toggleSpellCheck(code, true);\n });\n recordSettingChange();\n this.$.dialog.close();\n }", "title": "" }, { "docid": "c6e78d3942f647f50d46adb71830fc52", "score": "0.47309336", "text": "function breakfastChecker(contents) {\n // Your code goes here\n\n\n\n\n\n}", "title": "" }, { "docid": "a0bc7ef831ea405baa7c2395b8bc3f4c", "score": "0.47309265", "text": "isValid (content) {\n if (this.isGrammarLoaded()) {\n const match = this.grammar.match(content)\n return match.succeeded()\n }\n }", "title": "" }, { "docid": "efa1b2ac3563018dd20f2416fc92d224", "score": "0.4725052", "text": "function submitContent(checkArray) {\r\n\tvar rxCheckBox = new RegExp(\"<input type=checkbox name=terms.+?value=.+?>\");\r\n\tvar rxFixLinks = new RegExp(\"<a __(?:new|old)term=\\\"(.+?)\\\"(.+?)>(.+?)</a>\");\r\n\tvar rxKillFonts = new RegExp(\"<font __type=\\\"glossifyTemp\\\".+?>(.+?)</font>\");\r\n\tvar rxFixCRs = new RegExp(cGovCRConst);\r\n\tvar rxFixLFs = new RegExp(cGovLFConst);\r\n\tvar finalText = cGovStripCheckboxes(rxCheckBox, cGovMassagedData);\r\n\tfinalText = cGovFixFinalLinks(rxFixLinks, finalText, checkArray);\r\n\tfinalText = cGovKillFonts(rxKillFonts, finalText);\r\n\tfinalText = cGovFixCRLF(rxFixCRs, finalText, \"\\r\");\r\n\tfinalText = cGovFixCRLF(rxFixLFs, finalText, \"\\n\");\r\n\t// Finish up by restoring text to editor\r\n\t_glossifyEditor.setContent(finalText);\r\n}", "title": "" }, { "docid": "1976a0114ae02c1e3fd59640c3c561b0", "score": "0.47222552", "text": "async _castAsSpell() {\n if (!this.isSpell)\n throw new Error(\"Trying to cast a non-spell ability as a spell\");\n\n //Hold on! We need to know how they wish to cast that spell \n const use = await confirmSpellUse(this);\n\n let message = null;\n switch (use) {\n case \"time\":\n message = game.i18n.localize(\"NUMENERA.features.spells.time\") + this.spellCastingTime;\n break;\n\n case \"recovery\":\n const recoveries = this.actor.data.data.recoveries;\n const recovery = await selectRecoveryToUse(this.actor);\n switch (recovery) {\n case \"action\":\n //Get the first 1-action that is available\n //We've already confirmed that at least one is available\n for (let i = 0; i < recoveries.length - 3; i++)\n if (recoveries[i]) {\n recoveries[i] = false;\n break;\n }\n break;\n case \"tenMin\":\n recoveries[recoveries.length - 3] = false;\n break;\n case \"oneHour\":\n recoveries[recoveries.length - 2] = false;\n break;\n default:\n return false;\n }\n\n message = game.i18n.localize(\"NUMENERA.pc.recovery.\" + recovery)\n + game.i18n.localize(\"NUMENERA.features.spells.recovery\");\n\n //Save the actor data for that recovery's use\n await this.actor.update({ \"data.recoveries\": recoveries });\n break;\n default:\n //That one's easy.\n return false;\n }\n\n if (message !== null) {\n ChatMessage.create({\n user: game.user._id,\n speaker: this.actor,\n content: message,\n });\n }\n\n return true;\n }", "title": "" }, { "docid": "7d7b583d8ec57bb35fb0453e78cd5340", "score": "0.47190243", "text": "async checkDocument() {\n this.paused = false;\n let { buffer } = this;\n this._changedtick = await buffer.changedtick;\n this.lines = await buffer.lines;\n this.fireContentChanges.clear();\n this._fireContentChanges();\n }", "title": "" }, { "docid": "a815c9586629c507ba63a2af86f5c66b", "score": "0.47167194", "text": "function readFile(input) {\r\n let file = input.files[0];\r\n let reader = new FileReader();\r\n reader.readAsText(file);\r\n reader.onload = () => {\r\n inputText = reader.result;\r\n //displaying the text content of the file uploaded\r\n document.getElementById(\"text-content\").innerHTML = reader.result; \r\n // wrongWords = [];\r\n //entered words is an array consisting of each words as an element of the array\r\n enteredWords = reader.result.split(/\\W+/); \r\n //api\r\n let url1 = `https://api.textgears.com/spelling?key=zmeWUWHyKUYTqHFy&text=${inputText}&language=en-GB`;\r\n //declare a new XMLHttpRequest and send it out\r\n let req1 = new XMLHttpRequest();\r\n req1.open(\"GET\", url1);\r\n req1.send();\r\n req1.onload = () => {\r\n //response object of the request's response\r\n let parsedResponse1 = JSON.parse(req1.response);\r\n for (var i = 0; i < parsedResponse1.response.errors.length; i++) {\r\n valueArray = [];\r\n //wrongWords has all the wrongly spelled words from the input document, essentially, all the wrongly spelled words in parsedResponse\r\n wrongWords.push(parsedResponse1.response.errors[i].bad);\r\n //valueArray has the description of the possible error and the suggestions for the same\r\n valueArray.push(parsedResponse1.response.errors[i].description.en);\r\n valueArray.push(parsedResponse1.response.errors[i].better);\r\n // store these in the local storage for better access\r\n localStorage.setItem(\r\n parsedResponse1.response.errors[i].bad,\r\n valueArray\r\n );\r\n // console.log(wrongWords,)\r\n }\r\n\r\n pTag = document.createElement(\"p\");\r\n for (var x of enteredWords) {\r\n id = 0;\r\n if (wrongWords.includes(x)) {\r\n var span = document.createElement(\"span\");\r\n var spanContent = document.createTextNode(\" \" + x + \" \");\r\n span.append(spanContent);\r\n pTag.append(span);\r\n span.classList.add(\"wrong-red\");\r\n // id++;\r\n span.setAttribute(\"id\", id);\r\n id++;\r\n span.setAttribute(\"value\", x);\r\n } else {\r\n var spanContent = document.createTextNode(\" \" + x + \" \");\r\n pTag.append(spanContent);\r\n }\r\n document.getElementById(\"text-content\").innerHTML = \"\";\r\n document.getElementById(\"text-content\").append(pTag);\r\n }\r\n invalidSpans = document.querySelectorAll(\".wrong-red\");\r\n\r\n for (let i = 0; i < invalidSpans.length; i++) {\r\n\r\n let arr = localStorage.getItem(invalidSpans[i].innerText.trim()).split(\",\");\r\n // $(\"invalidSpans\")\r\n invalidSpans[i].addEventListener(\"contextmenu\", event => { customeRightClick(arr, i); });\r\n }\r\n };\r\n reader.onerror = () => {\r\n console.log(reader.error);\r\n };\r\n };\r\n}", "title": "" }, { "docid": "6c68b328da7da2478ddb3ba0b8bfca18", "score": "0.4715041", "text": "checkLetter(userSelection) {\n return this.phrase.includes(userSelection.textContent) ? true : false;\n }", "title": "" }, { "docid": "1b6dc3e13239833574cbcc9eba16cd31", "score": "0.4706631", "text": "function checkInputs() {\n\t\tif ($('author').classList.contains('err')) {\n\t\t\treturn true;\n\t\t}\n\t}", "title": "" }, { "docid": "14e1c8254276cf246f4ca6696520b297", "score": "0.46922326", "text": "function matchWords() {\n if (wordInput.value === currentWord.innerHTML) {\n message.innerHTML = 'Correct!!! Type next word to Begin -->';\n return true;\n }else{\n message.innerHTML = 'Words mismatch, check your spellings';\n return false;\n }\n}", "title": "" }, { "docid": "3411a994b397b5e2eb159bcf1f1e2c0c", "score": "0.46768776", "text": "function checkTheWord() {\n if (writeablogtitleinput.value === 'star wars' || writeablogtitleinput.value === 'Star wars') {\n writeablogmessagetextfield.value = 'Jij altijd met je Star Wars'\n } else if (writeablogtitleinput.value === 'anime' || writeablogtitleinput.value === 'Anime') {\n writeablogmessagetextfield.value = 'Jij altijd met je anime'\n }\n}", "title": "" }, { "docid": "2cbac8ae5ea4b0a50ab4687d95e11df6", "score": "0.4676671", "text": "onDidChangeTextDocument(event) {\n if (event.document.isDirty) {\n return;\n }\n if (event.document.uri.scheme === 'git') {\n return;\n }\n // Ignore a clean file with a change:\n if (event.contentChanges.length > 0) {\n return;\n }\n this.removeCachedTestResults(event.document);\n for (const editor of vscode.window.visibleTextEditors) {\n if (editor.document === event.document) {\n this.triggerUpdateActiveEditor(editor);\n }\n }\n }", "title": "" }, { "docid": "f0d0c1106a9aa6aab0b212a1eac391ef", "score": "0.46682262", "text": "function checkMatch(search_term) {\n console.log(\"unhighlighting\");\n unhighlight();\n console.log(\"checking match\");\n highlight_words(search_term);\n}", "title": "" }, { "docid": "c7d4ae49604040996a066765775e6d71", "score": "0.46579224", "text": "function changeMusic(){\n if (obfuscatedWord == worddelimited){\n // alert('Music');\n }\n}", "title": "" }, { "docid": "a1ca013fd88b3e9d16a9a92f14c0beae", "score": "0.46494055", "text": "function checkRecipe() {\n $('#recipe').html('');\n //cl(\"triggering\");\n var reagents = '';\n $('#bench .icon').each(function() {\n reagents += $(this).data('ingredient');\n }).clone().appendTo('#recipe');\n reagents = reagents.split('').sort().join('');\n if(window[\"spellbomb_descriptions\"][reagents]&&window[\"spellbombsKnown\"][reagents]) {$('#recipe').append('<span>'+formatRecipe(window[\"spellbomb_descriptions\"][reagents])+'</span>');}\n else if($('#recipe').html()) {$('#recipe').append('<span>'+\"No known recipe.\"+'</span>');}\n else {$('#recipe').html('');}\n }", "title": "" }, { "docid": "52e27b37049b329edd29001375be2458", "score": "0.46479452", "text": "function check(node) {\n var initial = start(node).offset\n var final = end(node).offset\n\n if (generated(node)) {\n return null\n }\n\n return node.lang || /^\\s*([~`])\\1{2,}/.test(contents.slice(initial, final))\n ? 'fenced'\n : 'indented'\n }", "title": "" }, { "docid": "1e8bb0a1734135e43d4be252fb972013", "score": "0.4632571", "text": "function gameEnde() {\n setWordCount(wordaCalculator(text));\n setOnGame(false);\n }", "title": "" }, { "docid": "06449518d4cf8f0223982fc96cd67a2a", "score": "0.46268657", "text": "function TextExtSuggestions() {\n }", "title": "" }, { "docid": "e8621f36b0eff612cdd5074226ead1c2", "score": "0.46266425", "text": "function checkCfscriptEditorGrammar(editor) {\n\tif ( !editor._checking_is_cfscript // not already checking...\n\t && !!module.htmlCfmlGrammar // and html/cfml grammar is loaded\n\t && !!module.cfscriptGrammar // and cfscript grammar is loaded\n\t) {\n\t\teditor._checking_is_cfscript=true;\n\t\t//\tOnly run this is the grammars have been defined.\n\t\t\n\t\tfor (var line of editor.getBuffer().getLines()) {\n\t\t\tif (line.length) {\n\t\t\t \tif (/(\\bimport\\b|^\\s*\\/\\*|^\\s*\\/\\/|\\bcomponent\\b|\\binterface\\b)/.test(line)) {\n\t\t\t\t\teditor.setGrammar(module.cfscriptGrammar);\n\t\t\t\t} else {\n\t\t\t\t\teditor.setGrammar(module.htmlCfmlGrammar);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\teditor._checking_is_cfscript=false;\n\t}\n}", "title": "" }, { "docid": "8f061c0b23fbb4075d8b658795751657", "score": "0.4624617", "text": "function wordCheck(key) {\n wordCheckArray.push(key.guessed);\n }", "title": "" }, { "docid": "fb27ded97656789303149e42fa3c9359", "score": "0.4624035", "text": "function submitWord() {\n let enteredWord = textBox.innerText;\n //if word is valid and hasn't already been found...\n if (!foundWords.includes(enteredWord) && validWords.includes(enteredWord.toUpperCase())) {\n foundList.innerHTML = `<li>${enteredWord}</li>` + foundList.innerHTML;\n foundWords.push(enteredWord);\n addPoints(enteredWord);\n calcPercentage();\n setTimeout(clearText, 550);\n } else if (!enteredWord.includes(center)) {\n textBox.innerText = \"Must use center letter!\";\n setTimeout(clearText, 550);\n } else {\n //if word has already been entered...\n if (foundWords.includes(enteredWord)) {\n textBox.innerText = \"Already found!\";\n setTimeout(clearText, 550);\n }\n //if word isn't valid...\n else {\n textBox.innerText = \"Invalid word!\";\n setTimeout(clearText, 550);\n }\n }\n function clearText() {\n textBox.innerText = \"\";\n }\n}", "title": "" } ]
f01e4b7ed704a4e4b7eaf8e2a8174ac1
this function calculates the current position on the torus curve
[ { "docid": "1cd1176fd5207c03036307ff3de49184", "score": "0.6305979", "text": "function calculatePositionOnCurve(u, p, q, radius, position) {\n var cu = Math.cos(u);\n var su = Math.sin(u);\n var quOverP = q / p * u;\n var cs = Math.cos(quOverP);\n position.x = radius * (2 + cs) * 0.5 * cu;\n position.y = radius * (2 + cs) * su * 0.5;\n position.z = radius * Math.sin(quOverP) * 0.5;\n }", "title": "" } ]
[ { "docid": "b01620d83b9ef1701529d4bcf1f989d1", "score": "0.66712904", "text": "function calculatePositionOnCurve(u,p,q,radius,position){var cu=Math.cos(u);var su=Math.sin(u);var quOverP=q/p*u;var cs=Math.cos(quOverP);position.x=radius*(2+cs)*0.5*cu;position.y=radius*(2+cs)*su*0.5;position.z=radius*Math.sin(quOverP)*0.5;}", "title": "" }, { "docid": "b01620d83b9ef1701529d4bcf1f989d1", "score": "0.66712904", "text": "function calculatePositionOnCurve(u,p,q,radius,position){var cu=Math.cos(u);var su=Math.sin(u);var quOverP=q/p*u;var cs=Math.cos(quOverP);position.x=radius*(2+cs)*0.5*cu;position.y=radius*(2+cs)*su*0.5;position.z=radius*Math.sin(quOverP)*0.5;}", "title": "" }, { "docid": "b01620d83b9ef1701529d4bcf1f989d1", "score": "0.66712904", "text": "function calculatePositionOnCurve(u,p,q,radius,position){var cu=Math.cos(u);var su=Math.sin(u);var quOverP=q/p*u;var cs=Math.cos(quOverP);position.x=radius*(2+cs)*0.5*cu;position.y=radius*(2+cs)*su*0.5;position.z=radius*Math.sin(quOverP)*0.5;}", "title": "" }, { "docid": "b01620d83b9ef1701529d4bcf1f989d1", "score": "0.66712904", "text": "function calculatePositionOnCurve(u,p,q,radius,position){var cu=Math.cos(u);var su=Math.sin(u);var quOverP=q/p*u;var cs=Math.cos(quOverP);position.x=radius*(2+cs)*0.5*cu;position.y=radius*(2+cs)*su*0.5;position.z=radius*Math.sin(quOverP)*0.5;}", "title": "" }, { "docid": "b01620d83b9ef1701529d4bcf1f989d1", "score": "0.66712904", "text": "function calculatePositionOnCurve(u,p,q,radius,position){var cu=Math.cos(u);var su=Math.sin(u);var quOverP=q/p*u;var cs=Math.cos(quOverP);position.x=radius*(2+cs)*0.5*cu;position.y=radius*(2+cs)*su*0.5;position.z=radius*Math.sin(quOverP)*0.5;}", "title": "" }, { "docid": "69529a478c86e560db288704b0eeb1ee", "score": "0.6595091", "text": "function calculatePositionOnCurve(u,p,q,radius,position){const cu=Math.cos(u);const su=Math.sin(u);const quOverP=q/p*u;const cs=Math.cos(quOverP);position.x=radius*(2+cs)*0.5*cu;position.y=radius*(2+cs)*su*0.5;position.z=radius*Math.sin(quOverP)*0.5;}", "title": "" }, { "docid": "69529a478c86e560db288704b0eeb1ee", "score": "0.6595091", "text": "function calculatePositionOnCurve(u,p,q,radius,position){const cu=Math.cos(u);const su=Math.sin(u);const quOverP=q/p*u;const cs=Math.cos(quOverP);position.x=radius*(2+cs)*0.5*cu;position.y=radius*(2+cs)*su*0.5;position.z=radius*Math.sin(quOverP)*0.5;}", "title": "" }, { "docid": "e746a3f1066e66305431a5b7d3358138", "score": "0.6447442", "text": "calcPos(){\n\t\tlet vrdx = Math.cos(Utils.angulo(this) + (this.sentido * this.vel)) * this.radio;\n\t\tlet vrdy = Math.sin(Utils.angulo(this) + (this.sentido * this.vel)) * this.radio;\n\t\t\n\t\tthis.x = vrdx;\n\t\tthis.y = vrdy;\n\t\treturn [this.x, this.y];\n\t}", "title": "" }, { "docid": "22b9fc017a9a8a70bf7a0f7fdb48728c", "score": "0.64262074", "text": "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\t\n\t\t\t\tvar cu = Math.cos( u );\n\t\t\t\tvar su = Math.sin( u );\n\t\t\t\tvar quOverP = q / p * u;\n\t\t\t\tvar cs = Math.cos( quOverP );\n\t\n\t\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\t\n\t\t\t}", "title": "" }, { "docid": "58e4bceb651c261bf12ba1d4fad480a9", "score": "0.6367026", "text": "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tvar cu = Math.cos( u );\n\t\t\tvar su = Math.sin( u );\n\t\t\tvar quOverP = q / p * u;\n\t\t\tvar cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}", "title": "" }, { "docid": "58e4bceb651c261bf12ba1d4fad480a9", "score": "0.6367026", "text": "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tvar cu = Math.cos( u );\n\t\t\tvar su = Math.sin( u );\n\t\t\tvar quOverP = q / p * u;\n\t\t\tvar cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}", "title": "" }, { "docid": "58e4bceb651c261bf12ba1d4fad480a9", "score": "0.6367026", "text": "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tvar cu = Math.cos( u );\n\t\t\tvar su = Math.sin( u );\n\t\t\tvar quOverP = q / p * u;\n\t\t\tvar cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}", "title": "" }, { "docid": "58e4bceb651c261bf12ba1d4fad480a9", "score": "0.6367026", "text": "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tvar cu = Math.cos( u );\n\t\t\tvar su = Math.sin( u );\n\t\t\tvar quOverP = q / p * u;\n\t\t\tvar cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}", "title": "" }, { "docid": "58e4bceb651c261bf12ba1d4fad480a9", "score": "0.6367026", "text": "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tvar cu = Math.cos( u );\n\t\t\tvar su = Math.sin( u );\n\t\t\tvar quOverP = q / p * u;\n\t\t\tvar cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}", "title": "" }, { "docid": "58e4bceb651c261bf12ba1d4fad480a9", "score": "0.6367026", "text": "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tvar cu = Math.cos( u );\n\t\t\tvar su = Math.sin( u );\n\t\t\tvar quOverP = q / p * u;\n\t\t\tvar cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}", "title": "" }, { "docid": "58e4bceb651c261bf12ba1d4fad480a9", "score": "0.6367026", "text": "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tvar cu = Math.cos( u );\n\t\t\tvar su = Math.sin( u );\n\t\t\tvar quOverP = q / p * u;\n\t\t\tvar cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}", "title": "" }, { "docid": "7c04a735a3d195129c88cb685a9d8668", "score": "0.6347752", "text": "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\t\tvar cu = Math.cos( u );\n\t\t\t\tvar su = Math.sin( u );\n\t\t\t\tvar quOverP = q / p * u;\n\t\t\t\tvar cs = Math.cos( quOverP );\n\n\t\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t\t}", "title": "" }, { "docid": "16f771402f56d02e980f0236ba764737", "score": "0.6330165", "text": "function calculatePositionOnCurve(u, p, q, radius, position) {\n var cu = Math.cos(u);\n var su = Math.sin(u);\n var quOverP = q / p * u;\n var cs = Math.cos(quOverP);\n position.x = radius * (2 + cs) * 0.5 * cu;\n position.y = radius * (2 + cs) * su * 0.5;\n position.z = radius * Math.sin(quOverP) * 0.5;\n }", "title": "" }, { "docid": "d4286d60b5b8e0c966b875068a5f1b06", "score": "0.63292307", "text": "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "title": "" }, { "docid": "d4286d60b5b8e0c966b875068a5f1b06", "score": "0.63292307", "text": "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "title": "" }, { "docid": "d4286d60b5b8e0c966b875068a5f1b06", "score": "0.63292307", "text": "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "title": "" }, { "docid": "d4286d60b5b8e0c966b875068a5f1b06", "score": "0.63292307", "text": "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "title": "" }, { "docid": "d4286d60b5b8e0c966b875068a5f1b06", "score": "0.63292307", "text": "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "title": "" }, { "docid": "d4286d60b5b8e0c966b875068a5f1b06", "score": "0.63292307", "text": "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "title": "" }, { "docid": "d4286d60b5b8e0c966b875068a5f1b06", "score": "0.63292307", "text": "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "title": "" }, { "docid": "5302dc9523bbe0782956b3ac31012d8e", "score": "0.62894404", "text": "function calculatePositionOnCurve(u, p, q, radius, position) {\n\n\t\tvar cu = Math.cos(u);\n\t\tvar su = Math.sin(u);\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos(quOverP);\n\n\t\tposition.x = radius * (2 + cs) * 0.5 * cu;\n\t\tposition.y = radius * (2 + cs) * su * 0.5;\n\t\tposition.z = radius * Math.sin(quOverP) * 0.5;\n\t}", "title": "" }, { "docid": "1c783e9129613e5613b58ffb6dcae50c", "score": "0.6260321", "text": "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tconst cu = Math.cos( u );\n\t\t\tconst su = Math.sin( u );\n\t\t\tconst quOverP = q / p * u;\n\t\t\tconst cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}", "title": "" }, { "docid": "1c783e9129613e5613b58ffb6dcae50c", "score": "0.6260321", "text": "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tconst cu = Math.cos( u );\n\t\t\tconst su = Math.sin( u );\n\t\t\tconst quOverP = q / p * u;\n\t\t\tconst cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}", "title": "" }, { "docid": "1c783e9129613e5613b58ffb6dcae50c", "score": "0.6260321", "text": "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tconst cu = Math.cos( u );\n\t\t\tconst su = Math.sin( u );\n\t\t\tconst quOverP = q / p * u;\n\t\t\tconst cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}", "title": "" }, { "docid": "92ef2eb4844e6382bafa26eae3bd4f4f", "score": "0.6251649", "text": "updatePosition() {\n this.currPos.x = TWEEN.easeOutQuad(this.animRemainingTime, this.initPos.x, this.goalPos.x - this.initPos.x, this.animDuration);\n this.currPos.y = TWEEN.easeOutQuad(this.animRemainingTime, this.initPos.y, this.goalPos.y - this.initPos.y, this.animDuration);\n }", "title": "" }, { "docid": "a797c4468303a2c020a6fa157d45ce69", "score": "0.62012863", "text": "function newPosition() {\n return state.position + deltaT * state.velocity;\n }", "title": "" }, { "docid": "641a26cc6fcb7597fc8ae5528ae9fb62", "score": "0.6198313", "text": "function initializePosAngleToDrawTrunk(){\n position_x = [0,0.02,0.07,0.13,0.18,0.25,0.31,0.37,0.43,0.49,0.55,0.61,0.67,0.72]; \n position_y = [0.25,0.22,0.23,0.21,0.28,0.33,0.3,0.35,0.31,0.31,0.25,0.3,0.27,0.25]; \n pos_angle = [55,120,60,150,130,50,120,60,130,70,140,40];\n a=0;\n }", "title": "" }, { "docid": "40b578e2fe3d28583b320d9a929eccf5", "score": "0.61783546", "text": "function calculatePositionOnCurve(u, p, q, radius, position) {\n const cu = Math.cos(u);\n const su = Math.sin(u);\n const quOverP = q / p * u;\n const cs = Math.cos(quOverP);\n position.x = radius * (2 + cs) * 0.5 * cu;\n position.y = radius * (2 + cs) * su * 0.5;\n position.z = radius * Math.sin(quOverP) * 0.5;\n }", "title": "" }, { "docid": "40b578e2fe3d28583b320d9a929eccf5", "score": "0.61783546", "text": "function calculatePositionOnCurve(u, p, q, radius, position) {\n const cu = Math.cos(u);\n const su = Math.sin(u);\n const quOverP = q / p * u;\n const cs = Math.cos(quOverP);\n position.x = radius * (2 + cs) * 0.5 * cu;\n position.y = radius * (2 + cs) * su * 0.5;\n position.z = radius * Math.sin(quOverP) * 0.5;\n }", "title": "" }, { "docid": "a375c63ddbe548c69b33e229f45c1308", "score": "0.6153724", "text": "updatePosition(){\r\n var seconds = Date.now() - this.lastTime / 1000; \r\n this.position[0] = this.position[0] + (this.velocity[0] * seconds) * .0000001; \r\n this.position[1] = this.position[1] + (this.velocity[1] * seconds) * .0000001; \r\n this.position[2] = this.position[2] + (this.velocity[2] * seconds) * .0000001;\r\n if (this.position[0] - this.radius[0] < -1) {\r\n this.position[0] = -1 + this.radius[0];\r\n this.velocity[0] = this.velocity[0] * -1;\r\n } else if (this.position[0] + this.radius[0] > 1) {\r\n this.position[0] = 1 - this.radius[0];\r\n this.velocity[0] = this.velocity[0] * -1;\r\n }\r\n if (this.position[1] - this.radius[0] < -1) {\r\n this.position[1] = -1 + this.radius[0];\r\n this.velocity[1] = this.velocity[1] * -1;\r\n } else if (this.position[1] + this.radius[0] > 1) {\r\n this.position[1] = 1 - this.radius[0];\r\n this.velocity[1] = this.velocity[1] * -1;\r\n }\r\n if (this.position[2] - this.radius[0] < -1) {\r\n this.position[2] = -1 + this.radius[0];\r\n this.velocity[2] = this.velocity[2] * -1;\r\n } else if (this.position[2] + this.radius[0] > 1) {\r\n this.position[2] = 1 - this.radius[0];\r\n this.velocity[2] = this.velocity[2] * -1;\r\n }\r\n// console.log(\"X: \" + this.position[0] +\" Y: \" + this.position[1] + \" Z: \" + this.position[2]);\r\n }", "title": "" }, { "docid": "46c714a8091ddae44d756d1c06abfba1", "score": "0.61449575", "text": "getPos(t) {\n let x = this.x + Math.sin(this.a) * this.m * t;\n let y = this.y - Math.cos(this.a) * this.m * t;\n return [x, y];\n }", "title": "" }, { "docid": "03f39f6c4cacb278d550172953c88ea6", "score": "0.61062694", "text": "function newPos() {\n\trelDist = 0;\n\tfor (i = 0; i < 3; i++) {\n\t\tlistToSound[i] = soundPosition[i] - listenerPosition[i];\n\t\trelDist += listToSound[i] * listToSound[i];\n\t}\n\trelDist = Math.sqrt(relDist);\n\tif (relDist == 0) return;\n\tif (relDist < headRadius + 0.01) relDist = headRadius + 0.01;\n\tcommonPart1 = headRadius * headRadius + relDist * relDist;\n\tcommonPart2 = 2 * headRadius * relDist;\n\tcalcRelRot();\n}", "title": "" }, { "docid": "00942aa884271a4e503dba3b097854c8", "score": "0.60073674", "text": "get relativeVelocity() {}", "title": "" }, { "docid": "1f568559b224f71e3662beab7a8c6f2e", "score": "0.59779245", "text": "function torus(p) {\n var ri = 1, ro = 4, fni = 16, fno = 32, roti = 0;\n if(p) {\n if(p.ri) ri = p.ri;\n if(p.fni) fni = p.fni;\n if(p.roti) roti = p.roti;\n if(p.ro) ro = p.ro;\n if(p.fno) fno = p.fno;\n }\n if(fni<3) fni = 3;\n if(fno<3) fno = 3;\n var c = _oldCircle({r:ri,fn:fni,center:true});\n if(roti) c = c.rotateZ(roti);\n return rotate_extrude({fn:fno},c.translate([ro,0,0]));\n }", "title": "" }, { "docid": "392371e1bbd9de7d88351e733cf429bd", "score": "0.5977454", "text": "HVPosition(params) {\n if (params[0] < 1)\n params[0] = 1;\n if (params[1] < 1)\n params[1] = 1;\n this._terminal.y = params[0] - 1;\n if (this._terminal.y >= this._terminal.rows) {\n this._terminal.y = this._terminal.rows - 1;\n }\n this._terminal.x = params[1] - 1;\n if (this._terminal.x >= this._terminal.cols) {\n this._terminal.x = this._terminal.cols - 1;\n }\n }", "title": "" }, { "docid": "7323f4f94fa84dbaa030bf58b12fb181", "score": "0.59578264", "text": "function Start () \n {\n \tpath = car.getPath();\n \tstartPoint = path[0];\n \tnextPoint = path[1]; \t\n \tvar dir : Vector3 = (nextPoint.transform.position - startPoint.transform.position).normalized;\n \tcar.transform.rotation = Quaternion.LookRotation(dir);\n \t\n \tif(car.getTakenPosition())\n \t{\n \t\tDebug.Log(\"Change pos...\");\n \t\tcar.transform.position -= car.transform.forward*30;//TODO if no other car is there!!\n \t}\n \t\n }", "title": "" }, { "docid": "d70b00c538261b91098a94753462e976", "score": "0.59376025", "text": "function calculateVelocity() {\n\t\t\t\tcurrentTime = (new Date).getTime();\n\t\t\t\tperiod = currentTime - previousTime;\n\t\t\t\tpreviousTime = currentTime;\n\t\t\t\tif (numSamples++) {\n\t\t\t\t\tvelocityX = (velocityX * (numSamples - 1) + numSamples * (translationX - previousTranslationX) / period) / 2 / numSamples;\n\t\t\t\t\tvelocityY = (velocityY * (numSamples - 1) + numSamples * (translationY - previousTranslationY) / period) / 2 / numSamples;\n\t\t\t\t} else {\n\t\t\t\t\tvelocityX = (translationX - startTranslationX) / period;\n\t\t\t\t\tvelocityY = (translationY - startTranslationY) / period;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "d70b00c538261b91098a94753462e976", "score": "0.59376025", "text": "function calculateVelocity() {\n\t\t\t\tcurrentTime = (new Date).getTime();\n\t\t\t\tperiod = currentTime - previousTime;\n\t\t\t\tpreviousTime = currentTime;\n\t\t\t\tif (numSamples++) {\n\t\t\t\t\tvelocityX = (velocityX * (numSamples - 1) + numSamples * (translationX - previousTranslationX) / period) / 2 / numSamples;\n\t\t\t\t\tvelocityY = (velocityY * (numSamples - 1) + numSamples * (translationY - previousTranslationY) / period) / 2 / numSamples;\n\t\t\t\t} else {\n\t\t\t\t\tvelocityX = (translationX - startTranslationX) / period;\n\t\t\t\t\tvelocityY = (translationY - startTranslationY) / period;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "e4d0e00adde10dbaf00ddf56886e2300", "score": "0.59210086", "text": "get theta(){return Math.atan2(this.y, this.x);}", "title": "" }, { "docid": "82294198c95aa1ce32c6fef53834bd61", "score": "0.58861196", "text": "function updatePosition() {\n var acceleration = calculateAcceleration(state.position);\n state.velocity = newVelocity(acceleration);\n state.position = newPosition();\n if (state.position > 1) { state.position = 1; }\n if (state.position < -1) { state.position = -1; }\n }", "title": "" }, { "docid": "21fea6f72ae84d66a46b7e9cbdc74412", "score": "0.5879229", "text": "calculateVelocity(){\n\t\tlet veloc = p5.Vector.sub(this.Pos2, this.Pos1);\n\t\tveloc.div(50);\n\t\treturn veloc;\n\t}", "title": "" }, { "docid": "179aad4008f91aebb6ee3cf07b791a60", "score": "0.58332783", "text": "function nextPos() {\n let ux = gun.ux[gun.ux.length - 1],\n uy = gun.uy[gun.uy.length - 1],\n x = gun.x[gun.x.length - 1],\n y = gun.y[gun.y.length - 1];\n\n gun.ux.push(ux - (app.resistance * ux * ux / app.weight) * dt);\n gun.uy.push(uy - (g + app.resistance * uy * uy / app.weight) * dt);\n gun.x.push(x + ux * dt);\n gun.y.push(y + uy * dt);\n }", "title": "" }, { "docid": "06a2802b7f72f70ef5a54be1fbee6fae", "score": "0.5818374", "text": "follow(x,y){\r\n let angle = Math.tan(((y-this.y)/(x-this.x))*(Math.PI/180));\r\n this.x=x-(4*Math.cos(angle)*(Math.PI/180));\r\n this.y=y-(4*Math.sin(angle)*(Math.PI/180));\r\n }", "title": "" }, { "docid": "7f74deb6c94e72c7c4139f1c3b5ae80b", "score": "0.5811363", "text": "function forward(p) {\n var coords = {};\n var S, T, U, V, W, temp, u, v;\n p.x = p.x - this.lam0;\n \n if (Math.abs(Math.abs(p.y) - _constants_values__WEBPACK_IMPORTED_MODULE_3__.HALF_PI) > _constants_values__WEBPACK_IMPORTED_MODULE_3__.EPSLN) {\n W = this.E / Math.pow((0,_common_tsfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, p.y, Math.sin(p.y)), this.B);\n \n temp = 1 / W;\n S = 0.5 * (W - temp);\n T = 0.5 * (W + temp);\n V = Math.sin(this.B * p.x);\n U = (S * this.singam - V * this.cosgam) / T;\n \n if (Math.abs(Math.abs(U) - 1.0) < _constants_values__WEBPACK_IMPORTED_MODULE_3__.EPSLN) {\n throw new Error();\n }\n \n v = 0.5 * this.ArB * Math.log((1 - U)/(1 + U));\n temp = Math.cos(this.B * p.x);\n \n if (Math.abs(temp) < TOL) {\n u = this.A * p.x;\n } else {\n u = this.ArB * Math.atan2((S * this.cosgam + V * this.singam), temp);\n } \n } else {\n v = p.y > 0 ? this.v_pole_n : this.v_pole_s;\n u = this.ArB * p.y;\n }\n \n if (this.no_rot) {\n coords.x = u;\n coords.y = v;\n } else {\n u -= this.u_0;\n coords.x = v * this.cosrot + u * this.sinrot;\n coords.y = u * this.cosrot - v * this.sinrot;\n }\n \n coords.x = (this.a * coords.x + this.x0);\n coords.y = (this.a * coords.y + this.y0);\n \n return coords;\n}", "title": "" }, { "docid": "c707fb29e81a530a4a7037056922a46d", "score": "0.57956076", "text": "updatePosition() {\n this.angle += this.delta / this.bodyOrbitTime * (this.isMoon ? sceneProps.moonSpeed : sceneProps.planetSpeed);\n this.px = Math.cos(this.angle) * this.orbitRadius + this.orbitedBody.px;\n this.pz = Math.sin(this.angle) * this.orbitRadius + this.orbitedBody.pz;\n this.body.position.set(this.px, this.py, this.pz);\n }", "title": "" }, { "docid": "1d1934ef903b134fef023cbade004631", "score": "0.57940155", "text": "updatePosition() {\n var increment = vec3.create();\n vec3.scale(increment, this.v, step);\n vec3.add(this.p, this.p, increment);\n\n for (var i = 0; i < 3; i++) {\n if (this.p[i] < -1) {\n this.p[i] = -1;\n this.v[i] = -this.v[i] * bouncing;\n }\n if (this.p[i] > 1) {\n this.p[i] = 1;\n this.v[i] = -this.v[i] * bouncing;\n }\n }\n }", "title": "" }, { "docid": "9f5b16b050971cfd0224556d00a573e0", "score": "0.57928175", "text": "VPositionRelative(params) {\n let param = params[0];\n if (param < 1) {\n param = 1;\n }\n this._terminal.y += param;\n if (this._terminal.y >= this._terminal.rows) {\n this._terminal.y = this._terminal.rows - 1;\n }\n // If the end of the line is hit, prevent this action from wrapping around to the next line.\n if (this._terminal.x >= this._terminal.cols) {\n this._terminal.x--;\n }\n }", "title": "" }, { "docid": "e8e22fa3a09064ec62732cfedb5adfea", "score": "0.57799065", "text": "findTriTop() {\n\n // length of tri from player to cursor\n let l = this.a;\n\n let pX = this.player.pos.x;\n let pY = this.player.pos.y;\n\n let t = new Coord(0, 0);\n let m = this.findCursorSlope();\n \n if (pX <= this.cursPos.x) {\n // Slope is 0\n if (m == 0)\n {\n t.x = pX + l;\n t.y = pY;\n }\n // If slope is infinte\n else if (!isFinite(m))\n {\n t.x = pX;\n t.y = pY + l;\n } \n else \n {\n let dx = (l / Math.sqrt(1 + (m * m)));\n let dy = m * dx;\n t.x = pX + dx;\n t.y = pY + dy;\n }\n\n // Return top of tri\n return t;\n }\n else {\n // Slope is 0\n if (m == 0)\n {\n t.x = pX + l;\n t.y = pY;\n }\n // If slope is infinte\n else if (!isFinite(m))\n {\n t.x = pX;\n t.y = pY + l;\n } \n else \n {\n let dx = (l / Math.sqrt(1 + (m * m)));\n let dy = m * dx;\n t.x = pX - dx;\n t.y = pY - dy;\n }\n\n // Return top of tri\n return t;\n }\n }", "title": "" }, { "docid": "be026f7f8a74d958576a39e86628bacf", "score": "0.5774582", "text": "update()\n\t{\n\t\tthis.world.update();\n\t\tthis.time++;\n\n\t\tif(this.drawing)\n\t\t{\n\t\t\tif(dist(this.last_x, this.last_y, mouseX, mouseY) > 5)\n\t\t\t{\n\t\t\t\tthis.addMousePoint();\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if (this.points.length > 0) // Flow the curve to straight.\n\t\t{\n\t\t\tvar start_x = room_w/24;\n\t\t\tvar\tstart_y = room_h/2;\n\t\t\tvar p0 = createVector(start_x - 2, start_y);\n\t\t\tvar p1 = createVector(start_x - 1, start_y);\n\t\t\t\t\n\t\t\tfor(var i = 0; i < this.points.length; i++)\n\t\t\t{\n\t\t\t\t// Move the currvent point a distance of 1 towards the location of a proper distance away from the previous point in the direction of p1 - p0.\n\t\t\t\tvar diff = p5.Vector.sub(p1, p0);\n\t\t\t\tdiff.normalize();\n\t\t\t\tif(abs(diff.y) < .0001)\n\t\t\t\t{\n\t\t\t\t\tdiff.y = 0.0;\n\t\t\t\t}\n\t\t\t\tdiff.mult(this.distances[i]);\n\t\t\t\tif(i > 0)\n\t\t\t\t{\n\t\t\t\t\tdiff.mult(this.scale);\n\t\t\t\t}\n\n\t\t\t\tvar target_position = p5.Vector.add(p1, diff);\n\t\t\t\t\n\t\t\t\tvar p2 = this.points[i];\n\t\t\t\tvar vel = p5.Vector.sub(target_position, p2);\n\t\t\t\tvel.mult(.8);\n\t\t\t\t/*\n\t\t\t\tif(vel.mag() > 2)\n\t\t\t\t{\n\t\t\t\t\tvel.normalize();\n\t\t\t\t\tvel.mult(2);\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\tp2.add(vel);\n\t\t\t\t\n\t\t\t\t// Cycle the trailing points.\n\t\t\t\tp0 = p1;\n\t\t\t\tp1 = p2;\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "04d2efc95e32deab8b80ad300c2175a0", "score": "0.575355", "text": "function drawTangent(pos, newAngle, refPoint, img, flag) {\n\tvar tangent_coor = makeTangent(refPoint.x, refPoint.y, pos, newAngle + 0);\n\tvar tangent_coor1 = makeTangent1(refPoint.x, refPoint.y, pos, newAngle + 0);\n\t_xx = tangent_coor[0] - 30;\n\t_yy = tangent_coor[1] - pos;\n\t_xx1 = tangent_coor[2] - 30;\n\t_yy1 = tangent_coor[3] - pos;\n\t\n\t_xx1_temp = tangent_coor1[2] - 30;\n\t_yy1_temp = tangent_coor1[3] - pos;\n\t\t\t\n\tvar x_diff = _xx1 - _xx;\n\tvar y_diff = _yy1 - _yy;\n\t\n\tvar x_diff_tempPoint = _xx1_temp - _xx;\n\tvar y_diff_tempPoint = _yy1_temp - _yy;\n\t\n\tvar tangentPathArrowTime, tangentPathArrowTime_tempPoint;\n\t\n\tvar X1, Y1, X2, Y2, X2_tempPoint, Y2_tempPoint;\n\tvar X1_arr, Y1_arr, X2_arr, Y2_arr;\n\t\n\tX2=game.canvasOriginX + x_diff -(game.imgW_onLoad / 2);\n\tY2=game.canvasOriginY + game.carDistFromOrigin + y_diff - (game.imgH_onLoad / 2);\n\t\n\tX2_arr = game.canvasOriginX + x_diff + 30;\n\tY2_arr = game.canvasOriginY + game.arrowDistFromOrigin + y_diff;\n\t\n\tX2_tempPoint = game.canvasOriginX + x_diff_tempPoint -(game.imgW_onLoad / 2);\n\tY2_tempPoint = game.canvasOriginY + game.carDistFromOrigin + y_diff_tempPoint - (game.imgH_onLoad / 2);\n\t\n\tif(linearPath){\n\t\t//if pause and played in the linear path\n\t\tX1 = game.car.x;\n\t\tY1 = game.car.y;\n\t\tX1_arr = game._arrow.x;\n\t\tY1_arr = game._arrow.y;\n\t\ttangentPathArrowTime = getRequiredTime(X1, Y1, X2, Y2);\n\t\ttangentPathArrowTime_tempPoint = getRequiredTime(X1, Y1, X2_tempPoint, Y2_tempPoint);\n\t}else{\n\t\tX1=game.canvasOriginX - (game.imgW_onLoad / 2);\n\t\tY1=(game.canvasOriginY + game.carDistFromOrigin - (game.imgH_onLoad / 2));\n\t\tX1_arr=game.canvasOriginX + 30;\n\t\tY1_arr=(game.canvasOriginY + game.arrowDistFromOrigin);\n\t\t//get the time at which the arrow has to traverse the path\n\t\ttangentPathArrowTime = getRequiredTime(game.canvasOriginX + 30, (game.canvasOriginY + game.arrowDistFromOrigin), game.canvasOriginX + x_diff + 30, game.canvasOriginY + game.arrowDistFromOrigin + y_diff);\n\t\ttangentPathArrowTime_tempPoint = getRequiredTime(game.canvasOriginX + 30, (game.canvasOriginY + game.arrowDistFromOrigin), game.canvasOriginX + x_diff_tempPoint + 30, game.canvasOriginY + game.arrowDistFromOrigin + y_diff_tempPoint);\n\t}\n\t\n\t//tangent path for car\t\t\n\ttangentAsPath = new CAAT.PathBehavior().\n\t\t\t\t\tsetValues( new CAAT.Path().setColor(\"#000\").setLinear(\n\t\t\t\t\t\tX1, Y1, X2, Y2\n\t\t\t\t\t).setInteractive(false) ).\n\t\t\t\t\tsetAutoRotate( true ).\n\t\t\t\t\tsetDelayTime( 0, tangentPathArrowTime * 1000 );\n\t\t\t\t\t\t\n\t//tangent path for arrow\n\ttangentAsPath_arrow = new CAAT.PathBehavior().\n\t\t\t\t\tsetValues( new CAAT.Path().setColor(\"#000\").setLinear(\n\t\t\t\t\t\tX1_arr, Y1_arr, X2_arr, Y2_arr\n\t\t\t\t\t).setInteractive(false) ).\n\t\t\t\t\tsetAutoRotate( true ).\n\t\t\t\t\tsetDelayTime(0, tangentPathArrowTime * 1000 );\n\t\t\n\t//tangent path for temp point\t\n\ttangentAsPath_tempPoint = new CAAT.PathBehavior().\n\t\t\t\t\tsetValues( new CAAT.Path().setColor(\"#000\").setLinear(\n\t\t\t\t\t\tX1, Y1, X2_tempPoint, Y2_tempPoint\n\t\t\t\t\t).setInteractive(false) ).\n\t\t\t\t\tsetAutoRotate( true ).\n\t\t\t\t\tsetDelayTime( 0, tangentPathArrowTime_tempPoint * 1000 );\n\t\t\t\t\t\t\t\t\t\n\t\n}", "title": "" }, { "docid": "9a2888a0ada5d2405a96b52d05518b0f", "score": "0.57515275", "text": "update() {\n this.theta += this.speed\n this.position = createVector(width/2-this.r*cos((radians(this.theta))), height/2-this.r*sin(radians(this.theta) ) )\n \n }", "title": "" }, { "docid": "6099b9d170ee9a67dad4321e63059c8d", "score": "0.5743521", "text": "calculRebond(positionYBalle){\r\n //0% de la raquette : sens = 0\r\n //50% de la raquette : sens = 3\r\n //100% de la raquette : sens = 6\r\n //le tout -3\r\n console.log(\"On est la\");\r\n console.log (\"pos balle :\",positionYBalle);\r\n console.log(\"pos raquette :\",this.positionY);\r\n console.log(\"pos relative :\",positionYBalle-this.positionY);\r\n console.log(\"hauteur raquette:\",this.hauteur);\r\n console.log(((positionYBalle - this.positionY)*this.hauteur/6)-3);\r\n //return ((positionYBalle - this.positionY)*this.hauteur/6)-3;\r\n\r\n /*Resultat de debug\r\n console.log(\"positionYBalle : \" , positionYBalle);\r\n console.log(\"this.positionY : \" , this.positionY);\r\n console.log(\"this.hauteur : \" , this.hauteur);\r\n console.log(\"position relative : \" , positionYBalle - this.positionY);\r\n console.log(\"Position relative * 100 : \",(positionYBalle - this.positionY)*6);\r\n console.log(\"Regle de 3 entre 0 et 6 \" , ((positionYBalle - this.positionY)*6/100));\r\n */\r\n return (((positionYBalle - this.positionY)*6/100)-3);\r\n }", "title": "" }, { "docid": "3f83c8ef0499a13b96227d93f9f29e23", "score": "0.57359976", "text": "tangentTheta(p) {\n const ref = _point__WEBPACK_IMPORTED_MODULE_0__.Point.clone(p);\n const x0 = ref.x;\n const y0 = ref.y;\n const a = this.a;\n const b = this.b;\n const center = this.bbox().center;\n const cx = center.x;\n const cy = center.y;\n const refPointDelta = 30;\n const q1 = x0 > center.x + a / 2;\n const q3 = x0 < center.x - a / 2;\n let x;\n let y;\n if (q1 || q3) {\n y = x0 > center.x ? y0 - refPointDelta : y0 + refPointDelta;\n x =\n (a * a) / (x0 - cx) -\n (a * a * (y0 - cy) * (y - cy)) / (b * b * (x0 - cx)) +\n cx;\n }\n else {\n x = y0 > center.y ? x0 + refPointDelta : x0 - refPointDelta;\n y =\n (b * b) / (y0 - cy) -\n (b * b * (x0 - cx) * (x - cx)) / (a * a * (y0 - cy)) +\n cy;\n }\n return new _point__WEBPACK_IMPORTED_MODULE_0__.Point(x, y).theta(ref);\n }", "title": "" }, { "docid": "af1edba8664e44d1bbcba0da069e7912", "score": "0.5732651", "text": "getPoint(t){\n const a = t * this.distance;\n const b = -this.param * a * (a - this.distance);\n const Va = (new THREE.Vector3()).add(this.end).sub(this.start).normalize().multiplyScalar(a);\n const Vb = (new THREE.Vector3()).add(this.direction).multiplyScalar(b);\n return (new THREE.Vector3()).add(Va).add(Vb).add(this.start);\n }", "title": "" }, { "docid": "4c5d237acd8b90c7ba825751524c1268", "score": "0.5729324", "text": "function computeTeta(p, q) {\n\tvar coeff= 0;\n\tvar teta= 0;\n\t//console.log(\"computeTeta --> prevTeta: \"+ teta +\"\\tp.x: \"+ p.x +\"\\tq.x: \"+ q.x);\n\t\n\tif (p.y == q.y) {\n\t\t// Retta parallela all'asse delle x --> 0° || 180°\n\t\tif (p.x>q.x) {\n\t\t\tteta= 180;\n\t\t}\n\t\telse {\n\t\t\tteta= 0;\n\t\t}\n\t}\n\n\telse if (p.x == q.x) {\n\t\t// Retta parallela all'asse delle y --> 90° || 270°\n\t\tif (p.y>q.y) {\n\t\t\tteta= 90;\n\t\t}\n\t\telse {\n\t\t\tteta= 270;\n\t\t}\n\t}\n\t\n\telse {\n\t\tcoeff= (q.y-p.y)/(q.x-p.x);\n\t\tteta= Math.abs(Math.atan(coeff)*180/Math.PI);\n\t\t\n\t\tif (p.x>q.x && p.y>q.y) {\n\t\t\t// Retta nel \"quarto quadrante\"\n\t\t\tteta= 180-teta;\n\t\t}\n\t\telse if (p.x>q.x && p.y<q.y) {\n\t\t\t// Retta nel \"terzo quadrante\"\n\t\t\tteta= 180+teta;\n\t\t}\n\t\telse if (p.x<q.x && p.y<q.y) {\n\t\t\t// Retta nel \"secondo quadrante\"\n\t\t\tteta= 360-teta;\n\t\t}\n\t}\n\t\n\tconsole.log(\"computeTeta --> \\tteta: \"+ teta);\n\t\n\treturn teta;\n}", "title": "" }, { "docid": "d6751514bcf4ca5caa732f25afdb9363", "score": "0.5720691", "text": "calcPos(x, y) {\n return ((x-1) + (y-1)*8)\n }", "title": "" }, { "docid": "e4562b2f85e1369b1a1339e86da23f74", "score": "0.57158506", "text": "setArrow() {\n\n let dx = this.x1 - this.x2; // note it's x1 - x2\n let dy = this.y1 - this.y2;\n\n let len = Math.sqrt(dx * dx + dy * dy);\n\n // calculate the position\n let x = dx / len * this.tipLen;\n let y = dy / len * this.tipLen;\n\n let sin_theta = Math.sin(this.tipAngle);\n let cos_theta = Math.cos(this.tipAngle);\n\n this.x3 = this.x2 + cos_theta * x - sin_theta * y;\n this.y3 = this.y2 + sin_theta * x + cos_theta * y;\n\n this.x4 = this.x2 + cos_theta * x + sin_theta * y;\n this.y4 = this.y2 + cos_theta * y - sin_theta * x;\n }", "title": "" }, { "docid": "51fa1472b92323a9239985ad582f3359", "score": "0.5704145", "text": "approach(target) {\n //find the difference between the current position and the wanted position\n let difference = p5.Vector.sub(target, this.pos);\n //limit the length of the vector to 8 units\n difference.limit(8);\n //add that to the position\n this.pos.add(difference);\n //speed things up in the start with some linear interpolation\n this.pos.lerp(target, 0.06);\n }", "title": "" }, { "docid": "9012c170103c37993677f6724b2e2c89", "score": "0.5700398", "text": "function particle_spins_translaction_movements() {\n\n // Creating the quarternion for the Particle's Spin Down State\n var quaternion_for_particle_spin_down = new THREE.Quaternion();\n\n // Setting and applying the quarternion's Y Axis for the Particle's Spin Down State\n quaternion_for_particle_spin_down.setFromAxisAngle( y_axis, ( motions_factor * 0.02 ) );\n particle_spin_down_pivot.applyQuaternion(quaternion_for_particle_spin_down);\n \n \n // Creating the quarternion for the Particle's Spin Up State\n var quaternion_for_particle_spin_up = new THREE.Quaternion();\n\n // Setting and applying the quarternion's Y Axis for the Particle's Spin Up State\n quaternion_for_particle_spin_up.setFromAxisAngle( y_axis, ( motions_factor * -0.02 ) );\n particle_spin_up_pivot.applyQuaternion(quaternion_for_particle_spin_up);\n \n}", "title": "" }, { "docid": "22329a5ed11ce2475b5e4cac90f1fc2f", "score": "0.56881285", "text": "_updatePos() {\n\t\tthis._camera.position.add(this.cache.pivot, this.cache.shift);\n\t\tthis._camera.lookAt(this.cache.pivot);\n\t}", "title": "" }, { "docid": "809f8434dce6322f10325a93185a5b6e", "score": "0.5686685", "text": "generateYPos() {\n return Math.sin(this.angle) * this.radius;\n }", "title": "" }, { "docid": "5e4a91d051c277f4ae9c3e33a81e969e", "score": "0.56822646", "text": "function updatePose() {\n\n\t// Update the start position\n\tvar start = {};\n\tstart.x = $(\"[name='start.x']\").val()\n\tstart.y = $(\"[name='start.y']\").val()\n\tstart.z = $(\"[name='start.z']\").val()\n\t// TODO: Try catch here in case not loaded yet, to avoid error msg\n\tstart_robot.position.set(start.x, start.y, start.z)\n\n\t// Update start rotation\n\tvar startRot = {};\n\tstartRot.x = $(\"[name='start.axis.x']\").val()\n\tstartRot.y = $(\"[name='start.axis.y']\").val()\n\tstartRot.z = $(\"[name='start.axis.z']\").val()\n\tstart_robot.rotation.set(DEG_TO_RAD*startRot.x, DEG_TO_RAD*startRot.y, DEG_TO_RAD*startRot.z);\n\n\t// Update the goal position\n\tvar goal = {};\n\tgoal.x = $(\"[name='goal.x']\").val()\n\tgoal.y = $(\"[name='goal.y']\").val()\n\tgoal.z = $(\"[name='goal.z']\").val()\n\t// TODO: Try catch here in case not loaded yet, to avoid error msg\n\tgoal_robot.position.set(goal.x, goal.y, goal.z)\n\n\t// Update start rotation\n\tvar goalRot = {};\n\tgoalRot.x = $(\"[name='goal.axis.x']\").val()\n\tgoalRot.y = $(\"[name='goal.axis.y']\").val()\n\tgoalRot.z = $(\"[name='goal.axis.z']\").val()\n\tgoal_robot.rotation.set(DEG_TO_RAD*goalRot.x, DEG_TO_RAD*goalRot.y, DEG_TO_RAD*goalRot.z);\n\n}", "title": "" }, { "docid": "776cd9b740e4a762e669df5ef3dbd5b7", "score": "0.5681053", "text": "function updatePosition() {\n angle %= 360;\n var radians = angle * Math.PI / 180;\n dx = Math.cos(radians) * ballSpeed;\n dy = Math.sin(radians) * ballSpeed;\n }", "title": "" }, { "docid": "9ed2b92e83f4d5c5f7b77d04693c5409", "score": "0.56699103", "text": "getHipBaseX() {\n var theta = this.body.torso.GetAngle();\n var x = this.body.torso.GetPosition().x;\n return x - 35*sin(theta)\n }", "title": "" }, { "docid": "5589d95846439bc76cc6aa54308e38ff", "score": "0.5661848", "text": "function animate() {\n \n var timeNow = new Date().getTime();\n if (lastTime != 0) {\n var elapsed = timeNow - lastTime;\n\n if (speedForward != 0) {\n zPosition -= speedForward * elapsed;\n }\n\n if (speedSide != 0) {\n xPosition -= speedSide * elapsed;\n }\n\n }\n //console.log(xPosition);\n lastTime = timeNow;\n \n\n updateOimoPhysics();\n\n}", "title": "" }, { "docid": "ad0b9958a8ea2ab8a2d995ca784555e2", "score": "0.56550324", "text": "function cl_position(_angle, _radi, _obj)\r\n{\r\n // Sin = y // cos = x\r\n var obj = document.getElementById(_obj);\r\n\r\n var yPos = Math.sin(_angle * Math.PI / 180.0); // Math.cos(_angle);\r\n var xPos = Math.cos(_angle * Math.PI / 180.0);\r\n\r\n //if(xPos< 0) xPos = (xPos*-1);\r\n obj.style.left = (xPos * _radi) + \"px\";\r\n obj.style.top = (yPos * _radi) + \"px\";\r\n}", "title": "" }, { "docid": "35cdaf4cb0e0783110d7ae6900e12cfa", "score": "0.56513774", "text": "_calcPosData() {\n var x = this._getPosValue('x'),\n y = this._getPosValue('y'),\n rotate = (90 + Math.atan((y.delta / x.delta) || 0) * h.RAD_TO_DEG);\n\n this._posData = {\n radius: Math.sqrt(x.delta * x.delta + y.delta * y.delta),\n rotate: (x.delta < 0) ? rotate + 180 : rotate,\n x,\n y,\n };\n\n // set the last position to _props\n // this._calcSwirlXY( 1 );\n }", "title": "" }, { "docid": "8d31112b9057bb503e79d36b6cbe208a", "score": "0.565003", "text": "function Update () {\ntransform.position.x = Mathf.SmoothDamp(transform.position.x, Personagem.position.x, Velocidade.x, ValorSuavizacao);\n\n//altera um valor alongo de tempo pra suavizar\n//o codigo em x e (horizontamente)\ntransform.position.y = Mathf.SmoothDamp(transform.position.y, Personagem.position.y, Velocidade.y, ValorSuavizacao);\n//mesma acompanhamento de camera suavizada no eixo y (verticamente)\n}", "title": "" }, { "docid": "74edb024274eff0affe5bc2c8fe7896a", "score": "0.5635229", "text": "tentativeUpdate (delta) {\n\t // updates the tentative variables to the next position and velocity\n //this.tent_vel = this.acceleration*delta\n this.tent_pos.x = this.position.x + this.velocity*delta*this.dof.x\n this.tent_pos.z = this.position.z + this.velocity*delta*this.dof.z\n this.tent_dof = this.dof\n }", "title": "" }, { "docid": "b17e5477fc9ef65402e7efd71a7219bd", "score": "0.5629828", "text": "function setVp1() {\r\n vp1x = originx;\r\n vp1y = originy + Math.tan(Math.radians(90 - tilt)) * rad;\r\n }", "title": "" }, { "docid": "0ad1e4984901aaaa36c0a9be4dc5ae88", "score": "0.5629219", "text": "function YServo_get_position()\n {\n if (this._cacheExpiration <= YAPI.GetTickCount()) {\n if (this.load(YAPI.defaultCacheValidity) != YAPI_SUCCESS) {\n return Y_POSITION_INVALID;\n }\n }\n return this._position;\n }", "title": "" }, { "docid": "00bc7905c96c9cb7da7d94a110fc2bed", "score": "0.5628306", "text": "get magnitude() {\n let ang = 0;\n if (this.x > 0) {\n ang = Math.PI * 0.5 - Math.atan(this.y / this.x);\n } else if (this.x < 0) {\n ang = Math.PI * 1.5 - Math.atan(this.y / this.x);\n } else if (this.x === 0) {\n ang = this.y > 0 ? 0 : Math.PI;\n }\n // UP = 0 RIGHT = pi/2 DOWN = pi LEFT = 3/2pi\n return {\n theta: ang,\n value: Math.sqrt(Math.pow(this.y, 2) + Math.pow(this.x, 2))\n };\n }", "title": "" }, { "docid": "18570a316f1a2f7559a5cf704ebea659", "score": "0.56254673", "text": "calculateVelocity()\n {\n this.velocity = this.rotationAngle / this.totalTime;\n }", "title": "" }, { "docid": "3f27e12257b6c5e7785b9a787558fa34", "score": "0.562228", "text": "get theta() { return Math.atan2(this.y, this.x); }", "title": "" }, { "docid": "3f27e12257b6c5e7785b9a787558fa34", "score": "0.562228", "text": "get theta() { return Math.atan2(this.y, this.x); }", "title": "" }, { "docid": "64e8143fb24eeb7f0598c951c21dbff7", "score": "0.5616016", "text": "function drawTangent(pos, newAngle, refPoint, img, curX, curY) {\n\t\tvar tangent_coor = makeTangent(refPoint.x, refPoint.y, pos, newAngle + 0);\n\n\t\t_xx = tangent_coor[0];\n\t\t_yy = tangent_coor[1];\n\t\t_xx1 = tangent_coor[2];\n\t\t_yy1 = tangent_coor[3];\n\t\t\t\t\n\t\tvar x_diff = _xx1 - _xx;\n\t\tvar y_diff = _yy1 - _yy;\n\t\t\n\t\tvar tangentPathArrowTime;\n\t\t\n\t\tvar X1, Y1, X2, Y2;\n\t\tvar X1_arr, Y1_arr, X2_arr, Y2_arr;\n\t\t\n\t\t//X2 = tangentLength + x_diff -(39 / 2);\n\t\tX2 = _xx1-(39 / 2);\n\t\t//Y2 = tangentLengthY + data_dist_pixels + y_diff - (18 / 2);\n\t\tY2 = _yy1;\n\t\t\n\t\tif(linearPath){\n\t\t\t//if pause and played in the linear path\n\t\t\tX1 = aActorBlue.x;\n\t\t\tY1 = aActorBlue.y;\n\t\t\ttangentPathArrowTime = getRequiredTime(X1, Y1, X2, Y2);\n\n\t\t}else{\n\n\t\t\tX1= curX;\n\t\t\tY1= curY;\n\t\t\tX1_arr=tangentLength + 30;\n\t\t\tY1_arr=(tangentLengthY);\n\t\t\t//get the time at which the arrow has to traverse the path\n\t\t\ttangentPathArrowTime = getRequiredTime(tangentLength + 30, (tangentLengthY + data_dist_pixels), tangentLength + x_diff + 30, tangentLengthY + data_dist_pixels + y_diff);\n\t\t}\n\t\n\t\t//tangent path for car\t\t\n\t\ttangentAsPath = new CAAT.PathBehavior().\n\t\t\t\t\t\tsetValues( new CAAT.Path().setColor(\"#000\").setLinear(\n\t\t\t\t\t\t\tX1, Y1, X2, Y2\n\t\t\t\t\t\t).setInteractive(false) ).\n\t\t\t\t\t\tsetAutoRotate( true ).\n\t\t\t\t\t\tsetDelayTime( 0, tangentPathArrowTime * 1000 );\n\t}", "title": "" }, { "docid": "89f5b9d7e7a38f6fa40628f47a6907cd", "score": "0.56159556", "text": "function magnetPositions(posx,posy){\r\n\tvar posxx = posx;\r\n\tvar posyy = posy;\r\n\tvar newlogo;\r\n\tif (horivert.dir[0] == \"h\"){\r\n\t\tvar n = posLabel(\"point\",horivert.label[0]);\r\n\t\tposyy = pointList[n].y\r\n\t\tnewlogo = new Logo(imghori,posxx,posyy-20,20,20);\r\n\t\tlogos.push(newlogo);\r\n\t};\r\n\tif (horivert.dir[0] == \"v\"){\r\n\t\tvar n = posLabel(\"point\",horivert.label[0]);\r\n\t\tposxx = pointList[n].x;\r\n\t\tnewlogo = new Logo(imgvert,posxx-20,posyy,20,20);\r\n\t\tlogos.push(newlogo);\r\n\t};\r\n\tif (horivert.dir[1] == \"h\"){\r\n\t\tvar n = posLabel(\"point\",horivert.label[1]);\r\n\t\tposyy = pointList[n].y\r\n\t\tnewlogo = new Logo(imghori,posxx,posyy-20,20,20);\r\n\t\tlogos.push(newlogo);\r\n\t};\r\n\tif (horivert.dir[1] == \"v\"){\r\n\t\tvar n = posLabel(\"point\",horivert.label[1]);\r\n\t\tposxx = pointList[n].x;\r\n\t\tnewlogo = new Logo(imgvert,posxx-20,posyy,20,20);\r\n\t\tlogos.push(newlogo);\r\n\t};\r\n\tif (constrline.dir ==\"h\"){\r\n\t\tposyy = pointList[constrline.point1].y; \r\n\t} ;\r\n\tif (constrline.dir ==\"v\"){\r\n\t\tposxx = pointList[constrline.point1].x;\r\n\t} \r\n\tif (constrline.dir == \"vh\"){\r\n\t\tposxx = pointList[constrline.point1].x;\r\n\t\tposyy = pointList[constrline.point2].y;\r\n\t} \r\n\tif (constrline.dir == \"hv\"){\r\n\t\tposxx = pointList[constrline.point2].x;\r\n\t\tposyy = pointList[constrline.point1].y;\r\n\t};\r\n\treturn [posxx,posyy];\r\n}", "title": "" }, { "docid": "779c3ac96cbd27ff03a2f85100a44ca0", "score": "0.561317", "text": "function control_point(loc, tan)\n{\n\tthis.pos = loc;\n\tthis.tangent = tan;\n\tthis.chain_lift = false;\n}", "title": "" }, { "docid": "b02608fa94ab4876be2d92f1bc97e012", "score": "0.5606892", "text": "GetVelocity(t){\n let place = t % 1;\n let seg_length = 1.0 / this.num_points;\n let seg = Math.floor(place / seg_length);\n let seg_place = (place % seg_length) / seg_length; //normalize\n return this.CalcVelocity(seg, seg_place);\n }", "title": "" }, { "docid": "38445e413419efed89a676dc561aa5ed", "score": "0.56056786", "text": "function updatePositions() {\n var dt = simSpeed * 1/10000;\n elapsedTime += dt;\n\n // 4th order runge-kutta\n var rk = rk4(dipoles[1].p, dipoles[1].v,\n Math.atan2(dipoles[1].m[1], dipoles[1].m[0]), dipoles[1].av,\n dt, dipoles[1].m);\n\n //----------------------------------------\n // torque\n //----------------------------------------\n\n if (updateM) {\n updateMoment(rk);\n }\n\n //----------------------------------------\n // force\n //----------------------------------------\n\n if (updateP && !dipoles[1].fixed) {\n var c0 = dipoles[0].p;\n var c1 = dipoles[1].p;\n\n var R01 = subtract(c1, c0);\n var R10 = subtract(c0, c1);\n // var touching = Math.abs(length(R01) - D) < 0.00000001;\n var touching = isTouching(c0, c1);\n\n var dx = subtract(rk.p, dipoles[1].p);\n\n if (!touching || dot(rk.v, mult(R01, -1)) < 0) {\n // We're not touching or we're traveling away from the fixed dipole\n\n // Find the distance a from the center of the fixed dipole\n // to the displacement line.\n //\n // dx ____ c1+dx\n // ____/\n // c1 /_________ c0\n // R10\n\n // dist will be the closest approach of c1 to c0.\n // If the shadow of R10 onto dx (using dot product) is either negative\n var dist;\n var shadow = dot(R10, dx) / length(dx);\n if (shadow > length(dx)) {\n // c1 won't pass c0, so find the ending point of c1.\n // dist = length(subtract(c0, add(c1, dx)));\n dist = length(subtract(c0, rk.p));\n } else if (shadow < 0) {\n // c1 is traveling away from c0, so find the ending point\n dist = length(subtract(c0, rk.p));\n } else {\n // c1 will pass c0, so find the distance at closest approach\n dist = length(cross(R10, dx)) / length(dx);\n }\n\n if (dist < D) {\n // c1 will collide with c0. \n var qt = computeIntersection(c0, c1, dx);\n if (collisionType == ELASTIC) {\n elapsedTime -= dt;\n var half = 0.5 * simSpeed * 1/10000;\n var done = false;\n dt = half;\n var iterations = 0;\n // Binary search for a really close hit\n while (!done && iterations < 100) {\n var theta = Math.atan2(dipoles[1].m[1], dipoles[1].m[0]);\n var newrk = rk4(\n dipoles[1].p, dipoles[1].v,\n theta, dipoles[1].av,\n dt, dipoles[1].m);\n \n half /= 2;\n if (length(subtract(newrk.p, dipoles[0].p)) < D) {\n // intersects\n dt -= half;\n } else {\n // no intersection\n updateMoment(newrk);\n updatePosition(newrk.p, newrk.v);\n elapsedTime += dt;\n dt = half;\n }\n done = isTouching(c0, dipoles[1].p);\n ++iterations;\n }\n\n // specular reflection\n var normal = normalize(subtract(dipoles[1].p, dipoles[0].p));\n var l = normalize(mult(dipoles[1].v, -1));\n var refln = 2 * dot(l, normal);\n refln = mult(refln, normal);\n refln = normalize(subtract(refln, l));\n var newv = mult(refln, length(dipoles[1].v));\n // Update log BEFORE the position and vector are updated so\n // we get velocity values before the collision\n updateLog(LOG_COLLISION);\n updatePosition(dipoles[1].p, newv);\n } else {\n // inelastic collision - really should set v to something meaningful\n var newv = vec3(0, 0, 0);\n var newp = add(dipoles[1].p, mult(dx, qt));\n // Update log BEFORE the position and vector are updated so\n // we get velocity values before the collision\n updateLog(LOG_COLLISION);\n updatePosition(newp, newv);\n }\n debugValues.v_at_collision = length(rk.v).toFixed(5);\n debugValues.t_at_collision = elapsedTime.toFixed(5);\n } else {\n // no collision\n updatePosition(rk.p, rk.v);\n }\n } else {\n // already touching\n var tangent = normalize(cross(R01, vec3(0, 0, 1)));\n var newv = mult(tangent, dot(rk.v, tangent));\n // newp_tangent is the new position if traveling\n // in the tangent direction\n var newp_tangent = add(dipoles[1].p, mult(newv, dt));\n // Traveling in the tangent direction will pull c1 off of c0,\n // so pull c1 toward c0 until they touch\n var u = mult(normalize(subtract(newp_tangent, dipoles[0].p)), D);\n var newp = add(dipoles[0].p, u);\n updatePosition(newp, newv);\n }\n }\n\n updateDebug(dipoles[1]);\n}", "title": "" }, { "docid": "4c32aefe0cd9d0f34f95d71d03208c5d", "score": "0.55976576", "text": "calcPos(Bl,Bm,Al,Am){\r\n this.x = (-Bl+Bm)/(Al-Am);\r\n this.y = Am*this.x+Bm;\r\n }", "title": "" }, { "docid": "a4c43b5399036d7357b4917e7a28b10a", "score": "0.55923384", "text": "getPosition(out) {\n\t const _out = !!out && out.isVector3 ? out : new THREE.Vector3();\n\t return _out.setFromSpherical(this._sphericalEnd).applyQuaternion(this._yAxisUpSpaceInverse).add(this._targetEnd);\n\t }", "title": "" }, { "docid": "a64054749d06ab9337dc368d5ea139a9", "score": "0.5589761", "text": "function calculateVelocity() {\n return velocity = (1/n) * ((calculateHydaulicRadius())**(2/3))*(getSlope()**(1/2)); //unit in m/sec\n}", "title": "" }, { "docid": "2f3f0f766c6a7cf09fe47738bca572ce", "score": "0.55881196", "text": "getRelativePosition(position, dir, n) {\n let d = StepDelta.getDelta(position.strideType, StepType.Full, dir);\n return {\n x: position.x + d.deltaX * n,\n y: position.y + d.deltaY * n,\n };\n }", "title": "" }, { "docid": "384bf0090ceb00a45686147504ba1ae3", "score": "0.55845785", "text": "function UpdatePosition () {\n for(let i = 0; i < triNum; i++){\n if (holding == null){\n //console.log(\"currently updating: \" + i);\n let position = new Victor(triPosArr[i].x, triPosArr[i].y);\n triVelArr[i].add(triAccArr[i]);\n let velMag = triVelArr[i].magnitude();\n \n if (velMag > maxSpeed){\n triVelArr[i].normalize();\n triVelArr[i].limit(0, maxSpeed);\n }\n \n position.add(triVelArr[i]);\n triAccArr[i] = new Victor(0, 0);\n \n //console.log(triVelArr[i].length());\n let direction = triVelArr[i].horizontalAngleDeg() + 90;\n //console.log(direction);\n \n let newPos = new Victor(position.x + triPosArr[i].x, position.y + triPosArr[i].y);\n triArr[i].style.top = position.y + \"px\";\n triArr[i].style.left = position.x + \"px\";\n triArr[i].style.transform = \"rotate(\" + direction + \"deg)\";\n //triArr[i].transform({rotation: direction});\n \n \n triPosArr[i] = position;\n }\n else if (triArr[i].alt != holding.alt){\n //console.log(\"currently updating: \" + i);\n let position = new Victor(triPosArr[i].x, triPosArr[i].y);\n triVelArr[i].add(triAccArr[i]);\n let velMag = triVelArr[i].magnitude();\n \n if (velMag > maxSpeed){\n triVelArr[i].normalize();\n triVelArr[i].limit(0, maxSpeed);\n }\n \n position.add(triVelArr[i]);\n triAccArr[i] = new Victor(0, 0);\n \n //console.log(triVelArr[i].length());\n let direction = triVelArr[i].horizontalAngleDeg() + 90;\n //console.log(direction);\n \n let newPos = new Victor(position.x + triPosArr[i].x, position.y + triPosArr[i].y);\n triArr[i].style.top = position.y + \"px\";\n triArr[i].style.left = position.x + \"px\";\n triArr[i].style.transform = \"rotate(\" + direction + \"deg)\";\n //triArr[i].transform({rotation: direction});\n \n \n triPosArr[i] = position;\n }\n \n }\n \n}", "title": "" }, { "docid": "565089a1c172b6bb5dede84e6d3e2c56", "score": "0.55818534", "text": "function calculate_cur_prox_node() {\n\tcur_prox_dis = compute_distance( cur_node.x, sink_node.x, cur_node.y, sink_node.y );\n}", "title": "" }, { "docid": "c6f1c1e7d1d300a0143df62170f48721", "score": "0.55813956", "text": "function followPoint(startingX, startingY, endingX, endingY, velosity) {\n const deltaY = endingY - startingY;\n const deltaX = endingX - startingX;\n const angle = atan2(deltaY, deltaX);\n const distanceBetween = dist(startingX, startingY, endingX, endingY);\n\n let totalDistanceToTraval = distanceBetween;\n if(totalDistanceToTraval > velosity) {\n totalDistanceToTraval = velosity;\n }\n\n const distanceToTravalX = cos(angle) * totalDistanceToTraval;\n const distanceToTravalY = sin(angle) * totalDistanceToTraval;\n\n const newX = startingX + distanceToTravalX;\n const newY = startingY + distanceToTravalY;\n\n return [newX, newY];\n}", "title": "" }, { "docid": "93805d6cc62b28f2610853fe21c5a4c8", "score": "0.5577219", "text": "function getTimeToAngle(radius, velocity, startAngle, targetAngle) {\n //var 2 * Math.PI\n }", "title": "" }, { "docid": "f74d9f43386e5e88f0a114b5eebbe879", "score": "0.5576519", "text": "motion() {\n this.pX += this.mX;\n this.pY += this.mY;\n }", "title": "" }, { "docid": "3e36cb3339239a528c11d7f1b85cb1be", "score": "0.5573313", "text": "function draw_parabolic_front(beach, ly) {\n\n}", "title": "" }, { "docid": "bb3350a03f12d30187545c314306cace", "score": "0.556713", "text": "function animate() {\n\t\n\n\tfor (circ of cl) {\n\t\tcirc.acceleration = new Vector2D(0, 0);\n\t\tcirc.force = new Vector2D(0, 0);\n\n\t\tif (circ.ispivot && circ != currentcirc) {\n\t\t\tcirc.vel = new Vector2D(0, 0);\n\t\t}\n\t\tcirc.vel = circ.vel.add(gravity.mult(timestep));\n\t\tcirc.edgeDetect();\n\t\tcirc.collide();\n\n\t\tif (!circ.ispivot && circ != currentcirc) {\n\t\t\tcirc.prevpos = circ.pos;\n\t\t\tcirc.velocity(circ.vel);\n\n\t\t}\n\t}\n\n\t//for (i = 0; i < 1; i++) {\n\t\tfor (joint of spjoint) {\n\t\t\tjoint.update();\t\n\t\t}\n\t//}\n\n\n\n\tfor (circ of cl) {\n\t\tif (!circ.ispivot && circ != currentcirc) {\n\t\t\tcirc.vel = (circ.pos.sub(circ.prevpos)).mult(1 / timestep);\n\t\t\t//circ.edgeDetect();\n\t\t\t//circ.collide();\n\t\t\t//print(circ.vel)\n\t\t\t//circ.pos = circ.prevpos.add(circ.vel.mult(timestep));\n\t\t}\n\t\tcirc.draw();\n\t}\n\n\n\t//print(circ4.pos.y);\n\n\n}", "title": "" }, { "docid": "341d816103d959f1e5b5db0345661a0d", "score": "0.5566949", "text": "function updateSliderValues() {\n document.getElementById('x').value = torso.gap1*1000;\n document.getElementById('y').value = torso.gap2*1000;\n\n document.getElementById('torso-x').value = theta1[torso.id];\n document.getElementById('torso-y').value = theta2[torso.id];\n document.getElementById('torso-z').value = theta3[torso.id];\n \n document.getElementById('neck-x').value = -1 * theta1[neck.id];\n document.getElementById('neck-y').value = theta2[neck.id];\n \n document.getElementById('head-x').value = theta1[head.id];\n \n document.getElementById('upper-right-front-x').value = theta1[legs.upper.right.front.id];\n document.getElementById('upper-right-front-y').value = theta2[legs.upper.right.front.id];\n document.getElementById('upper-right-front-z').value = theta3[legs.upper.right.front.id];\n \n document.getElementById('upper-right-middle-x').value = theta1[legs.upper.right.middle.id];\n document.getElementById('upper-right-middle-y').value = theta2[legs.upper.right.middle.id];\n document.getElementById('upper-right-middle-z').value = theta3[legs.upper.right.middle.id];\n\n document.getElementById('upper-right-back-x').value = -1 * theta1[legs.upper.right.back.id];\n document.getElementById('upper-right-back-y').value = -1 * theta2[legs.upper.right.back.id];\n document.getElementById('upper-right-back-z').value = theta3[legs.upper.right.back.id];\n \n document.getElementById('upper-left-front-x').value = -1 * theta1[legs.upper.left.front.id];\n document.getElementById('upper-left-front-y').value = -1 * theta2[legs.upper.left.front.id];\n document.getElementById('upper-left-front-z').value = theta3[legs.upper.left.front.id];\n \n document.getElementById('upper-left-middle-x').value = -1 * theta1[legs.upper.left.middle.id];\n document.getElementById('upper-left-middle-y').value = -1 * theta2[legs.upper.left.middle.id];\n document.getElementById('upper-left-middle-z').value = theta3[legs.upper.left.middle.id];\n\n document.getElementById('upper-left-back-x').value = theta1[legs.upper.left.back.id];\n document.getElementById('upper-left-back-y').value = theta2[legs.upper.left.back.id];\n document.getElementById('upper-left-back-z').value = theta3[legs.upper.left.back.id];\n\n document.getElementById('lower-right-front').value = theta3[legs.lower.right.front.id];\n document.getElementById('lower-right-middle').value = theta3[legs.lower.right.middle.id]\n document.getElementById('lower-right-back').value = theta3[legs.lower.right.back.id];\n document.getElementById('lower-left-front').value = theta3[legs.lower.left.front.id];\n document.getElementById('lower-left-middle').value = theta3[legs.lower.left.middle.id];\n document.getElementById('lower-left-back').value = theta3[legs.lower.left.back.id];\n}", "title": "" }, { "docid": "6b97a0262bdd40ff94b4819eadc42bba", "score": "0.55643564", "text": "function updatePositionsincident() {\n var positions = line.geometry.attributes.position.array;\n\n var x = -13;\n var y = 0; \n var z = -2.5;\n var index = 0;\n console.log(\"chirag \" + finalx + \" \" + finaly )\n for ( var i = 0, l = MAX_POINTS; i < l; i ++ ) {\n\n positions[ index ++ ] = x;\n positions[ index ++ ] = y;\n positions[ index ++ ] = z;\n\n x += ((finalx + 13.04) /MAX_POINTS);\n y += (finaly /MAX_POINTS);\n }\n}", "title": "" }, { "docid": "9e1a00e043092eca2ca4b4e35c30828b", "score": "0.555966", "text": "update() {\r\n\t\t// get relevant data\r\n\t\tvar rx = this.robot.x;\r\n\t\tvar ry = this.robot.y;\r\n\t\tvar angle = this.normalizeAngle(this.robot.theta);\r\n\r\n\t\tvar wx = this.path[this.current_waypoint].x;\r\n\t\tvar wy = this.path[this.current_waypoint].y;\r\n\r\n\t\tvar ex = this.path[this.path.length-1].x;\r\n\t\tvar ey = this.path[this.path.length-1].y;\r\n\r\n\t\t// calculate direction theta\r\n\t\tvar phi = Math.atan2(wy-ry,wx-rx); // angle from robot position to waypoint position\r\n\t\tvar distance = Math.sqrt(Math.pow(wx-rx,2) + Math.pow(wy-ry,2)); // distance from robot to waypoint\r\n\t\tvar distance_to_goal = Math.sqrt(Math.pow(ex-rx,2) + Math.pow(ey-ry,2));\r\n\r\n\t\tvar alpha = this.normalizeAngle(phi - angle);\r\n\r\n\t\t// implement control\r\n\t\tthis.robot.setVelocity(distance*this.velocity_weighting);\r\n\t\tthis.robot.setOmega(alpha*this.heading_weighting);\r\n\r\n\t\t// go to the next waypoint if we are within the waypoint tolerance\r\n\t\tif(distance < this.distance_tolerance && (this.current_waypoint + 1) != this.path.length) {\r\n\t\t\tif((this.current_waypoint + 1) != this.path.length) this.current_waypoint++;\r\n\t\t}\r\n\r\n\t\tif(distance_to_goal < this.distance_tolerance) {\r\n\t\t\tthis.robot.setVelocity(2*distance);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "7ac7fdbae94cc3209e23139aa3fc79b4", "score": "0.5553664", "text": "function forward$l(p) {\n var coords = {};\n var S, T, U, V, W, temp, u, v;\n p.x = p.x - this.lam0;\n \n if (Math.abs(Math.abs(p.y) - HALF_PI) > EPSLN) {\n W = this.E / Math.pow(tsfnz(this.e, p.y, Math.sin(p.y)), this.B);\n \n temp = 1 / W;\n S = 0.5 * (W - temp);\n T = 0.5 * (W + temp);\n V = Math.sin(this.B * p.x);\n U = (S * this.singam - V * this.cosgam) / T;\n \n if (Math.abs(Math.abs(U) - 1.0) < EPSLN) {\n throw new Error();\n }\n \n v = 0.5 * this.ArB * Math.log((1 - U)/(1 + U));\n temp = Math.cos(this.B * p.x);\n \n if (Math.abs(temp) < TOL) {\n u = this.A * p.x;\n } else {\n u = this.ArB * Math.atan2((S * this.cosgam + V * this.singam), temp);\n } \n } else {\n v = p.y > 0 ? this.v_pole_n : this.v_pole_s;\n u = this.ArB * p.y;\n }\n \n if (this.no_rot) {\n coords.x = u;\n coords.y = v;\n } else {\n u -= this.u_0;\n coords.x = v * this.cosrot + u * this.sinrot;\n coords.y = u * this.cosrot - v * this.sinrot;\n }\n \n coords.x = (this.a * coords.x + this.x0);\n coords.y = (this.a * coords.y + this.y0);\n \n return coords;\n }", "title": "" } ]
af816c6835e3aef58dd07af548d52ed2
Add a function on the Person.prototype called fullName that returns the firstName and lastName property of an object created by the Person constructor concatenated together. Add a property on the Person object called family which is an empty array. Add a function on the Person.prototype called addToFamily which adds an object constructed from the Person constructor to the family array. To make sure that the object you are adding is an object construced from the Person constructor take a look at the instanceofoperator. Make sure that your family array does not include duplicates! This method should the length of the family array.
[ { "docid": "a36b88e1da3cbb7e1d7d8f8723d16572", "score": "0.642534", "text": "function Person(firstName, lastName, favoriteColor, favoriteNumber){\n this.firstName = firstName,\n this.lastName = lastName,\n this.favoriteColor = favoriteColor,\n this.favoriteNumber = favoriteNumber\n this.family = []\n}", "title": "" } ]
[ { "docid": "9b722c7d56cf7a395c0d6fab8d9a8a80", "score": "0.6411665", "text": "function Person(firstName, lastName, favoriteColor, favoriteNumber){\n this.firstName = firstName;\n this.lastName = lastName;\n this.favoriteColor = favoriteColor;\n this.favoriteNumber = favoriteNumber;\n this.family = [];\n}", "title": "" }, { "docid": "9b722c7d56cf7a395c0d6fab8d9a8a80", "score": "0.6411665", "text": "function Person(firstName, lastName, favoriteColor, favoriteNumber){\n this.firstName = firstName;\n this.lastName = lastName;\n this.favoriteColor = favoriteColor;\n this.favoriteNumber = favoriteNumber;\n this.family = [];\n}", "title": "" }, { "docid": "951984ffabf2410e2fdf137c441975c0", "score": "0.6303543", "text": "constructor({name, members, id}){\n this.name = name\n this.members = members\n this.id = id\n\n // .push adds a new item to the end of an array and returns the new length\n Family.all.push(this)\n }", "title": "" }, { "docid": "a20715711ca5a8cd5957039a18c62667", "score": "0.62160623", "text": "function myFamily (name, surname, age, job) {\n\t// Define some prototype properties that will be filled in later.\n\tthis.theirName = name;\n\tthis.theirLast = surname;\n\tthis.theirAge = age;\n\tthis.theirJob = job;\n\t// Define a prototype method for the myFamily object. \n\tthis.familyMember = function() {\n\t\tdocument.querySelector(\".family-1\").innerHTML = \"Family Member: \" + name + \" \" + surname + \"<br>Age: \" + age + \"<br>Job: \" + job;\n\t}\n}", "title": "" }, { "docid": "5ab32d3a1ab6f19426efb2e1b5a6a5e5", "score": "0.618454", "text": "function Persons(firstName, lastName, portrait, titles){\n\tthis.firstName = firstName;\n\tthis.lastName = lastName;\n\tthis.portrait = portrait;\n\tthis.titles = titles;\n\n// better to be stored outside each object for better load time and less code\n\t// this.fullName = function(){\n\t// \treturn this.firstName + ' ' + this.lastName;\n\t// }\n\tpushToArray(array, this); {\n\n}\n// this will add to the array\nfunction pushToArray(arr, object){\n\tarr.push(object);\n}\n\n// Add your method to your objects’ prototype, \n// \tand remove the method from your constructor function\n// \tTest the method on each object in your console again.\nPersons.prototype.fullName = function(){\n\treturn this.firstName + ' ' + this.lastName;\n}\n\n\n// add these to the array\nvar person1 = new Persons('Steve', 'Young', 'img/young.jpg', 'co-founder');\nvar person2 = new Persons('Jerry', 'Rice', 'img/rice.jpg', 'co-founder');\nvar person3 = new Persons('Joe', 'Montana', 'img/montana.jpg', 'cto');\nvar person4 = new Persons('Patrick', 'Willis', 'img/willis.jpg', 'cfo');\nvar person5 = new Persons('Frank', 'Gore', 'img/gore.jpg', 'cmo');\n\n// will log in console if you did it right\nconsole.log(array);\n\n\n}", "title": "" }, { "docid": "e17fe05a3cc90a2ee15686e4c0a15d0d", "score": "0.61766213", "text": "function Person (firstName, lastName, favoriteColor, favoriteNumber){\n\tthis.firstName = firstName;\n\tthis.lastName = lastName;\n\tthis.favoriteColor = favoriteColor;\n\tthis.favoriteNumber = favoriteNumber;\n\tthis.family = []; //step 3\n}", "title": "" }, { "docid": "7c8a855b203933c79db3f29e3a5ede9b", "score": "0.6021442", "text": "function addPerson() {\n let fname = prompt(\"Enter First Name:\");\n let lname = prompt(\"Enter Last Name:\");\n let newPerson = new Person(fname,lname);\n persons.push(newPerson);\n console.log(persons);\n console.log(persons.length);\n}", "title": "" }, { "docid": "a7dcb8a13a018cb9c026d4862a2b9244", "score": "0.6005165", "text": "addFriend (person) {\n friends.push(person)\n }", "title": "" }, { "docid": "81986c0bfa9a65a7b1a5c2bcce5a6877", "score": "0.600369", "text": "function Person(firstName, lastName, favoriteColor, favoriteNumber, favoriteFoods = []) {\n\tthis.firstName = firstName;\n\tthis.lastName = lastName;\n\tthis.favoriteColor = favoriteColor;\n\tthis.favoriteNumber = favoriteNumber;\n\tthis.favoriteFoods = favoriteFoods;\n\tthis.family = [];\n}", "title": "" }, { "docid": "b59bf421d2b47dab44ad66fb55a58237", "score": "0.60014856", "text": "function addFamilyMember(){\n\n let img = document.querySelector(\"#img\").value; \n let name = document.querySelector(\"#name\").value; \n let age = document.querySelector(\"#age\").value; \n let relation = document.querySelector(\"#relation\").value; \n \n let newFamilyMember = {\n Name: name,\n Age: age,\n Relation: relation,\n img: img,\n };\n familyMembers.push(newFamilyMember);\n document.querySelector(\"#family-container\").innerHTML=\"\";\n appendFamilyMembers(familyMembers)\n\n\n }", "title": "" }, { "docid": "be9db0cb3adc3b06229a0ca4f6778f53", "score": "0.59884167", "text": "function family(name, surname, age, job) {\n\tthis.theirName = name;\n\tthis.theirLast = surname;\n\tthis.theirAge = age;\n\tthis.theirJob = job;\n\tthis.familyMember = function() {\n\t\tdocument.getElementById('familyObject').textContent = 'Family Member: ' + name + ' ' + surname + ', ' + age + ', ' + job;\n\t}\n}", "title": "" }, { "docid": "21dce54bf636efc164c69f4277996ffb", "score": "0.5897312", "text": "function Person(firstname, lastname) {\n //when this function ran\n //this point to the new empty object that created the object\n //.firstname and .lastname add them to the new object\n this.firstname = firstname;\n this.lastname = lastname;\n\n //avoid creating method inside function constructors\n //takes memory space. inefficient.\n /*this.getFormalFullName = function() {\n return this.lastname + ', ' + this.firstname;\n }*/\n\n}", "title": "" }, { "docid": "c750d0d368cf58d5bcc92ddd92fe3af2", "score": "0.5884571", "text": "function getFamily(person, people){\n\tvar familyArray=[];\n\tfamilyArray.currentSpouse=[];\n\tfamilyArray.parents=[];\n\tfamilyArray.children=[];\n\tfamilyArray.siblings=[];\n\tfor(var i=0; i<people.length; i++){\n\t\tvar d=0;\n\t\tif(person.currentSpouse==people[i].id){\n\t\t\tfamilyArray.currentSpouse= familyArray.currentSpouse +people[i].firstName+\" \"+people[i].lastName+\"\\n\";\n\t\t}\n\t\tfor(var j=0;j<person.parents.length;j++){\n\t\t\tfamilyArray.parents.length=person.parents.length;\n\t\t\tif(person.parents[j]==people[i].id){\n\t\t\t\tfamilyArray.parents = familyArray.parents +people[i].firstName+\" \"+people[i].lastName+\"\\n\";\n\t\t\t}\n\t\t}\n\t\tfor (var k=0;k<people[i].parents.length;k++){\n\t\t\tif(person.id==people[i].parents[k]){\n\t\t\tfamilyArray.children = familyArray.children + people[i].firstName+\" \"+people[i].lastName+\"\\n\";\n\t\t\t}\n\t\t}\n\t\tfor (var m=0; m<person.parents.length; m++){\n\t\t\tif (d>0){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tfor (var l=0;l<people[i].parents.length;l++){\n\t\t\t\tif(person.parents[m]==people[i].parents[l] && person.id!=people[i].id){\n\t\t\t\t\tfamilyArray.siblings = familyArray.siblings + people[i].firstName+\" \"+people[i].lastName+\"\\n\";\n\t\t\t\t\td++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfamilyArray.parents=familyArray.parents.slice(1,familyArray.parents.length+1);//gets rid of comma before listing parents\n\treturn(familyArray);\n}", "title": "" }, { "docid": "1c4ae0f1d463e9dbd4ec446da3b54ffb", "score": "0.5873929", "text": "function Person(n, f) {\n this.name = n\n this.family = f\n}", "title": "" }, { "docid": "c3fee80700a8c7e7cbd38520f5e5da7b", "score": "0.5857679", "text": "function Person(firstName, lastName) {\n this.fName = firstName;\n this.lName = lastName;\n this.fuName = this.fName + \" \" + this.lName;\n\n Object.defineProperty(this, 'firstName', {\n get: function () {\n return this.fName;\n },\n set: function (value) {\n this.fName = value;\n this.fuName = this.fName + \" \" + this.lName;\n }\n });\n\n Object.defineProperty(this, 'lastName', {\n get: function () {\n return this.lName;\n },\n set: function (value) {\n this.lName = value;\n this.fuName = this.fName + \" \" + this.lName;\n }\n });\n\n Object.defineProperty(this, 'fullName', {\n get: function () {\n return this.fuName;\n },\n set: function (value) {\n value = value.split(' ');\n this.fName = value[0];\n this.lName = value[1];\n this.fuName = this.fName + \" \" + this.lName;\n }\n });\n}", "title": "" }, { "docid": "bba5f86f7864d63314fc76fd957e52df", "score": "0.575454", "text": "function Person(firstN,lastN){\n this.firstName = firstN;\n this.lastName = lastN;\n this.emails = [];\n}", "title": "" }, { "docid": "0a623feaf99bc1a3b9dc9a09e33d0330", "score": "0.57322943", "text": "function person (firstName, lastName) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.fullName = function() {\n return this.firstName + \" \" + this.lastName;\n };\n}", "title": "" }, { "docid": "c369a4507d61820a59168c5469b899d0", "score": "0.5731984", "text": "addFriend (name, friend) {\n this.people[name].push(friend);\n this.people[friend].push(name);\n }", "title": "" }, { "docid": "ddf8d081ec902aa61ddf7d1541ceeccb", "score": "0.5718716", "text": "function Person(firstname, lastname, age) {\n this.Firstname = firstname,\n this.Lastname = lastname,\n this.Age = age,\n this.Fullname = function () {\n return this.Firstname + \" \" + this.Lastname;\n }\n}", "title": "" }, { "docid": "5a0f28725e3364255f0b0fa73e76bf90", "score": "0.5704232", "text": "function Person(firstName, lastName) = {\n this.firstName = firstName;\n this.lastName = lastName;\n this.getFullName = function () {\n return this.firstName + ' ' + this.lastName;\n }\n}", "title": "" }, { "docid": "98114e25d5b4637a2c78b05e0a02f035", "score": "0.5696046", "text": "function Person(name, age, job){\n this.name = name;\n this.age = age;\n this.job = job;\n this.friends = [“Shelby”, “Court”];\n}", "title": "" }, { "docid": "dd132787b73484c8d5c49dc473774a07", "score": "0.56944674", "text": "function add (firstName, lastName, email, phoneNumber){\n\tcontacts[contacts.length] = {\n firstName: firstName,\n lastName: lastName,\n phoneNumber: phoneNumber,\n email: email\n};\n\n}", "title": "" }, { "docid": "31090e4c95229d5b82abcd2910f82f64", "score": "0.56554663", "text": "function Person(name, age, job){\n this.name = name;\n this.age = age;\n this.job = job;\n this.friends = [“Shelby”, “Court”];\n}", "title": "" }, { "docid": "06ef5c6bd409eebd80a1710ee6e378d0", "score": "0.5643339", "text": "function Person(firstName, lastName, middleName) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.middleName = middleName;\n this.fullName = function() {\n console.log(`${this.firstName} ${this.middleName} ${this.lastName}`)\n }\n}", "title": "" }, { "docid": "6e9cc5efaf5c01aa5f6e57a5b3e6e403", "score": "0.5627696", "text": "function makePerson () { \n //Create a class called Person:\n //the function's string argument is the person's full name:\n let Person = function(firstAndLast) {\n //Split the full name string into an array of words:\n let fullName = firstAndLast.split(\" \");\n //Create method that returns the full name:\n this.getFullName = function() {\n //Join the full name array back into a string:\n fullN = fullName.join(\" \");\n return fullN;\n };\n //Create method that returns first name:\n this.getFirstName = function() {\n //returns first word in fullName array:\n return fullName[0];\n };\n //Create method that returns last name:\n this.getLastName = function() {\n //returns last word in fullname array:\n return fullName[1];\n };\n //Create method that sets first name:\n this.setFirstName = function(name) {\n //Change first element in fullname array\n //set to function's name argument and return:\n return fullName[0] = name;\n };\n //Create method that sets last name:\n this.setLastName = function(name) {\n //Change second element in fullname array\n //set to function's name argument and return:\n return fullName[1] = name;\n };\n //Create method that sets full name:\n this.setFullName = function(name) {\n //set firstAndLast variable to = function's name arg:\n firstAndLast = name;\n //set fullName to equal a new array of words\n //the result of splitting the new name string:\n fullName = firstAndLast.split(\" \");\n return fullName;\n };\n };\n //create class object bob and assign it the name Bob Ross:\n var bob = new Person('Bob Ross');\n //Example method calls:\n //console.log(bob.setFirstName(\"Tim\"));\n console.log(bob.setLastName(\"Stanislav\"));\n //console.log(bob.setFullName(\"Curry Haskell\"));\n console.log(bob.getFullName());\n //console.log(bob.getFirstName());\n //console.log(bob.getLastName());\n}", "title": "" }, { "docid": "5522aed78e2b0ce59e0eb41b912c15d3", "score": "0.5620655", "text": "function Person(name,age){\n this.name = name;\n this.age = age;\n this.bror =[];\n this.cars =[];\n}", "title": "" }, { "docid": "ffd392d975c53c94d20050578efc77c1", "score": "0.5596621", "text": "function Person(firstName, lastName, favoriteColor, favoriteNumber, ...favoriteFoods) {\n\tthis.firstName = firstName;\n\tthis.lastName = lastName;\n\tthis.favoriteColor = favoriteColor;\n\tthis.favoriteNumber = favoriteNumber;\n\tthis.favoriteFoods = favoriteFoods;\n\tthis.family = []\n}", "title": "" }, { "docid": "e23293965f0c7b14d7fae404e71ec9d3", "score": "0.5591504", "text": "function addPerson(name, surname, age) {\n\n}", "title": "" }, { "docid": "8a54cba516b7cd72c54cdb8ea8d7faa4", "score": "0.55784786", "text": "function addFriend(name, obj) {\n obj.friends.push(name);\n return obj;\n}", "title": "" }, { "docid": "8a54cba516b7cd72c54cdb8ea8d7faa4", "score": "0.55784786", "text": "function addFriend(name, obj) {\n obj.friends.push(name);\n return obj;\n}", "title": "" }, { "docid": "f90369057b7f5e2d10d55a2e342110dd", "score": "0.5548047", "text": "function Person(firstName , lastName ,date, newLastname){\n this.firstName = firstName;\n this.lastName = lastName;\n this.dob = new Date(date);\n // this.getMarried = function(){\n // this.lastName = newLastname;\n // }\n // this.fname = getMarried(newLastname,this);\n}", "title": "" }, { "docid": "4161510038b364df1d55e00c35d6ec27", "score": "0.55401516", "text": "function addPerson() {\n pCount++; //increment one person added to list of people\n console.log(\"The number of people added is \" + pCount);\n aName = document.getElementById(\"A_Name\").value;\n aAge = document.getElementById(\"A_Age\").value;\n aGender = document.getElementById(\"A_Gender\").value;\n aState = document.getElementById(\"A_State\").value;\n console.log(aPerson + \", \" + aName + \", \" + aAge + \", \" + aGender + \", \" + aState);\n var aPerson = new Person(aName, aAge, aGender, aState); // create the new object of the person class\n personList.push(aPerson); // add a person object to the list\n document.getElementById(\"New_and_This\").innerHTML = document.getElementById(\"New_and_This\").innerHTML + \n aPerson.pName + \" is a \" + \n aPerson.pAge + \" year old \" +\n aPerson.pGender + \" \" +\n aPerson.pAnimal + \" that lives in \" +\n aPerson.pState + \".<br>\";\n console.log(aPerson.pName + \" added to the list and should match --> \" + personList[(pCount-1)].pName);\n document.getElementById(\"Person_Count\").innerHTML = \"You have \" + pCount + \" people on the list:\";\n}", "title": "" }, { "docid": "2476964ad43a1f5bb2b1043113e12614", "score": "0.5519301", "text": "function Person() {\n\t\tthis.friends = [];\t\t\n\t}", "title": "" }, { "docid": "f9b41504f6f6b7dc24951906816c7d72", "score": "0.5481572", "text": "function getFamilyLastNames(familyComposition){\n\t//Generate random to know if the father/mother exist (flag value)\n\tvar random = Math.round(Math.random()*1);\n\t//console.log(random);\n\n\tvar surnames = getLastNamesDictionary(familyComposition,random);\n\n\t//Create a last name array \n\tvar last_names_array=[];\n\tfor (var i=0;i<familyComposition.length;i++){\n\t\tvar last_names=surnames[familyComposition[i]];\n\t\tlast_names_array.push(last_names[0]+' '+last_names[1]);\t\n\t}\n\treturn last_names_array;\n}", "title": "" }, { "docid": "7f5117e5cd7ab4307cdee44d37e046c9", "score": "0.5480614", "text": "function Person(firstName,lastName,age){\n this.firstName = firstName;\n this.lastName = lastName;\n this.age = age;\n this.getFullName = function(){\n console.log(`${this.firstName} ${this.lastName}`);\n }\n}", "title": "" }, { "docid": "76536088273ff03302a7835fa62daa8c", "score": "0.5473666", "text": "function addFriend (name, object) {\n//Should take a name and an object and add the name to the object's friends array then return the object\"\n//Add the name to the object friends array.\n//friends is key in object //name push into array //return whole object\nobject.friends.push(name);\nreturn object;\n\n}", "title": "" }, { "docid": "972fd54c286efa378cafd17b8a4b1f5b", "score": "0.5469728", "text": "function addFriend (name, object) {\nobject.friends.push(name); \nreturn object; \n}", "title": "" }, { "docid": "6166b326dccbd538d9fccc815903415d", "score": "0.5462791", "text": "function addFriend (name, object) {\n \n//input: name and object\n\n//add name to an array in object \nobject.friends.push(name);\n\n\n\n//returns object\nreturn object;\n}", "title": "" }, { "docid": "9a877b26327197c8f2e5c5dd1dbd319b", "score": "0.5436783", "text": "function addFullNameProp(obj) {\n var firstName = obj[\"firstName\"];\n var lastName = obj[\"lastName\"];\n if (firstName && lastName) {\n obj['fullName'] = firstName + ' ' + lastName;\n }\n return obj;\n}", "title": "" }, { "docid": "3d1d65c69f365e22088a35dea376b97b", "score": "0.542361", "text": "addPerson(object) {\n try {\n var personObj = object.person;\n var fname = this.inputFirstName();\n var lname = this.inputLastName();\n var address = this.inputAddress();\n var city = this.inputCity();\n var zip = this.inputZip();\n var mob = this.inputMobile();\n\n personObj.push({\n firstName: fname,\n lastName: lname,\n address: address,\n city: city,\n zip: zip,\n mobile: mob\n });\n\n console.log(personObj);\n }\n catch (err) {\n console.log(\"ERROR : \" + err);\n }\n\n\n }", "title": "" }, { "docid": "7081a245c62ae8e3f515fa1bd5784a70", "score": "0.54159", "text": "function addFullNameProp(obj) {\n var firstName = obj.firstName;\n var lastName = obj.lastName;\n\n if (firstName && lastName) {\n obj['fullName'] = firstName + ' ' + lastName;\n }\n return obj;\n}", "title": "" }, { "docid": "6634b6e7ecc09cd9b4b0fb052c856b61", "score": "0.54137903", "text": "function populatePeople() {\n\tvar firstNames = ['Gergana', 'Mihaela', 'Maria', 'Teodora', 'Gabriela', 'Ivan', 'Vasko', 'Simon', 'Vesko', 'Mihail'],\n\t\tlastNames = ['Georgieva', 'Filipova', 'Ivanova', 'Hristova', 'Petkova', 'Marinov', 'Petrov', 'Georgiev', 'Marinov', 'Filipov'];\n\t\n\tfor (i = 0; i < 10; i += 1) {\n\t\tpeople.push(createPerson(firstNames[i], lastNames[i], getRandomInt(1, 80), (i <= 4)));\n\t}\n}", "title": "" }, { "docid": "dee8ae19ebf311c7a60b33cd8f050037", "score": "0.54036796", "text": "function addFriend (name, object) {\n //add the name to the object's friends array then return the object\n object.friends.push(name);\n return object;\n}", "title": "" }, { "docid": "144e776b8087dc83e34a4235eb323143", "score": "0.5400212", "text": "function addFriend (name, object) {\nobject.friends.push(name);\nreturn object;\n \n}", "title": "" }, { "docid": "ce3061aee3888fc4074852c3032763e7", "score": "0.53889495", "text": "function addFriend (name, object) {\n \n /* Use the .push method to push the name value into the 'friends' property\n * of the Object\n */\n object.friends.push(name);\n \n // Return the new Object.\n return object;\n \n}", "title": "" }, { "docid": "eaf2536f4241d52a7cf6eaa3db30fab6", "score": "0.5388821", "text": "function Person(firstName, lastName) {\n this.getFirstName = function getFirstName() {\n return firstName;\n };\n this.getLastName = function getLastName() {\n return lastName;\n };\n this.getFullName = function getFullName() {\n return firstName + \" \" + lastName;\n };\n this.setFirstName = function setFirstName(fName) {\n if (/^[A-Za-z]+$/.test(fName)) firstName = fName;\n };\n this.setLastName = function setLastName(lName) {\n if (/^[A-Za-z]+$/.test(lName)) lastName = lName;\n };\n}", "title": "" }, { "docid": "2ed8a2b9d57bf9e2e512b5a9c2328433", "score": "0.53879917", "text": "function addFriend (name, object) {\n object.friends.push(name); // adding name to our friends property in object\n return object;\n\n}", "title": "" }, { "docid": "01736b6f884647f0845a41e5653dbda3", "score": "0.5379822", "text": "function addFriend (name, object) {\n \n\nobject.friends.push(name);\nreturn object;\n}", "title": "" }, { "docid": "8e18f80fb0897a7db1ee998ceb98f8fd", "score": "0.5370182", "text": "function addFriend (name, object) {\nobject.friends.push(name);\nreturn object;\n}", "title": "" }, { "docid": "fec213bf4ba165a7145dd6683aba1c3d", "score": "0.5369345", "text": "function addFriend (name, object) {\n object.friends.push(name);\n return object\n\n}", "title": "" }, { "docid": "0180593f521206dc56f0f04cb246d24f", "score": "0.53569007", "text": "function addFriend (name, object) {\n object.friends.push(name);\n return object;\n}", "title": "" }, { "docid": "0180593f521206dc56f0f04cb246d24f", "score": "0.53569007", "text": "function addFriend (name, object) {\n object.friends.push(name);\n return object;\n}", "title": "" }, { "docid": "ed9c3cba27b9c7256b0d63887ccc3641", "score": "0.5355235", "text": "static loadFamily(familyObj) {\n const id = familyObj.id \n const { name, members } = familyObj.attributes\n return new Family({id, name, members})\n }", "title": "" }, { "docid": "4d53b50cc8f18668c9178e2f5e75162f", "score": "0.5346679", "text": "function addFullNameProp(obj) {\n var firstName = obj.firstName;\n var lastName = obj[lastName];\n\n if (firstName && lastName) {\n obj['fullName'] = firstName + ' ' + lastName;\n }\n\n return obj;\n}", "title": "" }, { "docid": "bd2b33ad793bbc2863f6255382763793", "score": "0.53439575", "text": "function Person(name, birthday) {\r\n this.name = name;\r\n this.birthday = birthday;\r\n this.friends = [];\r\n this.greeting = 'Hello I am a.... Person.....';\r\n}", "title": "" }, { "docid": "1948b2e6cd9c2d8cb82d94fb02cbd180", "score": "0.5342328", "text": "function addFriend (name, object) {\n// takes name 'string' and an object\n\n//adds name to object's friends array\nobject.friends.push(name);\n//returns the object\nreturn object; \n}", "title": "" }, { "docid": "6bc8114638840ca9e3d88eda51a25d1d", "score": "0.53417116", "text": "function addFamilyRelation(name, dateOfBirth, gender){\n\t\tvar familyRelations = currentUser.relation(\"familyMember\");\n\t\tvar familyMember = new FamilyMember();\n\n\t\tfamilyMember.set(\"Name\", name);\n\t\tfamilyMember.set(\"dateOfBirth\", dateOfBirth);\n\t\tfamilyMember.set(\"gender\", gender);\n\t\tfamilyMember.save();\n\n\t familyRelations.add(familyMember);\n\t currentUser.save();\n\t}", "title": "" }, { "docid": "7330da41cd99887367b50ef48e5ec037", "score": "0.53402126", "text": "function addContact () {\n var firstName = $(\"#contactFirstName\").val();\n var lastName = $(\"#contactLastName\").val();\n var thisPerson = Object.create(Person);\n thisPerson.firstName = firstName;\n thisPerson.lastName = lastName;\n personArray.push(thisPerson);\n \n // Add contact right after input\n\n /*contactListItem.prepend (\n '<div class = \"d-block my-4 p-4 border rounded shadow-sm\">' +\n '<h4>' + firstName + ' ' + lastName+ '</h4>'\n )*/\n\n // Logs input in console\n console.log(\"Last Name: \" + lastName + \", First Name: \" + firstName);\n \n}", "title": "" }, { "docid": "0637e6c70b570532bde9bcbaca36a538", "score": "0.5322273", "text": "function addFriend (name, object) {\n// we can access an object using .dot notation and \n// we can add to an array in an object using.push\n object.friends.push(name);\n // retun the updated object\n return object;\n}", "title": "" }, { "docid": "ffd1a08f9e5d9e8a14d95837834a035f", "score": "0.53043026", "text": "function addStudent(firstName, lastName, grade){\r\n var x = new Student(firstName, lastName, grade);\r\n guardStudents.push(x);\r\n}", "title": "" }, { "docid": "5bdba1b36deba1bd0b5df65d597ea95b", "score": "0.5304058", "text": "function addFriend(name, object) {\n object.friends.push(name);\n return object;\n}", "title": "" }, { "docid": "847afb8dacd6fd33a57e87c2b531a816", "score": "0.5288264", "text": "function addFriend (name, object) {\nobject.friends.push(name)\nreturn object\n}", "title": "" }, { "docid": "e4a26c77eca43e45a2ea8eed782e7603", "score": "0.5279409", "text": "function addFriend(animal,friend){\n //animal.friends.push(friend);\n animal.friends.push(friend.username);\n}", "title": "" }, { "docid": "bd5313c577baacff16d59d5b7117a5e5", "score": "0.5273631", "text": "function Person(fName, lName, dob, ssn, email) {\r\n this.fName = fName;\r\n this.lName = lName;\r\n this.dob = dob;\r\n this.ssn = ssn;\r\n this.email = email;\r\n this.addToTable = addPersonToTable;\r\n}", "title": "" }, { "docid": "3cd9e777c8e8027878ef248607d6fb85", "score": "0.5263026", "text": "addPerson (name) {\n this.people[name] = [];\n }", "title": "" }, { "docid": "90c801e1fa663bf4c83ef6c8b9831df2", "score": "0.52628934", "text": "function addFriend (name, object) {\n object[\"friends\"].push(name);\n return object;\n\n}", "title": "" }, { "docid": "767e19186f693905dddeea78ecb9678b", "score": "0.5260295", "text": "function Person(first, last){\n this.first = first;\n this.last = last;\n}", "title": "" }, { "docid": "d878552aa59ac0928ed8c99dee0c37fd", "score": "0.5259529", "text": "function getFullName (people) {\n return people.firstName + ' ' + people.lastName\n}", "title": "" }, { "docid": "7d99f4bd72610e6e2d67f1d87dcef8e8", "score": "0.5247021", "text": "addPlayer(firstName, lastName, age) {\n this._players.push({\n firstName: firstName,\n lastName: lastName,\n age: age\n })\n }", "title": "" }, { "docid": "a726eedcf0b7674bf3154a6cc8dc0ed9", "score": "0.5244792", "text": "function addFriend (name, object) {\n//add name to the object's friends array\nobject[\"friends\"].push(name);\n\n//return the object\nreturn object;\n}", "title": "" }, { "docid": "2f6dc60abc81e4c22c259d28b65c8fb8", "score": "0.5242872", "text": "function Person() {\n this.firstName = \"\";\n this.lastName = \"\";\n this.shippingAddress = new Address();\n this.billingAddress = new Address();\n this.ID = new IDNumbers();\n}", "title": "" }, { "docid": "d3036575c3523f392e511391ea3c98c4", "score": "0.52298504", "text": "function Person(fname, lname){\r\n this.fistname = fname;\r\n this.lastname = lname;\r\n}", "title": "" }, { "docid": "52851c0d442e422786c2e1ce6df748d6", "score": "0.5223628", "text": "function Person(fistName, lastName, dob) {\n this.firstName = fistName;\n this.lastName = lastName;\n this.dob = new Date(dob);\n this.getBirthYear = function() {\n return this.dob.getFullYear(); //added method getBirthYear to Person object\n };\n this.getName = function() {\n return `${this.firstName} ${lastName}`; //added method getName to Person object\n };\n}", "title": "" }, { "docid": "b020f3719961355db3de3b19acf52bad", "score": "0.5222801", "text": "function addFirstPerson()\n\t{\n\t\tvar tree = new FamilyTree();\n\n\t\ttry\n\t\t{\n\t\t\ttree.addPerson( \"Alexander\", true );\n\t\t\treturn true;\n\t\t}\n\t\tcatch( err )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "55fd67c2b000ede95048793b201443d0", "score": "0.52185756", "text": "function addToListArray(name, address, phone, trash){\n let newPerson =\n {\"id\" : id,\n \"name\" : name,\n \"phone\" : phone,\n \"address\": address,\n \"trash\" : trash\n }\n PERSONS.push(newPerson);\n update (newPerson);\n \n}", "title": "" }, { "docid": "7797d454208675adfe96293ff3d97559", "score": "0.52182347", "text": "function addingPropertyToExistingObject(firstName,lastName,age,eyeColor)\n{\n\tthis.firstName = firstName;\n\tthis.lastName = lastName;\n\tthis.age = age;\n\tthis.eyeColor = eyeColor;\n\t\n}", "title": "" }, { "docid": "3e6f6fc6dc3b7425adba3248d22bfe1f", "score": "0.5210181", "text": "function fullName(person) {\n return person.firstName + \" \" + person.lastName;\n}", "title": "" }, { "docid": "93d96d5e70951e1808032d73938617ab", "score": "0.520316", "text": "addPlayer(firstName, lastName, age){\n const newPlayer = {\n firstName: firstName,\n latName: lastName,\n age: age\n };\n this._players.push(newPlayer);\n }", "title": "" }, { "docid": "f3fc4a4c5e9dd2571152bdf3809aa983", "score": "0.51929873", "text": "function firstName(obj) {\n var fullNames='';\n\nfor (var i = 0; i <obj.length; i++) {\n\n fullNames+=obj[i].name.first+' ';\n\n \n}\nreturn fullNames;\n}", "title": "" }, { "docid": "eded9231cdff049b034fa82be4e4b711", "score": "0.5184917", "text": "function displayStudent(obj) {\r\n for (i = 0; i < obj.length; i++) {\r\n var p = new Person(obj[i].first_name, obj[i].last_name);\r\n student_set.push(p);\r\n }\r\n //console.log(student_set);\r\n}", "title": "" }, { "docid": "e35edadad514ab790b8d1a85f0ffd5f9", "score": "0.5184346", "text": "function Person(firstname, lastname) {\n this.firstname = firstname;\n this.lastname = lastname; \n}", "title": "" }, { "docid": "6a2022d9e66777fb45335f9d1a930f42", "score": "0.517777", "text": "function makePerson(fname, lname, age, gender) {\n return {\n firstName: fname,\n lastName: lname,\n age: age,\n gender: gender,\n toString: function() {\n return this.firstname + ' ' + this.lastname ;\n }\n };\n}", "title": "" }, { "docid": "6a2022d9e66777fb45335f9d1a930f42", "score": "0.517777", "text": "function makePerson(fname, lname, age, gender) {\n return {\n firstName: fname,\n lastName: lname,\n age: age,\n gender: gender,\n toString: function() {\n return this.firstname + ' ' + this.lastname ;\n }\n };\n}", "title": "" }, { "docid": "36e8bc2c835b5f1dc922bc8f66f85ada", "score": "0.51736975", "text": "function Person(first,last,age,gender,interests){\n this.name = {'first': first, 'last': last};\n this.age = age;\n this.gender = gender;\n this.interests = interests;\n let outputgender = gender.toUpperCase() == 'MALE' ? 'He' : 'She';\n let interests_string = interests.join(' ').replace(/ /g, ' and ')\n\n this.bio = function (){\n console.log(this.name.first + ' ' + this.name.last + ' ' +\n this.age + ' years old.' + outputgender + ' likes ' + interests_string\n + '.');\n }\n\n this.greeting = function() {\n console.log('Hi I\\'m ' + this.name.first + '.');\n }\n}", "title": "" }, { "docid": "5ca6cfc7557e3f631608a47a5ecdc050", "score": "0.51711005", "text": "add(newPerson) {\n if (newPerson && newPerson.Id) {\n // condLog(\"Adding: \", newPerson.Id);\n this[newPerson.Id] = new WikiTreeAPI.Person(newPerson);\n } else {\n condLog(\"Can't add newPerson: \", newPerson);\n }\n }", "title": "" }, { "docid": "c11ba86154561382572799a0497fcfb8", "score": "0.51559466", "text": "function Person(first, last, age, eyecolor) {\r\n this.firstName = first;\r\n this.lastName = last;\r\n this.age = age;\r\n this.eyeColor = eyecolor;\r\n this.name = function() { return this.firstName + \" \" + this.lastName; };\r\n}", "title": "" }, { "docid": "0f9fab230098dd3fe4eac159ae2e860a", "score": "0.51493895", "text": "agregarPersona(id, nombre, sala) {\n\n let persona = {\n id,\n nombre,\n sala\n }\n\n this.personas.push(persona);\n\n return this.personas;\n }", "title": "" }, { "docid": "d4b61a27d3a89beea3fa87b3e5119f13", "score": "0.5148429", "text": "function addPerson(object)\n{\n people.push(object);\n\n updateDOM();\n}", "title": "" }, { "docid": "abed930d2955caad2c44db9f3e1b666a", "score": "0.51452875", "text": "agregarPersona(id, nombre, sala) {\n let persona = { id, nombre, sala };\n\n this.personas.push(persona);\n\n return this.personas;\n }", "title": "" }, { "docid": "acf0b3d6761f2bc0bae53d05b3f212c3", "score": "0.5136122", "text": "function person(firstName, lastName, greeting) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.greeting = greeting;\n this.sayGreeting = function() {\n console.log(this.greeting)\n };\n}", "title": "" }, { "docid": "e25f538728efb825ecfcdd88554daad6", "score": "0.51358384", "text": "function Person(firstName, middleName, lastName) {\n this.firstName = firstName;\n this.middleName = middleName;\n this.lastName = lastName;\n}", "title": "" }, { "docid": "d131f1b71da24f985d6e1de42247f2c7", "score": "0.51354223", "text": "function CreatePerson(fn, ln, age){\r\n this.firstName = fn;\r\n this.lastName = ln;\r\n this.age = age;\r\n this.print = function(add){\r\n this.age += add || 0;\r\n console.log(\"this new function object call: \" + this.firstName + \" \"\r\n + this.lastName + \" is \" + this.age + \" years old.\" );\r\n }\r\n}", "title": "" }, { "docid": "642ae92a5fb0a3d0d2091fb8d5910e3b", "score": "0.5130956", "text": "function Employee ( firstName, lastName, idNumber, jobTitle, annualSalary) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.idNumber = idNumber;\n this.jobTitle = jobTitle;\n this.annualSalary = annualSalary;\n console.log('new Employee ->', this);\n \n // push objects into global array\n employeeList.push( this );\n console.log('employeeList ->', employeeList);\n \n}", "title": "" }, { "docid": "c856dbdb1e0f3555f050c44840f88610", "score": "0.5127968", "text": "function ThomasFamily(firstName,lastName,nationality) {\n //adding default values\n lastName = (lastName === undefined) ? 'Thomas' : lastName;\n nationality = (nationality === undefined) ? 'British' : nationality;\n this.firstName = firstName;\n this.lastName = lastName;\n this.nationality = nationality;\n}", "title": "" }, { "docid": "73eaaca90bda2ef56a2a7596fb160163", "score": "0.51256263", "text": "agregarPersona(id, nombre, sala) {\n\t\tlet persona = {\n\t\t\tid,\n\t\t\tnombre,\n\t\t\tsala,\n\t\t};\n\n\t\tthis.personas.push(persona);\n\n\t\treturn this.personas;\n\t}", "title": "" }, { "docid": "7fc239f16791546a04ece6f6d373adaf", "score": "0.5119226", "text": "addPeopleArray() {\n this.personArray.forEach(edge => {\n if (!this.adList[edge[0].id]) {\n this.adList[edge[0].id] = new LinkedList();\n this.name[edge[0].id] = edge[0].name;\n }\n this.adList[edge[0].id].addNode(new AdjacencyNode(edge[1], edge[2]));\n });\n }", "title": "" }, { "docid": "62e4294717501554286abd32121422df", "score": "0.5117534", "text": "function addFriend (name, object) {\n\n}", "title": "" }, { "docid": "2e722acb38bea2f5e445b98c254cf88b", "score": "0.5108939", "text": "agregarPersonajes(personaje) {\n // Si el parámetro es un objeto o un string\n // this.personajes.push(personaje);\n this.personajes = personaje;\n this.getPersonajes();\n }", "title": "" }, { "docid": "82081afe68fb5305053f269420c89ce6", "score": "0.51083714", "text": "function newPerson(firstName, lastName) {\r\n this.firstName = firstName;\r\n this.lastName = lastName;\r\n}", "title": "" }, { "docid": "c181d85e2bb690d3a4002fafda013738", "score": "0.5108176", "text": "addHobby (hobby = \"\" )\n {\n if ( hobby.length > 0 ) // So we can only add items that are not empty.\n {\n this.hobbies.push( hobby ); // Built-in method push(); -< moves item to the end of an array!\n }\n }", "title": "" } ]
de46b40f5713ed0c1ef51c7a5145817a
setup helper function to check if string has all unique inputs
[ { "docid": "53eca86e8c9608477bc4850e21d5b002", "score": "0.7981512", "text": "function _isUnique(input) {\n //Set object that splits our string to an array\n //Then reduce that array\n const obj = input.split('').reduce((acc, char) => {\n //Set acc and character to be true\n acc[char] = true;\n //Return what our accumulator is holding so that\n //it's true\n return acc;\n //Reduce into an empty object\n }, {});\n //Match the length of our keys to our input \n return Object.keys(obj).length === input.length;\n }", "title": "" } ]
[ { "docid": "52bfbb47bd65605b4e8ac64cf7b423f7", "score": "0.7965572", "text": "function isUniqueOptimized(testString){\n \n \n}", "title": "" }, { "docid": "b7754a28b3ab4a2366d8cc412e3a7f9c", "score": "0.7560493", "text": "function allUnique(string) {\r\n\tfor (var i = 0; i < string.length; i++) {\r\n\t\tfor (var j = i+1; j < string.length; j++) {\r\n\t\t\tif (string[i] === string[j]) {\r\n\t\t\t\treturn false\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\treturn true\r\n}", "title": "" }, { "docid": "6cd83edd96f7f57757b124c5ae250c79", "score": "0.7552213", "text": "function isUnique(string) {\n if (string.length > 128) { return false }\n for(let i = 0; i < string.length; i++) {\n for(let j = i+1; j < string.length; j++){\n if (string[i] === string[j]) {\n return false\n }\n }\n }\n return true\n}", "title": "" }, { "docid": "604d47ef4f73d1eb8921d31d3c4d8dae", "score": "0.7410773", "text": "function isUnique14(str) {\n let arr = str.split('');\n for (let i = 0; i < arr.length - 1; i++) {\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[i] === arr[j]) {\n return false;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "aa90085d3db96be62ee563a5b4348230", "score": "0.74029213", "text": "function isUnique(str) {\n return new Set(str).size == str.length;\n}", "title": "" }, { "docid": "f7358634d490f9c039e4e781c517bc64", "score": "0.7399237", "text": "function isUnique2(str) {\n for (let i = 0; i < str.length; i++) {\n for (let j = i + 1; j < str.length; j++) {\n if (str[i] === str[j]) {\n return false;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "b3fd660c90568b2a0dde5bba9dfe4a9b", "score": "0.739674", "text": "function isUnique(str) {\n let set = new Set();\n for(let i = 0; i < str.length; i++) {\n if(set.has(str[i])) {\n return false;\n }\n else {\n set.add(str[i]);\n }\n }\n return true;\n}", "title": "" }, { "docid": "b36f1cc5538188a05b756c1ae4cd9fb1", "score": "0.7393728", "text": "function uniqueLetters(str) {\n let input = new Set();\n for (let i = 0; i < str.length; i++) {\n if (input.has(str[i])) {\n return false;\n }\n input.add(str[i]);\n }\n return true;\n}", "title": "" }, { "docid": "caf6c94fea67498a1ae2702425acdf80", "score": "0.730044", "text": "function isUnique(string) {\n if (string.length > 128) { return false }\n let hash = {}\n for (let i = 0; i < string.length; i++) {\n if (hash[string[i]] === \"true\") {\n return false\n } else {\n hash[string[i]] = \"true\"\n }\n }\n return true\n}", "title": "" }, { "docid": "39b3de4fcf88c4bf0a510d8f6ae9d547", "score": "0.7263327", "text": "function uniqueChars2(str){\n let chars = new Set();\n\n for (let i=0; i< str.length; ++i){\n if(chars.has(str[i])){\n return console.log(\"S2: False\"); // if match, return false\n }\n chars.add(str[i]);\n }\n return console.log(\"S2: True\"); // if no match, return true\n}", "title": "" }, { "docid": "8eb75e356a98666d8facded9e1962f2a", "score": "0.7249345", "text": "function isUnique2(str) {\n var stringTwo = '';\n for (var i = 0; i < str.length; i++) {\n for (var j = 0; j < stringTwo.length; j++) {\n if (str[i] == stringTwo[j]) {\n return false;\n }\n }\n stringTwo += str[i];\n }\n return true;\n}", "title": "" }, { "docid": "7a57f2d1c6a777b72b9dd939f66a1a00", "score": "0.7243666", "text": "function isUniq(str) {\n let checker = 0, // This is basically a 32 bit array \n // of bits i.e. 00000000 00000000 00000000 00000000 minus the spaces\n out = true; \n // now we loop through the string, checking against \n // the checker and setting a bit at the ith position \n // in it corresponding to the char, e.g. a = 1, z = 26\n for (var i = 0; i < str.length; i++) {\n // 1 in bits is a rightmost 1, i.e. \n // 00000000 00000000 00000000 00000001\n // Chars start at 97 (i.e. a = 97) so we subtract 96 from the charcode\n // Then we get a number betw 1-26 and move that\n // leftmost 1 rightwards that much\n let bitRepr = (1<<(str.charCodeAt(i) - 96));\n // now we check against the checker, if theres\n // a 1 in the ith position then we've seen that char before\n // AND returns 0 unless its comparing 2 1's,\n // so we get back the bit repr of 1\n if ((bitRepr & checker) > 1) {\n out = false;\n } else {\n // if we dont see a 1 then we use or to stick a 1 into\n // the checker bitvector\n // OR returns 1 unless both numbers are 0s\n // i.e 00000001 & 00000101 = 00000101\n checker |= bitRepr;\n }\n }\n return out;\n}", "title": "" }, { "docid": "cb3fd45c0dc4b6ef3fb3c7cae8e6757b", "score": "0.7222499", "text": "function unique(str) {\n\n}", "title": "" }, { "docid": "5845a5293ef631ca69bbc1b39a43e375", "score": "0.72170186", "text": "function uniqueChars1(string) {\n for (var i=0; i< string.length; i++) {\n for (var j = i + 1; j < string.length; j++) {\n if(string[i] === string[j]) {\n return console.log(\"S1: False\"); // if match, return false\n }\n }\n }\n return console.log(\"S1: True\"); // if no match, return true\n}", "title": "" }, { "docid": "30a889f861a82f90ba5c6e2613aa76e0", "score": "0.72157365", "text": "function isUnique(str) {\n let uniq = new Set();\n for (let i = 0; i < str.length; i++) {\n if (uniq.has(str[i])) {\n return false;\n }\n uniq.add(str[i]);\n }\n return true;\n}", "title": "" }, { "docid": "6559f6c5986d0517105042fbda56fa4b", "score": "0.720633", "text": "function isUniqueInPlace(str){\n str = str.split('').sort();\n for(let i = 0; i < str.length; i++){\n if(str[i] === str[i+1]){\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "c450014346416a667fcaea7df6e1bd6c", "score": "0.7205643", "text": "function isUnique2(str) { // without data structure;\n for (let i = 0; i < str.length; i++) {\n let char1 = str[i];\n for (let j = 0; j < str.length; j++) {\n let char2 = str[j];\n if (char1 === char2) {\n return false;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "82dc1249a41561fcd814e0f30f440e80", "score": "0.7187445", "text": "function isUnique(string) {\n for(let i = 0; i < string.length; i++) { // n\n let char = string[i]; // 1\n let newString = string.slice(i + 1); // n\n\n if(newString.includes(char)) { // n\n return false;\n }\n } \n return true;\n}", "title": "" }, { "docid": "1431994708c502313e0c74c290c63d97", "score": "0.7179364", "text": "function isUnique2(str) {\n // iterate through str and compare each character to all the other characters\n for (let i = 0; i < str.length; i += 1) {\n for (let j = i + 1; j < str.length; j += 1) { \n if (str[i] === str[j]) {\n return false;\n }\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "d1c20605273ff606f5bff650a2bcaae1", "score": "0.717919", "text": "function isUnique15(str) {\n // ASCII string longer than 128 has dups\n if (str.length > 128) {\n return false;\n }\n\n // O(n^2) when banning use of hash or array etc\n for (let i = 0; i < str.length; i += 1) {\n for (let j = i + 1; j < str.length; j += 1) {\n if (str[i] === str[j]) {\n return false;\n }\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "ef452f94cbdc8a5a3d223808722e6b78", "score": "0.71695507", "text": "function isUnique2(astr) {\n // astr\n if (astr.length == 1) {\n return true;\n }\n\n for (let i = 0; i < astr.length; i++) {\n if (astr.indexOf(astr[i], i + 1) > -1) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "e1570a947b9c77c245e258aedb72fbe5", "score": "0.71471596", "text": "function isUnique(string) {\n const chars = new Set();\n\n for (let c of string) {\n if (chars.has(c)) return false;\n else chars.add(c);\n }\n\n return true;\n}", "title": "" }, { "docid": "2e2aa0147539ccacc76609f1ac9a0bdf", "score": "0.71458614", "text": "function isUnique18(str) {\n let checker = 0;\n for (let i = 0; i < str.length; i++) {\n let val = str.charCodeAt(i) - 'a'.charCodeAt(0);\n if ((checker & (1 << val)) > 0) {\n return false;\n }\n checker |= 1 << val;\n }\n return true;\n}", "title": "" }, { "docid": "45c588ee6fc561543d232f2f886dc0af", "score": "0.7129284", "text": "function isUnique6(str) {\n let chars = new Set();\n\n for (let i = 0; i < str.length; ++i) {\n if (chars.has(str[i])) {\n return false;\n }\n chars.add(str[i]);\n }\n return true;\n}", "title": "" }, { "docid": "c9b7d0b136d1db4a6e54980c0423aa4d", "score": "0.7116192", "text": "function uniqueChar1(str) {\n if (str === '')\n return false;\n let set = new Set();\n for (let letter of str) {\n if (set.has(letter))\n return false;\n else\n set.add(letter);\n }\n return true;\n}", "title": "" }, { "docid": "473b06351c35948e6f685c49251f94ad", "score": "0.7111126", "text": "function isUnique(str) {\n var hash = {};\n \n for(var i = 0; i < str.length; i++) {\n if(hash[str[i]]) {\n return false;\n } else {\n hash[str[i]] = true;\n }\n }\n return true;\n}", "title": "" }, { "docid": "1ac854cca28f8ca6aa3e7c56459167c1", "score": "0.7105976", "text": "function isUnique(str) {\n for (let i=0; i<str.length; i++) {\n if (str.substring(0, i-1).indexOf(str.charAt(i)) > -1 || str.substring(i+1, str.length).indexOf(str.charAt(i)) > -1) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "c07f32c2fb419e3e34fb0f90631cdde8", "score": "0.7102104", "text": "function unique (string){\n for(let i=0; i<string.length; i++){\n for(let j=0; j<string.length; j++){\n //console.log(string[j], string[i])\n if(i==j){}\n else if(string[i]==string[j]){\n return false; \n }\n }\n }\n return true\n}", "title": "" }, { "docid": "2fb694d49526adfd7efc5e6903758373", "score": "0.70853764", "text": "function isUnique(str) {\n let count = 1;\n for (var char of str) {\n for (var i = count; i < str.length; i++) {\n if (str[i] === char) return false;\n }\n count++\n }\n return true;\n}", "title": "" }, { "docid": "9b06a57e6767031b6fbe60621c98173a", "score": "0.708227", "text": "function isUniqueAlt(str){\n let chars = [];\n \n for (let i = 0; i < str.length; i++){\n chars.push(str[i]);\n }\n\n chars.sort();\n\n for (let i = 0; i < str.length - 1; i++){\n if (chars[i] === chars[i+1]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "13bacec9118ffa1d2ab0822eaa483e29", "score": "0.70807785", "text": "function isUnique(str) { // with data structure;\n let mem = {};\n for (let i = 0; i < str.length; i++) {\n let char = str[i];\n if (mem[char]) {\n return false;\n } else {\n mem[char] = true;\n }\n }\n return true;\n}", "title": "" }, { "docid": "5e7cabf68e1086d014ba61b1f3e52429", "score": "0.7034971", "text": "function hasUniqueChars(str) {\n var check = str.split('').sort();\n for (var i = 0; i < check.length; i++) {\n if (check[i] == check[i + 1]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "6222272e34a26dc5b54bd555f21a27ac", "score": "0.6995006", "text": "function isUnique(str) {\n var counts = {};\n\n str.split(\"\").forEach(function(char) {\n if (counts.hasOwnProperty(char)) {\n counts[char]++;\n } else {\n counts[char] = 1;\n }\n });\n\n for (var key in counts) {\n if (counts[key] > 1) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "73b939e388034fe1e3754fac57cdbf07", "score": "0.6993185", "text": "function isUnique(str) {\n\n\tif(!str) {\n\t\treturn false;\n\t}\n\n\tvar limitSize\t= 23,\n\t\tr1ll\t\t= 32,\n\t\tr1ul\t\t= r1ll + 23,\n\t\tr2ll\t\t= r1ul + 1,\n\t\tr2ul\t\t= r2ll + 23,\n\t\tr3ll\t\t= r2ul + 1,\n\t\tr3ul\t\t= r3ll + 23,\n\t\tr4ll\t\t= r3ul + 1,\n\t\tr4ul\t\t= 126,\n\t\tchecker1\t= 0,\n\t\tchecker2\t= 0,\n\t\tchecker3\t= 0,\n\t\tchecker4\t= 0,\n\t\tlen\t\t\t= str.length,\n\t\tindex\t\t= 0,\n\t\tshift,\n\t\tcharCode;\n\n\tfor(; index < len; index++) {\n\t\tcharCode = str.charCodeAt(index);\n\n\t\tif(charCode >= r1ll && charCode <= r1ul) {\n\t\t\tshift = 1 << (charCode - r1ll);\n\t\t\tif(checker1 & shift) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tchecker1 |= shift;\n\t\t\t}\n\t\t} else if(charCode >= r2ll && charCode <= r2ul) {\n\t\t\tshift = 1 << (charCode - r2ll);\n\t\t\tif(checker2 & shift) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tchecker2 |= shift;\n\t\t\t}\n\t\t} else if(charCode >= r3ll && charCode <= r3ul) {\n\t\t\tshift = 1 << (charCode - r3ll);\n\t\t\tif(checker3 & shift) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tchecker3 |= shift;\n\t\t\t}\n\t\t} else if(charCode >= r4ll && charCode <= r4ul) {\n\t\t\tshift = 1 << (charCode - r4ll);\n\t\t\tif(checker4 & shift) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tchecker4 |= shift;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "9e9b8cf3caef0d19b8124a45801b6b9b", "score": "0.6992833", "text": "function isUniqHT(str) {\n let table = {}, out = true;\n\n for (var i = 0; i < str.length; i++) {\n if (table[str[i]] !== undefined) {\n out = false;\n }\n table[str[i]] = 1;\n }\n return out;\n}", "title": "" }, { "docid": "c7d7006221d53844541de27af3a6f390", "score": "0.69862694", "text": "function isUnique(testString){\n // verify input\n if(!isVerified(testString)){\n return;\n }\n \n // implementation 1. brute force\n // define array to track letters we've covered\n let covered_letters = []\n \n for(var i = 0; i < testString.length; i++){\n current_letter = testString[i]\n \n if(covered_letters.includes(testString[i])){\n console.log('duplicate', testString[i], 'found!')\n return;\n }\n \n // otherwise, continue loop\n covered_letters.push(testString[i])\n }\n \n // if we make it out the for loop, that means no dups\n console.log('string does not have duplicate letters')\n return true;\n}", "title": "" }, { "docid": "50067a5262a9eb74bb71e6e4bbbf5fed", "score": "0.696807", "text": "function hasUniqueChars (str) {\n const chrs = str.split('')\n return chrs.every((i, idx) => idx === chrs.lastIndexOf(i))\n}", "title": "" }, { "docid": "99f11bc6ef0b8b25304655c9ad35975a", "score": "0.6944376", "text": "function isUniq(input) {\n for (let i = 0; i < input.length; i++) {\n for (let j = i + 1; j < input.length; j++) {\n if (input[i] === input[j]) {\n return false;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "fbaec7c185ac37ec43bea121b4224a52", "score": "0.6933068", "text": "function uniqueChars(string){\n\n // create an object that records unique characters\n // if any characters have more than 1 characters, we can return false\n // if we complete the process without interrupting, we have a string with all unique characters\n\n var chars = {}, len = string.length;\n if (len < 2){\n return true;\n }\n\n for (var i = 0; i < len; i++){\n var ch = str.charAt(i);\n if (chars[ch] === undefined){\n chars[ch] = 1;\n }\n else {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "b717af608d51bbf0437d22642304e473", "score": "0.69304985", "text": "function isUnique2(str) {\n // sort string using quicksort\n arr = str.split('').sort();\n for (var i = 1; i < arr.length; ++i) {\n if (arr[i] === arr[i - 1]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "0e4140399043e1ba1cbc6027103c9a16", "score": "0.69155264", "text": "function is_unique(str) {\n var obj = {};\n for (var i = 0; i < str.length; i++) {\n var ch = str[i];\n if (obj[ch]) {\n return false;\n } else {\n obj[ch] = true;\n }\n }\n return true;\n}", "title": "" }, { "docid": "22ad436965b272e473634dcbb99c6418", "score": "0.69084036", "text": "function allCharsUnique(x){\n string.indexOf(x) = false\n return true\n}", "title": "" }, { "docid": "4c6fa171092c8fa76c65181ebdd036e6", "score": "0.6887971", "text": "function isUnique(s) {\n let arr = Array(26).fill(0); //intialize an empty array with 26 characters and fill each of them with 0\n s = s.toLowerCase(); // converting all leters to lowercase\n for (let char of s) {\n let value = char.charCodeAt() - 97; // subtracting 97 to get the position in which the char needs to be stored\n if (arr[value] != 0) {\n // if the value is not equal to 0, means that we have encountered the value for second time\n return false;\n } else {\n arr[value] = 1;\n }\n }\n return true; // if no dup character found, we return true\n }", "title": "" }, { "docid": "fa9e3c865fcdbd68d58497d26758b653", "score": "0.6880417", "text": "function isUnique(str) {\n const hashMap = {};\n let duplicate = false;\n for (let letter of str) {\n if (hashMap[letter]) {\n duplicate = true;\n } else {\n hashMap[letter] = true;\n }\n }\n return !duplicate;\n}", "title": "" }, { "docid": "a17b2d894a6cab739de1b48432f5f8ae", "score": "0.6859848", "text": "function isUnique2(str) {\n const chars = {};\n for (let i = 0; i < str.length; i++) {\n const thisChar = str[i];\n\n if (chars[thisChar] === true) {\n return false;\n }\n\n chars[thisChar] = true;\n }\n\n return true;\n}", "title": "" }, { "docid": "59c7e63fdd747f6be031ac9ecd2fddfe", "score": "0.68412304", "text": "function isUnique3(str) {\n // sort str (in place)\n str.sort();\n\n // iterate through str\n // if a character is the same as the adjacent character, return false\n for (let i = 0; i < str.length - 1; i += 1) {\n if (str[i] === str[i + 1]) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "1ac7337b6c55600d414aef3ac3f4ebee", "score": "0.68343323", "text": "function unique1(str) {\n let values = [];\n\n for (let letter of str) {\n // console.log(values.indexOf(letter));\n if (values.indexOf(letter) !== -1) {\n return false;\n }\n values.push(letter);\n }\n\n return true\n}", "title": "" }, { "docid": "f1e00fa01710cb432b2d05a12f7aa25e", "score": "0.6822488", "text": "function isUnique(str) {\n // create a set\n const chars = new Set();\n\n // iterate through str\n for (let i = 0; i < str.length; i += 1) {\n // if character is in set, return false\n if (chars.has(str[i])) {\n return false;\n }\n\n // if character is not in set, add to set\n chars.add(str[i]);\n }\n \n // return true\n return true;\n}", "title": "" }, { "docid": "f8af507e93f7dc250a30574716e66308", "score": "0.6807413", "text": "function isUnique7(str) {\n const letterSet = new Set();\n\n for (const letter of str) {\n if (letterSet.has(letter)) return false;\n letterSet.add(letter);\n }\n\n return true;\n}", "title": "" }, { "docid": "6286f251fb0b80c103f0b15ef3274c2b", "score": "0.6795419", "text": "function isUnique3(str) {\n var arr = str.split('');\n arr = arr.sort();\n var newStr = arr.join('');\n\n for (var i = 0; i < newStr.length - 1; i++) {\n if (newStr[i] === newStr[i + 1]) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "d1d5178dd4122918d36ce99a1387226e", "score": "0.6744701", "text": "function isUnique_hash(str){\n if(str.length > 128) return false;\n str = str.trim();\n var hashMap = {};\n for (var i = 0; i < str.length; i++) {\n if(!hashMap[str[i]]){\n hashMap[str[i]] = 1;\n }else{\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "8b35adb6315b78e47b1081afd95648c6", "score": "0.6730463", "text": "function uniqueChar2(str) {\n if (str === '')\n return -1;\n for (let i = 0; i < str.length; i++) {\n for (let j = i + 1; j < str.length; j++) {\n if (str[i] === str[j]) {\n return false;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "d1ba02f2ec7ed560403c9c363f7ec077", "score": "0.6715932", "text": "function checkUniqChars(str){\n\n let map ={}\n for ( let i = 0; i < str.length; i++){\n const char = str[i];\n\n if(map[char] === undefined){\n map[char] =null\n }else{\n return false\n }\n }\n return true\n}", "title": "" }, { "docid": "792aa6852b4c14528ab422298458a379", "score": "0.67108965", "text": "function uniqueChar(str) {\n str = str.toString().toLowerCase(); //converts to lowercase\n\n let trueVal;\n let falseVal;\n\n //makes sure the string is not undefined and is a string\n if (!str || typeof str !== \"string\") {\n return \"Enter a valid string\";\n }\n\n //if string length is 1, it is unique\n if (str.length === 1) {\n return \"Yep, it is unique\";\n }\n\n //conversts string to an array\n const strArr = [...str];\n\n //loops over every element\n for (let i = 0; i < strArr.length; i++) {\n const element = strArr[i];\n\n //result is a new array of all filtered character\n const result = strArr.filter((char) => char === element);\n\n //if more that one character, it is not unique else unique\n if (result.length > 1) {\n console.log(\"false\");\n falseVal = true;\n break;\n } else {\n trueVal = true;\n console.log(\"true\");\n }\n }\n\n if (falseVal) {\n return false;\n }\n\n if (trueVal) {\n return true;\n }\n}", "title": "" }, { "docid": "b7e1eb48a6b06962aaa7e5d181782ecf", "score": "0.6707271", "text": "function isUniqueNoDS(str) {\n str.sort();\n for(let i = 1; i < str.length; i++) {\n if(str[i] === str[i - 1]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "75b7015ed25f48a9fc8aaa375330a6f4", "score": "0.6707103", "text": "function noDuplicateLetters(phrase) {\n\treturn phrase.split(\" \").every(x => new Set(x.split(\"\")).size === x.length)\n}", "title": "" }, { "docid": "cb3544256e6738060edcaafa8a0e85e1", "score": "0.67000645", "text": "function isUnique8(str) {\n let arr = []; //I don't need to identify 128 in the []\n // because JS arrays expand to fit, making any # of possible chars handled.\n for (let j = 0; j < str.length; j++) {\n let val = str.charAt(j);\n if (arr[val]) {\n // second pass confirmed here\n return false;\n }\n arr[val] = true;\n }\n return true;\n}", "title": "" }, { "docid": "b6264dd36fdffb0bc7500880a1b7017b", "score": "0.66449744", "text": "function areThereDuplicate(str) {\n let collection = {};\n\n for (let char of str) {\n collection[char] ? (collection[char] += 1) : (collection[char] = 1);\n }\n\n for (let val in collection) {\n if (collection[val] > 1) return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "fb0b27b3cf4ff12d3ff8cf8b0391ce7e", "score": "0.6642745", "text": "function isIsogram(str) {\n\treturn new Set([...str.toLowerCase()]).size === str.length;\n}", "title": "" }, { "docid": "b353ba89cf1ea7a8a588d2448314dc94", "score": "0.6642272", "text": "function checkForDuplicates(str) {\n let repeats = /(.)\\1/;\n return repeats.test(str)\n}", "title": "" }, { "docid": "17b4119346c5b93baf23024a9de13456", "score": "0.66373223", "text": "function uniq(str){\n\n if (typeof str !== 'string') throw 'Type must be string.';\n\n var frequencyMap = {};\n var isUnique = true;\n\n for (var i = 0, len = str.length; i < len; i++){\n var c = str[i];\n if (frequencyMap[c]) {\n isUnique = false;\n break;\n }\n frequencyMap[c] = true;\n }\n\n return isUnique;\n\n}", "title": "" }, { "docid": "eff3547b92c09b2cf0cc4be398c510d5", "score": "0.6614652", "text": "function isUnique(str) {\n if (!str || str.length === 0) return false;\n const chars = str.split('');\n chars.sort(); // sort in-place, O(n*log(n)) using heap-sort or quick-sort\n for (let i=0; i<chars.length-1; i++) {\n if (chars[i] === chars[i+1]) return false;\n }\n return true;\n}", "title": "" }, { "docid": "ffa8142343d0c593e4a569935f74f7f5", "score": "0.661307", "text": "function isIsogram(word = \"\") {\n return isUniq(word);\n}", "title": "" }, { "docid": "f250a769fb456cb64c50fea2985a44b8", "score": "0.65556186", "text": "function isUnique(string, i = 0) {\n let regex = new RegExp(string[i], 'gi')\n if (i > string.length - 1) {\n return true\n } else if (string.match(regex).length > 1) {\n return false\n } else {\n return isUnique(string, i + 1)\n }\n}", "title": "" }, { "docid": "8c41266a6c4db324f7e4bd08e9b39383", "score": "0.65467477", "text": "function isUnique(string) {\n var map = {};\n var arr = Object.keys(map);\n for (var i = 0; i < string.length; i++) {\n if (map[string[i]]) {\n return false;\n } else {\n map[string[i]] = 1;\n }\n }\n // console.log(map);\n return true;\n}", "title": "" }, { "docid": "f52f417fecc4448c9180f3b34019701d", "score": "0.65045375", "text": "function unique3(str) {\n for (let i = 0; i < str.length; i++) {\n // console.log(str.lastIndexOf(str[i]));\n\n if (str.lastIndexOf(str[i]) !== i) {\n return false\n }\n }\n\n return true\n}", "title": "" }, { "docid": "c60956bd5ccdea52841430c82eb80899", "score": "0.6501266", "text": "function allUniqueDigitsX(str) {\n return (/^(?!\\d*(\\d)\\d*\\1)/).test(str);\n}", "title": "" }, { "docid": "e7db7f72e2280c5bd07c90b09dc3c233", "score": "0.65010345", "text": "function allEqual(string){\n if(string.length == 0){\n return true;\n }\n for (var i = 1; i < string.length; i++){\n var firstterm = string[0];\n if((string[i])!==firstterm){\n return false;\n } else {\n return true;\n };\n };\n}", "title": "" }, { "docid": "394a8fabe48cb30df514ef81456c2c5f", "score": "0.6450176", "text": "function uniqueLetters(str1, str2) { \n\n}", "title": "" }, { "docid": "a79fa657746c56f706a1bf6687d71770", "score": "0.6449622", "text": "function isUnique(string){\n // Create dictionary\n let dictionary = {};\n\n for(let i = 0; i < string.length; i++){\n // Check if it is already there\n if(dictionary[string[i]]){\n return false\n } else {\n dictionary[string[i]] = string[i];\n }\n console.log(dictionary);\n }\n return true;\n}", "title": "" }, { "docid": "eb7f27da054dd8ca236079a1c9b1cb63", "score": "0.6448023", "text": "function isValid(s){\n if (allCountsEqual(s)) {\n return 'YES'\n }\n let oneRemoved;\n for (let i = 0; i < s.length; i++) {\n oneRemoved = s.slice(0, i) + s.slice(i + 1)\n if (allCountsEqual(oneRemoved)) {\n return 'YES'\n }\n }\n return 'NO'\n}", "title": "" }, { "docid": "3138097bbcee82468979a045b088f46e", "score": "0.6394434", "text": "function isValid(s) {\n let obj = {}\n s.split(\"\").forEach(el => {\n obj.hasOwnProperty(el) ? obj[el] += 1 : obj[el] = 1\n });\n\n\n let uniqueValues = new Map()\n Object.values(obj).forEach((el) => {\n console.log(uniqueValues.has(el))\n uniqueValues.has(el) ? uniqueValues.set(el, uniqueValues.get(el) + 1) : uniqueValues.set(el, 1)\n })\n\n let occurances = [...uniqueValues.values()]\n\n console.log(uniqueValues)\n\n console.log(occurances.includes(1))\n\n let uniqueCharDupCount = [...uniqueValues.keys()]\n const biggerByOne = uniqueCharDupCount[0] - uniqueCharDupCount[1] === 1 || uniqueCharDupCount[1] - uniqueCharDupCount[0] === 1\n if (occurances.length === 1) {\n return \"YES\"\n } else if (occurances.length == 2 && occurances.includes(1) && biggerByOne ) {\n return \"YES\"\n } else {\n return \"NO\"\n }\n }", "title": "" }, { "docid": "c03ed604efd11ec7affc5e7f7cbb5634", "score": "0.63782114", "text": "function findDuplicate(strings) {\n\n}", "title": "" }, { "docid": "21a50b0075dafe6a14e79027cf8ae1b9", "score": "0.6364039", "text": "function CodelandUsernameValidation(str) {\n // YOUR CODE HERE\n let stringsNotAllowable = '!\"#$%&\\'()*+,- ./:;<=>?@[\\\\]^`{|}~';\n let numbersNotAllowable = '1234567890';\n if (str.length > 4 && str.length < 25) {\n console.log(\"its between 4 and 24\")\n if (stringsNotAllowable.indexOf(str[0]) === -1 && str[0] !== \"_\" && numbersNotAllowable.indexOf(str[0]) === -1) {\n console.log(\"it starts with a letter \" + str[0])\n if (str[str.length -1] !== \"_\" ) {\n console.log(\"it doesnt end with a _\")\n result = true\n let stringArray = str.split(\"\");\n console.log(stringArray)\n\n stringArray.forEach (function (elem, ind){\n if (stringsNotAllowable.indexOf(elem) !== -1) {\n console.log(\"it contains \" +elem)\n result = false;\n return result\n }\n \n })\n return result;\n }\n return false\n }\n return false\n}\nreturn false\n}", "title": "" }, { "docid": "2d6e31a3764092aad22e0639a80e7d6a", "score": "0.63582385", "text": "function check(str) {\n let same = false;\n if (m > 1) {\n for(let i = 1; i < m; i++) {\n if(idCatch(\"rez\" + i).innerHTML.split(\"<\")[0].toLocaleLowerCase() == str.toLocaleLowerCase()){\n same = true;\n }\n }\n if(same) {\n errDiv.innerHTML = \"ALREADY CHOSEN\";\n opPPlus(errDiv, 10);\n setTimeout(() => {\n opMinusErr(errDiv);\n }, 500);\n }\n }\n return same;\n}", "title": "" }, { "docid": "cce89d315802d129914d8dde4d6fa0d3", "score": "0.63389933", "text": "function isUnique() {\n if (threeOpt[0] !== threeOpt[1] && threeOpt[1] !== threeOpt[2] && threeOpt[2] !== threeOpt[0]) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "231f1ac31253b1539cb49b3ecd804f4c", "score": "0.63273937", "text": "function isUniqueChar(str) {\n let hash = {}; // 1\n for(let i = 0; i < str.length; i++) { // n\n let char = str[i]; // 1\n if(hash[char]) { // 1\n return false;\n } else {\n hash[char] = true; // 1\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "4fab5c719a1a3761e9257ca8c33090a6", "score": "0.6324904", "text": "function isUnique(str) {\n // ***with any methods you like:\n // Time: O(n)\n // Space: O(n)\n let charMap = {};\n\n for (let i = 0; i < str.length; i++) {\n if (charMap[str[i]]) return false;\n else charMap[str[i]] = true;\n }\n\n return true;\n // ***without additional data structs:\n // does this count as we are actually using an array for the sort?\n // let newStr = [...str].sort((a, b) => a.localeCompare(b)).join(\"\");\n // for (let i = 1; i < newStr.length; i++) {\n // if (str[i] === str[i - 1]) return false;\n // }\n // return true;\n // ***From `answers` for \"no additional data structures approach\":\n // O(n^2) approach, no additional data structures used\n // for each character, check remaining characters for duplicates\n // for (var i = 0; i < str.length; i++) {\n // for (var j = i + 1; j < str.length; j++) {\n // if (str[i] === str[j]) {\n // return false; // if match, return false\n // }\n // }\n // }\n // return true; // if no match, return true\n}", "title": "" }, { "docid": "96595bd3934b35e0a2663b71d9bb78bf", "score": "0.6324514", "text": "function uniqueCharString(string) {\n let strChars = {};\n\n for (let i = 0; i < string.length; i++) {\n if (strChars[string[i]]) return false;\n strChars[string[i]] = true;\n }\n return true;\n}", "title": "" }, { "docid": "d1130bb0e43e41d5f2d09fdf464c85a6", "score": "0.6320093", "text": "function isUniqueSorted(str) {\n str = str.split(\"\").sort().join(\"\")\n for (let i = 0; i < str.length - 1; i++) {\n if (str[i] == str[i + 1]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "6a51988818dd0c7aabdf9468c43ca3ac", "score": "0.6309186", "text": "function isIsogram(str){\n let str_arry = str.toLowerCase().split('').sort();\n let str_filter = str_arry.reduce((accu, i) => {\n return (i == str_arry.slice(accu.length - 1 , accu.length)) ? accu : [...accu, i]\n },[]);\n return str_arry.length == str_filter.length\n\n\n // // other solution\n // return !/(\\w).*\\1/i.test(str)\n}", "title": "" }, { "docid": "2b6897b79ca33c6a25ea9a7b0aaaa636", "score": "0.6305616", "text": "function isMatchOrNot(strOfInput) {\n var arrOfSameElements = [];\n var firstElem = strOfInput[0];\n for (var i = 0; i < strOfInput.length; i++) {\n if (strOfInput[i] === firstElem) {\n arrOfSameElements.push(strOfInput[i]);\n } else {\n return true;\n }\n if (arrOfSameElements.length === strOfInput.length) {\n return false\n }\n }\n }", "title": "" }, { "docid": "df96290f357e60a81823279ff4f9405d", "score": "0.6251632", "text": "function uniqueChars(s) {\r\n let unique = '';\r\n for (let i=0; i<s.length; i++) {\r\n if (!unique.includes(s[i])) {\r\n unique += s[i];\r\n }\r\n }\r\n return unique;\r\n}", "title": "" }, { "docid": "7255500598c3d82ca8dcea410c01e881", "score": "0.62323046", "text": "function isStringUnique(word){\n let characterCount = {}\n let count = 1\n for(character of word){\n if(character in characterCount){\n return \"String is not unique\"\n }\n characterCount[character] = count\n }\n return \"String is unique\"\n}", "title": "" }, { "docid": "ae634aba6bbfaec18ca713d17c2bdcbc", "score": "0.6219848", "text": "function duplicateCheck (input) {\n\t\tvar newInput = input.split(\" \");\n\n\t\tfor (var i = 0; i < newInput.length; i++) {\n \t\tif (newInput[i + 1] === newInput[i]) {\n \t\t\tconsole.log(newInput, \" has duplicate words\");\n\n \t\t\t// OutPut.innerHTML += \"<p>\" + \"'\" + input + \"'\" + \" : has duplicate words\" + \"</p>\";\n \treturn false;\n \t\t\t} else {\n \t\t\t\tconsole.log(newInput, \" does not have duplicate words\");\n\n \t\t\t\t// OutPut.innerHTML += \"<p>\" + \"'\" + input + \"'\" + \" : does not have duplicate words\" + \"</p>\";\n \t\t\t\treturn true;\n \t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "8ea95bb495126864db7f138bb08b0515", "score": "0.6206176", "text": "function isIsogram(str){\n var i, j;\n str = str.toLowerCase();\n for(i = 0; i < str.length; ++i) {\n for(j = i + 1; j < str.length; ++j) {\n if(str[i] === str[j]) {\n return false;\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "7aa50714336e4193a680b6dfd97200f0", "score": "0.6180193", "text": "function validateInput()\n{\n var user_input = document.getElementById(\"user-input\").value;\n var pattern = /[a-zA-Z ]+/ ;\n var patternresult = user_input.match(pattern);\n if( patternresult != null && user_input == patternresult.join(''))\n {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "7356ac36723543619969a959c95d3e6e", "score": "0.61793673", "text": "function globalValidator(str, key){\n\tvar mark=0;\n\t\n\tfor(var i=0; i<str.length; i++){\n\t\tfor(var j=0; j<key.length; j++){\n\t\t\tif(str.charAt(i+j) == key.charAt(j)){\n\t\t\t\tmark++;\n\t\t\t}else{\n\t\t\t\tmark=0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(mark == key.length){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "61b29c26ed9969f479f186928bf50805", "score": "0.61617213", "text": "function onlyUnique (str) {\n\n var strObj = {};\n var strArr = str.split(\"\");\n strArr.forEach(function(char) {\n if (strObj[char] === undefined) {\n strObj[char] = 0;\n }\n strObj[char] += 1;\n });\n for (var i = 0; i < str.length; i++) {\n if (strObj[str[i]] > 1) {\n strArr.forEach(function(item, index) {\n if (item === str[i]) {\n strArr.splice(index, 1);\n }\n })\n }\n }\n return strArr.join(\"\");\n\n}", "title": "" }, { "docid": "027e8a12a0102e65b1b182dc3abb45cc", "score": "0.6137244", "text": "function doubleCheck(str){\n let strArr = str.toLowerCase().split(\"\")\n return strArr.some((c, i) => c === strArr[i + 1])\n}", "title": "" }, { "docid": "96cd49955d26caefd2cd59c0a3da1547", "score": "0.6135223", "text": "function uniqueChar(str){\n console.log();\n // check for valid input\n if(typeof str !== 'string' || !str){\n return \"invalid input, please provide a valid string\"\n }\n\n // instantiate hash map\n var allChars = {};\n\n // split string into array of letters\n var letters = str.split(\"\");\n\n\n for (var i = 0; i < letters.length; i++){\n // add key if not already there\n if(!allChars[letters[i]]){\n allChars[letters[i]] = 1;\n }\n // if dupe, update count\n else{\n allChars[letters[i]] += 1;\n }\n }\n\n // for each key in order, check count and return if count is one\n for (var i = 0; i < letters.length; i++){\n // add key if not already there\n if(allChars[letters[i]] == 1){\n return letters[i];\n }\n }\n\n // return false if no count is one\n return false;\n}", "title": "" }, { "docid": "ac009e970a0a7bb869059216cb6aaf0c", "score": "0.6134046", "text": "function areThereDuplicatesOneLine() {\n return new Set(arguments).size !== arguments.length;\n}", "title": "" }, { "docid": "b8c4f5e25890518997f1b6d6f87a7940", "score": "0.6100724", "text": "function unique(str) {\n\tvar mySet = new Set(str);\n\treturn [...mySet]\n}", "title": "" }, { "docid": "f22598884966f2c98857ed32c79059b0", "score": "0.60924566", "text": "function _checkForUniqueness(array) {\n return new Set(array).size === array.length;\n }", "title": "" }, { "docid": "d71bafb33ba092ac75b32d041d570c86", "score": "0.60732305", "text": "function anagramChecker(stringA, stringB) {\n return helperCleanerFunction(stringA) === helperCleanerFunction(stringB)\n}", "title": "" }, { "docid": "abf5c08e6b3c5a0bc404a460d093f6d7", "score": "0.6052377", "text": "function isAnagram(input, validateInput) {\n let inputLen = input.length,\n validateInputLen = validateInput.length;\n \n /* making case in-sensitive */\n input = input.toLowerCase();\n validateInput = validateInput.toLowerCase();\n\n /* If length differs then skipping the process itself */\n if(inputLen !== validateInputLen) {\n return false;\n }\n\n /* To check for all unicode */\n let trackerArr = new Array(128).fill(0);\n\n /* Iterate on each char */\n for(let i = 0; i < inputLen; ++i) {\n trackerArr[input.charCodeAt(i)]++;\n trackerArr[validateInput.charCodeAt(i)]--;\n }\n\n /* filter tracker and finds whether its having non-zero elements */\n if(trackerArr.filter(tracker => tracker !== 0).length !== 0) {\n return false;\n }\n\n return true\n}", "title": "" }, { "docid": "b5efd5d9d519fc560924c5bef6fee91d", "score": "0.6050242", "text": "function isUniqueChar(str){\n var i, char;\n for (i=0; i<str.length; i++){\n char = str.charAt(i);\n if ( i != str.lastIndexOf(char)){\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "2d1416626c46064f7e1ce07a8212d170", "score": "0.6039647", "text": "function anyPermutation(str) {\n let hashMap = new HashMapOpen\n let count = 0\n for (let i = 0; i < str.length; i++) {\n if (hashMap.get(str[i]) === undefined) {\n count++\n }\n count--\n hashMap.set(str[i], null)\n }\n if (count > 1) {\n return console.log(false)\n }\n return console.log(true)\n}", "title": "" }, { "docid": "e9c9f71e075e4b40411458363c566347", "score": "0.60193944", "text": "function checkInput(input, output) {\r\n\tif(input.charAt(0) !== output.slice(-1)){\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "title": "" }, { "docid": "cf93e4e2b8087c1823341875165e5e31", "score": "0.60186666", "text": "function isUniform(stuff){\n var first = stuff[0]\n for(var i = 1; i < stuff.length; i++){\n if(stuff[i] !== first){\n return false;\n }\n }\n return true;\n}", "title": "" } ]
1539b80ee59a7f01c4395b7c95d4e858
Handle HTTP errors since fetch won't.
[ { "docid": "5a398496af15654e17c22b5e958d4e37", "score": "0.0", "text": "function handleErrors(response) {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response;\n}", "title": "" } ]
[ { "docid": "c4b3ab6b5f5aa0ab8f41e37576989688", "score": "0.7540429", "text": "function handleFetchErrors(response) {\n if (!response.ok) {\n throw Error(response.statusText)\n }\n return response\n}", "title": "" }, { "docid": "c75259fbcff258fc65bda22858448453", "score": "0.71846366", "text": "function catchFetchErrors(response) {\n if (!response.ok) {\n throw Error(response.statusText)\n }\n return response\n}", "title": "" }, { "docid": "f938a59799a038238e3a592c3ad698a9", "score": "0.6978443", "text": "function error (err) {\r\n cleanup();\r\n reject(new Error('Fetching ' + src));\r\n }", "title": "" }, { "docid": "b36c3b2355f366bcb1c62bdb4b6df788", "score": "0.68573534", "text": "function handleError () {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, RequestTask));\n\n // Clean up request\n RequestTask = null;\n }", "title": "" }, { "docid": "78bfd972a0020371d3be9e00fe388d07", "score": "0.68430954", "text": "function checkStatus(response) {\n // Code taken from\n // https://github.com/github/fetch/blob/master/README.md#handling-http-error-statuses\n if (response.status >= 200 && response.status < 300) {\n return response;} else \n {\n var error = new Error(response.statusText);\n error.response = response;\n throw error;}}", "title": "" }, { "docid": "6650556082c7333643f4f496d39a29c8", "score": "0.6700958", "text": "async function httpReject() {\n (0, _vegaUtil.error)('No HTTP fetch method available.');\n}", "title": "" }, { "docid": "c62ca1e752a8c3bbfee88f9a8b0eab1a", "score": "0.66671216", "text": "fetch(url, fetchParams, errorMessage) {\n let promise = nativeFetch(url, fetchParams)\n .then(response => {\n if (!response.ok) {\n const error = new Error(response.statusText);\n // note the error status\n error.status = response.status;\n // add the response to the error so callers can examine it\n error.response = response;\n throw error;\n }\n return response;\n });\n\n // if we got an error message, catch and log any errors\n // but do NOT stop normal processing\n if (errorMessage) {\n promise = promise.catch(error => {\n this.logError({ errorMessage, error, url, fetchParams });\n throw error;\n });\n }\n\n return promise;\n }", "title": "" }, { "docid": "98c00538cdc2dffd705a547335208154", "score": "0.6656042", "text": "function handleHTTPError(response) {\n\t\tif(response.ok)\n\t\t\treturn response;\n\t\tthrow Error(response.statusText);\n\t}", "title": "" }, { "docid": "138479a4a97737d1e13d38f290a14e5c", "score": "0.6608481", "text": "function handleError() {\n handleFeedParsingFailed(\"Error fetching feed\");\n}", "title": "" }, { "docid": "09343b547f35004fa798ee7224b585ee", "score": "0.65767556", "text": "function throwingFetch(fetch) {\n log.trace(\"init throwingFetch\");\n return (url, options) => {\n return fetch(url, options).then(r => {\n log.trace(\"throwingFetch called, throwing if\", !r.ok)\n if(!r.ok) throw new Error(r.status + \": \" + r.statusText);\n return r;\n });\n };\n}", "title": "" }, { "docid": "dea9d76329e92af0cc98cf0a4311e426", "score": "0.65728205", "text": "function executeFetch() {\n if (retryOnAbort) {\n if (timeout || getAbortController || _abortController) {\n // eslint-disable-next-line\n abortController =\n (getAbortController ? getAbortController() : null) ||\n _abortController ||\n new AbortController()\n\n if (abortController) {\n fetchOptions.signal = abortController.signal\n }\n }\n }\n // Kick off timer for abortController directly before fetch.\n let timer\n if (timeout)\n timer = setTimeout(() => {\n abortController.abort()\n }, timeout)\n fetchFunction(url, fetchOptions)\n .then(\n (res: Response) => {\n if (res.ok) {\n if (fetchOptions.method === 'HEAD') {\n next(request, {\n ...response,\n statusCode: res.status,\n })\n return\n }\n\n res.text().then((result: Object) => {\n // Try to parse the response as JSON\n let parsed\n try {\n parsed = result.length > 0 ? JSON.parse(result) : {}\n } catch (err) {\n if (enableRetry && retryCount < maxRetries) {\n setTimeout(\n executeFetch,\n calcDelayDuration(\n retryCount,\n retryDelay,\n maxRetries,\n backoff,\n maxDelay\n )\n )\n retryCount += 1\n return\n }\n parsed = result\n }\n\n const parsedResponse: Object = {\n ...response,\n body: parsed,\n statusCode: res.status,\n }\n\n if (includeResponseHeaders)\n parsedResponse.headers = parseHeaders(res.headers)\n\n if (includeOriginalRequest) {\n parsedResponse.request = {\n ...fetchOptions,\n }\n maskAuthData(\n parsedResponse.request,\n maskSensitiveHeaderData\n )\n }\n next(request, parsedResponse)\n })\n return\n }\n\n // Server responded with an error. Try to parse it as JSON, then\n // return a proper error type with all necessary meta information.\n res\n .text()\n .then((text: any) => {\n // Try to parse the error response as JSON\n let parsed\n try {\n parsed = JSON.parse(text)\n } catch (error) {\n parsed = text\n }\n\n const error: HttpErrorType = createError({\n statusCode: res.status,\n originalRequest: request,\n retryCount,\n headers: parseHeaders(res.headers),\n ...(typeof parsed === 'object'\n ? { message: parsed.message, body: parsed }\n : { message: parsed, body: parsed }),\n })\n\n if (\n enableRetry &&\n (retryCodes.indexOf(error.statusCode) !== -1 ||\n retryCodes?.indexOf(error.message) !== -1)\n ) {\n if (retryCount < maxRetries) {\n setTimeout(\n executeFetch,\n calcDelayDuration(\n retryCount,\n retryDelay,\n maxRetries,\n backoff,\n maxDelay\n )\n )\n retryCount += 1\n return\n }\n }\n\n maskAuthData(error.originalRequest, maskSensitiveHeaderData)\n // Let the final resolver to reject the promise\n const parsedResponse = {\n ...response,\n error,\n statusCode: res.status,\n }\n next(request, parsedResponse)\n })\n .catch((err: Error) => {\n if (enableRetry)\n if (retryCount < maxRetries) {\n setTimeout(\n executeFetch,\n calcDelayDuration(\n retryCount,\n retryDelay,\n maxRetries,\n backoff,\n maxDelay\n )\n )\n retryCount += 1\n return\n }\n\n const error = new InternalServerError(err.message, {\n originalRequest: request,\n retryCount,\n })\n maskAuthData(error.originalRequest, maskSensitiveHeaderData)\n next(request, { ...response, error, statusCode: 500 })\n })\n },\n // We know that this is a \"network\" error thrown by the `fetch` library\n (e: Error) => {\n if (enableRetry)\n if (retryCount < maxRetries) {\n setTimeout(\n executeFetch,\n calcDelayDuration(\n retryCount,\n retryDelay,\n maxRetries,\n backoff,\n maxDelay\n )\n )\n retryCount += 1\n return\n }\n\n const error = new NetworkError(e.message, {\n originalRequest: request,\n retryCount,\n })\n maskAuthData(error.originalRequest, maskSensitiveHeaderData)\n next(request, { ...response, error, statusCode: 0 })\n }\n )\n .finally(() => {\n clearTimeout(timer)\n })\n }", "title": "" }, { "docid": "cddb103dedf8bccf5f60c392963b9c24", "score": "0.6529572", "text": "function HTTPErrorHandler(fetchFunc) {\n return new Promise((resolve, reject) => {\n fetchFunc\n .then(response => {\n if (response.status === 401) {\n localStorage.removeItem('isLogged')\n\n reject(HTTPErrors.Unauthorized)\n } else {\n return response.json()\n }\n })\n .then(data => {\n resolve(data)\n })\n })\n}", "title": "" }, { "docid": "2272586cd96e5aa791459cfa5e3f710b", "score": "0.6328214", "text": "function handleRequestError() {\n id(\"results\").textContent = \"There was an error loading the data. Please try again later.\";\n }", "title": "" }, { "docid": "bebc9b7eebc2af5e18237eae3bc566e4", "score": "0.62779015", "text": "handleHTTPError(pHTTPError) {\n let Error = {\n code: 0,\n desc: '' // Error Description\n };\n // format error received from request : \n // {\"code\":\"ECONNREFUSED\",\"errno\":\"ECONNREFUSED\",\"syscall\":\"connect\",\"address\":\"127.0.0.1\",\"port\":5678}\n // map HTTP Error\n if (pHTTPError.code === 'ECONNREFUSED') {\n Error.code = 106;\n Error.desc = 'CONNECTION REFUSED';\n }\n else if (pHTTPError.code === 'ETIMEDOUT') {\n Error.code = 107;\n Error.desc = 'CONNECTION TIMEOUT';\n }\n else if (pHTTPError.code === 'ENOTFOUND') {\n Error.code = 108;\n Error.desc = 'SERVICE NOT FOUND';\n }\n else {\n Error.code = 109;\n Error.desc = 'UHANDLED HTTP ERROR';\n logging_service_1.Logging(JSON.stringify(pHTTPError));\n }\n return Error;\n }", "title": "" }, { "docid": "9ea4ee829874d4a127c47108217efbf8", "score": "0.62134844", "text": "function fetchFailure(error) {\n return {\n type: FETCH_FAILURE,\n payload: error\n };\n }", "title": "" }, { "docid": "a274b4c3184c7dafde4b38b29251dd7d", "score": "0.6193093", "text": "function myFetch(url, options) {\n if (options == null) options = {}\n if (options.credentials == null) options.credentials = 'same-origin'\n return fetch(url, options).then(function(response) {\n if (response.status >= 200 && response.status < 300) {\n return Promise.resolve(response)\n } else {\n var error = new Error(response.statusText || response.status)\n error.response = response\n return Promise.reject(error)\n }\n })\n }", "title": "" }, { "docid": "f022f7cd7b4658332ceb37143409ca36", "score": "0.6184366", "text": "fetchFooError(error) {\n\t\t// send a dispatch out for our error\n\t\tthis.dispatch(error);\n\t}", "title": "" }, { "docid": "68600e6f096fb6e458c0d46e673e4693", "score": "0.6158099", "text": "function handleError(response) {\n console.log(\"can't get api data\");\n}", "title": "" }, { "docid": "ea6ab55ae12bd761bb3b62eb0551a11c", "score": "0.6135789", "text": "function handleBadFetchStatus(response, requestPath, respondWith) {\n if (response.status !== 200) {\n console.error(\"[-] Bad fetch request to: '\" + requestPath + \"'. the response was: \" + response.statusText);\n if (respondWith)\n console.error(\"[-] \" + respondWith);\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "e68694c28c2edf60846dff5d26f00ee1", "score": "0.6087245", "text": "function myFetch(url) {\n const promise = new Promise(function(resolve, reject){\n const data = fetch(url)\n if (data.statusCode <400) {\n resolve();\n }else if(400 >= data.statusCode <= 599) {\n reject();\n }\n })\n return promise\n}", "title": "" }, { "docid": "cfa45f047861b2873f3fbeaae6604554", "score": "0.6059671", "text": "function onDataFetchFailed(error) {}", "title": "" }, { "docid": "c231ff11c3470bb7885a8d50e6bc7029", "score": "0.6041481", "text": "function handleError() {\n handleFeedParsingFailed(chrome.i18n.getMessage('failed_to_fetch_rss'));\n}", "title": "" }, { "docid": "ecf5ec3ade8f4850c20136e23595e68b", "score": "0.60414064", "text": "function request(...args) {\n return fetch(...args).catch(transformFailure).then(rejectErrors);\n}", "title": "" }, { "docid": "23fa69138b1c9856436b22da3132cc68", "score": "0.59899855", "text": "static fetch(url, callback){\n fetch(url, { })\n .then(function(res){\n if (res.status !== 200) {\n console.log('Looks like there was a problem. Status Code: ' +\n res.status);\n return;\n }\n else\n {\n return res.json();\n }\n }).then((result)=>{\n if(callback !== undefined)\n {\n callback(result);\n }\n });\n }", "title": "" }, { "docid": "1fd5cabb817665df48d6e6b8433b71c8", "score": "0.59855247", "text": "handleSourceRequestHTTP(error, response, html) {\n // if no error and the HTTP status code was Success (200)\n if (!error && response.statusCode == 200) {\n this.processHTMLResult(html);\n }else{\n console.log('HTTP Error');\n }\n }", "title": "" }, { "docid": "e1935ae12531eb49da3369c367c0b239", "score": "0.59803146", "text": "async get(url){\n\n // await the response of the fetch call\n const promise = await fetch(url);\n\n // we only proceed when it is resolved\n const response = await promise.json();\n\n return handleErrors(response);\n }", "title": "" }, { "docid": "a0fdfdf068e67fe366cf076acbe62c6f", "score": "0.59752655", "text": "async function getPhotos() {\r\n try {\r\n const response = await fetch(apiUrl);\r\n photoArray = await response.json();\r\n displayPhotos()\r\n\r\n } catch (error) {\r\n // Catch Error Here\r\n\r\n }\r\n}", "title": "" }, { "docid": "719c255aaad5b71d77069090562c4455", "score": "0.59597605", "text": "function throwNetworkErrors(err) {\n if (err.response && err.response.status && err.response.status !== 404) {\n throw err;\n }\n}", "title": "" }, { "docid": "bfe406a75da6d687b3593433bce9eece", "score": "0.59586704", "text": "async function getPhotos(){\n try {\n const response = await fetch(apiUrl)\n photosArray = await response.json();\n displayPhotos(photosArray)\n }\n catch (err){\n // Catch Error Here...\n }\n}", "title": "" }, { "docid": "6a8adc2e799328a33a280e42285622ed", "score": "0.59510267", "text": "function handleError() {\n let message = errorInfo();\n message.innerText = 'An error has occurred when making request! Try it later!';\n }", "title": "" }, { "docid": "e8e3c33a5f863da29024383d3b974c94", "score": "0.5948543", "text": "function handleError(ajax, url)\n{\n\tvar errorString = \"Error fetching ajax data \" + url + \"<br />\"\n\t\t+ ajax.status + \" \" + ajax.statusText;\n\t$(\"errors\").innerHTML = errorString;\n\t$(\"loadingmeaning\").hide();\n\t$(\"loadinggraph\").hide();\n\t$(\"loadingcelebs\").hide();\n}", "title": "" }, { "docid": "d9da01b8b2aaa12afc894a5d08e7b075", "score": "0.59072423", "text": "function onerror (err) {\n debug('http.ClientRequest \"error\" event: %o', err.stack || err);\n fn(err);\n }", "title": "" }, { "docid": "d9da01b8b2aaa12afc894a5d08e7b075", "score": "0.59072423", "text": "function onerror (err) {\n debug('http.ClientRequest \"error\" event: %o', err.stack || err);\n fn(err);\n }", "title": "" }, { "docid": "f5277ae95379eaa570f6997ed8e0f6ed", "score": "0.58963037", "text": "function bug(error) {\n if (error.response) {\n // The request was made but the response received falls out of the range\n console.log(error.response.data);\n console.log(error.response.status);\n console.log(error.response.headers);\n } else if (error.request) {\n // The request was made but no response was received\n console.log(error.request);\n } else {\n // Error triggered in request set up\n console.log(\"Error: \", error.message);\n }\n console.log(error.config);\n\n}", "title": "" }, { "docid": "1d5d0369c2406cc8896e36998df42880", "score": "0.5895838", "text": "static fetch(url) {\n return new Promise((resolve, reject) => {\n let xhr = new XMLHttpRequest();\n\n xhr.addEventListener('readystatechange', () => {\n if (xhr.readyState === 4) {\n let first = xhr.status.toString().charAt(0);\n if (first !== '2' && first !== '3') {\n try {\n reject(new Error(`API request for '${url}' failed :-S: ${JSON.parse(xhr.responseText).message}`));\n } catch (e) {\n reject(new Error(`API request for '${url}' failed :-S: ${xhr.statusText}`));\n }\n return;\n }\n try {\n resolve(JSON.parse(xhr.responseText));\n } catch (e) {\n reject(new Error(`API request for '${url}' succeeded, but failed to parse response :-S: ${e}`));\n }\n }\n });\n xhr.addEventListener('error', (ev) => {\n reject(new Error(`API request for '${url}' failed :-S: ${ev}`));\n });\n xhr.open('GET', url);\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n });\n }", "title": "" }, { "docid": "4a2cb16c6ee1f69e4b60e7bc014b95ba", "score": "0.58819026", "text": "function basicFetch() {\n\n /*\n * The fetch method will return a promise immediately.\n * - the promise itself is a way for us to chain the logic to be had once the fetch request is successfull or hits an error\n * */\n const promise = fetch(\"https://reqres.in/api/users/2\", {\n method: 'GET'\n });\n\n /*\n * When the promise is successful or fullfilled, the method passed to the then method will be called with a response object\n * - response object has lots of params, methods - we care about status and json\n **/\n return promise.then(function (response) {\n\n console.log(\"HTTP Status - \" + response.status);\n\n if (response.status > 299) {\n throw new Error(\"We got a bad response status code\");\n }\n\n /* Now when we know its 2xx response, we try to get the response json with the .json() method\n * - response.json() method again returns another promise\n * - we simply return the promise and handle it in the subsequent then chain\n **/\n\n return response.json();\n });\n\n}", "title": "" }, { "docid": "20252397d9db5baaea0f785af0976d80", "score": "0.58780557", "text": "function onerror (err) {\n debug('http.ClientRequest \"error\" event: %s', err.stack || err);\n fn(err);\n }", "title": "" }, { "docid": "faee0dfc45f77c012eeedb493f6e3be3", "score": "0.5875379", "text": "function handleError() {\n handleFeedParsingFailed(chrome.i18n.getMessage('fetchError'));\n $('topics').style.display = 'none';\n}", "title": "" }, { "docid": "a48400fc825570b8a41692a883a00a8e", "score": "0.58636194", "text": "async function fetchData(url) {\n try {\n const res = await fetch(url);\n const json = await res.json();\n return json;\n } catch (err) {\n // $(\".oops\").style.display = \"flex\";\n console.log(err);\n }\n}", "title": "" }, { "docid": "e9e2ac4d970f430791be6dbf1e850e79", "score": "0.5850704", "text": "function xhr_error(){\n var xhr = new XMLHttpRequest();\n\n // Setup our listener to process compeleted requests\n xhr.onreadystatechange = function () {\n\n // Only run if the request is complete\n if (xhr.readyState !== 4) return;\n\n // Process our return data\n if (xhr.status >= 200 && xhr.status < 300) {\n // What do when the request is successful\n console.log('success', JSON.parse(xhr.responseText));\n } else {\n // What to do when the request has failed\n console.log('error', xhr);\n }\n\n };\n xhr.open(\"GET\", \"https://jsonplaceholder.typicode.com/postses\");\n \n xhr.onload = () => {\n console.log(xhr.response)\n };\n\n xhr.send();\n}", "title": "" }, { "docid": "046fb31ebc11817f0b55d278637335fe", "score": "0.5842198", "text": "function handleAJAXError(xhr, status, err) {\n console.log([\"Error: \", err]);\n}", "title": "" }, { "docid": "e744ff6fa9eada8189e9a6196277f4ef", "score": "0.5836981", "text": "function validate_url(ev) {\n banner.className = 'fetching';\n ev.preventDefault();\n offlineCheck();\n\n var url = getValue(url_input);\n if (url.indexOf('http://') === -1 && url.indexOf('https://') === -1) {\n appendLog('Invalid URL: '+url);\n setBanner('ERROR', 'Invalid URL: '+url);\n } else {\n document.querySelector(textarea_selector).innerHTML = 'Fetching ...';\n\n var req = new Request(url, {\n method: 'GET',\n headers: new Headers(),\n mode: 'cors',\n cache: 'no-cache',\n });\n\n fetch(req)\n .then(function(response) {\n return response.text();\n })\n .then(function(response) {\n appendLog('fetched: ' + response);\n // store response into the textarea, FIXME this is currently exploitable, paste a HTML page\n document.querySelector(textarea_selector).value = response;\n validate(ev);\n })\n .catch(function(error) {\n var message = error.message;\n if (req.bodyUsed) {\n appendLog('fetch parse fail: ' + message);\n } else {\n message = 'is <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS\" target=\"_blank\">CORS</a> enabled? Check the iFrame for content\\n' + message;\n\n appendLog('fetch fail: ' + message);\n\n BackupIframe.tryUrl(url);\n }\n setBanner('ERROR', message);\n });\n }\n }", "title": "" }, { "docid": "c58d81a8a14bed0e2a032f5826d04b67", "score": "0.58294374", "text": "function handleHttpError(event, error) {\n var status = error.status,\n data = error.data;\n\n // avoid displaying any error message when performing a request against /camunda-welcome\n // since the get request against it is only necessary to determine if deployed\n const config = error.response.config;\n if (config.method === 'GET' && config.url === '/camunda-welcome') {\n return;\n }\n\n switch (status) {\n case 500:\n if (data && data.message) {\n addError({\n status: $translate.instant('PAGES_STATUS_SERVER_ERROR'),\n message: data.message,\n exceptionType: data.exceptionType\n });\n } else {\n addError({\n status: $translate.instant('PAGES_STATUS_SERVER_ERROR'),\n message: $translate.instant('PAGES_MSG_SERVER_ERROR')\n });\n }\n break;\n\n case 0:\n addError({\n status: $translate.instant('PAGES_STATUS_REQUEST_TIMEOUT'),\n message: $translate.instant('PAGES_MSG_REQUEST_TIMEOUT')\n });\n break;\n\n case 401:\n if ($location.absUrl().indexOf('/setup/#') !== -1) {\n $location.path('/setup');\n } else {\n setHeadTitle($location.absUrl());\n\n AuthenticationService.updateAuthentication(null);\n $rootScope.$broadcast('authentication.login.required');\n }\n break;\n\n case 403:\n if (data.type == 'AuthorizationException') {\n var message;\n if (data.resourceId) {\n message = $translate.instant(\n 'PAGES_MSG_ACCESS_DENIED_RESOURCE_ID',\n {\n permissionName: data.permissionName.toLowerCase(),\n resourceName: data.resourceName.toLowerCase(),\n resourceId: data.resourceId\n }\n );\n } else {\n var missingAuths = data.missingAuthorizations.map(function(\n missingAuth\n ) {\n return (\n \"'\" +\n missingAuth.permissionName +\n \"'\" +\n ' ' +\n missingAuth.resourceName +\n 's'\n );\n });\n\n message = $translate.instant('PAGES_MSG_ACCESS_DENIED', {\n missingAuths: missingAuths.join()\n });\n }\n\n addError({\n status: $translate.instant('PAGES_STATUS_ACCESS_DENIED'),\n message: message\n });\n } else {\n addError({\n status: $translate.instant('PAGES_STATUS_ACCESS_DENIED'),\n message: $translate.instant('PAGES_MSG_ACTION_DENIED')\n });\n }\n break;\n\n case 404:\n if (shouldDisplayAuthenticationError()) {\n addError({\n status: $translate.instant('PAGES_STATUS_NOT_FOUND'),\n message: $translate.instant('PAGES_MSG_NOT_FOUND')\n });\n }\n break;\n default:\n addError({\n status: $translate.instant('PAGES_STATUS_COMMUNICATION_ERROR'),\n message: $translate.instant('PAGES_MSG_COMMUNICATION_ERROR', {\n status: status\n })\n });\n }\n }", "title": "" }, { "docid": "9c57b7804662c53874d3d894e3e8ce5a", "score": "0.5827226", "text": "onWebRequestErrored (details) {\n if (this.webContents != null && details.webContentsId === this.webContents.id) {\n if (this.authBrowserEventSender) {\n this.sendResponse({\n error: details.error\n })\n }\n this.finish()\n }\n }", "title": "" }, { "docid": "95ce69a61399dade751c5e39dddfde7d", "score": "0.5820124", "text": "getPersons() {\n return fetch(URL).then(handleHttpErrors)\n }", "title": "" }, { "docid": "d2036b8564ccc4836daf2698e9c6293e", "score": "0.581049", "text": "function getDogPhoto() {\r\n fetch(\"https://dog.ceo/api/breeds/image/random\")\r\n .then((res) => {\r\n if (res.ok) {\r\n return res.json();\r\n } else {\r\n throw res.status;\r\n }\r\n }) //handling using error display ok vs response.text or success\r\n .then((res) => {\r\n let item = document.createElement(\"li\");\r\n document.getElementById(\"dog-photos\").appendChild(item);\r\n let image = document.createElement(\"img\");\r\n image.src = res.message;\r\n image.classList.add(\"dog-photo\");\r\n document.getElementById(\"dog-photos\").appendChild(image);\r\n })\r\n .catch((err) => alert(err)); //when catch called?\r\n}", "title": "" }, { "docid": "03626fd65b2662a8b46460a9f0663fa6", "score": "0.5803849", "text": "componentDidMount(){\n fetch(url)\n .then(response => {\n if(!response.ok){\n console.log(response);\n throw Error(\"Network request failed for Google News\"); \n } \n return response;\n })\n .then(d => d.json())\n .then(d =>{\n this.setState({ googleNewsList: d });\n }, () => {\n this.setState({\n requestFailed: true\n })\n })\n }", "title": "" }, { "docid": "42da8ef778cfc9df864441ab46ac0684", "score": "0.5798656", "text": "function handleError(_e,_xhr,_custom) {\n\t\t\tif (_custom) {\n\t\t\t\t_custom(e,xhr);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tTi.API.error('Error: '+JSON.stringify(_e)+'\\nServer response: '+_xhr.responseText);\n\t\t\t\tapp.ui.alert(L('error'), L('error_general'));\n\t\t\t\tTi.App.fireEvent('app:hide.loader');\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "c6ddb1d4a907903209b6bbc652099d87", "score": "0.5798575", "text": "async function getPhotos(){\n try{\n const response = await fetch(unsplashUrl);\n photoArray = await response.json();\n displayPhotos();\n }catch(error) {\n // Catch error here\n console.log(error);\n }\n}", "title": "" }, { "docid": "ae9cf189f3c669845d376d8324b83eb5", "score": "0.57920283", "text": "async handleErrorResponse () {\n\t\tif (!this.statusCode) {\n\t\t\tif (\n\t\t\t\t(this.gotError && !this.gotError.code) ||\n\t\t\t\t(typeof this.gotError === 'object' && this.gotError.internal)\n\t\t\t) {\n\t\t\t\tthis.statusCode = 500; // internal errors get a 500\n\t\t\t\tthis.reportError(this.gotError);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.statusCode = 403; // others get a 403\n\t\t\t}\n\t\t}\n\t\tthis.warn(ErrorHandler.log(this.gotError));\n\t\tthis.responseData = ErrorHandler.toClient(this.gotError);\n\t\tthis.response.set('X-Request-Id', this.request.id);\n\t\tthis.response.status(this.statusCode).send(this.responseData);\n\t}", "title": "" }, { "docid": "b90ce146f8875ff137d37458cd2734a9", "score": "0.57848066", "text": "function fetchBookAPI(bookURL) {\n fetch(bookURL)\n .then(response => {\n if (response.ok) {\n return response.json();\n }\n\n throw new Error(response.statusText);\n })\n .then(bookData => displayBookAPI(bookData))\n .catch(err => {\n $(\"#error-message\").removeClass(\"hidden\");\n $(\"#js-error-message\").text(\n `Something went wrong. Refresh the page and try again in a few minutes.`\n );\n });\n}", "title": "" }, { "docid": "84b07744f7041b5744ae9eabfff76887", "score": "0.5774605", "text": "async handle_api_errors(response) {\n if (!response.ok) {\n throw Error(await response.text())\n }\n return response\n }", "title": "" }, { "docid": "3ec0834165a2788f976a1042d20fb387", "score": "0.57651067", "text": "function handleError (request) {\n if (request.status >= 400 && request.status <= 499) {\n alert(\"Client error: \" + request.status + ' status code!');\n } else if (request.status >= 500 && request.status <= 599) {\n alert(\"Internal Server Error: \" + request.status + \" status code!\");\n } else if (request.status === 0) {\n alert(\"Connection is refused!\");\n } else {\n alert(\"Unable to execute request. Please, try again!\");\n }\n}", "title": "" }, { "docid": "60121201a78c38e4c05e8e0ea65b810e", "score": "0.57602924", "text": "function handleError(response) {\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n return response;\n}", "title": "" }, { "docid": "94ac420b15dce1bf856830c727466f5a", "score": "0.5759588", "text": "function handleError(err) {\n console.error('response status:', err.statusCode);\n console.error('data:', err.data);\n}", "title": "" }, { "docid": "aa525d1ce120efb047430e1450ce4bcd", "score": "0.57523924", "text": "async function getPhotos() {\n try {\n const response = await fetch(apiUrl);\n\n // receiving data from the API\n photoArray = await response.json();\n displayPhotos();\n } catch (error) {\n // Catch Error Here\n }\n}", "title": "" }, { "docid": "e35bc3e66333abc3da5df75317e92c3d", "score": "0.574475", "text": "function errorHandling(error, status, response){\n response.status(status).send('Sorry, something went wrong');\n}", "title": "" }, { "docid": "0e929863c8dddd8e3235ce3dfd672e9a", "score": "0.5744653", "text": "function handleErrors(response) {\n\tif (!response.ok) {\n\t\tthrow Error(response.statusText);\n\t}\n\treturn response;\n}", "title": "" }, { "docid": "93aa561c698c2e9e80eb8ce72739a23b", "score": "0.57414496", "text": "handleError(r, reject) {\n if (!r.ok) {\n HttpRequestError.init(r).then(reject);\n }\n return r.ok;\n }", "title": "" }, { "docid": "93aa561c698c2e9e80eb8ce72739a23b", "score": "0.57414496", "text": "handleError(r, reject) {\n if (!r.ok) {\n HttpRequestError.init(r).then(reject);\n }\n return r.ok;\n }", "title": "" }, { "docid": "a587588e858729556df5d48569261824", "score": "0.57366806", "text": "isFetchFailure(responseMessage) {\n return responseMessage === 'Failed to fetch';\n }", "title": "" }, { "docid": "c0c913fa0cffc88b26c68411eaf716c5", "score": "0.573478", "text": "function fetchGifo(url) {\n const found = fetch(url)\n .then(response => {\n return response.json();\n })\n .then(data => {\n return data;\n })\n .catch(error => {\n console.log(error)\n return error;\n });\n return found;\n}", "title": "" }, { "docid": "006103286efa7843d877cd5ba22f59e5", "score": "0.57128245", "text": "_handleError(event) {\r\n this.loading = false;\r\n this.users = event.detail.request.response\r\n console.log(this.users)\r\n if (this.users.statusCode == \"ERR600\") {\r\n this.message = baseUrl.ERR600;\r\n this.$.wrongCredentials.open();\r\n }\r\n }", "title": "" }, { "docid": "1a0c058c580c893152f174d467f6a04f", "score": "0.56962425", "text": "function fetchErrorPage(context) {\n const pageURL = context.event.request.url;\n const destination = context.event.request.destination;\n\n switch (destination) {\n case \"document\":\n return errorPageForURL(pageURL);\n default:\n return Response.error();\n }\n}", "title": "" }, { "docid": "d5c396ec0cdd631b73420a4711a01145", "score": "0.5693864", "text": "function handleErrors(response) {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response;\n }", "title": "" }, { "docid": "d5c396ec0cdd631b73420a4711a01145", "score": "0.5693864", "text": "function handleErrors(response) {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response;\n }", "title": "" }, { "docid": "15a5f1604f0bcef38a23d6a12b60cd8c", "score": "0.56876755", "text": "function handleErrors(response) {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response;\n}", "title": "" }, { "docid": "009754b312e1bc60cb61f24b5ca5d265", "score": "0.5681047", "text": "function handleError(err) {\n if (err instanceof http.IncomingMessage) {\n return emitter.emit('response', err);\n }\n emitter.emit('error', err);\n }", "title": "" }, { "docid": "2e3c72497085a89ebdd83fc484244e7b", "score": "0.56754124", "text": "function handleErrors(response) {\n if (response.statusText !== \"OK\") {\n throw Error(response.statusText);\n }\n return response.data;\n}", "title": "" }, { "docid": "18f2b828da563bf007e7c8ac6bb6faad", "score": "0.5661411", "text": "async function getData(url) {\nreturn fetch(url)\n .then(res => {\n if (!res.ok) {\n throw new Error(res.error);\n }\n return res;\n })\n .then(res => res.json())\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "c2252be4234cf873a930b0fe9e86ad51", "score": "0.56526524", "text": "function setupResponseErrorHandler($window) {\n if (!$window.fetch) {\n return;\n }\n\n const nativeFetch = $window.fetch;\n $window.fetch = (url, config) => {\n return nativeFetch(url, config)\n .then(async(result) => {\n if (result.status && (result.status === 401 || result.status === -1)) {\n try {\n redirectOnSessionTimeout($window);\n } catch (error) {\n console.log(error)\n }\n }\n\n return result;\n });\n };\n}", "title": "" }, { "docid": "1272c5f84ebd67a4599cc2beba704b0e", "score": "0.5641517", "text": "async function handleError(error, request) {\n console.error('ERROR handled by SW:', error);\n if (request.url.match(/undefined/) && request.format === 'image') {\n console.log(url);\n }\n if (request.url.match(/\\.(jpe?g|webp)$/i)) {\n const cache = await caches.open(CURRENT_CACHES.CACHE_STATIC);\n return cache.match('assets/img/svg/no-wifi.svg');\n }\n if (request.url.match(/reviews\\/\\?restaurant_id=$/)) {\n return console.log('couocu');\n }\n}", "title": "" }, { "docid": "1272c5f84ebd67a4599cc2beba704b0e", "score": "0.5641517", "text": "async function handleError(error, request) {\n console.error('ERROR handled by SW:', error);\n if (request.url.match(/undefined/) && request.format === 'image') {\n console.log(url);\n }\n if (request.url.match(/\\.(jpe?g|webp)$/i)) {\n const cache = await caches.open(CURRENT_CACHES.CACHE_STATIC);\n return cache.match('assets/img/svg/no-wifi.svg');\n }\n if (request.url.match(/reviews\\/\\?restaurant_id=$/)) {\n return console.log('couocu');\n }\n}", "title": "" }, { "docid": "4c8165de33710ab4412f67213ff4a5f2", "score": "0.5638902", "text": "function handleError(response) {\n //log(JSON.stringify(response.config, null, 2));\n $rootScope.urlCausedError = response.config.url;\n\n if (response.status == 502 || response.status == 503 || response.status == 0) {\n $rootScope.isRestUnavailable = true;\n //alertService.add(\"danger\", format('Адрес {} недоступен', $rootScope.urlCausedError));\n log(format('Адрес {} недоступен', $rootScope.urlCausedError));\n }\n else if (response.status == 500) {\n $rootScope.isRestError = true;\n //alertService.add(\"danger\", format('При обращении по адресу {} произошла ошибка',\n // $rootScope.urlCausedError));\n log(format('При обращении по адресу {} произошла ошибка',\n $rootScope.urlCausedError));\n }\n else {\n if ($rootScope.isRestUnavailable || $rootScope.isRestError) {\n $rootScope.isRestUnavailable = false;\n $rootScope.isRestError = false;\n }\n else {\n $rootScope.isRestUnavailable = false;\n $rootScope.isRestError = false;\n }\n }\n\n // The API response from the server should be returned in a\n // normalized format. However, if the request was not handled by the\n // server (or what not handles properly - ex. server error), then we\n // may have to normalize it on our end, as best we can.\n if (!angular.isObject(response.data) || !response.data.message) {\n return $q.reject({\n msg: \"An unknown error occurred.\",\n code: response.status\n });\n }\n // Otherwise, use expected error message.\n return $q.reject({\n msg: response.data.message,\n code: response.status\n });\n }", "title": "" }, { "docid": "6202f25666b836c4f13d8dfbcfdf38e3", "score": "0.56379735", "text": "function handleError() {\r\n\t\tlogToConsole(\"error!\");\r\n\t\twindow.clearTimeout(abortTimerId);\r\n\t\terrorLives--;\r\n\t\tif(errorLives <= 0)\r\n\t\t\tsetLoggedOutState();\r\n\t\t//scheduleRequest();\r\n\t}", "title": "" }, { "docid": "19ded78eaeaef804498405fd5561e9ef", "score": "0.5631526", "text": "function handleErrors(response) {\r\n if (!response.ok) {\r\n throw Error(response.statusText);\r\n }\r\n return response;\r\n }", "title": "" }, { "docid": "b5d8f312743b80285584f750c03c229b", "score": "0.56211424", "text": "function checkstauts(response){\n if(response.status >= 200 && response.status < 300){\n return response\n }\n const errortext = response.statusText;\n const error = new Error(errortext);\n error.name = response.status;\n error.response = response;\n throw error;\n}", "title": "" }, { "docid": "4c5d535725754ac0dd98cadaeedf77e2", "score": "0.5618695", "text": "function handleFetch(url) {\n return fetch(url)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n getData(data);\n getUvIndex(data);\n getFiveDay(data);\n })\n}", "title": "" }, { "docid": "0a2cb32378933e955992165e85fd98ff", "score": "0.56131774", "text": "async function asyncFetch(url) {\n try {\n console.log(`passing URL ${url}`);\n const parsedURL = new URL(url); \n let response = await fetch(parsedURL.href); \n let data = `Checking the URL ${parsedURL.href} : Status = ${response.status} and Reponse Code : ${response.statusText}` ;\n return data; \n }\n catch (error) {\n let data = `Failed in parsing the URL ${url} with error : ${error}`\n console.error(data);\n return data; \n }\n}", "title": "" }, { "docid": "660c07a2f55dc405b1a6d9b33620de53", "score": "0.56117", "text": "function fetchByFailure(error) {\n return {\n type: FETCH_BY_FAILURE,\n payload: error\n };\n }", "title": "" }, { "docid": "d7dcbf0bde04d3f075b30677265dad2a", "score": "0.56068796", "text": "onError( error, request, response ) {\n\n\t\tconsole.log( chalk.red.bold( \"API Error Handler:\" ) );\n\t\tconsole.log( error );\n\n\t\t// If the headers have already been sent, it's too late to adjust the output, so\n\t\t// just end the response so it doesn't hang.\n\t\tif ( response.headersSent ) {\n\n\t\t\treturn( response.end() );\n\n\t\t}\n\n\t\t// Since all API calls are intending to return JSON, let's render the error \n\t\t// as such.\n\t\t// --\n\t\t// NOTE: For the demo, I am keeping this error handling fairly naive.\n\t\tresponse\n\t\t\t.status( this._getStatusCode( error ) )\n\t\t\t.json({\n\t\t\t\tok: false,\n\t\t\t\tdata: \"Something went wrong.\"\n\t\t\t})\n\t\t;\n\n\t}", "title": "" }, { "docid": "dce627030c423afdaeadb4209846bada", "score": "0.5598015", "text": "async function fetchItOld(url) {\n try {\n const data = await fetch(url);\n return await data.json();\n } catch (e) {\n return await Promise.reject(e);\n }\n}", "title": "" }, { "docid": "e523ca2ad312fa7538918b9353670e8f", "score": "0.55885947", "text": "function fetchAllFailure(error) {\n return {\n type: FETCH_ALL_FAILURE,\n payload: error\n };\n }", "title": "" }, { "docid": "dea79b32945f0c3d7004d9e74505df2c", "score": "0.5588425", "text": "async function getQuotes(){\r\n const apiUrl='http://type.fit/api/quotes';\r\ntry{\r\n const response = await fetch(apiUrl);\r\n apiQuotes = await response.json();\r\n newQuote();\r\n}catch(error){\r\n // catch Error Here\r\n}\r\n\r\n}", "title": "" }, { "docid": "8d111b9b37977328e7e5fbd53192953a", "score": "0.5588176", "text": "async function getPhotos() {\n try {\n const response = await fetch(apiUrl);\n photosArray = await response.json();\n displayPhotos();\n if (!isInitialLoaded) {\n updateAPIUrl(picCount);\n }\n isInitialLoaded = true;\n //console.log(photosArray); \n } catch (error) {\n // Catch ERROR here \n\n }\n}", "title": "" }, { "docid": "2ecc03c16c833cedbe27b2cab63d0df8", "score": "0.5585038", "text": "_processResult(httpRes, error, apiResponse) {\n if(error) {\n httpRes.send(500, error.message);\n } else httpRes.send(apiResponse);\n }", "title": "" }, { "docid": "2b11661fb0abc65a461b598f97d44848", "score": "0.55838156", "text": "function handleErrors(response) {\n if (!response.ok ) {\n throw Error(response.statusText);\n }\n return response;\n}", "title": "" }, { "docid": "3e35db9ed8317911bd7a8c1b53bdf642", "score": "0.55837923", "text": "HTTPError(request,response,code) {\n\t\ttry {\n\t\t\t//Set the headers including the code.\n\t\t\tresponse.writeHead(code, {'Content-Type': 'text/html'});\n\t\t\t//Write a message to go with the error, contained in config/errorCodes.json\n\t\t\tresponse.write(this.errorCodes[code]);\n\t\t\tresponse.end();\n\t\t}\n\t\tcatch(err) {\n\t\t\tconsole.log(err);\n\t\t}\n\t}", "title": "" }, { "docid": "acd8c63285d5b766df1223ba9b3520c7", "score": "0.55814594", "text": "function handleError( response ) {\n // The API response from the server should be returned in a\n // nomralized format. However, if the request was not handled by the\n // server (or what not handles properly - ex. server error), then we\n // may have to normalize it on our end, as best we can.\n //console.log(response);\n\n if(response.status != 200){\n return( $q.reject( \"Error de conexión. Error \"+response.status+\". \"+response.statusText ) );\n }\n if (\n ! angular.isObject( response.data ) ||\n ! response.data.message\n ) {\n return( $q.reject( \"Un error desconocido ha sucedido.\" ) );\n }\n // Otherwise, use expected error message.\n return( $q.reject( response.data.message ) );\n }", "title": "" }, { "docid": "b2a9a797af2c8b76f5d9fb0d1e018af9", "score": "0.55784166", "text": "handleErrors(err) {\r\n if (err.response) {\r\n alert(`Problem with response ${err.response.status}. Price Not Available for this ticker.`);\r\n } else if (err.request) {\r\n alert(`Problem with request.`);\r\n } else {\r\n alert(`Error ${err.message}, recheck API url.`);\r\n }\r\n }", "title": "" }, { "docid": "5a5d3bfa82f6b655237f8ac86945652a", "score": "0.5577491", "text": "function requestURL(url) {\n\ttry {\n\t\trequest(url, (error, response, body) => {\n\t\t\tif (error || response.statusCode !== 200) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\ttry {\n\n\t\t\t} catch (e) {\n\n\t\t\t}\n\t\t})\t\n\t} catch(e) {\n\t\tconsole.log('failure requesting')\n\t}\n\t\n}", "title": "" }, { "docid": "2e9c9f2fe37cf3ae8de8bbec51c063ac", "score": "0.55701196", "text": "fetchData(url) {\n xhr({\n url: url\n }, (err, data)=> {\n const newdata = JSON.parse(data.body);\n if (newdata.cod === \"200\") {\n this.onFetchDataSuccess(newdata);\n this.removeLoading();\n } else {\n this.removeLoading();\n this.changeError(newdata.message);\n }\n }, (err)=> {\n this.removeLoading();\n this.changeError(\"Something went wrong. Please try it later.\");\n })\n }", "title": "" }, { "docid": "366a4aa7e6c5ebd6457aebe65fcfa594", "score": "0.5569902", "text": "function handleHttpErrors(res) {\n if (!res.ok) {\n throw Error(res.statusText);\n }\n console.log(res);\n return res.json();\n}", "title": "" }, { "docid": "1ef3bb63615ebc816db11646dc7182ce", "score": "0.55658937", "text": "fetchRepos() {\n fetch(url)\n .then((res) => res.json() )\n .then((data) => {\n this.setState({\n json: data,\n })\n })\n .catch((error) => window.alert(\"Error in fectch\") )\n // alert window when there is error.\n }", "title": "" }, { "docid": "39fff67365112fb120c2eb81f7b7fcbf", "score": "0.5559608", "text": "function handleErrors(response) {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response;\n}", "title": "" }, { "docid": "39fff67365112fb120c2eb81f7b7fcbf", "score": "0.5559608", "text": "function handleErrors(response) {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response;\n}", "title": "" }, { "docid": "39fff67365112fb120c2eb81f7b7fcbf", "score": "0.5559608", "text": "function handleErrors(response) {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response;\n}", "title": "" }, { "docid": "c5bd81c5003ba65f22ba9b191566fd04", "score": "0.5551762", "text": "fetchResultsFailure(err) {\n console.log(err);\n // If fetch failed we need to set currentStartIndex to what it was before\n this.setState({ currentStartIndex: this.state.prevStartIndex });\n if((err) && (err.message)) {\n this.setState({ errors: err.message }); \n }\n else {\n this.setState({ errors: errorMsgNotFound });\n }\n }", "title": "" }, { "docid": "c10d92ca5813e07aaa030d5adb2677fb", "score": "0.55514634", "text": "function handleError(response) {\n if (!response.ok) {\n throw new Error(`${response.status} (${response.statusText})`);\n }\n return response;\n }", "title": "" }, { "docid": "8d72e6dc5f2ea91dcd2fd7fbcf7deca4", "score": "0.55473506", "text": "function handleErrors(response) {\n console.log('00000')\n console.log(response)\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response;\n}", "title": "" }, { "docid": "c1f72e2f14dfc48ae8713b4f9ec782fd", "score": "0.5547269", "text": "function handleHttpErrors(res) {\n if (!res.ok) {\n return Promise.reject({ status: res.status, fullError: res.json() })\n }\n return res.json();\n}", "title": "" } ]
66b818a0336fcf1cbb79e6b23dd5bec8
Controls the state for the current analysis.
[ { "docid": "a170bdb0b8ea57b4ac8ae0d0d4a492f1", "score": "0.0", "text": "function StateController(AnalysisService) {\n var vm = this;\n vm.percentage = 0;\n\n /**\n * Initializes the sate of the analysis.\n */\n function initialize() {\n return AnalysisService.getAnalysisState(function (data) {\n vm.state = data.state;\n vm.stateLang = data.stateLang;\n vm.percentage = Math.round(parseFloat(data.percentComplete));\n vm.stateClass = _createClass(vm.state);\n });\n }\n\n /**\n * Dynamically creates the border color for the top of the sidebar depending on the state of the analysis.\n * @param state\n * @returns {string}\n * @private\n */\n function _createClass(state) {\n return 'analysis__alert--' + state.toLowerCase();\n }\n\n initialize();\n }", "title": "" } ]
[ { "docid": "d9d0ee8d685c10a557c90e9d90af0e8e", "score": "0.6307156", "text": "function setUpdatingState() {\n status.innerText = 'Updating arrangements...';\n status.style.color = 'black';\n playButton.disabled = true;\n alphaSlider.disabled = true;\n sampleButton1.disabled = true;\n sampleButton2.disabled = true;\n saveButton.disabled = true;\n changeChordsButton.disabled = true;\n chordInputs.forEach(c => c.disabled = true);\n chordInputs.forEach(c => c.style.color = 'gray');\n}", "title": "" }, { "docid": "e3744b3ffae05c8e688927077766afae", "score": "0.61095876", "text": "setTrading() {\n this.currentState = cpState.TRADING;\n }", "title": "" }, { "docid": "e81405538f7c40c2ba2099fc69452e6f", "score": "0.60600084", "text": "function StateManager_SetInterpreterData()\n{\n\t//Tell the Interpreter to Load this State, display it at the end only if we arent advancing and dont reset\n\t__SIMULATOR.Interpreter.LoadState(this.CurrentState, this.AdvancingStates == 0, false);\n\t//update block variable\n\tthis.BlockUserInteraction = this.CurrentState.ControlSettings && Get_Bool(this.CurrentState.ControlSettings[__NEMESIS_ParamName_LessonBlockControl], false);\n}", "title": "" }, { "docid": "228c2d0e457bf395299d5f7e54e05b68", "score": "0.6036129", "text": "function State() {\n\n }", "title": "" }, { "docid": "420d034547118179407d45ac1d1d08f8", "score": "0.5909259", "text": "function setState() {\n\t\t\tthis.data('timeline', {\n\t\t\t\ttriggers: triggers,\n\t\t\t\toptions: options,\n\t\t\t\tlastScrollY: lastScrollY\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "81465320ffdf01c828c15a6df2b0e7da", "score": "0.586369", "text": "function changeIsFigureChosen(state) {\r\n CanvasManager.isFigureChosen = state;\r\n}", "title": "" }, { "docid": "be35980c8587de45fcdb883bb2fdfc3f", "score": "0.5855806", "text": "reset() {\r\n this.activeState = this.config.initial;\r\n }", "title": "" }, { "docid": "239164b50e3e28f074ecce6004d23b4b", "score": "0.58050454", "text": "setNormal() {\n this.currentState = shtState.NORMAL;\n }", "title": "" }, { "docid": "a8397d3367b3ad69bba203f89c00f03e", "score": "0.5771134", "text": "_setInitialState() {\n const that = this;\n\n that._currentIndex = 0;\n that._indicators = [];\n that._items = [];\n that._rotate = false;\n that._handleDefaultInnerHTML();\n }", "title": "" }, { "docid": "e5459a5e6296f1f24bf9b1d6d89127f8", "score": "0.5770571", "text": "activate() {\n\t\tthis.active = true;\n\t\tthis.duration = this.savedDuration;\n\t\tif (this.partial) {\n\t\t\tthis.cycle = Math.ceil((1/this.density));\n\t\t}\n\t\telse {\n\t\t\tthis.cycle = 1;\n\t\t}\n\t\tthis.counter = 0;\n\t}", "title": "" }, { "docid": "25171d8e5cdab6b0f4dc373edd88d389", "score": "0.5770066", "text": "function StateManager_ProcessState()\n{\n\t//in advance state mode?\n\tif (this.AdvancingStates > 0)\n\t{\n\t\t//decrease counter\n\t\tthis.AdvancingStates--;\n\t}\n\t//Process State Data\n\tthis.SetInterpreterData();\n\t//still in advance state mode? and current has default action?\n\tif (this.AdvancingStates > 0 && this.CurrentState.ListOfPaths.length > 0)\n\t{\n\t\t//notify history\n\t\t__SIMULATOR.History.StateLoaded(this.CurrentState);\n\t\t//notify the scores\n\t\t__SIMULATOR.Scores.StateLoaded(this.CurrentState);\n\t\t//load next state\n\t\tthis.LoadState(this.CurrentState.ListOfPaths[0].Destiny);\n\t\t//stop waiting\n\t\t__WAIT_MANAGER.StopWaiting();\n\t}\n\telse\n\t{\n\t\t//ensure that the advancing state marker is 0\n\t\tthis.AdvancingStates = 0;\n\t\t//stop waiting\n\t\t__WAIT_MANAGER.StopWaiting();\n\t\t//Inform the simulator that a new state has just been loaded (after we reset it back visually)\n\t\t__SIMULATOR.StateLoaded(this.CurrentState);\n\t}\n}", "title": "" }, { "docid": "44749f58c4dbe01b48f296be39e3ae53", "score": "0.5705534", "text": "handle() {\n if(!this.enabled)\n return;\n\n Object.assign(this.previousState, this.state); // Save the previous state\n this.update(); // Update the current state\n this.notify();\n }", "title": "" }, { "docid": "d374b76df8501c7643ceb407f0f31aba", "score": "0.5705029", "text": "showAnalysis(query) {\n this.setState({\n renderAnalysis: true,\n selectedQuery: query,\n });\n }", "title": "" }, { "docid": "61dfe7113911d6efb591e5fc4d6e20ee", "score": "0.56948125", "text": "reset() {\r\n this.currentState = this.config.initial;\r\n }", "title": "" }, { "docid": "241a608f835fef200beb1354abdebe16", "score": "0.56700766", "text": "function optionChanged(state) {\n // console.log(state);\n buildPlot(state);\n insChart(state);\n}", "title": "" }, { "docid": "019fcd2cd72618b845c10f81f44ceeb9", "score": "0.5650908", "text": "resetState() {\n this.setState({\n show: false,\n currCode: null,\n latest: 0,\n performance: 0,\n capital: 0,\n amount: 0,\n potential: 0,\n multiplier: 1.5,\n prediction: 1,\n err: false,\n err_msg: null\n })\n }", "title": "" }, { "docid": "27ee577939ab53567a083aa3ac5ba38b", "score": "0.5592534", "text": "function setState(value) {\n state = value;\n appView.filterAll();\n }", "title": "" }, { "docid": "e314670227e08a61bd3a2485c241e6d5", "score": "0.55820185", "text": "resetSIMMState() {\r\n this.setState({\r\n currentReference : -1,\r\n currentProcess : 'N/A',\r\n currentPage : 'N/A',\r\n swapSpace : new SwapSpace(),\r\n frameTable : new FrameTable(),\r\n colorGenerator : new ColorGenerator()\r\n });\r\n }", "title": "" }, { "docid": "b61fae2ee984b848c7de9ac9fab2b190", "score": "0.5574647", "text": "changeVisualType(changeVisual) {\n this.setState({ changeVisual }) //changes state of changeVisual boolean\n if (changeVisual) {\n //change visualization based on the current boolean state\n this.setState({ visualType: 'Area' })\n } else if (!changeVisual) {\n this.setState({ visualType: 'Bar' })\n }\n }", "title": "" }, { "docid": "6a06f12ece14071954d6e90577a66f4b", "score": "0.556702", "text": "function setPlayingState() {\n status.innerText = 'Move the slider to interpolate styles.';\n status.style.color = 'black';\n playButton.innerText = 'Stop';\n playButton.disabled = false;\n alphaSlider.disabled = false;\n sampleButton1.disabled = false;\n sampleButton2.disabled = false;\n saveButton.disabled = false;\n changeChordsButton.disabled = false;\n chordInputs.forEach(c => c.disabled = true);\n chordInputs.forEach(c => c.style.color = 'gray');\n}", "title": "" }, { "docid": "aa2f022ab16f14b0cdc9a554025d5bcf", "score": "0.55654866", "text": "function setLoadingState() {\n status.innerText = 'Loading samples...';\n status.style.color = 'black';\n playButton.disabled = true;\n alphaSlider.disabled = true;\n sampleButton1.disabled = true;\n sampleButton2.disabled = true;\n saveButton.disabled = true;\n changeChordsButton.disabled = true;\n chordInputs.forEach(c => c.disabled = true);\n chordInputs.forEach(c => c.style.color = 'gray');\n}", "title": "" }, { "docid": "1b5adf86aeac84fa7a395089206cf657", "score": "0.55646276", "text": "reset() {\r\n this.state = this.config.initial;\r\n }", "title": "" }, { "docid": "907e9ceb148379880a5c03a857470f4a", "score": "0.55504805", "text": "reset() {\r\n this.currentState = this.initial;\r\n }", "title": "" }, { "docid": "afc12dac8482a99c6cc6897aa6305ed8", "score": "0.554261", "text": "stateUpdate() {\n this.handlestateVariable();\n this.handlestateVariable2();\n this.handleCChange();\n this.handleAChange();\n this.handleidCapture();\n this.handleimgCapture();\n this.handleConfigChange();\n this.idcaptureVal();\n this.imgcaptureVal();\n }", "title": "" }, { "docid": "3214e06539bbd0c10e4c5bce07d00c39", "score": "0.55344844", "text": "reset() {\r\n this.state = this.config.initial;\r\n }", "title": "" }, { "docid": "a252032326f04b376ce6d9bbc75b75a3", "score": "0.55326176", "text": "reset() {\r\n return this.state = \"normal\";\r\n }", "title": "" }, { "docid": "ceef3a1f6f9e68e48ee265c957effb68", "score": "0.5532301", "text": "function changeIsActionChosen(state) {\r\n CanvasManager.isActionChosen = state;\r\n}", "title": "" }, { "docid": "233b9caea49b64cae8020cf8bfa391e8", "score": "0.55287", "text": "constructor() {\n super();\n this.state = {\n filters: ['unemployed', 'employed_total', 'not_in_labor'],\n labels: ['U', 'E', 'N'],\n averageDataset: {},\n };\n\n this.calculateAverageDatset = this.calculateAverageDatset.bind(this);\n this.addLineGraph = this.addLineGraph.bind(this);\n }", "title": "" }, { "docid": "6b1a2656d35513e1e000e928f491c394", "score": "0.551561", "text": "function indicateState() {\n setTutorialState(props.tutorialText);\n setShowModalState(true);\n }", "title": "" }, { "docid": "906189083021d5ceafe3b2bbfa7063a3", "score": "0.5514003", "text": "function setChordChangeState() {\n status.innerText = 'Change chords (triads only) then press Done.';\n status.style.color = 'black';\n playButton.disabled = true;\n alphaSlider.disabled = true;\n sampleButton1.disabled = true;\n sampleButton2.disabled = true;\n saveButton.disabled = true;\n changeChordsButton.innerText = 'Done';\n changeChordsButton.disabled = false;\n chordInputs.forEach(c => c.disabled = false);\n chordInputs.forEach(c => c.style.color = 'black');\n}", "title": "" }, { "docid": "48a886aca8bc1ecb7fcde2e9fd1210e1", "score": "0.5492741", "text": "switchCaseStatus() {\n // console.log(\"111\");\n this.isShowCaseloadTrend = false;\n if (this.isShowCaseStatus == false) {\n this.isShowCaseStatus = true;\n } else {\n this.isShowCaseStatus = false;\n }\n }", "title": "" }, { "docid": "d41adb3d3f9d2c3ebc12859ce948f32c", "score": "0.54906976", "text": "setButtonState() {\n // this.view.setButtonState(this.runner.busy,this.synchronizing,this.synchronize_type)\n }", "title": "" }, { "docid": "d50b0ec1b804ca1d0be422605751213c", "score": "0.54870737", "text": "commonInvAction() {\n this.prevBaseFramePosition = undefined;\n this.vLab.WebGLRendererCanvas.style.cursor = 'default';\n this.baseFrameActionActivated = false;\n this.vLab.SceneDispatcher.currentVLabScene.currentControls.enable();\n }", "title": "" }, { "docid": "d6523c909e939ee769e9b49cf060ca66", "score": "0.5481222", "text": "changeState() {\n const newState = this.machineTable[this.state][this.lastRead].state;\n\n this.state = parseInt(newState, 10);\n }", "title": "" }, { "docid": "abb402160d4814438ccca336494feaa0", "score": "0.5471772", "text": "setNew() {\n this.currentState = pointState.New;\n }", "title": "" }, { "docid": "77cdb7976d8d7bade982ed20829162e3", "score": "0.5465356", "text": "function State() { }", "title": "" }, { "docid": "6bd134f9e7ae4eb6c7dedd4064ef5b33", "score": "0.54645014", "text": "stateChanged(state) {\n this._clicks = state.counter.clicks;\n this._value = state.counter.value;\n }", "title": "" }, { "docid": "201115106cea85bc9c0c7b06f8856687", "score": "0.5454872", "text": "function updatePracticePane()\n {\n evaluateInput()\n setTargetText()\n displayTargetText()\n updateProgress()\n updateSpeed()\n updateError()\n updateSmiley()\n\n if (my.current.state == my.STATE.COMPLETED) {\n displayAdvice()\n setResultTooltips()\n\n log('state', my.current.state.toUpperCase(),\n 'unit', my.current.unitNo + '.' + my.current.subunitNo,\n 'type', my.settings.unit,\n 'wpm', my.current.wpm,\n 'error', my.current.errorRate.toFixed(1))\n }\n }", "title": "" }, { "docid": "05b5ed2b26b536c3fe32b8e14184edae", "score": "0.5451349", "text": "handleUpdatedState(state) {\n this.lastTechnology = state.selectedTechnology;\n this.totalClicks = state.clickCounter;\n }", "title": "" }, { "docid": "89330456c6bd94a42a854860f475fbbc", "score": "0.54478025", "text": "postAnalysis() { }", "title": "" }, { "docid": "dfb2ca527e3c86601e059a0add74937c", "score": "0.5443376", "text": "function resetState(){\n d3.selectAll(\"button.state_reset\").style(\"display\", \"none\");\n d3.selectAll(\"button.county_reset\").style(\"display\", \"none\");\n selState=\"\";\n d3.select(\"#counties\").remove();\n if (pollClick) {\n mapTitle.text(selRiskString + \" Assessment for \" + selPoll);\n } else {\n mapTitle.text(selRiskString + \" Assessment\");\n }\n countyClick = false;\n countyLoad = false;\n hideTip();\n showStates();\n mapG.transition()\n .delay(50)\n .duration(550)\n .style(\"stroke-width\", \"1.5px\")\n .attr('transform', 'translate('+mapMargin.left+','+mapMargin.top+')');\n}", "title": "" }, { "docid": "e8d813b48e69f08c9eb3a849319660dc", "score": "0.5439122", "text": "reset() {\r\n this.state = this.initial;\r\n }", "title": "" }, { "docid": "58fa843c5128600c0dc5a03a4f0183d8", "score": "0.54231775", "text": "reset() {\r\n this.prevState=this.currentState;\r\n this.currentState = this.config.initial;\r\n }", "title": "" }, { "docid": "b28e9421bea15efcb33057848e40a28d", "score": "0.542208", "text": "function startVisualize() {\n if (selectedHeuristic == undefined && algorithmIndex == undefined) {\n showAlert(\"Please select an Algorithm and Heuristic function\");\n } else if (selectedHeuristic == undefined) {\n showAlert(\"Please select Heuristic function\");\n } else if (algorithmIndex == undefined) {\n showAlert(\"Please select an Algorithm\");\n } else {\n $controlButton.toggleClass(\"active\");\n finished = false;\n initialized = false;\n toggleControls();\n running = true;\n }\n}", "title": "" }, { "docid": "3ee0e13199b5a1228b6e5d8feb5234a0", "score": "0.541282", "text": "changeState(state)\r\n {\r\n if(state==\"hungry\"||state==\"busy\"||state==\"normal\"||state==\"sleeping\")\r\n {\r\n this.usteps.push(this.initial);\r\n this.rsteps=[];\r\n this.initial=state;\r\n }\r\n else\r\n {\r\n throw new Error();\r\n }\r\n }", "title": "" }, { "docid": "0df28f552ebeac76e60764c00ed123da", "score": "0.5404411", "text": "function resetApplicationState() {\r\n Canvas.clearCanvas();\r\n Animation.reset();\r\n animating = false;\r\n\r\n AlgoSelect.deselectAlgButtons();\r\n AlgoSelect.loadAlgoInfo('default');\r\n\r\n // save to undo history\r\n saveCurrentState()\r\n}", "title": "" }, { "docid": "982b1a0f0f38c83b4bd67e76dcb1d982", "score": "0.53935003", "text": "constructor() {\n super()\n this.state = {\n advisories_visiable: true,\n warnings_visiable: true,\n watches_visiable: true,\n interval: undefined,\n map: undefined,\n infoWindow: undefined,\n cetner: {\n lat: 39.8282,\n lng: -98.5795\n },\n zoom: 3\n }\n }", "title": "" }, { "docid": "c1e728af5fa0139c783042cd9b6a0373", "score": "0.53899044", "text": "function OnStateUpdate(self, state)\n {\n self.level = state.attributes.volume_level;\n self.state = state;\n set_view(self, state)\n }", "title": "" }, { "docid": "3434b365f3de01d3de91edcc87654102", "score": "0.53847456", "text": "applyState(state) {\n const me = this;\n me.beginBatch();\n\n if ('locked' in state) {\n me.locked = state.locked;\n }\n\n if ('minWidth' in state) {\n me.minWidth = state.minWidth;\n }\n\n if ('width' in state) {\n me.width = state.width;\n }\n\n if ('flex' in state) {\n me.flex = state.flex;\n }\n\n if ('width' in state && me.flex) {\n me.flex = undefined;\n } else if ('flex' in state && me.width) {\n me.width = undefined;\n }\n\n if ('text' in state) {\n me.text = state.text;\n }\n\n if ('region' in state) {\n me.region = state.region;\n }\n\n if ('renderer' in state) {\n me.renderer = state.renderer;\n }\n\n if ('filterable' in state) {\n me.filterable = state.filterable;\n }\n\n me.endBatch();\n\n if ('hidden' in state) {\n me.toggle(state.hidden !== true);\n }\n }", "title": "" }, { "docid": "7fe106984ce35492768dcd1b32192fa8", "score": "0.53844315", "text": "switchCaseloadTrend() {\n // console.log(\"222\");\n this.isShowCaseStatus = false;\n if (this.isShowCaseloadTrend == false) {\n this.isShowCaseloadTrend = true;\n } else {\n this.isShowCaseloadTrend = false;\n }\n }", "title": "" }, { "docid": "f2eed839cfc2ba91022c4ea035a879b1", "score": "0.538207", "text": "constructor() {\n super();\n // set index of each dataset to false\n // TODO: use meaningful property names?\n this.state = { 1: false, 2: false, 3: true, 4: false, 5: false };\n }", "title": "" }, { "docid": "91c2bc81e96fc65ecb4af9ea95e6e8de", "score": "0.5381953", "text": "constructor () {\n this.analyses = [];\n this.pass = true;\n\n Object.seal(this);\n }", "title": "" }, { "docid": "b52198778ec024987e43f84aca4cd686", "score": "0.538027", "text": "reset() {\n if (!this._running) {\n this._currentState = undefined;\n }\n }", "title": "" }, { "docid": "e74961012ebf4a4852caeb5624b2f6d3", "score": "0.5375275", "text": "function State() {\n\n }", "title": "" }, { "docid": "1c7db9596405ced107413b3503229a7e", "score": "0.53737617", "text": "imptoMetric() {\n this.setState(prevState => ({\n metric: !prevState.metric\n })\n )\n }", "title": "" }, { "docid": "08f308379ed66e702a66f0b7626a11f7", "score": "0.5360858", "text": "strategyToggle() {\n// console.log('In ActionTrade.strategyToggle this=',this);\n// console.log('state=',this.state);\n logUsage('event', 'ActionTrade', { event_label: 'ActionTrade'});\n this.props.saveAutoSave();\n var design;\n var ncode;\n const { store } = this.context;\n// this.props.saveInputSymbolValues();\n// this.props.search();\n design = store.getState();\n var nviol = this.commonViolationSetup();\n if (design.model.result.objective_value <= design.model.system_controls.objmin || nviol === 0) {\n this.props.restoreInputSymbolValues();\n ncode = 'OBJ < OBJMIN - USE OF TRADE IS NOT APPROPRIATE';\n this.props.changeResultTerminationCondition(ncode);\n return;\n } else {\n this.setState({\n strategyModal: !this.state.strategyModal,\n });\n }\n }", "title": "" }, { "docid": "5ec723956bed90bc039a56cfdcfe77ba", "score": "0.5360352", "text": "function State() {\n this._trackedMetrics = {};\n this.on('ingest', ingest);\n}", "title": "" }, { "docid": "26f65e527b183d2c2dadba208228e820", "score": "0.53539747", "text": "function stateChange(state, expression) {\n let extent = getStateMapExtent(state);\n goToExtent(extent);\n countiesLyr.definitionExpression = expression;\n countiesLyr.visible = true;\n megaLyr.visible = true;\n urbanLyr.visible = true;\n statesLyr.visible = false;\n censusblockLyr.visible = false;\n view.popup.close();\n removeLegend();\n removeTable();\n setDefaultCategory();\n customize = $.extend(true, {}, defaultMapSettings);\n $method[0].sumo.selectItem('natural-breaks');\n $('.nav-tabs a[href=\"#fields\"]').tab('show');\n $cbNumOne.hide();\n $cbNumTwo.hide();\n hideFieldDesign();\n }", "title": "" }, { "docid": "9c3adb162d8bc79d89850e4c8a125a6f", "score": "0.5348873", "text": "function manageTypeFilterState() {\n if (ratios.options[ratios.selectedIndex].value !== 'all') {\n\n // in case someone has changed the type filter, we'll remember what it\n // was. that way, we can replace that filter's state as needed in the\n // else block. because the originalTypeFilter variable is declared\n // outside the scope of this block, it's value will be maintained across\n // multiple calls to this method.\n\n originalTypeFilter = typeFilter.selectedIndex;\n typeFilter.selectedIndex = 1;\n typeFilter.disabled = true;\n } else {\n typeFilter.selectedIndex = originalTypeFilter;\n typeFilter.disabled = false;\n }\n }", "title": "" }, { "docid": "051b5231c8ac149821358d49ee477200", "score": "0.53454995", "text": "function instructionState() {\n sea.update();\n //player.update();\n }", "title": "" }, { "docid": "8f5cacb1d05a1c304c4b707a89263b2a", "score": "0.53416306", "text": "function Handler() {\n\t\t\t\tthis.state = 0;\n\t\t\t}", "title": "" }, { "docid": "2814603c7acd47737ab69ce39b0ec089", "score": "0.53353614", "text": "emitStateChanges() {\n const currentState = store.getState();\n switch (true) {\n case !this.previousState.slides.length && !!currentState.slides.length:\n this.eventBus.emit(MAIN_CHANNEL, 'initialized');\n break;\n case !_.isEmpty(this.previousState.currentSlide) && !this.engine.slideEquals(currentState.currentSlide, this.previousState.currentSlide):\n this.eventBus.emit(MAIN_CHANNEL, 'gotoSlide', { slide: currentState.currentSlide });\n break;\n }\n this.previousState = currentState;\n }", "title": "" }, { "docid": "be3b84594fa3790a6fb5ee9d7cbeeab6", "score": "0.53340715", "text": "'state.selected_diagnostics'() {\n if (this.state.selected_diagnostics.length !== 0) {\n this.uncheckLabelsButtons();\n this.createPlot();\n }\n }", "title": "" }, { "docid": "7aa8c9a96984d849deced5d7830caaa7", "score": "0.53324014", "text": "applyState(state) {\n const me = this;\n\n me.beginBatch();\n\n if ('locked' in state) {\n me.locked = state.locked;\n }\n\n if ('minWidth' in state) {\n me.minWidth = state.minWidth;\n }\n\n if ('width' in state) {\n me.width = state.width;\n }\n\n if ('flex' in state) {\n me.flex = state.flex;\n }\n\n if ('width' in state && me.flex) {\n me.flex = undefined;\n } else if ('flex' in state && me.width) {\n me.width = undefined;\n }\n\n if ('text' in state) {\n me.text = state.text;\n }\n\n if ('region' in state) {\n me.region = state.region;\n }\n\n if ('renderer' in state) {\n me.renderer = state.renderer;\n }\n\n if ('filterable' in state) {\n me.filterable = state.filterable;\n }\n\n me.endBatch();\n\n if ('hidden' in state) {\n me.toggle(state.hidden !== true);\n }\n }", "title": "" }, { "docid": "dd9c27b6a1487e76b3d159743b930335", "score": "0.5329948", "text": "updateState() {\n\t\tthis.trigger(this.state);\n\t}", "title": "" }, { "docid": "f4d11849d43bd2fd3f4f84bc20940495", "score": "0.53277695", "text": "function nextState(){\n for (var i = 3; i<=91; i++){\n $(\"#MathJax-Span-\"+i).css(\"color\",\"black\"); \n }\n var points = model.get_current_state_array();\n var pointdict = model.get_current_state();\n var numpoints = points.length;\n var newstate = [];\n \n state++;\n updateGraph();\n \n $(\".next-state\").attr(\"disabled\",false);\n $(\".previous-state\").attr(\"disabled\",false);\n \n $(\".span7\").append(\"<a name='bottom'><div class='chart-container chart\"+state+\"'></div></a>\");\n setupGraph(state);\n updateTopBubbles(state);\n setupSideLabels(state);\n $(\".span7\").append(\"<div class='row-fluid continue-row'><button class='arrow-transition btn btn-large'>See Transition Model</button></div>\");\n $(\".arrow-transition\").css(\"visibility\",\"visible\");\n $(\".arrow-transition\").on(\"click\",function(){\n $(this).closest('.row-fluid').remove();\n $('.num-label'+state).remove(); $('.first-prob'+state).remove(); //to remove the duplicate\n firstupdate(state);\n updateFirstInputRow(\"rest\");\n })\n }", "title": "" }, { "docid": "298400af3830a8b33c1246f65b9efde1", "score": "0.53171337", "text": "reset() {\r\n this.currentState = this.config.initial;\r\n this.recordStates.push(this.currentState);\r\n this.currentStatePosition++;\r\n this.recordMethods.push('reset');\r\n }", "title": "" }, { "docid": "172e9c1cf2e7712ed548f70fbdf0e46c", "score": "0.53137773", "text": "stateChanged(state) {\n this.active = this.filter === state.visibilityFilter;\n }", "title": "" }, { "docid": "284f72173d47a08a8d1eb423fdd71902", "score": "0.5308928", "text": "stateChange(state){\n\t\tLogger.info(`Ably realtime state changed to: ${state.current}`);\n\t}", "title": "" }, { "docid": "43422a9cc7fbdbd36a459546bc824ddf", "score": "0.5308373", "text": "function resetStarted(){\n selectionStarted = false;\n bubbleStarted = false;\n insertionStarted = false;\n bogoStarted = false;\n quickStarted = false;\n heapStarted = false;\n mergeStarted = false;\n}", "title": "" }, { "docid": "7cd5ab5ac67254a49b4c40e2209d9042", "score": "0.5293523", "text": "function RunState() {\n // The time at which this run was performed.\n var time;\n\n // All alerts from any child workflows.\n var alerts = {};\n\n // An array of root workflows/documents for this state.\n var rootWorkflows = [];\n}", "title": "" }, { "docid": "7877bd19d319c85ef33dac444a69d8fe", "score": "0.52933645", "text": "constructor(props) {\n super(props);\n\n this.state = {\n active: window.Dataset.active\n };\n }", "title": "" }, { "docid": "f7d85a5c0e660365f45d9c4a5bdd06a6", "score": "0.52842677", "text": "drawState(){\n if(this.getTracer().stateStructure && this.getNode(this.currentId)){\n NodeStateService.process(this.getNode(this.currentId).state_variables);\n }\n }", "title": "" }, { "docid": "35f4f359b80df67f5d42884f69055199", "score": "0.5284159", "text": "initState () {\n // for benchmarking\n if (this.options) {\n if (this.options.timing === true && getItType(console.time) === 'FUNCTION') {\n this.state.TIMING = true\n }\n if (this.options.logging === true && getItType(console.log) === 'FUNCTION') {\n this.state.LOGGING = true\n }\n if (this.options.warning === true && getItType(console.warn) === 'FUNCTION') {\n this.state.WARNING = true\n }\n }\n }", "title": "" }, { "docid": "6073b03fff415ac16dd031f54fa68f7b", "score": "0.5284116", "text": "_onChangeState() {\n\n\n }", "title": "" }, { "docid": "efa6eab4faa1b0309bffdabef865b69f", "score": "0.5278573", "text": "function handleChange() {\n onChange(currentState);\n }", "title": "" }, { "docid": "cd7c3ef212b7f58fd78d40cdf22b43d0", "score": "0.52781206", "text": "function updatePracticePaneState()\n {\n switch (my.current.state) {\n\n case my.STATE.READY:\n my.html.practicePane.className = ''\n my.html.input.disabled = false\n my.html.input.focus()\n Util.setChildren(my.html.status, 'READY')\n my.html.status.title = 'Type in the input box below ' +\n 'to begin this lesson.'\n my.html.restartLink.style.visibility = 'hidden'\n break\n\n case my.STATE.RUNNING:\n my.html.practicePane.className = ''\n my.html.input.disabled = false\n my.html.input.focus()\n Util.setChildren(my.html.status, '')\n my.html.status.title = ''\n my.html.restartLink.style.visibility = 'visible'\n break\n\n case my.STATE.ERROR:\n my.html.practicePane.className = 'error'\n my.html.input.disabled = false\n my.html.input.focus()\n my.html.restartLink.style.visibility = 'visible'\n Util.setChildren(my.html.status, 'ERROR!')\n my.html.status.title = 'Fix errors in the input box ' +\n 'by pressing the backspace key.'\n break\n\n case my.STATE.COMPLETED:\n my.html.practicePane.className = 'completed'\n my.html.input.disabled = true\n my.html.input.blur()\n my.html.restartLink.style.visibility = 'visible'\n Util.setChildren(my.html.status, 'COMPLETED')\n my.html.status.title = 'You have completed this lesson.'\n break\n }\n\n }", "title": "" }, { "docid": "d65c2f0856fa064d47becbbc539cdb0f", "score": "0.5276743", "text": "function stateChange(){\n\n}", "title": "" }, { "docid": "ccd40bc72fff78988541292fd14dd1f6", "score": "0.5276321", "text": "setStudyState(aStudyState) {\n this.study_state= aStudyState;\n }", "title": "" }, { "docid": "778bc2d02f354fa09762b2640bcd9990", "score": "0.52762556", "text": "function activateQuiz(){\r\n quizMetrics.changeState(\"quiz\", true);\r\n }", "title": "" }, { "docid": "e8f7ab1e3bcf9ec6e0d583d2883d90e9", "score": "0.5275352", "text": "resetProgram() {\n this.checkForIntervalId();\n this.stateHistory.reset();\n }", "title": "" }, { "docid": "08e52709d16dc2c6646b35b465e45946", "score": "0.5273361", "text": "function OnStateUpdate(self, state)\n {\n self.level = state.attributes.volume_level;\n set_view(self, state)\n }", "title": "" }, { "docid": "113a4608c155b0fa302794b57df9651a", "score": "0.5262926", "text": "switchtoInfo() {\n this._setState('InfoState');\n }", "title": "" }, { "docid": "3360061b2f8fbfda5bdc9edac4a2dcdd", "score": "0.5262614", "text": "setCompanyActive () {\n this.companyActive = true;\n this.dataflowActive = false;\n }", "title": "" }, { "docid": "6bad0fe224991eaaf620075253b7e270", "score": "0.52603376", "text": "reset() {\r\n this.active = 'normal';\r\n }", "title": "" }, { "docid": "abd7d55984b0dfcf95922cb1b56c5e4f", "score": "0.5260014", "text": "controllerStateChange() {\n this.dataOpQueue = this.criteriaController.queue;\n this.retrieveData().extractItems(); // populates this items\n this.displayResults();\n }", "title": "" }, { "docid": "945d348e3aa7ecfd444d9aae25e5e1b0", "score": "0.52591753", "text": "toggle() {\n if (this.timeoutID) this.stop()\n else if (this.steps === 0) this.reset()\n else this.start()\n }", "title": "" }, { "docid": "3e990fefdc25d80cdf26ae4f3e55cb57", "score": "0.5253738", "text": "Set()\n {\n this.changed = true;\n this.indicator.style.backgroundColor = 'red';\n }", "title": "" }, { "docid": "ff37da4f2db15b306db4b2f6308a4a0c", "score": "0.5246005", "text": "function Handler() {\n\t\t\tthis.state = 0;\n\t\t}", "title": "" }, { "docid": "a1849d4fca4b9da62828e143248c880b", "score": "0.5245061", "text": "constructor(props) {\n super(props)\n\n this.state = {\n switcher: false,\n trending: props.trending\n }\n }", "title": "" }, { "docid": "6a6a092d2f6e98226ec5cd60bef4d4cb", "score": "0.52449936", "text": "function setStoppedState() {\n status.innerText = 'Ready to play!';\n status.style.color = 'black';\n playButton.innerText = 'Play';\n playButton.disabled = false;\n alphaSlider.disabled = false;\n sampleButton1.disabled = false;\n sampleButton2.disabled = false;\n saveButton.disabled = false;\n changeChordsButton.innerText = 'Change Chords';\n changeChordsButton.disabled = false;\n chordInputs.forEach(c => c.disabled = true);\n chordInputs.forEach(c => c.style.color = 'gray');\n}", "title": "" }, { "docid": "d7012b1337614108a2357da0f8282484", "score": "0.52437", "text": "function startOperation() {\n updateInput = null; changes = []; textChanged = selectionChanged = false;\n }", "title": "" }, { "docid": "d7012b1337614108a2357da0f8282484", "score": "0.52437", "text": "function startOperation() {\n updateInput = null; changes = []; textChanged = selectionChanged = false;\n }", "title": "" }, { "docid": "d7012b1337614108a2357da0f8282484", "score": "0.52437", "text": "function startOperation() {\n updateInput = null; changes = []; textChanged = selectionChanged = false;\n }", "title": "" }, { "docid": "b2343d1b91ab9317d6d69b4d3ecf3293", "score": "0.5242109", "text": "_updateStateOnClick() {\n const that = this;\n\n that._changeCheckState();\n that.focus();\n }", "title": "" }, { "docid": "cf6a7fd1e990d0f2effe0163c1ff4399", "score": "0.5235352", "text": "function OnStateUpdate(self, state)\n {\n if (!(\"ignore_state\" in self.parameters) || self.parameters.ignore_state === 0)\n {\n self.state = state.state;\n set_view(self, self.state)\n }\n }", "title": "" }, { "docid": "8c2fa07371b8c41b231d87baebf95c8b", "score": "0.5222003", "text": "function startOperation() {\n updateInput = userSelChange = textChanged = null;\n changes = []; selectionChanged = false; callbacks = [];\n }", "title": "" }, { "docid": "62213ec8fdc2275f64e0c521567a8cf5", "score": "0.52201176", "text": "get state() { return this._state; }", "title": "" }, { "docid": "a726717d7064cd75efa924cbc48fdb49", "score": "0.52199596", "text": "function StateManager_SetStateData(newState)\n{\n\t//update tutorial's current screen\n\tthis.CurrentState = newState;\n\t//update block variable\n\tthis.BlockUserInteraction = this.CurrentState.ControlSettings && Get_Bool(this.CurrentState.ControlSettings[__NEMESIS_ParamName_LessonBlockControl], false);\n}", "title": "" }, { "docid": "5570f4ddf95c337cc9abdad45edc588a", "score": "0.52173215", "text": "switchLyricIndex(state, index) {\n\t\t\t\t\tstate.songState.currentLyricIndex = index;\n\t\t\t\t}", "title": "" }, { "docid": "5e0a0c67fdaaf5dbf401b55c1d0809ac", "score": "0.52160585", "text": "doStart () {\n\t\tif (typeof this.state.isShuffle != \"boolean\") {\n\t\t\tthis.state.isShuffle = false;\n\t\t}\n\t\tif (typeof this.state.minItemDisplayDuration != \"number\") {\n\t\t\tthis.state.minItemDisplayDuration = 300;\n\t\t}\n\t\telse {\n\t\t\tif (this.state.minItemDisplayDuration < 0) {\n\t\t\t\tthis.state.minItemDisplayDuration = 0;\n\t\t\t}\n\t\t}\n\t\tif (typeof this.state.maxItemDisplayDuration != \"number\") {\n\t\t\tthis.state.maxItemDisplayDuration = 900;\n\t\t}\n\t\telse {\n\t\t\tif (this.state.maxItemDisplayDuration < 0) {\n\t\t\t\tthis.state.maxItemDisplayDuration = 0;\n\t\t\t}\n\t\t}\n\t\tif (typeof this.state.minStartPositionDelta != \"number\") {\n\t\t\tthis.state.minStartPositionDelta = 0;\n\t\t}\n\t\tif (typeof this.state.maxStartPositionDelta != \"number\") {\n\t\t\tthis.state.maxStartPositionDelta = 0;\n\t\t}\n\n\t\tthis.isPaused = false;\n\t\tthis.lastCommandTime = 0;\n\t\tthis.nextCommandTime = 0;\n\t\tthis.lastPauseTime = 0;\n\t}", "title": "" } ]
318736f8528d214143eb5bd870eec59f
Populate `_hostNode` on each child of `inst`, assuming that the children match up with the DOM (element) children of `node`. We cache entire levels at once to avoid an n^2 problem where we access the children of a node sequentially and have to walk from the start to our target node every time. Since we update `_renderedChildren` and the actual DOM at (slightly) different times, we could race here and see a newer `_renderedChildren` than the DOM nodes we see. To avoid this, ReactMultiChild calls `prepareToManageChildren` before we change `_renderedChildren`, at which time the container's child nodes are always cached (until it unmounts).
[ { "docid": "37f02001d130e394327475995d61467c", "score": "0.64546704", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? true ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" } ]
[ { "docid": "824a38933a2d1f2af4cbb6135fe944df", "score": "0.65556884", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "824a38933a2d1f2af4cbb6135fe944df", "score": "0.65556884", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "824a38933a2d1f2af4cbb6135fe944df", "score": "0.65556884", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "824a38933a2d1f2af4cbb6135fe944df", "score": "0.65556884", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "824a38933a2d1f2af4cbb6135fe944df", "score": "0.65556884", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "824a38933a2d1f2af4cbb6135fe944df", "score": "0.65556884", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "9669cac92d34e7df38a97b64114d0b36", "score": "0.6553111", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID == null) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "9669cac92d34e7df38a97b64114d0b36", "score": "0.6553111", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID == null) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "9669cac92d34e7df38a97b64114d0b36", "score": "0.6553111", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID == null) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "a8e18788c2bb21aba6c6d8b0c4b67b1a", "score": "0.6545349", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? \"development\" !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "a8e18788c2bb21aba6c6d8b0c4b67b1a", "score": "0.6545349", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? \"development\" !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "b931869f377819774bd51f8e7b0b24c8", "score": "0.6520908", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "edaca9426b03878a1b9adf34d4757d24", "score": "0.651924", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID == null) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n prodInvariant('32', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "1a63d56b33c5e18f88cc3c04a6ab3a16", "score": "0.6508824", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? true ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "1a63d56b33c5e18f88cc3c04a6ab3a16", "score": "0.6508824", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? true ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "d511c55f5ca7a5a7e9621acebae952f4", "score": "0.6499675", "text": "function precacheChildNodes(inst,node){if(inst._flags&Flags.hasCachedChildNodes){return;}var children=inst._renderedChildren;var childNode=node.firstChild;outer:for(var name in children){if(!children.hasOwnProperty(name)){continue;}var childInst=children[name];var childID=getRenderedHostOrTextFromComponent(childInst)._domID;if(childID===0){// We're currently unmounting this child in ReactMultiChild; skip it.\ncontinue;}// We assume the child nodes are in the same order as the child instances.\nfor(;childNode!==null;childNode=childNode.nextSibling){if(shouldPrecacheNode(childNode,childID)){precacheNode(childInst,childNode);continue outer;}}// We reached the end of the DOM children without finding an ID match.\ntrue?process.env.NODE_ENV!=='production'?invariant(false,'Unable to find element with ID %s.',childID):_prodInvariant('32',childID):void 0;}inst._flags|=Flags.hasCachedChildNodes;}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "65dafcc180f22ef931391104f06d360d", "score": "0.6499599", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "e29de4c76f5a8a227eb76e26c71a8176", "score": "0.6497022", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "e29de4c76f5a8a227eb76e26c71a8176", "score": "0.6497022", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "bbdab1f5e76adde221d120be5110dbe7", "score": "0.6496815", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? \"development\" !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "bbdab1f5e76adde221d120be5110dbe7", "score": "0.6496815", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? \"development\" !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "2c43c9c39f8e123e6fe765b67cbf1f3b", "score": "0.64656985", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "2c43c9c39f8e123e6fe765b67cbf1f3b", "score": "0.64656985", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "2c43c9c39f8e123e6fe765b67cbf1f3b", "score": "0.64656985", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "2c43c9c39f8e123e6fe765b67cbf1f3b", "score": "0.64656985", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "2c43c9c39f8e123e6fe765b67cbf1f3b", "score": "0.64656985", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "2c43c9c39f8e123e6fe765b67cbf1f3b", "score": "0.64656985", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "2c43c9c39f8e123e6fe765b67cbf1f3b", "score": "0.64656985", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "2c43c9c39f8e123e6fe765b67cbf1f3b", "score": "0.64656985", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "2c43c9c39f8e123e6fe765b67cbf1f3b", "score": "0.64656985", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.64616", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.64616", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.64616", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.64616", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.64616", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.64616", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.64616", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.64616", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.64616", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.64616", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.64616", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "4ff9b5e32be92e31fbade8b67fcbf7be", "score": "0.64616", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64558595", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64558595", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64558595", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64558595", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64558595", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64558595", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64558595", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64558595", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64558595", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64558595", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64558595", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64558595", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "6a62c7ccd57e635d87b61600ae0fc0e7", "score": "0.64558595", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID === 0) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "7ce319c46b11141664873d19c97186a0", "score": "0.64484835", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant_1(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "56ec3c88e859f37be88e13ecae5c2732", "score": "0.6447855", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID == null) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "56ec3c88e859f37be88e13ecae5c2732", "score": "0.6447855", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID == null) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "56ec3c88e859f37be88e13ecae5c2732", "score": "0.6447855", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID == null) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "56ec3c88e859f37be88e13ecae5c2732", "score": "0.6447855", "text": "function precacheChildNodes(inst, node) {\n\t if (inst._flags & Flags.hasCachedChildNodes) {\n\t return;\n\t }\n\t var children = inst._renderedChildren;\n\t var childNode = node.firstChild;\n\t outer: for (var name in children) {\n\t if (!children.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t var childInst = children[name];\n\t var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n\t if (childID == null) {\n\t // We're currently unmounting this child in ReactMultiChild; skip it.\n\t continue;\n\t }\n\t // We assume the child nodes are in the same order as the child instances.\n\t for (; childNode !== null; childNode = childNode.nextSibling) {\n\t if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n\t precacheNode(childInst, childNode);\n\t continue outer;\n\t }\n\t }\n\t // We reached the end of the DOM children without finding an ID match.\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;\n\t }\n\t inst._flags |= Flags.hasCachedChildNodes;\n\t}", "title": "" }, { "docid": "bbde94747cec73f0c5c57d24a1a7354e", "score": "0.64460886", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedHostOrTextFromComponent(childInst)._domID;\n if (childID === 0) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (shouldPrecacheNode(childNode, childID)) {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n invariant(false, 'Unable to find element with ID %s.', childID);\n }\n inst._flags |= Flags.hasCachedChildNodes;\n }", "title": "" }, { "docid": "9c9e6b1efe26f46145d4e756e9551621", "score": "0.64437914", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedNativeOrTextFromComponent(childInst)._domID;\n if (childID == null) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : invariant(false) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" }, { "docid": "9c9e6b1efe26f46145d4e756e9551621", "score": "0.64437914", "text": "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = children[name];\n var childID = getRenderedNativeOrTextFromComponent(childInst)._domID;\n if (childID == null) {\n // We're currently unmounting this child in ReactMultiChild; skip it.\n continue;\n }\n // We assume the child nodes are in the same order as the child instances.\n for (; childNode !== null; childNode = childNode.nextSibling) {\n if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {\n precacheNode(childInst, childNode);\n continue outer;\n }\n }\n // We reached the end of the DOM children without finding an ID match.\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : invariant(false) : void 0;\n }\n inst._flags |= Flags.hasCachedChildNodes;\n}", "title": "" } ]
f2c54cc094bc714b594bc89f2be45771
Pick a moment m from moments so that m[fn](other) is true for all other. This relies on the function fn to be transitive. moments should either be an array of moment objects or an array, whose first element is an array of moment objects.
[ { "docid": "a671359a7aae52888e56ffa94f16da22", "score": "0.0", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n}", "title": "" } ]
[ { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76119864", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "1049f16c74ffb30925c1b37be4084b24", "score": "0.75763077", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "52ce0dea29bc703957516ca123dbdef1", "score": "0.7552658", "text": "function pickBy(fn, moments) {\n\t\tvar res, i;\n\t\tif (moments.length === 1 && isArray(moments[0])) {\n\t\t\tmoments = moments[0];\n\t\t}\n\t\tif (!moments.length) {\n\t\t\treturn moment();\n\t\t}\n\t\tres = moments[0];\n\t\tfor (i = 1; i < moments.length; ++i) {\n\t\t\tif (moments[i][fn](res)) {\n\t\t\t\tres = moments[i];\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}", "title": "" }, { "docid": "4ce33886d9c879de52ca22a0d28b1cb7", "score": "0.7440539", "text": "function pickBy(fn, moments) {\n\t var res, i;\n\t if (moments.length === 1 && isArray(moments[0])) {\n\t moments = moments[0];\n\t }\n\t if (!moments.length) {\n\t return moment();\n\t }\n\t res = moments[0];\n\t for (i = 1; i < moments.length; ++i) {\n\t if (moments[i][fn](res)) {\n\t res = moments[i];\n\t }\n\t }\n\t return res;\n\t }", "title": "" }, { "docid": "4ce33886d9c879de52ca22a0d28b1cb7", "score": "0.7440539", "text": "function pickBy(fn, moments) {\n\t var res, i;\n\t if (moments.length === 1 && isArray(moments[0])) {\n\t moments = moments[0];\n\t }\n\t if (!moments.length) {\n\t return moment();\n\t }\n\t res = moments[0];\n\t for (i = 1; i < moments.length; ++i) {\n\t if (moments[i][fn](res)) {\n\t res = moments[i];\n\t }\n\t }\n\t return res;\n\t }", "title": "" }, { "docid": "da173bbfca46440731ae354b4509bec6", "score": "0.72959983", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.72923726", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" } ]
40775afeeb548e9e3c7cff634ba6bee5
Return a count of the total number of objects 'o' satisfying o.x == o.y. Parameter(s): objects: an array of objects with integer properties 'x' and 'y'
[ { "docid": "e3a4f3bdaea139f1b856b42487ca5e58", "score": "0.8278828", "text": "function getCount(objects) {\n var count = 0;\n for(let i=0; i<objects.length; i++){\n\n if(objects[i].x===objects[i].y){\n count++;\n }\n\n }\n return count\n}", "title": "" } ]
[ { "docid": "5ac70c843f87de02c3e84df869a7141a", "score": "0.87068814", "text": "function getCount(objects){\n // let x = {};\n // let y = {};\n //\n //\n // if(x === y){\n //\n // }\n\n let n = 0;\n for(let o of objects) {\n n += (o.x === o.y);\n }\n return n;\n\n// another solution\n// return objects.filter(function(o){return o.x==o.y}).length\n}", "title": "" }, { "docid": "0a00d1946c07cfebc4059b1bc8c3b702", "score": "0.8254485", "text": "function getCount(objects) {\n let count = 0\n objects.forEach(element => {\n if (element.x === element.y)\n count ++\n });\n\n return count\n}", "title": "" }, { "docid": "b9659b0d8fbda43fbbceafbcaad83ad3", "score": "0.8073674", "text": "function getCount(objects) {\n\n let counter = 0;\n\n objects.forEach(key => {\n if (key.x === key.y) {\n counter++;\n }\n });\n\n return counter;\n\n\n\n}", "title": "" }, { "docid": "826926fc4dddd3c36d81baae8d252069", "score": "0.80623955", "text": "function getCount(objects) {\n var ctr = 0;\n for(var i=0; i<objects.length; i++){\n if(objects[i].x == objects[i].y) {\n ctr++;\n }\n }\n return ctr;\n}", "title": "" }, { "docid": "6b223ada18fb0f583f349b3eb27c5937", "score": "0.8025641", "text": "function getCount(objects) {\n let count = 0;\n \n /*for(let i = 0; i< objects.length; i++){\n const obj = objects[i];\n if(obj.x == obj.y)\n count++;\n }\n */\n /*\n for(let i in objects){\n const o = objects[i];\n if(o.x == o.y)\n count++;\n }\n */\n //value, index, array\n /*\n objects.forEach((value, index, array) => {\n if(value.x == value.y)\n count++;\n });\n */\n /*\n objects.forEach((value, index, array) => {\n const o = array[index];\n if(o.x == o.y)\n count++;\n });\n */\n objects.forEach((value) =>{\n if(value.x == value.y)\n count++;\n })\n return count;\n}", "title": "" }, { "docid": "9684df8662a8ded89b86a5ca85ff548f", "score": "0.79952097", "text": "function getCount(objects) {\n return objects.filter(({x, y}) => x == y).length;\n}", "title": "" }, { "docid": "31fdeb7baa9c7ca7b9eec572ccca19f4", "score": "0.6673447", "text": "function count(arr, obj) {\n return (arr.filter((value) => value === obj)).length;\n}", "title": "" }, { "docid": "6c711a7de3c148a1e8c69396947da995", "score": "0.6278938", "text": "function arrCal(x,y){\n var count = 0;\n for (i = 0; i<x.length; i++){\n if(x[i]===y){\n count++;\n }\n } return count;\n}", "title": "" }, { "docid": "194717c5933f8a78fd039326ee5d8b0c", "score": "0.61598545", "text": "function totalLength(x, y) {\n var total = x.length + y.length; //any[] - array of objects of any type - since we only are considering \n return total; //length, we dont care about the type\n}", "title": "" }, { "docid": "f97a6c9324091a496508b95d3b65f1bf", "score": "0.6048241", "text": "getAdjacentMinesCount(x, y) {\n return this.mines\n .filter(isMineAdjacent(x, y))\n .length;\n }", "title": "" }, { "docid": "2cd7cca4467c595142f32a30d2ab26d9", "score": "0.5949929", "text": "numWantsMe(students) {\n let count = 0;\n for (var i = 0; i < students.length; i++) {\n if (students[i].wanted.includes(this)) {\n count++;\n };\n }\n return count;\n }", "title": "" }, { "docid": "1eeaad82b5148f9356fd81abfb4e98bb", "score": "0.5940212", "text": "function countMatches(orders) {\nvar matched = 0, dimension = orders[0].length\nwhile(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n}\nreturn matched\n}", "title": "" }, { "docid": "5def5fa1375b04874380b1a451f3f51e", "score": "0.5935359", "text": "function countVerses(obj) {var prop;var propCount = 0;for (prop in obj) {propCount++;}return propCount;}", "title": "" }, { "docid": "5def5fa1375b04874380b1a451f3f51e", "score": "0.5935359", "text": "function countVerses(obj) {var prop;var propCount = 0;for (prop in obj) {propCount++;}return propCount;}", "title": "" }, { "docid": "409623ed4d5cbbeffdac1b6e3b7e62c2", "score": "0.59273547", "text": "function count_object(object_base, fn){\n\tvar count = 0;\n\tfor(var sub in object_base){\n\t\tif(fn(sub, object_base[sub]))\n\t\t\tcount += 1;\n\t}\n\treturn count;\n}", "title": "" }, { "docid": "c44aac38bddd44679eaf61cc6c9fd121", "score": "0.5905858", "text": "function countObjectLenght(object) {\n let count = 0;\n let i;\n \n for (i in object) {\n if (object.hasOwnProperty(i)) {\n count++;\n }\n }\n return count;\n }", "title": "" }, { "docid": "4f9225ff8870eb7423035bc84e536b44", "score": "0.5903698", "text": "function countSameFriend(x, y) {\n let xx = x.map(e => e.friend.toString());\n let yy = y.map(e => e.friend.toString());\n let z = xx.filter(function (val) {\n return yy.indexOf(val) != -1;\n });\n return z.length;\n}", "title": "" }, { "docid": "caae57eeb0cdb10d176c047f267e0488", "score": "0.5880733", "text": "function countAliveSurrounding(mapArr, x, y) {\n var count = 0;\n for (var i = -1; i < 2; i++) {\n for (var j = -1; j < 2; j++) {\n\n var neighbor_x = x + i;\n var neighbor_y = y + j;\n var ij_test = (i === 0 && j === 0)\n if (neighborCountHelper(neighbor_x, neighbor_y, mapArr) && !ij_test) count++;\n }\n }\n return count;\n}", "title": "" }, { "docid": "29bfd7adb643340d42dd701281769e5b", "score": "0.5852651", "text": "function count(obj) { return Object.keys(obj).length; }", "title": "" }, { "docid": "065e31ecedf3d7fdbe8485d31a1cb989", "score": "0.5807444", "text": "function countObject( object={} ) {\n\n let totalCount = 0;\n\n for ( let i in object ) { totalCount ++; }\n\n return totalCount;\n}", "title": "" }, { "docid": "255f95fb9d6d3badbbe5e4d4aabec9e7", "score": "0.57832164", "text": "function countMatches(orders) {\r\n var matched = 0, dimension = orders[0].length\r\n while(matched < dimension) {\r\n for(var j=1; j<orders.length; ++j) {\r\n if(orders[j][matched] !== orders[0][matched]) {\r\n return matched\r\n }\r\n }\r\n ++matched\r\n }\r\n return matched\r\n}", "title": "" }, { "docid": "255f95fb9d6d3badbbe5e4d4aabec9e7", "score": "0.57832164", "text": "function countMatches(orders) {\r\n var matched = 0, dimension = orders[0].length\r\n while(matched < dimension) {\r\n for(var j=1; j<orders.length; ++j) {\r\n if(orders[j][matched] !== orders[0][matched]) {\r\n return matched\r\n }\r\n }\r\n ++matched\r\n }\r\n return matched\r\n}", "title": "" }, { "docid": "255f95fb9d6d3badbbe5e4d4aabec9e7", "score": "0.57832164", "text": "function countMatches(orders) {\r\n var matched = 0, dimension = orders[0].length\r\n while(matched < dimension) {\r\n for(var j=1; j<orders.length; ++j) {\r\n if(orders[j][matched] !== orders[0][matched]) {\r\n return matched\r\n }\r\n }\r\n ++matched\r\n }\r\n return matched\r\n}", "title": "" }, { "docid": "255f95fb9d6d3badbbe5e4d4aabec9e7", "score": "0.57832164", "text": "function countMatches(orders) {\r\n var matched = 0, dimension = orders[0].length\r\n while(matched < dimension) {\r\n for(var j=1; j<orders.length; ++j) {\r\n if(orders[j][matched] !== orders[0][matched]) {\r\n return matched\r\n }\r\n }\r\n ++matched\r\n }\r\n return matched\r\n}", "title": "" }, { "docid": "255f95fb9d6d3badbbe5e4d4aabec9e7", "score": "0.57832164", "text": "function countMatches(orders) {\r\n var matched = 0, dimension = orders[0].length\r\n while(matched < dimension) {\r\n for(var j=1; j<orders.length; ++j) {\r\n if(orders[j][matched] !== orders[0][matched]) {\r\n return matched\r\n }\r\n }\r\n ++matched\r\n }\r\n return matched\r\n}", "title": "" }, { "docid": "255f95fb9d6d3badbbe5e4d4aabec9e7", "score": "0.57832164", "text": "function countMatches(orders) {\r\n var matched = 0, dimension = orders[0].length\r\n while(matched < dimension) {\r\n for(var j=1; j<orders.length; ++j) {\r\n if(orders[j][matched] !== orders[0][matched]) {\r\n return matched\r\n }\r\n }\r\n ++matched\r\n }\r\n return matched\r\n}", "title": "" }, { "docid": "9008815deea42562c94ab8504a8650f3", "score": "0.57819355", "text": "function countObject(obj) { \n\t\t\t\tvar count = 0; \n\t\t\t\tfor(var prop in obj) { \n\t\t\t\t\tcount++; \n\t\t\t\t} \n\t\t\t\treturn count; \n\t\t\t}", "title": "" }, { "docid": "4f5320f87a3c88be5fb2892b73ff4801", "score": "0.5779328", "text": "function JSI_COUNT(objectsList, fieldsArray)\r\n{\r\n var readField = function(object, field)\r\n {\r\n return function()\r\n {\r\n try {\r\n return eval(\"this.\" + field);\r\n }\r\n catch(err) {\r\n return null\r\n }\r\n }.call(object);\r\n };\r\n var stats = {};\r\n\r\n for( var x in objectsList) {\r\n var object = objectsList[x];\r\n if(object) {\r\n var values = {};\r\n var key = \"\";\r\n for( var y in fieldsArray) {\r\n var field = fieldsArray[y];\r\n var value = readField(object, field);\r\n values[field] = value;\r\n var key = key + \"\\t\\t\\t\" + field + \"\\t\" + value;\r\n }\r\n var stat = stats[key];\r\n if(stat) {\r\n stat.count++;\r\n }\r\n else {\r\n stats[key] = {\r\n values: values,\r\n count: 1\r\n };\r\n }\r\n }\r\n }\r\n\r\n var result = [];\r\n\r\n for( var x in stats) {\r\n var stat = stats[x];\r\n var values = stat.values;\r\n values[\"$COUNT\"] = stat.count;\r\n result.push(values);\r\n }\r\n\r\n return result;\r\n}", "title": "" }, { "docid": "4fdeaae886b2bcbd61b76bb6a34222df", "score": "0.57501936", "text": "count(target, input) {\n let counter = 0;\n input.map(item => item.map(value => {\n if(value === target) {\n counter++;\n }\n }));\n return counter;\n }", "title": "" }, { "docid": "0f628f6a0a928285738fd47b7df1dff0", "score": "0.57400465", "text": "function countOccurrences(arr) {\n return arr.reduce(function(a, b){\n //console.log(a,b);\n a[b] = arr.filter(function(element){\n return element === b;\n }).length\n console.log(a,b);\n return a;\n }, {})\n }", "title": "" }, { "docid": "0661d4815ba53e085c02d593116f37b8", "score": "0.57351303", "text": "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "title": "" }, { "docid": "0661d4815ba53e085c02d593116f37b8", "score": "0.57351303", "text": "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "title": "" }, { "docid": "0661d4815ba53e085c02d593116f37b8", "score": "0.57351303", "text": "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "title": "" }, { "docid": "0661d4815ba53e085c02d593116f37b8", "score": "0.57351303", "text": "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "title": "" }, { "docid": "0661d4815ba53e085c02d593116f37b8", "score": "0.57351303", "text": "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "title": "" }, { "docid": "0661d4815ba53e085c02d593116f37b8", "score": "0.57351303", "text": "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "title": "" }, { "docid": "0661d4815ba53e085c02d593116f37b8", "score": "0.57351303", "text": "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "title": "" }, { "docid": "0661d4815ba53e085c02d593116f37b8", "score": "0.57351303", "text": "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "title": "" }, { "docid": "0661d4815ba53e085c02d593116f37b8", "score": "0.57351303", "text": "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "title": "" }, { "docid": "0661d4815ba53e085c02d593116f37b8", "score": "0.57351303", "text": "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "title": "" }, { "docid": "0661d4815ba53e085c02d593116f37b8", "score": "0.57351303", "text": "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "title": "" }, { "docid": "0661d4815ba53e085c02d593116f37b8", "score": "0.57351303", "text": "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "title": "" }, { "docid": "0661d4815ba53e085c02d593116f37b8", "score": "0.57351303", "text": "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "title": "" }, { "docid": "925b0aea3bd361dc5d63abf698c959f5", "score": "0.5717314", "text": "function sizeof(object){\n\n // initialise the list of objects and size\n var objects = [object];\n var size = 0;\n\n // loop over the objects\n for (var index = 0; index < objects.length; index ++){\n\n // determine the type of the object\n switch (typeof objects[index]){\n\n // the object is a boolean\n case 'boolean': size += 4; break;\n\n // the object is a number\n case 'number': size += 8; break;\n\n // the object is a string\n case 'string': size += 2 * objects[index].length; break;\n\n // the object is a generic object\n case 'object':\n\n // if the object is not an array, add the sizes of the keys\n if (Object.prototype.toString.call(objects[index]) != '[object Array]'){\n for (var key in objects[index]) size += 2 * key.length;\n }\n\n // loop over the keys\n for (var key in objects[index]){\n \t\t\tif (objects[index].hasOwnProperty(key)) {\n // determine whether the value has already been processed\n var processed = false;\n for (var search = 0; search < objects.length; search ++){\n if (objects[search] === objects[index][key]){\n processed = true;\n break;\n }\n }\n\n // queue the value to be processed if appropriate\n if (!processed) objects.push(objects[index][key]);\n }\n }\n\n }\n\n }\n\n // return the calculated size\n return size;\n\n}", "title": "" }, { "docid": "24600aedb345d8bfd451d5ce47500849", "score": "0.57146287", "text": "function sizeof(object) {\n // initialise the list of objects and size\r\n var objects = [ object ];\n var size = 0;\n // loop over the objects\r\n for (var index = 0; index < objects.length; index++) {\n // determine the type of the object\r\n switch (typeof objects[index]) {\n // the object is a boolean\r\n case \"boolean\":\n size += 4;\n break;\n\n // the object is a number\r\n case \"number\":\n size += 8;\n break;\n\n // the object is a string\r\n case \"string\":\n size += 2 * objects[index].length;\n break;\n\n // the object is a generic object\r\n case \"object\":\n // if the object is not an array, add the sizes of the keys\r\n if (Object.prototype.toString.call(objects[index]) != \"[object Array]\") {\n for (var key in objects[index]) size += 2 * key.length;\n }\n // loop over the keys\r\n for (var key in objects[index]) {\n // determine whether the value has already been processed\r\n var processed = false;\n for (var search = 0; search < objects.length; search++) {\n if (objects[search] === objects[index][key]) {\n processed = true;\n break;\n }\n }\n // queue the value to be processed if appropriate\r\n if (!processed) objects.push(objects[index][key]);\n }\n }\n }\n // return the calculated size\r\n return size;\n}", "title": "" }, { "docid": "54d2b84ad76507868b572058504200e4", "score": "0.5694161", "text": "function getObjectItemCount (theObject) {\n var count = 0;\n for (var prop in theObject) {\n count++;\n }\n return count;\n}", "title": "" }, { "docid": "5b59d43a8cb33351424e8c3d3a3e552c", "score": "0.56715447", "text": "function sizeof(object) {\n // initialise the list of objects and size\n var objects = [object];\n var size = 0; // loop over the objects\n\n for (var index = 0; index < objects.length; index++) {\n // determine the type of the object\n switch (_typeof(objects[index])) {\n // the object is a boolean\n case 'boolean':\n size += 4;\n break;\n // the object is a number\n\n case 'number':\n size += 8;\n break;\n // the object is a string\n\n case 'string':\n size += 2 * objects[index].length;\n break;\n // the object is a generic object\n\n case 'object':\n // if the object is not an array, add the sizes of the keys\n if (Object.prototype.toString.call(objects[index]) != '[object Array]') {\n for (var key in objects[index]) {\n size += 2 * key.length;\n }\n } // loop over the keys\n\n\n for (var key in objects[index]) {\n // determine whether the value has already been processed\n var processed = false;\n\n for (var search = 0; search < objects.length; search++) {\n if (objects[search] === objects[index][key]) {\n processed = true;\n break;\n }\n } // queue the value to be processed if appropriate\n\n\n if (!processed) objects.push(objects[index][key]);\n }\n\n }\n } // return the calculated size\n\n\n return size;\n }", "title": "" }, { "docid": "2d0d57debd9cf8144fa9ac0b8135e1c9", "score": "0.56662387", "text": "function countMatches(orders) {\r\n\t var matched = 0, dimension = orders[0].length\r\n\t while(matched < dimension) {\r\n\t for(var j=1; j<orders.length; ++j) {\r\n\t if(orders[j][matched] !== orders[0][matched]) {\r\n\t return matched\r\n\t }\r\n\t }\r\n\t ++matched\r\n\t }\r\n\t return matched\r\n\t}", "title": "" }, { "docid": "5d2d4040af9811530d56a2c3f3ee5208", "score": "0.5658361", "text": "count() {\n let n = this.objectList.length();\n\n if (this.octant) \n for (let i=0; i<this.octant.length; i++) \n n += this.octant[i].count();\n return n\n }", "title": "" }, { "docid": "d33a37c1babe0796cf711eebac442359", "score": "0.5657007", "text": "function $count(obj){\n if (!obj) return 0;\n\t\n\tswitch(typeOf(obj)){\n case 'number' : return obj; \n \n case 'function':\n return (obj+\"\").split('{')[1].test(/[\\w]+/) ? 1 : 0;\n \n case 'object' : \n if (obj['getLength']) return obj.getLength();\n \n return Object.getLength(obj);\n \n case 'window' :\n case 'document':\n case 'element' : return obj.getChildren().length;\n }\n\t\n return ((obj.length) ?\n obj.length :\n (typeOf(+obj)) ? +obj : 1);\n}", "title": "" }, { "docid": "0140798e5a0a0e8b11903d5f4b624597", "score": "0.5625185", "text": "function countCoordinates(coords) {\n const a = Array.isArray(coords);\n const b = a && Array.isArray(coords[0]);\n const c = b && Array.isArray(coords[0][0]);\n const d = c && Array.isArray(coords[0][0][0]);\n\n let length = 0;\n if (d) { // Multipolygon\n coords.forEach(polys => {\n polys.forEach(rings => length += rings.length);\n });\n } else { // Polygon\n coords.forEach(rings => length += rings.length);\n }\n return length;\n}", "title": "" }, { "docid": "8c74142e2c66a92667f549268ecccf31", "score": "0.56212616", "text": "function countMatches(orders) {\n\t var matched = 0, dimension = orders[0].length\n\t while(matched < dimension) {\n\t for(var j=1; j<orders.length; ++j) {\n\t if(orders[j][matched] !== orders[0][matched]) {\n\t return matched\n\t }\n\t }\n\t ++matched\n\t }\n\t return matched\n\t}", "title": "" }, { "docid": "30e544de0c55269566599d6e1e25e9fb", "score": "0.5600043", "text": "function countAliveNeighbours(map, x, y) {\n var count = 0\n for (var i = -1; i < 2; i++) {\n for (var j = -1; j < 2; j++) {\n var nb_x = i + x\n var nb_y = j + y\n if (i === 0 && j === 0) {}\n //If it's at the edges, consider it to be solid (you can try removing the count = count + 1)\n else if (nb_x < 0 || nb_y < 0 ||\n nb_x >= map.length ||\n nb_y >= map[0].length) {\n count = count + 1\n } else if (map[nb_x][nb_y] === solid) {\n count = count + 1\n }\n }\n }\n return count\n}", "title": "" }, { "docid": "778cd415f764c6f9fcf0a5feafb76624", "score": "0.55944437", "text": "numWantedBy(students) {\n var count = 0;\n for (var s = 0; s < students.length; s++) {\n if (this.wanted.includes(students[s])) {\n count += 1;\n }\n }\n return count\n }", "title": "" }, { "docid": "567d8707593d612f64143f2d8e6927d7", "score": "0.55924594", "text": "static countValues(array, target) {\n let count = 0;\n\n for (let i = 0; i < array.length; i++) {\n const curVal = array[i];\n if (curVal === target) {\n count++;\n }\n }\n\n return count;\n }", "title": "" }, { "docid": "7b6a02b425c461cf5312ee2f4c66cc8d", "score": "0.55899334", "text": "function countAliveNeighbours(map, x, y)\n{\n var count = 0;\n for(var i = -1; i < 2; i++){\n for(var j = -1; j < 2; j++){\n var nb_x = i+x;\n var nb_y = j+y;\n if(i == 0 && j == 0){\n }\n //If it's at the edges, consider it to be solid (you can try removing the count = count + 1)\n else if(nb_x < 0 || nb_y < 0 ||\n nb_x >= map.length ||\n nb_y >= map[0].length){\n count = count + 1; \n }\n else if(map[nb_x][nb_y] == 1){\n count = count + 1;\n }\n }\n }\n return count;\n}", "title": "" }, { "docid": "ee86e788b2f3b5afa8979421ab2c5ed1", "score": "0.558041", "text": "function getPropertyCount( _obj, _NoCountEmpty ){\n\tif( typeof _obj !== 'object' )\n\t\treturn -1;\n\t\t\n\tvar i = 0;\n\tfor( var ref in _obj ){\n\t\tif( _NoCountEmpty !== true || ref !== 'empty' )\n\t\t\ti++;\n\t}\t\n\t\t\n\treturn i;\n}", "title": "" }, { "docid": "c476c2dba5b5764cb9d2fdd806b94739", "score": "0.55777276", "text": "function countProps(obj)\n{\n var c;\n for (var prop in obj)\n ++c;\n return c;\n}", "title": "" }, { "docid": "dea67a79d8ac61d0958d236c4a5bcb5c", "score": "0.55747914", "text": "function countMatches(orders) {\n\t var matched = 0, dimension = orders[0].length;\n\t while(matched < dimension) {\n\t for(var j=1; j<orders.length; ++j) {\n\t if(orders[j][matched] !== orders[0][matched]) {\n\t return matched\n\t }\n\t }\n\t ++matched;\n\t }\n\t return matched\n\t}", "title": "" }, { "docid": "b93bb68463e49b681fb4d30f76d8a778", "score": "0.55738664", "text": "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length;\n while (matched < dimension) {\n for (var j = 1; j < orders.length; ++j) {\n if (orders[j][matched] !== orders[0][matched]) {\n return matched;\n }\n }\n ++matched;\n }\n return matched;\n }", "title": "" }, { "docid": "e9bea5422b33ecfd8c02f1abd0c76945", "score": "0.556105", "text": "count(m_data, label) {\n let cnt = 0;\n for (let i = 0; i < m_data.length; i++) {\n let e = m_data[i];\n if (e.label == label) {\n cnt++;\n }\n }\n return cnt;\n }", "title": "" }, { "docid": "e9bea5422b33ecfd8c02f1abd0c76945", "score": "0.556105", "text": "count(m_data, label) {\n let cnt = 0;\n for (let i = 0; i < m_data.length; i++) {\n let e = m_data[i];\n if (e.label == label) {\n cnt++;\n }\n }\n return cnt;\n }", "title": "" }, { "docid": "227a3af5ae9bbc6b9f179a92786b11b4", "score": "0.55308485", "text": "getNumberOfViolencePlanets(sortedQuotients){\n\t\tlet numberOfViolenceObjects = 0,\n\t\t\tthat =this;\n\t\tsortedQuotients.forEach(function(stateObject){\n\t\t\tif(stateObject.quotient > that.groupSplitter){\n\t\t\t\tnumberOfViolenceObjects++;\n\t\t\t}\n\t\t});\n\t\treturn numberOfViolenceObjects;\n\t}", "title": "" }, { "docid": "17612cd53beae208939efe6bf856497b", "score": "0.55278057", "text": "function countOccurrences(arr) {\n return arr.reduce((a, b) => {\n a[b] = arr.filter(element => element === b).length;\n return a;\n }, {})\n }", "title": "" }, { "docid": "3d3857a156a24fa0ec0ba45ce96a9cfb", "score": "0.5516197", "text": "function getCount() {\n return filtered_refrence_objects.length;\n }", "title": "" }, { "docid": "da614f9bd317025d9e550cc985e75d84", "score": "0.5508823", "text": "function len(obj) {\n\t var count = 0;\n\t for (var p in obj) {\n\t count ++;\n\t }\n\t return count;\n\t}", "title": "" }, { "docid": "bb7fe3d87e86208df8a5c980a1d787a7", "score": "0.5507386", "text": "function task2() {\n const countProps = obj => Object.keys(obj).length;\n // const countProps = function(obj) {\n // const objKeys = Object.keys(obj);\n // const quantity = objKeys.length;\n // return quantity;\n // };\n\n console.log(countProps({})); // 0\n console.log(countProps({ name: 'Mango', age: 2 })); // 2\n console.log(\n countProps({ mail: '[email protected]', isOnline: true, score: 500 }),\n ); // 3\n}", "title": "" }, { "docid": "c7a75e12a057efda816ab1fd9718a242", "score": "0.5496838", "text": "function count(obj) {\n\n if (obj.__count__ !== undefined) { // Old FF\n return obj.__count__;\n }\n\n if (Object.keys) { // ES5 \n return Object.keys(obj).length;\n }\n\n // Everything else:\n\n var c = 0, p;\n for (p in obj) {\n if (obj.hasOwnProperty(p)) {\n c += 1;\n }\n }\n\n return c;\n\n}", "title": "" }, { "docid": "a8de52e6fe530ddd0de8ff8fad102240", "score": "0.54928654", "text": "function countOccurrences(arr) {\n return arr.reduce(function(a, b){\n console.log(a,b);\n a[b] = arr.filter(function(element){\n return element === b;\n }).length;\n console.log(a,b);\n return a;\n }, {})\n //console.log(a[b]);\n }", "title": "" }, { "docid": "c2d74fce565dfae7fab232e4d81916d1", "score": "0.5477729", "text": "function countApplesAndOranges(s, t, a, b, apples, oranges) {\n let house = [s, t],\n houseLeft = s,\n houseRight = t,\n appleTree = a,\n orangeTree = b,\n appleIside = 0,\n orangeInside = 0;\n\n apples.map(apple => {\n let applesLocation = appleTree + apple;\n if (houseLeft <= applesLocation && applesLocation <= houseRight) {\n return appleIside++;\n }\n });\n\n oranges.map(orange => {\n let orangesLocation = orangeTree + orange;\n if (houseLeft <= orangesLocation && orangesLocation <= houseRight) {\n return orangeInside++;\n }\n });\n\n console.log(appleIside);\n console.log(orangeInside);\n}", "title": "" }, { "docid": "f5d26046e09b66c93e109b58e6c32a97", "score": "0.54606044", "text": "function findOcurrences(array){\n // flatten out the array\n var flat = array.reduce(function(carry, item){\n // This allows us to append either a value or an array without fuss\n return carry.concat(item);\n }, []);\n \n // count the ocurrences\n return flat.reduce(function(carry, item){\n carry[item] = (carry[item] || 0) + 1;\n return carry;\n }, {});\n}", "title": "" }, { "docid": "5a9ac9b62e051bb24bd7f8fab383fb48", "score": "0.54575926", "text": "function countNeighbors(grid, x, y) {\n var count = 0;\n for (var y1 = Math.max(0, y - 1); y1 <= Math.min(height - 1, y + 1); y1++) {\n for (var x1 = Math.max(0, x - 1); x1 <= Math.min(width - 1, x + 1); x1++) {\n if ((x1 != x || y1 != y) && grid[x1 + y1 * width])\n count += 1;\n }\n }\n return count;\n }", "title": "" }, { "docid": "66e43b8928f8785a715abc7605cd34c0", "score": "0.5446197", "text": "function trioWins() {\n var trioWinsArray = [];\n trioWinObjects(trioWinsArray);\n for (var i = 0; i < rolls.length; i++) {\n //console.log(rolls[i]);\n for (var j = 0; j < trioWinsArray.length; j++) {\n if (trioWinsArray[j].nums.includes(rolls[i])) {\n trioWinsArray[j].hits++;\n }\n }\n }\n \n for (var k = 0; k < trioWinsArray.length; k++) {\n //console.log(trioWinsArray[k].name + \" \" + \" \" + trioWinsArray[k].hits);\n }\n}", "title": "" }, { "docid": "00606a05cbd45d378690410ee0b9aa08", "score": "0.5437626", "text": "function lengthOfObject(object){\n let count = 0;\n for (prop in Object.keys(object)){\n count +=1;\n }\n return count;\n}", "title": "" }, { "docid": "7256c7353b036e57975e6c6d0970b757", "score": "0.5435979", "text": "function count(obj) {\n if (obj.__count__ !== undefined) { // Old FF\n return obj.__count__;\n }\n\n if (Object.keys) { // ES5\n return Object.keys(obj).length;\n }\n\n // Everything else:\n let c = 0, p;\n for (p in obj) {\n if (obj.hasOwnProperty(p)) {\n c += 1;\n }\n }\n return c;\n}", "title": "" }, { "docid": "71b6c5eb70de1e6a2d6c0d3e3200b94d", "score": "0.5429627", "text": "function getMemberCount(object){\r\n member_count = 0;\r\n\r\n if(typeof object == \"object\"){\r\n for (item in object){\r\n member_count += 1;\r\n }\r\n }\r\n\r\n return member_count;\r\n}", "title": "" }, { "docid": "04c8b5b5b993e303cacf1a84c667df35", "score": "0.54260164", "text": "function solve(a,b){\n let arr = [];\n for (var idx = 0; idx < b.length; idx++){\n var count = 0;\n a.forEach((v) => (v === b[idx] && count++));\n arr.push(count);\n }\n return arr;\n}", "title": "" }, { "docid": "23ddfa346d9fb310dcbf7bc055b86cd6", "score": "0.54248524", "text": "function sumPoints() {\n const wins = question => question.status == 1;\n return collection.filter(wins).length;\n }", "title": "" }, { "docid": "ba0788a5a1cd7ea42a4df78361f07ba0", "score": "0.542433", "text": "function countProperties(object){\n return getKeys(object).length;\n}", "title": "" }, { "docid": "dcc648d17cd4aeb04f1141928e1641d6", "score": "0.5417395", "text": "function countLength(obj)\r\n{\r\n var count = 0;\r\n for(var prop in obj)\r\n {\r\n if(obj.hasOwnProperty(prop))\r\n {\r\n count++;\r\n }\r\n }\r\n return count;\r\n}", "title": "" }, { "docid": "f07773b3f0b854c57e437b4eedad40e8", "score": "0.5412515", "text": "function countNumberOfPropiertiesOfObject(myObject){\n\tvar countOfProperties = 0;\n\tfor(var prop in myObject){\n\t\tcountOfProperties++;\n\t}\n\tconsole.log(countOfProperties);\n}", "title": "" }, { "docid": "b0206770c4d2c90704481f5b4f5e4153", "score": "0.5411626", "text": "function cornerWins() {\n cornerWinsArray = [];\n\n cornerWinObjects(cornerWinsArray);\n for (var i = 0; i < rolls.length; i++) {\n //console.log(rolls[i]);\n for (var j = 0; j < cornerWinsArray.length; j++) {\n if (cornerWinsArray[j].nums.includes(rolls[i])) {\n cornerWinsArray[j].hits++;\n }\n }\n }\n for (var k = 0; k < cornerWinsArray.length; k++) {\n //console.log(cornerWinsArray[k].name + \" \" + \" \" + cornerWinsArray[k].hits);\n }\n}", "title": "" }, { "docid": "44f2372f85cfad5b802c00965b3da0fd", "score": "0.5410109", "text": "function countSize(obj) {\n var size = 0, key;\n for (key in obj) {\n if (obj.hasOwnProperty(key)) size++;\n }\n return size;\n }", "title": "" }, { "docid": "595d31977f89efd7713de40ef70d0c10", "score": "0.5405576", "text": "function occurence(arr, x){\r\n let i=0;\r\n let count = 0;\r\n for(i=0; i<arr.length; i++){\r\n if (arr[i] == x){\r\n count +=1;\r\n }\r\n }\r\n return count;\r\n}", "title": "" }, { "docid": "e383540d8da6d62fd6ac03383a2d38d7", "score": "0.53968984", "text": "function len (o) {\n var count = 0;\n for (i in o) count++;\n return count;\n}", "title": "" }, { "docid": "57a152338c6bcbdadcf438a257eed9bb", "score": "0.5388605", "text": "countNeighbors(board, x, y) {\n let neighbors = 0;\n const dirs = [[-1, -1], [-1, 0], [-1, 1], [0, 1], [1, 1], [1, 0], [1, -1], [0, -1]];\n for( let i = 0; i < dirs.length; i++) {\n const dir = dirs[i];\n let y1 = y + dir[0];\n let x1 = x + dir[1];\n\n if( x1 >= 0 && x1 < this.state.cols && y1 >= 0 && y1 < this.state.rows && board[y1][x1]) {\n neighbors++;\n }\n }\n return neighbors;\n }", "title": "" }, { "docid": "eb3d21d4363e337473df7654f5afc65d", "score": "0.5379632", "text": "function getBooksBorrowedCount(books) {\n let result = 0;\n for(let i = 0; i < books.length; i++){\n const borrows = books[i].borrows;\n const isBookOut = borrows.some(instance => !instance.returned);\n if(isBookOut){\n result++;\n }\n }\n return result;\n}", "title": "" }, { "docid": "8811aa12901d541422cf3fad427078e7", "score": "0.53773654", "text": "function count_neighbors(x, y) {\r\n sum = 0\r\n if(x - 1 >= 0) {\r\n if(y - 1 >= 0) sum += g[y - 1][x - 1]\r\n sum += g[y][x - 1]\r\n if(y + 1 < g.length) sum += g[y + 1][x - 1]\r\n }\r\n\r\n if(x + 1 < g[0].length) {\r\n if(y - 1 >= 0) sum += g[y - 1][x + 1]\r\n sum += g[y][x + 1]\r\n if(y + 1 < g.length) sum += g[y + 1][x + 1]\r\n }\r\n\r\n if(y - 1 >= 0) sum += g[y - 1][x]\r\n if(y + 1 < g.length) sum += g[y + 1][x]\r\n\r\n return sum\r\n}", "title": "" }, { "docid": "e1a1b683f7b1559cfecf32bb58b4e7de", "score": "0.5370127", "text": "function count(layer,val){\n return _.sum(layer.map(x=>x==val?1:0));\n}", "title": "" }, { "docid": "ecb6487c03ff9db5b48dd103a05edbea", "score": "0.53647274", "text": "function countScore(){\r\n\tif(player.x == obstacle.x + obstacle.w)\r\n\t{\r\n\t\tscore++;\r\n\t}\r\n\r\n\tif(player.x == obstacle2.x + obstacle2.w)\r\n\t{\r\n\t\tscore++;\r\n\t}\r\n\r\n\tif(player.x == obstacle3.x + obstacle3.w)\r\n\t{\r\n\t\tscore++;\r\n\t}\r\n}", "title": "" }, { "docid": "52658c5d51498b91570b98a63fc2636e", "score": "0.5357212", "text": "function countProperties(obj) {\n var prop;\n var propCount = 0;\n\n for (prop in obj) {\n\tpropCount++;\n }\n return propCount;\n}", "title": "" }, { "docid": "7f4db713420f45fa4c1d08caf45d856b", "score": "0.5354517", "text": "function getBooksBorrowedCount1(books) {\n let total = 0\n for (let book of books) {\n for (let borrowed of book.borrows)\n if (borrowed.returned === false)\n total++\n }\n return total\n}", "title": "" }, { "docid": "5909e1830eb9abda1d17f0e913279f83", "score": "0.5354432", "text": "function encontrarModa (lista){\r\n\r\n const object = arrayObject(lista);\r\n\r\n const moda = arrayCount1(object);\r\n\r\n console.log(moda);\r\n\r\n}", "title": "" }, { "docid": "40d3ff6623699190a74681b4e511ed95", "score": "0.5353253", "text": "function objectSize(obj) {\n var x;\n var count=0;\n if (obj == null || typeof(obj) == 'undefined') {\n return 0;\n }\n if(typeof(obj.hasOwnProperty)!='function' && typeof(obj.length)!='undefined'){\n return obj.length;\n }\n for (x in obj) {\n if (obj.hasOwnProperty(x)) {\n count++;\n }\n }\n return count;\n}", "title": "" }, { "docid": "c216c10f8fe976266a0269107b1890b7", "score": "0.5352934", "text": "function totalAmountAdjectives(obj) {\n return Object.keys(obj).length;\n }", "title": "" }, { "docid": "b00824f8c3ebbb5343c95fd3cee388eb", "score": "0.5345986", "text": "function compare(obj1, obj2) {\n let values1 = Object.values(obj1);\n let values2 = Object.values(obj2);\n let count = 0;\n values1.forEach((thing, i) => {\n if (thing === values2[i]) {\n count++;\n }\n });\n if (count === 3) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "bc990170cc25b097427d7ed67cb84944", "score": "0.5342882", "text": "function countStudentsFromHouse(house) {\n return activeList.filter(x => x.house === house).length;\n}", "title": "" }, { "docid": "59dd3cf9124de89ed1104a52afc312c2", "score": "0.5340736", "text": "function getDuplicateCount(x, numbers) {\n let count = 0\n for (let i = 0; i < numbers.length; i++){\n if (numbers[i] == x){\n count++\n }\n }\n return count\n}", "title": "" }, { "docid": "28391f236aaaff07aa7c780641739a95", "score": "0.53393704", "text": "function histo(obj, returnTuples) {\n\tvar obj1 = {},\n\t\tlength = obj.length;\n\tfor (var i = 0; i < length; ++i) {\n\t\tif (i in obj) {\n\t\t\tvar item = obj[i];\n\t\t\tif (item in obj1) {\n\t\t\t\t++obj1[item];\n\t\t\t} else {\n\t\t\t\tobj1[item] = 1;\n\t\t\t}\n\t\t}\n\t}\n\tif (returnTuples) {\n\t\tvar ret = [];\n\t\tfor (var key in obj1) {\n\t\t\tret.push([key, obj1[key]]);\n\t\t}\n\t\treturn ret;\n\t} else {\n\t\treturn obj1;\n\t}\n}", "title": "" }, { "docid": "109794299fed1fd2f08d5e908114793f", "score": "0.5336124", "text": "function count(array, elem) {\n return countWhere(array, function(x) {\n return elem == x\n });\n}", "title": "" } ]
5af7a0e847e952069babdc5fdb3464a5
this is terrible but golly datetime formating in here is ultra complicated. Ain't nobody got time for that.
[ { "docid": "ef491dfa0ff6adf50a20e7b8b8084d72", "score": "0.0", "text": "function reallyLazyDateRangeFormatFix(dwithf) {\n const datesArr = dwithf.toString().split(\" — \");\n const dateObj = new Date(datesArr[0]);\n return dateObj.getMonth() + 1 + \"/\" + dateObj.getDate();\n}", "title": "" } ]
[ { "docid": "4ed789ea156a066a27cc4c977b3d8614", "score": "0.7360345", "text": "function FormatDateTime(dateTimeFormat,x){var parts=CreateDateTimeParts(dateTimeFormat,x);var result='';for(var i=0;parts.length>i;i++){var part=parts[i];result+=part.value;}return result;}", "title": "" }, { "docid": "f2c3618fdda0d1b0d1f2b190e31d1d63", "score": "0.68275934", "text": "function DataTimeFormatting(inputdate)\r\n{\r\n var date=inputdate.split('T')[0]\r\n date=date.split('-')[1]+\"/\"+date.split('-')[2]+\"/\"+date.split('-')[0]\r\n if(inputdate.split('T')[1].includes('+'))\r\n {\r\n var time=inputdate.split('T')[1].split('+')[0]\r\n time=time.split(':')[0]+\":\"+time.split(':')[1]\r\n }\r\n else\r\n {\r\n var time=inputdate.split('T')[1].split('-')[0]\r\n time=time.split(':')[0]+\":\"+time.split(':')[1]\r\n }\r\n \r\n return date+\" \"+time;\r\n}", "title": "" }, { "docid": "4db1d3cb269c2685f124151c996400fe", "score": "0.6803092", "text": "function render_datetime(data){\n\t\tif (data == \"\" || data === undefined)\n\t\t\treturn \"\";\n\t var datetime = data.split(' ');\n\t var date = datetime[0].split('-').reverse().join('/');\n\t var time = datetime[1].substring(0,5);\n\t return date+' às '+time;\n\t}", "title": "" }, { "docid": "4db1d3cb269c2685f124151c996400fe", "score": "0.6803092", "text": "function render_datetime(data){\n\t\tif (data == \"\" || data === undefined)\n\t\t\treturn \"\";\n\t var datetime = data.split(' ');\n\t var date = datetime[0].split('-').reverse().join('/');\n\t var time = datetime[1].substring(0,5);\n\t return date+' às '+time;\n\t}", "title": "" }, { "docid": "4f2a73117894f66fe62e1005e4fe1343", "score": "0.67579514", "text": "_formatDate(date) {\n\t const dateString = date.slice(0, 10);\n\t const timeString = date.slice(11, 19);\n\t return dateString + \" \" + timeString;\n }", "title": "" }, { "docid": "af9f9ef74ea42cb5f63f30abd13685e3", "score": "0.6744788", "text": "function formatDateTime(d)\n {\n var result = d.getFullYear()+'-'+Expand(d.getMonth()+1,2)+'-'+Expand(d.getDate(),2)+'--'+\n Expand(d.getHours(),2)+'-'+Expand(d.getMinutes(), 2)+'-'+Expand(d.getSeconds(),2);\n return result;\n }", "title": "" }, { "docid": "05179b6c6c8e2f2a4968e6f5b411b4b6", "score": "0.6722635", "text": "function pretty_datetime(mysql_date,justdate,justshort) {\n\tif ( mysql_date != null && mysql_date != \"\") {\n\t\tvar t \t\t \t= mysql_date.split(/[- :]/);\n\t\tvar timething\t= \"AM\";\n\t\tt[3] \t\t\t= parseInt(t[3]);\n\t\tif ( t[3] > 11 ) { timething = \"PM\"; }\n\t\tif ( t[3] > 12 ) { t[3] = t[3] - 12; }\n\t\t\n\t\tif ( justdate && justshort ) {\n\t\t\tvar new_date = t[1]+\"-\"+t[2]+\"-\"+t[0].substring(2,4);\n\t\t} else if ( justdate ) {\n\t\t\tvar new_date = t[1]+\"-\"+t[2]+\"-\"+t[0];\n\t\t} else if ( justshort ) {\n\t\t\tvar new_date = t[1]+\"-\"+t[2]+\"-\"+t[0].substring(2,4)+\" \"+t[3]+\":\"+t[4]+\" \"+timething;\n\t\t} else {\n\t\t\tvar new_date = t[1]+\"-\"+t[2]+\"-\"+t[0]+\" \"+t[3]+\":\"+t[4]+\" \"+timething;\n\t\t}\n\t\t\n\t\treturn new_date;\n\t} else { return \"\"; }\n}", "title": "" }, { "docid": "ab45ae1eeed640895f9179ebea9bfd68", "score": "0.67054886", "text": "formatApiDateTime(DateTime){\n var date = DateTime.slice(0,10),\n time = DateTime.slice(11,16);\n return date.replace(/-/g,\"/\") + \" \" + time;\n }", "title": "" }, { "docid": "1e4882f33644a801a28907d5566f1cb4", "score": "0.6669809", "text": "function dt2dtstr (dt_datetime) {\n var FormatedDate=\"\"\n \n FormatedDate+=(dt_datetime.getDate().toString().length==1)?\"0\"+dt_datetime.getDate().toString():dt_datetime.getDate().toString();\n FormatedDate+=\"/\";\n FormatedDate+=((dt_datetime.getMonth()+1).toString().length==1)?\"0\"+(dt_datetime.getMonth()+1).toString():(dt_datetime.getMonth()+1).toString();\n FormatedDate+=\"/\";\n FormatedDate+=\"20\"+dt_datetime.getFullYear().toString().substring(dt_datetime.getFullYear().toString().length-2,dt_datetime.getFullYear()).toString()\n return FormatedDate;\n}", "title": "" }, { "docid": "534f39860f52e8124ea12dca0f177296", "score": "0.6667132", "text": "formatTime(date) { return this.formatDate(date,null,false,true) }", "title": "" }, { "docid": "5a98b10849a1ad62aad0fe2f6faa2156", "score": "0.65552837", "text": "function formatDateTime(value, format) {\n var index = 0;\n var output = \"\";\n var ampm = format.contains(\"AM/PM\");\n var hours = 0;\n var date;\n if (!(value instanceof Date)) {\n date = new Date(value);\n }\n else {\n date = value;\n }\n while (index < format.length) {\n var fmt = format.substr(index);\n if (fmt.startsWith(\"mmmm\")) {\n //---- full month name ----\n var str = monthNames[date.getMonth()];\n output += str;\n index += 4;\n }\n else if (fmt.startsWith(\"mmm\")) {\n //---- 3 letter month abbreviaton ----\n var str = monthAbbrevs[date.getMonth()];\n output += str;\n index += 3;\n }\n else if (fmt.startsWith(\"mm\")) {\n //---- 2 digit minutes ----\n var str = N2(date.getMinutes());\n output += str;\n index += 2;\n }\n else if (fmt.startsWith(\"m\")) {\n //---- 1-2 digit day month number (1-relative) ----\n var str = (date.getMonth() + 1) + \"\";\n output += str;\n index += 1;\n }\n else if (fmt.startsWith(\"q\")) {\n //---- 1 digit QUARTER number (1-relative) ----\n var str = (Math.floor(date.getMonth() / 3) + 1) + \"\";\n output += str;\n index += 1;\n }\n else if (fmt.startsWith(\"dddd\")) {\n //---- full day of week ----\n var str = dayNames[date.getDay()];\n output += str;\n index += 4;\n }\n else if (fmt.startsWith(\"ddd\")) {\n //---- 3 letter day abbreviaton ----\n var str = dayAbbrevs[date.getDay()];\n output += str;\n index += 3;\n }\n else if (fmt.startsWith(\"dd\")) {\n //---- 2 digit day-of-month ----\n var str = N2(date.getDate());\n output += str;\n index += 2;\n }\n else if (fmt.startsWith(\"d\")) {\n //---- 1-2 digit day of month ----\n var str = date.getDate() + \"\";\n output += str;\n index += 1;\n }\n else if (fmt.startsWith(\"yyyy\")) {\n //---- 4 digit year ----\n var str = date.getFullYear() + \"\";\n output += str;\n index += 4;\n }\n else if (fmt.startsWith(\"yy\")) {\n //---- 2 digit year----\n var str = (date.getFullYear() + \"\").substr(2); // drop first 2 chars\n output += str;\n index += 3;\n }\n else if (fmt.startsWith(\".0\")) {\n //---- milliseconds as fraction ----\n var str = (date.getMilliseconds() / 1000) + \"\";\n output += str;\n index += 2;\n }\n else if (fmt.startsWith(\"ss\")) {\n //---- 2 digit seconds ----\n var str = N2(date.getSeconds());\n output += str;\n index += 2;\n }\n else if (fmt.startsWith(\"s\")) {\n //---- 1-2 digit seconds ----\n var str = date.getSeconds() + \"\";\n output += str;\n index += 1;\n }\n else if (fmt.startsWith(\"hh\")) {\n //---- 2 digit hours ----\n hours = date.getHours();\n var hrs = getHours(hours, ampm);\n var str = N2(hrs);\n output += str;\n index += 2;\n }\n else if (fmt.startsWith(\"h\")) {\n //---- 1-2 digit hours ----\n hours = date.getHours();\n var hrs = getHours(hours, ampm);\n var str = hrs + \"\";\n output += str;\n index += 1;\n }\n else if (fmt.startsWith(\"AM/PM\")) {\n //---- AM/PM indicator ----\n var str = (hours > 11) ? \"PM\" : \"AM\";\n output += str;\n index += 5;\n }\n else {\n //---- copy a literal char ----\n output += fmt[0];\n index += 1;\n }\n }\n return output;\n }", "title": "" }, { "docid": "f3bdcc12db5a1f2a0ff6e463fc4c209b", "score": "0.65496284", "text": "function getPrettyDateTime() {\n var rawDate = new Date();\n // PRETTY HOURS\n var date = lessThanTen(rawDate.getDate());\n var month = lessThanTen(rawDate.getMonth()+1); \n var hours = lessThanTen(rawDate.getHours());\n var minutes = lessThanTen(rawDate.getMinutes());\n var seconds = lessThanTen(rawDate.getSeconds());\n\n var datetime = \"\" + date + \"/\"\n + month + \"/\" \n + rawDate.getFullYear() + \" at \" \n + hours + \":\" \n + minutes + \":\" \n + seconds;\n return datetime;\n}", "title": "" }, { "docid": "3e7943c99f87bd695686e0205637137d", "score": "0.6509965", "text": "function FormatDateTime(dateTimeFormat, x) {\n\t var parts = CreateDateTimeParts(dateTimeFormat, x);\n\t var result = '';\n\t\n\t for (var i = 0; parts.length > i; i++) {\n\t var part = parts[i];\n\t result += part.value;\n\t }\n\t return result;\n\t}", "title": "" }, { "docid": "1168f39511d318372a8f3389e0d726e0", "score": "0.6472385", "text": "function t(e,t,a){var n=\" \";return(e%100>=20||e>=100&&e%100==0)&&(n=\" de \"),e+n+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[a]}", "title": "" }, { "docid": "47e0487f4c26056be2a08a6509cd3676", "score": "0.64708084", "text": "function formatDate(date, format) {\n format = format + \"\";\n var result = \"\";\n var i_format = 0;\n var c = \"\";\n var token = \"\";\n var y = date.getYear() + \"\";\n var M = date.getMonth() + 1;\n var d = date.getDate();\n var E = date.getDay();\n var H = date.getHours();\n var m = date.getMinutes();\n var s = date.getSeconds();\n var yyyy, yy, MMM, MM, dd, hh, h, mm, ss, ampm, HH, H, KK, K, kk, k;\n // Convert real date parts into formatted versions\n var value = new Object();\n if (y.length < 4) { y = \"\" + (y - 0 + 1900); }\n value[\"y\"] = \"\" + y;\n value[\"yyyy\"] = y;\n value[\"yy\"] = y.substring(2, 4);\n value[\"M\"] = M;\n value[\"MM\"] = LZ(M);\n value[\"MMM\"] = MONTH_NAMES[M - 1];\n value[\"NNN\"] = MONTH_NAMES[M + 11];\n value[\"d\"] = d;\n value[\"dd\"] = LZ(d);\n value[\"E\"] = DAY_NAMES[E + 7];\n value[\"EE\"] = DAY_NAMES[E];\n value[\"H\"] = H;\n value[\"HH\"] = LZ(H);\n if (H == 0) { value[\"h\"] = 12; }\n else if (H > 12) { value[\"h\"] = H - 12; }\n else { value[\"h\"] = H; }\n value[\"hh\"] = LZ(value[\"h\"]);\n if (H > 11) { value[\"K\"] = H - 12; } else { value[\"K\"] = H; }\n value[\"k\"] = H + 1;\n value[\"KK\"] = LZ(value[\"K\"]);\n value[\"kk\"] = LZ(value[\"k\"]);\n if (H > 11) { value[\"a\"] = \"PM\"; }\n else { value[\"a\"] = \"AM\"; }\n value[\"m\"] = m;\n value[\"mm\"] = LZ(m);\n value[\"s\"] = s;\n value[\"ss\"] = LZ(s);\n while (i_format < format.length) {\n c = format.charAt(i_format);\n token = \"\";\n while ((format.charAt(i_format) == c) && (i_format < format.length)) {\n token += format.charAt(i_format++);\n }\n if (value[token] != null) { result = result + value[token]; }\n else { result = result + token; }\n }\n return result;\n}", "title": "" }, { "docid": "b5fd41cac5d7af9f33869f9f2d472fee", "score": "0.64628863", "text": "function std_datetime(date) {\n return dateformat(date, 'yyyy-mm-dd hh:MM:ss')\n}", "title": "" }, { "docid": "2d6905aace65c7d9364b140f442ffed0", "score": "0.64548707", "text": "function datetimeString(d) {\n\treturn dateString(d) + ' ' + timeString(d)\n}", "title": "" }, { "docid": "a6550669b2b88528c15a3993aec231ab", "score": "0.6442213", "text": "function xFormDateTime(datetime) {\n var results;\n var tokens1;\n var tokens2;\n var tokens3;\n var tokens4;\n results = \"\";\n tokens1 = new Array();\n tokens1 = datetime.split('T');\n results = tokens1[0];\n tokens2 = new Array();\n tokens2 = tokens1[1].split('.');\n results = results + \" \" + tokens2[0]; \n return results;\n}", "title": "" }, { "docid": "0b9605e426f9a8a8511b1ea26c4b8ac7", "score": "0.64282537", "text": "_format(dtf, date) {\r\n const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\r\n return dtf.format(d);\r\n }", "title": "" }, { "docid": "6c2d91944716ece39376907cdd56da7b", "score": "0.6427437", "text": "function formatDate(dt){\n // Function for splitting date from ES-style format to human readable time/date\n var time, date;\n var df, dfor;\n time = dt.split('T')[1];\n date = dt.split('T')[0];\n\n df = date.split('-');\n dfor = df[2] + '/' + df[1] + '/' + df[0];\n\n return time + ' ' + dfor;\n}", "title": "" }, { "docid": "b7115577add62f5fb2b7422ce90fd3a9", "score": "0.64225584", "text": "function formatDateTime() {\n var date = new Date();\n var year = date.getFullYear();\n /* 在日期格式中,月份是从0开始的,因此要加0\n * 使用三元表达式在小于10的前面加0,以达到格式统一 如 09:11:05\n * */\n var month = date.getMonth() + 1 < 10 ? \"0\" + (date.getMonth() + 1) : date.getMonth() + 1;\n var day = date.getDate() < 10 ? \"0\" + date.getDate() : date.getDate();\n var hours = date.getHours() < 10 ? \"0\" + date.getHours() : date.getHours();\n var minutes = date.getMinutes() < 10 ? \"0\" + date.getMinutes() : date.getMinutes();\n var seconds = date.getSeconds() < 10 ? \"0\" + date.getSeconds() : date.getSeconds();\n // 拼接\n // noinspection JSAnnotator\n return year + \"-\" + month + \"-\" + day + \" \" + hours + \":\" + minutes + \":\" + seconds;\n}", "title": "" }, { "docid": "28eb85457893642989710c6471588019", "score": "0.641669", "text": "function formatDate(d) {\n if (d === undefined){\n d = (new Date()).toISOString()\n }\n let currDate = new Date(d);\n let year = currDate.getFullYear();\n let month = currDate.getMonth() + 1;\n let dt = currDate.getDate();\n let time = currDate.toLocaleTimeString('en-SG')\n\n if (dt < 10) {\n dt = '0' + dt;\n }\n if (month < 10) {\n month = '0' + month;\n }\n\n return dt + \"/\" + month + \"/\" + year + \" \" + time ;\n \n }", "title": "" }, { "docid": "d18e15d86775b8156624b5ccfa4bcc1c", "score": "0.64052236", "text": "function formatDateTime(dateField) {\n if (dateField) {\n //return moment(dateField).format('MM/DD/YYYY h:mm:ss a');\n return moment(dateField).format('MM/DD/YYYY HH:mm:ss');\n } else {\n return dateField;\n }\n }", "title": "" }, { "docid": "f4f53b8e819530ca9dba4864ad0568b8", "score": "0.6398306", "text": "function DateTimeBeautify(date){\n return DateBeautify(date) + ' ' + TimeBeautify(date);\n}", "title": "" }, { "docid": "9b79defd67047c4ba0a74b8fd7adf6a8", "score": "0.6385953", "text": "function createDateTimeFormats(formats){var availableFormats=formats.availableFormats;var timeFormats=formats.timeFormats;var dateFormats=formats.dateFormats;var result=[];var skeleton=void 0,pattern=void 0,computed=void 0,i=void 0,j=void 0;var timeRelatedFormats=[];var dateRelatedFormats=[];// Map available (custom) formats into a pattern for createDateTimeFormats\nfor(skeleton in availableFormats){if(availableFormats.hasOwnProperty(skeleton)){pattern=availableFormats[skeleton];computed=createDateTimeFormat(skeleton,pattern);if(computed){result.push(computed);// in some cases, the format is only displaying date specific props\n// or time specific props, in which case we need to also produce the\n// combined formats.\nif(isDateFormatOnly(computed)){dateRelatedFormats.push(computed);}else if(isTimeFormatOnly(computed)){timeRelatedFormats.push(computed);}}}}// Map time formats into a pattern for createDateTimeFormats\nfor(skeleton in timeFormats){if(timeFormats.hasOwnProperty(skeleton)){pattern=timeFormats[skeleton];computed=createDateTimeFormat(skeleton,pattern);if(computed){result.push(computed);timeRelatedFormats.push(computed);}}}// Map date formats into a pattern for createDateTimeFormats\nfor(skeleton in dateFormats){if(dateFormats.hasOwnProperty(skeleton)){pattern=dateFormats[skeleton];computed=createDateTimeFormat(skeleton,pattern);if(computed){result.push(computed);dateRelatedFormats.push(computed);}}}// combine custom time and custom date formats when they are orthogonals to complete the\n// formats supported by CLDR.\n// This Algo is based on section \"Missing Skeleton Fields\" from:\n// http://unicode.org/reports/tr35/tr35-dates.html#availableFormats_appendItems\nfor(i=0;i<timeRelatedFormats.length;i+=1){for(j=0;j<dateRelatedFormats.length;j+=1){if(dateRelatedFormats[j].month==='long'){pattern=dateRelatedFormats[j].weekday?formats.full:formats.long;}else if(dateRelatedFormats[j].month==='short'){pattern=formats.medium;}else{pattern=formats.short;}computed=joinDateAndTimeFormats(dateRelatedFormats[j],timeRelatedFormats[i]);computed.originalPattern=pattern;computed.extendedPattern=pattern.replace('{0}',timeRelatedFormats[i].extendedPattern).replace('{1}',dateRelatedFormats[j].extendedPattern).replace(/^[,\\s]+|[,\\s]+$/gi,'');result.push(computeFinalPatterns(computed));}}return result;}// this represents the exceptions of the rule that are not covered by CLDR availableFormats", "title": "" }, { "docid": "13f1d72e7c2dd4be49425f8644f9e547", "score": "0.6382518", "text": "function t(e,t,o){var n=\" \";return(e%100>=20||e>=100&&e%100==0)&&(n=\" de \"),e+n+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[o]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "e56ce415af42388cb81447969903ecf4", "score": "0.6377319", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "4e739acc8d1bfe4e363f1fff93203c4d", "score": "0.6372405", "text": "function pretty_datetime(datetime) {\n\tif (datetime == null) {\n\t\treturn '';\n\t}\n\t\n\tvar a = new Date(datetime);\n\tvar months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\treturn months[a.getMonth()] + \" \" + a.getDate() + \" \" + a.getFullYear() + \" @ \" + a.toLocaleTimeString();\n}", "title": "" }, { "docid": "795a3bc6e6f99d06d402ba4e6d856a7a", "score": "0.63711476", "text": "getFormattedDate() {\n const d = this.date;\n if (!d) return;\n const date = formatDate(this, d) || '';\n const time = formatTime(this, d) || '';\n return \"\".concat(date, \" \").concat(time).trim();\n }", "title": "" }, { "docid": "ba7925ff811ef52d6a071e4449ccd0be", "score": "0.6370448", "text": "function time_format(){\n function pad(n){return n<10 ? '0'+n : n}\n d = new Date();\n return d.getFullYear()+'-'\n + pad(d.getMonth()+1)+'-'\n + pad(d.getDate())+'+'\n + pad(d.getHours())+'%3A'\n + pad(d.getMinutes())+'%3A'\n + pad(d.getSeconds())\n}", "title": "" }, { "docid": "101a21500e393a8050f090b3d143b10e", "score": "0.6365812", "text": "function formatDate(sVal, format) {\n if (sVal == null || sVal == '' || sVal == c_sUnavailable)\n return c_sUnavailable;\n\n var dDate = new Date(sVal);\n var nMonth = dDate.getMonth() + 1;\n var nDate = dDate.getDate();\n var nYear = dDate.getFullYear();\n var nHours = dDate.getHours();\n var nMinutes = dDate.getMinutes();\n\n var sDate = \"\";\n\n switch (format) {\n case dateFormats.yyyy:\n sDate = nYear.toString();\n break;\n case dateFormats.MMMdd:\n sDate = monthNames[nMonth - 1] + \" \" + nDate.toString();\n break;\n case dateFormats.MMddyyyy:\n sDate = nMonth.toString() + \"/\" + nDate.toString() + \"/\" + nYear.toString();\n break;\n case dateFormats.MMddyy:\n var sMonth = (nMonth > 9) ? nMonth.toString() : '0' + nMonth.toString();\n var sDate = (nDate > 9) ? nDate.toString() : '0' + nDate.toString();\n var sYear = nYear.toString().substr(nYear.toString().length - 2, nYear.toString().length);\n sDate = sMonth + '/' + sDate + '/' + sYear;\n break;\n case dateFormats.MMMddtt:\n var sHours = (nHours <= 12) ? nHours.toString() : (nHours - 12).toString();\n var sMinutes = nMinutes.toString();\n sDate += formatDate(dDate, dateFormats.MMMdd).toString();\n sDate += \" at \";\n sDate += (nHours < 10) ? \"0\" + nHours.toString() : nHours.toString();\n sDate += \":\"\n sDate += (nMinutes < 10) ? \"0\" + nMinutes.toString() : nMinutes.toString();\n sDate += (nHours < 12) ? \"am\" : \"pm\";\n break;\n default:\n var sMonth = (nMonth > 9) ? nMonth.toString() : '0' + nMonth.toString();\n var sDate = (nDate > 9) ? nDate.toString() : '0' + nDate.toString();\n var sYear = nYear;//.toString().substr(nYear.toString().length - 2, nYear.toString().length);\n sDate = sMonth + '/' + sDate + '/' + sYear;\n break;\n }\n return sDate;\n}", "title": "" }, { "docid": "3a03c410fc4c701ddc2322408996e58d", "score": "0.6365269", "text": "function formatDate(date, format)\n{\n format = format+\"\";\n var result = \"\";\n var i_format = 0;\n var c = \"\";\n var token = \"\";\n var y = date.getYear()+\"\";\n var M = date.getMonth()+1;\n var d = date.getDate();\n var E = date.getDay();\n var H = date.getHours();\n var m = date.getMinutes();\n var s = date.getSeconds();\n var yyyy, yy, MMM, MM, dd, hh, h, mm, ss, ampm, HH, H, KK, K, kk, k;\n // Convert real date parts into formatted versions\n var value = new Object();\n if (y.length < 4)\n {\n y = \"\"+(y-0+1900);\n }\n value[\"y\"] = \"\"+y;\n value[\"yyyy\"] = y;\n value[\"yy\"] = y.substring(2, 4);\n value[\"M\"] = M;\n value[\"MM\"] = LZ(M);\n value[\"MMM\"] = MONTH_NAMES[M-1];\n value[\"NNN\"] = MONTH_NAMES[M+11];\n value[\"d\"] = d;\n value[\"dd\"] = LZ(d);\n value[\"E\"] = DAY_NAMES[E+7];\n value[\"EE\"] = DAY_NAMES[E];\n value[\"H\"] = H;\n value[\"HH\"] = LZ(H);\n if (H==0)\n {\n value[\"h\"] = 12;\n }\n else if (H>12)\n {\n value[\"h\"] = H-12;\n }\n else\n {\n value[\"h\"] = H;\n }\n value[\"hh\"] = LZ(value[\"h\"]);\n if (H>11)\n {\n value[\"K\"] = H-12;\n }\n else\n {\n value[\"K\"] = H;\n }\n value[\"k\"] = H+1;\n value[\"KK\"] = LZ(value[\"K\"]);\n value[\"kk\"] = LZ(value[\"k\"]);\n if (H > 11)\n {\n value[\"a\"] = \"PM\";\n }\n else\n {\n value[\"a\"] = \"AM\";\n }\n value[\"m\"] = m;\n value[\"mm\"] = LZ(m);\n value[\"s\"] = s;\n value[\"ss\"] = LZ(s);\n while (i_format < format.length)\n {\n c = format.charAt(i_format);\n token = \"\";\n while ((format.charAt(i_format)==c) && (i_format < format.length))\n {\n token += format.charAt(i_format++);\n }\n if (value[token] != null)\n {\n result = result + value[token];\n }\n else\n {\n result = result + token;\n }\n }\n return result;\n}", "title": "" }, { "docid": "ac970edc1dd5c450a9c2740e1d119002", "score": "0.6347871", "text": "function t(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "ac970edc1dd5c450a9c2740e1d119002", "score": "0.6347871", "text": "function t(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "ac970edc1dd5c450a9c2740e1d119002", "score": "0.6347871", "text": "function t(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "ac970edc1dd5c450a9c2740e1d119002", "score": "0.6347871", "text": "function t(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "2aa60a959c0ac487918211ac75cc0ca3", "score": "0.63470197", "text": "function formatDate(d) {\n if (d === undefined){\n d = (new Date()).toISOString()\n \n }\n let currDate = new Date(d);\n \n let year = currDate.getFullYear();\n let month = currDate.getMonth() + 1;\n let dt = currDate.getDate();\n let time = currDate.toLocaleTimeString('en-SG')\n\n if (dt < 10) {\n dt = '0' + dt;\n }\n if (month < 10) {\n month = '0' + month;\n }\n\n return dt + \"/\" + month + \"/\" + year + \" \" + time ;\n }", "title": "" }, { "docid": "058a5d284a0ea9071d8aa63c4c66d8d4", "score": "0.6337052", "text": "function dateParser(created_at){\n\tvar fields = created_at.split(\" \");\n\tcreated_at = fields[0] + ' ' +\n\t fields[1] + ' ' +\n\t fields[2] + ' ' +\n\t fields[3] + ' ' +\n\t fields[5] + ' ';\n\treturn created_at;\n}", "title": "" }, { "docid": "fc46298190fce4962846fd171b65413c", "score": "0.63322264", "text": "function formatDate(date) {\n return date.year+'.'+date.month+'.'+date.day+' '+date.hour+':'+date.minute+':'+Math.floor(date.second);\n}", "title": "" }, { "docid": "af7ae762582f8ed8f6e50ef8dbd93a22", "score": "0.63215756", "text": "static _format(dtf, date) {\n const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n return dtf.format(d);\n }", "title": "" }, { "docid": "70e707a35f294bcadf17ef3afb4fdd2b", "score": "0.63196766", "text": "function timefmt(now, last) {\n //letiable to hold the current time, formatted as YYYY-MM-DDTHH:MM:SS.mmmZ\n let nowstr = now.toJSON();\n //letiable to hold the output string, now empty\n let outstr = \"\";\n //letiable to hold the current date as a string. uses regular expression to match everything before the \"T\"\n let datestr = nowstr.match(/([0-9,-]+)T/)[1].cyan;\n //letiable to hold the current time as a string. uses regular expression to match everything between the \"T\" and the \"Z\"\n let timestr = nowstr.match(/T([0-9,\\:,\\.]+)Z/)[1].bold.blue;\n //checks if the dates are different\n if (last && checkDateDiff(last, now)) {\n //assign the date string and a space to the output\n outstr = datestr + \" \";\n }\n //append the time string to the output\n outstr = outstr + timestr;\n //return the output\n return outstr;\n}", "title": "" }, { "docid": "5e32c3036a77cc5259f7f8b814d5e5f4", "score": "0.63183844", "text": "function getFormatDate(date) {\n return (\"0\" + (date.getMonth() + 1)).slice(-2) + '/' + \n (\"0\" + date.getDate()).slice(-2) + '/' + \n (date.getFullYear()) + ' ' + \n (\"0\" + date.getHours()).slice(-2) + ':' + \n (\"0\" + date.getMinutes()).slice(-2) + ':' + \n (\"0\" + date.getSeconds()).slice(-2);\n}", "title": "" }, { "docid": "547ea1c07b23b758831a3ff1a514eebb", "score": "0.6313271", "text": "function t(e,t,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "547ea1c07b23b758831a3ff1a514eebb", "score": "0.6313271", "text": "function t(e,t,n){var a=\" \";return(e%100>=20||e>=100&&e%100==0)&&(a=\" de \"),e+a+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "5dd98c223733b2553cb964cc7b8337bd", "score": "0.63053113", "text": "function formatDate(date, format) {\n format = format + '';\n var result = '';\n var iFormat = 0;\n var c = '';\n var token = '';\n var y = date.getYear() + '';\n var M = date.getMonth() + 1;\n var d = date.getDate();\n var E = date.getDay();\n var H = date.getHours();\n var m = date.getMinutes();\n var s = date.getSeconds();\n // var yyyy, yy, MMM, MM, dd, hh, h, mm, ss, ampm, HH, H, KK, K, kk, k\n // Convert real date parts into formatted versions\n var value = {};\n if (y.length < 4) {\n y = '' + (y - 0 + 1900);\n }\n value['y'] = '' + y;\n value['yyyy'] = y;\n value['yy'] = y.substring(2, 4);\n value['M'] = M;\n value['MM'] = LZ(M);\n value['MMM'] = MONTH_NAMES[M - 1];\n value['NNN'] = MONTH_NAMES[M + 11];\n value['d'] = d;\n value['dd'] = LZ(d);\n value['E'] = DAY_NAMES[E + 7];\n value['EE'] = DAY_NAMES[E];\n value['H'] = H;\n value['HH'] = LZ(H);\n if (H === 0) {\n value['h'] = 12;\n } else if (H > 12) {\n value['h'] = H - 12;\n } else {\n value['h'] = H;\n }\n value['hh'] = LZ(value['h']);\n if (H > 11) {\n value['K'] = H - 12;\n } else {\n value['K'] = H;\n }\n value['k'] = H + 1;\n value['KK'] = LZ(value['K']);\n value['kk'] = LZ(value['k']);\n if (H > 11) {\n value['a'] = 'PM';\n } else {\n value['a'] = 'AM';\n }\n value['m'] = m;\n value['mm'] = LZ(m);\n value['s'] = s;\n value['ss'] = LZ(s);\n while (iFormat < format.length) {\n c = format.charAt(iFormat);\n token = '';\n while (format.charAt(iFormat) === c && iFormat < format.length) {\n token += format.charAt(iFormat++);\n }\n if (value[token] !== null) {\n result = result + value[token];\n } else {\n result = result + token;\n }\n }\n return result;\n}", "title": "" }, { "docid": "a4fc1d335d8683cfac98297d3990daf6", "score": "0.63040185", "text": "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "title": "" }, { "docid": "a4fc1d335d8683cfac98297d3990daf6", "score": "0.63040185", "text": "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "title": "" }, { "docid": "a4fc1d335d8683cfac98297d3990daf6", "score": "0.63040185", "text": "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "title": "" }, { "docid": "5db1876cd9f4980c1744c536e411cbec", "score": "0.6288811", "text": "function t(e,t,r){var n=\" \";return(e%100>=20||e>=100&&e%100==0)&&(n=\" de \"),e+n+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[r]}", "title": "" }, { "docid": "f3af877ed74a22243e908fd21089dcab", "score": "0.62829906", "text": "function _convertDatetime(taskDate){\n // break it up\n return Date.parse(taskDate).toString().substr(0,10);\n}", "title": "" }, { "docid": "edf8afe9d683a988da582d2219b4f6f1", "score": "0.6279553", "text": "function formatDate(date)\n{\n newdate = \"\"\n for (i in date)\n {\n if (date[i] == 'T')\n {\n newdate += \" \"\n }\n else if (date[i] == 'Z')\n {\n newdate += ''\n }\n else\n {\n newdate += date[i]\n }\n }\n return newdate\n}", "title": "" }, { "docid": "acd28d255358d7fd86b5a0260ff6f415", "score": "0.62759006", "text": "function dateFormat(i){\n var date = data.list[i].dt_txt;\n var year = date.slice(0,4);\n var day = date.slice(5,7);\n var month = date.slice(8,10);\n\n var newDateFormat = day + \"/\" + month + \"/\" + year;\n console.log(newDateFormat);\n return newDateFormat;\n }", "title": "" }, { "docid": "a3b8be1f3df73edc68b720c1edeeabfc", "score": "0.6271312", "text": "function formatDate(date_time){\n var datetime = date_time.split(\" \");\n var date = datetime[0].split(\"-\");\n var time = datetime[1].split(\":\");\n return new Date(date[0],date[1]-1,date[2],time[0],time[1]); \n}", "title": "" }, { "docid": "4da0a30a71d4d5d6595b68fec87ed083", "score": "0.62624234", "text": "function formatDate(date,format) {\r\n\tformat=format+\"\";\r\n\tvar result=\"\";\r\n\tvar i_format=0;\r\n\tvar c=\"\";\r\n\tvar token=\"\";\r\n\tvar y=date.getYear()+\"\";\r\n\tvar M=date.getMonth()+1;\r\n\tvar d=date.getDate();\r\n\tvar E=date.getDay();\r\n\tvar H=date.getHours();\r\n\tvar m=date.getMinutes();\r\n\tvar s=date.getSeconds();\r\n\tvar yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;\r\n\t// Convert real date parts into formatted versions\r\n\tvar value=new Object();\r\n\tif (y.length < 4) {y=\"\"+(y-0+1900);}\r\n\tvalue[\"y\"]=\"\"+y;\r\n\tvalue[\"yyyy\"]=y;\r\n\tvalue[\"yy\"]=y.substring(2,4);\r\n\tvalue[\"M\"]=M;\r\n\tvalue[\"MM\"]=LZ(M);\r\n\tvalue[\"MMM\"]=MONTH_NAMES[M-1];\r\n\tvalue[\"d\"]=d;\r\n\tvalue[\"dd\"]=LZ(d);\r\n\tvalue[\"E\"]=DAY_NAMES[E+7];\r\n\tvalue[\"EE\"]=DAY_NAMES[E];\r\n\tvalue[\"H\"]=H;\r\n\tvalue[\"HH\"]=LZ(H);\r\n\tif (H==0){value[\"h\"]=12;}\r\n\telse if (H>12){value[\"h\"]=H-12;}\r\n\telse {value[\"h\"]=H;}\r\n\tvalue[\"hh\"]=LZ(value[\"h\"]);\r\n\tif (H>11){value[\"K\"]=H-12;} else {value[\"K\"]=H;}\r\n\tvalue[\"k\"]=H+1;\r\n\tvalue[\"KK\"]=LZ(value[\"K\"]);\r\n\tvalue[\"kk\"]=LZ(value[\"k\"]);\r\n\tif (H > 11) { value[\"a\"]=\"PM\"; }\r\n\telse { value[\"a\"]=\"AM\"; }\r\n\tvalue[\"m\"]=m;\r\n\tvalue[\"mm\"]=LZ(m);\r\n\tvalue[\"s\"]=s;\r\n\tvalue[\"ss\"]=LZ(s);\r\n\twhile (i_format < format.length) {\r\n\t\tc=format.charAt(i_format);\r\n\t\ttoken=\"\";\r\n\t\twhile ((format.charAt(i_format)==c) && (i_format < format.length)) {\r\n\t\t\ttoken += format.charAt(i_format++);\r\n\t\t\t}\r\n\t\tif (value[token] != null) { result=result + value[token]; }\r\n\t\telse { result=result + token; }\r\n\t\t}\r\n\treturn result;\r\n\t}", "title": "" }, { "docid": "4da0a30a71d4d5d6595b68fec87ed083", "score": "0.62624234", "text": "function formatDate(date,format) {\r\n\tformat=format+\"\";\r\n\tvar result=\"\";\r\n\tvar i_format=0;\r\n\tvar c=\"\";\r\n\tvar token=\"\";\r\n\tvar y=date.getYear()+\"\";\r\n\tvar M=date.getMonth()+1;\r\n\tvar d=date.getDate();\r\n\tvar E=date.getDay();\r\n\tvar H=date.getHours();\r\n\tvar m=date.getMinutes();\r\n\tvar s=date.getSeconds();\r\n\tvar yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;\r\n\t// Convert real date parts into formatted versions\r\n\tvar value=new Object();\r\n\tif (y.length < 4) {y=\"\"+(y-0+1900);}\r\n\tvalue[\"y\"]=\"\"+y;\r\n\tvalue[\"yyyy\"]=y;\r\n\tvalue[\"yy\"]=y.substring(2,4);\r\n\tvalue[\"M\"]=M;\r\n\tvalue[\"MM\"]=LZ(M);\r\n\tvalue[\"MMM\"]=MONTH_NAMES[M-1];\r\n\tvalue[\"d\"]=d;\r\n\tvalue[\"dd\"]=LZ(d);\r\n\tvalue[\"E\"]=DAY_NAMES[E+7];\r\n\tvalue[\"EE\"]=DAY_NAMES[E];\r\n\tvalue[\"H\"]=H;\r\n\tvalue[\"HH\"]=LZ(H);\r\n\tif (H==0){value[\"h\"]=12;}\r\n\telse if (H>12){value[\"h\"]=H-12;}\r\n\telse {value[\"h\"]=H;}\r\n\tvalue[\"hh\"]=LZ(value[\"h\"]);\r\n\tif (H>11){value[\"K\"]=H-12;} else {value[\"K\"]=H;}\r\n\tvalue[\"k\"]=H+1;\r\n\tvalue[\"KK\"]=LZ(value[\"K\"]);\r\n\tvalue[\"kk\"]=LZ(value[\"k\"]);\r\n\tif (H > 11) { value[\"a\"]=\"PM\"; }\r\n\telse { value[\"a\"]=\"AM\"; }\r\n\tvalue[\"m\"]=m;\r\n\tvalue[\"mm\"]=LZ(m);\r\n\tvalue[\"s\"]=s;\r\n\tvalue[\"ss\"]=LZ(s);\r\n\twhile (i_format < format.length) {\r\n\t\tc=format.charAt(i_format);\r\n\t\ttoken=\"\";\r\n\t\twhile ((format.charAt(i_format)==c) && (i_format < format.length)) {\r\n\t\t\ttoken += format.charAt(i_format++);\r\n\t\t\t}\r\n\t\tif (value[token] != null) { result=result + value[token]; }\r\n\t\telse { result=result + token; }\r\n\t\t}\r\n\treturn result;\r\n\t}", "title": "" }, { "docid": "97671e79bca0c20b20a95452d44f0667", "score": "0.6258988", "text": "function FormatDateTime(dateTimeFormat, x) {\n var parts = CreateDateTimeParts(dateTimeFormat, x);\n var result = '';\n\n for (var i = 0; parts.length > i; i++) {\n var part = parts[i];\n result += part.value;\n }\n return result;\n}", "title": "" }, { "docid": "97671e79bca0c20b20a95452d44f0667", "score": "0.6258988", "text": "function FormatDateTime(dateTimeFormat, x) {\n var parts = CreateDateTimeParts(dateTimeFormat, x);\n var result = '';\n\n for (var i = 0; parts.length > i; i++) {\n var part = parts[i];\n result += part.value;\n }\n return result;\n}", "title": "" }, { "docid": "97671e79bca0c20b20a95452d44f0667", "score": "0.6258988", "text": "function FormatDateTime(dateTimeFormat, x) {\n var parts = CreateDateTimeParts(dateTimeFormat, x);\n var result = '';\n\n for (var i = 0; parts.length > i; i++) {\n var part = parts[i];\n result += part.value;\n }\n return result;\n}", "title": "" }, { "docid": "97671e79bca0c20b20a95452d44f0667", "score": "0.6258988", "text": "function FormatDateTime(dateTimeFormat, x) {\n var parts = CreateDateTimeParts(dateTimeFormat, x);\n var result = '';\n\n for (var i = 0; parts.length > i; i++) {\n var part = parts[i];\n result += part.value;\n }\n return result;\n}", "title": "" }, { "docid": "baaa687adcacb39aac63db29accc79f0", "score": "0.6252133", "text": "function formatDateTime(dateTime) {\n let formattedTime = dateTime.slice(0, 16); // Removing seconds and miliseconds\n return formattedTime;\n}", "title": "" }, { "docid": "456adcddae66d3512cf08420799cf129", "score": "0.62485397", "text": "function date_format(date) {\n var res = date.getFullYear() + \" \" \n + (\"0\" + (date.getMonth() + 1)).slice(-2) + \" \" \n + (\"0\" + date.getDate()).slice(-2) + \" \" \n + (\"0\" + date.getHours()).slice(-2) + \" \" \n + (\"0\" + date.getMinutes()).slice(-2);\n return res;\n}", "title": "" }, { "docid": "760ebae27a064b844e8dd453f80c2748", "score": "0.6240551", "text": "function format(t) {\n function toInt(fl) {\n /* eslint no-bitwise: \"off\" */\n /* jshint ignore: start */\n return fl >> 0; // bit-shift zero places: converts to 32 bit int\n /* jshint ignore: end */\n }\n t = Number(t); // force conversion from Date\n switch (type) {\n case \"short\": {\n if (t >= 31536e6) {\n return (t / 31536e6).toFixed(1) + \" years\";\n } else if (t >= 6048e5) {\n return (t / 6048e5).toFixed(1) + \" weeks\";\n } else if (t >= 864e5) {\n return (t / 864e5).toFixed(1) + \" days\";\n } else if (t >= 36e5) {\n return (t / 36e5).toFixed(1) + \" hours\";\n } else if (t >= 6e4) {\n return (t / 6e4).toFixed(1) + \" minutes\";\n }\n return (t / 1e3).toFixed(1) + \" seconds\";\n }\n case \"long\": {\n var a = [],\n s = toInt((t % 6e4) / 1e3),\n m = toInt((t % 36e5) / 6e4);\n a.push(pad(\"0\", 2, s));\n if (t >= 36e5) {\n var h = toInt((t % 864e5) / 36e5);\n a.push(pad(\"0\", 2, m));\n if (t >= 864e5) {\n a.push(pad(\"0\", 2, h));\n a.push(Math.floor(t / 864e5).toFixed());\n } else {\n a.push(h.toFixed());\n }\n } else {\n a.push(m.toFixed());\n }\n return a.reverse().join(\":\");\n }\n }\n }", "title": "" }, { "docid": "55573d3fa314336d4e244af9dd796269", "score": "0.62398607", "text": "function t(e,t,a){var o={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+o[a]}", "title": "" }, { "docid": "e4aab2fe17cdf757589f564047c6e084", "score": "0.62393", "text": "function tryCombineDateTime() {\n\n\t\t\t\t if($scope.sdate && $scope.stime) {\n\t\t\t\t \tvar dateParts = [$scope.sdate.getFullYear(),\n\t\t\t\t \t $scope.sdate.getMonth() + 1,\n\t\t\t\t \t $scope.sdate.getDate()\n\t\t\t\t \t ];\n\t\t\t\t \tvar timeParts = [$scope.stime.getHours(), $scope.stime.getMinutes(), $scope.stime.getSeconds()];\n\n\t\t\t\t if(dateParts && timeParts) {\n\t\t\t\t dateParts[1] -= 1;\n\t\t\t\t $scope.post.postDate = new Date(Date.UTC.apply(undefined,dateParts.concat(timeParts))).toISOString();\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t }", "title": "" }, { "docid": "d3f311386e4d087e169585ec43a3f410", "score": "0.6234126", "text": "function t(e,t,n){var o=\" \";return(e%100>=20||e>=100&&e%100==0)&&(o=\" de \"),e+o+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "31fe0743132f3008996278e656da35d2", "score": "0.62260395", "text": "function formatDateTimeValue(val, format) {\n\tif (!val)\n return val;\n\t\n\ttry {\n\t\tvar now = new Date(val);\n\t\treturn moment(now).format(format);\n\t} catch (e) {}\n\n\treturn val;\n}", "title": "" }, { "docid": "55f013ba87ace09628f3a0b354624c4a", "score": "0.6225408", "text": "formatDateTime(dateTimeWidgetId) {\r\n let fieldIds = this.buildFieldIdsForDateTimeWidget(dateTimeWidgetId);\r\n\r\n let dateValue = document.getElementById(fieldIds.dateFieldId).value;\r\n let timeValue = document.getElementById(fieldIds.timeFieldId).value;\r\n\r\n return dateValue + ' ' + timeValue;\r\n }", "title": "" }, { "docid": "2d86817a605453c727e9e1843e6ab887", "score": "0.62247384", "text": "function formatDate(dat) {\n // mm/dd/yyyy at hh:mm pm\n var month = dat.getMonth() + 1;\n month = month < 10 ? \"0\" + month : \"\" + month;\n var date = dat.getDate();\n date= date < 10 ? \"0\" + date : \"\" + date;\n var year = dat.getFullYear() - 2000;\n\n var hour = dat.getHours() % 12;\n if (hour == 0) { hour = 12; }\n hour = hour < 10 ? \"0\" + hour : \"\" + hour;\n var min = dat.getMinutes();\n min = min < 10 ? \"0\" + min : \"\" + min;\n var pm = dat.getHours() < 12 ? \"am\" : \"pm\";\n\n return month + \"/\" + date + \"/\" + year + \" at \" + hour + \":\" + min + pm;\n }", "title": "" }, { "docid": "2beb273ec977d22b724edbc032dc89e8", "score": "0.6210545", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "2beb273ec977d22b724edbc032dc89e8", "score": "0.6210545", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "2beb273ec977d22b724edbc032dc89e8", "score": "0.6210545", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "2beb273ec977d22b724edbc032dc89e8", "score": "0.6210545", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "2beb273ec977d22b724edbc032dc89e8", "score": "0.6210545", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "2beb273ec977d22b724edbc032dc89e8", "score": "0.6210545", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "2beb273ec977d22b724edbc032dc89e8", "score": "0.6210545", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "2beb273ec977d22b724edbc032dc89e8", "score": "0.6210545", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "2beb273ec977d22b724edbc032dc89e8", "score": "0.6210545", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "2beb273ec977d22b724edbc032dc89e8", "score": "0.6210545", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "2beb273ec977d22b724edbc032dc89e8", "score": "0.6210545", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "2beb273ec977d22b724edbc032dc89e8", "score": "0.6210545", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "2beb273ec977d22b724edbc032dc89e8", "score": "0.6210545", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" } ]
b88f4ccc84177d5bc8bc1e4905928af0
Attaches an info window to a marker with the provided message. When the marker is clicked, the info window will open with the secret message.
[ { "docid": "2180ef8b447dcfc233d5d043205ba499", "score": "0.82693374", "text": "function attachSecretMessage(marker, secretMessage) {\n var infowindow = new google.maps.InfoWindow({\n content: secretMessage\n });\n \n marker.addListener('click', function() {\n infowindow.open(marker.get('map'), marker);\n });\n }", "title": "" } ]
[ { "docid": "829833c0f79a1cd76b82d068d4549275", "score": "0.81733304", "text": "function attachSecretMessage(marker, secretMessage) {\n const infowindow = new google.maps.InfoWindow({\n content: secretMessage,\n });\n marker.addListener(\"click\", () => {\n infowindow.open(marker.get(\"map\"), marker);\n });\n}", "title": "" }, { "docid": "ab8442d799fa4fea9786b3b14f5cd24c", "score": "0.79621434", "text": "function addInfoWindow(marker, message) {\n\tvar cinfoWindow = new google.maps.InfoWindow();\n\tvar chtml = message;\n\n\tgoogle.maps.event.addListener(marker, 'click', function() {\n\t\tcinfoWindow.setContent(chtml);\n\t\tcinfoWindow.open(mymap, marker);\n\t});\n}", "title": "" }, { "docid": "4cd2c21c1219d9f8bb18f43809a638c0", "score": "0.78940976", "text": "function attachMessage(marker, message) {\n\t var infowindow = new google.maps.InfoWindow({\n\t content: message\n\t });\n\n\t google.maps.event.addListener(marker, 'click', function() {\n\t infowindow.open(marker.get('map'), marker);\n\t });\n\t}", "title": "" }, { "docid": "e7fa85543a2b3ce9576777b521f7a281", "score": "0.78499925", "text": "function attachMessage(marker, message) {\n\tvar infowindow = new google.maps.InfoWindow({\n\t\tcontent: message\n\t});\n\n\tmarker.addListener('click', function () {\n\t\tinfowindow.open(marker.get('map'), marker);\n\t});\n}", "title": "" }, { "docid": "d210e3a85c62db1ed01c1583f9c814f6", "score": "0.7766354", "text": "function attachMessage(marker, msg) {\n var infowindow = new google.maps.InfoWindow(\n { content: msg,\n size: new google.maps.Size(50,50)\n });\n google.maps.event.addListener(marker, 'click', function() {\n infowindow.open(map,marker);\n });\n}", "title": "" }, { "docid": "78fcb0498b550485705a9c3012f7d93a", "score": "0.7278532", "text": "function addMarker(location, message) {\n marker = new google.maps.Marker({\n position: location,\n map: mymap,\n animation: google.maps.Animation.DROP\n });\n\naddInfoWindow(marker, message)\n}", "title": "" }, { "docid": "43928204bcbf5be7c31132ac925c8e91", "score": "0.706073", "text": "function markerAddInfoWindow(marker, content) {\n var infoWindow = new google.maps.InfoWindow({\n content: content\n });\n google.maps.event.addListener(marker, \"click\", function (e) { \n if (lastOpenInfoWindow) { lastOpenInfoWindow.close(); }\n infoWindow.open(map, this); \n lastOpenInfoWindow = infoWindow;\n });\n}", "title": "" }, { "docid": "f5ba78f4bcd1507de98f1be1da85baac", "score": "0.69714344", "text": "function makeInfoWindow(position, msg) {\n // close old window if it exists\n if (infoWindow) infoWindow.close();\n\n // make a new InfoWindow\n infoWindow = new google.maps.InfoWindow({\n map: map,\n position: position,\n\n content: \"<b>\" + msg + \"</b>\"\n });\n}", "title": "" }, { "docid": "ecb1116b4fdf4f60d81bc23cad1ed4c4", "score": "0.6906288", "text": "function createNewInfoWindow(coord, content){\n // information window is displayed at click position\n\tmapCollector.infowindow = new google.maps.InfoWindow({\n\t \tcontent: content,\n\t \tposition: coord\n\t});\n }", "title": "" }, { "docid": "b766d6794e9e7582e04323068aa5ccfc", "score": "0.68637973", "text": "function showInfoWindow(marker)\n {\n google.maps.event.trigger(markers[marker], 'click');\n }", "title": "" }, { "docid": "45edf52f4788cdb044aaf997fba7abba", "score": "0.68587196", "text": "function MarkerClickEvent(marker){\n\t//\tIf the infoBox is already open then close it\n\tif(infobox){\n\t\tinfobox.close();\n\t}\n\t//\tCreate a new instance of infowindow from Google\n\tinfobox = new google.maps.InfoWindow();\n\t//\tAdd a click event to the Marker which you are currently clicking onto\n\tgoogle.maps.event.addListener(marker, \"click\", function(){\n\t\t//\tSetting the content of the infoBox\n\t\tinfobox.setContent(\"<div><strong>\"+marker.title+\"</strong></div><hr>\"+\n\t\t\t\t\t\t\t\"<div>\"+marker.description+\"</div>\"\n\t\t\t);\n\t\t//\tOpen the infoBox on the Map at the position of the Marker\n\t\t//\tWhat .open needs is what Map you want it on and also what Marker you want it onto aswell\n\t\tinfobox.open(map, marker);\n\t\t//\tChange the current Marker to the one which you are clicking onto\n\t\tcurrentMarker = marker;\n\t\t//\tShowing the directions to the new Marker clicked using one of the transport modes that is selected\n\t\tshowDirection(currentMarker.position, TransportMode);\n\t});\n}", "title": "" }, { "docid": "0232fb5ed90903ce4c7dbc06a0306557", "score": "0.6852828", "text": "function bindInfoWindow(marker, map, infoWindow, content) {\n google.maps.event.addListener(marker, 'click', function() {\n infoWindow.setContent(content);\n infoWindow.open(map, marker);\n });\n }", "title": "" }, { "docid": "a574adfd5102294c5a1272de1313021f", "score": "0.6847331", "text": "function setMarkerInfo(info) {\n infoWindow.setContent(info);\n }", "title": "" }, { "docid": "b1f0d0632855db8e555685539b7b6c5b", "score": "0.6775753", "text": "function addClicker(marker, content) {\n google.maps.event.addListener(marker, 'click', function() {\n \n if (infowindow) {infowindow.close();}\n infowindow = new google.maps.InfoWindow({content: content});\n infowindow.open(map, marker);\n });\n }", "title": "" }, { "docid": "c5ee7337580314808634be09a53e524f", "score": "0.6749387", "text": "function createInfoWindow(marker, centerMarker) {\n var onclick;\n var centerMarkerId\n var rating = (marker.rating == \"None\") ? \"\" : \"Rating: \" + Math.round(marker.rating) + \"/100\";\n var errorMessage = ($(\"#err\").length) ? $(\"#err\").html() : \"\";\n\n // There is no centerMarker if the marker is on our path\n if (centerMarker == null) {\n onclick = ' id=\"removeBtn\" onclick=\"removePoint(' + marker.id + ');\">' +\n '<span class=\"glyphicon glyphicon-trash\"></span>';\n } else {\n centerMarkerId = centerMarker.id;\n onclick = ' id=\"addBtn\" onclick=\"addPoint(' + marker.id + ', ' +\n centerMarker.id + ');\">Add';\n }\n\n var content = '<p>' + marker.name + '</p><p>' +\n rating + '</p><p id=\"err\">' + errorMessage +\n '</p><div class=\"btn btn-primary btn-sm\"' + onclick +\n '</div><div class=\"btn btn-link btn-sm\"' +\n 'onclick=\"setInfoWindowContent('+ marker.id + ', ' + centerMarkerId +\n ');\">More Info...</div>';\n\n namespace.popWindow.marker = marker;\n namespace.popWindow.setContent(content);\n namespace.popWindow.open(namespace.map, marker);\n}", "title": "" }, { "docid": "69c9a5e95781a84c2ddbc1b38bd1f99c", "score": "0.67467165", "text": "function addInfoWindow(marker, message,myLatLng,i) {\nvar infoWindow = new google.maps.InfoWindow({\n content: \"\"\n});\n var geocoder = new google.maps.Geocoder;\n google.maps.event.addListener(marker, 'click', function () {\n\t\t\tgeocodeLatLng(geocoder, map,marker, infoWindow,myLatLng,i);\n\t\t\t//infoWindow.open(map, marker);\n });\n}", "title": "" }, { "docid": "f04786d0a23070387c01a1f02e9ed899", "score": "0.6738923", "text": "function makeInfoWindowEvent( contentString, marker ) {\n\t\t\t\t\n\t\t\t\tgoogle.maps.event.addListener( marker, 'click', function() {\n\t\t\t\t\n\t\t\t\tinfowindow.setContent( contentString );\n\t\t\t\t\n\t\t\t\tinfowindow.open( map, marker );\n\t\t\t \n\t\t\t });\n\t\t\t\n\t\t\t}", "title": "" }, { "docid": "5ed303025ef0477552aea8ff11a901ab", "score": "0.6718509", "text": "function showInfoWindow() { \n currentmarker = this;\n infoWindow.open(map, currentmarker);\n buildIWContent();\n\n}", "title": "" }, { "docid": "d2c937f94ca4b0fbe736c04ad74ff534", "score": "0.6687552", "text": "createInfoWindow(marker, infoWindow, map) {\n\t\tif (this.onReadyInfoWindow) window.google.maps.event.removeListener(this.onReadyInfoWindow);\n\t\tif (this.onCloseInfoWindow) window.google.maps.event.removeListener(this.onCloseInfoWindow);\n\t\tinfoWindow.marker = marker;\n\t\tinfoWindow.setContent('<div id=\"infoWindow\" />');\n\t\tthis.onReadyInfoWindow = infoWindow.addListener('domready', e => {\n\t\t\trender(<InfoWindow marker={marker} />, document.getElementById('infoWindow'));\n\t\t});\n\t\tthis.onCloseInfoWindow = infoWindow.addListener('closeclick', function() {\n\t\t\tinfoWindow.marker = null;\n\t\t});\n\t\tinfoWindow.open(map, marker);\n\t}", "title": "" }, { "docid": "ad4ccd52ce8cecf2de44bc02b2108d1f", "score": "0.6680505", "text": "function createMarker(location, content, potholeID) {\n\n // Step 1: Create the marker\n\n // (First, though, we use a special variable to make old ones non-draggable)\n var drag = (content === undefined) ? true : false\n var sprayCan = {\n url: \"/assets/sprayCan2.png\",\n scaledSize: new google.maps.Size(50,50)}\n\n // Now we actually do step 1\n var marker = new google.maps.Marker({\n position: location,\n map: map,\n draggable: drag,\n animation: google.maps.Animation.DROP,\n icon: sprayCan,\n pothole_id: potholeID\n });\n\n // Step 2: Add newly created marker to a marker array\n\n markers.push(marker);\n\n\n // Step 3: Set up HTML for infobox\n var contentString;\n var markerLocation = {latitude:marker.position.ob, longitude:marker.position.pb}\n\n // If a new marker, creates a form\n // If an existing marker, uses content data passed into createMarker function\n if (content === undefined) {\n contentString = JST['templates/newForm'](markerLocation);\n } else {\n contentString = content;\n }\n\n // Step 4: Put content into infobox\n infobox.setContent(contentString);\n\n\n // Step 5: If it's a new marker, open the infobox\n if (newMarkerExists === true) {\n infobox.open(map, marker);\n isWindowOpen = true;\n };\n\n // Bug fix: Set currentLat/currentLng to hold last dragged position\n currentLat = markerLocation.latitude\n currentLng = markerLocation.longitude\n\n google.maps.event.addListener(marker, 'dragend', function(){\n currentLat = this.getPosition().lat()\n currentLng = this.getPosition().lng()\n })\n\n\n\n\n // On clicking marker, centers and opens/closes info window\n // Refactoring: Does this need to go inside createMarker function?\n\n google.maps.event.addListener(marker, 'click', function(){\n\n map.panTo(marker.getPosition());\n\n if (isWindowOpen == false) {\n infobox.setContent(contentString);\n infobox.open(map,marker);\n isWindowOpen = true;\n currentMarker = marker;\n } else if (infobox.content === contentString) {\n infobox.close();\n isWindowOpen = false;\n currentMarker = null;\n } else {\n infobox.close();\n infobox.setContent(contentString);\n infobox.open(map,marker);\n currentMarker = marker;\n }\n });\n } // end of createMarker()", "title": "" }, { "docid": "ba7b30e8624ffadc9b532dd5f3ea0b84", "score": "0.6667935", "text": "function fnAttainClosureInformationWindow(marker, ajLocations) {\n //Attaching click event to the current marker\n google.maps.event.addListener(marker, \"click\", function(event) {\n infoWindow.setContent(ajLocations.address);\n infoWindow.open(map, marker);\n });\n }", "title": "" }, { "docid": "de5ee9049a2dddd8d7f9db9840b1950f", "score": "0.6657694", "text": "function attachInfo(marker, event) {\n\t\tvar info = new google.maps.InfoWindow(\n\t\t\t{\n\t\t\t\tcontent: formatInfo(event),\n\t\t\t\tsize: new google.maps.Size(75, 50)\n\t\t\t});\n\t\tgoogle.maps.event.addListener(marker, 'click', function() {\n\t\t\topenInfo(event.id);\n\t\t});\n\t\teventMarkerMap[event.id] = {'info': info, 'marker': marker, 'event': event};\n\t}", "title": "" }, { "docid": "babac88a3b014e149195ae0ce2c4674a", "score": "0.6656749", "text": "function infoBox(map, marker, item) {\n var infoWindow = new google.maps.InfoWindow();\n // Attaching a click event to the current marker\n google.maps.event.addListener(marker, \"click\", function (e) {\n //map.setZoom(8),\n map.setCenter(marker.getPosition());\n infoWindow.setContent(this.html);\n infoWindow.open(map, marker);\n });\n\n\n\n\n }//fin funcion informacion de marcador", "title": "" }, { "docid": "2d74a473d649387fe8c5d150d81f4ca7", "score": "0.66563654", "text": "function attachContent(markerM, content) {\n var infowindow = new google.maps.InfoWindow({\n content: content\n });\n\n markerM.addListener('click', function() { //markerM copy\n infowindow.open(markerM.get('map'), markerM);\n\n });\n }", "title": "" }, { "docid": "9d20bbc0f1e76e3c7d1cdc902f84914a", "score": "0.66442937", "text": "function bindInfoWindow(newMark,map,infowindow){\n newMark.addListener('click', function() {\n infowindow.close();\n infowindow.open(map, newMark);\n })\n }", "title": "" }, { "docid": "d5be1280d2c464865156cecd4a39c24f", "score": "0.66160613", "text": "function openInfoWindow(map, marker, infoWindow) {\n const windowNode = document.createElement(\"div\");\n\n let owner = document.createElement(\"div\");\n owner.innerText = marker.owner;\n owner.className = \"user-nickname\";\n windowNode.appendChild(owner);\n\n let overview = document.createElement(\"div\");\n overview.innerText = marker.overview;\n overview.className = \"task-content-marker\";\n windowNode.appendChild(overview);\n\n let category = document.createElement(\"div\");\n category.innerText = \"#\" + marker.category;\n category.className = \"task-category\";\n windowNode.appendChild(category);\n\n let dateTime = document.createElement(\"div\");\n dateTime.innerText = marker.dateTime;\n dateTime.className = \"task-date-time\";\n windowNode.appendChild(dateTime);\n\n // adds help out option\n if (marker.get(\"isCurrentUser\") == false) {\n const helpOutButton = document.createElement(\"button\");\n helpOutButton.innerText = \"Help Out\";\n helpOutButton.className = \"help-out-marker\";\n\n // adds help out button click event\n helpOutButton.addEventListener(\"click\", function(e) {\n let helpOverlay = document.getElementById(\"help-overlay-map\");\n helpOverlay.style.display = \"block\";\n\n // adds confirm help click event\n document.getElementById(\"confirm-map\").addEventListener(\"click\", function(e) {\n confirmHelp(marker.get(\"key\"));\n helpOverlay.style.display = \"none\";\n e.stopPropagation();\n });\n\n // adss exit help click event\n document.getElementById(\"exit-help-map\").addEventListener(\"click\", function(e) {\n helpOverlay.style.display = \"none\";\n e.stopPropagation();\n });\n e.stopPropagation();\n });\n windowNode.appendChild(helpOutButton);\n }\n\n // adds click even to open up the task details modal\n windowNode.addEventListener(\"click\", function() {\n showTaskInfo(marker.get(\"key\"));\n });\n \n infoWindow.setContent(windowNode);\n infoWindow.open(map, marker);\n infoWindows.push(infoWindow);\n}", "title": "" }, { "docid": "15e3328caa8bbf47186ec0a0010207d5", "score": "0.6613735", "text": "function infoClicked(lat, long, name, link){\n const image = {\n url: \"http://www.stickpng.com/assets/images/58469c62cef1014c0b5e47f6.png\",\n scaledSize: new google.maps.Size(30, 30)\n };\n\n let marker = new google.maps.Marker({\n position: new google.maps.LatLng(lat, long),\n icon: image,\n animation: google.maps.Animation.DROP,\n map: map\n \n });\n\n const infoContent = `<a href=\"${link}\" target=\"blank\">${name}</a>`;\n\n mapWindow.setContent(infoContent);\n mapWindow.open(map, marker);\n}", "title": "" }, { "docid": "374eabdcc2bb417d61c71d6c3db133e1", "score": "0.6610467", "text": "OpenInfo({content, marker}) {\n\t\tthis.removeMarkerAnimation();\n\t\tthis.setMarkerAnimation(marker);\n\t\tthis.MAPINFOWindow.SetInfoWindowContent(this.INFOWindow, content || '');\n\t\tthis.MAPINFOWindow.OpenInfoWindow(this.INFOWindow, this.DrawnMap, marker);\n\t}", "title": "" }, { "docid": "56f9b1924fd7ddbe196cd5f05c554b64", "score": "0.6602119", "text": "function bindInfoWindow(marker, map, infoWindow, html) {\n google.maps.event.addListener(marker, 'click', function() {\n infoWindow.setContent(html);\n infoWindow.open(map, marker);\n });\n }", "title": "" }, { "docid": "7c6ad956cf1be4c27b2e366158adec71", "score": "0.65965384", "text": "function attachInfo(marker, info) {\n var infowindow = new google.maps.InfoWindow({\n content: info\n });\n\n //Listen for a click on a Marker\n marker.addListener('click', function() {\n infowindow.open(marker.get('map'), marker);\n instantClickID = marker.myOwnProperty[0];\n\n //DELETE EVENT - APPEARS ONLY FOR SAME USER\n var authorId = marker.myOwnProperty[2];\n var userId = \"\";\n //Check if the user is logged-in or not\n if(auth.currentUser != null){\n userId = auth.currentUser.uid;\n }\n //Allows the \"delete marker button to appear\"\n if(authorId == userId) {\n existingMarkerLink.forEach(item => item.style.display = 'block');\n doubleTapOnTheMapToAdd.forEach(item => item.style.display = 'none');\n }\n\n //GETTING INFO ABOUT A USER PROFILE\n db.collection('users').doc(authorId).get().then(doc => {\n\n const html = `<h4>${doc.data().name}</h4>\n <div style=\"margin-top:40px;\"><b>About me: </b>${doc.data().aboutMe}</div>\n <div class=\"btn-large blue\" style=\"margin-top:40px;\">${doc.data().totalNbEvents}</div>\n <div class=\"blue-text\" style=\"margin-top:10px;\">Total number of shared events</div>`;\n\n userDetails.innerHTML = html;\n });\n\n });\n\n map.addListener('click', function () {\n infowindow.close();\n });\n }", "title": "" }, { "docid": "aefb5c03ee7a8c4ac564e94cc2ff07ae", "score": "0.65785235", "text": "function mapInform(title, message) {\r\n\t\tvar content = '<h2>' + title + '</h2><p>' + message + '</p> <a class = \"button\" href = \"#\" id = \"mapConfirm\">OK</a>'; \r\n\t\topenModalBox(content, false);\r\n\t\t$(\"#mapConfirm\").click(function(e){\r\n\t\t\te.preventDefault();\r\n\t\t\tcloseModalBox();\r\n\t\t\t$['mapsettings'].element.trigger('finishPrompt');\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "49fb2ad0e215294f0a90d3d7a7fecb55", "score": "0.6555821", "text": "function markerClick(marker){\n\t\tmap.setZoom(16);\n\t\tmap.setCenter(marker.getPosition());\n\t\tinfoWindow.setContent(marker.getTitle());\n\t\tinfoWindow.open(map, marker);\n\t}", "title": "" }, { "docid": "247d45ea0acae554b30cd768d33941e2", "score": "0.65499127", "text": "function addMarker(details) {\n var marker = new google.maps.Marker({\n position: details.position,\n map: details.map,\n icon: 'images/map_markers/'+ details.icon +'.png'\n });\n\n var infoWindow = new google.maps.InfoWindow({\n content: details.infoMarkup\n });\n\n marker.addListener('click', function(){\n infoWindow.open(details.map, marker);\n });\n}", "title": "" }, { "docid": "56e934f45a656e6884d82fcd61d54cb2", "score": "0.6538189", "text": "function infoBox(){\n\t//\tCreate a new instance of Google Maps infowindows\n\tvar infobox = new google.maps.InfoWindow();\n\t// Adding a click event to the Marker\n\tgoogle.maps.event.addListener(marker, \"click\", function(){\n\t\t//\tsetContent is just like innerHTML. You can write HTML into this document\n\t\tinfobox.setContent(\"<div><strong>\"+marker.title+\"</strong></div><hr>\"+\n\t\t\t\t\t\t\t\"<div>\"+marker.description+\"</div>\"\n\t\t\t);\n\t\t//\tOpening the infoBox\n\t\tinfobox.open(map, marker);\n\t});\n\n}", "title": "" }, { "docid": "6bb7bf7983123c00ab574cc6a7abcff9", "score": "0.6532757", "text": "function insertMicrosoftMarker(map) {\n // Microsoft Location\n var MicrosoftLocation = new google.maps.LatLng(47.6371, -122.1237);\n var MicrosoftLocationMarker = new google.maps.Marker({\n position: MicrosoftLocation,\n icon: {\n url: \"http://maps.google.com/mapfiles/ms/icons/green-dot.png\"\n }\n });\n\n MicrosoftLocationMarker.setMap(map);\n\n // This block of code is for the small info window\n var contentMicrosoft =\n ' <h1 style=\"text-align: center;\">MICROSOFT CORPORATION</h1>' +\n ' <img src=\"./assets/Images/microsoftInfoImg.jpg\"' +\n ' style=\"float:left; width: 34%; border-radius: 30px 50px 0 50px; float: left; width: 34% !important;\">' +\n ' <p style = \"text-align: center;\"><b>MICROSOFT</b> is an American multinational technology company ' +\n 'with headquarters in Redmond, Washington. The company develops, manufactures, licenses, supports, ' +\n 'and sells computer software <br>' +\n '<a href=\"https://en.wikipedia.org/wiki/Microsoft\"><button type=\"button\" class=\"common-btn-styling\">LEARN MORE!</button></a>' +\n ' </p>';\n\n\n var infoMicrosoft = new google.maps.InfoWindow({\n content: contentMicrosoft\n });\n\n\n\n var MicrosoftLocationInfo = new google.maps.InfoWindow({\n content: \"MICROSOFT\"\n });\n\n google.maps.event.addListener(MicrosoftLocationMarker, 'click', function () {\n MicrosoftLocationInfo,\n infoMicrosoft.open(map, MicrosoftLocationMarker);\n });\n}", "title": "" }, { "docid": "b5efcda7a375a382a6bd777e673fa4da", "score": "0.65213406", "text": "function createMarker(point,infoWin, icon) {\r\n var marker = new GMarker(point, {icon:icon});\r\n GEvent.addListener(marker, \"click\", function() {\r\n marker.openInfoWindowHtml(infoWin);\r\n });\r\n return marker;\r\n }", "title": "" }, { "docid": "b894095b470a01be08af7a03238b3b29", "score": "0.6514206", "text": "function showInfoWindow(event) {\n\tvar $elementFired = $( event.data.elementPlotter );\n\t\n\tif (exists($elementFired)) {\n\t\tvar id = $elementFired.attr('item-id');\n\t\t\n\t\tif (id) {\n\t\t\tfor (var indexInfoMarks = 0; indexInfoMarks < markers.length; indexInfoMarks++) {\n\t\t\t\tvar infoMark = markers[indexInfoMarks];\n\t\t\t\t\n\t\t\t\tif (infoMark.id == id) {\n\t\t\t\t\tnew google.maps.event.trigger( infoMark.googleOBJ , 'click' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0e41a0feee0e4cc78fcc10fe54712135", "score": "0.6513926", "text": "function createInfoWindow(marker, content) {\n // open info window with created content\n infoWindow = new google.maps.InfoWindow({\n content: content\n });\n\n infoWindow.open(map, marker);\n \n // turn popover windows on\n $('[data-toggle=\"popover\"]').popover();\n\n // to close mobile popovers\n $('[data-toggle=\"popover\"]').click(function(evt) {\n $(this).popover(\"hide\");\n });\n\n\n }", "title": "" }, { "docid": "bda4c9928f6687dbd78126a8f7305906", "score": "0.6495825", "text": "function pushMarker(json) {\n\n geocode({ 'address': json.location }, function (results, status) {\n if (status != google.maps.GeocoderStatus.OK) {\n console.log(status);\n return;\n }\n var coordinates = results[0].geometry.location;\n // if the coordinates are fine, create the marker and the infoWindow\n if (status == google.maps.GeocoderStatus.OK) {\n // check if the marker is already on the named location\n var getIndex;\n for (var i = 1; i < markers.length; i++) {\n if (coordinates.G == markers[i].getPosition().lat() && coordinates.K == markers[i].getPosition().lng()) {\n getIndex = i;\n break;\n }\n }\n // if the marker already exists, just change the infoWindow\n if (getIndex != null) {\n var content = infoViews[getIndex - 1].getContent();\n }\n // create the content of the infoWindow\n var contentString =\n '<div id=\"content\">' +\n '<div id=\"siteNotice\">' +\n '</div>' +\n '<h1 id=\"firstHeading\" class=\"firstHeading\">' + json.title + '</h1>';\n\n if (json.related != null) {\n contentString = contentString + '<h4 style=\"font-size: small;font-style: italic\">' + json.artist + ' is related to ' + json.related + '</h4>';\n }\n\n var contentString = contentString +\n '<h5 id=\"secondHeading\">' + json.type + '</h5>' +\n '<div id=\"bodyContent\">' +\n '<p>' + json.description + '</p>' +\n '</div>' +\n '</div>';\n\n // if marker already on the map, just change the content \n if (getIndex != null) {\n var newContent = content + contentString;\n infoViews[getIndex - 1].setContent(newContent);\n markers[getIndex].title = 'Miscellaneous';\n var icon = 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=M|00FF00|0000FF';\n markers[getIndex].setIcon(icon);\n markers[getIndex].addListener('click', function () {\n infoViews[getIndex - 1].open(map, markers[getIndex]);\n });\n return;\n }\n // otherwise\n else {\n // create the infoWindow containing the content string\n var infoWindow = new google.maps.InfoWindow({\n content: contentString\n });\n infoViews.push(infoWindow);\n\n // set the propper icon\n var icon;\n if (json.type == 'TwitterLocation') {\n icon = 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=T|4099FF|0000FF'\n } else if (json.type == 'Tweet') {\n icon = 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=T|4099FF|0000FF'\n } else if (json.type == 'Performance') {\n icon = 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=P|FF4500|0000FF'\n } else if (json.type == 'Release') {\n icon = 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=R|9400D3|0000FF'\n }\n\n var marker = new google.maps.Marker({\n animation: google.maps.Animation.DROP,\n icon: icon,\n position: coordinates,\n map: map,\n title: json.title\n });\n markers.push(marker);\n\n marker.addListener('click', function () {\n infoWindow.open(map, marker);\n });\n }\n }\n });\n}", "title": "" }, { "docid": "40a654230456f6bae2c4706e93eab203", "score": "0.64626884", "text": "function openInfoWindow(marker) {\n if (infoWindow.marker !== marker) {\n infoWindow.marker = marker;\n infoWindow.setContent(buildInfoContent(marker));\n infoWindow.open(self.map, marker);\n infoWindow.addListener('closeclick', function () {\n infoWindow.marker = null;\n });\n getYelpInfo(marker);\n }\n }", "title": "" }, { "docid": "5a4dd803ed3f8fbdc7be5dd2cc8c857d", "score": "0.64554787", "text": "function showInfoWindow() {\n var marker = this;\n jsonifyPlace(marker);\n console.log(\"Debugging Marker\" , marker);\n placesService.getDetails({ placeId: marker.placeResult.place_id }, \n function(place,status) {\n if (status !== google.maps.places.PlacesServiceStatus.OK) {\n return;\n }\n infoWindow.open(map, marker);\n buildIWContent(place);\n });\n}", "title": "" }, { "docid": "3348b6dd083e9ddc92b8c60f35828c4c", "score": "0.64273983", "text": "function addMarker(lat, lon, contentString) {\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng(lat,lon),\n map: map\n });\n //create info windows for the markers on the map\n var infoWindow = new google.maps.InfoWindow({\n content: contentString\n });\n //open the info window when the marker is clicked\n \t google.maps.event.addListener(marker, 'click', function() {\n \t infoWindow.open(map,marker);\n \t });\n }", "title": "" }, { "docid": "39cb7baaeb593ee69e37c9aad507109e", "score": "0.6421318", "text": "function showInfoMessage(sMessage) {\n ppsc().showInfoMessagePane(sMessage);\n}", "title": "" }, { "docid": "2fa50a15ee6b65a7188e65974e369a49", "score": "0.64210564", "text": "function populateInfoWindow(marker) {\n var infowindow = largeInfowindow;\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent('<div>' + marker.title + '</div>');\n infowindow.open(map, marker);\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n });\n }\n}", "title": "" }, { "docid": "9b5736c3bf05bed137fe911e3f34511c", "score": "0.64092964", "text": "function infoMarkers(marker){\r\n\t\t\tvar infowindow = new google.maps.InfoWindow({\r\n\t\t\t content: marker.title,\r\n\t\t\t});\r\n\t\t\t \r\n\t\t\tmarker.addListener('click', function(){\r\n\t\t\t infowindow.open(marker.get('map'),marker);\r\n\t\t\t});\r\n\r\n\t\t}", "title": "" }, { "docid": "33739e50a5931c8fc047f1f16c4d172d", "score": "0.640443", "text": "function setupInfoWindow(marker) {\n\n var favoBtn = $('#favo-btn');\n var span = $('#favo-span');\n var place_id = marker.place_id;\n\n if (favos.includes(place_id)) {\n marker.is_favo = true;\n }\n\n toggleFavoBtn(marker.is_favo);\n\n favoBtn.on('click', function () {\n\n marker.is_favo = !marker.is_favo;\n var isFavo = marker.is_favo;\n\n toggleFavoBtn(isFavo);\n\n if (isFavo) {\n favos.push(marker.place_id);\n } else {\n favos.pop('marker_id');\n }\n });\n\n function toggleFavoBtn(isFavo) {\n var favoHtml = '<i class=\"fas fa-heart\"></i> Favorate!';\n var notFavoHtml = 'Add to Favo'\n\n if (isFavo) {\n favoBtn.html(favoHtml);\n } else {\n favoBtn.html(notFavoHtml);\n }\n\n favoBtn.toggleClass('btn-danger', isFavo);\n favoBtn.toggleClass('btn-success', !isFavo);\n }\n}", "title": "" }, { "docid": "b797b3e72542b8866e3f7ce73fd08317", "score": "0.6402216", "text": "function bindInfoWindow(marker, map, infowindow, description) {\n marker.addListener('click', function() {\n infowindow.setContent(description);\n infowindow.open(map, this);\n });\n}", "title": "" }, { "docid": "7fcbcdb5ba4a1283050ae1d4869629ed", "score": "0.63993895", "text": "function showInfoWindow(marker)\n {\n\n var address;\n var linkContent;\n var openInNewAttrs = \"\";\n\n /* jshint validthis: true */\n // 1. if there’s no window\n if (oWin === null)\n {\n oWin = new google.maps.InfoWindow({ content: \"\" });\n }\n\n // 2. Converts address to string with only +'s not spaces'\n if( marker.address ) {\n address = marker.address.split(' ').join('+');\n }\n\n if( marker.openInNew !== undefined && marker.openInNew ) {\n openInNewAttrs = ' target=\"_blank\" ';\n }\n\n if (marker.linkText && marker.linkHref) {\n linkContent = '<a ' + openInNewAttrs + ' href=\"'+ marker.linkHref +'\">' + marker.linkText + '</a>';\n } else {\n linkContent = '<a ' + openInNewAttrs + ' href=\"https://www.google.com/maps?daddr='+ address +'\">Get directions</a>';\n }\n\n\n // 3. set the content + show it\n oWin.setContent(\n '<strong class=\"map__info-window\">'+marker.title+'</strong>' +\n '<br>' +\n linkContent\n );\n oWin.open(oMap, marker);\n }", "title": "" }, { "docid": "8a8f245c9277c5ba78c6beb5a247242d", "score": "0.63964105", "text": "function addInfoWindow(map, marker, infowindow) {\n\tmarker.addListener('click', function() {\n\t\tinfowindow.setContent('<div id=\"stationinfo_' + marker.get('station_id') + '\">Loading station info for station ' + marker.get('station_id') + '...</div>');\n\t\tinfowindow.open(map, marker);\n\t\tget_station(marker.get('station_id'));\n\t});\n}", "title": "" }, { "docid": "1bbfe39ca3aa748147fdf86f0a44cbd4", "score": "0.63910156", "text": "function openInfoWindow() {\n infobox.close();\n infobox.setContent(contentString.replace('%user', walker.user).replace('%phone', walker.phone));\n infobox.setOptions(infoBoxOptions);\n infobox.open(map, marker);\n }", "title": "" }, { "docid": "841cc3972f33347ae35dccda964a0b22", "score": "0.63893116", "text": "function createMarker(point, map) {\n\tvar markerInfoWindow = new google.maps.InfoWindow({\n\t\tcontent: \"Coordinates: (\" + point.lat() +\",\"+ point.lng() +\")\"\n\t});\n\t\n\tvar marker = new google.maps.Marker({\n\t\tposition: point,\n\t\tmap: map\n\t});\n\t\n\tgoogle.maps.event.addListener(marker, 'click', function() {\n\t\tmarkerInfoWindow.open(map, marker);\n\t});\n}", "title": "" }, { "docid": "940f1b5c3506309994e6796e9f50a9d2", "score": "0.6385021", "text": "function createMarker(latlng, name, address1, address2){\n var marker = new google.maps.Marker({\n map: map,\n position: latlng,\n title: name,\n icon: pawIcon\n });\n\n // This event expects a click on a marker\n // When this event is fired the Info Window content is created\n // and the Info Window is opened.\n google.maps.event.addListener(marker, 'click', function() {\n \n // Creating the content to be inserted in the infowindow\n var iwContent = '<div id=\"iw_container\">' +\n '<div class=\"iw_title\">' + name + '</div>' +\n '<div class=\"iw_content\">' + address1 + '<br />' +\n address2 + '<br />' +\n '</div></div>';\n \n // including content to the Info Window.\n infoWindow.setContent(iwContent);\n\n // opening the Info Window in the current map and at the current marker location.\n infoWindow.open(map, marker);\n });\n}", "title": "" }, { "docid": "bffb851b5d3f027a6d350a6f3422873a", "score": "0.6381347", "text": "function addMarkers(location, map, placeName) {\n infowindow = new google.maps.InfoWindow({\n content: '<p>More Info About <b>' + placeName + '</b></p>'\n }); // Create the text window\n var marker = new google.maps.Marker({\n position: location,\n map: map\n }); // Create the marker\n markers.push(marker); // Add to array of markers\n marker.addListener('click', function() {\n infowindow.open(map, marker);\n infowindow.setContent('<p><b>' + placeName + '</b></p>');\n }); // onClickListener for text window\n }", "title": "" }, { "docid": "a8ed5d5498bf760a7988464db2ef84d3", "score": "0.6369381", "text": "function openmarkerinfowindow(markerele, markerid) {\r\n\r\n\t//Google marker click handling\r\n\tif (mapstraction.api == \"google\") {\r\n\r\n\t\tmarkerele.openInfoWindowHtml(genmarkerinfohtml(pospopup_markerinfo[markerid]));\r\n\r\n\t} else if (mapstraction.api == \"multimap\") {\r\n\r\n\t\tmarkerele.openInfoBox(genmarkerinfohtml(pospopup_markerinfo[markerid]));\r\n\r\n\t} else if (mapstraction.api == \"openlayers\") {\r\n\r\n\t\tif (markerele.popup == null) {\r\n\r\n\r\n\r\n//??????????????????????????????????????????????????????????????\r\n\r\n\t\t\tvar point = new OpenLayers.LonLat(90, 90);\r\n\r\n\t\t\tvar popup = new OpenLayers.Popup.AnchoredBubble(\r\n\t\t\t\tnull,\r\n\t\t\t\tpoint,\r\n\t\t\t\tnew OpenLayers.Size(200, 120),\r\n\t\t\t\tgenmarkerinfohtml(pospopup_markerinfo[markerid]),\r\n\t\t\t\tnull,\r\n\t\t\t\ttrue\r\n\t\t\t);\r\n\r\n\t\t\tmarkerele.popup = popup;\r\n\r\n\t\t\tbasemap.addPopup(popup);\r\n\r\n\t\t} else {\r\n\t\t\tmarkerele.popup.toggle();\r\n\t\t}\r\n\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "2b56c5ac04c05d96d212d40b21faf920", "score": "0.6363715", "text": "function addMarker(lat,lng,title,message){\n console.log(message)\n L.marker([lat,lng]).addTo(map).bindPopup(`<h2>${title}</h2>`)\n createButtons(lat,lng,title); \n return message\n}", "title": "" }, { "docid": "10f484550c27dd44123a3b1c261c457b", "score": "0.6362397", "text": "function insertIBMMarker(map) {\n // IBM Location\n var IBMLocation = new google.maps.LatLng(41.1264849, -73.7140195);\n var IBMLocationMarker = new google.maps.Marker({\n position: IBMLocation,\n icon: {\n url: \"http://maps.google.com/mapfiles/ms/icons/blue-dot.png\"\n }\n });\n\n IBMLocationMarker.setMap(map);\n\n // This block of code is for the small info window\n var contentIBM =\n ' <h1 style=\"text-align: center;\">IBM CORPORATION</h1>' +\n ' <img src=\"./assets/Images/ibmInfoImg.jpg\"' +\n ' style=\"float:left; width: 34%; border-radius: 30px 50px 0 50px; float: left; width: 34% !important;\">' +\n ' <p style = \"text-align: center;\"><b>IBM</b> is an American multinational information technology company ' +\n 'headquartered in Armonk, New York. The company produces and sells computer hardware, middleware and software, <br>' +\n '<a href=\"https://en.wikipedia.org/wiki/IBM\"><button type=\"button\" class=\"common-btn-styling\">LEARN MORE!</button></a>' +\n ' </p>';\n\n var infoIBM = new google.maps.InfoWindow({\n content: contentIBM\n });\n\n var IBMLocationInfo = new google.maps.InfoWindow({\n content: \"IBM\"\n });\n\n google.maps.event.addListener(IBMLocationMarker, 'click', function () {\n IBMLocationInfo,\n infoIBM.open(map, IBMLocationMarker);\n });\n}", "title": "" }, { "docid": "fd6994e97cc029e14be44bb50195b71e", "score": "0.634132", "text": "function doInfo(marker_){\r\n var pin = marker_;\r\n var iwContents = pin.response.replace(/,/g, \",<br/>\");\r\n iwContents += \"<div class='small'>\" + pin.getLatLng().toUrlValue();\r\n iwContents += \"<br/>Accuracy: \" + pin.accuracy;\r\n if (pin.howMany > 1) {\r\n iwContents += \"<br/>\" + pin.howMany;\r\n }\r\n iwContents += \"</div>\";\r\n iwContents += \"<a href='javascript:memo(markers[\" + pin.index + \"])'>Copy to memo area</a>\";\r\n pin.bindInfoWindowHtml(iwContents);\r\n map.openInfoWindowHtml(pin.getLatLng(), iwContents);\r\n}", "title": "" }, { "docid": "ad437198e346bfac5a01f36f14716eb6", "score": "0.63361496", "text": "function showInfoWindow() {\n var marker = this;\n placesService.getDetails({placeId: marker.placeResult.place_id},\n function(place, status) {\n if (status !== google.maps.places.PlacesServiceStatus.OK) {\n return;\n }\n infoWindow.open(map, marker);\n buildIWContent(place);\n });\n }", "title": "" }, { "docid": "f7f898500816df6ed9619b6acecb074a", "score": "0.6333559", "text": "function showInfo(marker, content)\n{\n // Start div\n let div = \"<div id='info'>\";\n if (typeof(content) == \"undefined\")\n {\n // http://www.ajaxload.info/\n div += \"<img alt='loading' src='/static/ajax-loader.gif'/>\";\n }\n else\n {\n div += content;\n }\n\n // End div\n div += \"</div>\";\n\n // Set info window's content\n info.setContent(div);\n\n // Open info window (if not already open)\n info.open(map, marker);\n}", "title": "" }, { "docid": "f7f898500816df6ed9619b6acecb074a", "score": "0.6333559", "text": "function showInfo(marker, content)\n{\n // Start div\n let div = \"<div id='info'>\";\n if (typeof(content) == \"undefined\")\n {\n // http://www.ajaxload.info/\n div += \"<img alt='loading' src='/static/ajax-loader.gif'/>\";\n }\n else\n {\n div += content;\n }\n\n // End div\n div += \"</div>\";\n\n // Set info window's content\n info.setContent(div);\n\n // Open info window (if not already open)\n info.open(map, marker);\n}", "title": "" }, { "docid": "c3344eca22dc7077f6017531e2cdd599", "score": "0.6333502", "text": "function createInfoWindow(marker, infowindow) {\n // Verify if the info window is already open\n if (infowindow.marker != marker) {\n // Set the current infowindow to the marker\n infowindow.marker = marker;\n // Create a basic content with the title of the marker\n infowindow.setContent('<div class=\"text-dark font-weight-bold\">'+ marker.title +'</div>');\n // Get a photo of the marker from Foursquare API and\n // set info window content\n getFoursquareContent(marker, infowindow);\n // Add a function to the close button on the info window\n infowindow.addListener('closeclick', function(){\n infowindow.marker = null;\n })\n // Open the info windows\n infowindow.open(map, marker);\n }\n}", "title": "" }, { "docid": "b647814dde270acfce837be847abe7f3", "score": "0.6332401", "text": "function addMarker(map,info_friend,info_bulle){\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng(info_friend.lat, info_friend.lng),\n label: \"\" + info_friend.name,\n map: map,\n title : \"Location of \" + info_friend.name\n });\n\n marker.addListener('click', function() {\n info_bulle.open(map, marker);\n });\n return marker;\n}", "title": "" }, { "docid": "2e69c5c7288f38802811574e4ba93338", "score": "0.632989", "text": "function populateInfoWindow(marker, infowindow) {\n if (infowindow.marker == marker) {\n infowindow.marker = marker;\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n marker.setIcon(makeMarkerIcon('0091ff'));\n });\n \n // Add content to info window. Can be made richer and as needed.\n var content = \"<div class='infoWindowTitle'>\" + marker.title + \"</div>\";\n if(marker.content) {\n content += \"<div class='infoWindowContent'>\" + marker.content + \"</div>\";\n }\n \n infowindow.setContent(content);\n infowindow.open(map, marker);\n }\n}", "title": "" }, { "docid": "b3fcded53c2abfaa117f034fe7bc4ca8", "score": "0.6326029", "text": "function setInfoWindow(marker, infoWindow) {\n if (infoWindow.marker != marker) {\n infoWindow.marker = marker;\n infoWindow.setContent(\"<div class='title'>\" + marker.title + \"</div>\" + marker.contentString);\n }\n marker.setAnimation(google.maps.Animation.BOUNCE);\n setTimeout(function() {\n marker.setAnimation(null);\n }, 500);\n infoWindow.open(map, marker);\n \n infoWindow.addListener('closeclick', function() {\n infoWindow.setMarker = null;\n });\n\n //Automatically close info window after 3 seconds\n window.setTimeout(function(){\n infoWindow.close();\n }, 3000);\n }", "title": "" }, { "docid": "ef6d6be918aed3ac6903ea52bb0e74bb", "score": "0.63245285", "text": "function createMarker(latlng, name, address1){\r\n var marker = new google.maps.Marker({\r\n map: map,\r\n position: latlng,\r\n title: name,\r\n icon : {url:'images/'+name+'.jpg',scaledSize:new google.maps.Size(50,50),}\r\n });\r\n\r\n // This event expects a click on a marker\r\n // When this event is fired the Info Window content is created\r\n // and the Info Window is opened.\r\n google.maps.event.addListener(marker, 'click', function() {\r\n \r\n // Creating the content to be inserted in the infowindow\r\n var iwContent = '<div id=\"iw_container\">' +\r\n '<div class=\"iw_title\">' + name + '</div>' +\r\n '<div class=\"iw_content\">' + address1 + '<br />' +\r\n '</div></div>';\r\n \r\n // including content to the Info Window.\r\n infoWindow.setContent(iwContent);\r\n\r\n // opening the Info Window in the current map and at the current marker location.\r\n infoWindow.open(map, marker);\r\n });\r\n}", "title": "" }, { "docid": "f1dbbe4d2cd400d94f020702191a4513", "score": "0.6318931", "text": "function initMakerInfoWindow(marker, markerGoogle) {\n\tgoogle.maps.event.addListener(markerGoogle, 'click', function() {\n\t\tcloseAllMarkersWindows();\n\t\t\n \tvar infowindow = new InfoBubble({\n\t\t\tcontent: buildInfoWindow(marker),\n\t\t\tpadding: 0\n\t\t});\n \tinfowindow.open(MAP_MAIN, markerGoogle);\n \t\n \tinfoWindows[marker.id] = infowindow;\n });\n}", "title": "" }, { "docid": "b04d4f029a89b4d6eb75cd0ce010d601", "score": "0.63181686", "text": "function populateInfoWindow(marker, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.marker.setAnimation(google.maps.Animation.BOUNCE);\n infowindow.setContent( '<h2>' + marker.text + '</h2>' + '<div>' + marker.title + '</div>');\n infowindow.open(map, marker);\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n });\n }\n}", "title": "" }, { "docid": "1347e38f2b08d79ab78fbaeb39098abe", "score": "0.63126093", "text": "function createMarker(map,point,image, txt) {\n var marker = new google.maps.Marker({\n position: point,\n map: map,\n icon: image\n });\n\n \n\n var infowindow = new google.maps.InfoWindow({\n content: txt\n });\n google.maps.event.addListener(marker, 'click', function() {\n \n infowindow.open(map,marker);\n \n });\n \n \n return marker;\n }", "title": "" }, { "docid": "88082d52b5c13cab4852d4c46d516e88", "score": "0.6311062", "text": "function populateInfoWindow(marker, popupContent) {\n google.maps.event.addListener(marker, 'click', function () {\n infoWindow.setContent(popupContent);\n\n\n\n if (marker.getAnimation() !== null) {\n\n this.setAnimation(null);\n marker.setIcon('assets/img/map-marker.png');\n infoWindow.close(map, this);\n } else {\n //setTimeout(function(){ this.setAnimation(google.maps.Animation.BOUNCE); }, 750);\n marker.setAnimation(google.maps.Animation.BOUNCE);\n setTimeout(function(){ marker.setAnimation(null); }, 1400);\n marker.setIcon('assets/img/map-marker.png');\n infoWindow.open(map, this);\n }\n });\n }", "title": "" }, { "docid": "33d80b05da3308ecb4ed34ed1a175142", "score": "0.6299481", "text": "function showInfoWindow() {\n var marker = this;\n places.getDetails({\n placeId: marker.placeResult.place_id,\n },\n function(place, status) {\n if (status !== google.maps.places.PlacesServiceStatus.OK) {\n return;\n }\n infoWindow.open(map, marker);\n buildIWContent(place);\n }\n );\n}", "title": "" }, { "docid": "0657018da17e6a220e77be88633df39e", "score": "0.6298642", "text": "function addMarker(props) {\n const marker = new google.maps.Marker({\n position: props.coords,\n map: map,\n animation: google.maps.Animation.DROP,\n icon: props.iconImage\n });\n if (props.iconImage) {\n marker.setIcon(props.iconImage);\n }\n\n const infoWindow = new google.maps.InfoWindow({\n content: props.content\n })\n marker.addListener('click', function () {\n infoWindow.open(map, marker);\n setTimeout(function(){infoWindow.close();}, '2000');\n });\n }", "title": "" }, { "docid": "1f8513acd665a295ae1629da0c020ff2", "score": "0.62985164", "text": "function showInfo(marker, content)\n{\n // start div\n var div = \"<div id='info'>\";\n if (typeof(content) === \"undefined\")\n {\n // http://www.ajaxload.info/\n div += \"<img alt='loading' src='img/ajax-loader.gif'/>\";\n }\n else\n {\n div += content;\n }\n\n // end div\n div += \"</div>\";\n\n // set info window's content\n info.setContent(div);\n\n // open info window (if not already open)\n info.open(map, marker);\n}", "title": "" }, { "docid": "1f8513acd665a295ae1629da0c020ff2", "score": "0.62985164", "text": "function showInfo(marker, content)\n{\n // start div\n var div = \"<div id='info'>\";\n if (typeof(content) === \"undefined\")\n {\n // http://www.ajaxload.info/\n div += \"<img alt='loading' src='img/ajax-loader.gif'/>\";\n }\n else\n {\n div += content;\n }\n\n // end div\n div += \"</div>\";\n\n // set info window's content\n info.setContent(div);\n\n // open info window (if not already open)\n info.open(map, marker);\n}", "title": "" }, { "docid": "1f8513acd665a295ae1629da0c020ff2", "score": "0.62985164", "text": "function showInfo(marker, content)\n{\n // start div\n var div = \"<div id='info'>\";\n if (typeof(content) === \"undefined\")\n {\n // http://www.ajaxload.info/\n div += \"<img alt='loading' src='img/ajax-loader.gif'/>\";\n }\n else\n {\n div += content;\n }\n\n // end div\n div += \"</div>\";\n\n // set info window's content\n info.setContent(div);\n\n // open info window (if not already open)\n info.open(map, marker);\n}", "title": "" }, { "docid": "8532fa96b57c7a911688c16b066902d5", "score": "0.62980664", "text": "function createMarker(point, text) {\n var marker = new GMarker(point);\n\n GEvent.addListener(marker, \"click\", function() {\n\tmarker.openInfoWindowHtml('<div class=\"maptext\">' + text + '</div>');\n });\n return marker;\n}", "title": "" }, { "docid": "c171b7608539cbbfefff2adba7682929", "score": "0.62977505", "text": "function infoWindows(marker, data) {\n //Event listener for when a marker i clicked\n google.maps.event.addListener(marker, \"click\", function (e) {\n //Wrap the content inside an HTML DIV in order to set height and width of InfoWindow.\n infoWindow.setContent(\"<div style = 'max-height:300px'>\" + '<p style=\"font-size: 24px; text-decoration: underline;\"><strong><a href=\"' + data.link + '\" target=\"blank\">' + data.name + '</a></strong></p>' + \"<br><p>\" + data.description + \"</p></div>\");\n //Open the markers infowindow\n infoWindow.open(map, marker);\n });\n }", "title": "" }, { "docid": "ee65fc725a645ddb2212477046830d72", "score": "0.62938803", "text": "function showInfo(marker, content)\n{\n // Start div\n let div = \"<div id='info'>\";\n console.log(typeof(content))\n if (typeof(content) == \"undefined\")\n {\n // loading agax gif\n div += \"<img alt='loading' src='/static/ajax-loader.gif'/>\";\n }\n else\n {\n div += content;\n }\n\n // End div\n div += \"</div>\";\n\n // Set info window's content\n info.setContent(div);\n\n // Open info window (if not already open)\n info.open(map, marker);\n}", "title": "" }, { "docid": "34f8a1a64a4531eb49c72ad060111169", "score": "0.6279808", "text": "function populateInfoWindow(marker, infowindow) {\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent('<div>'+ marker.title +'</div>' +\n '<div>Address: '+ marker.listElement.address +'</div>' +\n '<div> <i class=\"fa fa-foursquare\" aria-hidden=\"true\"></i> Check-Ins: '+ marker.listElement.checkins +'</div>');\n infowindow.open(map, marker);\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n });\n }\n}", "title": "" }, { "docid": "04419463cb787a34ec05d07bc76cd188", "score": "0.62785745", "text": "function setInfoWindow(place, marker) {\n //clone a new element for window content and set the place name\n var content = $(\"#place-info\").clone().removeAttr('id');\n content.find('.name').text(place.name);\n \n //set address if available\n if(typeof place.formatted_address === 'undefined') {\n content.find('.address').remove();\n }\n else {\n content.find('.address').text(place.formatted_address);\n }\n \n //set phone number if available\n if(typeof place.formatted_phone_number === 'undefined') {\n content.find('.phone').remove();\n }\n else {\n content.find('.phone').prop('href', 'tel:' + place.formatted_phone_number).text(place.formatted_phone_number);\n }\n \n //set directions button action\n content.find('button').click(function() {\n app.calcRoute(place.geometry.location);\n app.infoWindow.close();\n });\n \n //set the window content and open it\n app.infoWindow.setContent(content[0]);\n app.infoWindow.open(app.map, marker);\n }", "title": "" }, { "docid": "c2eb7953dc89c649bb42a39cac3c8764", "score": "0.6275959", "text": "function openInfoWindow(locationClick){\n\t\tvar marker = locationClick.marker;\n\t\tvar content = \"<div> \"+ marker.title + \"<br>\" + \"<img src=\"+marker.rating +\"></img><br><img src=\"+ marker.imageSnapShot+\"> </img></div>.\";\n\t\t\tinfowindow.setContent(content); \n \t\tinfowindow.open(map, marker);\n\t}", "title": "" }, { "docid": "9093d42f20061c25ed467f95ad702170", "score": "0.627337", "text": "function showInfoWindow() {\n const marker = this;\n places.getDetails(\n {\n placeId: marker.placeResult.place_id,\n },\n (place, status) => {\n if (status !== google.maps.places.PlacesServiceStatus.OK) {\n return;\n }\n infoWindow.open(map, marker);\n buildIWContent(place);\n }\n );\n}", "title": "" }, { "docid": "ab8306e52e5ffdd1f261eca661a8b0cf", "score": "0.6272118", "text": "function bindInfoWindow(marker, map, infowindow, html) {\n marker.addListener('click', function() {\n infowindow.setContent(html);\n infowindow.open(map, this);\n });\n}", "title": "" }, { "docid": "6b46c9ab6d1ded06a236e702ce3b75c3", "score": "0.62598115", "text": "function createMarker() {\n\t\t\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\t\t\tposition: latLng,\n\t\t\t\t\t\tmap: map,\n\t\t\t\t\t\ttitle: title,\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\tvar infowindow = new google.maps.InfoWindow({\n\t\t\t\t\t\tcontent: title,\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tgoogle.maps.event.addListener(marker, 'click', function() {\n\t\t\t\t\t\tif (lastOpened != undefined) {\n\t\t\t\t\t\t\tlastOpened.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinfowindow.open(map, marker);\n\t\t\t\t\t\tmap.panTo(marker.position);\n\t\t\t\t\t\tlastOpened = infowindow;\n\t\t\t\t\t});\n\t\t\t\t\tmarker.setMap(map);\n\t\t\t\t}", "title": "" }, { "docid": "971e8bb81d9ee46f75533f11b6223704", "score": "0.62584287", "text": "function createMarker(place, open) {\n var loc = place.geometry.location;\n var marker = new google.maps.Marker({\n map: app.map,\n position: loc,\n icon: 'img/smoking-icon.png',\n animation: google.maps.Animation.DROP,\n zIndex:2\n });\n app.smokesMarkers.push(marker);\n \n if(open === true) {\n setInfoWindow(place, marker);\n }\n \n //create new window on marker click\n google.maps.event.addListener(marker, 'click', function() {\n setInfoWindow(place, this);\n });\n \n //set the content for the info window with the associated place and open it\n function setInfoWindow(place, marker) {\n //clone a new element for window content and set the place name\n var content = $(\"#place-info\").clone().removeAttr('id');\n content.find('.name').text(place.name);\n \n //set address if available\n if(typeof place.formatted_address === 'undefined') {\n content.find('.address').remove();\n }\n else {\n content.find('.address').text(place.formatted_address);\n }\n \n //set phone number if available\n if(typeof place.formatted_phone_number === 'undefined') {\n content.find('.phone').remove();\n }\n else {\n content.find('.phone').prop('href', 'tel:' + place.formatted_phone_number).text(place.formatted_phone_number);\n }\n \n //set directions button action\n content.find('button').click(function() {\n app.calcRoute(place.geometry.location);\n app.infoWindow.close();\n });\n \n //set the window content and open it\n app.infoWindow.setContent(content[0]);\n app.infoWindow.open(app.map, marker);\n }\n }", "title": "" }, { "docid": "b23bb1845c4f976a84efdbc1a11f9d68", "score": "0.6251412", "text": "function insertAmazonMarker(map) {\n // Amazon Location\n var AmazonLocation = new google.maps.LatLng(47.626444, -122.337627);\n var AmazonLocationMarker = new google.maps.Marker({\n position: AmazonLocation,\n icon: {\n url: \"http://maps.google.com/mapfiles/ms/icons/red-dot.png\",\n scaledSize: new google.maps.Size(25, 25)\n }\n });\n\n AmazonLocationMarker.setMap(map);\n\n // This block of code is for the small info window\n var contentAmazon =\n ' <h1 style=\"text-align: center;\">AMAZON</h1>' +\n ' <img src=\"./assets/Images/amazonInfoImg.jpg\" ' +\n ' style=\"float:left; width: 34%; border-radius: 30px 50px 0 50px; float: left; width: 34% !important;\">' +\n ' <p style = \"text-align: center;\"><b>Amazon.com</b> is an American multinational technology ' +\n 'company based in Seattle, Washington, that focuses on ' +\n 'e - commerce, cloud computing, digital streaming, and artificial intelligence.<br>' +\n '<a href=\"https://en.wikipedia.org/wiki/Amazon_(company)\"><button type=\"button\" class=\"common-btn-styling\">LEARN MORE!</button></a>' +\n ' </p>';\n\n\n var infoAmazon = new google.maps.InfoWindow({\n content: contentAmazon\n });\n\n\n\n\n var AmazonLocationInfo = new google.maps.InfoWindow({\n content: \"AMAZON\"\n });\n\n google.maps.event.addListener(AmazonLocationMarker, 'click', function () {\n AmazonLocationInfo,\n infoAmazon.open(map, AmazonLocationMarker);\n });\n}", "title": "" }, { "docid": "05e5e665e039b9e5fc9c3d22604f063f", "score": "0.6241167", "text": "function insertSASMarker(map) {\n // SAS Location\n var SASLocation = new google.maps.LatLng(35.822830042, -78.757330304);\n var SASLocationMarker = new google.maps.Marker({\n position: SASLocation,\n icon: {\n url: \"http://maps.google.com/mapfiles/ms/icons/pink-dot.png\"\n }\n });\n\n SASLocationMarker.setMap(map);\n\n // This block of code is for the small info window\n var contentSAS =\n ' <h1 style=\"text-align: center;\">SAS INSTITUTE</h1>' +\n ' <img src=\"./assets/Images/sasInfoImg.jpg\" ' +\n ' style=\"float:left; width: 34%; border-radius: 30px 50px 0 50px; float: left; width: 34% !important;\">' +\n ' <p style = \"text-align: center;\"><b>SAS</b> is an American multinational developer ' +\n 'of analytics software based in Cary, North Carolina. SAS develops and markets a suite of analytics software, ' +\n 'which helps access, manage, analyze data<br>' +\n '<a href=\"https://en.wikipedia.org/wiki/SAS_Institute\"><button type=\"button\" class=\"common-btn-styling\">LEARN MORE!</button></a>' +\n ' </p>';\n\n\n var infoSAS = new google.maps.InfoWindow({\n content: contentSAS\n });\n\n\n\n\n var SASLocationInfo = new google.maps.InfoWindow({\n content: \"SAS\"\n });\n\n google.maps.event.addListener(SASLocationMarker, 'click', function () {\n SASLocationInfo,\n infoSAS.open(map, SASLocationMarker);\n });\n\n}", "title": "" }, { "docid": "4765e0629d739f72428e84dd3a1d4f2a", "score": "0.6237373", "text": "function populateInfoWindow(marker, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent('<div>' + marker.title + '</div>');\n infowindow.open(map, marker);\n \n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n });\n }\n}", "title": "" }, { "docid": "298f73957f69cda3231ae86b0e03bee8", "score": "0.62205946", "text": "function klikInfoWindow(id, marker)\n{\n google.maps.event.addListener(marker, \"click\", function(){\n detailmes_infow(id);\n\n });\n\n}", "title": "" }, { "docid": "5f1201e94ab21bc41ac600c92278e28d", "score": "0.6216926", "text": "function populateInfoWindow(marker, infowindow) {\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent('<div id=infoWindow>' + marker.title + '</div>');\n infowindow.open(map, marker);\n infowindow.addListener('closeclick', function() {\n infowindow.setMarker = null;\n });\n }\n }", "title": "" }, { "docid": "6ba9ee86e80a8b26e1d93d5f288ab459", "score": "0.62150407", "text": "function populateInfoWindow(marker, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent('<div>' + marker.title + '</div>');\n infowindow.open(map, marker);\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n });\n }\n }", "title": "" }, { "docid": "cbd7f3c14f76d75f3de657115b4a55ce", "score": "0.6213655", "text": "function populateInfoWindow(marker, infowindow) {\n\t\t\t// Check to make sure the infowindow is not already opened on this marker.\n\t\t\t\tif (infowindow.marker != marker) {\n\t\t\t\t\t\tinfowindow.marker = marker;\n\t\t\t\t\t\t// Wiki(marker.location);\n\t\t\t\t\t\tmarker.setAnimation(google.maps.Animation.BOUNCE);\n\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\tmarker.setAnimation(null);\n\t\t\t\t\t\t}, 1000);\n\t\t\t\t\t\t// Wiki(marker.location);\n\t\t\t\t\t\t\n\t\t\t\t\t\tinfowindow.setContent(wikicontent + '<hr>' + '<div>' + marker.title + '</div>');\n\t\t\t\t\t\tconsole.log('information window : '+ wikicontent);\n\t\t\t\t\t\tinfowindow.open(map, marker);\n\t\t\t\t\t\t// Make sure the marker property is cleared if the infowindow is closed.\n\t\t\t\t\t\tinfowindow.addListener('closeclick', function() {\n\t\t\t\t\t\t\t\tinfowindow.marker = null;\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t}", "title": "" }, { "docid": "5a76f2fe5e56af21670de744675115d1", "score": "0.6212781", "text": "function makeInfoWindow(marker, map, infowindow, htmlString) {\n google.maps.event.addListener(marker, 'mouseover', function () {\n infowindow.setContent(htmlString);\n infowindow.open(map, marker);\n });\n}", "title": "" }, { "docid": "36abac67d66943d3a3919ba739e190d4", "score": "0.62024885", "text": "function bindInfoWindow(marker, map, infowindow, html, location) \n{\n marker.addListener('click', function() \n {\n \n infowindow.setContent(html);\n infowindow.open(map, this);\n queryMapDetail(location);\n });\n}", "title": "" }, { "docid": "90bffcc7ec3af4a930f4c43c790668f4", "score": "0.6195925", "text": "function showTheInfobox(e) {\n if (e.targetType == 'pushpin') {\n\n var pin = e.target;\n var location = e.target.getLocation();\n var infoBoxEvent = this;\n\n var theInfoboxHTML = '<div class=\"infobox\"><a class=\"infobox_close\" href=\"javascript:hideTheInfobox()\"></a>';\n theInfoboxHTML = theInfoboxHTML + '<div class=\"infobox_content\">' + pin.title + '</div></div>';\n theInfoboxHTML = theInfoboxHTML + '<div classe=\"infobox_pointer\"><img src=\"' + iconInfoboxPointer + '\"></div>';\n\n theInfobox.setLocation(location);\n theInfobox.setOptions({\n visible: true,\n htmlContent: theInfoboxHTML\n });\n }\n}", "title": "" }, { "docid": "826af5d27dd058ffad93b24d7b457599", "score": "0.61920005", "text": "function createMarkerForDisplay(lat, lng, content, address) {\n const marker =\n new google.maps.Marker({position: {lat: lat, lng: lng}, map: map});\n\n content= \"<b>\"+ content+ \"</b>\" + \"<br>\" + address;\n\n const infoWindow = new google.maps.InfoWindow({ content:content});\n marker.addListener('click', () => {\n infoWindow.open(map, marker);\n map.setZoom(9);\n map.setCenter(marker.getPosition());\n });\n}", "title": "" }, { "docid": "db6124f5afbd4b2f72d5988f1fa00e18", "score": "0.61860645", "text": "function addMarker(property){\n\n const marker = new google.maps.Marker({\n position:property.location,\n map:map,\n icon: \"images/hiking.png\"\n });\n\n const detailWindow = new google.maps.InfoWindow({\n content: property.content\n });\n\n // open and close infowindow\n\n marker.addListener(\"click\", () =>{\n if(activeInfoWindow){activeInfoWindow.close();}\n detailWindow.open(map, marker);\n activeInfoWindow = detailWindow;\n })\nmarkers.push(marker);\n}", "title": "" }, { "docid": "9bd3a2cc7c496563f6ddc6b9aaa412ac", "score": "0.61860234", "text": "function showMarkerSelected(id){\n\t// find the marker from google map objectlist\n\t// get the marker details\n\t// create infoWindow with de\n}", "title": "" }, { "docid": "b8eb966cb710f2d0fe1edf7df9dad6e4", "score": "0.6181375", "text": "function populateInfoWindow(marker, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent(\"<div class='markerTitle'>\" + marker.title + \"</div>\");\n infowindow.setContent(\"<div class='markerDescription'>\" + marker.description + \"</div>\");\n infowindow.open(map, marker);\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener(\"closeclick\", function() {\n infowindow.marker = null;\n });\n }\n }", "title": "" }, { "docid": "cf855c3f8ca2279053e02a34eeb2f053", "score": "0.61768645", "text": "function FieldClickListener() {\n google.maps.event.addListener(\n myField,\n 'click',\n function (event) {\n var message = GetMessage(myField);\n myInfoWindow.setOptions({ content: message });\n myInfoWindow.setPosition(myField.center);\n myInfoWindow.open(map);\n }\n );\n}", "title": "" }, { "docid": "1e694b4f512cf22963d93f5f9f5f94b4", "score": "0.6172344", "text": "function showInfoBoxForMarker(marker) {\n\t\tinfobox.close();\n\t\tmarker.setMap(map);\n//\t\t$('#infobox')\n\t\t$(infobox.content_).html('contractee: '+marker.data.contract_operator_official_name);\n\t\tinfobox.open(map, marker);\n\t}", "title": "" } ]
608e0487be94faf3c430eb4727482278
Teardown step for the test functions. This needs to be called from test teardown.
[ { "docid": "6ce478178762c3ab6b1b87a78a2a3f42", "score": "0.63713706", "text": "tearDown() {\n for (var i = 0; i < MAX_INSTANCE_COUNT; i++) {\n dispose(eventTargets[i]);\n }\n }", "title": "" } ]
[ { "docid": "a1cefabc6b133f584146bba80aa1ddc1", "score": "0.762369", "text": "function SampleClass_teardown () { }", "title": "" }, { "docid": "ccf64ce11a4a0ec0f03f97bf300f18ba", "score": "0.7585319", "text": "teardown() {\n // NOOP\n }", "title": "" }, { "docid": "11a2f51bf0dbaa62c81e3cd904835f0f", "score": "0.75496686", "text": "testCleanup() { }", "title": "" }, { "docid": "0cd31d465c1ed4446f93e32ced70038a", "score": "0.75103366", "text": "async teardown() {\n await Promise.all(\n this.cleanup\n .filter(Boolean) // Remove possible undefineds.\n .map(fn => fn()) // Execute so we get promise instances.\n .filter(Boolean) // Clean up again, to remove non-async functions.\n );\n\n this.cleanup.length = 0;\n this.screen.restore();\n this.runner = null;\n }", "title": "" }, { "docid": "56cd91bcea80ec47196ab192ca3489ff", "score": "0.7415307", "text": "function teardown() {\n\tteardownSiteHeader();\n}", "title": "" }, { "docid": "a20728caa3a9bcfdfbabf6bc5f610e11", "score": "0.7408456", "text": "function teardown() {\n\tteardownTocNav();\n}", "title": "" }, { "docid": "f421ed36b7a4ad9644d0fd08b27c2e95", "score": "0.72264683", "text": "async teardown() {\n return this.pageDataGatherer.shutdown();\n }", "title": "" }, { "docid": "01f931cfa18eaf98a1293db1d1465127", "score": "0.6806363", "text": "function teardown() {\n\t\tbgStop();\n\n\t\t// Stop karts\n\t\tfor(i=0;i<karts.length;i++){\n\t\t\tkarts[i].tearDown();\n\t\t}\n\t\tif(bgMusic) window._AVManager.removeAudio(bgMusic);\n\t\tbgMusic = null;\n\t}", "title": "" }, { "docid": "5c2c46435ab5e2eeb5e75828ff6a089f", "score": "0.67648613", "text": "async teardown() {\n this.browser.close();\n }", "title": "" }, { "docid": "b844ecaddd19fd37d3a15d562477e85d", "score": "0.6711876", "text": "teardown() {\n if(this.eventFunctions.size) {\n this.eventFunctions.forEach((listeners, event) => {\n listeners.forEach(listener => {\n this.client.removeListener(event, listener);\n })\n });\n }\n }", "title": "" }, { "docid": "7e0cca4e6f5d947879f5537461dc665d", "score": "0.66786236", "text": "function teardown() {\n\t\t// TODO: stop the page\n\t\tconsole.log(\"super-mario-galaxy page teardown\");\n\n\t\t$('#content #galaxy-scene').parallax('disable').find('div').removeClass('animated');\n\t\n\t\tif(bgMusic) window._AVManager.removeAudio(bgMusic);\n\t\tbgMusic = null;\n\t}", "title": "" }, { "docid": "38897cb4b282b24a67974c2de0e55521", "score": "0.66243625", "text": "async teardown(): Promise<void> {\n try {\n await this._controlApi.teardown(this.id);\n\n } catch (error) {\n if (ApiError instanceof ApiError && error.type === 'unsupported-api-version') {\n throw new TestError('Unsupported API version.');\n }\n\n if (ApiError instanceof ApiError && error.type === 'unknown-test') {\n throw new TestError(`Unable to teardown unknown test \"${this.id}\".`);\n }\n\n if (ApiError instanceof ApiError && error.type === 'teardown-failed') {\n throw new TestError(`Teardown of test \"${this.id}\" using scenario \"${this.scenario}\" failed with error.`);\n }\n\n throw error;\n }\n }", "title": "" }, { "docid": "e2a8a338a20dcd59e902c7bd9ab8687a", "score": "0.6610156", "text": "async teardown() {\n // here you can clear fixtures, etc.\n // (e.g. you might want to destroy the records you created above)\n\n // stop the backend server because if something after this needs need to run another server\n // it will collide and fail with this running instance\n if (sails) sails.lower();\n\n // so garbage collection doesn't have anything useless laying around it is useless\n // because a lowered sails server, cannot be re-lifted, a new instanceh has to be made\n sails = null;\n }", "title": "" }, { "docid": "a515c966553e7bd2d5cb7d1a7ddf41a3", "score": "0.66073024", "text": "function teardown() {\n\t\tpageReady = false;\n\t\tstageParts.stage.unbind('click');\n\t\tstageParts.scene.add(stageParts.background).parallax('disable');\n\t\t\n\t\tif(sounds) window._AVManager.removeAudios(sounds);\n\t\tsounds = null;\n\t}", "title": "" }, { "docid": "2635ac39ac42312b79fd2c8d8cf00967", "score": "0.6585082", "text": "tearDown(callback) {\n callback();\n }", "title": "" }, { "docid": "2c46b0d5ead3db1d9c193d94f6f9820e", "score": "0.65833676", "text": "function tearDown() {\n mockController.verifyMocks();\n mockController.reset();\n mockTimer.uninstall();\n}", "title": "" }, { "docid": "9fa5ba466f642ac15229cf57f975a4e4", "score": "0.6568441", "text": "teardown() {\n if (this.active) {\n // remove self from vm's watcher list\n // this is a somewhat expensive operation so we skip it\n // if the vm is being destroyed.\n if (!this.vm._isBeingDestroyed) {\n remove(this.vm._watchers, this);\n }\n\n let i = this.deps.length;\n\n while (i--) {\n this.deps[i].removeSub(this);\n }\n\n this.active = false;\n }\n }", "title": "" }, { "docid": "2607cef22c2f2a70cb9646709c35d6d8", "score": "0.65513366", "text": "function cleanUp() {\n }", "title": "" }, { "docid": "154a329b8c5f6f20ce46e4f73226b098", "score": "0.65470237", "text": "teardown() {\n this.clear(true);\n this.$player.off('click.vac-controls');\n $(document).off(`keyup.vac-nav-${this.playerId} mousemove.vac-tooltip-${this.playerId}`);\n if (this.playerButton) this.playerButton.teardown();\n super.teardown();\n }", "title": "" }, { "docid": "424253a1bf64205276a007231d004a5b", "score": "0.6528843", "text": "function teardown() {\n\t\tif(config.logging) log('Handhelds.teardown()');\n\n\t\t//SET STATE (before undefining everything)\n\t\t$(art).hide();\n\t\tclearTimeout(playVideoLoopTimeout);\n\t\tplayVideoLoopTimeout = null;\n\t\tif(videoLoopIsPlaying){\n\t\t\tstopVideoLoop();\n\t\t}\n\n\t\t//TEARDOWN VIEW\n\t\tview.id = view.id+'__old';//Change the old view's id, so it can't accidentally be found by the new ViewController.\n\n\t\tview = null;\n\t\t$view = null;\n\t\tart = null;\n\t\t\tmainStage = null;\n\t\t\tart = null;\n\t\t\t\tart__inner = null;\n\t\t\t\t\tconsolesElement = null;\n\t\t\t\t\t\tgameBoy = null;\n\t\t\t\t\t\t\tgameBoy__video = null;\n\t\t\t\t\t\tgameBoyAdvance = null;\n\t\t\t\t\t\t\tgameBoyAdvance__video = null;\n\t\t\t\t\t\tnintendoDS = null;\n\t\t\t\t\t\t\tnintendoDS__video = null;\n\t\tconsoles = null;\n\t\twindow._AVManager.removeVideos(videos);\n\t\tvideos = null;\n\n\t\t//TEARDOWN CONTROLLER\n\t\tinited = false;\n\t\treadied = false;\n\t\tmousePosition = null;\n\n\t\t//TEARDOWN INTERACTION\n\t\t$(window).unbind('resize', onResize);\n\t\t$(window).unbind('mousemove', onMouseMove);\n\t}", "title": "" }, { "docid": "e4862722bc4f00c9503f880cc59666f2", "score": "0.6506652", "text": "TearDown()\n\t{\n\t\tconst self = this\n\t\tself.hasBeenTornDown = true\n\t\tconsole.log(\"♻️ Tearing down Wallet\", self._id)\n\t\tself._tearDown_polling()\n\t}", "title": "" }, { "docid": "fc318a3be285cd841c81bb51d3911493", "score": "0.6497569", "text": "function cleanup(cb){\n teardown(peri.device,0,function(){\n teardown(peri.device,1,function(){\n teardown(peri.device,2,function(){\n setTimeout(function(){\n peri.device.close();\n cb();\n },1000);\n });\n });\n });\n}", "title": "" }, { "docid": "6aa3e414be1341551a9c1e5c44d412ce", "score": "0.6490503", "text": "function teardown () {\n removeNativeEventListeners()\n removeNativeElement()\n app.off('unmount', onunmount)\n app.off('mount', onmount)\n app.off('source', onupdate)\n }", "title": "" }, { "docid": "fb6aa4f49d05eccd96d151015bf7c21c", "score": "0.6481286", "text": "function _testSuiteCleanUp() {\n return ImptTestHelper.productDelete(PRODUCT_NAME);\n }", "title": "" }, { "docid": "0e90169b55102ab37076a316dd97e56e", "score": "0.6457201", "text": "cleanup() {\n\t}", "title": "" }, { "docid": "db896188bfca95b6b7344e7c1d31a8f6", "score": "0.6453933", "text": "function unsetContext() {\n __test_context__ = undefined;\n }", "title": "" }, { "docid": "f871a528c7dd2284436120b9ac1139ab", "score": "0.6431822", "text": "function _testSuiteCleanUp() {\n return ImptTestHelper.productDelete(PRODUCT_NAME);\n }", "title": "" }, { "docid": "78274e0b4bbcf6c24bc83c9d8223dde4", "score": "0.64309496", "text": "function afterEachTest() {\n delete process.env.NEW_RELIC_SEND_INTERVAL_MS;\n\n // stop the queue so no pending timers that would block end of mocha execution\n sendQueue.stop();\n\n // nock does not support a way to just \"clean\" a single scope (metricsNock)\n // nock.removeInterceptor() or scope.persist(false) do not work the same way,\n // only cleanAll() gives the proper reset\n nock().cleanAll();\n\n metricsNock = undefined;\n}", "title": "" }, { "docid": "532da8358282e981be9eda3c810efc30", "score": "0.64216566", "text": "_cleanup() {\n this._executor = null;\n this._ifaces = null;\n this.state = null;\n }", "title": "" }, { "docid": "f335b0c6d6d097c63e6f85de2fc7394e", "score": "0.635728", "text": "cleanup() {}", "title": "" }, { "docid": "f335b0c6d6d097c63e6f85de2fc7394e", "score": "0.635728", "text": "cleanup() {}", "title": "" }, { "docid": "f335b0c6d6d097c63e6f85de2fc7394e", "score": "0.635728", "text": "cleanup() {}", "title": "" }, { "docid": "f335b0c6d6d097c63e6f85de2fc7394e", "score": "0.635728", "text": "cleanup() {}", "title": "" }, { "docid": "f335b0c6d6d097c63e6f85de2fc7394e", "score": "0.635728", "text": "cleanup() {}", "title": "" }, { "docid": "0425be573ab0f974a505839def4d7979", "score": "0.62930024", "text": "teardown() {\n for (var key in this.subscriptions) {\n this.subscriptions[key].unsubscribe()\n }\n\n this.repo.off('change', this.compute, this)\n }", "title": "" }, { "docid": "231d62f469de72e516dc696a6e2e5519", "score": "0.6264901", "text": "function globalTeardown() {\n const prettierRubyPID = process.env.PRETTIER_RUBY_PID;\n\n if (prettierRubyPID) {\n try {\n process.kill(parseInt(prettierRubyPID, 10), \"SIGINT\");\n } catch (e) {\n throw new Error(\"Failed to kill the parser process in globalTeardown.\");\n }\n }\n}", "title": "" }, { "docid": "8950829140926d3037056b15233d3794", "score": "0.6234901", "text": "function customDone(test) {\n\tclear(); // Remove shut objects from the list\n\tif (list.length) { // We should have shut them all, but didn't\n\t\tlog(_sayList());\n\t\ttest.fail();\n\t\texit(); // Stop here instead of running the remaining tests\n\t} else { // The test shut everything correctly\n\t\ttest.done(); // Tell nodeunit the test finished successfully\n\t}\n}", "title": "" }, { "docid": "83312d62fea0011a0601a5898dd72344", "score": "0.62318224", "text": "function teardown(done) {\n var down = {\n block: null,\n contracts: null,\n price: null,\n creation: null\n };\n augur.filters.ignore(true, {\n block: function () {\n assert.isNull(augur.filters.block_filter.heartbeat);\n assert.isNull(augur.filters.block_filter.id);\n down.block = true;\n if (down.contracts && down.price && down.creation) done();\n },\n contracts: function () {\n assert.isNull(augur.filters.contracts_filter.heartbeat);\n assert.isNull(augur.filters.contracts_filter.id);\n down.contracts = true;\n },\n price: function () {\n assert.isNull(augur.filters.price_filter.heartbeat);\n assert.isNull(augur.filters.price_filter.id);\n down.price = true;\n },\n creation: function () {\n assert.isNull(augur.filters.creation_filter.heartbeat);\n assert.isNull(augur.filters.creation_filter.id);\n down.creation = true;\n }\n });\n }", "title": "" }, { "docid": "d4cf77ab115c894a062feccf8e879792", "score": "0.6225417", "text": "cleanUp(){}", "title": "" }, { "docid": "b49027716418312e327214084e4ed4b7", "score": "0.6221714", "text": "function teardownMixin() {\n this.after(\"initialize\", function () {\n this.on(\"teardown\",\n /**\n * @param {Event} event\n * @param {boolean} bubbleUp Teardown should bubble up\n */\n function (event, bubbleUp) {\n this.teardown();\n if(!bubbleUp) {\n event.stopPropagation();\n }\n }\n );\n });\n }", "title": "" }, { "docid": "580c2173020174c948a4dcb4269785b9", "score": "0.6212874", "text": "async function teardown(testCase) {\n console.log('Started teardown phase.');\n if(typeof testCase.teardown === \"function\") {\n await testCase.teardown(databaseClient);\n }\n console.log('Successfully completed the teardown.');\n}", "title": "" }, { "docid": "4f403006ded850d8bd129b04de456827", "score": "0.6212339", "text": "function tearDown() {\r\n if (recordingState !== IDLE) {\r\n cancelRecording();\r\n }\r\n }", "title": "" }, { "docid": "f70bca18d3fc0d00d4601c38a1217c58", "score": "0.62006235", "text": "async destruct() {\n await this.browser.close()\n deleteFolderRecursive(this.resourceDownloadPath)\n delete this.creds\n }", "title": "" }, { "docid": "f9d99edb1fd16722308c446cf74812a7", "score": "0.6147883", "text": "function closeTestSuite(){\n //To be overriden\n \n }", "title": "" }, { "docid": "c71af1ea32b99df3b70cadd6b44c7408", "score": "0.6110013", "text": "afterEach() {\n // Do nothing\n }", "title": "" }, { "docid": "c118192f958442a8357c59f5c02e83b2", "score": "0.61070186", "text": "function histbw_teardown() {\n\tconsole.log('History in Black and White teardown');\n}", "title": "" }, { "docid": "86b3f9dc2430388101dbe494c6390094", "score": "0.609493", "text": "shutdown() {\n // Call teardown on the Microcosm\n this.teardown()\n\n // Trigger a teardown event before completely shutting\n // down. Signalling teardown on domains and effects\n this._emit('teardown', this)\n\n // Stop tracking history\n this.history._removeScope(this)\n\n // Remove all listeners\n this.removeAllListeners()\n }", "title": "" }, { "docid": "99367c14e58f82b667bb4303dea0cd2d", "score": "0.60723466", "text": "function tearDown() {\n mockController.verifyMocks();\n mockController.reset();\n}", "title": "" }, { "docid": "b699a3a069f14f0d4b0f0a1748a12b1b", "score": "0.60573196", "text": "function tearDown(view) {\n\t\t\tif (view) { view.destroy(); }\n\t\t}", "title": "" }, { "docid": "69ff7434faa95ed6d2dac37d256afc0e", "score": "0.60126436", "text": "cleanup(){\r\n\r\n // stop listening for custom events\r\n this.stopListening();\r\n }", "title": "" }, { "docid": "2764ee743a6dc4198218b1ef97b7c1d3", "score": "0.5996745", "text": "function teardownAll() {\n var componentInfo = registry.findComponentInfo(this);\n\n componentInfo && Object.keys(componentInfo.instances).forEach(function(k) {\n var info = componentInfo.instances[k];\n // It's possible that a previous teardown caused another component to teardown,\n // so we can't assume that the instances object is as it was.\n if (info && info.instance) {\n info.instance.teardown();\n }\n });\n }", "title": "" }, { "docid": "2dd473b6e1eed3b33b24022410b13fb9", "score": "0.5990117", "text": "teardown() {\n if (this.vm && !this.vm._isBeingDestroyed) {\n remove$2(this.vm._scope.effects, this);\n }\n if (this.active) {\n let i = this.deps.length;\n while (i--) {\n this.deps[i].removeSub(this);\n }\n this.active = false;\n if (this.onStop) {\n this.onStop();\n }\n }\n }", "title": "" }, { "docid": "6112fc33dbdf10aa1661eb63a2f532fd", "score": "0.59852576", "text": "destroy() {\n this.test.removeListener(this.listener);\n }", "title": "" }, { "docid": "357d3823b2ffe6a1b56a20af3bd73b7a", "score": "0.59778225", "text": "cleanUp(){\n\t\tthis.input = null;\n\t\tthis.result = null;\n\t}", "title": "" }, { "docid": "36a6b74ddb6935422cb944c5e606791f", "score": "0.59548974", "text": "assignAfterEachHook () {\n Ava.afterEach(`${this.constructor.name}: afterEach`, async t => {\n return this.test.afterEach(t)\n })\n }", "title": "" }, { "docid": "f5c5e69534f7085442f48d5e078ae9ed", "score": "0.5935462", "text": "destroy() {\n this.cleanup();\n }", "title": "" }, { "docid": "9af2b525d0fd3490a4666507bc777705", "score": "0.5934273", "text": "unload() {}", "title": "" }, { "docid": "9af2b525d0fd3490a4666507bc777705", "score": "0.5934273", "text": "unload() {}", "title": "" }, { "docid": "06ca32c8d9267ca3e51ef3bf54ed5daa", "score": "0.5931819", "text": "function onExit() {\r\n TuyaDevice.disconnectAll();\r\n if (tester) tester.destroy();\r\n}", "title": "" }, { "docid": "004f00abbce97250e394261d0ca8c8ae", "score": "0.59267354", "text": "function cleanupProcedure() {\n return procedurePipe('cleanup', destroyAnimationProcedure(), markVisibleAndActiveProcedure(), calculateOffsetProcedure(), calculateActiveSlideProcedure(), removeExcessiveProcedure(), shuffleSlidesProcedure(), calculateActiveSlideProcedure());\n }", "title": "" }, { "docid": "3f19ed71e36372d49fa874edcdd687a3", "score": "0.59145886", "text": "async function teardown() {\n return new Promise((acc, rej) => {\n pool.end(err => {\n if (err) rej(err);\n else acc();\n });\n });\n}", "title": "" }, { "docid": "f2278d2f7cc7fa2d2f0cf3f371e0dfdf", "score": "0.59056467", "text": "function cleanUp(e){\n //console.log('cleanUp', 'done: ' + done, arguments, e && e.type);\n _.setData(window, '_' + ths.guid, undefined);\n //if the timeout is still active\n window.clearTimeout(requestTimeout);\n if(el){\n //remove the script fom the DOM tree)\n _dom.remove(el);\n el = null;\n }\n if(!done){\n done = true;\n //console.log('failure fire');\n ths.responseCode = 0;\n _events.fire(ths, 'failure', {data: arguments, cancelable: false, manualBubble: true});\n _events.fire(ths, 'complete', {cancelable: false, manualBubble: true});\n }\n }", "title": "" }, { "docid": "9a0979d6071cc134f3b5ca2894fc844d", "score": "0.5888148", "text": "function endTest() {\n if (gInboxListener) {\n gDbService.unregisterPendingListener(gInboxListener);\n }\n gInboxListener = null;\n MailServices.mailSession.RemoveFolderListener(FolderListener);\n teardownIMAPPump();\n}", "title": "" }, { "docid": "b778c75f48302fcabf096fb113f0bfdc", "score": "0.5881535", "text": "cleanup(done) {\n // Clean up the temporary structures\n del.sync([this._tmpDir.name]);\n\n // Done cleaning up\n done();\n }", "title": "" }, { "docid": "e7992865c3854bbb8f8e4a4e93dea9ed", "score": "0.5833387", "text": "function shutdownTestRunner (err) {\n if (httpServerFixtures) {\n httpServerFixtures.close();\n }\n if (httpServerAssessmentPages) {\n httpServerAssessmentPages.close();\n };\n if (_client && _client.end) {\n _client.end();\n }\n if (err) {\n console.error(err);\n return process.exit(1);\n }\n return process.exit(0);\n}", "title": "" }, { "docid": "2d13045db0fcf7674e6cdba7fce90cf0", "score": "0.5815803", "text": "function Ractive$teardown() {\n var this$1 = this;\n\n if (this.torndown) {\n warnIfDebug('ractive.teardown() was called on a Ractive instance that was already torn down');\n return Promise.resolve();\n }\n\n this.shouldDestroy = true;\n return teardown$1(this, function () { return (this$1.fragment.rendered ? this$1.unrender() : Promise.resolve()); });\n}", "title": "" }, { "docid": "98ee1e4fa77c6b7017dc5a2af25984eb", "score": "0.5815355", "text": "function cleanUp(done) {\n [\n 'added.js',\n 'nested/added.js',\n ].forEach(function(d) {\n var p = path.resolve(__dirname, 'fixtures', d);\n if (fs.existsSync(p)) { fs.unlinkSync(p); }\n });\n done();\n}", "title": "" }, { "docid": "3477dc5527f56f7667b66119d3488d58", "score": "0.5814746", "text": "reset() {\n sinon.verifyAndRestore();\n document.getElementById.reset();\n document.getElementsByClassName.reset();\n auth.logout();\n localStorage.clear();\n fetchMock.reset();\n filter.reset();\n flatpickr.reset();\n eventSignals.dispatch.reset();\n domSignals.dispatch.reset();\n api.reset();\n userIDFetcher._isRunning = undefined;\n users.reset();\n\n // stub out boostrap functions \n BSN = {\n Collapse: sinon.stub(),\n Popover: sinon.stub(),\n Dropdown: sinon.stub(),\n Alert: sinon.stub(),\n }\n }", "title": "" }, { "docid": "9e40f87577c9dc5bef59a0c90c1e6a44", "score": "0.58056355", "text": "function teardown(db, done) {\n db.close();\n done(null);\n}", "title": "" }, { "docid": "d656dc98859b513042b4b3427cac1517", "score": "0.58007777", "text": "function cleanUp(){\n\n\t//extend cleanUp\n\tcleanExtend();\n\t//suggestion cleanUp\n\tcleanHint();\n\n}", "title": "" }, { "docid": "ee060a2e8a24c8846abaa1e93a303869", "score": "0.57874614", "text": "onSuiteEnd () {\n\n }", "title": "" }, { "docid": "6a3fd31508de2ebaa965fc175e7399e3", "score": "0.57823634", "text": "function cleanup()\n{\n\tDispatcher.off(null,null,$);\n\t$.off();\n\t$.destroy();\n}", "title": "" }, { "docid": "594cee208dac34e09c3f36c547fd3938", "score": "0.5774923", "text": "_cleanup() {\n // Remove previous target's classes and event listeners\n if (this.nextTarget != null) {\n this.previousTarget = this.nextTarget;\n this.previousTarget.classList.remove(this.options.targetClass);\n this.previousTarget.removeEventListener(\n this.transitionEvent,\n this.moveFocusBox\n );\n }\n }", "title": "" }, { "docid": "fb62b035c92f55b61752085a6ce8dc8d", "score": "0.5768667", "text": "function unmockAllTestDestinations() {\n var currentDestinations = getDestinationsFromEnv();\n var cleanedDestinations = currentDestinations.filter(function (destination) { return !destination.isTestDestination; });\n setDestinationsInEnv(cleanedDestinations);\n}", "title": "" }, { "docid": "7e112ef371eb3cda7970862684c87bf8", "score": "0.5767723", "text": "function cleanup() {\n observer && observer.disconnect();\n removeEvent(wheelEvent, wheel);\n removeEvent('mousedown', mousedown);\n removeEvent('keydown', keydown);\n removeEvent('resize', refreshSize);\n removeEvent('load', init);\n }", "title": "" }, { "docid": "9ac682d50cfb953f223ffd8be6c3834d", "score": "0.576709", "text": "function _testCleanUp() {\n return ImptTestHelper.runCommand(`impt device update -d ${config.devices[config.deviceidx]} --name ${ImptTestHelper.deviceInfo.deviceName}`, ImptTestHelper.emptyCheck);\n }", "title": "" }, { "docid": "ef4e223292c25a8da1a73454d8ed9fd9", "score": "0.57663625", "text": "function cleanup(args, ctx) {\n}", "title": "" }, { "docid": "4486223504c4c9ba18833edb9d981cb6", "score": "0.5760734", "text": "unload() {\r\n\r\n }", "title": "" }, { "docid": "e8d97be87088c7492c7b596f12001987", "score": "0.5758525", "text": "function cleanup() {\n observer && observer.disconnect();\n removeEvent(wheelEvent, wheel);\n removeEvent('mousedown', mousedown);\n removeEvent('keydown', keydown);\n}", "title": "" }, { "docid": "2b2677594290068bcd2f98320287feec", "score": "0.5757528", "text": "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "title": "" }, { "docid": "2b2677594290068bcd2f98320287feec", "score": "0.5757528", "text": "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "title": "" }, { "docid": "2b2677594290068bcd2f98320287feec", "score": "0.5757528", "text": "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "title": "" }, { "docid": "2b2677594290068bcd2f98320287feec", "score": "0.5757528", "text": "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "title": "" }, { "docid": "2b2677594290068bcd2f98320287feec", "score": "0.5757528", "text": "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "title": "" }, { "docid": "e0bd5f3f9b029732f64fcf12ec4ccae6", "score": "0.5751762", "text": "destroy() {\n this.reset();\n\n this.main = null;\n this.options = null;\n this.dom = null;\n this.release = null;\n }", "title": "" }, { "docid": "708fd4e8bdfa659286b5a8a0fb071a18", "score": "0.574454", "text": "function cleanup() {\n this.status = null;\n\n this.corner_timeout_id = null;\n}", "title": "" }, { "docid": "ba0c5ff69b5fcd571a3f83cd8f3fafa2", "score": "0.5742863", "text": "function cleanup() {\r\n observer && observer.disconnect();\r\n removeEvent(wheelEvent, wheel);\r\n removeEvent('mousedown', mousedown);\r\n removeEvent('keydown', keydown);\r\n removeEvent('resize', refreshSize);\r\n removeEvent('load', init);\r\n}", "title": "" }, { "docid": "ba0c5ff69b5fcd571a3f83cd8f3fafa2", "score": "0.5742863", "text": "function cleanup() {\r\n observer && observer.disconnect();\r\n removeEvent(wheelEvent, wheel);\r\n removeEvent('mousedown', mousedown);\r\n removeEvent('keydown', keydown);\r\n removeEvent('resize', refreshSize);\r\n removeEvent('load', init);\r\n}", "title": "" }, { "docid": "09aa4deaa9e607edc0d030880bce861a", "score": "0.5738039", "text": "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "title": "" }, { "docid": "b2c1619a440ca0832732d7357e103c90", "score": "0.57379097", "text": "function finishTest() {\n clearUp();\n window.location.replace(surveyLink);\n }", "title": "" }, { "docid": "55a8d860f3a62691dd60555125f71a47", "score": "0.5729107", "text": "function clean_up() {\n\t\tthis.task.run_sync(\"core\", \"ui_container\", \"clean_up\");\n\t\tglob.document.body.innerHTML = \"\";\n\t}", "title": "" }, { "docid": "33f55bd927883529fa8a1e69d7c7458c", "score": "0.5727338", "text": "function runTest5() {\n content.removeChild(window.Test.currentElement);\n window.Test.currentElement = getApprehensionTest();\n }", "title": "" }, { "docid": "8ab299019cb99b4a7694c24d027c008a", "score": "0.5723955", "text": "function teardownTocNav() {\n\tif ( _tocNav && _tocNav.observer ) {\n\t\t_tocNav.observer.disconnect();\n\t}\n\t_tocNav.dropdown.handlers.visibleChange = handleVisibleChange;\n\n\tif ( _contentColumn && _contentColumn.observer ) {\n\t\t_contentColumn.observer.disconnect();\n\t}\n}", "title": "" }, { "docid": "778b18093ccb7379e2469640d74df579", "score": "0.57067585", "text": "function cleanUp() {\n delete window[callbackName];\n document.body.removeChild(scriptElem);\n }", "title": "" }, { "docid": "548d7fd76a08b72f7fe00fa52f89ab1c", "score": "0.5706281", "text": "async shutdown(){\n\t\tthis._clearState();\n\t\tthis._isLoaded = false;\n\t}", "title": "" }, { "docid": "0dee27d5e47b0f4b6981f89917dc0880", "score": "0.5700907", "text": "destroy() {\n if (this.tooltip) {\n this.tooltip.destroy();\n this.tooltip = null;\n }\n\n if (isHTMLElement(this.el) && this.el.parentNode) {\n this.el.parentNode.removeChild(this.el);\n this.el = null;\n }\n\n if (this.target) {\n this._updateStepTargetOnHide();\n }\n\n this.trigger('destroy');\n }", "title": "" }, { "docid": "61930714b3f00ba5fb7f4bc0f21b2713", "score": "0.5694432", "text": "shutDownProcessor(){\n G.modelsManager.shutDownFunctions.shift();\n if (G.modelsManager.shutDownFunctions.length == 0) {\n window.close();\n } else {\n G.modelsManager.shutDownFunctions[0]();\n }\n }", "title": "" }, { "docid": "54a52be4450cd8007ceb2ddc32e886fe", "score": "0.56941056", "text": "function cleanup() {\n observer && observer.disconnect();\n removeEvent(wheelEvent, wheel);\n removeEvent('mousedown', mousedown);\n removeEvent('keydown', keydown);\n removeEvent('resize', refreshSize);\n removeEvent('load', init);\n}", "title": "" }, { "docid": "54a52be4450cd8007ceb2ddc32e886fe", "score": "0.56941056", "text": "function cleanup() {\n observer && observer.disconnect();\n removeEvent(wheelEvent, wheel);\n removeEvent('mousedown', mousedown);\n removeEvent('keydown', keydown);\n removeEvent('resize', refreshSize);\n removeEvent('load', init);\n}", "title": "" }, { "docid": "54a52be4450cd8007ceb2ddc32e886fe", "score": "0.56941056", "text": "function cleanup() {\n observer && observer.disconnect();\n removeEvent(wheelEvent, wheel);\n removeEvent('mousedown', mousedown);\n removeEvent('keydown', keydown);\n removeEvent('resize', refreshSize);\n removeEvent('load', init);\n}", "title": "" } ]
78d692c2322a9f11efc3d5537a4d5ea3
Returns a map labels that are common to the given label sets.
[ { "docid": "d06943c7e71d4e6d579490f744103b39", "score": "0.8135971", "text": "function findCommonLabels(labelsSets) {\n return labelsSets.reduce(function (acc, labels) {\n if (!labels) {\n throw new Error('Need parsed labels to find common labels.');\n }\n if (!acc) {\n // Initial set\n acc = __assign({}, labels);\n }\n else {\n // Remove incoming labels that are missing or not matching in value\n Object.keys(labels).forEach(function (key) {\n if (acc[key] === undefined || acc[key] !== labels[key]) {\n delete acc[key];\n }\n });\n // Remove common labels that are missing from incoming label set\n Object.keys(acc).forEach(function (key) {\n if (labels[key] === undefined) {\n delete acc[key];\n }\n });\n }\n return acc;\n }, undefined);\n}", "title": "" } ]
[ { "docid": "8d6b36974ff92f5dab66e061ef5913d3", "score": "0.6110906", "text": "function intersection(sets) {\n var source = sets[0];\n var rest = sets.slice(1);\n var keys = Object.keys(source);\n var keysLength = keys.length;\n var restLength = rest.length;\n var result = [];\n for (var keyIndex = 0; keyIndex < keysLength; keyIndex++) {\n var key = keys[keyIndex];\n var matched = true;\n for (var restIndex = 0; restIndex < restLength; restIndex++) {\n if (!rest[restIndex].hasOwnProperty(key)) {\n matched = false;\n break;\n }\n }\n if (matched) {\n result.push(source[key]);\n }\n }\n return result;\n }", "title": "" }, { "docid": "743fea249062d857725a301545d52395", "score": "0.6095056", "text": "function intersection(sets) {\n let source = sets[0];\n let rest = sets.slice(1);\n let keys = Object.keys(source);\n let keysLength = keys.length;\n let restLength = rest.length;\n let result = [];\n for (let keyIndex = 0; keyIndex < keysLength; keyIndex++) {\n let key = keys[keyIndex];\n let matched = true;\n for (let restIndex = 0; restIndex < restLength; restIndex++) {\n if (!rest[restIndex].hasOwnProperty(key)) {\n matched = false;\n break;\n }\n }\n if (matched) {\n result.push(source[key]);\n }\n }\n return result;\n }", "title": "" }, { "docid": "743fea249062d857725a301545d52395", "score": "0.6095056", "text": "function intersection(sets) {\n let source = sets[0];\n let rest = sets.slice(1);\n let keys = Object.keys(source);\n let keysLength = keys.length;\n let restLength = rest.length;\n let result = [];\n for (let keyIndex = 0; keyIndex < keysLength; keyIndex++) {\n let key = keys[keyIndex];\n let matched = true;\n for (let restIndex = 0; restIndex < restLength; restIndex++) {\n if (!rest[restIndex].hasOwnProperty(key)) {\n matched = false;\n break;\n }\n }\n if (matched) {\n result.push(source[key]);\n }\n }\n return result;\n }", "title": "" }, { "docid": "878a13dfa5b647e4eb0a6f9758b71f2a", "score": "0.599105", "text": "function getCommonElements(arrays) {\r\n var currentValues = {};\r\n var commonValues = {};\r\n for (var i = arrays[0].length - 1; i >= 0; i--) {\r\n currentValues[arrays[0][i]] = 1;\r\n }\r\n for (var i = arrays.length - 1; i > 0; i--) {\r\n var currentArray = arrays[i];\r\n for (var j = currentArray.length - 1; j >= 0; j--) {\r\n if (currentArray[j] in currentValues) {\r\n commonValues[currentArray[j]] = 1;\r\n }\r\n }\r\n currentValues = commonValues;\r\n commonValues = {};\r\n }\r\n return Object.keys(currentValues).map(function (value) {\r\n return value;\r\n });\r\n}", "title": "" }, { "docid": "435083cc3eae0ccb7066349e129857a9", "score": "0.5848931", "text": "function findUniqueLabels(labels, commonLabels) {\n var uncommonLabels = __assign({}, labels);\n Object.keys(commonLabels).forEach(function (key) {\n delete uncommonLabels[key];\n });\n return uncommonLabels;\n}", "title": "" }, { "docid": "435083cc3eae0ccb7066349e129857a9", "score": "0.5848931", "text": "function findUniqueLabels(labels, commonLabels) {\n var uncommonLabels = __assign({}, labels);\n Object.keys(commonLabels).forEach(function (key) {\n delete uncommonLabels[key];\n });\n return uncommonLabels;\n}", "title": "" }, { "docid": "c1a52d97b6ac9455e90f8655ba642f12", "score": "0.5837764", "text": "intersection(otherSet) {\n const intersectionSet = new CustomSet();\n const firstSet = this.values();\n firstSet.forEach(e => {\n if (otherSet.has(e)) {\n intersectionSet.add(e)\n }\n });\n return intersectionSet;\n }", "title": "" }, { "docid": "66fc030f7f5cb67833c0941a4a095bee", "score": "0.5811618", "text": "getOriginalCommonIds() {\n const labelIds = [];\n this.getElement('.issuable-list input[type=\"checkbox\"]:checked').each((i, el) => {\n labelIds.push(this.getElement(`#${this.prefixId}${el.dataset.id}`).data('labels'));\n });\n return intersection.apply(this, labelIds);\n }", "title": "" }, { "docid": "2a8f2a03d9f2b548c0a9fc840c0dfe63", "score": "0.57358664", "text": "intersection(set) {\n const intersectionSet = new Set();\n const setA = this.values();\n\n setA.forEach((item) => {\n if (setB.has(item)) {\n intersectionSet.add(item);\n }\n });\n\n return intersectionSet;\n }", "title": "" }, { "docid": "f6eea5fdc23797874ee3bdfacb3839a1", "score": "0.5670928", "text": "function calculateSetIntersect(setA, setB) {\n let _tmp = new Set();\n for (var i of setB) {\n setA.forEach( x => { if (x.p == i.p && x.o == i.o) { _tmp.add(i); } });\n }\n return _tmp;\n }", "title": "" }, { "docid": "f796d934567003c60e7daeffb040e0ed", "score": "0.56456316", "text": "function _same_set(set1, set2){\n\tvar h1 = {};\n\tvar h2 = {};\n\tfor( var h1i = 0; h1i < set1.length; h1i++ ){ h1[set1[h1i]] = 1; }\n\tfor( var h2i = 0; h2i < set2.length; h2i++ ){ h2[set2[h2i]] = 1; }\n\treturn _same_hash(h1, h2);\n }", "title": "" }, { "docid": "7517c7f08a04d9b445cfe4258471b304", "score": "0.5568988", "text": "intersection(otherSet) {\n let intersectionSet = new mySet();\n let firstSet = this.values();\n firstSet.forEach((e) => {\n if (otherSet.has(e)) {\n intersectionSet.add(e);\n }\n });\n return intersectionSet;\n }", "title": "" }, { "docid": "a5e62f00a8a38db44c20493c2c2dc1df", "score": "0.5544295", "text": "intersection(otherSet) {\r\n const intersectionSet = new MySet();\r\n const firstSet = this.values();\r\n\r\n firstSet.forEach(function(e){\r\n if(otherSet.has(e)){\r\n intersectionSet.add(e);\r\n }\r\n });\r\n\r\n return intersectionSet;\r\n }", "title": "" }, { "docid": "12dc41b8fb82aefdc10fdecf8fc0c559", "score": "0.5516235", "text": "function intersect(xs, ys) {\n var map = new Map();\n for (var _a = 0, _b = xs.elements; _a < _b.length; _a++) {\n var e = _b[_a];\n map.set(e.unit.id, e.indices);\n }\n var elements = [];\n for (var _c = 0, _d = ys.elements; _c < _d.length; _c++) {\n var e = _d[_c];\n if (!map.has(e.unit.id))\n continue;\n var indices = _mol_data_int__WEBPACK_IMPORTED_MODULE_1__[\"OrderedSet\"].intersect(map.get(e.unit.id), e.indices);\n if (_mol_data_int__WEBPACK_IMPORTED_MODULE_1__[\"OrderedSet\"].size(indices) === 0)\n continue;\n elements[elements.length] = { unit: e.unit, indices: indices };\n }\n return Loci(xs.structure, elements);\n }", "title": "" }, { "docid": "4e9c99850ec7f64f68cb6fcf120aedf1", "score": "0.540518", "text": "getLabels(input) {\n\t\tconst labels = new Map();\n\t\tinput.forEach((arr, index) => {\n\t\t\tif (!this.validInstructions.includes(arr[0])) {\n\t\t\t\tlabels.set(arr[0], index);\n\t\t\t}\n\t\t})\n\t\treturn labels\n\t}", "title": "" }, { "docid": "720fea14832c4dcb920642ba935ed165", "score": "0.53699934", "text": "static intersect(A, B)\n {\n if (A.size === 0 || B === 0)\n return new NSet();\n\n var s = new NSet();\n\n A.forEach( (item) => {\n if (B.has(item))\n s.add(item);\n });\n\n return s;\n }", "title": "" }, { "docid": "72d415fa0284dbc10d4585cf50b73ffc", "score": "0.53643715", "text": "function intersect(s1, s2) {\n let intersection = new Set();\n for (let item of s1) {\n if (s2.has(item)) {\n intersection.add(item);\n }\n }\n return intersection;\n}", "title": "" }, { "docid": "3995c30f94850f3da19e64f859db27f7", "score": "0.5332245", "text": "function intersection(setA, setB) {\n var intersection = new Set();\n setB.forEach(function (elem) {\n if (setA.has(elem))\n intersection.add(elem);\n });\n return intersection;\n }", "title": "" }, { "docid": "a8836408a9e341547af2cb79d20498c3", "score": "0.5328907", "text": "function common(a, b) {\n const setB = new Set(b);\n return [...new Set(a)].filter((a) => setB.has(a));\n}", "title": "" }, { "docid": "bcc1442bf60814856aad1b53ad112ab1", "score": "0.5323337", "text": "function common(a, b) {\n const setB = new Set(b);\n return [...new Set(a)].filter(a => setB.has(a));\n}", "title": "" }, { "docid": "4c1db3455ec8766b09d2de7a13d26d57", "score": "0.5309547", "text": "function intersection(setA, setB) {\n const newSet = new Set();\n for (const item of setA) {\n if (setB.has(item))\n newSet.add(item);\n }\n return newSet;\n}", "title": "" }, { "docid": "4c1db3455ec8766b09d2de7a13d26d57", "score": "0.5309547", "text": "function intersection(setA, setB) {\n const newSet = new Set();\n for (const item of setA) {\n if (setB.has(item))\n newSet.add(item);\n }\n return newSet;\n}", "title": "" }, { "docid": "47c10fbd5dc698ced376e2b144c5dcbb", "score": "0.52896345", "text": "function intersection(...arrays) {\n let elHash = {};\n let resultArr = [];\n for (let i = 0; i < arrays.length; i++) {\n let inputArr = arrays[i];\n for (let j = 0; j < inputArr.length; j++) {\n const el = inputArr[j];\n if (elHash[el]) {\n elHash[el] += 1;\n if (elHash[el] === 3) resultArr.push(el);\n } else {\n elHash[el] = 1;\n }\n }\n }\n return resultArr;\n}", "title": "" }, { "docid": "fc26c156b41cf92c5009b5906b3e02c4", "score": "0.5271534", "text": "function merge(files) {\n\tconst data = {};\n\tconst labels = [];\n\n\tfiles.forEach((file) => {\n\t\tif (!Array.isArray(file)) {\n\t\t\treturn;\n\t\t}\n\n\t\tfile.forEach((label) => {\n\t\t\tif (data[label.name] !== null && data[label.name] !== '') {\n\t\t\t\tdata[label.name] = label;\n\t\t\t} else {\n\t\t\t\tif (JSON.stringify(data[label.name]) !== JSON.stringify(label)) {\n\t\t\t\t\tconsole.error(chalk.red(`Conflicting label names were found: ${label.name}`));\n\t\t\t\t\tprocess.exit(1);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n\n\t// Make sure leading `#` are stripped from the color property.\n\tObject.keys(data).forEach((key) => {\n\t\tconst label = data[key]; \n\t\tconst color = String(label.color);\n\t\tif (color.startsWith('#')) {\n\t\t\tlabel.color = color.replace('#', '');\n\t\t}\n\t\tlabels.push(label);\n\t});\n\n\treturn labels;\n}", "title": "" }, { "docid": "c93865d6bd43316bf511db46d9b3f0ea", "score": "0.5243817", "text": "function commonElement(lists) {\n\n let commonList = [];\n\n // make hash map for list[0]\n for (let item of lists[0]) {\n commonList[item] = item;\n }\n\n for (let i = 1; i < lists.length; i++) {\n commonList = findCommons(commonList, lists[i]);\n }\n\n return commonList.filter(function(element){\n return element !== '';\n })\n}", "title": "" }, { "docid": "d695cb1c845676be9fe37b080ac50e15", "score": "0.52337897", "text": "function generateSets(source, inSet, elements) {\n if(renderer.options[\"debugprint\"]) console.log(\" Computing sets...\");\n\n var ignore, include;\n if(elements && elements.ignore) ignore = elements.ignore;\n if(elements && elements.include) include = elements.include;\n\n var ignore = function(setName) { \n return elements && elements.ignore && contains(elements.ignore, setName);\n }\n\n var include = function(setName) {\n var inc = true;\n if(elements && elements.include) {\n inc = contains(elements.include, setName);\n }\n return inc;\n }\n\n var sets = {};\n source.forEach(function(element) {\n var setName = inSet(element);\n console.log(' ', element, 'is in set', setName);\n\n if(setName == -1 || ignore(setName) || !include(setName)) return;\n\n var elements = sets[setName] || [];\n elements.push(element);\n sets[setName] = elements;\n });\n \n if(renderer.options[\"setnode\"]) {\n // TODO! We want to add the set nodes to the sets. \n // We don\"t want set nodes in the sets, we want them in the groups?\n // createSetNode(sets);\n createSetNodes(sets);\n }\n\n return sets;\n}", "title": "" }, { "docid": "2819fdbb59779eab624d790e14e4c841", "score": "0.5232464", "text": "common(t) {\n\t\tconst r = new UniqueSet()\n\t\tfor (const item of this) if (t.has(item)) r.add(item)\n\t\treturn r\n\t}", "title": "" }, { "docid": "fc18f3d5e536f58272c8d045a1ed99f8", "score": "0.52253455", "text": "function run() {\n let ds = new DisjointSet();\n input.forEach(([x, y]) => {\n ds.merge(x, y);\n });\n let groups = new Map();\n for (let member of ds.members()) {\n let root = ds.findRoot(member);\n let group = groups.get(root);\n if (group) {\n group.add(member);\n } else {\n groups.set(root, new Set([member]));\n }\n }\n console.log(groups);\n}", "title": "" }, { "docid": "04a7807b15a82e3ad3caca6712233636", "score": "0.5171938", "text": "function common_elements(list1, list2) {\n}", "title": "" }, { "docid": "660c2bd80e40d6e8d5aa5f52013f2384", "score": "0.51471204", "text": "function common(array_one, array_two){\n var combined = [];\n for(var i = 0; i < array_one.length; i++){\n for(var j = 0; j < array_two.length; j++){\n if(array_one[i] == array_two[j]){\n combined.push(array_one[i]);\n }\n }\n }\n return combined;\n}", "title": "" }, { "docid": "7a03ab94582459105d37947a1449b758", "score": "0.513614", "text": "function getKeySet(obj1, obj2) {\n var keyArray = Object.keys(obj1).concat(Object.keys(obj2)),\n keySet = {};\n\n for (var i = 0; i < keyArray.length; i++) {\n keySet[keyArray[i]] = true;\n }\n\n return keySet;\n }", "title": "" }, { "docid": "840c19b27e699f872810a04526d5f20d", "score": "0.5070102", "text": "function combineLabels(labels, numberOfBuckets) {\n var buckets = {};\n var highPriorityLabels = [];\n Object.keys(labels).forEach(function (key) {\n var label = labels[key];\n if (label.highPriority) {\n highPriorityLabels.push(label);\n return;\n }\n var bucket = Math.floor(label.annotationCenterAngle / 6.29 * numberOfBuckets);\n if (!buckets[bucket]) {\n buckets[bucket] = label;\n } else {\n buckets[bucket].labelAndSublabels.push(label);\n buckets[bucket].labelIds[label.id] = true;\n }\n });\n var combinedLabels = Object.keys(buckets).map(function (key) {\n return buckets[key];\n }).concat(highPriorityLabels);\n return combinedLabels;\n}", "title": "" }, { "docid": "62c818a55e365d542d53840892c8ee15", "score": "0.5034627", "text": "function calculateSetUnion(listOfSets) {\n var _tmp = new Set();\n listOfSets.forEach( function(y) {\n for (var i of y) {\n _tmp.add(i);\n }\n });\n return _tmp;\n }", "title": "" }, { "docid": "64ab47d70a9e460c682e6fd955e0c5df", "score": "0.5006542", "text": "function intersection(setA, setB) {\n var e_9, _a;\n var newSet = new Set();\n try {\n for (var setA_1 = __values(setA), setA_1_1 = setA_1.next(); !setA_1_1.done; setA_1_1 = setA_1.next()) {\n var item = setA_1_1.value;\n if (setB.has(item))\n newSet.add(item);\n }\n }\n catch (e_9_1) { e_9 = { error: e_9_1 }; }\n finally {\n try {\n if (setA_1_1 && !setA_1_1.done && (_a = setA_1.return)) _a.call(setA_1);\n }\n finally { if (e_9) throw e_9.error; }\n }\n return newSet;\n}", "title": "" }, { "docid": "852329340652cda2510f73bd1813796d", "score": "0.50060153", "text": "function commonSubset(values) {\n var len = values.length;\n var subset = '';\n if (len < 2) {\n return subset;\n }\n var strlen = values[0].length;\n for (var i = 0; i < strlen; i++) {\n var ch = values[0][i];\n for (var j = 1; j < len; j++) {\n if (values[j][i] !== ch) {\n return subset;\n }\n }\n subset += ch;\n }\n return subset;\n }", "title": "" }, { "docid": "b5fd05b1c1eed9c1bd9ab8dcfb74ff05", "score": "0.50050586", "text": "function containsCommonItem2(arr1, arr2) {\n let map = {};\n for (let i = 0; i < arr1.length; i++) {\n if (!map[arr1[i]]) {\n const item = arr1[i];\n map[item] = true;\n }\n }\n for (let j = 0; j < arr2.length; j++) {\n if (map[arr2[j]]) { \n return true;\n }\n } \nreturn false\n}", "title": "" }, { "docid": "0a94674753f986eb82e5226febd276ab", "score": "0.5004747", "text": "function intersection(arrays) {}", "title": "" }, { "docid": "ca57f8997ce32ded0a0872d3f6624323", "score": "0.49264768", "text": "getCandidateSets(potentialUsedSets, baseSets, setlessMods) {\n /**\n * Possible sets:\n *\n * base set (already added)\n *\n * 4-mod sets\n * Set(4) + base set\n * Set(4) + Set(2)\n *\n * 2-mod sets\n * Set(2) + base set\n * Set(2 * 2) + base set\n * Set(2 * 3)\n * Set(2) + Set(2) + base set\n * Set(2 * 2) + Set(2)\n * Set(2) + Set(2) + Set(2)\n */\n let fourModSets = potentialUsedSets.filter(modSet => 4 === modSet.numberOfModsRequired);\n let twoModSets = potentialUsedSets.filter(modSet => 2 === modSet.numberOfModsRequired);\n let candidateSets = [];\n\n for (let firstSetType of fourModSets) {\n let firstSet = baseSets.get(firstSetType);\n\n // the whole set plus setless mods\n candidateSets = candidateSets.concat(this.combineSets(firstSet, setlessMods));\n\n // the whole set plus any 2-mod set\n for (let secondSetType of twoModSets) {\n let secondSet = baseSets.get(secondSetType);\n candidateSets = candidateSets.concat(this.combineSets(firstSet, secondSet));\n }\n }\n\n for (let i = 0; i < twoModSets.length; i++) {\n let firstSet = baseSets.get(twoModSets[i]);\n\n // the whole set plus setless mods\n candidateSets = candidateSets.concat(this.combineSets(setlessMods, firstSet));\n\n // the whole set plus a set of 4 from any 2-mod sets and the base set\n for (let j = i; j < twoModSets.length; j++) {\n let secondSet = baseSets.get(twoModSets[j]);\n\n // the first set plus the second set plus setless mods\n candidateSets = candidateSets.concat(this.combineSets(setlessMods, firstSet, secondSet));\n\n // the first set plus the second set plus another set\n for (let k = j; k < twoModSets.length; k++) {\n let thirdSet = baseSets.get(twoModSets[k]);\n\n candidateSets = candidateSets.concat(this.combineSets(firstSet, secondSet, thirdSet));\n }\n }\n }\n\n return candidateSets;\n }", "title": "" }, { "docid": "caa0e62b674b1f5ebf3ddb217e747b70", "score": "0.49258816", "text": "function containCommonItemMap(arr1, arr2) {\n\n let map = {} // Space-Complexity: O(n)\n\n // @TODO: Modularize the code | break into chunk of functions\n // Loop through first array and create object properties === items in the array\n // mapArrayToObject(arr1);\n\n\n for (let i = 0; i < arr1.length; i++) {\n\n if (!map[arr1[i]]) {\n const item = arr1[i]\n map[item] = true\n };\n };\n\n // Loop through second array and check if item in second array exists on\n // created object\n // compareArrayToObject(arr2)\n\n for (let j = 0; j < arr2.length; j++) {\n if (map[arr2[j]]) {\n\n console.log(arr2[j]);\n console.log(true);\n return true\n };\n };\n console.log(false)\n return false;\n }", "title": "" }, { "docid": "f5b50ffb8be948e1042b7c14c9c9d0bd", "score": "0.49255908", "text": "function containsCommonItems2(arr1, arr2) {\n // loop through first array and create object\n // where properties === items in the array \n // can we assume always 2 parameters in the function?\n let map = {};\n for (let i=0; i < arr1.length; i++) {\n if(!map[array1[i]]) {\n const item = array1[i];\n map[item] = true;\n }\n }\n // loop through second array and check if\n // item in second array exists on created object.\n for (let j=0; j < arr2.length; j++) {\n if(map[array2[j]]) {\n return true;\n }\n } \n return false; \n}", "title": "" }, { "docid": "9575e3f7f8d6d39a2a23125cb8ded59c", "score": "0.49249047", "text": "function intersection(first, second) {\n var matchArray = [];\n for (var i = 0; i < first.length; i++) {\n for (var s = 0; s < second.length; s++) {\n if (first[i] === second[s]) {\n matchArray.push(first[i]);\n break;\n }\n }\n }\n return matchArray;\n}", "title": "" }, { "docid": "a036a217c96f0e3b8baba2b71edc5f92", "score": "0.49239442", "text": "function calcSetSimilarity(set1, set2) {\n let verbose = true;\n if (typeof set1 != 'Set')\n set1 = new Set(set1);\n if (typeof set2 != 'Set')\n set2 = new Set(set2);\n let union = new Set([...set1, ...set2]);\n let intersection = new Set([...set1].filter(i => set2.has(i)));\n\n let similarity = intersection.size/union.size;\n if (verbose) console.log(\"[calcSetSimilarity] set1.size=\"+set1.size+\", set2.size=\"+set2.size+\", union.size=\"+union.size+\", intersection.size=\"+intersection.size+\"\\n -> similarity=\"+similarity);\n return similarity;\n}", "title": "" }, { "docid": "c2a48f273b26489bb5e241c47678e231", "score": "0.4912724", "text": "function getCommonValues(arr1, arr2) {\n var exitArray = [],\n i;\n for (i = 0; i < arr1.length; i++) {\n if (arr2.includes(arr1[i]) && !exitArray.includes(arr1[i])) {\n exitArray.push(arr1[i]);\n }\n }\n return exitArray;\n }", "title": "" }, { "docid": "00fa12821d7786721e542bc5b12e66e8", "score": "0.48738778", "text": "getConjugacyClasses(elements /*: Array<groupElement> */) /*: Array<BitSet> */ {\n const conj =\n (a,b) => this.multtable[a][this.multtable[b][this.inverses[a]]];\n\n // create map with key:value where key is sum of values, value is array of bitsets\n const conjugacyClasses = new Map();\n\n outerLoop: for (let i = 0; i < elements.length; i++) {\n let conjugacyClass = new BitSet(this.order);\n for (let j = 0; j < elements.length; j++) {\n conjugacyClass.set(conj(elements[j],elements[i]));\n }\n // calculate key, add to Map\n let key = conjugacyClass.arr.reduce((sum,el) => sum + el, 0);\n const vals = conjugacyClasses.get(key);\n if (vals != undefined) {\n for (let j = 0; j < vals.length; j++) {\n if (conjugacyClass.equals(vals[j])) {\n continue outerLoop;\n }\n }\n vals.push(conjugacyClass);\n conjugacyClasses.set(key, vals);\n } else {\n conjugacyClasses.set(key, [conjugacyClass]);\n }\n }\n\n const result = [];\n conjugacyClasses.forEach(el => { result.push(...el) });\n\n const sortedResult = result.sort( (a /*: BitSet */, b /*: BitSet */) => a.popcount() - b.popcount() );\n return sortedResult;\n }", "title": "" }, { "docid": "e69fdb40cbb378520a7cb97ee7ef158b", "score": "0.48709548", "text": "function findCommon(arr1, arr2){\n\n}", "title": "" }, { "docid": "603010ff504b49e0699c6b9da89e3381", "score": "0.48532745", "text": "function commonElement(a1, a2) { //O(n+m)\n\tlet hashTable = {};\n\ta1.forEach(x => {\n\t\tif (!hashTable[x]) hashTable[x] = true;\n\t});\n\n\ta2.forEach(y => {\n\t\tif (hashTable[y] === true) return true;\n\t});\n\treturn false;\n}", "title": "" }, { "docid": "3718bd5ecc262d055ff5e5882d500d69", "score": "0.48483363", "text": "commonMatches() {\n const { edge, showMatches } = this;\n if(showMatches) {\n return _.map(\n _.intersectionBy(\n edge.source.meta.matches, edge.target.meta.matches,\n 'molecule_id'\n ),\n (m) => { return { ...m, 'kind': 'common' } }\n )\n }\n }", "title": "" }, { "docid": "e10679425de8fb28e4585ed975740ef8", "score": "0.48427406", "text": "function match(a, b, canonical = (x) => x) {\n const def = (v) => v || 0\n const times = (i,f) => { while(i--) { f() } }\n\n let as = {}, bs = {}, vals = {}\n const canon = (v, vals) => { let k = canonical(v); vals[k] = v; return k }\n\n // generate a hash of counts for each canonical value across both datasets\n a.forEach( (v) => { v = canon(v, vals); as[v] = def(as[v]) + 1; bs[v] = def(bs[v]) } )\n b.forEach( (v) => { v = canon(v, vals); as[v] = def(as[v]); bs[v] = def(bs[v]) + 1 } )\n\n // for each discrete value, allot matches\n let matches = [], unmatched_a = [], unmatched_b = []\n Object.keys(vals).forEach( (v) => {\n times(Math.min(as[v], bs[v]), () => matches.push(vals[v]))\n times(Math.max(0, as[v]-bs[v]), () => unmatched_a.push(vals[v]))\n times(Math.max(0, bs[v]-as[v]), () => unmatched_b.push(vals[v]))\n })\n\n return [ matches, unmatched_a, unmatched_b ]\n}", "title": "" }, { "docid": "8cb9049f4d83e2a98908870251bc94d2", "score": "0.4833543", "text": "function tree_intersection(tree1, tree2) {\n let tree1vals = tree1.inOrder();\n let tree2vals = tree2.inOrder();\n let myHash = {};\n let results = [];\n // https://stackoverflow.com/questions/16227197/compute-intersection-of-two-arrays-in-javascript\n // but the big O here will be O(n2)\n // const result = tree1vals.filter(function(n) {\n // return tree2vals.indexOf(n) > -1;\n // });\n\n // i think Big O here will be O(3n), or rather O(n)\n tree1vals.forEach(function(e) {\n //strip duplicates\n if (myHash[e] === undefined) {\n myHash[e] = 'tree1';\n }\n });\n\n tree2vals.forEach(function(e){\n if (myHash[e] === 'tree1') {\n results.push(e);\n }\n });\n\n return results;\n}", "title": "" }, { "docid": "bae385041ae75361faeed9ad110a4fd2", "score": "0.481526", "text": "function intersection(arrayOfArrays) {\n\tvar result = [];\n\tvar dict = {};\n\n\tdict = reduce(arrayOfArrays, reducer, dict);\n\n\tfor (let key in dict) {\n\t\tif (dict.hasOwnProperty(key)) {\n\t\t\tif (dict[key] == arrayOfArrays.length) {\n\t\t\t\tresult.push(+key);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result.length > 0 ? result : null;\n}", "title": "" }, { "docid": "216c4e38c8c2bd370df0d4a60512a88e", "score": "0.47750783", "text": "function commonCharacterCount(s1, s2) {\n\tlet count = {},\n\t\tcount2 = {},\n\t\tmap = {},\n\t\tarr = [],\n\t\tsum = 0;\n\tfor (let char1 of s1) {\n\t\tfor (let char2 of s2) {\n\t\t\tif (char1 === char2) map[char1] = true;\n\t\t}\n\t}\n\tfor (let key in map) {\n\t\tfor (let char of s1) {\n\t\t\tif (char === key) {\n\t\t\t\tif (!count[char]) count[char] = 1;\n\t\t\t\telse count[char]++;\n\t\t\t}\n\t\t}\n\t\tfor (let char of s2) {\n\t\t\tif (char === key) {\n\t\t\t\tif (!count2[char]) count2[char] = 1;\n\t\t\t\telse count2[char]++;\n\t\t\t}\n\t\t}\n\t}\n\tfor (let key in map) {\n\t\tarr.push(Math.min(count[key], count2[key]));\n\t}\n\tarr.map(k => (sum += k));\n\treturn sum;\n}", "title": "" }, { "docid": "eb87ceb2a43fb839bb4c9513f83cdf08", "score": "0.47750038", "text": "combineSets(firstSet, secondSet, thirdSet) {\n let combinations = [];\n\n /* eslint-disable no-unused-vars */\n if ('undefined' === typeof thirdSet) {\n for (let [firstSetSlots, secondSetSlots] of this.chooseFourOptions) {\n let set = firstSet.copy();\n combinations.push(set.replaceSlots(secondSetSlots, secondSet));\n }\n } else {\n for (let [firstSetSlots, secondSetSlots, thirdSetSlots] of this.chooseTwoOptions) {\n let set = firstSet.copy();\n combinations.push(set.replaceSlots(secondSetSlots, secondSet).replaceSlots(thirdSetSlots, thirdSet));\n }\n }\n /* eslint-enable no-unused-vars */\n\n return combinations;\n }", "title": "" }, { "docid": "fa77882dbf60316f9d57a758817868de", "score": "0.4769277", "text": "function intersect(a, b) {\n var s = new Set(b);\n return a.filter(x => s.has(x));\n }", "title": "" }, { "docid": "33e668eab77add84880ffdb0833dd70f", "score": "0.47664052", "text": "function findCommonMembers(arrays, uniqByFunc) {\n const shortestArray = minBy(arrays, (_) => _.length);\n const results = [];\n for (const item of shortestArray) {\n // if this item is included in every array in the intermediate results, add it to the final results\n if (\n !arrays.some(\n (array) =>\n array.findIndex(\n (_) => uniqByFunc(_) === uniqByFunc(item)\n ) === -1\n )\n ) {\n results.push(item);\n }\n }\n return results;\n}", "title": "" }, { "docid": "c15947e1a6c97ebd6dbb7812104b7ee1", "score": "0.47498262", "text": "function common(a, b) {\n const dp = [[a[0] === b[0] ? 1 : 0]];\n for (let j = 1; j < b.length; j++) {\n dp[0][j] = (a[0] === b[j] ? 1 : 0) + dp[0][j - 1];\n }\n\n for (let i = 1; i < a.length; i++) {\n dp[i] = [dp[i - 1][0] + (a[i] === b[0] ? 1 : 0)];\n for (let j = 1; j < b.length; j++) {\n let count = dp[i - 1][j] + dp[i][j - 1] - dp[i - 1][j - 1];\n if (a[i] === b[j]) {\n count += dp[i - 1][j - 1] + 1;\n }\n dp[i][j] = count % mod;\n }\n }\n\n return dp;\n}", "title": "" }, { "docid": "bd61315d509862e53a86c76152f656fc", "score": "0.47495326", "text": "static getLabels (datasets) {\n // get all line labels\n const lines = Object.keys(datasets);\n\n if (lines.length == 0) {\n return [];\n }\n\n // get any line from the dataset\n const anyLine = lines[0];\n\n // get any dataset\n const anyDataset = datasets[anyLine];\n const anyData = anyDataset.data;\n const dataLength = anyData.length;\n\n const labels = [];\n for (let i = 0; i < dataLength; ++i) {\n labels.push(i);\n }\n\n return labels;\n }", "title": "" }, { "docid": "b3315c99449587bcd099bb79b5d3605f", "score": "0.4745132", "text": "static intersectData (d1, d2) {\n const result = {};\n for (const key of ArrayHelper.intersect(Object.keys(d1), Object.keys(d2))) {\n result[key] = d1[key].concat(d2[key]);\n }\n return result;\n }", "title": "" }, { "docid": "3229e86970577e06adfd2add6f9bf552", "score": "0.4736062", "text": "function generateConflictMatrix(labels, list){\n let conflictMatrix = new Array(labels.length);\n for (let i = 0; i < labels.length; i++){\n conflictMatrix[i] = new Array(labels.length).fill(0);\n }\n console.log(conflictMatrix);\n \n for (let i = 0; i < list.length - 1; i++){\n for (let j = i+1; j < list.length; j++){\n if(list[i][1] == list[j][1]){\n let firstIndex = labels.indexOf(list[i][0]);\n let secondIndex = labels.indexOf(list[j][0]);\n if (firstIndex!= secondIndex){\n conflictMatrix[firstIndex][secondIndex]++;\n conflictMatrix[secondIndex][firstIndex]++;\n }\n }\n }\n }\n return conflictMatrix;\n}", "title": "" }, { "docid": "6ba3f8f2ea3bc510215b91f9366535c8", "score": "0.47329462", "text": "function equalSets(a, b) {\n if (a.size !== b.size) return false;\n for (const i of a) if (!b.has(i)) return false;\n return true;\n}", "title": "" }, { "docid": "0ad97ca15de048ef1e3158e46b0676a1", "score": "0.47322178", "text": "function intersect(set) {\n var tempSet = new Set();\n for (var i = 0; i < this.dataStore.length; i++) {\n if (set.contains(this.dataStore[i])) {\n tempSet.add(this.dataStore[i]);\n }\n }\n return tempSet;\n }", "title": "" }, { "docid": "e8c2ef77bbd95c79e5ba0c6dde16a5ee", "score": "0.47301835", "text": "function intersection(l1, l2){\n\tvar l3 = [];\n\tfor(var i = 0; i < l1.length; i++){\n\t\tfor(var j = 0; j < l2.length; j++){\n\t\t\tif(l1[i] == l2[j]){\n\t\t\t\tl3.push(l1[i]);\n\t\t\t}\n\t\t}\n\t}\n\treturn l3;\n}", "title": "" }, { "docid": "9e2e5fd31207ee65df96a9337a18087b", "score": "0.4716004", "text": "function calculateSetDifference(setA, setB) {\n let _t = new Set();\n for (var i of setB) {\n if (!setA.has(i)) {\n _t.add(i);\n }\n }\n return _t;\n }", "title": "" }, { "docid": "fc2eb856422b9b15cf3cc338886dbbf5", "score": "0.47019914", "text": "function intersection(arr1, arr2) {\n let cashe = {};\n let result = [];\n\n for (let i = 0; i < arr1.length; i++) {\n cashe[arr1[i]] = true;\n }\n\n for (let i = 0; i < arr2.length ; i++) {\n if (!cashe[arr2[i]]){\n delete cashe[arr2[i]]\n }\n }\n\n for (key in cashe) {\n result = [...result, key]\n }\n\n return result;\n}", "title": "" }, { "docid": "27e4ce7d408875094a3019d0bffaa3bc", "score": "0.46880382", "text": "difference(otherSet) {\n const differenceSet = new CustomSet();\n const firstSet = this.values();\n \n firstSet.forEach(e => {\n if (!otherSet.has(e)) {\n differenceSet.add(e);\n }\n });\n return differenceSet;\n }", "title": "" }, { "docid": "da715f6cab5ab0d9dc31b9c775a92b59", "score": "0.46864334", "text": "function intersectionOf3Arrays(a, b, c) {\r\n const firstReturn = intersectionTwoArrays(a, b)\r\n return intersectionTwoArrays(firstReturn, c)\r\n}", "title": "" }, { "docid": "161fd6c9be20786f890e217d2c9ad2fe", "score": "0.46782798", "text": "function intersect(a, b) {\n if (b.length > a.length) return intersect(b, a)\n const set = new Set(b)\n return a.filter(i => set.has(i))\n}", "title": "" }, { "docid": "28541b18daf420e0389063535daac467", "score": "0.46729067", "text": "function sumCommon(arr1, arr2, arr3) {\n // Time=> always will be 3 arrays\n // N=> length of arrays.\n // it will increase as the length increases\n // Time: O(n) where n=== length of array. as there will be only 3 arrays, it does not\n // increase exponentially.\n // Space: O(n)\n let numMap = {};\n\n [arr1, arr2, arr3].forEach((arr) => {\n arr.forEach((element) => {\n numMap[element] ? numMap[element]++ : (numMap[element] = 1);\n });\n });\n\n let sum = 0;\n\n for (let [k, v] of Object.entries(numMap)) {\n if (v >= 3) {\n sum += Number.parseInt(k) * Math.floor(v / 3);\n }\n }\n\n return sum;\n}", "title": "" }, { "docid": "3527e9c0ae8a8ddb33ba69407415e310", "score": "0.46626124", "text": "function intersect(array1, array2) {\n // set-like intersection\n return uniq(array1).filter(function (item) {\n return array2.indexOf(item) > -1;\n });\n}", "title": "" }, { "docid": "b9fcacbe407ef91c974af8045d03458f", "score": "0.46615106", "text": "function intersection(arr1, arr2) {\n var res = [];\n arr1.forEach(el1 => {\n if (arr2.includes(el1)) res.push(el1);\n })\n return res;\n}", "title": "" }, { "docid": "a08a4458b6728e77f07fc5784c4afc1a", "score": "0.46502697", "text": "function setCompare(set1, set2) {\n if (set1.size !== set2.size) {\n return false;\n }\n for (const a of set1) {\n if (!set2.has(a)) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "ced62a73588dffaa1cb15bd7be19767a", "score": "0.46429846", "text": "function mergeStyleSets() {\r\n var cssSets = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n cssSets[_i] = arguments[_i];\r\n }\r\n // tslint:disable-next-line:no-any\r\n var classNameSet = {};\r\n var classMap = {};\r\n var cssSet = cssSets[0];\r\n if (cssSet) {\r\n if (cssSets.length > 1) {\r\n cssSet = concatStyleSets_1.concatStyleSets.apply(void 0, cssSets);\r\n }\r\n var registrations = [];\r\n for (var prop in cssSet) {\r\n if (cssSet.hasOwnProperty(prop)) {\r\n var args = cssSet[prop];\r\n // tslint:disable-next-line:no-any\r\n var _a = extractStyleParts_1.extractStyleParts(args), classes = _a.classes, objects = _a.objects;\r\n var registration = styleToClassName_1.styleToRegistration({ displayName: prop }, objects);\r\n registrations.push(registration);\r\n if (registration) {\r\n classMap[prop] = registration.className;\r\n classNameSet[prop] = classes.concat([registration.className]).join(' ');\r\n }\r\n }\r\n }\r\n for (var _b = 0, registrations_1 = registrations; _b < registrations_1.length; _b++) {\r\n var registration = registrations_1[_b];\r\n if (registration) {\r\n styleToClassName_1.applyRegistration(registration, classMap);\r\n }\r\n }\r\n }\r\n return classNameSet;\r\n}", "title": "" }, { "docid": "ced62a73588dffaa1cb15bd7be19767a", "score": "0.46429846", "text": "function mergeStyleSets() {\r\n var cssSets = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n cssSets[_i] = arguments[_i];\r\n }\r\n // tslint:disable-next-line:no-any\r\n var classNameSet = {};\r\n var classMap = {};\r\n var cssSet = cssSets[0];\r\n if (cssSet) {\r\n if (cssSets.length > 1) {\r\n cssSet = concatStyleSets_1.concatStyleSets.apply(void 0, cssSets);\r\n }\r\n var registrations = [];\r\n for (var prop in cssSet) {\r\n if (cssSet.hasOwnProperty(prop)) {\r\n var args = cssSet[prop];\r\n // tslint:disable-next-line:no-any\r\n var _a = extractStyleParts_1.extractStyleParts(args), classes = _a.classes, objects = _a.objects;\r\n var registration = styleToClassName_1.styleToRegistration({ displayName: prop }, objects);\r\n registrations.push(registration);\r\n if (registration) {\r\n classMap[prop] = registration.className;\r\n classNameSet[prop] = classes.concat([registration.className]).join(' ');\r\n }\r\n }\r\n }\r\n for (var _b = 0, registrations_1 = registrations; _b < registrations_1.length; _b++) {\r\n var registration = registrations_1[_b];\r\n if (registration) {\r\n styleToClassName_1.applyRegistration(registration, classMap);\r\n }\r\n }\r\n }\r\n return classNameSet;\r\n}", "title": "" }, { "docid": "ced62a73588dffaa1cb15bd7be19767a", "score": "0.46429846", "text": "function mergeStyleSets() {\r\n var cssSets = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n cssSets[_i] = arguments[_i];\r\n }\r\n // tslint:disable-next-line:no-any\r\n var classNameSet = {};\r\n var classMap = {};\r\n var cssSet = cssSets[0];\r\n if (cssSet) {\r\n if (cssSets.length > 1) {\r\n cssSet = concatStyleSets_1.concatStyleSets.apply(void 0, cssSets);\r\n }\r\n var registrations = [];\r\n for (var prop in cssSet) {\r\n if (cssSet.hasOwnProperty(prop)) {\r\n var args = cssSet[prop];\r\n // tslint:disable-next-line:no-any\r\n var _a = extractStyleParts_1.extractStyleParts(args), classes = _a.classes, objects = _a.objects;\r\n var registration = styleToClassName_1.styleToRegistration({ displayName: prop }, objects);\r\n registrations.push(registration);\r\n if (registration) {\r\n classMap[prop] = registration.className;\r\n classNameSet[prop] = classes.concat([registration.className]).join(' ');\r\n }\r\n }\r\n }\r\n for (var _b = 0, registrations_1 = registrations; _b < registrations_1.length; _b++) {\r\n var registration = registrations_1[_b];\r\n if (registration) {\r\n styleToClassName_1.applyRegistration(registration, classMap);\r\n }\r\n }\r\n }\r\n return classNameSet;\r\n}", "title": "" }, { "docid": "ced62a73588dffaa1cb15bd7be19767a", "score": "0.46429846", "text": "function mergeStyleSets() {\r\n var cssSets = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n cssSets[_i] = arguments[_i];\r\n }\r\n // tslint:disable-next-line:no-any\r\n var classNameSet = {};\r\n var classMap = {};\r\n var cssSet = cssSets[0];\r\n if (cssSet) {\r\n if (cssSets.length > 1) {\r\n cssSet = concatStyleSets_1.concatStyleSets.apply(void 0, cssSets);\r\n }\r\n var registrations = [];\r\n for (var prop in cssSet) {\r\n if (cssSet.hasOwnProperty(prop)) {\r\n var args = cssSet[prop];\r\n // tslint:disable-next-line:no-any\r\n var _a = extractStyleParts_1.extractStyleParts(args), classes = _a.classes, objects = _a.objects;\r\n var registration = styleToClassName_1.styleToRegistration({ displayName: prop }, objects);\r\n registrations.push(registration);\r\n if (registration) {\r\n classMap[prop] = registration.className;\r\n classNameSet[prop] = classes.concat([registration.className]).join(' ');\r\n }\r\n }\r\n }\r\n for (var _b = 0, registrations_1 = registrations; _b < registrations_1.length; _b++) {\r\n var registration = registrations_1[_b];\r\n if (registration) {\r\n styleToClassName_1.applyRegistration(registration, classMap);\r\n }\r\n }\r\n }\r\n return classNameSet;\r\n}", "title": "" }, { "docid": "ced62a73588dffaa1cb15bd7be19767a", "score": "0.46429846", "text": "function mergeStyleSets() {\r\n var cssSets = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n cssSets[_i] = arguments[_i];\r\n }\r\n // tslint:disable-next-line:no-any\r\n var classNameSet = {};\r\n var classMap = {};\r\n var cssSet = cssSets[0];\r\n if (cssSet) {\r\n if (cssSets.length > 1) {\r\n cssSet = concatStyleSets_1.concatStyleSets.apply(void 0, cssSets);\r\n }\r\n var registrations = [];\r\n for (var prop in cssSet) {\r\n if (cssSet.hasOwnProperty(prop)) {\r\n var args = cssSet[prop];\r\n // tslint:disable-next-line:no-any\r\n var _a = extractStyleParts_1.extractStyleParts(args), classes = _a.classes, objects = _a.objects;\r\n var registration = styleToClassName_1.styleToRegistration({ displayName: prop }, objects);\r\n registrations.push(registration);\r\n if (registration) {\r\n classMap[prop] = registration.className;\r\n classNameSet[prop] = classes.concat([registration.className]).join(' ');\r\n }\r\n }\r\n }\r\n for (var _b = 0, registrations_1 = registrations; _b < registrations_1.length; _b++) {\r\n var registration = registrations_1[_b];\r\n if (registration) {\r\n styleToClassName_1.applyRegistration(registration, classMap);\r\n }\r\n }\r\n }\r\n return classNameSet;\r\n}", "title": "" }, { "docid": "ced62a73588dffaa1cb15bd7be19767a", "score": "0.46429846", "text": "function mergeStyleSets() {\r\n var cssSets = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n cssSets[_i] = arguments[_i];\r\n }\r\n // tslint:disable-next-line:no-any\r\n var classNameSet = {};\r\n var classMap = {};\r\n var cssSet = cssSets[0];\r\n if (cssSet) {\r\n if (cssSets.length > 1) {\r\n cssSet = concatStyleSets_1.concatStyleSets.apply(void 0, cssSets);\r\n }\r\n var registrations = [];\r\n for (var prop in cssSet) {\r\n if (cssSet.hasOwnProperty(prop)) {\r\n var args = cssSet[prop];\r\n // tslint:disable-next-line:no-any\r\n var _a = extractStyleParts_1.extractStyleParts(args), classes = _a.classes, objects = _a.objects;\r\n var registration = styleToClassName_1.styleToRegistration({ displayName: prop }, objects);\r\n registrations.push(registration);\r\n if (registration) {\r\n classMap[prop] = registration.className;\r\n classNameSet[prop] = classes.concat([registration.className]).join(' ');\r\n }\r\n }\r\n }\r\n for (var _b = 0, registrations_1 = registrations; _b < registrations_1.length; _b++) {\r\n var registration = registrations_1[_b];\r\n if (registration) {\r\n styleToClassName_1.applyRegistration(registration, classMap);\r\n }\r\n }\r\n }\r\n return classNameSet;\r\n}", "title": "" }, { "docid": "93509bc2eecdaad80ffddb81bd8de3d1", "score": "0.46272245", "text": "function orderedSet_contains(set1, set2, caseSensitive) {\n for (const val2 of set2) {\n let found = false;\n for (const val1 of set1) {\n if (caseSensitive) {\n if (val1 === val2) {\n found = true;\n break;\n }\n }\n else {\n if (val1.toUpperCase() === val2.toUpperCase()) {\n found = true;\n break;\n }\n }\n }\n if (!found)\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "63eb82d46bc6dbcdf41cda289fceec4e", "score": "0.46142012", "text": "function getDistanceMatrices(areas, sets, setids) {\n // initialize an empty distance matrix between all the points\n var distances = zerosM(sets.length, sets.length),\n constraints = zerosM(sets.length, sets.length);\n\n // compute required distances between all the sets such that\n // the areas match\n areas.filter(function(x) {\n return x.sets.length == 2;\n })\n .map(function(current) {\n var left = setids[current.sets[0]],\n right = setids[current.sets[1]],\n r1 = Math.sqrt(sets[left].size / Math.PI),\n r2 = Math.sqrt(sets[right].size / Math.PI),\n distance = distanceFromIntersectArea(r1, r2, current.size);\n\n distances[left][right] = distances[right][left] = distance;\n\n // also update constraints to indicate if its a subset or disjoint\n // relationship\n var c = 0;\n if (current.size + 1e-10 >= Math.min(sets[left].size,\n sets[right].size)) {\n c = 1;\n } else if (current.size <= 1e-10) {\n c = -1;\n }\n constraints[left][right] = constraints[right][left] = c;\n });\n\n return {\n distances: distances,\n constraints: constraints\n };\n }", "title": "" }, { "docid": "1ba3d0497fd95a7ab84599afcdbedc17", "score": "0.46139956", "text": "function getSharedNames(list1, list2) {\n // filter first list\n const lists = list1.filter((list) => {\n // compare both list and return a new array list that includes same value\n return list2.includes(list);\n });\n\n return lists;\n}", "title": "" }, { "docid": "735ae5738765be52ee131743011bdb6e", "score": "0.46132874", "text": "averageSimilarLabels(labels) {\n const ids = Object.keys(labels);\n const newLabels = {};\n const counts = {};\n ids.forEach((id) => {\n const m = /(\\w*[A-Za-z_]+)(\\d*)/.exec(id);\n const newId = m[1];\n const pos = newLabels[newId];\n if (pos) {\n newLabels[newId] = pos.map((a, i) => a + labels[id][i]);\n counts[newId] += 1;\n } else {\n newLabels[newId] = labels[id].slice(0, 3);\n counts[newId] = 1;\n }\n });\n Object.keys(newLabels).forEach((id) => {\n newLabels[id] = newLabels[id].map(a => a / counts[id]);\n });\n return newLabels;\n }", "title": "" }, { "docid": "93a7b86e9314e4d493a5677930813e2c", "score": "0.46130908", "text": "function union(setA, ...sets) {\n const union = new Set(setA);\n sets.forEach(currentSet => {\n for (const elem of currentSet) {\n union.add(elem);\n }\n });\n return union;\n}", "title": "" }, { "docid": "e57d0613cf69cd49b4ba547c7a43d3c0", "score": "0.46089616", "text": "filterIntersect(subsA, subsB) {\n var intersect = {}\n for (let name in subsA) {\n var info = subsA[name]\n if (name in subsB || subsB.hasOwnProperty(name)) {\n intersect[name] = info\n }\n }\n return intersect\n }", "title": "" }, { "docid": "6218a1f48a2dcb6e9e395b34a4d7e865", "score": "0.460368", "text": "function compareSets(a, b){\n\tif(a.elements.length > b.elements.length){\n\t\treturn -1;\n\t}\n\tif(a.elements.length < b.elements.length){\n\t\treturn 1;\n\t}\n\treturn 0;\n}", "title": "" }, { "docid": "767fb2225f009fb6cedd54957d73c2f2", "score": "0.4594507", "text": "function map_labels (response) {\n return _.map(response.data, map_label);\n }", "title": "" }, { "docid": "94073a6a6e120ae65236ec803c4cb211", "score": "0.45912328", "text": "function getDistanceMatrices(areas, sets, setids) {\n // initialize an empty distance matrix between all the points\n var distances = zerosM(sets.length, sets.length),\n constraints = zerosM(sets.length, sets.length);\n\n // compute required distances between all the sets such that\n // the areas match\n areas.filter(function (x) {\n return x.sets.length == 2;\n }).map(function (current) {\n var left = setids[current.sets[0]],\n right = setids[current.sets[1]],\n r1 = Math.sqrt(sets[left].size / Math.PI),\n r2 = Math.sqrt(sets[right].size / Math.PI),\n distance$$1 = distanceFromIntersectArea(r1, r2, current.size);\n\n distances[left][right] = distances[right][left] = distance$$1;\n\n // also update constraints to indicate if its a subset or disjoint\n // relationship\n var c = 0;\n if (current.size + 1e-10 >= Math.min(sets[left].size, sets[right].size)) {\n c = 1;\n } else if (current.size <= 1e-10) {\n c = -1;\n }\n constraints[left][right] = constraints[right][left] = c;\n });\n\n return { distances: distances, constraints: constraints };\n }", "title": "" }, { "docid": "a0d8fa3dbed8efaa0256847f24c53929", "score": "0.45804295", "text": "function matchDiscountSet() {\n // Convert shopping list into a set of its names\n let checkout_set = new Set(shopping_cart);\n console.log(checkout_set);\n // Compare shopping cart set matches any discount set from discount list\n for (const discount_set of discount_list) {\n if (setCompare(discount_set.set, checkout_set)) {\n // Return the matched discount set\n return discount_set;\n }\n }\n // No discount set matched\n return null;\n}", "title": "" }, { "docid": "ae28b4a75410206e2eb91d664c3fda5f", "score": "0.45703188", "text": "function getDFMap(allWords, documents){\n var DFMap = new Map()\n allWords.forEach(word => {\n DFMap.set(word, howManyDocsHaveIt(word, documents))\n });\n return DFMap\n}", "title": "" }, { "docid": "117b3b4d316107c1fd18b9d809e452fe", "score": "0.45650914", "text": "function myFunction(set1, set2) {\n var answer = new Set([...set1, ...set2]);\n return answer;\n}", "title": "" }, { "docid": "7b0f1725cd0b20abd3ca599e4277c0a7", "score": "0.45501634", "text": "intersect (arrList) {\n const arrLength = Object.keys(arrList).length;\n // (Also accepts regular objects as input)\n const index = {};\n for (let i in arrList) {\n for (let j in arrList[i]) {\n const v = arrList[i][j];\n if (index[v] === undefined) index[v] = {};\n index[v][i] = true; // Mark as present in i input.\n }\n }\n const retv = [];\n for (let i in index) {\n if (Object.keys(index[i]).length === arrLength) retv.push(i);\n }\n return retv;\n }", "title": "" }, { "docid": "beb037dd0d0318259eda6910184ad13e", "score": "0.45446637", "text": "function getTFMap(allWords, documents){\n var TFMap = new Map()\n var docMap = new Map()\n documents.forEach(obj=>{\n docMap = new Map()\n allWords.forEach(word=>{\n docMap.set(word, getWordRepeatCount(word, obj.content.split(' ')))\n })\n TFMap.set(obj.key, docMap)\n })\n\n return TFMap\n}", "title": "" }, { "docid": "537e6f6b74b7dfa293b4348e5f29eeea", "score": "0.45422915", "text": "function commonElements(array1, array2){\n let common =[];\n for (let i = 0; i < array1.length; i++){\n for (let j = 0; j < array2.length; j++){\n if (array1[i] === array2[j]){\n common.push(i);\n }\n }\n }\n // console.log(common);\n return common;\n}", "title": "" }, { "docid": "a5f821d4f1f26efc4fa50f5ae8d69646", "score": "0.45371786", "text": "function intersect(L, M) {\n if (L.length > M.length) {\n [M, L] = [L, M];\n }\n const C = [];\n let mPos = 0;\n for (let i = 0; i < L.length; ++i) {\n // avoid duplicates\n if (C.length > 0 && C[C.length-1] == L[i]) {\n continue;\n }\n while(mPos < M.length) {\n // if it's smaller, keep scanning\n if (L[i] < M[mPos]) {\n break; \n } else if (L[i] > M[mPos]) { // if it's larger, we didn't find intersection, move to the next letter\n mPos += 1;\n } else { // found an intersection\n C.push(L[i]);\n mPos += 1;\n break;\n }\n }\n if (mPos == M.length) {\n return C;\n }\n }\n return C;\n}", "title": "" }, { "docid": "fd068f1088a91725346de03c509337aa", "score": "0.4513503", "text": "function intersection(arr1, arr2) {\n\tvar rtn = [];\n\n\tif (arr1.length > arr2.length) {\n\t\tvar t = arr1;\n\n\t\tarr1 = arr2;\n\t\tarr2 = t;\n\t}\n\n\tfor (var i = 0, c = arr1.length; i < c; i++) {\n\t\tvar d = arr1[i];\n\n\t\tif (arr2.indexOf(d) !== -1) {\n\t\t\trtn.push(d);\n\t\t}\n\t}\n\n\treturn rtn;\n}", "title": "" }, { "docid": "ab33b5fc71ff10015246b23b02f7c0d1", "score": "0.45123723", "text": "function intersection(arr1, arr2) {\n const intersection = arr1.filter(ele => {\n if(arr2.indexOf(ele) !== -1) return ele;\n });\n\n return [...new Set(intersection)];\n}", "title": "" }, { "docid": "f93a7598b7741f25b8ea630369eae65b", "score": "0.45043728", "text": "difference(otherSet) {\r\n const differenceSet = new MySet();\r\n const firstSet = this.values();\r\n \r\n firstSet.forEach(function(e){\r\n if(!otherSet.has(e)){\r\n differenceSet.add(e);\r\n }\r\n });\r\n\r\n return differenceSet;\r\n }", "title": "" }, { "docid": "e4a5ab3386847685f0220a13090d4127", "score": "0.45031765", "text": "function intersectBy(a, b, fn) {\n var s = new Set(b.map(fn));\n return a.filter(x => s.has(fn(x)));\n }", "title": "" }, { "docid": "96ebe01f5316ced35f6c4945e0360afb", "score": "0.45011052", "text": "function inefficientIntersectingLists(ll1, ll2) {\n let firstNode = ll1\n let secondNode = ll2\n const setOfNodes = new Set()\n // make a set of nodes\n while (firstNode !== null) {\n setOfNodes.add(firstNode)\n firstNode = firstNode.next\n }\n // loop through second linkedList check for overlap\n while (secondNode !== null) {\n if (setOfNodes.has(secondNode)) {\n return secondNode\n }\n secondNode = secondNode.next\n }\n // didn't have overlap\n return 'No Overlap'\n}", "title": "" }, { "docid": "71ce2b41f3e049f971937abae4e3565f", "score": "0.449835", "text": "function orderedSet_contains(set1, set2, caseSensitive) {\n var e_1, _a, e_2, _b;\n try {\n for (var set2_1 = __values(set2), set2_1_1 = set2_1.next(); !set2_1_1.done; set2_1_1 = set2_1.next()) {\n var val2 = set2_1_1.value;\n var found = false;\n try {\n for (var set1_1 = (e_2 = void 0, __values(set1)), set1_1_1 = set1_1.next(); !set1_1_1.done; set1_1_1 = set1_1.next()) {\n var val1 = set1_1_1.value;\n if (caseSensitive) {\n if (val1 === val2) {\n found = true;\n break;\n }\n }\n else {\n if (val1.toUpperCase() === val2.toUpperCase()) {\n found = true;\n break;\n }\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (set1_1_1 && !set1_1_1.done && (_b = set1_1.return)) _b.call(set1_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n if (!found)\n return false;\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (set2_1_1 && !set2_1_1.done && (_a = set2_1.return)) _a.call(set2_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return true;\n}", "title": "" }, { "docid": "b7588a90681270a2b5bb6c82be2e23ff", "score": "0.4494019", "text": "union(otherSet) {\n const unionSet = new CustomSet();\n const firstSet = this.values();\n const secondSet = otherSet.values();\n\n firstSet.forEach(e => {\n unionSet.add(e);\n });\n\n secondSet.forEach(e => {\n unionSet.add(e);\n });\n\n return unionSet;\n }", "title": "" } ]
eb6e45097495c6f4b26a3946a79a9e83
make ajax call to server to unlike entry, and on success, toggle unlike button to like and decrement like count wihout refreshing page
[ { "docid": "00665ffb68edbb38c9d3c6471000b342", "score": "0.83695775", "text": "function unlikePost(entryID) {\n if (WAITING_FOR_AJAX) {\n return;\n }\n WAITING_FOR_AJAX = true;\n var $likeButton = $('#' + entryID + ' .like-button');\n $.post({\n url: '/unlikepost/' + String(entryID),\n success: function() {\n var $likeCount = $('#' + entryID + ' .like-count');\n\n // toggle to unlike\n $likeButton.text('👍 Like');\n\n // change onclick to like function\n oldFunc = $likeButton.attr('onclick');\n newFunc = oldFunc.replace('unlike', 'like');\n $likeButton.attr('onclick', newFunc);\n\n // increment like-count\n var likeCount = parseInt($likeCount.text());\n $likeCount.text(likeCount - 1);\n WAITING_FOR_AJAX = false;\n },\n error: function() {\n alert(\"Not allowed to unlike!\");\n WAITING_FOR_AJAX = false;\n }\n });\n}", "title": "" } ]
[ { "docid": "ba1f70b2cefbd90555ceae344dd130c9", "score": "0.7917354", "text": "function likePost(entryID) {\n if (WAITING_FOR_AJAX) {\n return;\n }\n WAITING_FOR_AJAX = true;\n var $likeButton = $('#' + entryID + ' .like-button');\n $.post({\n url : '/likepost/' + String(entryID),\n success: function() {\n var $likeCount = $('#' + entryID + ' .like-count');\n // toggle to unlike\n $likeButton.text('👍 Unlike');\n\n // change onclick to unlike function\n oldFunc = $likeButton.attr('onclick');\n newFunc = oldFunc.replace('like', 'unlike');\n $likeButton.attr('onclick', newFunc);\n\n // increment like-count\n var likeCount = parseInt($likeCount.text());\n $likeCount.text(likeCount + 1);\n WAITING_FOR_AJAX = false;\n },\n error: function() {\n alert(\"Not allowed to like!\");\n WAITING_FOR_AJAX = false;\n }\n });\n}", "title": "" }, { "docid": "c417db910028257b582451d3f38c6791", "score": "0.783303", "text": "function updateLikeDislike() {\n $.post(\"/songcloud/get_like_dislike\", {roomId:roomId, roomType:roomType})\n .done(function(data) {\n if(data == '') {\n return;\n }\n var dislike = data.countdislike;\n var count = $(\"#countdislike\");\n var next = $(\"#next\");\n var maxNum = Math.ceil(data.memberNum*0.6);\n if (dislike >= maxNum) {\n if($('#startBtnAdmin').length) {\n clearInterval(adminInterval);\n updateSongDefault();\n $(\"#like-button\").on('click',addLike);\n $(\"#dislike-button\").on('click',addDislike);\n }\n else {\n $(\"#like-button\").on('click',addLike);\n $(\"#dislike-button\").on('click',addDislike);\n jumpInterval = setInterval(FindNext, 1000);\n }\n }\n count.text(dislike);\n\n var like = data.countlike;\n var countlike = $(\"#countlike\");\n countlike.text(like);\n })\n}", "title": "" }, { "docid": "2a1d8f294a05e6a7c1e828573d7f7208", "score": "0.77571833", "text": "function unlikeComment(commentID) {\n if (WAITING_FOR_AJAX) {\n return;\n }\n WAITING_FOR_AJAX = true;\n $.post({\n url: '/unlikecomment/' + String(commentID),\n success: function() {\n var $likeButton = $('#' + commentID + ' .like-comment-button');\n var $likeCount = $('#' + commentID + ' .like-comment-count');\n\n // toggle to unlike\n $likeButton.text('👍 Like');\n\n // change onclick to like function\n oldFunc = $likeButton.attr('onclick');\n newFunc = oldFunc.replace('unlike', 'like');\n $likeButton.attr('onclick', newFunc);\n\n // increment like-count\n var likeCount = parseInt($likeCount.text());\n $likeCount.text(likeCount - 1);\n WAITING_FOR_AJAX = false;\n },\n error: function() {\n alert(\"Not allowed to unlike!\");\n WAITING_FOR_AJAX = false;\n }\n });\n}", "title": "" }, { "docid": "6d9124a977dfbe8e76f2d8efcc38901d", "score": "0.7700178", "text": "function like(){\n $('.btn-like').off().click(function(){\n console.log('like');\n $(this).addClass('btn-unlike').removeClass('btn-like');\n $(this).attr('src', '/img/heart-red.png');\n\n $.ajax({\n url: url+'/like/'+$(this).data('id'),\n type: 'GET',\n success: function(response){\n // like un objeto que devuelve response, al dar click\n if (response.like) {\n console.log('like sucess');\n } else {\n console.log('like not sucess');\n }\n }\n });\n\n unlike();\n });\n }", "title": "" }, { "docid": "fe3ae949ef5861a6f5b26684f2beaffc", "score": "0.76740944", "text": "function Liked(id) {\n //id is the id of the like button\n //check the class of like button if(light)-> make new like else make like before\n var btn = document.getElementById(id).className;\n //loading like data to send to action\n var like = {};\n like.PostID = id.substring(8);\n console.log(like.PostID);\n var nLike = $('#nolike_' + id.substring(8)).text();\n //Make like on post\n if (btn == \"btn btn-light\") {\n $.ajax({\n method: \"Post\",\n url: \"/homepage/LikePost\",\n data: { like: like },\n success: function () {\n document.getElementById(id).classList.add(\"btn-primary\");\n document.getElementById(id).classList.remove(\"btn-light\");\n nLike = parseInt(nLike)+1 ;\n $('#nolike_' + id.substring(8)).text(nLike + ' Likes');\n }\n });\n }\n //Remove like from post\n else {\n $.ajax({\n method: \"Post\",\n url: \"/homepage/RemoveLikePost\",\n data: { like: like },\n success: function () {\n document.getElementById(id).classList.add(\"btn-light\");\n document.getElementById(id).classList.remove(\"btn-primary\");\n nLike = parseInt(nLike) - 1;\n $('#nolike_' + id.substring(8)).text(nLike + ' Likes');\n }\n });\n }\n\n}", "title": "" }, { "docid": "7bcb0a8a36f2b6d67f07f79f0300fdfb", "score": "0.76489735", "text": "function like_unlike(post_id) {\n // Create JSON\n fetch('/like_unlike', {\n method: 'POST',\n body: JSON.stringify({\n post_id: post_id\n })\n })\n // Put response into json form\n .then(response => response.json())\n .then(result => {\n if (result.message == \"post liked successfully\") {\n // Post has been liked successfully\n console.log(result);\n // Update HTML to reflect the like\n let old_num_likes = document.getElementById(post_id+\"_numlikes\").innerHTML;\n document.getElementById(post_id+\"_numlikes\").innerHTML = parseInt(old_num_likes) + 1;\n\n } else {\n // Post has been unliked successfully\n console.log(result);\n // Update HTML to reflect the unlike\n let old_num_likes = document.getElementById(post_id+\"_numlikes\").innerHTML;\n document.getElementById(post_id+\"_numlikes\").innerHTML = parseInt(old_num_likes) - 1;\n } \n })\n .catch(error => {\n console.log('Error:', error);\n });\n\n // Stop form from submitting\n return false;\n}", "title": "" }, { "docid": "29272a0a9c00726e3ad0f5b111ca69a8", "score": "0.75081074", "text": "function like(post_id)\n{\n var target_url = '/post/' + post_id + '/like/';\n var xhr = new XMLHttpRequest();\n xhr.open('get', target_url);\n\n xhr.onreadystatechange = function()\n {\n if(xhr.readyState === 4)\n {\n if(xhr.status === 200)\n {\n var like_button_css_path = '#like_button_' + post_id;\n var target_element = $(like_button_css_path);\n var t = \"unlike(\" + post_id + \")\";\n target_element.attr(\"onclick\", t);\n target_element.html('<i class=\"thumbs outline down icon\"></i>Unlike');\n\n var like_count_css_path = '#like_count_' + post_id;\n var count1 = parseInt($(like_count_css_path).text());\n $(like_count_css_path).text(String(count1 + 1));\n }\n }\n };\n xhr.send(null);\n}", "title": "" }, { "docid": "7e8e40f2e790387a8b75f78b04b8ad01", "score": "0.7489591", "text": "function likeAndUnlikeAction($elem)\n\t{\n\t\tvar $id=$elem.parent().find('.id').text();\n\n\t\tvar $span=$elem.parent().find('span.likes-count');\n\n\t\tif($elem.hasClass('far'))\n\t\t{\n\t\t\t$elem.removeClass('far').addClass('fas');\n\n\t\t\t$.ajax('/comment/like', {\n\t\t\t\ttype:'POST',\n\t\t\t\theaders:{'X-CSRF-TOKEN':$('meta[name=\"csrf-token\"]').attr('content')},\n\t\t\t\tdata:{\n\t\t\t\t\t'comment_id':$id\n\t\t\t\t},\n\t\t\t\tsuccess:function(data) {\n\t\t\t\t\t$span.text(data);\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$elem.removeClass('fas').addClass('far');\n\n\t\t\t$.ajax('/comment/unlike', {\n\t\t\t\ttype:'POST',\n\t\t\t\theaders:{'X-CSRF-TOKEN':$('meta[name=\"csrf-token\"]').attr('content')},\n\t\t\t\tdata:{\n\t\t\t\t\t'comment_id':$id\n\t\t\t\t},\n\t\t\t\tsuccess:function(data) {\n\t\t\t\t\t$span.text(data);\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}", "title": "" }, { "docid": "258f872769f9ebb33dbbce5f9d440831", "score": "0.74863964", "text": "function comment_like_unlike(button,operation,CID,SID,Notified,User,token){\n\t\t\t\t\tvar line_number = parseInt($(\"#likes-number-comment-\"+CID).html());\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\ttype:\"POST\",\n\t\t\t\t\t\turl:\"../api/api.php\",\n\t\t\t\t\t\tdata:{operation:operation,CID:CID,Notified:Notified,SID:SID,User:User,action:\"unlineAndlikeComment\",token:token},\n\t\t\t\t\t\tsuccess:function(data){\n\t\t\t\t\t\t\tif(operation==\"plus\"){\n\t\t\t\t\t\t\t\t$(button).attr({\"onclick\":\"comment_like_unlike(this,'minus',\"+CID+\",\"+SID+\",\"+Notified+\",\"+User+\")\"});\n\t\t\t\t\t\t\t\t$(button).html(\"unlike\");\n\t\t\t\t\t\t\t\t$(\"#likes-number-comment-\"+CID).html(line_number+1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (operation==\"minus\") {\n\t\t\t\t\t\t\t\t$(button).attr({\"onclick\":\"comment_like_unlike(this,'plus',\"+CID+\",\"+SID+\",\"+Notified+\",\"+User+\")\"});\n\t\t\t\t\t\t\t\t$(button).html(\"like\");\n\t\t\t\t\t\t\t\t$(\"#likes-number-comment-\"+CID).html(line_number-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}", "title": "" }, { "docid": "9bff0613c31fc10dfb25e362acea0888", "score": "0.7358001", "text": "function do_like(){\n\t$.ajax({\n\t\t//data: ({\"username\":username,\"password\":password}),\n\t\ttype: \"POST\", \n\t\turl: \"\"+window.location.href+\"/like_view/\", \n\t\tsuccess: function(data) {\n\t\t\tresponse = JSON.parse(data);\n\t\t\t//Wrong login/password input\n\t\t\tif (response[\"response_code\"]==-100){\n\t\t\t\t//$('#login-alert').text(response[\"message\"]).show();\n\t\t\t\talert(\"Error. Can't like this route\")\n\t\t\t} else if(response[\"response_code\"]==200){\n\t\t\t//Correct response\n\t\t\t//Show user name instead of login button \n\t\t\t\tvar current_likes = parseInt($('#like_counter').text());\n\t\t\t\t$('#like_counter').text(current_likes+1).prop('title', current_likes+1);\n\t\t\t}\n\t\t},\n\t\terror: function (data) {\n\t\t\t//$('#login-alert').text(\"Submit fail. Try again\").show();\n\t\t\talert(\"Connection Error. Can't send request\")\n\t\t} \n\t});\n}", "title": "" }, { "docid": "c21dea1d0026571c9cd5ed3a197f76d0", "score": "0.73275554", "text": "function like_post(post_id) {\n \t$.ajax({\n\t\turl: \"/cgi-bin/postHandler.py\",\n\n\t\ttype: \"POST\",\n\n\t\tdata: \"like=true&id=\" + post_id,\n\n\t\tdataType: \"json\",\n\n\t\tsuccess: function(data) {\n\t\t\tif(data.result == 'succeed') {\n\t\t\t\told_likes = parseInt($(\"#\"+post_id).text());\n\n\t\t\t\t$(\"#\"+post_id).text(++old_likes);\n\n\t\t\t}\n\t\t\telse if(data.result != \"no change\") {\n\t\t\t\talert(\"server error\")\n\t\t\t}\n\t\t},\n\n\t\terror: function(data) {\n\t\t\talert(\"server error\");\n\t\t\tconsole.log(data);\n\t\t}\n\n\t});\n }", "title": "" }, { "docid": "690d9c6519396196002b1c4679ab6f82", "score": "0.73213625", "text": "function unlike(event) {\n console.log('in unlike', event);\n event.preventDefault();\n const myHeaders = new Headers();\n myHeaders.append('Content-Type', 'application/json');\n \n const data = {\n post: event.target.dataset.post_id\n };\n console.log(data);\n // Fetches the like view and removes a like via DELETE\n fetch('/like', {\n method: 'DELETE',\n headers: myHeaders,\n body: JSON.stringify(data)\n })\n .then(response => response.json())\n .then(result => {\n console.log('result', result);\n })\n event.target.style.display = 'none';\n event.target.previousElementSibling.style.display = 'block';\n location.reload();\n}", "title": "" }, { "docid": "c04cbfeb29daaef6341baaf481be5129", "score": "0.7302804", "text": "function toggleLike(button, data, isResponse) {\n\tvar type = isResponse ? 1 : 0;\n\tbutton = $(button);\n\tvar likeText = button.find(\".like-text\");\n\tvar numLikes = button.find(\".num-likes\");\n\t\n\tif (data.liked) {\n\t\tpost(\"discussion.php\", {unlike: type, id: data.id}, function () {\n\t\t\tdata.likes--;\n\t\t\tdata.liked = 0;\n\t\t\tbutton.removeClass(\"liked\");\n\t\t\tlikeText.text(\"like\");\n\t\t\tnumLikes.text(data.likes);\n\t\t}, function () {\n\t\t\tnavigator.nofication.alert(\"You must be online to unlike this post.\", null, \"Post\");\n\t\t});\n\t} else {\n\t\tpost(\"discussion.php\", {like: type, id: data.id}, function () {\n\t\t\tdata.likes++;\n\t\t\tdata.liked = 1;\n\t\t\tbutton.addClass(\"liked\");\n\t\t\tlikeText.text(\"unlike\");\n\t\t\tnumLikes.text(data.likes);\n\t\t}, function () {\n\t\t\tnavigator.nofication.alert(\"You must be online to like this post.\", null, \"Post\");\n\t\t});\n\t}\n}", "title": "" }, { "docid": "4ca119ab1393a1517dd54b5c129ba2d7", "score": "0.7299009", "text": "function likeComment(commentID) {\n if (WAITING_FOR_AJAX) {\n return;\n }\n WAITING_FOR_AJAX = true;\n $.post({\n url : '/likecomment/' + String(commentID),\n success: function() {\n var $likeButton = $('#' + commentID + ' .like-comment-button');\n var $likeCount = $('#' + commentID + ' .like-comment-count');\n // toggle to unlike\n $likeButton.text('👍 Unlike');\n\n // change onclick to unlike function\n oldFunc = $likeButton.attr('onclick');\n newFunc = oldFunc.replace('like', 'unlike');\n $likeButton.attr('onclick', newFunc);\n\n // increment like-count\n var likeCount = parseInt($likeCount.text());\n $likeCount.text(likeCount + 1);\n WAITING_FOR_AJAX = false;\n },\n error: function() {\n alert('Not allowed to like!');\n WAITING_FOR_AJAX = false;\n }\n });\n}", "title": "" }, { "docid": "a04a42e22160a88ca96430f19a3121e5", "score": "0.7279841", "text": "function likeUnLike(recordId,secureV,request,unlikeT,likeT)\n{\n\tvar warning='';\n\tdocument.getElementById(\"lable_\"+secureV).onclick=function (){alert('wait');};\n $.ajax({\n type: \"POST\",\n url: \"ajax.php\",\n data: \"action=likeUnLike&recordId=\"+recordId+\"&secureV=\"+secureV,\n cache: false,\n success: function(html){\n\t\t\t if(html==0)///un expected error\n\t\t\t {\n\t\t\t\t\twarning='<img src=\"images/emotions/img/expliation_mark.jpg\" width=\"16\" height=\"16\" border=\"0\" title=\"error found..\" />';\n\t\t\t\t\tdocument.getElementById(\"text_\"+secureV).innerHTML+=warning;\n\t\t\t\t\tif(request==1)//do like request\n\t\t\t\t\t\t\tdocument.getElementById(\"lable_\"+secureV).onclick=function (){likeUnLike(recordId,secureV,0,unlikeT,likeT)};\n\t\t\t\t\telse\n\t\t\t\t\t\t\tdocument.getElementById(\"lable_\"+secureV).onclick=function (){likeUnLike(recordId,secureV,1,unlikeT,likeT)};\n\t\t\t }else// if every thing is okay\n\t\t\t {\n\t\t\t\t\tif(request==1)//do like\n\t\t\t\t\t{\n\t\t\t\t\t\t\tvar likeNum=parseInt(document.getElementById(secureV).innerHTML)+1;\n\t\t\t\t\t\t\tdocument.getElementById(\"text_\"+secureV).innerHTML=warning;\n\t\t\t\t\t\t\tdocument.getElementById(\"text_\"+secureV).className='functionImages likeUnlikeStatus';\n\t\t\t\t\t\t\tdocument.getElementById(secureV).innerHTML=likeNum;\n\t\t\t\t\t\t\tdocument.getElementById(\"lable_\"+secureV).onclick=function (){likeUnLike(recordId,secureV,0,unlikeT,likeT)};\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\t\tvar likeNum=parseInt(document.getElementById(secureV).innerHTML)-1;\n\t\t\t\t\t\t\tdocument.getElementById(\"text_\"+secureV).innerHTML=warning;\n\t\t\t\t\t\t\tdocument.getElementById(\"text_\"+secureV).className='functionImages likeUnlike';\n\t\t\t\t\t\t\tdocument.getElementById(secureV).innerHTML=likeNum;\n\t\t\t\t\t\t\tdocument.getElementById(\"lable_\"+secureV).onclick=function (){likeUnLike(recordId,secureV,1,unlikeT,likeT)};\n\t\t\t\t\t}\n\t\t\t }\n }\n });\n\n}", "title": "" }, { "docid": "ff02c76b8d34e893943d93689a6ceaa5", "score": "0.7272534", "text": "function likes(post_id) {\n console.log(\"Like/Unlike toggler\");\n fetch(`/post/${post_id}`,{\n method: 'PUT'\n\n });\n\n\n const div_post = document.querySelector(`#post-${post_id}`);\n const like_button_color = div_post.querySelector('#like-button').style.color;\n if (like_button_color === \"red\") {\n div_post.querySelector('#like-button').style.color = \"darkgray\";\n div_post.querySelector('#like-button').setAttribute('title', 'like');\n var count = div_post.querySelector(\"#like-counter\");\n var update_count = parseInt(count.innerHTML) - 1;\n count.innerHTML = update_count.toString();\n }\n else {\n div_post.querySelector('#like-button').style.color = \"red\";\n div_post.querySelector('#like-button').setAttribute('title', 'unlike');\n var count = div_post.querySelector(\"#like-counter\");\n var update_count = parseInt(count.innerHTML) + 1;\n count.innerHTML = update_count.toString();\n }\n\n}", "title": "" }, { "docid": "fe2bd8e002d09467d3bfa1b2b57c9ec5", "score": "0.72189087", "text": "function dislike(event, url, dislike) {\n event.preventDefault();\n var type = dislike.data('type');\n var pk = dislike.data('id');\n var action = dislike.data('action');\n var like = dislike.prev();\n\n // ajax request\n // send data\n $.post(url,\n {\n pk: pk,\n },\n // ###end### send data\n\n // get data + work with\n function (json) {\n if (json['status'] == 'ok') {\n\n // draw circle\n var id = 'circle-' + pk;\n var circle = document.getElementById(id);\n set_vote_circle(circle, json.percentage)\n // ###end### draw circle\n\n $('span.dislike').text(json.dislike_count);\n $('span.like').text(json.like_count);\n\n // for horizontal voting\n //var percentage = String(json.percentage + '%');\n //$('div.progress-bar').css('width',percentage);\n }\n }\n // ###end### get data + work with\n );\n // ###end### ajax request\n}", "title": "" }, { "docid": "9db6479222474fc3b1c4d5ec87a631f9", "score": "0.7108624", "text": "function unlikesubject(button,SID,Notified,User,token){\n\t\t\t\t\tvar operation = \"minus\";\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\ttype:\"POST\",\n\t\t\t\t\t\turl:\"../api/api.php\",\n\t\t\t\t\t\tdata:{User:User,Notified:Notified,SID:SID,operation:operation,action:\"likeSubject\",token:token},\n\t\t\t\t\t\tsuccess:function(data){\n\t\t\t\t\t\t}\t\n\t\t\t\t\t});\n\t\t\t\t\t//changing the unlike button to the like button\n\t\t\t\t\t$(button).attr({\"onclick\":\"likesubject(this,\"+SID+\",'',\"+User+\");\",\"style\":\"background-position: -85px -27px\"});\n\t\t\t\t}", "title": "" }, { "docid": "b2102e4264d9dc865e5f188f6757d261", "score": "0.7108129", "text": "function dislike() {\n $('.btn-dislike').unbind('click').click(function () {\n console.log('dislike');\n $(this).addClass('btn-like').remove('btn-dislike');\n $(this).attr('src', url+'/img/heart-black.png');\n //$(this).attr('src','img/heart-black.png');\n ///AJAX///\n //data('id') recoge atributo de la pagina data-id=\"{{$image->id}}\"\n //success: miisage si funciona\n $.ajax({\n url: url+'/dislike/'+$(this).data('id'), //.attr('data-id'), //.data('id'),\n type: 'GET',\n success: function(response){\n //console.log(response); datos del objeto\n if(response.dislike){\n console.log('Ok,AJAX dislike publicacion');\n }else{\n console.log('KO,AJAX ya dislike publicacion');\n }\n }\n });\n \n \n \n like();\n });\n \n \n \n }", "title": "" }, { "docid": "54b63c5b5f02f13c27233ebdeca3738e", "score": "0.7106014", "text": "function likesubject(button,SID,Notified,User,token){\n\t\t\t\t\tvar operation = \"plus\";\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\ttype:\"POST\",\n\t\t\t\t\t\turl:\"../api/api.php\",\n\t\t\t\t\t\tdata:{User:User,Notified:Notified,SID:SID,operation:operation,action:\"likeSubject\",token:token},\n\t\t\t\t\t\tsuccess:function(data){\n\t\t\t\t\t\t}\t\n\t\t\t\t\t});\n\t\t\t\t\t//changing the like button to the unlike button\t\n\t\t\t\t\t$(button).attr({\"onclick\":\"unlikesubject(this,\"+SID+\",\"+Notified+\",\"+User+\");\",\"style\":\"background-position: -60px -27px\"});\n\t\t\t\t}", "title": "" }, { "docid": "1df90f69062842c6c4685fb4941fdebf", "score": "0.7089372", "text": "function click_like(rid) {\r\n var ul_id = \"#like_dislike_\"+rid;\r\n var hreF = $r(ul_id+\" #like\").attr('href');\r\n $r.ajax({\r\n type: \"GET\",\r\n url : hreF,\r\n success: function(data){\r\n $r(ul_id).html(data);\r\n return false;\r\n }\r\n });\r\n return false;\r\n}", "title": "" }, { "docid": "417b485af44bf7fcd974698d2bc0fbad", "score": "0.70664734", "text": "function kopa_like_button_click(obj, pid) {\r\n if (!obj.hasClass('inprocess')) {\r\n var status = obj.hasClass('kopa_like_button_enable') ? 'enable' : 'disable';\r\n jQuery.ajax({\r\n type: 'POST',\r\n url: kopa_front_variable.ajax.url,\r\n dataType: 'json',\r\n async: false,\r\n data: {\r\n action: 'kopa_change_like_status',\r\n wpnonce: jQuery('#kopa_change_like_status_wpnonce').val(),\r\n pid: pid,\r\n status: status\r\n },\r\n beforeSend: function(XMLHttpRequest, settings) {\r\n obj.addClass('inprocess');\r\n },\r\n complete: function(XMLHttpRequest, textStatus) {\r\n },\r\n success: function(data) {\r\n obj.parent().find('.kopa_like_count').html(data.total);\r\n obj.removeClass('kopa_like_button_' + status);\r\n obj.addClass('kopa_like_button_' + data.status);\r\n obj.removeClass('inprocess');\r\n },\r\n error: function(XMLHttpRequest, textStatus, errorThrown) {\r\n }\r\n });\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "5d0e89afd83c98b97ffe6b39151f7700", "score": "0.70209354", "text": "function wpbooklistCommentsLikeButton() {\n\n\t\t$( document ).on( 'click', '.wpbooklist-comments-likes-thumb-img-wrapper', function( event ) {\n\n\t\t\tvar newlikes = 0;\n\t\t\tvar commentid = '';\n\t\t\tvar request = '';\n\t\t\tvar bookuid = $( this ).attr( 'data-bookuid' );\n\n\t\t\t// Dim and disable the like button, and get the attributes needed to update the DB.\n\t\t\t$(this).css({ 'opacity': '0.5', 'pointer-events': 'none' });\n\t\t\tcommentid = $( this ).attr( 'data-commentid' );\n\n\t\t\t// Increment the Like number.\n\t\t\tnewlikes = parseInt( $(this).attr( 'data-likes' ) ) + 1 ;\n\n\t\t\t// Display the new Like number.\n\t\t\t$(this).next( '.wpbooklist-comments-total-likes-p' ).text( newlikes + ' ' + wpbooklistCommentsPhpVariables.trans36 );\n\n\t\t\tvar data = {\n\t\t\t\t'action': 'wpbooklist_comments_like_action',\n\t\t\t\t'security': wpbooklistCommentsPhpVariables.adminnonce1,\n\t\t\t\t'commentid': commentid,\n\t\t\t\t'newlikes': newlikes,\n\t\t\t\t'bookuid': bookuid\n\t\t\t};\n\n\t\t\tconsole.log(data);\n\n\t\t\trequest = $.ajax({\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdata: data,\n\t\t\t\ttimeout: 0,\n\t\t\t\tsuccess: function( response ) {\n\t\t\t\t\tconsole.log(response);\n\t\t\t\t},\n\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\tconsole.log( errorThrown );\n\t\t\t\t\tconsole.log( textStatus );\n\t\t\t\t\tconsole.log( jqXHR );\n\t\t\t\t}\n\t\t\t});\n\n\n\t\t});\n\n\t}", "title": "" }, { "docid": "b5e107a2b5645d243b23daf15bff30a9", "score": "0.7017164", "text": "function updateDislikesHangman(){\n\tif(clicked == false){\n\t\tconsole.log(\"updating dislikes----\");\n\t\tvar dislikes = document.getElementById(\"dislikes\").innerHTML;\n\t\tvar dislikes_int = parseInt(dislikes);\n\t\tdislikes_int++;\n\t\tvar url ='https://nostalgia-games.herokuapp.com/hangman/addlikes'+'?dislikes='+dislikes_int;\n\t $.ajax({url:url}).then(function(data) {\n\t \tconsole.log(data);\n\t });\n\t\tdocument.getElementById(\"dislikes\").innerHTML = dislikes_int;\n\t\tdocument.getElementById(\"dislikes2\").innerHTML = dislikes_int;\n\n\t\tdocument.getElementById('thumbs-down').style.color = 'red';\n\t\tdocument.body.removeEventListener('click', updateDislikes);\n\t\tdisableButtons();\n\t\t\n\t}\n\tclicked = true;\n\treturn false;\n}", "title": "" }, { "docid": "98e0822c2e85ea75defe1c2dc9f47c36", "score": "0.70140296", "text": "function likePhoto(el, id){\n\tvar request = $.ajax({\n\t url: BASE_URL+\"live/public/api/v1/image/like-unlike\",\n\t headers: {\n\t \"Authorization\" : \"Bearer \"+token\n\t },\n\t type: \"POST\",\n\t data: {\n\t \t\"image_id\" : id\n\t },\n\t beforeSend:function(){\n\t //showLoader();\n\t //$('#signinErrorMsg').html('');\n\t },\n\t complete:function(jqXHR, status){\n\t //hideLoader();\n\t }\n });\n\n request.done(function(response) {\n \tvar responseData = null;\n \ttry {\n \tresponseData = JSON.parse(response); \n \t} catch (e) {\n \tresponseData = response;\n \t}\n\n \t//console.log(responseData);\n \tvar status = responseData.status;\n\t\tswitch (status) { \n\t\t\tcase 1: \n\t\t\t\tconsole.log(responseData.message);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tconsole.log(responseData.content);\n\t\t\t\tif(responseData.content.like_unlike_status==1){\n\t\t\t\t\t$(\"#likeBtnContainer\"+id).html('<i data-container=\"body\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Liked\" onclick=\"likePhoto(this, '+id+')\" class=\"fas fa-thumbs-up\"></i>');\n\t\t\t\t}else{\n\t\t\t\t\t$(\"#likeBtnContainer\"+id).html('<i data-container=\"body\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Like\" onclick=\"likePhoto(this, '+id+')\" class=\"far fa-thumbs-up\"></i>');\n\t\t\t\t}\n\t\t\t\t//$('[rel=tooltip]').tooltip({container: 'body'});\n\t\t\t\t$('[data-toggle=\"tooltip\"]').tooltip();\n\t\t\t\t$(\"#totalLike\"+id).html(responseData.content.total_likes);\n\t\t\t\tbreak;\n\t\t\tcase 3: \n\t\t\t\tconsole.log(responseData.message);\n\t\t\t\tbreak;\n\t\t\tcase 4: \n\t\t\t\tconsole.log(responseData.message);\n\t\t\t\tbreak;\n\t\t\tcase 5: \n\t\t\t\tconsole.log(responseData.message);\n\t\t\t\tbreak;\t\n\t\t\tdefault:\n\t\t\t\tconsole.log('Something went wrong! please try again later');\n\t\t}\n });\n\n request.fail(function(jqXHR, textStatus) {\n \tvar errorData = null;\n \ttry {\n \terrorData = JSON.parse(jqXHR); \n \t} catch (e) {\n \terrorData = jqXHR;\n \t}\n \tconsole.log(\"Error : \"+errorData);\n });\n}", "title": "" }, { "docid": "cd40e557a8d3e052595d5267f9e530b0", "score": "0.70137876", "text": "function like_unlike(x,id) {\n // Get the state of the like_unlike icon.\n let y = x.classList.contains('fa-thumbs-down');\n x.classList.toggle(\"fa-thumbs-down\");\n var state;\n if (y === true){\n state = 'up';\n }\n else{\n state = 'down';\n }\n \n fetch(`/like_unlike/${id}`,{\n method: 'PUT',\n body: JSON.stringify({\n id : id,\n state : state\n })\n \n });\n \n setTimeout(() => {update_like_unlike(id);}, 100);\n}", "title": "" }, { "docid": "fa40fa7859f37d4bdd7c3ff0b8e6545d", "score": "0.6991818", "text": "unlikeTweet() {\n if (this.tweet.id === null) {\n // Tweet is not in database yet, register first with callback\n this.registerTweet(this.unlike)\n }\n else {\n fetch(`https://infinite-scroll-is-not-enough.herokuapp.com/unlike/${this.tweet.id}`, { method: 'Get' })\n .then(res => res.json())\n .then(likes => {\n if (likes.length > 0) {\n this.likeCount.previous = this.likeCount.current\n this.likeCount.current = likes[0]['likes']\n this.unsetLiked()\n this.setState({\n liked: false,\n inanimate: false\n })\n }\n })\n }\n }", "title": "" }, { "docid": "1fd4e0b946febdc55ab75ae86070c637", "score": "0.69247127", "text": "function toggleLike(button) {\n // Get the closest form with this class\n var form = button.closest('.post-info-form');\n\n // Create a new form based off our form element and send it as a request to the indicated route\n fetch('/handlelike', {\n method: 'POST',\n body: new FormData(form),\n }).then(function() {\n var icons = button.getElementsByTagName('div')\n var likeCountEl = button.parentElement.getElementsByClassName(\"like-count\")[0]\n var likeCount = parseInt(likeCountEl.innerHTML);\n\n // Toggle between like icons \n for (let i of icons)\n i.style.display = (i.style.display == \"\") ? \"none\" : \"\";\n \n // Update visual like count\n likeCount = (icons[0].style.display == \"none\") ? likeCount + 1 : likeCount - 1;\n likeCountEl.innerHTML = likeCount;\n });\n\n return false;\n}", "title": "" }, { "docid": "0b3bc59b17ae34a8e67bcb8d5c6f55a7", "score": "0.6917744", "text": "function likecount(postid) {\n const request = new Request(\n `/likecountandstatus?id=${postid}`, {\n headers: {\n 'X-CSRFToken': csrf_token,\n 'Content-Type': 'application/JSON'\n }\n }\n );\n\n fetch(request, {\n method: 'GET'\n })\n\n .then(response => {\n // presents alert if POST request returns anything other than 201 status code and breaks out. \n if (!response.status === 400) {\n alert(\"Sorry, your request to the server was not successful. If the problem persists, please email [email protected]\")\n return 0\n } else {\n return response.json()\n } \n })\n .then(response => {\n let likecounter = response.likecount\n likecounter = likecounter.toString()\n let likestatus = response.likestatus\n likebutton = document.querySelector(`#like-${postid}`)\n //if the already user likes the post being loaded\n if (likestatus) {\n likebutton.setAttribute(\"onclick\", `togglelikedel(${postid})`)\n likebutton.textContent = \"Unlike\"\n likeheart = document.querySelector(`#likeheart-${postid}`)\n likeheart.classList.add(\"likeheartliked\")\n }\n document.querySelector(`#likecountpost-${postid}`).textContent = `${likecounter}`\n \n })\n \n}", "title": "" }, { "docid": "3e6a3dfefd7d2feeea83fd63042162cd", "score": "0.69100034", "text": "function like() {\n $('.btn-like').unbind('click').click(function () {\n console.log('like');\n $(this).addClass('btn-dislike').remove('btn-like');\n $(this).attr('src',url+'/img/heart-red.png');\n //$(this).attr('src','img/heart-red.png');\n \n ///AJAX///\n //data('id') recoge atributo de la pagina data-id=\"{{$image->id}}\"\n //success: miisage si funciona\n $.ajax({\n url: url+'/like/'+$(this).attr('data-id'), //data('id'),\n type: 'GET',\n success: function(response){\n //console.log(response); datos del objeto\n if(response.like){\n console.log('Ok,AJAX like publicacion');\n }else{\n console.log('KO,AJAX likelizado publicacion');\n }\n }\n });\n \n dislike();\n });\n\n }", "title": "" }, { "docid": "da94e186f445c322ae3da0b813d18fbe", "score": "0.69000065", "text": "function like(id) {\n console.log(\"Function run\");\n //id = id.substr(4);\n var postid = parseInt(id.substr(4));\n const htmllike = document.querySelector(`#${id}`);\n const likecountdiv = document.querySelector(`#likecount${postid}`);\n var likecount = parseInt(likecountdiv.innerHTML.substr(0,1));\n console.log(`id is ${id}, postid is ${postid}`);\n if (htmllike.innerHTML == 'Like') {\n fetch(`/like/${postid}`, {\n method:\"POST\"\n })\n .then(response => console.log(response))\n .then(result => {\n console.log(result);\n });\n htmllike.innerHTML = 'Unlike';\n likecount = likecount + 1;\n }\n else {\n fetch(`unlike/${postid}`, {\n method:\"POST\"\n })\n htmllike.innerHTML = 'Like';\n likecount = likecount - 1;\n }\n if (likecount == 1){\n likecountdiv.innerHTML = `${likecount} like`;\n } else {\n likecountdiv.innerHTML = `${likecount} likes`\n }\n\n }", "title": "" }, { "docid": "c76addb447571741e69aa3d630ecc9b5", "score": "0.6874099", "text": "function likeUnlikeStory( storyID, userID ) {\n\targs = {\n\t\tuserID: userID,\n\t\tstoryID: storyID\n\t};\n\tstory_l_u_handler = make_ajax( \"ajax-handlers/like-unlike-story.php\", \"POST\", \"text\", args );\n\tstory_l_u_handler.onreadystatechange = function() {\n\t\tif ( story_l_u_handler.readyState == 4 && story_l_u_handler.status == 200 ) {\n\t\t\tsetTimeout(function() {\n\t\t\t\tobj_ = $( \"#story-\"+storyID+\" #like-container\" );\n\t\t\t\tstatus_ = story_l_u_handler.responseText.split( \"%%\" )[0];\n\t\t\t\tlikes_ = story_l_u_handler.responseText.split( \"%%\" )[1];\n\t\t\t\tif ( status_ == \"liked\" ) {\n\t\t\t\t\tobj_.children( \"span\" ).html( \"&#xf088;\" );\n\t\t\t\t\tobj_.children( \"h1\" ).html( \"Dislike\" );\n\t\t\t\t\t//Add new like\n\t\t\t\t\tobj_.parent( \"#story-\"+storyID ).children( \".story-likes\" ).html( \"<span class='liked'>&#xf004;</span>\"+likes_ );\n\t\t\t\t} else if ( status_ == \"disliked\" ) {\n\t\t\t\t\tobj_.children( \"span\" ).html( \"&#xf004;\" );\n\t\t\t\t\tobj_.children( \"h1\" ).html( \"Like\" );\n\t\t\t\t\t//Remove the like\n\t\t\t\t\tobj_.parent( \"#story-\"+storyID ).children( \".story-likes\" ).html( \"<span class='liked'>&#xf004;</span>\"+likes_ );\n\t\t\t\t} else { console.log( status_ ); }\n\t\t\t}, 250);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2cd508ff26cc57ecb7b7b9e4cbc22aaa", "score": "0.68727285", "text": "function like_post(element, id) {\n\n //Check if another process is already running\n if(!working){\n\n\n //Localhost\n var host_url = domain + \"/api/posts/\";\n\n //Starts the working process\n working = true;\n\n\n //The current like count\n var likesCount = $('#likes_count_' + id);\n\n if (element.classList.contains('fa-heart-o')){\n $.ajax({\n type: \"POST\",\n data: {data:id},\n url: host_url + \"add_like\",\n success: function(data){\n working = false;\n if(data === 'Success'){\n likesCount.text(parseInt(likesCount.text()) +1);\n element.classList.remove('fa-heart-o');\n element.classList.add('fa-heart');\n }else if(data === 'Access denied'){\n alert('You need to login to like posts.')\n }else if(data === 'error'){\n alert('An error occurred.')\n }\n }\n });\n\n }else{\n $.ajax({\n type: \"POST\",\n data: {data:id},\n url: host_url + \"delete_like\",\n success: function(data){\n working = false;\n if(data == 'Success'){\n likesCount.text(parseInt(likesCount.text()) - 1);\n element.classList.remove('fa-heart');\n element.classList.add('fa-heart-o');\n element.classList.add('shadow');\n setTimeout(function(){\n element.classList.remove('shadow');\n }, 200)\n }else if(data == 'Access denied'){\n alert('You need to login to like posts.')\n }else if(data === 'error'){\n alert('An error occurred.')\n }\n\n }\n });\n }\n }\n}", "title": "" }, { "docid": "263394da2e94967b16936503979f04c3", "score": "0.6815778", "text": "function setLikeFunction(event) {\n event.preventDefault();\n $.ajax({\n type: \"POST\",\n async: false,\n url: \"http://localhost:8080/MetroShare/webresources/media/opinion/like\",\n data: $(\"#like-media-form\").serialize(),\n success: function (data, textStatus, xhr) {\n if (data) {\n location.reload();\n }\n },\n error: function (jqXHR, textStatus, errorThrown) {\n console.log(\"Error: \" + errorThrown);\n }\n });\n}", "title": "" }, { "docid": "fd941a078c9ac84a3a76d1b7a4e0f95d", "score": "0.6807667", "text": "function ajaxVoteComment () {\n\n let id = $(this).attr('id')\n let $container = $(this).parent()\n let $error = $container.parent().next()\n let $counter = $container.find('#comments-like-counter')\n let commentId = $(this).attr('data-comment')\n\n const voted = yo`<span id=\"new-card-liked\" data-comment=\"${commentId}\" class=\"Noticias_comentarios_card-feedback-like-icon-liked\"></span>`\n const unVoted = yo`<span id=\"new-card\" data-comment=\"${commentId}\" class=\"Noticias_comentarios_card-feedback-like-icon\"></span>`\n\n let operation, $hide, $show\n\n if (id === 'new-card') {\n $hide = $(this)\n $show = voted\n operation = 1\n\n } else if (id === 'new-card-liked') {\n $hide = $(this)\n $show = unVoted\n operation = -1\n }\n\n $hide.remove()\n\n $.post(`/api/comment-like/${commentId}`, (data) => {\n // If there is Error on the reply\n if (data.indexOf('Error') !== -1)\n return commentErrorHandler($error, $hide, $container)\n\n $container.prepend($show)\n $counter.html(Number(data) + Number(operation))\n })\n //handles error. Logs error and reset previus icon. Insert fb message and then removes it\n .fail((response) => {\n // console.log(response.responseText)\n commentErrorHandler($error, $hide, $container)\n })\n}", "title": "" }, { "docid": "969ab2d7c96a486cb2ed2072062ac729", "score": "0.6802936", "text": "handleUnlike(id) {\n new CallAPI().unlikeArticle(id, (err) => {\n if(err) {\n alert(\"Failed to unlike. Please try again\");\n return;\n }\n });\n }", "title": "" }, { "docid": "8988f9a1e35712c6959066d06353e18a", "score": "0.6783834", "text": "function likePost(postid) {\n\n // Get the specific like count\n likeNumberDiv = document.querySelector(`.likeNumber[data-postid='${postid}']`);\n likeNumber = parseInt(likeNumberDiv.innerHTML);\n\n // Send request to update like number\n const request = new Request(\n `/likePost/${postid}`,\n {headers: {'X-CSRFToken': csrftoken}}\n );\n\n fetch(request, {\n method: 'POST',\n mode: 'same-origin'\n })\n .then(response => response.json().then(data => ({status: response.status, body: data})))\n .then(result => {\n console.log(result.status)\n // Print message\n if (result.status === 201) {\n console.log(result.body.message)\n if (result.body.message === 'liked') {\n // Add +1 to like count\n likeNumber++;\n\n // Update value\n likeNumberDiv.innerHTML = likeNumber;\n }\n else {\n // Add +1 to like count\n likeNumber--;\n\n // Update value\n likeNumberDiv.innerHTML = likeNumber;\n }\n \n }\n else {\n console.log('Sorry, you can only like a post once.');\n }\n });\n}", "title": "" }, { "docid": "6a07a79ab3750c4700772616cb463993", "score": "0.67794406", "text": "function changeInterest(button) {\r\n\r\n\tvar event_id = button.id.replace(\"interest\", \"\");\r\n\tvar currentValue = (button.innerText === \"Like\") ? \"like\" : \"unlike\";\r\n\r\n\t/*\r\n\t * Send an AJAX call to the interest end point to change the interest state\r\n\t * of the currently signed in user.\r\n\t */\r\n\t$.ajax({\r\n\t\turl : \"/interest\",\r\n\t\tdata : {\r\n\t\t\t\"event_id\" : event_id,\r\n\t\t\t\"state\" : currentValue\r\n\t\t},\r\n\t\ttype : 'POST',\r\n\t\tsuccess : function(response) {\r\n\r\n\t\t\tvar popularity = document.getElementById(\"popularity\" + event_id);\r\n\r\n\t\t\t// If the request was successful\r\n\t\t\tif (response === \"success\") {\r\n\r\n\t\t\t\t// If the button said 'like' before change it to now say 'Unlike'\r\n\t\t\t\tif (currentValue === \"like\") {\r\n\t\t\t\t\tbutton.innerText = \"Unlike\";\r\n\t\t\t\t\tbutton.classList.remove(\"btn-success\");\r\n\t\t\t\t\tbutton.classList.add(\"btn-danger\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Increase the event popularity\r\n\t\t\t\t\tpopularity.innerText = parseInt(popularity.innerText) + 1;\r\n\r\n\t\t\t\t} \r\n\t\t\t\t// If the button said 'unlike' before change it to now say 'Like'\r\n\t\t\t\telse {\r\n\t\t\t\t\tbutton.innerText = \"Like\";\r\n\t\t\t\t\tbutton.classList.remove(\"btn-danger\");\r\n\t\t\t\t\tbutton.classList.add(\"btn-success\");\r\n\r\n\t\t\t\t\t// Decrease the event popularity\r\n\t\t\t\t\tpopularity.innerText = parseInt(popularity.innerText) - 1;\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\talert(\"Update failed - Sorry about that\");\r\n\t\t\t}\r\n\t\t},\r\n\t\terror : function(XMLHttpRequest, textStatus, errorThrown) {\r\n\t\t\talert(\"Update failed - Sorry about that\");\r\n\t\t}\r\n\t});\r\n\r\n}", "title": "" }, { "docid": "7cb867808c00bebcd2f5df4f56ac300a", "score": "0.67402506", "text": "function ajaxVotePosts () {\n // Thumbup and thumbup-liked buttons\n const thumbupLiked = yo`<span id=\"thumbup-liked\" class=\"Noticia_comentarios-comentarios-agree-header-votes-icon-liked\"></span>`\n const thumbup = yo`<span id=\"thumbup\" class=\"Noticia_comentarios-comentarios-agree-header-votes-icon\"></span>`\n // Thumbdown and thumbdown-liked buttons\n const thumbdownLiked = yo`<span id=\"thumbdown-liked\" class=\"Noticia_comentarios-comentarios-disagree-header-votes-icon-liked\"></span>`\n const thumbdown = yo`<span id=\"thumbdown\" class=\"Noticia_comentarios-comentarios-disagree-header-votes-icon\"></span>`\n // Loader\n const loader = yo`<span id=\"like-post-loader\"></span>`\n\n let id = $(this).attr('id')\n let uri, $hide, $show, $container, operation\n\n // Depending on clicked button, creates logics\n if (id === 'thumbup'){\n uri = 'upvote'\n $hide = $(this)\n $show = thumbupLiked\n $container = $('#agree-votes-container')\n operation = 1\n }\n\n else if (id === 'thumbup-liked'){\n uri = 'unupvote'\n $hide = $(this)\n $show = thumbup\n $container = $('#agree-votes-container')\n operation = -1\n }\n\n else if (id === 'thumbdown'){\n uri = 'downvote'\n $hide = $(this)\n $show = thumbdownLiked\n $container = $('#disagree-votes-container')\n operation = 1\n }\n\n else if (id === 'thumbdown-liked'){\n uri = 'undownvote'\n $hide = $(this)\n $show = thumbdown\n $container = $('#disagree-votes-container')\n operation = -1\n }\n\n // Includes loader and gets counter number\n $hide.remove()\n $container.append(loader)\n let $counter = $container.find('.post-counter')\n let $feedback = $container.parent().next()\n\n // AJAX call: Removes loader, appends new icon and sums or substracts 1 to counter and sends fb message\n // data sends the number of likes before updating\n $.post(`/api/${uri}`, (data) => {\n // If there is Error on the reply\n if (data.indexOf('Error') !== -1)\n return ajaxErrorResponse(loader, $container, $hide, $feedback)\n\n $(loader).remove()\n $container.append($show)\n $counter.html(Number(data) + Number(operation))\n $feedback.addClass('success-like')\n setTimeout(() => { $feedback.removeClass('success-like') }, 3000)\n })\n //handles error. Logs error and reset previus icon. Insert fb message and then removes it\n .fail((response) => {\n console.log(response.responseText)\n return ajaxErrorResponse(loader, $container, $hide, $feedback)\n })\n}", "title": "" }, { "docid": "e0c9744891a9efd213e6a1f569ad82dc", "score": "0.6739818", "text": "function likeEntry($entryElement) {\n var entryId = parseInt($entryElement.attr('entry-id'));\n\n $.ajax({\n type: \"POST\",\n url: ksData.templateDirectoryUri + '/api/like_entry.php',\n data: {entry_id: entryId},\n success: function (data, textStatus, jqXHR) {\n\n if (!data || data.error) {\n return;\n }\n\n $entryElement.find('.entry-like-button-text').text('');\n $entryElement.find('.entry-like-button-count').text(data.likes.toString());\n $entryElement.find('.entry-like-button').addClass('liked');\n\n },\n dataType: 'json'\n });\n }", "title": "" }, { "docid": "a621fdcc78b2f523172af1c92ba976f0", "score": "0.67339796", "text": "function enableForget(){\n $(\".forget\").unbind().click(function(){\n postId = $(this).closest('.post').find('.post_id').html();\n var postIndex = $(this).closest('.post').attr('id');\n console.log(postId, postIndex);\n $.ajax({\n url: '/forget',\n type: 'POST',\n data: {\n post_id: postId,\n post_index: postIndex,\n user_id: personId,\n },\n success: function(data){\n $('#' + postIndex + ' .text').css('opacity', data.memory);\n $('#' + postIndex + ' .reactview').css('opacity', data.memory);\n lowerMessage(\"<div class='message'><i class='material-icons'>check_circle</i> This post is less visible to you, but we cannot guarantee it will disappear. </div>\")\n }\n });\n });\n}", "title": "" }, { "docid": "cf971bd1efe3ffc2df6ca6155b84030f", "score": "0.67334455", "text": "function likeSingleQuote(quoteId, check, num) {\n\n if (userId) {\n\n if (check === true) {\n fade_in();\n $(\".notifs_message\").html(\"You have liked this quote before\");\n\n } else {\n\n // make ajax call to test if user has liked quote before\n $.post(\"includes/handlers/ajax/loveQuote.php\", { quoteId: quoteId, userId: userId }, function (data) {\n if (data === \"success\") {\n fade_in();\n $(\".notifs_message\").html(\"Thanks for the love\");\n $(\".\" + quoteId + \"quoteText\").html((num + 1));\n $(\".\" + quoteId + \".fas.fa-heart\").removeClass(\"black\").addClass(\"red\");\n\n } else if (data === \"failure\") {\n fade_in();\n $(\".notifs_message\").html(\"server error\");\n }\n });\n }\n\n } else {\n fade_in();\n $(\".notifs_message\").html(\"You need to <a class='blue' href='signIn.php'> log in </a> to do that\");\n }\n}", "title": "" }, { "docid": "4854924c33606e5a0896cb757fa70c4a", "score": "0.6733153", "text": "function likeButton(advice_id) {\n var advice_ID = advice_id;\n\n var dataString = \"advice_ID=\" + advice_ID;\n $.ajax({\n url: \"http://13.59.122.228/api/Advice/likeadvice.php\",\n type: \"POST\",\n dataType: \"json\",\n data: dataString,\n //on success it will call this function\n success: function (data) {\n data = JSON.parse(JSON.stringify(data));\n console.log(data);\n popup(data);\n updateLikes();\n }\n\n });\n\n $('#like-img' + advice_ID).attr('src', 'images/advice/liked.png');\n}", "title": "" }, { "docid": "5a92201c36edee892ec035733be38fc7", "score": "0.67298985", "text": "function follow(_0){\n\t$.ajax({\n\t\turl: 'ajax/follow',\n\t\tasync: true,\n\t\ttype: \"POST\",\n\t\tdata: \"id=\"+_0\n });\n $('#follow-btn-'+_0).removeClass('follow_b').addClass('unfollow_b');\n $('#follow-btn-'+_0+' .ff').css(\"display\",\"none\");\n $('#follow-btn-'+_0+' .uu').css(\"display\",\"inline-block\");\n var number = $('#follow-btn-'+_0+' .count').html();\n if(parseInt(number)<100){\n \tnumber++;\n \t$('#follow-btn-'+_0+' .count').html(number);\n }\n $('#follow-btn-'+_0).attr(\"onclick\",\"unfollow(\"+_0+\")\");\n return false;\n}", "title": "" }, { "docid": "5aecdbefa10b32aecf8e8b5309875445", "score": "0.6688827", "text": "function unfollow(_0){\n\t$.ajax({\n\t\turl: 'ajax/unfollow',\n\t\tasync: true,\n\t\ttype: \"POST\",\n\t\tdata: \"id=\"+_0\n });\n $('#follow-btn-'+_0).removeClass('unfollow_b').addClass('follow_b');\n $('#follow-btn-'+_0+' .uu').css(\"display\",\"none\");\n $('#follow-btn-'+_0+' .ff').css(\"display\",\"inline-block\");\n var number = $('#follow-btn-'+_0+' .count').html();\n if(parseInt(number)<100){\n \tnumber--;\n \t$('#follow-btn-'+_0+' .count').html(number);\n }\n $('#follow-btn-'+_0).attr(\"onclick\",\"follow(\"+_0+\")\");\n return false;\n}", "title": "" }, { "docid": "55facdb7c0ac9ee6e2f188fd93a70ffc", "score": "0.6681962", "text": "like(event) {\n this.postRecrod.updateLikeCount(this.topic.like_count + 1);\n if (this.postRecrod.likeAction && this.postRecrod.likeAction.get(\"canToggle\")) {\n this.postRecrod.likeAction.togglePromise(this.postRecrod).then((result) => {\n if (result.acted) {\n this.$('.topic-custom-like').addClass('liked');\n this.$('.likes-count > .number').html(this.topic.like_count + 1);\n this.topic.set(\"like_count\", this.topic.like_count + 1);\n } else {\n this.$('.topic-custom-like.liked').removeClass('liked');\n this.$('.likes-count > .number').html(this.topic.like_count - 1);\n this.topic.set(\"like_count\", this.topic.like_count - 1);\n }\n });\n }\n }", "title": "" }, { "docid": "7604f2b4eae2627bd1d14328461e4cce", "score": "0.65821743", "text": "function unlikeUser (event) {\n event.preventDefault();\n //hides the unlike button\n $(event.target).toggle();\n //shows the like button\n $(event.target).siblings('.likeUser').toggle();\n\n removeUnliked(likedSimpleLogin(event));\n\n}// end unlikeUser", "title": "" }, { "docid": "fb43ccbb8117691317a1c7eed52aff42", "score": "0.6576538", "text": "function like(id) {\n\n let like_button = document.querySelector(`#like${id}`);\n let like_count = document.querySelector(`#like_count${id}`);\n\n \n\n // If the heart color is gray \n if (like_button.style.color == 'gray') {\n fetch('/like/' + id, {\n method: 'PUT',\n body: JSON.stringify({\n like: true\n })\n })\n\n // Get the number of likes\n fetch('/like/'+ id)\n .then(response => response.json())\n .then(post => {\n numberLikes = post.number_likes;\n });\n \n // change the heart to red \n like_button.style.color = 'red';\n \n // Reset the number of like in html\n like_count.innerHTML = (numberLikes * 1);\n\n }\n\n // If is heart color is red \n else {\n\n // Set the heart color the gray\n like_button.style.color = 'gray';\n fetch('/like/' + id, {\n method: 'PUT',\n body: JSON.stringify({\n like: false\n })\n });\n \n // Reset the number of like in html\n like_count.innerHTML = (numberLikes * 1);\n }\n return false;\n}", "title": "" }, { "docid": "4fa95fe7e7b61c9c305571a3cbabb4c0", "score": "0.6573652", "text": "function like() {\n $('.btn-like').unbind('click').click(function () {\n console.log('like');\n $(this).addClass('btn-dislike').remove('btn-like');\n $(this).attr('src', 'img/heart-red.png');\n dislike();\n });\n }", "title": "" }, { "docid": "90ca7bc399d7c5a94547cd86f6786617", "score": "0.65642446", "text": "function addListenersToLikes() {\n // Listen for clicks on like button\n $('#tweets-container').on('click', 'i.fa-heart', function () {\n let currentUser = Cookies.get('email')\n if (currentUser) {\n if ($(this).data('owner') !== currentUser){\n let counterElm = $(this).siblings(('#like-counter'))\n let counter = Number(counterElm.text())\n if ($(this).hasClass('liked')) {\n counterElm.text(counter - 1)\n } else {\n counterElm.text(counter + 1)\n }\n //\n\n\n const _id = $(this).data('_id')\n const elm = $(this)\n $.ajax({\n method: 'PUT',\n url: `/tweets/${_id}/like`,\n data: {email: Cookies.get('email')}\n }).then(function () {\n // Then, toggle the liked class\n elm.toggleClass('liked')\n })\n\n }\n }\n })\n}", "title": "" }, { "docid": "862deb2ab6a93cce7852d9047ca844c3", "score": "0.65170723", "text": "handleLike() {\n return new Promise(() => {\n document.getElementById(this.state.messageID).disabled = false\n setTimeout(() => {\n if (this.state.likedByUser === false) {\n document.getElementById(this.state.messageID).disabled = true\n return (this.client.postLike(this.state.messageID)\n .then(response => {\n this.setState((state, props) => ({\n likedByUser: true,\n likes: state.likes + 1,\n userLike: response.data.like.id\n })\n )\n }))\n }\n // If there is a like, DELETE the like\n else {\n document.getElementById(this.state.messageID).disabled = true\n return this.client.deleteLike(this.state.userLike)\n .then(this.setState((state) => ({ likedByUser: false, likes: state.likes - 1 })))\n }\n }, 2000)\n })\n }", "title": "" }, { "docid": "8c15c292e5d0d112d0379535328706f5", "score": "0.64921564", "text": "function like(event) {\n console.log('in like', event);\n event.preventDefault();\n const myHeaders = new Headers();\n myHeaders.append('Content-Type', 'application/json');\n \n const data = {\n post: event.target.dataset.post_id\n };\n console.log(data);\n // Fetches the like view and adds a like via POST\n fetch('/like', {\n method: 'POST',\n headers: myHeaders,\n body: JSON.stringify(data)\n })\n .then(response => response.json())\n .then(result => {\n console.log('result', result);\n });\n event.target.style.display = 'none';\n event.target.nextElementSibling.style.display = 'block';\n location.reload();\n}", "title": "" }, { "docid": "659b334cd29e42a8ecd066f6e7ac4c09", "score": "0.6477488", "text": "function serverPostLike(uid) {\n 'use strict';\n //Add ajax request for like count\n //Try several request if fail\n //No need to handle success\n var postData;\n postData = {\n uid: uid\n };\n $.post(\"/leaf/like\", postData, null, \"json\")\n .done(function (data) {\n setNotification(\"点赞成功!(≧∇≦)\", 0, 0);\n })\n .fail(function () {\n });\n}", "title": "" }, { "docid": "12392a9ae63f6f7420cd460602a2cc68", "score": "0.6468516", "text": "function follow_or_unfollow(page_owner,follower,action)\n{\n var dataString = \"page_owner=\" + page_owner + \"&follower=\" + follower;\n $.ajax({ \n type: \"POST\", \n url: \"follow_or_unfollow.php\", \n data: dataString,\n\t\tcache: false,\n beforeSend: function() \n {\n if ( action == \"following\" )\n {\n $(\"#following\").hide();\n $(\"#loading\").html('<img src=\"images/loading.gif\" align=\"absmiddle\" alt=\"Loading...\">');\n }\n else if ( action == \"follow\" )\n {\n $(\"#follow\").hide();\n $(\"#loading\").html('<img src=\"images/loading.gif\" align=\"absmiddle\" alt=\"Loading...\">');\n }\n else { }\n }, \n success: function(response)\n {\n if ( action == \"following\" )\n\t\t\t{\n $(\"#loading\").html('');\n $(\"#follow\").show();\n \n }\n else if ( action == \"follow\" )\n\t\t\t{\n $(\"#loading\").html('');\n $(\"#following\").show();\n }\n else { }\n }\n }); \n}", "title": "" }, { "docid": "8991cf3af5b2b19ce69446fea7d12678", "score": "0.6445083", "text": "function unfollow() {\n\t$.ajax({\n url: \"/unfollow\",\n type: \"POST\",\n data: {\n stock_name: $.cookie(\"index\")\n },\n success: function (obj) {\n console.log(obj);\n checkFollowedButton();\n }\n });\n}", "title": "" }, { "docid": "387a2ae06ec75dc1aac6c5f4e2a105df", "score": "0.64359146", "text": "function up_vote(e){\n\t$.ajax({\n\t\tmethod: 'post',\n\t\turl: url,\n\t\tdata: {up_vote: e, post_id: post_id, _token: token },\n\t\tsuccess: function(data){\n\t\t\t$('.vote-counter').text(data);\n\t\t},\n\t\terror: function (xhr, ajaxOptions, thrownError) {\n\t $('#myModal').modal('show');\n\t }\n\t});\n}", "title": "" }, { "docid": "7df68486434a1c03a1ed357dd0b80bd4", "score": "0.643514", "text": "function liked(id){\n fetch(`/liked/${id}`,{method:\"GET\"})\n .then(response => response.json())\n .then(result => {\n if(result.message ===\"notliked\"){\n const liked_count = parseInt(document.querySelector(`.post_likes_count_${id}`).innerText);\n document.querySelector(`.svg_icon_${id} svg`).setAttribute('fill','red');\n document.querySelector(`.post_likes_count_${id}`).innerText = liked_count+1;\n fetch(`/liked/${id}`,{method:\"PUT\"})\n }\n else{\n const liked_count = parseInt(document.querySelector(`.post_likes_count_${id}`).innerText);\n document.querySelector(`.svg_icon_${id} svg`).setAttribute('fill','black');\n document.querySelector(`.post_likes_count_${id}`).innerText = liked_count-1;\n fetch(`/liked/${id}`,{method:\"PUT\"})\n }\n })\n}", "title": "" }, { "docid": "4486d7e710a3b06b0c1d9b8b704048e3", "score": "0.6432175", "text": "function likePost(id) {\n console.log(\"Liking post \", id);\n $(`#like-${id}`).attr('data-state', 'liked');\n $.post(`/api/likes/${id}`);\n // make a HTTP post to the likes table\n}", "title": "" }, { "docid": "bf3d78f69a25254606654f1190785be3", "score": "0.6414566", "text": "function dislike() {\n $('.btn-dislike').unbind('click').click(function () {\n console.log('dislike');\n $(this).addClass('btn-like').remove('btn-dislike');\n $(this).attr('src', 'img/heart-black.png');\n like();\n });\n }", "title": "" }, { "docid": "88b2a6d125a4841b6b17c2e20e415c9d", "score": "0.6399448", "text": "function like(Username) {\n if (Username > 0) {\n $.ajax({\n type: \"POST\",\n url: \"/\" + \"UsuariosHospitales\" + \"/like/\" + 3,\n cache: false,\n success: function (response) {\n if (response > 0) {\n console.log(\"success: \" + response);\n alert(\"success: \" + response);\n }\n else {\n alert(\"No puedes dar like revisa tu conexion\");\n }\n },\n failure: function (response) {\n console.log(\"error: \" + response);\n alert(response);\n }\n });\n }\n\n }", "title": "" }, { "docid": "82957c09385755db4d891ee6e91dde6b", "score": "0.63639414", "text": "function like_this_article(obj, type, article_serial){\n var yes = $(obj).hasClass('yes');\n $(\".article-interactive .interactive-btn\").removeClass('yes');\n if(!yes) $(obj).addClass('yes');\n\n $.post('/function/like', {\n 'article_serial': article_serial,\n 'type': type\n },function(data){\n if(data['Err']){\n console.log(data['Err']);\n notice(data['Err']);\n return;\n }else{\n $(\"#like-num\").text(data['Num-like']);\n $(\"#dislike-num\").text(data['Num-dislike']);\n }\n }, 'json');\n}", "title": "" }, { "docid": "d3f3e7d3338d3c6f1f646ba126f4cbbe", "score": "0.6356622", "text": "function updatePost(data) {\n $.ajax({\n url: \"http://localhost:8000/updatePost\",\n type: \"POST\",\n contentType: \"application/json\",\n data: JSON.stringify(data),\n dataType: \"json\",\n success: function(updatedData) {\n var count = (updatedData.like).length;\n\n if (count === limit) {\n postTweet(updatedData.content, updatedData.id);\n\n }\n }\n });\n}", "title": "" }, { "docid": "b59f6ec42f4b3abd09fcf89fa272778e", "score": "0.63559204", "text": "function likeMe() {\n let $counter = $(this).siblings('span');\n let count = parseInt($counter.text());\n count++;\n $counter.text(count);\n $.ajax(`http://localhost:3000/characters/${$(this).attr('name')}`, {method: 'PUT', dataType: 'JSON'});\n}", "title": "" }, { "docid": "e55a4177b61f0bcae523798c77434cd5", "score": "0.6351269", "text": "function down_vote(e){\n\t$.ajax({\n\t\tmethod: 'post',\n\t\turl : down_url,\n\t\tdata: {down_vote: e, post_id: post_id, _token: token},\n\t\tsuccess: function(data){\n\t\t\t$('.vote-counter').text(data);\n\t\t},\n\t\terror: function (xhr, ajaxOptions, thrownError) {\n\t $('#myModal').modal('show');\n\t }\n\t});\n}", "title": "" }, { "docid": "c0835c8192e0d05e9be0aa42b08f3923", "score": "0.62922543", "text": "function loadTweets() {\n var countFlag = false;\n var ajaxFn = function() {\n $.ajax({\n url: \"http://localhost:8000/loadTweets\",\n type: \"GET\",\n dataType: \"json\",\n success: function(postData) {\n $(\"div#posts\").html(\"\");\n $(\".userArea\").removeClass(\"hide\");\n\n var loginuser = \"\";\n loginuser += session.id;\n postData.forEach(function(postData) {\n\n if (postData.approved === false) {\n countFlag = true;\n var upcount, dcount, updown;\n var likearr = postData.like;\n upcount = likearr.length;\n\n var dislikearr = postData.dislike;\n dcount = dislikearr.length;\n\n if (likearr.indexOf(loginuser) !== -1) {\n updown = \"up\";\n } else if (dislikearr.indexOf(loginuser) !== -1) {\n updown = \"down\";\n } else {\n updown = \"no\";\n }\n displayName(postData.id, postData.content, postData.user, postData.date, upcount, dcount, updown);\n }\n });\n if (countFlag === false) {\n $(\"#postsAlert .alert\").text(\"Currently, there are no posts to show.\");\n $(\"#postsAlert .alert\").removeClass(\"hide\");\n }\n }\n });\n };\n setTimeout(ajaxFn, 1000);\n\n}", "title": "" }, { "docid": "1de3220bf20a94c9fda3aa356546fd90", "score": "0.62908334", "text": "function toggleLikes(in_tweet) {\n if (LoginState().isLoggedIn() === false) {\n displayLoginModal();\n return;\n }\n Likes(in_tweet).toggle();\n const likeCount = in_tweet.hearts + Likes(in_tweet).get();\n if (likeCount) {\n document.getElementById(`${in_tweet.id}-likes`).innerText = likeCount;\n } else {\n document.getElementById(`${in_tweet.id}-likes`).innerText = \"\";\n }\n}", "title": "" }, { "docid": "6d478d8f24dd5575602787730c181aad", "score": "0.6285928", "text": "function onClickBtnLike(event){\n event.preventDefault();\n\n const url = this.href;\n const count = this.querySelector('p.nb-js-like');\n const icon = this.querySelector('.heart');\n\n axios.get(url).then(function(response){\n //Change the number of likes//\n const likes = response.data.likes\n count.textContent = likes + ' J\\'aime';\n \n //switch the icons if user like the post or not//\n if(icon.classList.contains('like_icon_red')){\n icon.classList.replace('like_icon_red','like_icon');\n } else {\n icon.classList.replace('like_icon','like_icon_red');\n }\n }).catch(function(error){\n if(error.response.status === 403){\n window.alert('Vous devez vous connecter pour liker un post')\n }\n });\n}", "title": "" }, { "docid": "bac164fe9ad5100c8ea70344348a402d", "score": "0.62648594", "text": "toggleLikePost() {\n\t\tlet { isLiked } = this.state.postObject;\n\t\tif (isLiked == false) {\n\t\t\tthis.like();\n\t\t} else {\n\t\t\tthis.disLike();\n\t\t}\n\t}", "title": "" }, { "docid": "2caecb3ac7fd0a6e8164712ce053801b", "score": "0.62532973", "text": "function unlike() {\n $(this).siblings('.far.fa-heart').removeClass('d-none');\n $(this).addClass('d-none');\n let num = $(this).siblings('span').text();\n $(this).siblings('span').text(+num - 1);\n\n applyChange(this, \"-\");\n}", "title": "" }, { "docid": "ad8df4a0a2598726e6d538035d444f56", "score": "0.62524503", "text": "function like_post()\n{\n var likes_button = document.getElementById(\"likes_button\")\n likes_button.innerHTML = '<i class=\"fa fa-thumbs-up \">'+'</i>'+'&nbsp;'+\"Liked!\";\n likes_button.style.border=\"none\";\n count += 1;\n \n if(count!=0)\n {\n if (count==1)\n { document.getElementById('label_like_count').innerHTML = count + \" person likes this!\"; }\n else \n { document.getElementById('label_like_count').innerHTML = count + \" people have liked this!\"; }\n }\n}", "title": "" }, { "docid": "6e4e54880fc42772e6551153691feea6", "score": "0.6234756", "text": "function likeUpdate(){\n var j=document.getElementById('likeButton');\n if(numberOfLikes==0){\n numberOfLikes++;\n j.innerHTML='Liked!';\n document.getElementById('like-active').innerHTML=\"1 person likes this!\";\n }\n else if(numberOfLikes>0){\n numberOfLikes++;\n j.innerHTML='Liked!';\n document.getElementById('like-active').innerHTML= numberOfLikes+\" people have liked this!\";\n }\n}", "title": "" }, { "docid": "f18b70a70b7be252b9271f440fe47b0f", "score": "0.61781067", "text": "like() {\n // Update the like number.\n this._currentMeme.likeNumber++;\n var likeNumber = this._currentMeme.likeNumber;\n // TODO: update the like number of the \"#meme-likes-id\" element.\n this.updateLikeNumberElement(likeNumber);\n }", "title": "" }, { "docid": "d930cbb43d24be93a5b08ecfdb5243e7", "score": "0.61758655", "text": "function updateFriendInvitationCount() {\n $.post(\"/Friend/GetFriendInvitationCount\", null, function (data) {\n if (data > 0) {\n $(\"#lnoti_friends\").text(data);\n $(\"#noti_friends\").text(data);\n $(\"#spanMyFriendInviCount\").text(data);\n $(\"#spanFriendInvitationCount\").text(data);\n $(\"#lnoti_friends\").show();\n $(\"#noti_friends\").show();\n $(\"#spanFriendInvitationCount\").show();\n } else {\n $(\"#lnoti_friends\").text(data);\n $(\"#noti_friends\").text(data);\n $(\"#spanMyFriendInviCount\").text(data);\n $(\"#spanFriendInvitationCount\").text(data);\n $(\"#lnoti_friends\").hide();\n $(\"#noti_friends\").hide();\n $(\"#spanFriendInvitationCount\").hide();\n }\n }, \"json\");\n}", "title": "" }, { "docid": "df198daa478f67030c6bed0e4f02ef95", "score": "0.6171733", "text": "dislike() {\r\n // Update the like number.\r\n this._currentMeme.likeNumber--;\r\n var likeNumber = this._currentMeme.likeNumber;\r\n this.updateLikeNumberElement(likeNumber);\r\n }", "title": "" }, { "docid": "482a1ac1f0e24adae11d560f246c5f5d", "score": "0.6171717", "text": "function postDislike(event) {\n event.preventDefault();\n\n var dislike = $('.pet').data('uuid'),\n data = JSON.stringify(dislike);\n console.log(dislike);\n $.post(FIREBASE_URL + '/users/' + fb.getAuth().uid + '/data/dislikes.json', data, function (res) {\n });\n}", "title": "" }, { "docid": "12c6d2690d9a0401e88d77952626f72e", "score": "0.61266816", "text": "async function togglePostLike(req,res,next){\n try {\n const group = await Group.findById(req.params.groupId)\n const post = group.posts.id(req.params.postId)\n if (!group || !post) {\n throw new Error('Not Found')\n }\n if (post.likes.includes(req.currentUser._id)) {\n post.likes.pull(req.currentUser)\n } else {\n post.likes.push(req.currentUser)\n }\n \n \n await group.save()\n res.status(201).json('post liked/unliked successfully')\n\n } catch (err){\n next(err)\n }\n}", "title": "" }, { "docid": "d5901a521702509cec93a05f6f4f287c", "score": "0.61128503", "text": "function dislike() {\n request({ method: 'POST', body: { target_id }, path: '/api/dislike' })\n .then(data => {\n if (data.status === 'ok') {\n getRandomUser()\n toastr[\"success\"]('User successfully was skipped!')\n } else {\n }\n })\n }", "title": "" }, { "docid": "f6452a24205ac5af89e337c12b2d0e44", "score": "0.6111296", "text": "function postLiked(){\n document.getElementById(\"likeBlog\").innerHTML = \"<i class='fa fa-thumbs-up'></i> Liked!\";\n numberOfClicks += 1;\n if(numberOfClicks!=0){\n if (numberOfClicks==1){\n document.getElementById('likeCount').innerHTML = numberOfClicks + \" person likes this!\";\n }\n else {\n document.getElementById('likeCount').innerHTML = numberOfClicks + \" people have liked this!\";\n }\n }\n }", "title": "" }, { "docid": "ec7ed49d451e6b7ea4453305096f1faf", "score": "0.6093516", "text": "likeTweet() {\n if (this.tweet.id === null) {\n // Tweet is not in database yet, register first with callback\n this.registerTweet(this.like)\n }\n else {\n fetch(`https://infinite-scroll-is-not-enough.herokuapp.com/like/${this.tweet.id}`, { method: 'Get' })\n .then(res => res.json())\n .then(likes => {\n if (likes.length > 0) {\n this.likeCount.previous = this.likeCount.current\n this.likeCount.current = likes[0]['likes']\n this.setLiked()\n this.setState({\n liked: true,\n inanimate: false\n })\n }\n })\n }\n }", "title": "" }, { "docid": "d643dffdc2740c508bd4873a06894669", "score": "0.6088034", "text": "function markAsSeen() {\n $.ajax({\n url: '/players/mark_as_seen/player' + currentChatPlayerID,\n type: 'POST',\n contentType: 'application/json',\n data: JSON.stringify({ author: 'Valutatore' }),\n success: function () {\n $('#chatNotification').remove();\n },\n error: function (xhr, ajaxOptions, thrownError) {\n \n }\n });\n}", "title": "" }, { "docid": "045acf556086013deff1c26c7bac1788", "score": "0.6086242", "text": "function showHideHeart() {\n\t\tlet formData = new FormData();\n\t\tlet XHR = new XMLHttpRequest();\n\n\t\tphotoId = this.parentNode.getElementsByClassName('likes_number')[0];\n\t\tformData.append('photo_id', photoId.getAttribute('photo_id'));\n\t\tif (this.innerHTML === 'favorite') {\n\t\t\tthis.innerHTML = 'favorite_border';\n\t\t\tthis.style.fontSize = '24px';\n\n\t\t\tnew_like_num = parseInt(photoId.innerHTML) - 1;\n\t\t\tXHR.open('POST', '/delete_like');\n\t\t} else {\n\t\t\tthis.innerHTML = 'favorite';\n\t\t\tthis.style.fontSize = '27px';\n\n\t\t\tXHR.open('POST', '/add_like');\n\t\t\tnew_like_num = parseInt(photoId.innerHTML) + 1;\n\t\t}\n\t\tphotoId.innerHTML = new_like_num;\n\t\tXHR.send(formData);\n\t}", "title": "" }, { "docid": "3b422ab6634851d695260f385f3a1807", "score": "0.6079059", "text": "function Handles(props) {\n\n const likeBtn = () => {\n\n if (!localStorage.getItem('token')) {\n Swal.fire({\n icon: 'error',\n title: 'Please Sign In/Up first.',\n })\n }\n else {\n\n var myHeaders = new Headers();\n myHeaders.append(\"Authorization\", localStorage.getItem('token'));\n\n\n var requestOptions = {\n method: 'POST',\n headers: myHeaders,\n redirect: 'follow'\n };\n\n fetch(`https://recmonk.herokuapp.com/posts/like/${props.cardId}`, requestOptions)\n .then(response => {\n if (response.ok) {\n return response;\n } else {\n let errorMessage = `${response.status(response.statusText)}`\n let error = new Error(errorMessage);\n throw (error);\n }\n })\n .then(response => response.json())\n .then(result => {\n console.log(\"result like: \", result)\n Swal.fire({\n icon: 'success',\n title: 'You have liked.',\n })\n })\n .catch(error => console.log('error from QuesCard: ', error));\n }\n }\n\n const dislikeBtn = () => {\n\n if (!localStorage.getItem('token')) {\n Swal.fire({\n icon: 'error',\n title: 'Please Login/Signup first.',\n })\n }\n else {\n\n\n\n var myHeaders = new Headers();\n myHeaders.append(\"Authorization\", localStorage.getItem('token'));\n\n\n var requestOptions = {\n method: 'POST',\n headers: myHeaders,\n redirect: 'follow'\n };\n\n fetch(`https://recmonk.herokuapp.com/posts/unlike/${props.cardId}`, requestOptions)\n .then(response => {\n if (response.ok) {\n return response;\n } else {\n let errorMessage = response.status + \": \" + response.statusText\n let error = new Error(errorMessage);\n throw (error);\n }\n })\n .then(response => response.json())\n .then(result => {\n console.log(\"result unlike: \", result)\n Swal.fire({\n icon: 'success',\n title: 'You have unliked.',\n })\n })\n .catch(error => console.log('error from QuesCard: ', error));\n }\n }\n\n const [click, setClick] = useState(false);\n\n const ShowComment = () => {\n setClick(true)\n }\n\n const HideComment = () => {\n setClick(false)\n }\n\n\n const DeskCardHandles = () => {\n\n return (\n <div>\n <div className=\"deskBtmQeus1 btmQues1\" id=\"deskBtmQeus1\">\n <div className=\"cardIcons\" onClick={click == false ? ShowComment : HideComment} style={{ cursor: 'pointer' }}>\n <CommentOutlinedIcon fontSize=\"medium\" style={{ color: '#707070', margin: '0px 5px', cursor: 'pointer' }} />\n <p>Answers</p>\n </div>\n <div className=\"cardIcons\">\n <VisibilityOutlinedIcon fontSize=\"medium\" style={{ color: '#707070', margin: '0px 10px', cursor: 'pointer' }} />\n <p>Views</p>\n </div>\n <div className=\"cardIcons\">\n <ShareIcon fontSize=\"medium\" style={{ color: '#707070', margin: '0px 10px', cursor: 'pointer' }} />\n <p>Share</p>\n </div>\n\n </div>\n\n </div>\n )\n }\n\n return (\n <div>\n <div className=\"btmQues\">\n\n <div className=\"mobBtmQeus1 btmQues1\" id=\"mobBtmQeus1\">\n <div className=\"cardIcons\" onClick={click == false ? ShowComment : HideComment}>\n <CommentOutlinedIcon fontSize=\"medium\" style={{ color: '#707070', margin: '0px 5px', cursor: 'pointer' }} />\n <p>23</p>\n </div>\n <div className=\"cardIcons\">\n <VisibilityOutlinedIcon style={{ color: '#707070', margin: '0px 10px' }} />\n <p>34</p>\n </div>\n <ShareIcon style={{ color: '#707070', margin: '0px 10px' }} />\n\n </div>\n <DeskCardHandles />\n <div className=\"btmQues2\">\n <div onClick={likeBtn}>\n <ArrowDropUpIcon fontSize=\"large\" style={{ color: '#797979', cursor: 'pointer' }} />\n </div>\n <p style={{ color: '#B0343C', fontWeight: 'bold' }}>\n {props.likes}\n </p>\n <div onClick={dislikeBtn}>\n <ArrowDropDownIcon fontSize=\"large\" style={{ color: '#797979', cursor: 'pointer' }} />\n </div>\n </div>\n </div>\n {click == true ? <div>\n <ReplyCompo CName={props.CName} CId={props.CId} CImg={props.CImg} cardId={props.cardId} />\n <DisplayComment cardId={props.cardId} CId={props.CId} />\n </div>\n : HideComment}\n </div>\n );\n}", "title": "" }, { "docid": "278a4f0be655fbf0d4588d30e8e33e28", "score": "0.6075468", "text": "function likAktivitet() {\n setFillState(!fillState);\n\n fetch(`http://localhost:8000/whoLiked/${task.activity_id}/`, {\n method: \"PUT\",\n headers: {\n Authorization: `Token ${cookieToken[\"mytoken\"]}`,\n },\n })\n .then((result) => {\n if (!result.ok) throw result;\n updateTasks(cookieToken[\"mytoken\"]);\n return result.json();\n })\n .catch((error) => {\n console.log(error);\n });\n\n if (task.who_liked.split(\",\").includes(user.username)) {\n task.who_liked = \"\";\n userLikeState = true;\n } else {\n task.who_liked = user.username;\n userLikeState = false;\n }\n\n history.replace({ pathname: location.pathname, state: { task: task } });\n }", "title": "" }, { "docid": "bc1b77e94ecae02199b282441249aced", "score": "0.60703546", "text": "function updateLikeInPopup(popupLikeSelector,clickedObj){\r\n\t\r\n\tvar likesCount = clickedObj.find('#clicks').text();\r\n\tvar isLiked = clickedObj.find('a.like-counter > img').hasClass('liked');\r\n\tvar moduleId = clickedObj.find('a.like-counter').attr('data-module');\r\n\tvar entryId = clickedObj.find('a.like-counter').attr('data-entry');\r\n\t\r\n\t\r\n\tif(isLiked){\r\n\t\t$(popupLikeSelector +' a').find('img').addClass('liked').attr('src', '../images/likeHover.png?version=1.1');\r\n\t}else{\r\n\t\t$(popupLikeSelector +' a').find('img').removeClass('liked').attr('src', '../images/like.png');\r\n\t}\r\n\t\t\r\n\r\n\t$(popupLikeSelector +' a.like-counter').attr('data-module',moduleId);\r\n\t$(popupLikeSelector +' a.like-counter').attr('data-entry',entryId);\r\n\t$(popupLikeSelector +' a:last-child').text(likesCount);\r\n\t \r\n}", "title": "" }, { "docid": "feb90b6b1cf7d6c8673a5d2d3f7f2261", "score": "0.6059174", "text": "function like_get(post_id) {\n\t$.post('ajax/likeGet', {post_id:post_id}, function(data) {\n data = JSON.parse(data)\n\t\t$('#post_'+post_id+'_likes').text(data.likes);\n\t});\n}", "title": "" }, { "docid": "59c6f5b1ca15a858d835c18a7fb53ff4", "score": "0.6054887", "text": "function likeUnlike()\n{\n \n}", "title": "" }, { "docid": "aec629c5c7bcb0c26d1f8907b3e11425", "score": "0.60540986", "text": "unLikeMeme(id, memeid) {\n document.querySelectorAll('.memeDiv').forEach((element, index) => {\n element.parentNode.removeAttribute(\"class\", \"hideMemeDiv\");\n });\n\n this.props.changeView(-1, true);\n this.props.clearMatches();\n\n // this makes a call to the unlike endpoint \n axios.put(\"https://memedr.herokuapp.com/users/profile/unlike/\" + id, {\n id: id,\n memeid: memeid\n }).catch((err) => { return err });\n }", "title": "" }, { "docid": "3c16886e0cf76f2cd2383fa30c75649f", "score": "0.6052945", "text": "function showStatus(){\n$.ajax({\n url: 'server.php',\n type: 'POST',\n data: {action: 'showStatus'},\n success: function(r){\n r = JSON.parse(r);\n let id = $(\"#id\").val()\n r.forEach(function(item){\n let k= item.likes.some(a=>a.id==id)\n let comment = ''\n item.comment.forEach(function(i){\n comment+=`<div>\n <img src=\"${i.photo}\" width=50 height=50/>${i.name +' '+ i.surname}<br>${i.comment}\n </div>`\n })\n\n let likes = ''\n item.likes.forEach(function(i){\n likes+=`<div class=\"like_user\">\n <img src=\"${i.photo}\" width=50 height=50/>${i.name +' '+ i.surname}\n </div>`\n })\n let s = $(`<div class ='status_item'>\n <div>\n <img src=\" ${item.photo}\" width=50 height=50 style='border-radius:50%'/> ${item.name} ${item.surname}\n </div>\n ${item.status} <br />\n <b class='likeCount'>${item.likes.length}</b>\n <img src=\"images/${(k)?'dislike':'like'}.png\" class='${(k)?'dislike':'like'}' width= '40' id = \"${item.id}\">\n <div class='like_users'>${likes}</div>\n <div class='comment'>\n <textarea class='comment_mess' ></textarea>\n <button class='add_comm' id='${item.id}'>Add</button>\n <button id=\"showComm\">Show comments</button>\n <div class='comment_div'>${comment}</div>\n </div>\n </div>`);\n $(\".showStatus\").append(s);\n });\n }\n});\n}", "title": "" }, { "docid": "69d608c05277b2b642245656777c484e", "score": "0.60443157", "text": "function updateLikeFromPopup(popupDtlLikeSelector){\r\n\t\r\n\tvar detailModuleName=$(popupDtlLikeSelector +' a.like-counter').attr('data-module');\r\n\tvar detailEntryId=$(popupDtlLikeSelector +' a.like-counter').attr('data-entry');\r\n\tvar isDetailLiked = $(popupDtlLikeSelector +' a.like-counter > img').hasClass('liked');\t\r\n\tvar detailLikesCount = $(popupDtlLikeSelector).find('#clicks').text();\r\n\t\r\n\tvar mainLikeSelector = \"#\"+detailModuleName + \"-\" + detailEntryId;\r\n\t\r\n\t\r\n\tif( detailModuleName && detailEntryId && detailLikesCount) {\r\n\t\t\r\n\t\t$(mainLikeSelector +' a:last-child').text(detailLikesCount);\r\n\t\t\r\n\t\tif(isDetailLiked){\r\n\t\t\t$(mainLikeSelector +' a').find('img').addClass('liked').attr('src', '../images/likeHover.png?version=1.1');\r\n\t\t}else{\r\n\t\t\t$(mainLikeSelector +' a').find('img').removeClass('liked').attr('src', '../images/like.png');\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "17828a50c799e8ffb10c81a464871c8f", "score": "0.6035642", "text": "function handleResponse2(id) {\n if (req.readyState != 4 || req.status != 200) {\n return;\n }\n // Removes the old to-do list items\n console.log(\"out\")\n var dislikes = document.getElementById(\"dislikes\");\n console.log(\"handleResponse\");\n var item = JSON.parse(req.responseText);\n var newdislikes = item[\"dislikes\"];\n console.log(newdislikes);\n dislikes.innerHTML = \"<td>&nbsp;\"+newdislikes+\"&nbsp;</td>\";\n}", "title": "" }, { "docid": "dabe73b435328ed4daac10bf1f931ca9", "score": "0.60347074", "text": "function addRemoveLikes(action,forumId) {\n let like = {\n type: action,\n publication_id: forumId,\n user_id: JSON.parse(tempoData.getItem(\"user\")).userId\n }\n dataRequest = JSON.stringify(like);\n sendRequest(\"POST\", \"http://localhost:3000/api/like/:\"+ forumId,dataRequest)\n .then(dataLikes => {\n location.reload();\n })\n .catch(errorLikes => {\n errorView[0].innerHTML = errorLikes;\n })\n}", "title": "" }, { "docid": "550376d12c9175cdac05da650bfdecae", "score": "0.6033306", "text": "function likeUser (event) {\n event.preventDefault();\n //use event.target to get the uid, grab the data attribute\n //hides the like button\n $(event.target).toggle();\n //shows the unlike button\n $(event.target).siblings('.unlikeUser').toggle();\n\n //save the likes array to firebase\n saveLikes(likedSimpleLogin(event))\n\n showMatch(event, likedSimpleLogin(event));\n}//end likeUser", "title": "" }, { "docid": "08b34690d39c1367e377a45d7743dadd", "score": "0.60265696", "text": "function handleResponse1(id) {\n if (req.readyState != 4 || req.status != 200) {\n return;\n }\n // Removes the old to-do list items\n console.log(\"out\")\n var likes = document.getElementById(\"likes\");\n console.log(\"handleResponse\");\n var item = JSON.parse(req.responseText);\n var newlikes = item[\"likes\"];\n console.log(newlikes);\n likes.innerHTML = \"<td>&nbsp;\"+newlikes+\"&nbsp;</td>\";\n}", "title": "" }, { "docid": "094061407fc3eeb21b0dfcc5ffbd6b5d", "score": "0.60240483", "text": "async function toggleCommentLike(req,res,next){\n try {\n const group = await Group.findById(req.params.groupId)\n const post = group.posts.id(req.params.postId)\n const commentToLike = post.comments.id(req.params.commentId)\n if (!group || !post || !commentToLike) {\n throw new Error('Not Found')\n }\n if (commentToLike.likes.includes(req.currentUser._id)) {\n commentToLike.likes.pull(req.currentUser)\n } else {\n commentToLike.likes.push(req.currentUser)\n }\n await group.save()\n res.status(201).json('post liked/unliked successfully')\n\n } catch (err){\n next(err)\n }\n}", "title": "" }, { "docid": "6ef67537d5ea0971cd62465c374f0bd9", "score": "0.601856", "text": "handleLike(id) {\n new CallAPI().likeArticle(id, (err) => {\n if(err) {\n alert(\"Failed to like. Please try again\");\n return;\n }\n });\n }", "title": "" }, { "docid": "2f5fda43cb60881d09c1184063173fb1", "score": "0.5997344", "text": "updateLikeNumberElement(likeNumber) {\r\n $(\"#meme-likes-id\").text(likeNumber + \" Likes\");\r\n }", "title": "" }, { "docid": "8017e020fe2fb06f519d72b533a2f8d4", "score": "0.59936225", "text": "function like(req) {\n db.data.run(`UPDATE tweets SET likes=likes + 1 WHERE rowid = ${req.tweetid}`,\n function(err) {\n if (err) {\n console.error(\"Error updating the number of likes\");\n }\n });\n}", "title": "" }, { "docid": "240a4e2c5cb2bd63d930a51bb5fdbf69", "score": "0.5990992", "text": "function postLikeHandler(){\n // event.preventDefault();\n //let hash = splitHash(window.location.hash);\n let id = this.dataset.id\n //console.log(id)\n Model.addLike(Number(id))\n}", "title": "" }, { "docid": "d1872aacbc51ae560cfaa851c8e02b57", "score": "0.59879553", "text": "function like(event, messageId) {\n event.preventDefault();\n $.ajax({\n url: 'ajax.php?action=like&messageId=' + messageId\n }).done(function (data) {\n data = JSON.parse(data);\n notify('Message aimé', 3000);\n $(event.srcElement).parent().parent().find('.aime').html(data.aime);\n }).fail(function (error) {\n console.log(error);\n });\n}", "title": "" }, { "docid": "2d8f9586c4b333565506dad4e6900cea", "score": "0.5974259", "text": "like() {\r\n // Update the like number.\r\n this._currentMeme.likeNumber++;\r\n var likeNumber = this._currentMeme.likeNumber;\r\n this.updateLikeNumberElement(likeNumber);\r\n }", "title": "" } ]
084e48633ca2814b45bda71743273742
Getting a Coordinates of Mouse click
[ { "docid": "4cef92161391898616e16267aacb9aa7", "score": "0.7011675", "text": "function GetCoordinates(e){\r\n\r\n var PosX = 0;\r\n var PosY = 0;\r\n var ImgPos;\r\n ImgPos = FindPosition(output);\r\n\r\n if (!e) var e = window.event;\r\n if (e.pageX || e.pageY)\r\n {\r\n PosX = e.pageX;\r\n PosY = e.pageY;\r\n }\r\n else if (e.clientX || e.clientY)\r\n {\r\n PosX = e.clientX + document.body.scrollLeft\r\n + document.documentElement.scrollLeft;\r\n PosY = e.clientY + document.body.scrollTop\r\n + document.documentElement.scrollTop;\r\n }\r\n PosX = PosX - ImgPos[0];\r\n PosY = PosY - ImgPos[1];\r\n //document.getElementById(\"x\").innerHTML = PosX;\r\n //document.getElementById(\"y\").innerHTML = PosY;\r\n return (PosX, PosY);\r\n}", "title": "" } ]
[ { "docid": "c558564c9a2da245285e9023370019ce", "score": "0.7787455", "text": "function findClickCoordinates(e) {\n var offset = canvasElement.offsetLeft;\n var coordinates = new Point(e.x - offset, e.y);\n return coordinates\n}", "title": "" }, { "docid": "fb47dfc54eede8998c4c6fea043276cb", "score": "0.7650288", "text": "function mouse_coords(e) {\n var posx = 0;\n var posy = 0;\n if (!e)\n e = window.event;\n if (e.pageX || e.pageY) {\n posx = e.pageX;\n posy = e.pageY;\n }\n else if (e.clientX || e.clientY) {\n posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;\n posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;\n }\n var rect = e.target.getBoundingClientRect();\n return [posx - rect.left, posy-rect.top];\n}", "title": "" }, { "docid": "9b6846287d1cd37f892c8432f8513a36", "score": "0.76339805", "text": "function mouseClicked() {\r\n print(int(mouseX), int(mouseY))\r\n}", "title": "" }, { "docid": "89ab6eb4d3569e44ef3130d54e2d7982", "score": "0.7582109", "text": "function handleMouseDown(event){\n\tmouseX = getMousePosition(canvas,event)[0];\n \tmouseY = getMousePosition(canvas,event)[1];\n}", "title": "" }, { "docid": "8ec765d713e55140d17bea95ae918700", "score": "0.7560616", "text": "function getCoords(e) {\r\n const { x, y } = e.target.getBoundingClientRect()\r\n const mouseX = e.clientX - x\r\n const mouseY = e.clientY - y\r\n\r\n return [Math.floor(mouseX / (cnvRef.current.width / 10)), Math.floor(mouseY / (cnvRef.current.height / 10))]\r\n }", "title": "" }, { "docid": "de934dd7fecd38d73755b85745ce1678", "score": "0.75538653", "text": "function extractCoordinateFromMouseEvent () {\n\t\t return 0;\n\t\t }", "title": "" }, { "docid": "ffd01842434649086ba162f61e002259", "score": "0.75322884", "text": "function getMouseCoords(e) {\r\n \treturn [e.clientX,e.clientY];\r\n}", "title": "" }, { "docid": "806d8b855db6a2a46d45b1c352c69fa7", "score": "0.75316125", "text": "function getpositionmouse(event){\n var x = event.clientX - canvas.getBoundingClientRect().left;\n var y = event.clientY - canvas.getBoundingClientRect().top;\n return {x:x,y:y};\n}", "title": "" }, { "docid": "0d02f466083cbd0c7a7d613e3a048f68", "score": "0.7527858", "text": "getClickPosition(event) {\n let posX = 0;\n let posY = 0;\n\n if (!event) {\n event = window.event;\n }\n\n if (event.pageX || event.pageY) {\n posX = event.pageX;\n posY = event.pageY;\n } else if (event.clientX || event.clientY) {\n posX = (event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft);\n posY = (event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft);\n }\n\n return {\n x: posX,\n y: posY,\n };\n }", "title": "" }, { "docid": "67757ec504ac7e9b37a05967d6eb1ec4", "score": "0.7517355", "text": "function extractCoordinateFromMouseEvent () {\n return 0;\n }", "title": "" }, { "docid": "791e4f2bd4b5a3498251f0b951dd0999", "score": "0.7509564", "text": "function getMousePos()\r\n{\r\n return { x: event.pageX, y: event.pageY };\r\n}", "title": "" }, { "docid": "8b75720a6b7fa649ddd95cbd91e8b58a", "score": "0.7473283", "text": "function getMousePos(canvas, event) {\n var click = canvas.getBoundingClientRect();\n return {\n x: event.clientX - click.left,\n y: event.clientY - click.top\n };\n}", "title": "" }, { "docid": "713b7514ffd8752991b27388b375fd52", "score": "0.7469385", "text": "function getMousePosition(canvas, event) {\n let rect = canvas.getBoundingClientRect();\n mouseClickPos.x = event.clientX - rect.left;\n mouseClickPos.y = event.clientY - rect.top;\n}", "title": "" }, { "docid": "8f20c58d22eb2ee659902ae1785534b8", "score": "0.741807", "text": "function alert_coords(evt) {\n pt.x = evt.clientX;\n pt.y = evt.clientY;\n\n // The cursor point, translated into svg coordinates\n var cursorpt = pt.matrixTransform(svg.node().getScreenCTM().inverse());\n return [cursorpt.x, cursorpt.y];\n}", "title": "" }, { "docid": "4d75c3c47bb72662e7cf08772570374a", "score": "0.74178714", "text": "getMouseCoords(evt) {\n const xaxis = this.plot.chart._fullLayout.xaxis;\n const yaxis = this.plot.chart._fullLayout.yaxis;\n const l = this.plot.chart.getBoundingClientRect().x + this.plot.chart._fullLayout.margin.l;\n const t = this.plot.chart.getBoundingClientRect().y + this.plot.chart._fullLayout.margin.t;\n const x = xaxis.p2c(evt.x - l);\n const y = yaxis.p2c(evt.y - t);\n return { x, y };\n }", "title": "" }, { "docid": "57408cfb8b8f012fb1a78a2edffa2984", "score": "0.7388332", "text": "function getMouseCoords(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n \"x\": evt.clientX - rect.left,\n \"y\": evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "57408cfb8b8f012fb1a78a2edffa2984", "score": "0.7388332", "text": "function getMouseCoords(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n \"x\": evt.clientX - rect.left,\n \"y\": evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "3cb8829ab20196e92210f83235787f44", "score": "0.73852754", "text": "function canvas_click_position(e){\n\t var nav = e.target;\n\t var x = 0;\n\t var y = 0;\n\t while( nav.tagName && nav.tabIndex ){\n\t y += nav.offsetTop;\n\t x += nav.offsetLeft;\n\t nav = nav.parentNode;\n\t }\n\t return {x : e.clientX - x, y : e.clientY - y}\n\t\t/* failed method.. craps\n\t\tx = e.clientX\n\t\ty = e.clientY\n\t\tvar pos = j(e.target).position() // se pah nao faz o que eu quero =/\n\t\tdebugger\n\t\treturn {x : x-pos.left, y : y-pos.top}\n\t */\n\t}", "title": "" }, { "docid": "bc14a15db3b28ffa473f5e5bcca2569c", "score": "0.7372509", "text": "function calculateMousePosition(e){\n var rect = canvas.getBoundingClientRect();\n //console.log(rect);\n var root = document.documentElement;\n var mouseX = e.clientX - rect.left - root.scrollLeft;\n var mouseY = e.clientY - rect.top - root.scrollTop;\n \n //console.log(`clientY: ${e.clientY}`)\n return {\n x:mouseX,\n y:mouseY\n }\n }", "title": "" }, { "docid": "8891758a45d0881545f8fa9030e8d658", "score": "0.7360438", "text": "function getMouseCoord(canvas, e) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: e.clientX - rect.left,\n y: e.clientY - rect.top\n };\n }", "title": "" }, { "docid": "ada98486bb106a54805965e497f8198a", "score": "0.73545533", "text": "function getCoords(e, element) {\n // coursesweb.net/\n var xy_pos = getXYpos(element);\n var x = 0;\n var y = 0;\n\n // if IE\n if (navigator.appVersion.indexOf(\"MSIE\") != -1) {\n\t// in IE scrolling page affects mouse coordinates into an element\n\t// This gets the page element that will be used to add scrolling value\n\t// to correct mouse coords\n\tvar standardBody = (document.compatMode == 'CSS1Compat') ? document.documentElement : document.body;\n\n\tx = event.clientX + standardBody.scrollLeft;\n\ty = event.clientY + standardBody.scrollTop;\n } else {\n\tx = e.pageX;\n\ty = e.pageY;\n }\n\n x = x - xy_pos['xp'];\n y = y - xy_pos['yp'];\n\n return [ x, y ];\n}", "title": "" }, { "docid": "8d072bc9441d0cbbd06d12c3ddc59fcf", "score": "0.7332772", "text": "function mouse_position_xy(e) {\n\t\tlet x = e.clientX;\n\t\tlet y = e.clientY;\n\t\tlet result = new Object();\n\t\tresult.x = x;\n\t\tresult.y = y;\n\t\treturn result;\n\t}", "title": "" }, { "docid": "855609d91fceba5d59d56ddea9cfc12b", "score": "0.7314662", "text": "function mouseClicked(event) {\n console.log('mouseClicked', event.clientX, event.clientY);\n}", "title": "" }, { "docid": "928858d04a88fc8fbe3450e792dcec4e", "score": "0.72909236", "text": "function getMousePos(event) {\n mouseX = event.clientX; mouseY = event.clientY;\n}", "title": "" }, { "docid": "329214c305584446733e7bd705c17c8a", "score": "0.72712344", "text": "getMousePos(event) {\n const rect = this.canvas.getBoundingClientRect();\n const x = Math.floor((event.clientX - rect.left) / GRID_SIZE);\n const y = Math.floor((event.clientY - rect.top) / GRID_SIZE);\n return { x, y };\n }", "title": "" }, { "docid": "0691c02965983d37794d2895699b70b6", "score": "0.7269648", "text": "function getClickPosition(e) {\n var rect = e.currentTarget.getBoundingClientRect();\n var xPixel = e.clientX - rect.left;\n var yPixel = e.clientY - rect.top;\n // print(xPixel+\" \"+yPixel);\n\n if (e.which === 1) {\n\n // convert pixel to math number\n xcenter = xmin + xPixel / xscale;\n ycenter = ymin + yPixel / yscale;\n\n zoom *= 2; // zoom doesn't really do anything\n span /= 2;\n\n // maxIterations *= 1.1;\n // maxIterations += 20;\n\n } else if (e.which === 3) { // right click on mac touchpad for some reason\n\n zoom /= 2;\n span *= 2;\n\n // maxIterations /= 1.1;\n // maxIterations -= 20;\n\n\n }\n\n xmin = xcenter - span;\n xmax = xcenter + span;\n ymin = ycenter - span;\n ymax = ycenter + span;\n\n xscale = width / (xmax - xmin);\n yscale = height / (ymax - ymin);\n\n drawMandelbrot();\n\n\n }", "title": "" }, { "docid": "90fd85ef142bfb254ad7e50a749aca9a", "score": "0.72539485", "text": "function getMouseCoords(event) {\n\tlet rect = Els.editor.getBoundingClientRect();\n\tlet x = event.clientX - rect.left;\n\tlet y = event.clientY - rect.top;\n\treturn {x: x, y: y};\n}", "title": "" }, { "docid": "681f243904b9f55c914009048c47abc8", "score": "0.7242771", "text": "function eventCoordinates(e) {\n var pos =\n { x: e.pageX - canvas.offsetLeft\n , y: e.pageY - canvas.offsetTop };\n return pos;\n}", "title": "" }, { "docid": "68092dec2b5341a620e11dd1c6e4ec09", "score": "0.72194505", "text": "function getMousePos(event) {\n var rect = canvas.getBoundingClientRect();\n return {x: parseInt((event.clientX - rect.left)), y: parseInt((event.clientY - rect.top))};\n}", "title": "" }, { "docid": "434759efe05c9ca4ddfee70382ee481a", "score": "0.7200532", "text": "getMousePos(event) {\n const rect = canvas.getBoundingClientRect();\n return {\n x: event.clientX - rect.left,\n y: event.clientY - rect.top\n };\n }", "title": "" }, { "docid": "927fbc5ce297d3bafacc4d148f13c529", "score": "0.7187361", "text": "static getMousePressPosition() {\n return Input.mousePressPosition;\n }", "title": "" }, { "docid": "e57d6902df8dbd0e063258cf46d96ca9", "score": "0.7184513", "text": "function getMousePos(e) {\n if (!e)\n var e = event;\n if (e.offsetX) {\n mouseX = e.offsetX;\n mouseY = e.offsetY;\n }\n else if (e.layerX) {\n mouseX = e.layerX;\n mouseY = e.layerY;\n }\n }", "title": "" }, { "docid": "270866092ae8cd4822883cddd93dc185", "score": "0.71798366", "text": "function mousePressed (){\n console.log (mouseX, mouseY);\n}", "title": "" }, { "docid": "49cf5049cc5514fd8ef70c77434daf49", "score": "0.7177606", "text": "function calculateMousePosition (evt) {\n\tvar rect = canvas.getBoundingClientRect();\n\tvar root = document.documentElement;\n\tvar mouseX = evt.clientX - rect.left - root.scrollLeft;\n\tvar mouseY = evt.clientY - rect.top - root.scrollTop;\n\treturn {x:mouseX, y:mouseY};\n\t}", "title": "" }, { "docid": "9053fdff92155330f61950537c80be8e", "score": "0.716944", "text": "function getMousePos(e) \n{ \n if (!e) \n var e = event; \n if (e.offsetX) { \n mouseX = e.offsetX; \n mouseY = e.offsetY; \n } \n else if (e.layerX) { \n mouseX = e.layerX; \n mouseY = e.layerY; \n } \n}", "title": "" }, { "docid": "d6ac6f830db40c3d584385b6e189ae2b", "score": "0.71691626", "text": "function mouse(e) {\n\n return [\n e.pageX - div.offsetLeft - r,\n e.pageY - div.offsetTop - r\n ];\n}", "title": "" }, { "docid": "f0fdb2bcf0ee4623aba306b15ef8a427", "score": "0.7167712", "text": "function getMousePosition(canvas, evt) {\n //var rect = canvas.getBoundingClientRect();\n var offset = getOffset(canvas);\n return {\n x: evt.pageX - offset.left,\n y: evt.pageY - offset.top\n };\n }", "title": "" }, { "docid": "b866e1835c12363528e93aaad7bb6929", "score": "0.7163674", "text": "function getMousePos(e) {\n if (!e)\n var e = event;\n\n if (e.offsetX) {\n mouseX = e.offsetX;\n mouseY = e.offsetY;\n }\n else if (e.layerX) {\n mouseX = e.layerX;\n mouseY = e.layerY;\n }\n }", "title": "" }, { "docid": "74a3ff94deea726561c1e57bda76a77d", "score": "0.71599096", "text": "function getMousePos(canvas, evt, verbose = false) {\n let rect = canvas.getBoundingClientRect(), // abs. size of element\n scaleX = canvas.width / rect.width, // relationship bitmap vs. element for X\n scaleY = canvas.height / rect.height; // relationship bitmap vs. element for Y\n let coord = {\n x: (evt.clientX - rect.left) * scaleX, // scale mouse coordinates after they have\n y: (evt.clientY - rect.top) * scaleY, // been adjusted to be relative to element\n };\n if (verbose) console.log(coord.x + \",\" + coord.y);\n return coord;\n}", "title": "" }, { "docid": "b59c0506130024ce18cb636f4108b8e3", "score": "0.71447444", "text": "function calculateMousePosition(evt) {\n\tvar rect = canvas.getBoundingClientRect();\n\tvar root = document.documentElement;\n\t// calculate the mouse X axis position\n\tvar mouseX = evt.clientX - rect.left - root.scrollLeft;\n\t// calculate the mouse Y axis position\n\tvar mouseY = evt.clientY - rect.top - root.scrollTop;\n\treturn {\n\t\tx: mouseX,\n\t\ty: mouseY\n\t};\n}", "title": "" }, { "docid": "e0c5f0276c7635028b9a09c04606f45b", "score": "0.71413404", "text": "function getMousePos(e) {\n return { x: e.clientX, y: e.clientY };\n}", "title": "" }, { "docid": "939cc3b4b496ce6fef2193b9fc2e8e29", "score": "0.7139129", "text": "function click_location(evt, graph, line) {\n // Find out where the user clicked\n var pt = graph.svg.createSVGPoint();\n pt.x = evt.clientX;\n pt.y = evt.clientY;\n // The cursor point, translated into svg coordinates\n const gpt = pt.matrixTransform(graph.svg.getScreenCTM().inverse());\n\n const cx = graph.x_val(gpt.x);\n const cy = graph.y_val(gpt.y);\n\n // Find out which square (if any) the user clicked\n var index = null;\n for (let i in line.pts) {\n \tif (Math.abs(graph.x_coord(line.pts[i][0]) - gpt.x) <= graph.handle_side &&\n Math.abs(graph.y_coord(line.pts[i][1]) - gpt.y) <= graph.handle_side) {\n\t index = i;\n\t break;\n \t}\n }\n\n return [cx, cy, index];\n}", "title": "" }, { "docid": "344cb3598d1abec087d09175eb5320ce", "score": "0.7135543", "text": "function getMousePos(e){\n var canvasRect = canvas.getBoundingClientRect();\n return{\n x: e.clientX - canvasRect.left,\n y: e.clientY - canvasRect.top\n }\n}", "title": "" }, { "docid": "66f7e20b2b191e55a12242edb23c8f7f", "score": "0.7131951", "text": "function getMouseCoords(event)\n{\n\t\n\tif (!event) var event = window.event;\n\n\tvar posx = 0;\n\tvar posy = 0;\n\tif (event.pageX || event.pageY) \t{\n\t\tposx = event.pageX;\n\t\tposy = event.pageY;\n\t}\n\telse if (event.clientX || event.clientY) \t{\n\t\tposx = event.clientX + document.body.scrollLeft\n\t\t\t+ document.documentElement.scrollLeft;\n\t\tposy = event.clientY + document.body.scrollTop\n\t\t\t+ document.documentElement.scrollTop;\n\t}\n\n\tvar totaloffset = findPos(canvasObj);\n\t\n \tvar totalXoffset = totaloffset[0];\n \tvar totalYoffset = totaloffset[1];\n\n \tvar canvasX = posx- totalXoffset;\n \tvar canvasY = posy- totalYoffset;\n\n \t// return coordinates in an array\n\treturn [canvasX, canvasY];\n\t\n}", "title": "" }, { "docid": "949ce2d65829a44ceba771ad79e526f1", "score": "0.7130436", "text": "function getMousePos(evt) {\n var canvas = evt.target;\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "9db3a8afc89efe5cb70b36d36bf6c877", "score": "0.71281743", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: parseInt(evt.clientX - rect.left),\n y: parseInt(evt.clientY - rect.top)\n };\n }", "title": "" }, { "docid": "879b6d0f6bbcf9bcae2fd2191e7e86e6", "score": "0.71220464", "text": "function mouseCoordinates() {\n var mouse = document.getElementById('mouse').getContext('2d');\n mouse.canvas.addEventListener('mousemove', function(event) {\n var mouseX = event.clientX - mouse.canvas.offsetLeft;\n var mouseY = event.clientY - mouse.canvas.offsetTop;\n var status = document.getElementById('status');\n status.innerHTML = mouseX + \" | \" + mouseY;\n });\n}", "title": "" }, { "docid": "dd551622263dc0c00fc89dffd3eb6c7a", "score": "0.7117316", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "dd551622263dc0c00fc89dffd3eb6c7a", "score": "0.7117316", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "ff7074ac633e3e82159d80be112d877b", "score": "0.71154046", "text": "function calculateMousePos(evt){ // an event fires when mouse moves\n var rect = canvas.getBoundingClientRect();\n var root = document.documentElement;\n var mouseX = evt.clientX - rect.left - root.scrollLeft;\n var mouseY = evt.clientY - rect.top - root.scrollTop;\n return {\n x:mouseX, // Object Literal\n y:mouseY // Object Literal\n };\n }", "title": "" }, { "docid": "1228bf2fcb12cec481c825447ca8d161", "score": "0.71145105", "text": "getMousePos(canvas, event) {\n const rect = canvas.getBoundingClientRect();\n return {\n x: event.clientX - rect.left,\n y: event.clientY - rect.top,\n };\n }", "title": "" }, { "docid": "99b668ad34839945f7b9035ae9c96a16", "score": "0.7109569", "text": "function getMousePosition(e) {\n \tvar pos, item = null, offset = evtHolder.offset();\n \tvar canvasX = e.pageX - offset.left - plotOffset.left,\n \tcanvasY = e.pageY - offset.top - plotOffset.top;\n \tpos = plot.c2p({left: canvasX, top:canvasY});\n \tpos.pageX = e.pageX;\n \tpos.pageY = e.pageY;\n \titem = findNearbyItem(canvasX, canvasY);\n \treturn [pos, item];\n }", "title": "" }, { "docid": "282e060c394bd65c492b7d11a796f42f", "score": "0.7100797", "text": "function getMousePos(e) {\n if (!e)\n var e = event;\n\n if (e.offsetX) {\n mouseX = e.offsetX;\n mouseY = e.offsetY;\n } else if (e.layerX) {\n mouseX = e.layerX;\n mouseY = e.layerY;\n }\n }", "title": "" }, { "docid": "57ff48d715ecd00db34c499ad958b65b", "score": "0.70897824", "text": "function getMousePos(evt){\n var rect = canvas.getBoundingClientRect(),\n scaleX = canvas.width / rect.width,\n scaleY = canvas.height / rect.height;\n\n return {\n x: ((evt.clientX - rect.left) * scaleX),\n y: ((evt.clientY - rect.top) * scaleY)\n }\n}", "title": "" }, { "docid": "563378943563154aaa22f3e395055174", "score": "0.70892835", "text": "function getMousePos(canvas, evt){\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "4ccb9ecc2855d03f338e30ebe33c8e74", "score": "0.70888096", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "8621bd5cf1f1bb78aa9b391962eb98ed", "score": "0.7087401", "text": "function getMousePos(e) {\n if (!e)\n var e = event;\n\n if (e.offsetX) {\n mouseX = e.offsetX;\n mouseY = e.offsetY;\n }\n else if (e.layerX) {\n mouseX = e.layerX;\n mouseY = e.layerY;\n }\n }", "title": "" }, { "docid": "e13355fbc7abf350673cc6ebf8fb87c7", "score": "0.70806336", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "9d7e61e4e59d5ab26c8167d35e0d73e5", "score": "0.70732373", "text": "function getEventLocationInSvgCoordinates(event) {\n let canvas = event.target.closest('svg');\n let pt = canvas.createSVGPoint();\n pt.x = event.clientX;\n pt.y = event.clientY;\n\n // The cursor point, translated into svg coordinates\n var cursorpt = pt.matrixTransform(canvas.getScreenCTM().inverse());\n return [ cursorpt.x, cursorpt.y ];\n}", "title": "" }, { "docid": "96a2a408a839b5c8fae97beeb3a10a15", "score": "0.7069117", "text": "function getMousePos(e) {\r\n if (!e)\r\n var e = event;\r\n\r\n if (e.offsetX) {\r\n mouseX = e.offsetX;\r\n mouseY = e.offsetY;\r\n }\r\n else if (e.layerX) {\r\n mouseX = e.layerX;\r\n mouseY = e.layerY;\r\n }\r\n }", "title": "" }, { "docid": "b3a9f855b0ffdde544ae80dbddb66d58", "score": "0.70626813", "text": "function mouseCoord(event) {\n var rect = canvas.getBoundingClientRect();\n return vec2(2 * (event.clientX - rect.left - 10) / canvas.width - 1, \n 2 * (canvas.height - (event.clientY - rect.top - 10)) / canvas.height - 1);\n}", "title": "" }, { "docid": "cc4f3ecd7877ea668ecdc7e0976c04de", "score": "0.7054573", "text": "function mousePos(event) {\n event = (event ? event : window.event);\n return {\n x: event.pageX - canvas.offsetLeft,\n y: event.pageY - canvas.offsetTop\n }\n }", "title": "" }, { "docid": "dc81e733d58ef8202e8867717cace6e5", "score": "0.70522946", "text": "function calcMousePos(evnt) {\n var rect = canvas.getBoundingClientRect();\n var root = document.documentElement;\n var mouseX = evnt.clientX - rect.left - root.scrollLeft;\n var mouseY = evnt.clientY - rect.top - root.scrollTop;\n return {\n x:mouseX,\n y:mouseY\n };\n}", "title": "" }, { "docid": "fefb556e66d5ac282536747410d89ea8", "score": "0.70510906", "text": "getCoords(evt) {\n const CTM = this.svg.getScreenCTM();\n\t\tlet rect = this.svg.getBoundingClientRect();\n //console.log(\"svg:rect:\", rect);\n //console.log(\"evt:client:\", evt.clientX, evt.clientY);\n\t\tlet x = (evt.clientX - rect.left - CTM.e) / CTM.a;\n\t\tlet y = (evt.clientY - rect.top - CTM.f) / CTM.d;\n\t\treturn [x, y];\n\t}", "title": "" }, { "docid": "7e9ce67ec753e8127305f93b8e41d20d", "score": "0.70489484", "text": "function getMousePos(e) {\n if (!e)\n var e = event;\n\n if (e.offsetX) {\n mouseX = e.offsetX;\n mouseY = e.offsetY;\n }\n else if (e.layerX) {\n mouseX = e.layerX;\n mouseY = e.layerY;\n }\n}", "title": "" }, { "docid": "4a832fd1cf0ffcc9fed7268a7a6f3192", "score": "0.70483625", "text": "function mouseclick (ev) {                                  \n posx = ev.layerX;                         \n posy = ev.layerY;             \n}", "title": "" }, { "docid": "6b8993c99a7d29c31d6debfac0374519", "score": "0.70478755", "text": "function getMousePos(canvas, evt) {\r\n var rect = canvas.getBoundingClientRect();\r\n return {\r\n x: evt.clientX - rect.left,\r\n y: evt.clientY - rect.top\r\n };\r\n}", "title": "" }, { "docid": "074a4cef7fee37c411687f6683b32322", "score": "0.70445544", "text": "function calculateMousePos(event){\n\n\tvar rect=canvas.getBoundingClientRect();\n\tvar root=document.documentElement;\n\tvar mouseX=event.clientX-rect.left-root.scrollLeft;\n\tvar mouseY=event.clientY-rect.top-root.scrollTop;\n\treturn{\n\t\tx:mouseX,\n\t\ty:mouseY\n\t};\n\n}", "title": "" }, { "docid": "d730bfa62064dc17562c4b259d531aff", "score": "0.704261", "text": "function getMousePos(canvas, evt) {\n \t\t\tvar rect = canvas.getBoundingClientRect();\n \t\t\treturn {\n \t\t\t\tx: evt.clientX - rect.left,\n \t\t\t\ty: evt.clientY - rect.top\n \t\t\t};\n \t\t}", "title": "" }, { "docid": "90355c0aa3b01884722ea1b5b5a20d76", "score": "0.70377535", "text": "function click() {\n var latlon = projection.invert(d3.mouse(this));\n console.log(latlon);\n}", "title": "" }, { "docid": "54935cc6bdc06d9724a68055d0bb6b64", "score": "0.70360804", "text": "function calculateMousePos (evt) {\n let rect = canvas.getBoundingClientRect()\n let root = document.documentElement\n let mouseX = evt.clientX - rect.left - root.scrollLeft\n let mouseY = evt.clientY - rect.top - root.scrollTop\n return {\n x: mouseX,\n y: mouseY\n }\n}", "title": "" }, { "docid": "682734089593de0b443fc4e3bf95750a", "score": "0.7035638", "text": "function getMousePos2(canvas, evt)\r\n{\r\n var x = evt.clientX - canvas.offsetLeft;\r\n var y = evt.clientY - canvas.offsetTop;\r\n var mousePos = new Point(x,y);\r\n return mousePos;\r\n}", "title": "" }, { "docid": "2aafd8d120f638f94eb9421810d385da", "score": "0.7034049", "text": "function getMousePos(e) \n{\n var rect = game_canvas.getBoundingClientRect();\n return {\n x: e.clientX - rect.left,\n y: e.clientY - rect.top\n };\n}", "title": "" }, { "docid": "4c866ede366c11d0fe55afd08874b1df", "score": "0.7028685", "text": "function getMousePos(canvas, evt) {\n let rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n }", "title": "" }, { "docid": "12ea9d8474bfca52092bb3ccbc324e94", "score": "0.70275617", "text": "function getMousePos(canvas, evt) {\n\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n }", "title": "" }, { "docid": "f45b37d5e9fffb630dd7c81176834666", "score": "0.7027436", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "f45b37d5e9fffb630dd7c81176834666", "score": "0.7027436", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "f45b37d5e9fffb630dd7c81176834666", "score": "0.7027436", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "34562db09456a6fa2b4bd2d25d7ebaef", "score": "0.70265716", "text": "function getCoords(e) {\n\tif (e.offsetX) {\n\t\treturn { x: e.offsetX, y: e.offsetY };\n\t}\n\telse if (e.layerX) {\n\t\treturn { x: e.layerX, y: e.layerY };\n\t}\n\telse {\n\t\treturn { x: e.pageX - cb_canvas.offsetLeft, y: e.pageY - cb_canvas.offsetTop };\n\t}\n}", "title": "" }, { "docid": "d426d041a47553c5a3cbf598eb9bacde", "score": "0.7026308", "text": "function getMousePos(evt) {\n\tvar rect = glcanvas.getBoundingClientRect();\n\treturn {\n\t\tX: evt.clientX - rect.left,\n\t\tY: evt.clientY - rect.top\n\t};\n}", "title": "" }, { "docid": "0a7ad8129fcbbf7e978568897423f5c1", "score": "0.7025717", "text": "getMousePosCanv(e) {\n var rect = this.canvas.getBoundingClientRect();\n return {\n x: e.clientX - rect.left,\n y: e.clientY - rect.top\n };\n }", "title": "" }, { "docid": "c1b6332d58c6d8550b95e6f1064647cd", "score": "0.7024805", "text": "function getMousePos(canvas, evt) { \r\n var rect = canvas.getBoundingClientRect(); \r\n return { \r\n x: evt.clientX - rect.left * (canvas.width / rect.width),\r\n y: evt.clientY - rect.top * (canvas.height / rect.height)\r\n }\r\n }", "title": "" }, { "docid": "06fe590b98a8172dd1d07213ec52d1a9", "score": "0.7021754", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "06fe590b98a8172dd1d07213ec52d1a9", "score": "0.7021754", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "a8c3c7502875c8ebb14de68a1f56fcab", "score": "0.7019569", "text": "function getMousePos(evt) {\n var rect = c.getBoundingClientRect();\n\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "a8c3c7502875c8ebb14de68a1f56fcab", "score": "0.7019569", "text": "function getMousePos(evt) {\n var rect = c.getBoundingClientRect();\n\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "64e5cf4519d5492ac805502e59241f26", "score": "0.7015482", "text": "function calculateMousePos(evt) {\n var rect = canvas.getBoundingClientRect();\n var root = document.documentElement;\n var mouseX = evt.clientX - rect.left - root.scrollLeft;\n var mouseY = evt.clientY - rect.top - root.scrollTop;\n\n return {\n x:mouseX,\n y:mouseY\n };\n}", "title": "" }, { "docid": "20bdfbc813d1ccf8f4e08d7b7defce1e", "score": "0.70112544", "text": "function calcMousePos(e) {\n let pointer = canvas.getPointer(e);\n mousePos.x = pointer.x;\n mousePos.y = pointer.y;\n }", "title": "" }, { "docid": "89737a962e80e475fbdf3e51e9518bb0", "score": "0.7011074", "text": "function onMouseDown(event){\r\n console.log(\"COORDENADAS DO CLIQUE: \" + event.x + \", \" + event.y);\r\n}", "title": "" }, { "docid": "dab3caa30120fa6c01a7e30c4546f946", "score": "0.7011061", "text": "function getMouseCoordinates(element, event) {\n let rect = element.getBoundingClientRect(), // grootte van element\n scaleX = element.width / rect.width, // grootte van afbeelding / werkelijke grootte\n scaleY = element.height / rect.height;\n\n return {\n x: (event.clientX - rect.left) * scaleX, // schaal toepassen op muispositie\n y: (event.clientY - rect.top) * scaleY\n }\n}", "title": "" }, { "docid": "97dd403f0d9d49938d4f8b79d9e83610", "score": "0.7004831", "text": "function click() {\r\n var latlon = projection.invert(d3.mouse(this));\r\n console.log(latlon);\r\n}", "title": "" }, { "docid": "9413ec7f10348e2c855baeb9194f8997", "score": "0.6999729", "text": "function getMousePos(canvas, evt) {\n\t\tvar rect = canvas.getBoundingClientRect();\n\t\treturn {\n\t\t x: evt.clientX - rect.left,\n\t\t y: evt.clientY - rect.top\n\t\t};\n\t}", "title": "" }, { "docid": "d88530623b9ce9b4154fa1e06c3b5e88", "score": "0.6996202", "text": "function getMousePos(canvas, evt) {\r\n var rect = canvas.getBoundingClientRect();\r\n return {\r\n x: (evt.clientX-rect.left)/(rect.right-rect.left)*canvas.width,\r\n y: (evt.clientY-rect.top)/(rect.bottom-rect.top)*canvas.height\r\n };\r\n}", "title": "" }, { "docid": "1f8337caf30cc48f7964ea8ff0a6798b", "score": "0.6992755", "text": "function getMousePos( canvas, event ) {\r\n\tvar rect = canvas.getBoundingClientRect();\r\n\treturn {\r\n\t\tx: event.clientX - rect.left,\r\n\t\ty: event.clientY - rect.top\r\n\t};\r\n}", "title": "" }, { "docid": "c6dd9b211ba9b9c5f1665d868098d0da", "score": "0.6990289", "text": "function getCoords(event,canvas)\n {\n //Firefox\n if (event.layerX || event.layerX == 0) \n { \n x = event.layerX - canvas.offset().left - 1;\n y = event.layerY - canvas.offset().top - 1;\n } \n //Opera\n else if (event.offsetX || event.offsetX == 0) \n {\n x = event.offsetX - canvas.offset().left - 1;\n y = event.offsetY - canvas.offset().top - 1;\n }\n return {x : x, y: y};\n }", "title": "" }, { "docid": "3543b85467da5c679946b9b9b86d6d39", "score": "0.69870496", "text": "function returnClickedPoint(canvas, event) {\n var rect = canvas.getBoundingClientRect();\n var x = event.clientX - rect.left - htmlCanvasGridMargin;\n var y = event.clientY - rect.top - htmlCanvasGridMargin;\n var canvasPoint = new Point(x, y);\n return canvasPoint;\n}", "title": "" }, { "docid": "66e7a1e8a375cfec9be7741c595fc9cb", "score": "0.69845676", "text": "function getCursorPosition(e) {\n\tvar x, y;\n\tif (e.pageX || e.pageY) {\n\t\tx = e.pageX;\n\t\ty = e.pageY;\n\t}\n\telse {\n\t\tx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;\n\t\ty = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;\n\t}\n\tx -= document.getElementById(\"main-canvas\").offsetLeft;\n\ty -= document.getElementById(\"main-canvas\").offsetTop;\n\n\treturn [x, y];\n}", "title": "" }, { "docid": "7c935199c55d88d413ceb7d2e4c89385", "score": "0.6976569", "text": "click(ev) {\n // Print x,y coordinates.\n console.log(ev.clientX, ev.clientY);\n //Convert coordinates to webgl style\n var x = (ev.clientX - (canvas.height / 2)) / (canvas.height / 2);\n var y = ((canvas.height / 2) - ev.clientY) / (canvas.height / 2);\n }", "title": "" } ]
f400c36758a0383e6773496a73a40f06
DE INITIELE VOTING SITUATIE SETTEN = NEUTRALE PIJLTJES
[ { "docid": "10fad719073d3a846e9447cb18ceccac", "score": "0.0", "text": "function setInitialVotingSituation (p_currentMessageId)\n{\n\t\t$(p_currentMessageId).data('voteddown',false);\n\t\t$(p_currentMessageId).find('.voteDown').addClass('down');\n\t\t$(p_currentMessageId).find('.voteDown').removeClass('chosenDown');\n\t\t$(p_currentMessageId).find('.voteDown').removeClass('inactiveDown');\n\t\t$(p_currentMessageId).find('.voteDown').prop('disabled', false);\n\n\t\t// de overblijvende vote\n\t\t$(p_currentMessageId).data('votedup',false);\n\t\t$(p_currentMessageId).find('.voteUp').removeClass('inactiveUp');\n\t\t$(p_currentMessageId).find('.voteUp').removeClass('chosenUp');\n\t\t$(p_currentMessageId).find('.voteUp').addClass('up');\n\t\t$(p_currentMessageId).find('.voteUp').prop('disabled', false);\n\n}", "title": "" } ]
[ { "docid": "57220a1178079c47b90efbe9541f811d", "score": "0.6639534", "text": "function toutLesNiveaux() {\n partieLancement = 0;\n partie=0; \n lancementToutLesNiveaux();\n}", "title": "" }, { "docid": "8245d8823cce35405383386e4f8f8768", "score": "0.65069634", "text": "function niveaux1() {\n partie = 0;\n partieLancement = 0;\n lancement1Niveaux();\n}", "title": "" }, { "docid": "058bfe2c1fffb73be6acfa41e1e420d4", "score": "0.61700344", "text": "function unidadesVendidas() {}", "title": "" }, { "docid": "261c037578299231c73b828256bc8626", "score": "0.6026223", "text": "function vastaus(suhde){\n // 0 25 Annan yhden neljäsosa tabletin kerralla/päivässä.\n // 0 50 Annan yhden puolikkaan tabletin kerralla/päivässä.\n // 0 75 Annan kolme neljäsosa tablettia kerralla/päivässä.\n\n // 1 Annan yhden kokonaisen tabletin kerralla/päivässä\n // 1 25 Annan yhden kokonaisen ja yhden neljäsosa tabletin kerralla/päivässä.\n // 1 50 Annan yhden kokonaisen ja yhden puolikkaan tabletin kerralla/päivässä.\n // 1 75 Annan yhden kokonaisen ja kolme neljäsosa tabletia kerralla/päivässä.\n\n //2/3 Annan kaksi/kolme tablettia kerralla/päivässä.\n //2/3 25 Annan kaksi/kolme kokonaista ja yhden neljäsosa tabletin kerralla/päivässä.\n //2/3 75 Annan kaksi/kolme kokonaista ja kolme neljäsosa tablettia kerralla/päivässä.\n //2/3 50 Annan kaksi/kolme kokonaista ja yhden puolikkaan tabletin kerralla/päivässä.\n \n var D = 0;\n var lukuSanat = [\"nolla\",\"yksi\",\"kaksi\",\"kolme\",\"neljä\",\"viisi\",\"kuusi\",\"seitsemän\",\"kahdeksan\",\"yhdeksän\"];\n \n // Vastauksessa desimaalilukuja\n if( suhde % 1 > 0){\n var intPart = (suhde+\"\").split(\".\")[0];\n var decPart = (suhde+\"\").split(\".\")[1];\n if(D) console.debug(\"intPart=\"+intPart+\" decPart=\"+decPart);\n \n if( intPart == 0){\n var intTeksti = \"\"; }\n else if( intPart == 1){\n var intTeksti = \"yhden kokonaisen ja \"; }\n else{\n var intTeksti = lukuSanat[intPart]+\" kokonaista ja \"; }\n \n if( decPart == 25){\n var decTeksti = \"yhden neljäsosa tabletin\"; }\n else if( decPart == 5){2\n var decTeksti = \"yhden puolikkaan tabletin\"; }\n else if( decPart == 75){\n var decTeksti = \"kolme neljäsosa tablettia\";}\n }\n else{\n if(D) console.debug(\"suhde=\"+intPart);\n\n if( suhde == 1){\n var intTeksti = \"yhden kokonaisen tabletin\";}\n else{\n var intTeksti = lukuSanat[suhde]+\" kokonaista tablettia\";}\n var decTeksti = \"\";\n }\n return \"Annan \"+intTeksti+decTeksti+\".\";\n }", "title": "" }, { "docid": "39940070cc24b67aca9912439bd04b6e", "score": "0.5841952", "text": "function azzeraValori(){\n\tvar macro = [1,2,3];\n\tvar fmv = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15];\n\tvar alcol = [0,1,2];\n\n\tfor(var a=0, ax; ax=macro[a]; a++)\n\t\tmacronutrienti.children[ax].children[2].innerHTML = 0;\n\n\tfor(var b=0; b < fmv.length; b++ )\n\t\tvitMin.children[b].children[2].innerHTML = 0;\n\n\tfor(var c=0; c < alcol.length; c++ )\n\t\talimentiAlcol.children[c].innerHTML = 0;\n\n\tmacronutrienti.children[4].children[2].innerHTML = 0;\t\t\t\t// calorie\n\tmacronutrienti.children[4].children[2].style['background'] = '' ;\t// quando il totale supera il fabbisogno diventa rosso e allora ... \n}", "title": "" }, { "docid": "c8eb3f1cfe4d513da47ff70a8a3629fb", "score": "0.57896113", "text": "function ReSetNormalizeEVZ(){\n\tvar Inny1;\n\tvar Inny2;\n\tvar Inny3;\n\n\tInny1 = document.getElementById(\"ActualTESTxData\");\t\n\tInny1.innerHTML = \"Ha.&nbsp;&nbsp;Sure, Whatevz!\";\n\n\tInny2 = document.getElementById(\"ExpectingX\");\n\tInny2.textContent = \"\";\n\n\tInny3 = document.getElementById(\"DisplayRANDOMxData\");\n\tInny3.textContent = \"\";\n\n\t// GUI:\n\tHDxRandomHINTxUnicorns();\n\t\n}", "title": "" }, { "docid": "c39bfbc67c0b7e95acddbcf81e47925a", "score": "0.57729995", "text": "function coquinVide() { \n\tnewElement(\"Ta réponse est vide, petit coquin ! Essaye encore :\");\n}", "title": "" }, { "docid": "46a20d871d1259800eba0e9be5108723", "score": "0.57691616", "text": "function temVencedor() {\n return verificaLinha(0) || verificaLinha(1) || verificaLinha(2)\n || verificaColuna(0) || verificaColuna(1) || verificaColuna(2)\n || verificaDiagonais();\n }", "title": "" }, { "docid": "81a0713daf9e292fd68dc61455ba5cfb", "score": "0.57663536", "text": "function promedio() {\n var nota = est.getProm();\n\n alert (\"El promedio de notas es: \" + nota);\n}", "title": "" }, { "docid": "96c7edf2994c2c04ba0e792a54444cbe", "score": "0.57622045", "text": "function controlloVittoria()\n{\n\tif (mazziCompletati==8)\n\t{\n\t\tgestisciVincita();\n\t}\n}", "title": "" }, { "docid": "2c59d235cd8ac52c5a02ac49d811fdfc", "score": "0.5668735", "text": "function iniciacion()\n {\n valorDisplay = \"\";\n hayPunto = \"0\";\n ochoDigitos = \"\";\n }", "title": "" }, { "docid": "337bc3553642446d9c0e6bfa8c4df843", "score": "0.56684464", "text": "ukloni(){\r\n var that=this; //that zato sto sam prepisivao funkcije koje su bile pod window event listener-om\r\n var element=that.obelezeni_mal;\r\n var ind=that.nadjiMalind(element);\r\n var t=that.skupMal[ind].value;\r\n var p=that.skupMal[ind].pripadnost;\r\n var poz=that.skupMal[ind].pos;\r\n this.skupMal.splice(ind,1);\r\n\r\n element.remove();\r\n if(p==\"A\"){\r\n that.brojMalA=that.brojMalA+t;\r\n }\r\n else if(p==\"B\"){\r\n that.brojMalB=that.brojMalB+t;\r\n }\r\n\r\n if(that.auto_bodovi && poz>=29){\r\n if(p==\"A\"){\r\n that.dodaj(\"A\",t);\r\n }\r\n else if(p==\"B\"){\r\n that.dodaj(\"B\",t);\r\n }\r\n }\r\n that.nista();\r\n that.stampa();\r\n }", "title": "" }, { "docid": "a73a8f0ae27d466648f689ed9c465c9c", "score": "0.564074", "text": "function stProprieteCompo()\n{\n this.Action_en_cours=null;\n this.NewCle=null;\n}", "title": "" }, { "docid": "a73a8f0ae27d466648f689ed9c465c9c", "score": "0.564074", "text": "function stProprieteCompo()\n{\n this.Action_en_cours=null;\n this.NewCle=null;\n}", "title": "" }, { "docid": "0a611ab5d290aac19c91ffcf1dcb1232", "score": "0.559007", "text": "function final_equip_seleccionat(){\n app.jugador_seleccionat = app.equips.Visitants.jugadors[app.equips.Visitants.jugadors.length-1];\n}", "title": "" }, { "docid": "0863725ead5ed4cda6a0d2131dde3565", "score": "0.5581333", "text": "function verifEtatSolde( solde){\n if(parseInt(solde) > 0){\n return \"cediteur\";\n }\n if(parseInt(solde) < 0){\n return \"debiteur\";\n }\n if(parseInt(solde) == 0){\n return \"null\";\n }\n return \"VALLEUR NON NUMERIQUE\";\n \n }", "title": "" }, { "docid": "e11b0619e48f5e84557a844f0fca481b", "score": "0.5574316", "text": "function zeroenemi()\r\n{\r\ntypenemi = '';\r\nenemilife = '';\r\nenemimaxlife ='';\r\ndammagenemi = '';\r\neallergie = '';\r\nforceeallergie = 0;\r\ndocument.getElementById(\"disen\").innerHTML = '';\r\nshakefadin(\"caractere\");\r\n//document.getElementById(\"caractere\").style.visibility = 'hidden';\r\naffichenemi();\r\ndammageplayer = 0;\r\naffichplayer();\r\nmonster[casejoueur] = '';\r\n //la ou il y avait un monstre , il n'y en a plus.\r\ndocument.getElementById(\"enemi\").innerHTML = \"\";\r\n\r\n}", "title": "" }, { "docid": "4c2c96781f44c0f226c47908d3905d36", "score": "0.5560451", "text": "function kuvaTekst() {\n /*\n Markeerib ja kuvab teksti, seab caret ja väljastab silumiseks vastava teate konsoolile.\n */ \n var mTekst = markeeriTekst(t, kuvaKesktahtYhekordselt);\n $('#Tekst').html(mTekst);\n seaCaret(t.indexOf('|'));\n // Logimine\n if (logimistase > 0) {\n console.log('kuvaTekst: kuvan teksti: ' + moodustaTekstiStruktuurKonsoolile());\n }\n /* Uuenda täheloendurit */\n var tahti = kanoonilineKuju(t).length;\n var loenduritekst;\n if (tahti == 0) {\n loenduritekst = '&nbsp;&nbsp;&nbsp;'\n }\n else {\n loenduritekst = tahti.toString();\n }\n $('#Taheloendur').html(loenduritekst);\n}", "title": "" }, { "docid": "d498ff85fd6dd47780f2cedc47fdc103", "score": "0.55545545", "text": "function tilanne() {\n if ((pelaaja.itemOO == true) && ((vuoroL - pelaaja.kIvuoro) == 2)) {\n pelaaja.iKesto(pelaaja.iKaytossa);\n }\n \n if ((tietokone.hp <= 30) && (tietokone.hp > 1)) {\n tietokone.toiminto = 1;\n vuoroOO = false;\n } else {\n tietokone.toiminto = 0;\n vuoroOO = false;\n }\n\n if (tietokone.keraaVOO == false && ((tietokone.hp >= 90) && (tietokone.hp <= 100)) ||\n tietokone.keraaVOO == false && ((tietokone.hp >= 70) && (tietokone.hp <= 80))) {\n tietokone.toiminto = 3;\n vuoroOO = false;\n }\n\n if (pelaaja.hp < 1) {\n document.getElementById(\"pelaaja\").innerHTML = \"<b>PELAAJA hävisi.</b>\";\n document.getElementById(\"tietokone\").innerHTML = \"<b>TIETOKONE voitti.</b>\";\n document.getElementById(\"napit\").innerHTML = \"\";\n vuoroOO = false;\n }\n\n if (tietokone.hp < 1) {\n document.getElementById(\"pelaaja\").innerHTML = \"<b>PELAAJA voitti.</b>\";\n document.getElementById(\"tietokone\").innerHTML = \"<b>TIETOKONE hävisi.</b>\";\n document.getElementById(\"napit\").innerHTML = \"\";\n vuoroOO = false;\n }\n\n if ((vuoroL - tietokone.laskuriKV) == 3) {\n tietokone.keraaVOO = false;\n tietokone.attack = 7;\n sivulle(\"Tietokoneen voimat palasivat takaisin.\");\n tietokone.statit();\n }\n}", "title": "" }, { "docid": "30a69653bb1babfda216b202c6ada235", "score": "0.55537343", "text": "function initround(joueur) {\n balleH = 390;\n balleV = 290;\n vitesseH = (joueur == 1) ? -5 : 5;\n vitesseV = (Math.random() * 5) - 2;\n }", "title": "" }, { "docid": "4c836ad56639df9abf6873e9408d5f6d", "score": "0.55404735", "text": "function restauraValores() {\n\n}", "title": "" }, { "docid": "81dcfd4d467aa89e3459d2a40cff264b", "score": "0.5537709", "text": "function reset(meni) {\n // Looping za kroglice petice (v zgornji vrstici od desne proti levi)\n // x koordinate ne rabimo spreminjati. Spreminjamo le y, ki ga nastavimo isto kot pri generiranju sorobana\n for (var i = 1; i <= n; i++) {\n document.getElementById(10 * i + 5).setAttribute('cy', yUp);\n // Looping za kroglice enice (narise vse kroglice v spodnjih 4-ih vrsticah)\n for (var j = 1; j <= 4; j++) { \n document.getElementById(i * 10 + j).setAttribute('cy', yStart + (j - 1) * yDiff);\n }\n }\n\n // Izpise vrednost sorobana\n if (meni=='vaje') {\n document.getElementById(\"spanVrednostSorobana\").innerHTML = vrednostSorobana();\n }\n}", "title": "" }, { "docid": "fbd42bf85766897003fe0c7002f22c92", "score": "0.55228543", "text": "function pulisciENascondiTabellaProvvedimento(){\n var tabelleInDataTable =$.fn.dataTable.fnTables(true);\n var tabellaProvvedimento = $('#risultatiRicercaProvvedimento' + this.suffix);\n var tabelleDaIgnorare = $(tabelleInDataTable).not(tabellaProvvedimento);\n var arrayDaIgnorare = [];\n for(var i=0; i<tabelleDaIgnorare.size(); i++){\n arrayDaIgnorare.push(tabelleDaIgnorare.get(i));\n }\n cleanDataTables(arrayDaIgnorare);\n $('#tabellaProvvedimento' + this.suffix).slideUp();\n }", "title": "" }, { "docid": "9f3c9ba21eb41c5d455c7df693f3690f", "score": "0.5521223", "text": "function ConvertToCelsuis() {\n changeMeasurementUinit(\"C\");\n }", "title": "" }, { "docid": "40c207ef1847feb46aff392aa019032f", "score": "0.55079263", "text": "function enToVi(){\n //data array for translating\n var enCar = [\t'and','quadrillion','trillion','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen','twenty','thirty','forty','fifty','sixty','seventy','eighty','ninety','hundred','thousand','million','billion','zero','one','two','three','four','five','six','seven','eight','nine','ten'];\n var viCar = ['lẻ','triệu tỷ','nghìn tỷ','mười một','mười hai','mười ba','mười bốn','mười lăm','mười sáu','mười bảy','mười tám','mười chín','hai mươi','ba mươi','bốn mươi','năm mươi','sáu mươi','bảy mươi','tám mươi','chín mươi','trăm','1nghìn','triệu','tỷ','không','một','hai','ba','bốn','năm','sáu','bảy','tám','chín','mười'];\n //get en\n car = read.en.value;\n //translate from eng to vi\n for(var i=0;i<enCar.length;i++){\n var re = new RegExp(enCar[i], \"g\");\n car = car.replace(re,viCar[i]);\n }\n //now we got vi, then fix some exception\n car = car.replace(/mươi năm/g,'mươi lăm');\n car = car.replace(/mươi một/g,'mươi mốt');\n car = car.replace(/Because of interger\\'s limitation, 16 is the maximum decimals of number that this app support./g,'Vì giới hạn của kiểu dữ liệu số thực nên ứng dụng này chỉ hỗ trợ số có tối đa 16 kí tự.');\n car = car.replace(/thouslẻ/g,'nghìn');//something wrong so i have to use this to fix\n //set vi\n read.vi.value = car;\n}", "title": "" }, { "docid": "a1c223cd4abd24c9458ad824ea5c37ab", "score": "0.5503065", "text": "function Reconocimiento_por_Impacto(Etiqueta,Palabras,Velocidad_Inicial,Indice_Inicial,Cantidad_Inicial){\n //this.Palabras=Palabras;\n Dom=Etiqueta;\n Velocidad_Interna=Velocidad_Inicial;\n Indice=Indice_Inicial;\n Velocidad_Externa=1;\n Cantidad=Cantidad_Inicial;\n velocidad_standard=Velocidad_Inicial; \n tiempo_de_percepcion=(60/velocidad_standard)*1000;\n //alert(tiempo_de_percepcion);\n //clearTimeout(Controlador);\n}", "title": "" }, { "docid": "96a3b6213a3fc93ce9d42945c24f1389", "score": "0.5495522", "text": "precioDescuento(){\n this.precioDescuento = this.precio * 0.85;\n }", "title": "" }, { "docid": "00ea1f0b56da4cc34cddbe7f86f3db49", "score": "0.54851323", "text": "function vaciar () {\n jugada1 = \"\";\t\n jugada2 = \"\";\t\n identificadorJ1 = \"\";\n identificadorJ2 = \"\";\n}", "title": "" }, { "docid": "6072959a2464c310550bacab5f034662", "score": "0.54800785", "text": "function ntv_quan_tri_hien_thi_sua_thong_tin_lien_he(){\n\tdocument.getElementById('div_thong_tin_lien_he_da_duyet').style.display = 'none';\n\tdocument.getElementById('div_thong_tin_lien_he_cho_duyet').style.display = ''; \n\tntv_quan_tri_reset_ma_bao_mat('div_ma_chinh_lien_he');\n}", "title": "" }, { "docid": "0d9a270d14a6e4fc609b570c97ec055c", "score": "0.548001", "text": "function imprimirC3(v) {\n //console.log(v);\n var cad = TraduccionTP.getValue();\n for (var element of v) {\n if (element.tipo == \"C3D\") {\n cad += element.etiqueta + \" = \";\n if (element.opIzq != undefined) {\n cad += element.opIzq + \" \";\n }\n cad += element.operacion + \" \";\n if (element.opDer != undefined) {\n cad += element.opDer;\n }\n cad += \";\\n\";\n } else if (element.tipo == \"LLC3D\") {\n cad += element.id + \"( \" + element.etiqueta + \" );\\n\";\n } else if (element.tipo == \"LLC3DPOT\") {\n cad += element.id + \"(\" + \");\\n\";\n } else if (element.tipo == \"LLC3DMOD\") {\n cad +=\n element.etiqueta +\n \" = \" +\n element.id +\n \"(\" +\n element.base +\n \",\" +\n element.expo +\n \");\\n\";\n } else if (element.tipo == \"PRINT\") {\n if (element.tipoDato == \"DECIMAL\") {\n cad += 'printf(\"%f\", ';\n cad += element.val;\n cad += \");\\n\";\n } else {\n cad += 'printf(\"%f\", ';\n cad += element.val;\n cad += \");\\n\";\n }\n } else if (element.tipo == \"IF\") {\n cad +=\n \"if(\" +\n element.opIz +\n element.operacion +\n element.opDer +\n \") goto \" +\n element.label +\n \";\\n\";\n } else if (element.tipo == \"GOTO\") {\n cad += \"goto \" + element.label + \";\\n\";\n } else if (element.tipo == \"IFB\") {\n //IF CON ELEMENTOS DE UN SOLO VALOR\n cad += \"if(\" + element.val + \") goto \" + element.label + \";\\n\";\n } else if (element.tipo == \"ETIQUETA\") {\n if (Array.isArray(element.etiqueta)) {\n for (var e of element.etiqueta) {\n cad += e + \": \";\n }\n cad += \"\\n\";\n } else {\n cad += element.etiqueta + \": \\n\";\n }\n }\n }\n TraduccionTP.setValue(cad);\n}", "title": "" }, { "docid": "fa49fea509cb1c07aaf0ed87208a2eb9", "score": "0.5479783", "text": "function proinversionep(proy,com,dom,moneda,div){\n\n\n\t var enerotl=0;var febrerotl=0; var marzotl=0; var abriltl=0; var mayotl=0; var juniotl=0; var juliotl =0; var agostotl=0; var septiembretl=0; var octubretl =0; var noviembretl=0; var diciembretl =0; \n\t\n\n\t\t \tconsole.log(proy.length);\n\n\tfor (var i=0; i < proy.length ; i++) {\n\n\n\t\tif(proy[i]['iddom']== dom && proy[i]['iddivision']== div && proy[i]['idmoneda']==moneda){\n\n\t\t\t enerotl += parseFloat(proy[i]['enero'+com+'']);\n\t\t febrerotl += parseFloat(proy[i]['febrero'+com+'']); \n\t\t marzotl += parseFloat(proy[i]['marzo'+com+'']); \n\t\t abriltl += parseFloat(proy[i]['abril'+com+'']); \n\t\t mayotl += parseFloat(proy[i]['mayo'+com+'']); \n\t\t juniotl += parseFloat(proy[i]['junio'+com+'']); \n\t\t juliotl += parseFloat(proy[i]['julio'+com+'']); \n\t\t agostotl += parseFloat(proy[i]['agosto'+com+'']); \n\t\t septiembretl += parseFloat(proy[i]['septiembre'+com+'']); \n\t\t octubretl += parseFloat(proy[i]['octubre'+com+'']); \n\t\t noviembretl += parseFloat(proy[i]['noviembre'+com+'']); \n\t\t diciembretl += parseFloat(proy[i]['diciembre'+com+'']); \t\t\n\t\t}//fin if \n\t\n\t}//fin for \n\tvar labor = new Array(enerotl,febrerotl,marzotl,abriltl,mayotl,juniotl,juliotl,agostotl,septiembretl,octubretl,noviembretl,diciembretl);\n\treturn labor;\n\n\n}", "title": "" }, { "docid": "125cbadb196de1ddce2f8b76638912c7", "score": "0.5466385", "text": "function updateTablePtoVenta(valor){\n\n\t\tvar elemento = (-1);\n\t\tfor(i=0; i< detalle.length; i++){\n\t\t\tif(detalle[i][0]== valor){\n\t\t\t\telemento=i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(elemento != (-1)){\n\t\t\tvendedor = detalle[i][1];\n\t\t\tchangePcCveVendedor(vendedor[0]);\n\t\t\tchangePcNombreVendedor(vendedor[1]);\n\t\t\t//changePcCvePuesto(vendedor[2]);\n\t\t\tchangePcDescPuesto(vendedor[3]);\n\t\t\tchangePcFchAlta(vendedor[4]);\n\t\t\tchangePcFchBaja(vendedor[5]);\n\t\t\t//changePcDigVerif(vendedor[6]);\n\t\t\tchangePcCiudad(vendedor[7]);\n\t\t\tchangePcEstado(vendedor[8]);\n\t\t\tchangePcDireccion(vendedor[9]);\n\t\t\tchangePcColonia(vendedor[10]);\n\t\t\tchangePcCp(vendedor[11]);\n\t\t\tchangePcTel(vendedor[12]);\n\t\t\tchangePcFax(vendedor[13]);\n\t\t}else{\n\t\t\tchangePcCveVendedor(\"\");\n\t\t\tchangePcNombreVendedor(\"\");\n\t\t\t//changePcCvePuesto(\"\");\n\t\t\tchangePcDescPuesto(\"\");\n\t\t\tchangePcFchAlta(\"\");\n\t\t\tchangePcFchBaja(\"\");\n\t\t\t//changePcDigVerif(\"\");\n\t\t\tchangePcCiudad(\"\");\n\t\t\tchangePcEstado(\"\");\n\t\t\tchangePcDireccion(\"\");\n\t\t\tchangePcColonia(\"\");\n\t\t\tchangePcCp(\"\");\n\t\t\tchangePcTel(\"\");\n\t\t\tchangePcFax(\"\");\n\t\t}\n\t\tif( window.mmIsOpera ) (document.getElementById(\"Tienda\").style.visibility = 'hidden');\n\t\tif (document.all) (document.all.Tienda.style.visibility = 'hidden');\n\t\tif (document.getElementById) (document.getElementById(\"Tienda\").style.visibility = 'hidden');\n\t}", "title": "" }, { "docid": "c6ffdb72031eb93f9918a2d1111a8169", "score": "0.54625463", "text": "function entregaVariacion(){\r\n\tvar moneda_variacionValor = [];\r\n\r\n\r\n\t// obtiene variacion (valor absoluto) entre monedas anteriores y actuales, \r\n\tfor(i=0; i<moneda_valorAnterior.length; i++){\r\n\t\tmoneda_variacionValor[i] = \tMath.abs(moneda_valorAnterior[i] - moneda_valorActual[i]) ;\r\n }\r\n\r\n\r\n\t//saca variacion moneda anterior y actual, valor absoluto\r\n\tfor(i=0; i < moneda_valorAnterior.lenght;\ti++){\r\n\t\t//RESTA MONEDAS Y ENTREGA VALOR ABSOLUTO\r\n//\t\tmoneda_variacionValor[i] = \tMath.abs(moneda_valorAnterior[i] - moneda_valorActual[i]) ;\r\n }\r\n\r\n\r\n\r\n\t// compara monedas y entrega valor mas alto\r\n\tvar counter = 1;//parte en 1 pues debe comtarar1 con el anterior q es 0\r\n\tvar indexDelMasAlto\t= 0;\r\n\tvar devuelve;\r\n\t\r\n\tfor(counter; counter<moneda_variacionValor.length; counter++){\r\n\t\tif(moneda_variacionValor[indexDelMasAlto] < moneda_variacionValor[counter]) {\r\n\t\t\tindexDelMasAlto = counter;\r\n\t\t} \r\n\t\tdevuelve = indexDelMasAlto;\r\n\t}\r\n\r\n\treturn devuelve;\r\n}", "title": "" }, { "docid": "ab15d52057d346fc0e23c7c67a682467", "score": "0.5459747", "text": "function Nunu(){}", "title": "" }, { "docid": "2a5e376672c79c89c179d44069c0c020", "score": "0.54581225", "text": "function gatti_Restanti_Ultima_Fila(){\nlet gatti_Restanti_Ultima_Fila = (round_file_Risultante * num_Gatti_per_Fila) - num_Gatti;\nif(gatti_Restanti_Ultima_Fila === 0){\n return 'Tutte le file sono al completo.'\n}else{\n return `Nell'ultima fila sono ancora vacanti ${gatti_Restanti_Ultima_Fila} posti per completare la fila.`;\n}\n}", "title": "" }, { "docid": "a3986d76208a1c56b141224eb120bce2", "score": "0.5444974", "text": "function impostaValore(pasto){\n\n\tvar m=0, fmv=-4, a=-20;\n\tfor(var i in pasto){\n\t\tm += 1;\n\t\tfmv += 1; \n\t\ta += 1;\n\t\tif(i === 'carbo' || i === 'proteine' || i === 'grassi')\n\t\t\tmacronutrienti.children[m].children[2].innerHTML = pasto[i].toFixed(0);\n\t\tif(i==='fibre'||i==='sodio'||i==='potassio'||i==='calcio'||i ==='fosforo'||i==='magnesio' )\n\t\t\tvitMin.children[fmv].children[2].innerHTML = pasto[i].toFixed(0);\n\t\tif(i==='ferro'||i==='zinco'||i==='b1'||i==='b2'||i==='b3'||i==='a'||i==='c'||i==='e')\n\t\t\tvitMin.children[fmv].children[2].innerHTML = pasto[i].toFixed(2);\n\t\tif(i==='rame'||i==='selenio')\t\n\t\t\tvitMin.children[fmv].children[2].innerHTML = pasto[i].toFixed(3);\n\t\tif( i === 'birra' || i === 'vinoBianco' || i === 'vinoRosso'){\n\t\t\talimentiAlcol.children[a].innerHTML = pasto[i].toFixed(2);\n\t\t}\n\n//\t\tImpostazione delle calorie \n\t\tvar exValCarbo = macronutrienti.children[1].children[2].firstChild.nodeValue;\t\t\t\t// valore esistente 'carboidrati'\n\t\tvar exValProteine = macronutrienti.children[2].children[2].firstChild.nodeValue;\t\t\t// valore esistente 'proteine'\n\t\tvar exValGrassi = macronutrienti.children[3].children[2].firstChild.nodeValue;\t\t\t// valore esistente 'grassi'\n\t\tvar exValBirra = parseFloat(alimentiAlcol.children[0].firstChild.nodeValue);\n\t\tvar exValVinoBianco = parseFloat(alimentiAlcol.children[1].firstChild.nodeValue);\n\t\tvar exVaVinoRosso = parseFloat(alimentiAlcol.children[2].firstChild.nodeValue);\n\n\t\tvar calorieTotali = (exValGrassi*9) + (exValProteine*4) + (exValCarbo*4) + exValBirra + exValVinoBianco + exVaVinoRosso;\n\t\tmacronutrienti.children[4].children[2].innerHTML = calorieTotali.toFixed(0);\n\t\tallarmeRosso(calorieTotali, mieCalorie, macronutrienti.children[4].children[2]);\n\t}// for \n\n}// impostaValore", "title": "" }, { "docid": "d74e9b954d0f74e459c4cadfb6b1286a", "score": "0.5438055", "text": "zavrsenPotez(){\r\n if(this.blokadaMala && !this.blokadaZavrsenogPoteza){\r\n if(this.naPotezu==\"A\") this.naPotezu=\"B\";\r\n else this.naPotezu=\"A\";\r\n this.blokadaBacanja=false;\r\n this.prikaz=false;\r\n this.baceno=[];\r\n this.blokadaZavrsenogPoteza=true;\r\n this.obavestenje=\"\";\r\n }\r\n else{\r\n if(!this.blokadaMala) this.obavestenje=\"Igrač treba da odigra potez sa žetonom!\";\r\n else if(this.blokadaZavrsenogPoteza) this.obavestenje=\"Igrač mora da baci i onda da odigra potez sa žetonom!\";\r\n }\r\n this.stampa();\r\n }", "title": "" }, { "docid": "f09ae988a09c5c27e015af2559321f8a", "score": "0.54290396", "text": "function Exo_2_3()\r\n\t\t// DEBUT\r\n\t\t{\r\n\t\t\t// VARIABLE iPrixArticle, iNombreArticle, iTauxTVA, iTTC en NUMERIQUE\r\n\t\t\tvar iPrixArticle, iNombreArticle, iTauxTVA;\r\n\r\n\t\t\t// ECRIRE \"Entrez le prix de l'article en €\"\r\n\t\t\t// LIRE iPrixArticle\r\n\t\t\tiPrixArticle= prompt(\"Entrez le prix de l'article en €\");\r\n\r\n\t\t\t// ECRIRE \"Entrez le nombre d'article\"\r\n\t\t\t// LIRE iNombreArticle\r\n\t\t\tiNombreArticle= prompt(\"Entrez le nombre d'article\");\r\n\r\n\t\t\t// ECRIRE \"Entrez le montant de la TVA en %\"\r\n\t\t\t// LIRE iTauxTVA\r\n\t\t\tiTauxTVA= prompt(\"Entrez le montant de la TVA en %\");\r\n\r\n\t\t\t// iCarre= iNombreUtilisateur * iNombreUtilisateur\r\n\t\t\tiTTC= iPrixArticle * iNombreArticle * (1+ iTauxTVA/100 );\r\n\r\n\t\t\t// ECRIRE \"Le prix TTC est de \" + iTTC + \" €\"\r\n\t\t\talert(\"Le montant TTC est de \" + iTTC + \" €\");\r\n\r\n\t\t// FIN\r\n\t\t}", "title": "" }, { "docid": "9c6a4c597060c5904d3ffa5a9c2d8aee", "score": "0.5422184", "text": "function invertsinrevert () {\nlet oracion = window.prompt(\"¿Qué oración quieres voltear?\");\nlet palabravolteada = '';\nfor (let x = oracion.length - 1 ; x >= 0; x--){\n palabravolteada += oracion[x];\n }\n alert(\"Tu oración volteada es \" + palabravolteada)\n}", "title": "" }, { "docid": "76a59e7e4596f7852f994a0d120031b6", "score": "0.5419585", "text": "function verif(bouton){ \n if(ready){\n nbAffiche ++;\n let ligne = bouton.substr(0,1);\n let colonne = bouton.substr(2,1);\n //je veux que quand on clique sur un 0 a la place ce mette un numeroe\n tabJeu[ligne][colonne] = tabResultat[ligne][colonne] ;//tableau de reusltat afficher\n afficherTableau();\n if(nbAffiche > 1){\n ready = false;\n setTimeout(() =>{\n //verification\n if(tabJeu [ligne] [colonne] !== tabResultat[oldSelection[0]][oldSelection[1]]){\n tabJeu[ligne][colonne] = 0;\n //le 1er old c'est pour la ligne et le 2eme old c'esy pour la colonne\n tabJeu[oldSelection[0]][oldSelection[1]] = 0;\n }\n afficherTableau();\n ready = true;\n nbAffiche = 0;\n oldSelection = [ligne,colonne];\n //apres le temps qu'il faut qu'il attende...1000ms = 1s\n },500)\n \n }else{\n oldSelection = [ligne,colonne];\n }\n //le orecedent element selctionnes contiendra\n \n }\n}", "title": "" }, { "docid": "5a1a703be870b64e5eb258ac694b130e", "score": "0.54190993", "text": "function tigreSigueVivo(){\n\treturn vidaTigre > 0\n}", "title": "" }, { "docid": "4955e0b8565dacfea161bdc03ba25dd8", "score": "0.5415473", "text": "function tradicionViejuna(whatever) {\n switch (whatever) { case 1: return \"El Galán\"; break; case 2: return \"El Sol\"; break;case 3: return \"El Niño\"; break;case 4: return \"La Cama\"; break;case 5: return \"La Espina\"; break;case 6: return \"El Corazón\"; break;case 7: return \"La Pipa\"; break;case 8: return \"La Dama\"; break;case 9: return \"El Zapato\"; break;case 10: return \"La Rosa\"; break;case 11: return \"El Clavel\"; break;case 12: return \"Los Huesos\"; break;case 13: return \"La Mala Pata\"; break;case 14: return \"La Cerveza\"; break;case 15: return \"La Niña Bonita\"; break;case 16: return \"La Guitarra\"; break;case 17: return \"El Barco\"; break;case 18: return \"Los Ojos\"; break;case 19: return \"San José\"; break;case 20: return \"El Tío Del Queso\"; break;case 21: return \"La Primavera\"; break;case 22: return \"Los Patitos\"; break;case 23: return \"El Melón\"; break;case 24: return \"Nochebuena\"; break;case 25: return \"Navidad\"; break;case 26: return \"Los Pollos\"; break;case 27: return \"La Pajarera\"; break;case 28: return \"Alicante\"; break;case 29: return \"El Viaje\"; break;case 30: return \"El León\"; break;case 31: return \"Los Caballos\"; break;case 32: return \"La Bomba\"; break;case 33: return \"La Edad De Cristo\"; break;case 34: return \"El Garrote\"; break;case 35: return \"El Fuego\"; break;case 36: return \"La Sangre\"; break;case 37: return \"La Puñalá\"; break;case 38: return \"El Perro\"; break;case 39: return \"El Toro\"; break;case 40: return \"La Campana\"; break;case 41: return \"El Carbón\"; break;case 42: return \"La Estrella\"; break;case 43: return \"La Corona\"; break;case 44: return \"Los Tacones\"; break;case 45: return \"El Tambor\"; break;case 46: return \"El Sombrero\"; break;case 47: return \"El Mundo\"; break;case 48: return \"La Negra\"; break;case 49: return \"La Breva\"; break;case 50: return \"El Cartucho\"; break;case 51: return \"La Cabra\"; break;case 52: return \"El Tomate\"; break;case 53: return \"El Pimiento\"; break;case 54: return \"El Cólera\"; break;case 55: return \"Los Civiles\"; break;case 56: return \"La Lechuga\"; break;case 57: return \"La Zanahoria\"; break;case 58: return \"Los Limones\"; break;case 59: return \"El Canario\"; break;case 60: return \"La Abuela\"; break;case 61: return \"La Pipa\"; break;case 62: return \"El Piojo\"; break;case 63: return \"La Cebolla\"; break;case 64: return \"La Casa\"; break;case 65: return \"La Pelea\"; break;case 66: return \"Las Monjas\"; break;case 67: return \"El Cura-Fraile\"; break;case 68: return \"El Rosario\"; break;case 69: return \"La Postura\"; break;case 70: return \"El Albaricoque\"; break;case 71: return \"El Maestro\"; break;case 72: return \"El Higo\"; break;case 73: return \"El Conejo\"; break;case 74: return \"La Escalera\"; break;case 75: return \"El Gato\"; break;case 76: return \"El Agua\"; break;case 77: return \"Las Banderas\"; break;case 78: return \"La Cuchara\"; break; case 79: return \"El Cerdo\"; break;case 80: return \"La Lavandera\"; break;case 81: return \"El Matrimonio\"; break;case 82: return \"La Escupidera\"; break;case 83: return \"La Dama y El Niño\"; break;case 84: return \"El Casamiento\"; break;case 85: return \"La Palmera\"; break;case 86: return \"La Mierda\"; break;case 87: return \"El Pescado\"; break;case 88: return \"Las Preñadas\"; break;case 89: return \"Ls Gamba\"; break;case 90: return \"El Abuelo\"; break;case 91: return \"El Borracho\"; break;case 92: return \"Los Palomos\"; break;case 93: return \"La Revolución\"; break;case 94: return \"La Rata\"; break;case 95: return \"El Pavo\"; break;case 96: return \"El Paseo\"; break;case 97: return \"La Gallina\"; break;case 98: return \"El Borrego\"; break;case 99: return \"La Agonia\"; break; }\n }", "title": "" }, { "docid": "915bb5e5eb2e381f8b617ac553f67874", "score": "0.5415467", "text": "function Exo_2_4()\r\n\t\t// DEBUT\r\n\t\t{\r\n\t\t\t// Variables, sV1, sV2, sV3, sV4 en alphanumerique\r\n\t\t\tvar sV1, sV2, sV3, sV4;\r\n\t\t\tvar sV1 = \"belle Marquise\";\r\n\t\t\tvar sV2 = \"vos beaux yeux\"\r\n\t\t\tvar sV3 = \"me font\"\r\n\t\t\tvar sV4 = \"mourir d’amour\"\r\n\t\t\t//ECRIRE \"\"\r\n\t\t\talert ((sV1 + ' ' + sV2 + ' ' + sV4 + ' ' + sV3) + '\\n' + (sV2 + ' ' + sV3 + ' ' + sV1 + ' ' + sV4) + '\\n' + (sV3 + ' ' + sV4 + ' ' + sV2 + ' ' + sV1) + '\\n' + (sV4 + ' ' + sV1 + ' ' + sV3 + ' ' + sV2)) ;\r\n\t\t// FIN\r\n\t\t}", "title": "" }, { "docid": "54bde1a902abcb583cef0d590bcfad32", "score": "0.5412719", "text": "function ntd_quan_tri_gui_phan_hoi_1_ho_so_ung_vien(stt){\n\tvar tong_so_ung_vien = document.getElementById('tong_so_ho_so_ung_vien').value;\n\tntd_quan_tri_chon_tat_ca_ho_so_ung_vien(tong_so_ung_vien,false);\n\tdocument.getElementById('checkbox_ho_so_ung_vien['+stt+']').checked=true;\n\tntd_quan_tri_chon_1_ho_so_ung_vien(stt);\n\tntd_quan_tri_gui_phan_hoi_ds_ho_so_ung_vien();\n}", "title": "" }, { "docid": "3fb4a74072f4c0cdd793b978c7b6f203", "score": "0.54078233", "text": "esconder(){\n console.log(`${this._nombre} corre a ${this._velocidad} m/s y da un salto de ${this._salto} m. y se esconde`)\n }", "title": "" }, { "docid": "0cd319622de2c8f54b91d8a75991f639", "score": "0.5404323", "text": "function limpiar() {\n //codigo3D = [];\n temporal = 0;\n etiqueta = 0;\n}", "title": "" }, { "docid": "95f2855990f53f0ca8409225f7a9c464", "score": "0.54026216", "text": "function ntv_quan_tri_khong_hien_thi_sua_thong_tin_lien_he(){\n\tdocument.getElementById('div_thong_tin_lien_he_da_duyet').style.display = '';\n\tdocument.getElementById('div_thong_tin_lien_he_cho_duyet').style.display = 'none'; \n\tntv_quan_tri_reset_ma_bao_mat('div_ma_xac_minh');\n}", "title": "" }, { "docid": "ed8691658a326c0aeb27da71bd477dea", "score": "0.538735", "text": "function inversioneParola(parolaUtente) {\n var parolaInvertita = '';\n // La variabile i parte dalla fine della parolaUtente (il -1 serve perchè ricordiamo che il conteggio parte da 0 e non da 1) e continua il loop fino a quando non arriva al carattere 0 (il primo della parola inserita dall'utente) grazie al contatore i--\n for ( var i = parolaUtente.length - 1; i >= 0; i-- ) {\n parolaInvertita += parolaUtente[i];\n }\n // Indispensabile per portare il valore ottenuto fuori dalla funzione\n return parolaInvertita;\n}", "title": "" }, { "docid": "79cc8a2a8f749223020c7bcf07964c6e", "score": "0.53818554", "text": "function doLightAut() { // eslint-disable-line no-unused-vars\n //vypnut svela\n tx_msg.lit_aut = true\n //vykonaj\n cmd_set = true\n}", "title": "" }, { "docid": "b53930e4ddfd77e78e198d0fdb2eb85c", "score": "0.538132", "text": "function sledecePitanje(){\n moguciOdgovori++;\n ispisPitanja();\n kreiranjeOdgovora();\n}", "title": "" }, { "docid": "c468584ec499a3114b411813ad8e393e", "score": "0.53744817", "text": "function attaqueMonstre (defenseJoueur, pvJoueur){\n\tif (defenseJoueur.innerHTML > 0) {\n\t\tdefenseJoueur.innerHTML = defenseJoueur.innerHTML - 1\n\t\tpvJoueur.innerHTML = pvJoueur.innerHTML - 2\n\t\tif (pvJoueur.innerHTML < 1){\n\t\t\tmort()\n\t\t}\n\t} else {\n\t\tpvJoueur.innerHTML = pvJoueur.innerHTML - 5\n\t\tif (pvJoueur.innerHTML < 1){\n\t\t\tmort()\n\t\t}\n\t}\n//Fonction pour réactiver les boutons \n}", "title": "" }, { "docid": "ea86c071eef699068b15165f658bc8f7", "score": "0.5369265", "text": "decrire() {\n return `titulaire: ${this.titulaire}, solde: ${this.solde}`;\n }", "title": "" }, { "docid": "ef4614791af31a52c9e13000d4f914b3", "score": "0.5368966", "text": "irParaODiaAnterior() {\n const vm = this;\n // Não pode voltar dias anteriores à data de hoje\n if (this.dataAtual.getTime() <= new Date().getTime()) {\n return;\n }\n\n this.dataAtual = this.subtrairDias(this.dataAtual, 1);\n this.dataAtualString = this.dataAtual.parsePTBR();\n }", "title": "" }, { "docid": "c3544aea490cd2f0c2e8a16f9a39bf77", "score": "0.5367334", "text": "tetthet() {\n return this.masse / this.volum;\n }", "title": "" }, { "docid": "d2ad4fb30139b40f53de8ced86536ca3", "score": "0.536723", "text": "Prediksi() {\n this.Inferensi();\n return this.Defuzzyfikasi();\n }", "title": "" }, { "docid": "73f3db04129996adeacca516d65a3636", "score": "0.5366946", "text": "function reinicia_variaveis_cronometro(){\n pontos_lutador1 = 0;\n pontos_lutador2 = 0;\n adv_lutador1 = 0;\n adv_lutador2 = 0;\n pen_lutador1 = 0;\n pen_lutador2 = 0;\n}", "title": "" }, { "docid": "c983d64a075b289d012d01cbbd5ba786", "score": "0.5364879", "text": "function confereVitoria(){\n\t//Lógica com muito copy-paste, não é uma boa solução, trocar\n\t//Vitoria horizontal\n\tif((quadrados[0].textContent === quadrados[1].textContent) && (quadrados[1].textContent === quadrados[2].textContent)){\n\t\tvitoriaJogo(quadrados[0],quadrados[1],quadrados[2]);\n\t}else if((quadrados[3].textContent === quadrados[4].textContent) && (quadrados[4].textContent === quadrados[5].textContent)){\n\t\tvitoriaJogo(quadrados[3],quadrados[4],quadrados[5]);\n\t}else if((quadrados[6].textContent === quadrados[7].textContent) && (quadrados[7].textContent === quadrados[8].textContent)){\n\t\tvitoriaJogo(quadrados[6],quadrados[7],quadrados[8]);\n\t}\n\t//Vitoria vertical\n\telse if((quadrados[0].textContent === quadrados[3].textContent) && (quadrados[3].textContent === quadrados[6].textContent)){\n\t\tvitoriaJogo(quadrados[0],quadrados[3],quadrados[6]);\n\t}else if((quadrados[1].textContent === quadrados[4].textContent) && (quadrados[4].textContent === quadrados[7].textContent)){\n\t\tvitoriaJogo(quadrados[1],quadrados[4],quadrados[7]);\n\t}else if((quadrados[2].textContent === quadrados[5].textContent) && (quadrados[5].textContent === quadrados[8].textContent)){\n\t\tvitoriaJogo(quadrados[2],quadrados[5],quadrados[8]);\n\t}\n\t//Vitoria diagonal\n\telse if((quadrados[0].textContent === quadrados[4].textContent) && (quadrados[4].textContent === quadrados[8].textContent)){\n\t\tvitoriaJogo(quadrados[0],quadrados[4],quadrados[8]);\n\t}else if((quadrados[2].textContent === quadrados[4].textContent) && (quadrados[4].textContent === quadrados[6].textContent)){\n\t\tvitoriaJogo(quadrados[2],quadrados[4],quadrados[6]);\n\t}else if(jogadaAtual === 9){\n\t\tfimDeJogo = true;\n\t\talert('Empate');\n\t}\n}", "title": "" }, { "docid": "99e11611e2ece181c233bdd9e3877ece", "score": "0.5357922", "text": "decrire() {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "title": "" }, { "docid": "99e11611e2ece181c233bdd9e3877ece", "score": "0.5357922", "text": "decrire() {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "title": "" }, { "docid": "99e11611e2ece181c233bdd9e3877ece", "score": "0.5357922", "text": "decrire() {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "title": "" }, { "docid": "d2f802de41f4820709ba2ada0e73015e", "score": "0.5354984", "text": "function ntd_quan_tri_xoa_1_ho_so_ung_vien(stt){\n\tvar tong_so_ung_vien = document.getElementById('tong_so_ho_so_ung_vien').value;\n\tntd_quan_tri_chon_tat_ca_ho_so_ung_vien(tong_so_ung_vien,false);\n\tdocument.getElementById('checkbox_ho_so_ung_vien['+stt+']').checked=true;\n\tntd_quan_tri_chon_1_ho_so_ung_vien(stt);\n\tntd_quan_tri_xoa_ds_ho_so_ung_vien();\n}", "title": "" }, { "docid": "8a0dcabd62d0fd3ece99345e307826bb", "score": "0.53505707", "text": "racunanje(){\r\n let racun;\r\n const preth = parseFloat(this.prethodniOperator)\r\n const tren = parseFloat(this.trenutniOperator)\r\n if(isNaN(preth) || isNaN(tren)) return;\r\n /*IZRACUNATI 'RACUN' U ZAVISNOSTI OD ODABRANE OPERACIJE (THIS.OPERATION)*/ \r\n \r\n this.trenutniOperator=racun;\r\n this.operation=undefined;\r\n this.prethodniOperator='';\r\n \r\n }", "title": "" }, { "docid": "2adf8ed94f6ed279a83615c8177caccb", "score": "0.53482395", "text": "function ntv_quan_tri_reset_ds_viec_lam_da_ung_tuyen_thu_gon(id_viec_lam){\t\n\tv_url='/ajax/ntv_quan_tri_viec_lam_da_ung_tuyen/box_thong_ke/';\t\t\t\n\tAjaxAction('div_tk_viec_lam_da_ung_tuyen',v_url);\n\tv_url='/ajax/ntv_quan_tri_viec_lam_da_ung_tuyen_thu_gon/index?id_viec_lam='+id_viec_lam;\t\t\t\n\tAjaxAction('div_ds_viec_lam_da_ung_tuyen',v_url);\n\treturn false;\n}", "title": "" }, { "docid": "2c93a7b403844abdaebbc04accb17db5", "score": "0.53481406", "text": "tiraDadi(){\n var valoreDadi = []\n valoreDadi[0] = Math.random();\n valoreDadi[1] = Math.random();\n if(this.turniPrigione == 0){ //non sei in prigione\n cambiaPosizione(valoreDadi[0]+valoreDadi[1]);\n }else{ //sei in prigione\n if(valoreDadi[0] == valoreDadi[1]){ //dadi uguali => si esce di prigione\n cambiaPosizione(valoreDadi[0]);\n }else if(turniPrigione == 3){ //raggiunto il numero massimo di turni in prigione\n paga(\"Banca\", 125);\n cambiaPosizione(valoreDadi[0]+valoreDadi[1]);\n }else{ //aumenta il numero di turni attuali in prigione\n this.turniPrigione++;\n }\n }\n }", "title": "" }, { "docid": "8e86b3d469ff569e241317c77eb34379", "score": "0.5347202", "text": "function uu42744() { return 'ket'; }", "title": "" }, { "docid": "3cf3bb064316aa1ba887b7c49cfef622", "score": "0.5339907", "text": "decrire() {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "title": "" }, { "docid": "d0049744350f16d5f054ce263c8b3907", "score": "0.5339621", "text": "perditaPartita(){\n sessione.bancarottaGiocatore(this);\n }", "title": "" }, { "docid": "244588485e5149a83ba08fd2927df556", "score": "0.5334873", "text": "function brezPrijateljaSestevanje() {\n vmesniRezultat1Pravilno = false;\n vmesniRezultat2Pravilno = false;\n\n // Pocisti vsebino diva za racun\n $(\"#racunVaje\").empty();\n $(\"#stevilo1\").empty();\n $(\"#stevilo1\").css(\"color\", \"black\");\n $(\"#stevilo2\").empty();\n $(\"#stevilo2\").css(\"color\", \"black\");\n $(\"#stevilo3\").empty();\n $(\"#stevilo3\").css(\"color\", \"black\");\n $(\"#pravilnoNepravilno\").empty();\n\n // Pocisti soroban\n reset('vaje');\n\n // Izberemo 3 nakljucna stevila\n // Lahko je najvec ena 5-ka in najvec stiri 1-ke\n // Stevilo je i + v\n\n // Izbira prvega stevila\n // Za enico se omejimo le na stevili 1 in 2, da naslednji dve enici nista 0 \n var v1 = 0;\n var i1 = 0;\n // Math.random vrne stevilo nakljucno med 0 in 1\n // V polovici primerov petico postavimo na 5, sicer ostane 0 (kot bi metali kovanec)\n if (Math.random() < 0.5) {\n v1 = 5;\n i1 = izberiNakljucno(0, 2);\n }\n else {\n i1 = izberiNakljucno(1, 2);\n }\n\n var stevilo1 = i1 + v1;\n\n // Izbira drugega stevila\n // Omejimo enico i1+i2<=3, da i3 ne bo 0 \n\n var i2 = 0;\n var v2 = 0;\n\n // Ce v prvem stevilu ni bilo 5-ke\n if (v1 == 0) {\n if (Math.random() < 0.5) {\n v2 = 5;\n i2 = izberiNakljucno(0, 3 - i1);\n }\n else {\n i2 = izberiNakljucno(1, 3 - i1);\n }\n }\n else {\n i2 = izberiNakljucno(1, 3 - i1);\n }\n\n var stevilo2 = i2 + v2;\n\n // Izbira tretjega stevila\n // Omejimo enico i1+i2+i3<=4, ker so lahko maksimalno 4 1-ke\n\n\n var i3 = 0;\n var v3 = 0;\n\n // Ce v prvem in drugem stevilu ni bilo 5-ke\n if ((v1 == 0) && (v2 == 0)) {\n if (Math.random() < 0.5) {\n v3 = 5;\n i3 = izberiNakljucno(0, 4 - i1 - i2);\n }\n else {\n i3 = izberiNakljucno(1, 4 - i1 - i2);\n }\n }\n else { \n i3 = izberiNakljucno(1, 4 - i1 - i2);\n }\n\n var stevilo3 = i3 + v3;\n var sestevek = stevilo1 + stevilo2 + stevilo3;\n \n // Vstavi izracun v div\n $(\"#racunVaje\").append(\"<div><b>Izračunaj:</b></div>\");\n $(\"#racunVaje\").append(\"<div id='stevilo1'>\" + stevilo1 + \"</div>\");\n $(\"#racunVaje\").append(\"<div id='stevilo2'>\" + stevilo2 + \"</div>\");\n $(\"#racunVaje\").append(\"<div id='stevilo3'>\" + stevilo3 + \"</div>\");\n $(\"#racunVaje\").append(\"<div id='pravilnoNepravilno'></div>\");\n var racunVajeString = \"<button type='button' class='btn btn-default' onclick = 'brezPrijateljaSestevanje()'>Naslednji</button >\";\n $(\"#racunVaje\").append(racunVajeString);\n $(\"#napisVrednostSorobana\").show();\n/*\n $(\"#stevilo1\").append(stevilo1);\n $(\"#stevilo2\").append(stevilo2);\n $(\"#stevilo3\").append(stevilo3);\n $(\"#gumbPreveri\").attr({ \"onclick\": \"brezPrijateljaSestevanje()\" });\n*/\n // Mozno tudi z jquery click\n}", "title": "" }, { "docid": "66bc5f528d71cccdbd72a7cd6d02fcfc", "score": "0.53298056", "text": "function ntv_quan_tri_reset_ds_viec_lam_da_luu_thu_gon(id_viec_lam){\t\n\tv_url='/ajax/ntv_quan_tri_thong_ke_viec_lam_da_luu/index/';\t\t\t\n\tAjaxAction('div_tk_viec_lam_da_luu',v_url);\n\tv_url='/ajax/ntv_quan_tri_viec_lam_da_luu_thu_gon/index?id_viec_lam='+id_viec_lam;\t\t\t\n\tAjaxAction('div_ds_viec_lam_da_luu',v_url);\n\treturn false;\n}", "title": "" }, { "docid": "16781b96a950b2194d8392cf35654eda", "score": "0.5319531", "text": "function setCodeTableEntry3() {\n for (var i = 0; i < $rootScope.languages.length; i++) {\n if ($rootScope.languages[i].DESCRIZIONE == $rootScope.userData.MADRELINGUA) {\n $scope.mothertongueTraduttore = $rootScope.languages[i];\n }\n }\n }", "title": "" }, { "docid": "cf86509d96141328694485b603f59db7", "score": "0.5314859", "text": "function Avainsanateksti (sanaIndeksi, todennakoisyys, suurinTn)\n{\n this.sanaIndeksi = sanaIndeksi;\n // kerroin on vähintään 0.2\n this.kirjainkokoKerroin = max (todennakoisyys / suurinTn, .2);\n this.x = 0;\n this.y = 0;\n \n this.asetaPaikka = function (x, y)\n {\n this.x = x;\n this.y = y;\n };\n \n this.piirra = function (ikkunaLeveys, ikkunaKorkeus,\n ikkunaX, ikkunaY,\n suurinKirjainkoko)\n {\n var kirjainKoko = suurinKirjainkoko * this.kirjainkokoKerroin\n var x = ikkunaX + .5 * ikkunaLeveys + suurinKirjainkoko * this.x;\n var y = ikkunaY + .5 * ikkunaKorkeus + suurinKirjainkoko * this.y;\n if (x < windowWidth\n && y - kirjainKoko / 2 >= 0\n && y + kirjainKoko / 2 <= windowHeight)\n {\n textSize (kirjainKoko);\n textAlign (CENTER, CENTER);\n text (avainsanat [sanaIndeksi], x, y);\n }\n };\n\n // mikä tulisi kirjainkooksi tällä avainsanatekstillä?\n this.kirjainkoko = function (ikkunaLeveys, maxKirjainkoko)\n {\n textSize (maxKirjainkoko);\n var testiLeveys = textWidth (avainsanat [sanaIndeksi]);\n var ehdotettuKoko = ikkunaLeveys / testiLeveys * maxKirjainkoko * .9;\n return (min (ehdotettuKoko, maxKirjainkoko));\n }\n}", "title": "" }, { "docid": "6a2a0056d40ae15fd5ea512dfb7ca5ed", "score": "0.53139734", "text": "function etatPanier (){\n let etat;\n if(panierPeluches.length >= 1){\n etat = titreEtatPanier.textContent=\"Résumé du panier \"+ total/100 +\"€\";\n }else{\n etat = titreEtatPanier.textContent= \"Votre panier est vide\";\n }\n}", "title": "" }, { "docid": "0d8960f9220a3568a25052fb146b276b", "score": "0.5311176", "text": "function desactiveCoeur(main, desactive) {\n\tfor (var i=0; i<main.length; i++) {\n\t\tif (main[i].genre == \"Coeur\")\n\t\t\tmain[i].valide = !desactive;\n\t}\n}", "title": "" }, { "docid": "5c4f74189026696f0e2504690fcfb766", "score": "0.5310616", "text": "function ver(litros, kilometr) {\n let litros_t = 0;\n // litros.forEach(function (valor) {\n for (var i = INIT; i < litros.length; i++) {\n litros_t += parseFloat(litros[i]);\n }\n init_k = kilometr[INIT - 1];\n console.log(\"Kms. since: \" + init_k);\n const distancia = kilometr[kilometr.length - 1] - init_k;\n console.log(`La distancia es: ${distancia}`);\n }", "title": "" }, { "docid": "8fbf47edde76372f81fedc750ac9076c", "score": "0.5308166", "text": "function cambiarmodo() {\n if (trivia == 1) { trivia = 0 }\n else if (trivia == 0) { trivia = 1 }\n }", "title": "" }, { "docid": "7a2c4b080b7151af6e85ceab54cf5fe0", "score": "0.5304942", "text": "function resetearpantalla(){\n secuencia = [];\n indice = 0;\n pulsverde.style.cssText = verdeapagado;\n pulsrojo.style.cssText = rojoapagado;\n pulsamarillo.style.cssText = amarilloapagado;\n pulsnaranja.style.cssText = naranjaapagado;\n pulsblanco.style.cssText = blancoapagado;\n pulsazul.style.cssText = azulapagado;\n \n salida.innerHTML = 'NIVEL ' + nivel;\n puntos.innerHTML ='Puntos: ' + puntuaje;\n\n }", "title": "" }, { "docid": "1e3c9c33802b96b30324adfbfc8fd026", "score": "0.52979946", "text": "function sugeneruokSkaiciuNuo10iki100() {\n var atsitiktinisSkaicius = Math.random();\n atsitiktinisSkaicius = atsitiktinisSkaicius * 90 + 10;\n // =* same\n atsitiktinisSkaicius = Math.round( atsitiktinisSkaicius);\n // console.log(\"atsitiktinis: \", atsitiktinisSkaicius);\n return atsitiktinisSkaicius; //coppy\n }", "title": "" }, { "docid": "99ec5888afac2b9cbb6f8289b6343601", "score": "0.52963424", "text": "function ntv_quan_tri_gia_han_1_ttv(id_ntv,id_ttv){\n\tvar id = 'gia_han_' + id_ttv;\n\tvar so_luot_con = document.getElementById(id).value;\n\tif( so_luot_con<=0 ){\n\t\talert('Tin tìm việc đã hết số lượt gia hạn!');\n\t\tdat_trang_thai_xu_ly_xong();\n\t\treturn;\n\t}\n\tntv_quan_tri_show_box_popup_gia_han(id_ntv,id_ttv);\n}", "title": "" }, { "docid": "fa9623b46be36e4d1cabcb8f72d103bd", "score": "0.5292608", "text": "function extraerNodoP() {\n\tvar nuevo = this.raiz;\n\tif (!this.vacia()) {\n\t\tthis.raiz = this.raiz.sig;\n\t}\n\treturn nuevo;\n}", "title": "" }, { "docid": "27727707d980a3bcc1080f6fdcad093e", "score": "0.5287727", "text": "function verPrecios() {\n\tprecioSuma += precioItem.value * unidadesItem.value;\n\tprecioTotal.value = precioSuma + \" €\";\n}", "title": "" }, { "docid": "f5c538d25f1302c978bef76bedf0e805", "score": "0.5279465", "text": "function NotaFinal() {\n\n pregunta1();\n cor =\n parseFloat(tpre1);\n Calculo_nota();\n}", "title": "" }, { "docid": "c1e001e8a19ecaecf64f13136789b749", "score": "0.5277283", "text": "function preencheDados() {\n\n}", "title": "" }, { "docid": "8c443988a881f52c2d1999705d6739e3", "score": "0.5273944", "text": "function Reikna(){\n\tvar ManadarLaun = document.getElementById(\"b_laun\").value;\n\tManadarLaun = Number(ManadarLaun);\n\tvar Personuafslattur = document.getElementById(\"b_fradrattur\").value;\n\tPersonuafslattur = Number(Personuafslattur);\n\tvar Skattskillt = ManadarLaun;\n\tvar SkilaBreyta = SkattUtreikningur(Skattskillt,Personuafslattur);\n\tSkilaBreyta = Math.ceil(SkilaBreyta);\n\t//SkilaBreyta = SkilaBreyta;\n\tBorgad = ManadarLaun - SkilaBreyta;\n\tdocument.getElementById(\"output_borgadur_skattur\").innerHTML = \"Greytt i skatt: \" + Borgad;\n\tdocument.getElementById(\"output_utborgad\").innerHTML = \"Utborgud laun: \" + SkilaBreyta;\n\t\n\treturn false;\n}", "title": "" }, { "docid": "0bf787a00a27fd15fdc3835fe97d12eb", "score": "0.5273095", "text": "function setMovChariot(parm) {\n parcoursAxePlateau[0] = parm;\n parcoursPeigneAccu[0] = parm;\n parcoursPeigneCompteur[0] = parm;\n parcoursPignonAccu[0] = parm;\n parcoursPignonCompteur[0] = parm;\n}", "title": "" }, { "docid": "b206a950e1b7e416bc877984f0f5585c", "score": "0.5268596", "text": "function totaal() {\r\n\ttotaalprijs = prijsfris + prijswijn + prijsbier + prijsbittersmall + prijsbitterbig;\r\n\t\tif (wijn >= 1) {\r\n\t\t\tdocument.write(wijn + ' wijn = €' + prijswijn + '<br>');\r\n\t\t}\r\n\t\t\tif (fris >= 1) {\r\n\t\t\t\tdocument.write(fris + ' fris = €' + prijsfris + '<br>');\r\n\t\t\t}\r\n\t\t\t\tif (bier >= 1) {\r\n\t\t\t\t\tdocument.write(bier + ' bier = €' + prijsbier + '<br>');\r\n\t\t\t\t}\r\n\t\t\t\t\tif (bittersmall >= 1) {\r\n\t\t\t\t\t\tdocument.write(bittersmall + 'x bitterbalschaal (8stuks) = €' + prijsbittersmall + '<br>');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\tif (bitterbig >= 1) {\r\n\t\t\t\t\t\t\tdocument.write(bitterbig + 'x bitterbalschaal (16stuks) = €' + prijsbitterbig + '<br>');\r\n\t\t\t\t\t\t}\r\n}", "title": "" }, { "docid": "049644266565e5b4d81cdbf3d3c148c9", "score": "0.52667916", "text": "function mulai() {\n selesai = false;\n skor = 0;\n papanSkor.textContent = 0;\n\n munculkanTikus();\n setTimeout(() => {\n selesai = true;\n }, 10000);\n}", "title": "" }, { "docid": "b1b91e3396915be260c986c46efa7387", "score": "0.52642226", "text": "function verificoRes(){\n var idt=$(this).attr('id').charAt(2);\n $('#lb'+idt).remove();\n uniIn=$('#spui'+idt).text();\n uniOut=$('#spuo'+idt).text();\n var numPro=parseFloat($('#spn'+idt).text());\n var vaUni1=auxConv(uniIn);\n var vaUni2=auxConv(uniOut);\n factConv=vaUni1/vaUni2;\n var result=numPro*factConv;\n var numIng=$('#'+'tx'+idt).val();\n if(!isNaN(numIng)){\n numIng=parseFloat(numIng);\n if((1/numIng)*result<1.0000000001&&(1/numIng)*result>0.9999999999){\n correcto1(idt);\n }else{\n incorrecto1(idt);\n $('#p'+idt).click(mostrarAyuda);\n }\n }else{\n alert('¡No ingresó el resultado!');\n }\n }", "title": "" }, { "docid": "45fecd99f148dc0f80d1aee0103457f8", "score": "0.5262069", "text": "descrever(){\n console.log(\"A palavra \" + this.letras + \"tem\" + this.contaVogais() + \"vogais, e \" + this.contaLetras() + \"letras\");\n }", "title": "" }, { "docid": "6bf9e5007a8b3b53eaca3becd24f6d21", "score": "0.525116", "text": "function calcolaValori (){\n\n\tvar numDivPasto = document.querySelectorAll('div.divPasto').length;\n\tvar grammi, totProp;\n\tvar sCarbo = 0, sProteine = 0, sGrassi = 0;\t\t\t\t\t\t\t\t// per la Visualizzazione del messaggio nutrienti scelti \n\n\tvar seletsGrammi = document.querySelectorAll('select.porzioneGrammi');\t\t\t\n\tfor(var i=0, seletta; seletta= seletsGrammi[i]; i++) { \t\t\t\t\t\t\t\n\t\tseletta.addEventListener('change', function (e) {\n\t\t\tmemDieta.style.display = 'block';\t\t\t\t\t\t// <div id=\"memorizzaDieta\"></div> \n\t\t\tio = e.target;\n\t\t\tgrammi = io.value;\n\t\t\tvar spanValoriNutrienti = io.parentNode;\t\t\t\t\t// lo <span class=\"valori-nutrienti\">\n\t\t\tvar attributi = spanValoriNutrienti.attributes;\n\n\t\t\tfor(var x=0, z, w=0; x < attributi.length; x++){\t\t\t\t// proteine (il primo nutriente) è il secondo attributo \n\t\t\t\tz = attributi[x].nodeName;\n\t\t\t\tw = parseFloat(attributi[x].nodeValue);\n\t\t\t\tif(z.charAt(0) === 'm'){\t\t\t// estrazione attributi (valori di base) che hanno come prima lettera 'm' (mproteine, mgrassi ...)\n\t\t\t\t\ttotProp = w * grammi / 100;\t\n\t\t\t\t\tvar pat = 'z' + z;\t\t\t\t// pattern per i nuovi attributi (\"zmproteine\", \"zmgrassi\" ...)\t\n\t\t\t\t\tspanValoriNutrienti.setAttribute(pat, totProp); \t\t// Ora lo <span> contiene altri attributi che contengono i nutrienti totali ottenuti moltiplicando i valori di base per i grammi\n\n\t\t\t\t\tif(z === 'mcarbo') sCarbo = totProp;\n\t\t\t\t\tif(z === 'mproteine') sProteine = totProp;\n\t\t\t\t\tif(z === 'mgrassi') sGrassi = totProp;\n\t\t\t\t\tsetTimeout(\"showSuggerimento('Carboidrati: \"+sCarbo+\" - Proteine: \"+sProteine+\" - Grassi: \"+sGrassi+\"',4000)\", 100);\t\t\t\t\t\n\t\t\t\t}\t\n\t\t\t}\t\t\t\n\n\t\t\tshowRisultati();\n\n\t\t},false);\n\t}// for \n\n} // calcolaValori();", "title": "" }, { "docid": "42c241f4cd0faa3ce9dde2d5744a26fd", "score": "0.52489704", "text": "function getVerse() {\n var index = elements.verse.value - 1;\n var verse = chapterXml.getElementsByTagName('verse')[index];\n // Set the scope based on the verse ID.\n accentInterpretation.setAccents(verse.getAttribute('osisID'));\n clearNodes(elements.display);\n elements.display.appendChild(markupVerse(verse));\n }", "title": "" }, { "docid": "6e3dbb602480c922a2801c61e8191a92", "score": "0.52429354", "text": "function ex_11_I(vett){\r\n\treturn dispar(vett);\r\n}", "title": "" }, { "docid": "d5ffdc3aec120077c137ca35611227b3", "score": "0.52414554", "text": "function nV(a,b){this.af=[];this.Lea=a;this.Vda=b||null;this.rL=this.xE=!1;this.ht=void 0;this.i4=this.Ara=this.A3=!1;this.nU=0;this.Xd=null;this.w3=0}", "title": "" }, { "docid": "c236c1dab5070161df5be85f379649c3", "score": "0.5231115", "text": "function nouveau_combat(){\r\n\r\n\r\nvar donnees = {\r\n saison:0, // 0:saison 1/1:saison 2\r\n a:{\r\n statut:1, // 1:joueur/0:PNJ\r\n dolmens:0,\r\n cri_de_guerre:0,\r\n inspiration:0,\r\n heros:0, // 1:heros present\r\n niveau:1,\r\n faction:0,\r\n archetype:0,\r\n artefacts:[0,0,0,0,0,0,0,0],\r\n tacticien:0,\r\n ecuyer:0,\r\n tireur_elite:0,\r\n commandant_infanterie:0,\r\n logisticien:0,\r\n harangueur:0,\r\n sapeur:0,\r\n massacreur:0,\r\n instinct:[0,0,0,0],\r\n expert:[0,0,0,0],\r\n arcanes:0,\r\n bonus_ecole:[0,0,0,0],\r\n larmes:0,\r\n sort:[ {id:-1, tour:1}, {id:-1, tour:2} ],\r\n troupes:[ {}, {unite:255,nombre:0}, {unite:255,nombre:0}, {unite:255,nombre:0}, {unite:255,nombre:0}, {unite:255,nombre:0}, {unite:255,nombre:0}, {unite:255,nombre:0} ],\r\n mhr:{signe:0, valeur:0},\r\n butin_de_guerre:0,\r\n relever_les_morts:0,\r\n resistance_magique:0,\r\n moral_eleve:0,\r\n resurrection:0,\r\n tir_de_barrage:0,\r\n heros_superieur:0,\r\n maitrise_des_sorts:0,\r\n revelation_de_caracteristiques:0,\r\n classement_voies:0\r\n },\r\n d:{\r\n statut:0, // 1:joueur/0:PNJ\r\n lieu:0, // 1:cite/2:region/3:halte\r\n fortification:0, // 1:fortin/2:citadelle/3:chateau\r\n forts:0,\r\n fort_principal:0,\r\n dolmens:0,\r\n ralliement:0,\r\n inspiration:0,\r\n heros:0,\r\n niveau:1,\r\n faction:0,\r\n archetype:0,\r\n artefacts:[0,0,0,0,0,0,0,0],\r\n tacticien_defenseur:0,\r\n ecuyer_defenseur:0,\r\n expert_tirs_barrage:0,\r\n inebranlable:0,\r\n logisticien:0,\r\n bon_payeur:0,\r\n batisseur_fortifications:0,\r\n massacreur:0,\r\n instinct:[0,0,0,0],\r\n expert:[0,0,0,0],\r\n arcanes:0,\r\n bonus_ecole:[0,0,0,0],\r\n larmes:0,\r\n sort:[ {id:-1, tour:1}, {id:-1, tour:2} ],\r\n troupes:[ {}, {unite:255,nombre:0}, {unite:255,nombre:0}, {unite:255,nombre:0}, {unite:255,nombre:0}, {unite:255,nombre:0}, {unite:255,nombre:0}, {unite:255,nombre:0} ],\r\n mhr:{signe:0, valeur:0},\r\n butin_de_guerre:0,\r\n relever_les_morts:0,\r\n resistance_magique:0,\r\n moral_eleve:0,\r\n resurrection:0,\r\n tir_de_barrage:0,\r\n\r\n heros_superieur:0,\r\n maitrise_des_sorts:0,\r\n revelation_de_caracteristiques:0,\r\n classement_voies:0\r\n }\r\n};\r\n \r\n \r\n\r\n return donnees;\r\n}", "title": "" }, { "docid": "66c916b0b3b097839e3a173e53638efb", "score": "0.5230493", "text": "function cambiaJugador(){\n if(jugador != \"ultimo\"){\n if(jugador == \"rojo\"){\n jugador = \"azul\";\n }\n else{\n jugador = \"rojo\";\n }\n }\n }", "title": "" }, { "docid": "8cc32dbc7b469a39116cc42bc0e5f147", "score": "0.5230057", "text": "function liczbyUlamki(){\n calkowite = false;\n}", "title": "" }, { "docid": "a8718559303d10298ace1e86d5e737e4", "score": "0.5227955", "text": "function dc_v(seguidores) {\r\n\r\n if (!(simbolo in Primeiros[\"dc_v\"]) && !(simbolo in Seguidores[\"dc_v\"]) && !(simbolo in seguidores)) {\r\n error(\"Esperado 'var', 'procedimento' ou 'inicio' mas encontrado '\" + cadeia + \"'\");\r\n varre(join(Primeiros[\"dc_v\"], Seguidores[\"dc_v\"], seguidores));\r\n }\r\n\r\n while (simbolo == \"var\") {\r\n obterSimbolo();\r\n\r\n // CORTE TRANSVERSAL PARA ANALISADOR SEMANTICO\r\n if (analisadorSemantico) {\r\n // sinaliza ao analisador que um bloco de\r\n // declaração de variáveis está sendo iniciado\r\n analisadorSemantico.iniciarDeclaracao();\r\n } // FIM DO CORTE PARA ANALISADOR SEMANTICO\r\n\r\n\r\n // Chama a regra \"variáveis\"\r\n variaveis(join(Seguidores[\"dc_v\"], seguidores, \":\", \"real\", \"inteiro\"));\r\n\r\n\r\n if (simbolo != \":\") {\r\n error(\"Esperado ':' mas encontrado '\" + cadeia + \"'\");\r\n varre(join(Seguidores[\"dc_v\"], \":\", \"real\", \"inteiro\", \";\", seguidores));\r\n }\r\n if (simbolo == \":\") {\r\n obterSimbolo();\r\n }\r\n\r\n if (simbolo != \"real\" && simbolo != \"inteiro\") {\r\n error(\"Esperado tipo de variavel (real ou inteiro) mas encontrado '\" + cadeia + \"'\");\r\n varre(join(Seguidores[\"dc_v\"], \"real\", \"inteiro\", \";\", seguidores));\r\n\r\n }\r\n if (simbolo == \"real\" || simbolo == \"inteiro\") {\r\n\r\n // CORTE TRANSVERSAL PARA ANALISADOR SEMANTICO\r\n if (analisadorSemantico) {\r\n analisadorSemantico.inserir({\"tipo\":simbolo});\r\n if (gerador) {\r\n gerador.iniciarDeclaracao(simbolo);\r\n }\r\n } // FIM DO CORTE PARA ANALISADOR SEMANTICO\r\n\r\n obterSimbolo();\r\n }\r\n\r\n if (simbolo != \";\") {\r\n error(\"Esperado ';' mas encontrado '\" + cadeia + \"'\");\r\n varre(join(Primeiros[\"dc_v\"], Seguidores[\"dc_v\"], \";\", seguidores));\r\n }\r\n if (simbolo == \";\") {\r\n obterSimbolo();\r\n }\r\n\r\n if (!(simbolo in Primeiros[\"dc_v\"]) && !(simbolo in Seguidores[\"dc_v\"]) && !(simbolo in seguidores)) {\r\n error(\"Esperado 'var', 'procedimento' ou 'inicio' mas encontrado '\" + cadeia + \"'\");\r\n varre(join(Primeiros[\"dc_v\"], Seguidores[\"dc_v\"], seguidores));\r\n }\r\n\r\n }\r\n }", "title": "" }, { "docid": "3bdc917baaba21f0110528827904aa23", "score": "0.52265173", "text": "function potong (kalimatTerbilang) {\n\t\tvar results = kalimatTerbilang.split(' ')\n\n\t\t// periksa jika ada kalimat belas\n\t\tvar indexBelas = results.indexOf('belas')\n\n\t\twhile (indexBelas > -1) { // jika ketemu\n\t\t\t// ubah kata belas menjadi satu angka sebelumnya\n\t\t\t// lalu angka sebelumnya diubah menjadi satu\n\n\t\t\t// contoh -> sembilan belas -> jadi -> satu sembilan\n\n\t\t\tresults[indexBelas] = results[indexBelas-1];\n\t\t\tresults[indexBelas-1] = 'satu'\n\n\t\t\t// periksa lagi apakah ada kata belas lainnya pada inputan\n\t\t\tindexBelas = results.indexOf('belas')\n\t\t}\n\n\t\treturn ubahKataSpesialMenjadiNol(results)\n\t}", "title": "" }, { "docid": "57f8c7e6e29d612eb265de83ade82670", "score": "0.52264595", "text": "static soma(vetores) {\n\t\tlet versaoUnitario,\n \t\t\tcompIFinal = 0,\n \t compJFinal = 0,\n \t compKFinal = 0,\n significativos = [];\n\t\tfor (let vet of vetores) {\n\t\t\tversaoUnitario = this.convertePadraoUnit(vet);\n significativos.push(vet.significativos);\n\t\t\tif (vet.isSubtracao) {\n\t\t\t\tversaoUnitario.inverterValores();\n\t\t\t}\n\t\t\tcompIFinal += versaoUnitario.i;\n\t\t\tcompJFinal += versaoUnitario.j;\n\t\t\tcompKFinal += versaoUnitario.k;\n\t\t}\n //Descobre menor numero de sig. entre os vetores\n significativos = Math.min(...significativos);\n\t\tlet vetResultante = this.converteUnitPadrao( new VetorUnitario(compIFinal, compJFinal, compKFinal));\n vetResultante.significativos = significativos;\n\t\treturn vetResultante;\n }", "title": "" }, { "docid": "a9e952ed154cda7ecce75aebbdffe745", "score": "0.5223011", "text": "function _VezesEspecial(especial) {\n var especial_tabela = tabelas_especiais[especial];\n var valor = 0;\n if ('vezes' in especial_tabela) {\n var valor = especial_tabela.vezes.fixo || 0;\n if ('nivel' in especial_tabela.vezes) {\n valor += PersonagemNivelClasse(especial_tabela.vezes.nivel);\n }\n if ('atributo' in especial_tabela.vezes) {\n valor += gPersonagem.atributos[especial_tabela.vezes.atributo].modificador;\n }\n if ('talento' in especial_tabela.vezes && PersonagemPossuiTalento(especial_tabela.vezes.talento.chave)) {\n valor += especial_tabela.vezes.talento.fixo;\n }\n }\n return valor;\n}", "title": "" }, { "docid": "0f96ed98cb7b3a32101ec81a299680e5", "score": "0.52205753", "text": "lagring() {\n kundeLagring = this.kunde;\n utleiedataLagring = this.utleiedata;\n }", "title": "" }, { "docid": "ae57a96e970671a1fb338bc94c61b3a7", "score": "0.5218236", "text": "limite()\n {\n //Colision raquette\n if(this.bas > terrain.hauteur)\n {\n this.bas = terrain.hauteur;\n }\n\n if (this.haut < 0)\n {\n this.haut = 0;\n }\n }", "title": "" } ]
a94165361841ea3de51f557bc742247c
Reset the scheduler's state.
[ { "docid": "bc17b279dbd9853b8b9ceeeefb7de395", "score": "0.0", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (true) {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" } ]
[ { "docid": "ff96db21119093b604802791b74bf14b", "score": "0.8352197", "text": "function resetSchedulerState () {\n queue.length = 0;\n has$1 = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "829d7ed5823abfc29dfb547c13272cca", "score": "0.82158494", "text": "function resetSchedulerState () {\n\t queue.length = 0;\n\t has$1 = {};\n\t {\n\t circular = {};\n\t }\n\t waiting = flushing = false;\n\t}", "title": "" }, { "docid": "829d7ed5823abfc29dfb547c13272cca", "score": "0.82158494", "text": "function resetSchedulerState () {\n\t queue.length = 0;\n\t has$1 = {};\n\t {\n\t circular = {};\n\t }\n\t waiting = flushing = false;\n\t}", "title": "" }, { "docid": "829d7ed5823abfc29dfb547c13272cca", "score": "0.82158494", "text": "function resetSchedulerState () {\n\t queue.length = 0;\n\t has$1 = {};\n\t {\n\t circular = {};\n\t }\n\t waiting = flushing = false;\n\t}", "title": "" }, { "docid": "dda4cf04e9765d477f5ebc083a4a0f05", "score": "0.81833833", "text": "function resetSchedulerState () {\n queue.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "eeaf184c0636bccccfb54344d5c6cb39", "score": "0.81699425", "text": "function resetSchedulerState () {\n queue.length = 0;\n has$1 = {};\n if (false) {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "aa4a5af632efb399ca81b85a0805135b", "score": "0.8157873", "text": "function resetSchedulerState () {\n queue.length = 0;\n has = {};\n if (false) {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "aa4a5af632efb399ca81b85a0805135b", "score": "0.8157873", "text": "function resetSchedulerState () {\n queue.length = 0;\n has = {};\n if (false) {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "fbfa87bd2fd9ec497e51f9f7c82017be", "score": "0.81561536", "text": "function resetSchedulerState () {\n queue.length = 0\n has$1 = {}\n {\n circular = {}\n }\n waiting = flushing = false\n}", "title": "" }, { "docid": "7ee68b2a6e03b21cd31e8ab85c604983", "score": "0.81401116", "text": "function resetSchedulerState () {\n\t queue.length = 0;\n\t has$1 = {};\n\t if (process.env.NODE_ENV !== 'production') {\n\t circular = {};\n\t }\n\t waiting = flushing = false;\n\t}", "title": "" }, { "docid": "61569d718305ed74c9745b35cbad7fde", "score": "0.81140536", "text": "function resetSchedulerState () {\n queue.length = 0;\n has$1 = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "61569d718305ed74c9745b35cbad7fde", "score": "0.81140536", "text": "function resetSchedulerState () {\n queue.length = 0;\n has$1 = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "61569d718305ed74c9745b35cbad7fde", "score": "0.81140536", "text": "function resetSchedulerState () {\n queue.length = 0;\n has$1 = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "f4272ed2cd606c1b33684a6260db49b9", "score": "0.8092071", "text": "function resetSchedulerState () {\n queue.length = 0;\n has$1 = {};\n if ('development' !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "3179d31508214af8f766bb019a3fb5a4", "score": "0.80703217", "text": "function resetSchedulerState () {\n queue.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "3179d31508214af8f766bb019a3fb5a4", "score": "0.80703217", "text": "function resetSchedulerState () {\n queue.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "3179d31508214af8f766bb019a3fb5a4", "score": "0.80703217", "text": "function resetSchedulerState () {\n queue.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "63cbc0e7d67d9dcb64c5e82067943f78", "score": "0.8046139", "text": "function resetSchedulerState () {\n\t queue.length = 0;\n\t has = {};\n\t if (process.env.NODE_ENV !== 'production') {\n\t circular = {};\n\t }\n\t waiting = flushing = false;\n\t}", "title": "" }, { "docid": "151ba515467e0ac939e1cbb10fa98e1e", "score": "0.79680675", "text": "function resetSchedulerState() {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (false) {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "b9a89556424a53409290eae6eeb06e90", "score": "0.79472953", "text": "function resetSchedulerState()\n {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "ffc1ad5a70f76a8aca9c24a4b588f5e4", "score": "0.79464346", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n waiting = flushing = false;\n}", "title": "" }, { "docid": "ffc1ad5a70f76a8aca9c24a4b588f5e4", "score": "0.79464346", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n waiting = flushing = false;\n}", "title": "" }, { "docid": "ffc1ad5a70f76a8aca9c24a4b588f5e4", "score": "0.79464346", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n waiting = flushing = false;\n}", "title": "" }, { "docid": "3be629433d39db5f956df171397f9d43", "score": "0.7942666", "text": "function resetSchedulerState() {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "3a0ef67acb1e34c0b77de8e654ad0827", "score": "0.7930694", "text": "function resetSchedulerState() {\n index$1 = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "3a0ef67acb1e34c0b77de8e654ad0827", "score": "0.7930694", "text": "function resetSchedulerState() {\n index$1 = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "821a82be7d5ad534b0826e70028847c0", "score": "0.79292554", "text": "function resetSchedulerState() {\n index = queue.length = activatedChildren.length = 0;\n has$1 = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "83d036426aaa0907609fba83c418b052", "score": "0.7924793", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "83d036426aaa0907609fba83c418b052", "score": "0.7924793", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "83d036426aaa0907609fba83c418b052", "score": "0.7924793", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "83d036426aaa0907609fba83c418b052", "score": "0.7924793", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "83d036426aaa0907609fba83c418b052", "score": "0.7924793", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "e8ddd30850a2f806a5c7a8e905ce8069", "score": "0.78955543", "text": "function resetSchedulerState() {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "e8ddd30850a2f806a5c7a8e905ce8069", "score": "0.78955543", "text": "function resetSchedulerState() {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "e8ddd30850a2f806a5c7a8e905ce8069", "score": "0.78955543", "text": "function resetSchedulerState() {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "e8ddd30850a2f806a5c7a8e905ce8069", "score": "0.78955543", "text": "function resetSchedulerState() {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n }", "title": "" }, { "docid": "20ef5e7287ae8e758c5608be414259b2", "score": "0.788747", "text": "function resetSchedulerState () {\n queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "719561cde91ba6ae23f9a00d1f6f36ef", "score": "0.78867775", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "77e80c8a71926555ce0e2f708184dc85", "score": "0.78748596", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (false) {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "77e80c8a71926555ce0e2f708184dc85", "score": "0.78748596", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (false) {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "77e80c8a71926555ce0e2f708184dc85", "score": "0.78748596", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (false) {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "77e80c8a71926555ce0e2f708184dc85", "score": "0.78748596", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (false) {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "77e80c8a71926555ce0e2f708184dc85", "score": "0.78748596", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (false) {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "77e80c8a71926555ce0e2f708184dc85", "score": "0.78748596", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (false) {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "77e80c8a71926555ce0e2f708184dc85", "score": "0.78748596", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (false) {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" }, { "docid": "77e80c8a71926555ce0e2f708184dc85", "score": "0.78748596", "text": "function resetSchedulerState () {\n index = queue.length = activatedChildren.length = 0;\n has = {};\n if (false) {\n circular = {};\n }\n waiting = flushing = false;\n}", "title": "" } ]
96e1109393e68a39ff14350a5d6cbb88
getMeshFromRenderProxy generate a new mesh from render proxy floor_normal: skip all triangles whose normal differs from that top_face_z: use for the face Z coordinates unless null
[ { "docid": "7bdc4dd15305fb6a636885c2cfc8862e", "score": "0.8578899", "text": "getMeshFromRenderProxy( dbId, render_proxy, floor_normal, top_face_z ) {\n let matrix = render_proxy.matrixWorld\n let geometry = render_proxy.geometry\n let attributes = geometry.attributes\n\n let vA = new THREE.Vector3()\n let vB = new THREE.Vector3()\n let vC = new THREE.Vector3()\n\n let geo = new THREE.Geometry()\n let iv = 0\n\n if( attributes.index !== undefined ) {\n let indices = attributes.index.array || geometry.ib\n let positions = geometry.vb ? geometry.vb : attributes.position.array\n let stride = geometry.vb ? geometry.vbstride : 3\n let offsets = geometry.offsets\n if( !offsets || offsets.length === 0 ) {\n offsets =[ { start: 0, count: indices.length, index: 0 } ]\n }\n for( let oi =0, ol = offsets.length ; oi < ol ; ++oi ) {\n let start = offsets[oi].start\n let count = offsets[oi].count\n let index = offsets[oi].index\n for( let i = start, il = start + count ; i < il ; i += 3 ) {\n let a = index + indices [i]\n let b = index + indices [i + 1]\n let c = index + indices [i + 2]\n\n vA.fromArray( positions, a * stride )\n vB.fromArray( positions, b * stride )\n vC.fromArray( positions, c * stride )\n\n vA.applyMatrix4( matrix )\n vB.applyMatrix4( matrix )\n vC.applyMatrix4( matrix )\n\n let n =THREE.Triangle.normal( vA, vB, vC )\n if ( floor_normal === null\n || this.isEqualVectorsWithPrecision( n, floor_normal ) )\n {\n let cache = this._floorTopEdges\n , debug = this._debug_floor_top_edges\n\n this.drawVertex( vA, cache, debug )\n this.drawVertex( vB, cache, debug )\n this.drawVertex( vC, cache, debug )\n this.drawLine( vA, vB, cache, debug )\n this.drawLine( vB, vC, cache, debug )\n this.drawLine( vC, vA, cache, debug )\n\n geo.vertices.push( new THREE.Vector3( vA.x, vA.y,\n top_face_z === null ? vA.z : top_face_z ) )\n geo.vertices.push( new THREE.Vector3( vB.x, vB.y,\n top_face_z === null ? vB.z : top_face_z ) )\n geo.vertices.push( new THREE.Vector3( vC.x, vC.y,\n top_face_z === null ? vC.z : top_face_z ) )\n geo.faces.push( new THREE.Face3( iv, iv + 1, iv + 2 ) )\n iv = iv + 3\n }\n }\n }\n }\n\n this.calculateUVsGeo( geo )\n geo.computeFaceNormals()\n geo.computeVertexNormals()\n geo.computeBoundingBox()\n\n let mat = new THREE.MeshBasicMaterial( { color: 0xffff00 } )\n let shaderMat = this.createShaderMaterial( dbId )\n\n let mesh = new THREE.Mesh( geo,\n top_face_z !== null ? shaderMat : mat )\n\n //mesh.matrix.copy (render_proxy.matrixWorld)\n mesh.matrixWorldNeedsUpdate = true\n mesh.matrixAutoUpdate = false\n mesh.frustumCulled = false\n\n return mesh\n }", "title": "" } ]
[ { "docid": "6d57067350411d7ee9c2d20ece7d2332", "score": "0.5812236", "text": "function createMesh2(){\n var r=pointSample.length;\n var n=gridBoundary.length;\n var interiorPointsNumber=GridMeshVertexArray.length-r;\n console.log(interiorPointsNumber);\n var totalPoints=GridMeshVertexArray.length;\n var vtx=toThreeVector3(GridMeshVertexArray.slice()); \n var vtx2=[];\n for(var i=0;i<interiorPointsNumber;i++){\n vtx2.push(new THREE.Vector3(vtx[i].x,vtx[i].y,parseFloat(-sizeGrid)));\n }\n for(var i=0;i<interiorPointsNumber;i++){\n //console.log(i,parseFloat(sizeGrid));\n vtx[i].setZ(parseFloat(sizeGrid));\n }\n\n vtx=vtx.concat(vtx2);\n var fac=GridMeshFacesArray.slice();\n for(var i=0;i<GridMeshFacesArray.length;i++){\n var current=GridMeshFacesArray[i].slice();\n current.reverse();\n for(var j=0;j<3;j++){\n if(current[j]<interiorPointsNumber){\n current[j]+=totalPoints;\n } \n }\n fac.push(current);\n }\n \n return [fac,vtx];\n}", "title": "" }, { "docid": "27c98270a3e2d5b3b4f865fff9beb1a3", "score": "0.57571703", "text": "function create_O3D_Mesh(mesh, pack, o3d, client, atomtype,colorMaterial, shadowMaterial){\n \n // var transform = pack.createObject('Transform');\n // transform.translate(mesh.pos[0], mesh.pos[1], mesh.pos[2]);\n\n for(var i=0; i<mesh.faceArray.length; i++){\n \n // -- TRIANGLE --\n\t// create an Effect object and initialize it using the shaders from the text area\n\tvar g_triangleTransform;\n //var colorEffect = pack.createObject('Effect');\n\t//var shaderString = triangle_shader_material;\n\t//colorEffect.loadFromFXString(shaderString);\n\n\t// create a Material for the mesh\n\t//var triangleMaterial = pack.createObject('Material');\n\n\t// set the material's drawList, performance draw list is for opaque elements\n\t//triangleMaterial.drawList = viewInfo.performanceDrawList;\n //triangleMaterial.effect = colorEffect;\n //colorEffect.createUniformParameters(triangleMaterial);\n\t// apply our effect to this material, it determines which shaders to use\n\n // triangleMaterial.getParam('lightViewProjection').value = mesh.lightViewProjection;\n //triangleMaterial.getParam('lightWorldPos').value = mesh.lightWorldPos;\n //triangleMaterial.getParam('lightColor').value = mesh.lightColor;\n //triangleMaterial.getParam('ambient').value = o3djs.math.mulScalarVector(0.1, mesh.color);\n //triangleMaterial.getParam('diffuse').value = o3djs.math.mulScalarVector(0.8, mesh.color);\n //triangleMaterial.getParam('specular').value = mesh.specular;\n //triangleMaterial.getParam('shininess').value = 80;\n\n var curr_face = mesh.faceArray[i];\n var curr_color= mesh.color;\n var vert_1 = mesh.vertexArray[curr_face.getPoint(0)].pos;\n var vert_2 = mesh.vertexArray[curr_face.getPoint(1)].pos;\n var vert_3 = mesh.vertexArray[curr_face.getPoint(2)].pos;\n var vertices = [vert_1, vert_2, vert_3];\n var normals = [mesh.vertexArray[curr_face.getPoint(0)].normal, mesh.vertexArray[curr_face.getPoint(1)].normal, mesh.vertexArray[curr_face.getPoint(2)].normal];\n\t// create the Shape for the triangle mesh and assign its material\n\tvar triangleShape = CreateTriangle(pack, o3d, vertices, normals, colorMaterial);\n\n\t// create a new transform for the triangle\n\tg_triangleTransform = pack.createObject('Transform');\n\tg_triangleTransform.addShape(triangleShape);\n\n // g_triangleTransform.shape.createDrawElements(pack, shadowMaterial);\n\n\t// connect the triangle's transform to the client root\n\tg_triangleTransform.parent = client.root;\n g_triangleTransform.cull = true;\n g_triangleTransform.visible = true;\n mesh.transforms.push(g_triangleTransform);\n \n }\n\n for(var i=0; i<mesh.faceArray.length; i++){\n delete mesh.faceArray[mesh.faceArray.length-i-1];\n }\n for(var i=0; i<mesh.edgeArray.length; i++){\n delete mesh.edgeArray[mesh.edgeArray.length-i-1];\n }\n for(var i=0; i<mesh.half_edgeArray.length; i++){\n delete mesh.half_edgeArray[mesh.half_edgeArray.length-i-1];\n }\n for(var i=0; i<mesh.posArray.length; i++){\n delete mesh.posArray[mesh.posArray.length-i-1];\n }\n\n\n\n delete mesh.faceArray;\n delete mesh.half_edgeArray;\n delete mesh.vertexArray;\n delete mesh.indexArray;\n delete mesh.posArray;\n \n}", "title": "" }, { "docid": "bd773b1e605f4d29bcc063611f67415d", "score": "0.5712276", "text": "function iterate(mesh) {\n // capture the mesh before iteration\n var mesh0 = {\n vertices: mesh.vertices.slice(0),\n faces: mesh.faces.slice(0),\n };\n\n // Find the next face in the mesh with points\n for (var i = 0; i < mesh.faces.length; ++i) {\n var face = mesh.faces[i];\n var points = face.points;\n if (points && points.length) {\n var plane = new Plane(mesh.vertices[face.a], mesh.vertices[face.b], mesh.vertices[face.c]);\n var mostDistant = findMostDistantFromPlane(plane, points);\n var lightFaces = findLightFaces(mostDistant.point, mesh, [i]);\n var horizonEdges = findHorizonEdges(mesh, lightFaces);\n\n // Create new faces using the point and the horinzon edges\n var newVertexIndex = mesh.vertices.push(mostDistant.point) - 1;\n var newFaces = horizonEdges.map(function(edge) {\n var index = mesh.faces.push({a: edge[0], b: edge[1], c: newVertexIndex}) - 1;\n return index;\n });\n\n // Reclassify all the point of the light faces. Current face's points\n // and all the light faces (wihout the current face)\n var remaining = points;\n remaining.splice(mostDistant.index, 1);\n lightFaces.forEach(function(faceIndex) {\n if (faceIndex !== i) {\n var face = mesh.faces[faceIndex];\n if (face.points) {\n remaining = remaining.concat(face.points);\n }\n }\n });\n\n // Remove the light faces from the mesh and update the indices\n // of the new faces\n var prunedFaces = [];\n for (var k = 0; k < mesh.faces.length; ++k) {\n if (lightFaces.indexOf(k) === -1) {\n prunedFaces.push(mesh.faces[k]);\n } else {\n newFaces = newFaces.map(function(index) {\n return index >= k ? index-1 : index;\n });\n }\n }\n mesh.faces = prunedFaces;\n\n assignPointsToFaces(remaining, mesh);\n return {\n point: mostDistant.point,\n lightFaces: lightFaces,\n newFaces: newFaces,\n mesh0: mesh0,\n };\n }\n }\n return undefined;\n}", "title": "" }, { "docid": "fb6f141cd96ea58b6d56edae0549b509", "score": "0.56827337", "text": "function createFloor() {\n let mesh = new THREE.Mesh(\n new THREE.PlaneBufferGeometry(2000, 2000),\n new THREE.MeshPhongMaterial({ color: '#656565', depthWrite: false })\n );\n mesh.rotation.x = -Math.PI / 2;\n mesh.position.y = -100;\n mesh.receiveShadow = true;\n scene.add(mesh);\n }", "title": "" }, { "docid": "fe4240608d79cabf6c621969dbadefd3", "score": "0.5632151", "text": "createFrustum(camera, frustum, flip = false) {\n // return frustum\n const planes = [];\n const vertices = [];\n const origin = camera.position.clone();\n // let local = this.worldToLocal(origin);\n // local = new THREE.Vector3(-local.x, -local.y, local.z)\n // Obtain vertices in world space\n for (let vindex = 0, vcount = this.geometry.vertices.length; vindex < vcount; ++vindex) {\n const local = this.geometry.vertices[vindex].clone();\n const world = this.localToWorld(local);\n vertices.push(world);\n }\n\n // for (var i = 0; i < vertices.length; ++i) {\n // var i2 = (i + 1) % vertices.length;\n\n // // var n = mathHelper.createPlaneFromEyeAndVertexes(cameraVec4, thisPortalVerticesCopy[i], thisPortalVerticesCopy[i2]);\n // const eye = origin;\n // const vertex1 = vertices[i]\n // const vertex2 = vertices[i2]\n // var edgeDir1 = new THREE.Vector3();\n // edgeDir1.subVectors(vertex1, eye)\n \n // var edgeDir2 = new THREE.Vector3();\n // edgeDir2.subVectors(vertex2, eye)\n \n // const normVector = new THREE.Vector3();\n // normVector.cross(edgeDir2, edgeDir1);\n // normVector.normalize();\n // const distToPlane = normVector.distanceTo(eye);\n // normVector.z = -distToPlane;\n\n // const planeNorm = new THREE.Plane(normVector);\n\n // if (flip) {\n // planeNorm.negate();\n // }\n // // console.warn('here', planeNorm)\n // planes.push(planeNorm);\n // }\n\n // Check distance to portal\n const distance = this.portal.plane.distanceToPoint(this.worldToLocal(origin));\n const close = distance > 1.0 && distance < -1.0;\n // console.log(distance)\n /* \n If the portal is very close, use the portal vertices unedited; otherwise, clip the portal\n vertices by the provided frustum.\n */\n const clipped = THREEUtil.clipVerticesByFrustum(vertices, frustum)//close ? vertices : THREEUtil.clipVerticesByFrustum(vertices, frustum);\n\n // If clipping the portal vertices resulted in a polygon with fewer than 3 vertices, return\n // null to indicate a new frustum couldn't be produced.\n if (clipped.length < 3) {\n return null;\n }\n\n // Produce side planes for new frustum\n for (let vindex = 0, vcount = clipped.length; vindex < vcount; ++vindex) {\n const vertex1 = clipped[vindex];\n const vertex2 = clipped[(vindex + 1) % vcount];\n\n const plane = new THREE.Plane().setFromCoplanarPoints(vertex1, vertex2, origin);\n // if (flip) plane.negate();\n planes.push(plane);\n }\n\n // Copy the original far plane (index: last - 1)\n const farPlaneIndex = frustum.planes.length - 1;\n const farPlane = frustum.planes[farPlaneIndex];\n planes.push(farPlane);\n // this.add(new THREE.PlaneHelper( farPlane, 1, 0xff0000 ));\n // Create a near plane matching the portal\n const nearPlane = new THREE.Plane().setFromCoplanarPoints(clipped[0], clipped[1], clipped[2]);\n // if (flip) nearPlane.negate();\n planes.push(nearPlane);\n // let h = new PlaneHelper( nearPlane, 10, 0x0000ff );\n // this.add(h);\n // const planeHelper = new PlaneHelper( nearPlane, 10, 0xff0000 );\n // planeHelper.position.set(\n // this.parent.position.x, \n // this.parent.position.y, \n // this.parent.position.z)\n // console.log(this.parent.parent.parent)\n // this.add(planeHelper);\n const newFrustum = { planes };\n // DebugPanel.test3 = DebugPanel.frustumToString(newFrustum.planes);\n // const fr = new THREE.Frustum(...planes);\n // const h = new FrustumHelper(fr);\n // console.log(h)\n // this.parent.add(h)\n this.material.color = new THREE.Color(0xff0000);\n // this.material.opacity = 1;\n return newFrustum;\n }", "title": "" }, { "docid": "d5f1bddc85dda76aae11f78cdfc801ab", "score": "0.56107837", "text": "function run(mesh) {\n var faces = mesh.faces;\n var triFaces=[];\n\n for (let face of faces) {\n while (face.length > 3) {\n triFaces.push( [face[0],face[1],face[2]] );\n face.splice(1,1);\n }\n if (face.length == 3)\n triFaces.push(face);\n }\n \n mesh.faces = triFaces;\n\nreturn { Out: mesh };\n}", "title": "" }, { "docid": "8261bcbdeb151be7f8b344a8c72bb278", "score": "0.56065774", "text": "constructor(objBlob){\n super();\n this.name = 'cMesh';\n this.camToCenter = undefined; //how far is meshes distToCamera in worldview\n this.opacity = 1;\n\n this.verts = objBlob.verts.slice();\n this.vertStores = this.verts.slice();\n this.vertsTransformed = new Array(this.verts.length); //verts but rotated and also homo coords [x,y,z,w]\n for (let i = 0; i < this.vertsTransformed.length; i++) { //rgb\n this.vertsTransformed[i] = new Array(4);\n }\n\n this.vertNorms = objBlob.vertNorms.slice(); //arr of vertex normals\n this.camToVerts = new Array(this.verts.length); //vector from camera to all vertexes\n this.camToVertsMag = new Array(this.verts.length); //magnitude from camera to all vertexes\n\n this.faces = objBlob.faces.slice();\n this.camToFaces = new Array(this.faces.length); // avg pos of face - camera pos = vec to faceCenter from camera\n this.camToFacesMag = new Array(this.faces.length);\n\n this.faceColors = new Array(this.faces.length);\n for (let i = 0; i < this.faces.length; i++) { //rgb\n this.faceColors[i] = [ran(40,255),ran(220),ran(40,255),1];\n }\n\n this.shading = new Array(this.verts.length);\n\n }", "title": "" }, { "docid": "d7619e2f4201b720c6c3e826fe3c6682", "score": "0.55864626", "text": "function createCustomFaceGeometry(lBorderPoints, rBorderPoints) {\n\n\tvar geometry = new THREE.BufferGeometry();\n\tvar vertices = [];\n\n\t// start from iBorder's first point, each loop draw 2 triangles representing the quadralateral iBorderP[i], iBorderP[i+1], oBorder[i+1], oBorder[i] \n\tfor (var i = 0; i < Math.min(lBorderPoints.length, rBorderPoints.length) - 1; i++) {\n\t\tvertices = vertices.concat([rBorderPoints[i].x, rBorderPoints[i].y, rBorderPoints[i].z]);\n\t\tvertices = vertices.concat([rBorderPoints[i + 1].x, rBorderPoints[i + 1].y, rBorderPoints[i + 1].z]);\n\t\tvertices = vertices.concat([lBorderPoints[i + 1].x, lBorderPoints[i + 1].y, lBorderPoints[i + 1].z]);\n\n\t\tvertices = vertices.concat([rBorderPoints[i].x, rBorderPoints[i].y, rBorderPoints[i].z]);\n\t\tvertices = vertices.concat([lBorderPoints[i + 1].x, lBorderPoints[i + 1].y, lBorderPoints[i + 1].z]);\n\t\tvertices = vertices.concat([lBorderPoints[i].x, lBorderPoints[i].y, lBorderPoints[i].z]);\n\t}\n\n\tif (lBorderPoints.length < rBorderPoints.length) {\n\n\t\tvar lPoint = lBorderPoints[lBorderPoints.length - 1];\n\n\t\tfor (var i = lBorderPoints.length - 1; i < rBorderPoints.length - 1; i++) {\n\t\t\tvertices = vertices.concat([lPoint.x, lPoint.y, lPoint.z]);\n\t\t\tvertices = vertices.concat([rBorderPoints[i].x, rBorderPoints[i].y, rBorderPoints[i].z]);\n\t\t\tvertices = vertices.concat([rBorderPoints[i + 1].x, rBorderPoints[i + 1].y, rBorderPoints[i + 1].z]);\n\t\t}\n\t}\n\n\n\tif (lBorderPoints.length > rBorderPoints.length) {\n\n\t\tvar rPoint = rBorderPoints[rBorderPoints.length - 1];\n\n\t\tfor (var i = rBorderPoints.length - 1; i < lBorderPoints.length - 1; i++) {\n\t\t\tvertices = vertices.concat([rPoint.x, rPoint.y, rPoint.z]);\n\t\t\tvertices = vertices.concat([lBorderPoints[i + 1].x, lBorderPoints[i + 1].y, lBorderPoints[i + 1].z]);\n\t\t\tvertices = vertices.concat([lBorderPoints[i].x, lBorderPoints[i].y, lBorderPoints[i].z]);\n\t\t}\n\t}\n\n\tvertices = Float32Array.from(vertices)\n\t// itemSize = 3 becuase there are 3 values (components) per vertex\n\tgeometry.addAttribute('position', new THREE.BufferAttribute(vertices, 3));\n\n\treturn geometry;\n}", "title": "" }, { "docid": "5da2e4e5d59864d69fa89a119d0241ec", "score": "0.5535205", "text": "async attenuationCalculator( data ) {\n let impl = this.viewer.impl\n\n // remove debug markers\n\n this._floorTopEdges.forEach( (obj) => {\n impl.scene.remove( obj )\n })\n this._raycastRays.forEach( (obj) => {\n impl.scene.remove( obj )\n })\n\n this._floorTopEdges = []\n this._raycastRays = []\n\n this.drawVertex( data.point, this._floorTopEdges, \n this._debug_floor_top_edges )\n\n let psource = new THREE.Vector3 (\n data.point.x, data.point.y,\n data.point.z + this._rayTraceOffset\n )\n\n let top_face_z = data.point.z + this._topFaceOffset\n\n // from the selected THREE.Face, extract the normal\n let floor_normal = data.face.normal\n\n // retrieve floor render proxies matching normal\n let instanceTree = this.viewer.model.getData().instanceTree\n const fragIds = await Toolkit.getFragIds( \n this.viewer.model, data.dbId )\n\n let floor_mesh_render = impl.getRenderProxy(\n this.viewer.model, fragIds[0] )\n\n let mesh = this.getMeshFromRenderProxy( data.dbId, \n floor_mesh_render, floor_normal, top_face_z )\n\n if ( !this._proxyMeshes [fragIds [0]] ) {\n mesh.name = data.dbId + '-' + fragIds [0] + '-Test'\n this._proxyMeshes [fragIds [0]] = mesh\n impl.scene.add (mesh)\n } else {\n mesh = this._proxyMeshes [fragIds [0]]\n }\n\n // ray trace to determine wall locations on mesh\n let map_uv_to_color = this.rayTraceToFindWalls( mesh, psource )\n\n //console.log( map_uv_to_color )\n\n this._attenuation_max = this.array2dMaxW( map_uv_to_color )\n this._attenuation_min = this.array2dMinW( map_uv_to_color )\n\n let tex = this.createTexture( map_uv_to_color, \n this._attenuation_max )\n\n mesh.material.uniforms.checkerboard.value = tex\n\n impl.invalidate (true)\n }", "title": "" }, { "docid": "732842159a60072650b67902062fe7b9", "score": "0.5520896", "text": "function makeCube()\n{\n // vertices of cube\n var rawVertices = new Float32Array([ \n -0.5, -0.5, 0.5,\n 0.5, -0.5, 0.5,\n 0.5, 0.5, 0.5,\n -0.5, 0.5, 0.5,\n -0.5, -0.5, -0.5,\n 0.5, -0.5, -0.5,\n 0.5, 0.5, -0.5,\n -0.5, 0.5, -0.5]);\n\n var rawColors = new Float32Array([\n 1.0, 0.0, 0.0, 1.0, // red\n 0.0, 1.0, 0.0, 1.0, // green\n 0.0, 0.0, 1.0, 1.0, // blue\n 1.0, 1.0, 0.0, 1.0, // yellow\n 1.0, 0.0, 1.0, 1.0, // magenta\n 0.0, 1.0, 1.0, 1.0, // cyan\n ]);\n\n var rawNormals = new Float32Array([\n 0, 0, 1,\n 1, 0, 0,\n 0, 0, -1,\n -1, 0, 0,\n 0, 1, 0,\n 0, -1, 0 ]);\n\n var indices = new Uint16Array([\n 0, 1, 2, 0, 2, 3, // z face\n 1, 5, 6, 1, 6, 2, // +x face\n 5, 4, 7, 5, 7, 6, // -z face\n 4, 0, 3, 4, 3, 7, // -x face\n 3, 2, 6, 3, 6, 7, // + y face\n 4, 5, 1, 4, 1, 0 // -y face\n ]);\n \n var verticesArray = [];\n var colorsArray = [];\n var normalsArray = [];\n for (var i = 0; i < 36; ++i)\n {\n // for each of the 36 vertices...\n var face = Math.floor(i / 6);\n var index = indices[i];\n \n // (x, y, z): three numbers for each point\n for (var j = 0; j < 3; ++j)\n {\n verticesArray.push(rawVertices[3 * index + j]);\n }\n \n // (r, g, b, a): four numbers for each point\n for (var j = 0; j < 4; ++j)\n {\n colorsArray.push(rawColors[4 * face + j]);\n }\n \n // three numbers for each point\n for (var j = 0; j < 3; ++j)\n {\n normalsArray.push(rawNormals[3 * face + j]);\n }\n }\n \n return {\n vertices: new Float32Array(verticesArray),\n colors: new Float32Array(colorsArray),\n normals: new Float32Array(normalsArray)\n };\n}", "title": "" }, { "docid": "4f859a30f0884fa9c42592226b79f2c0", "score": "0.55132145", "text": "function convertCubeGeometry2LineGeometry(input) {\r\n\t\"use strict\";\r\n\tvar geometry = new THREE.Geometry();\r\n\tvar vertices = geometry.vertices;\r\n\tfor ( var i = 0; i < input.faces.length; i += 2) {\r\n\t\tvar face1 = input.faces[i];\r\n\t\tvar face2 = input.faces[i + 1];\r\n\t\tvar c1 = input.vertices[face1.c].clone();\r\n\t\tvar a1 = input.vertices[face1.a].clone();\r\n\t\tvar a2 = input.vertices[face2.a].clone();\r\n\t\tvar b2 = input.vertices[face2.b].clone();\r\n\t\tvar c2 = input.vertices[face2.c].clone();\r\n\t\tvertices.push(c1, a1, a2, b2, b2, c2);\r\n\t}\r\n\tgeometry.computeLineDistances();\r\n\treturn geometry;\r\n}", "title": "" }, { "docid": "d159c9fe0a824df79e3770b806074bd8", "score": "0.5511117", "text": "function processMesh(mesh){\n // if(!mesh.model.vertexMaterialIndices) {\n AddNormalsArrays(mesh);\n // }\n}", "title": "" }, { "docid": "32df18dbba5b47edbd71c115ae0a1edd", "score": "0.5509111", "text": "get Mesh() {}", "title": "" }, { "docid": "0ccbf09ba7cf2bd9a97d095a84f750ef", "score": "0.54999787", "text": "constructor() {\n const geo = new THREE.BufferGeometry();\n super(geo);\n this.clipPlane = new THREE.Plane();\n const size = new THREE.Vector3(0.5, 0.5, 0.5);\n this.size = size;\n\n this.cullFlag = [\n true, true, true, true,\n true, true, true, true,\n false, false, false, false, false, false,\n ];\n\n this.faces = [\n { indices: [], norm: new THREE.Vector3(0, 0, -1) },\n { indices: [], norm: new THREE.Vector3(0, 0, 1) },\n { indices: [], norm: new THREE.Vector3(0, -1, 0) },\n { indices: [], norm: new THREE.Vector3(0, 1, 0) },\n { indices: [], norm: new THREE.Vector3(-1, 0, 0) },\n { indices: [], norm: new THREE.Vector3(1, 0, 0) },\n { indices: [], norm: new THREE.Vector3(0, 0, 0) },\n ];\n\n this.vertices = [\n new THREE.Vector3(-size.x, -size.y, -size.z),\n new THREE.Vector3(-size.x, size.y, -size.z),\n new THREE.Vector3(size.x, -size.y, -size.z),\n new THREE.Vector3(size.x, size.y, -size.z),\n new THREE.Vector3(-size.x, -size.y, size.z),\n new THREE.Vector3(-size.x, size.y, size.z),\n new THREE.Vector3(size.x, -size.y, size.z),\n new THREE.Vector3(size.x, size.y, size.z),\n new THREE.Vector3(0.0, 0.0, 0.0), // Placeholder for section\n new THREE.Vector3(0.0, 0.0, 0.0),\n new THREE.Vector3(0.0, 0.0, 0.0),\n new THREE.Vector3(0.0, 0.0, 0.0),\n new THREE.Vector3(0.0, 0.0, 0.0),\n new THREE.Vector3(0.0, 0.0, 0.0),\n ];\n\n geo.setAttribute('position', new THREE.BufferAttribute(new Float32Array(this.vertices.length * 3), 3));\n\n this.name = 'VolumeMesh';\n }", "title": "" }, { "docid": "5e4387b6804a5b689faad69b41a31690", "score": "0.5447273", "text": "buildMesh (data, material) {\n\n const geometry = new THREE.Geometry()\n\n data.vertices.forEach((vertex) => {\n\n geometry.vertices.push(\n new THREE.Vector3(\n vertex.x,\n vertex.y,\n vertex.z))\n })\n\n data.faces.forEach((face) => {\n\n geometry.faces.push(\n new THREE.Face3(\n face.a,\n face.b,\n face.c))\n })\n\n geometry.computeFaceNormals()\n\n //geometry.computeVertexNormals()\n\n // Notes: after here, it just seem like regular code to create meshes\n // the key is in the calculation for the vertices and faces\n\n const matrixWorld = new THREE.Matrix4()\n\n matrixWorld.fromArray(data.matrixWorld)\n\n const mesh = new THREE.Mesh(\n geometry, material)\n\n mesh.applyMatrix(matrixWorld)\n\n mesh.dbId = data.dbId\n\n return mesh\n }", "title": "" }, { "docid": "14579a6268dfe98141ff0d5144296954", "score": "0.54378253", "text": "createTunnelMesh() {\n let tunnelGeometry = new THREE.CylinderGeometry(\n this.opts.radius, this.opts.radius, this.opts.length, 16\n );\n let tunnelMaterial = new THREE.MeshBasicMaterial({\n color: 0x00ff00,\n wireframe: true,\n transparent: true,\n opacity: (this.opts.debug ? 0.5 : 0.0),\n });\n return new THREE.Mesh(tunnelGeometry, tunnelMaterial);\n }", "title": "" }, { "docid": "4e2135f875085f2a6a0b555b4e599de7", "score": "0.5398549", "text": "function crtPoMesh(poly)\n{\n var lengths = new Array();\n var flatfaces = new Array();\n var f = 0;\n\n for(var i=0; i < poly.face.length; i++)\n {\n lengths[i] = poly.face[i].length;\n for(var j=0; j < lengths[i]; j++)\n\t{\n\t flatfaces[f] = poly.face[i][j];\n\t f++;\n\t}\n }\n\n crtOb(\"PolyMesh\", \"-p\", poly.face.length, \"-cv\", poly.xyz,\n\t\"-nv\", lengths, \"-iv\", flatfaces);\n} // crtPoMesh()", "title": "" }, { "docid": "96ecc25c5597c1c4ed4ea2ff321de65e", "score": "0.53917104", "text": "function getFaceNormals( vertices, indexList, numTriangles ) {\n // array of face normals\n var faceNormals = [];\n var faceNormal = [];\n \n // Following lines iterate over triangles\n for (var i = 0; i < numTriangles; i++) {\n // Following lines give you three vertices for each face of the triangle\n var p0 = vec3( vertices[indexList[3*i]][0],\n vertices[indexList[3*i]][1],\n vertices[indexList[3*i]][2]);\n \n var p1 = vec3( vertices[indexList[3*i+1]][0],\n vertices[indexList[3*i+1]][1],\n vertices[indexList[3*i+1]][2]);\n \n var p2 = vec3( vertices[indexList[3*i+2]][0],\n vertices[indexList[3*i+2]][1],\n vertices[indexList[3*i+2]][2]);\n \n // Calculate vector from p0 to p1 ( use subtract function in MV.js, NEEDS CODE )\n var p1minusp0 = vec3( p1[0]-p0[0], p1[1]-p0[1], p1[2]-p0[2]);\n // Calculate vector from p0 to p2 ( use subtract function, NEEDS CODE )\n var p2minusp0 = vec3( p2[0]-p0[0], p2[1]-p0[1], p2[2]-p0[2]);\n // Calculate face normal as the cross product of the above two vectors\n // (use cross function in MV.js, NEEDS CODE )\n var faceNormal = cross(p1minusp0 ,p2minusp0);\n // normalize face normal (use normalize function in MV.js, NEEDS CODE)\n faceNormal = normalize(faceNormal);\n // Following line pushes the face normal into the array of face normals\n faceNormals.push( faceNormal );\n }\n \n // Following line returns the array of face normals\n return faceNormals;\n}", "title": "" }, { "docid": "e55576b8a837275f86144542b11af623", "score": "0.5380523", "text": "function renderModelNormals(model) {\n\t\tvar modelData = model.getData();\n\t\tvar vertices = model.getProjectedVertices();\n\t\tvar polygons = modelData.polygonVertices;\n\t\tvar vertexNormals = model.getTransformedVertexNormals();\n\t\tvar polygonNormals = model.getTransformedPolygonNormals();\n\t\t// For display (but not for light calculations) normals\n\t\t// have to undergo perspective and view transformations\n\t\t// without the translation part.\n\t\tvar perspectiveNormal = [0, 0, 0, 0];\n\n\t\tvar polygonCenter;\n\t\t// Loop over polygons in model.\n\t\tfor(var p = 0; p < polygons.length; p++) {\n\n\t\t\tvar polygon = polygons[p];\n\t\t\tvar normal = polygonNormals[p];\n\n\t\t\t// BEGIN exercise Back-Face Culling\n\n\t\t\t// Back-face culling.\n\t\t\t// Check if polygon is facing away from the camera (in negative z-direction).\n\n\t\t\t// END exercise Back-Face Culling\n\n\t\t\t// The average of all vertices as debug geometry for the normals.\n\t\t\tpolygonCenter = [0, 0, 0];\n\n\t\t\t// Loop over vertices/edges in polygon.\n\t\t\tfor(var v = 0; v < polygon.length; v++) {\n\n\t\t\t\t// viewportProjection for vertex-normal.\n\t\t\t\tvar vertexIndex = polygon[v];\n\t\t\t\tvec3.set(vertexNormals[vertexIndex], perspectiveNormal)\n\t\t\t\tmat4.multiplyVec4(viewportProjection, perspectiveNormal);\n\t\t\t\t// Draw normal for vertex.\n\t\t\t\trenderNormal(vertices[vertexIndex], perspectiveNormal);\n\n\t\t\t\t// Accumulate vertices to calculate center of polygon.\n\t\t\t\tvec3.add(polygonCenter, vertices[vertexIndex]);\n\t\t\t}\n\t\t\tvec3.scale(polygonCenter, (1.0 / polygon.length));\n\n\t\t\t// viewportProjection for polygon-normal.\n\t\t\tvec3.set(normal, perspectiveNormal)\n\t\t\tmat4.multiplyVec4(viewportProjection, perspectiveNormal);\n\t\t\t// Draw normal for polygon beginning in the averaged center.\n\t\t\trenderNormal(polygonCenter, perspectiveNormal);\n\t\t}\n\t}", "title": "" }, { "docid": "407a9fa7aee63c449149b6271db1896d", "score": "0.5336784", "text": "function handleLoadedMesh(mesh) {\n // userData.vertPosObject = gl.createBuffer();\n //gl.bindBuffer ( gl.ARRAY_BUFFER, userData.vertPosObject );\n gl.bufferData ( gl.ARRAY_BUFFER, new Float32Array(mesh.vtxpos), gl.STATIC_DRAW );\n // userData.indicesObject = gl.createBuffer();\n //gl.bindBuffer ( gl.ELEMENT_ARRAY_BUFFER, userData.indicesObject );\n gl.bufferData ( gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(mesh.idx), gl.STATIC_DRAW );\n \n CurrentMeshDesc.indexcount = mesh.idx.length\n \n box = new Float32Array(mesh.bndbox)\n CurrentMeshDesc.minx = box[0]\n CurrentMeshDesc.miny = box[1]\n CurrentMeshDesc.minz = box[2]\n CurrentMeshDesc.maxx = box[3]\n CurrentMeshDesc.maxy = box[4]\n CurrentMeshDesc.maxz = box[5]\n CurrentMeshDesc.midx = (box[0] + box[3]) * 0.5\n CurrentMeshDesc.midy = (box[1] + box[4]) * 0.5\n CurrentMeshDesc.midz = (box[2] + box[5]) * 0.5\n}", "title": "" }, { "docid": "afbe9549e160b612f29670093f985d1f", "score": "0.5333846", "text": "function create_bounding_ellipsoid_batch(render, obj_name, is_dynamic, src_batch) {\n\n var batch = init_batch(\"DEBUG_VIEW\");\n\n apply_shader(batch, \"debug_view.glslv\", \"debug_view.glslf\");\n\n batch.debug_sphere = true;\n\n batch.depth_mask = true;\n batch.odd_id_prop = generate_odd_id(batch, render, obj_name);\n\n batch.debug_sphere_dynamic = is_dynamic;\n\n update_batch_render(batch, render);\n update_batch_id(batch);\n\n if (src_batch.use_be) {\n var be = src_batch.bounds_local.be;\n\n var center = __WEBPACK_IMPORTED_MODULE_23__libs_gl_matrix_vec3_js__[\"create\"]();\n var submesh = m_primitives.generate_uv_sphere(16, 8, 1, center,\n false, false);\n var scale = __WEBPACK_IMPORTED_MODULE_23__libs_gl_matrix_vec3_js__[\"fromValues\"](__WEBPACK_IMPORTED_MODULE_23__libs_gl_matrix_vec3_js__[\"length\"](be.axis_x),\n __WEBPACK_IMPORTED_MODULE_23__libs_gl_matrix_vec3_js__[\"length\"](be.axis_y), __WEBPACK_IMPORTED_MODULE_23__libs_gl_matrix_vec3_js__[\"length\"](be.axis_z));\n\n m_geom.scale_submesh_xyz(submesh, scale, center);\n \n var axis_x = __WEBPACK_IMPORTED_MODULE_23__libs_gl_matrix_vec3_js__[\"normalize\"](be.axis_x, _vec3_tmp);\n var axis_y = __WEBPACK_IMPORTED_MODULE_23__libs_gl_matrix_vec3_js__[\"normalize\"](be.axis_y, _vec3_tmp2);\n var axis_z = __WEBPACK_IMPORTED_MODULE_23__libs_gl_matrix_vec3_js__[\"normalize\"](be.axis_z, _vec3_tmp3);\n\n // if an object has zero dimension on some axis - recalculate it\n if (!scale[0] && scale[1] && scale[2])\n __WEBPACK_IMPORTED_MODULE_23__libs_gl_matrix_vec3_js__[\"cross\"](axis_y, axis_z, axis_x);\n else if (!scale[1] && scale[0] && scale[2])\n __WEBPACK_IMPORTED_MODULE_23__libs_gl_matrix_vec3_js__[\"cross\"](axis_z, axis_x, axis_y);\n else if (!scale[2] && scale[0] && scale[1])\n __WEBPACK_IMPORTED_MODULE_23__libs_gl_matrix_vec3_js__[\"cross\"](axis_x, axis_y, axis_z);\n\n var ellipsoid_mat = __WEBPACK_IMPORTED_MODULE_22__util_js__[\"W\" /* ellipsoid_axes_to_mat3 */](axis_x, axis_y,\n axis_z, _mat3_tmp);\n __WEBPACK_IMPORTED_MODULE_8__libs_gl_matrix_mat3_js__[\"invert\"](ellipsoid_mat, ellipsoid_mat);\n var quat = __WEBPACK_IMPORTED_MODULE_13__libs_gl_matrix_quat_js__[\"fromMat3\"](ellipsoid_mat, _vec4_tmp);\n __WEBPACK_IMPORTED_MODULE_20__tsr_js__[\"r\" /* set_quat */](quat, _tsr_tmp);\n __WEBPACK_IMPORTED_MODULE_20__tsr_js__[\"s\" /* set_scale */](1, _tsr_tmp);\n __WEBPACK_IMPORTED_MODULE_20__tsr_js__[\"v\" /* set_trans */](be.center, _tsr_tmp);\n m_geom.submesh_apply_transform(submesh, _tsr_tmp);\n } else {\n var bs = src_batch.bounds_local.bs;\n var submesh = m_primitives.generate_uv_sphere(16, 8, bs.radius,\n bs.center, false, false);\n }\n\n __WEBPACK_IMPORTED_MODULE_2__boundings_js__[\"t\" /* copy_boundings */](src_batch.bounds_local, batch.bounds_local);\n\n m_geom.submesh_drop_indices(submesh, 1, true);\n submesh.va_common[\"a_polyindex\"] = m_geom.extract_polyindices(submesh);\n update_batch_geometry(batch, submesh);\n\n return batch;\n}", "title": "" }, { "docid": "e747087f55a990f9c94f3e052efdad84", "score": "0.5321003", "text": "function setupScene() {\n var FLOORMATERIAL = '/assets/floor.png';\n var WALLMATERIAL = '/assets/wall.png';\n\n\t// Geometry: floor\n var floorGeometry = new t.CubeGeometry(HALLLONG, 0, HALLWIDTH);\n var floorTexture = t.ImageUtils.loadTexture(FLOORMATERIAL);\n floorTexture.wrapS = floorTexture.wrapT = THREE.RepeatWrap;\n floorTexture.repeat.set(16, 4);\n var floorMaterial = new t.MeshLambertMaterial({ map: floorTexture });\n\n\n\tvar floor = new t.Mesh(floorGeometry, floorMaterial);\n floor.position.x = HALLLONG / 2;\n\tscene.add(floor);\n\n\t// Geometry: ceil\n\tvar ceil = new t.Mesh(\n\t\tfloorGeometry, \n\t\tnew t.MeshLambertMaterial({color: 0x000000,/*map: t.ImageUtils.loadTexture('images/floor-1.jpg')*/})\n\t);\n\n ceil.position.x = HALLLONG / 2;\n ceil.position.y = HALLHEIGHT;\n\tscene.add(ceil);\n\n var hWallGeometry = new t.CubeGeometry(HALLLONG, HALLHEIGHT, 0);\n var hWallTexture = t.ImageUtils.loadTexture(WALLMATERIAL);\n hWallTexture.wrapS = hWallTexture.wrapT = THREE.RepeatWrap;\n hWallTexture.repeat.set(128, 16);\n var hWallMaterial = new t.MeshLambertMaterial({ map: hWallTexture });\n\n var rWall = new t.Mesh(hWallGeometry, hWallMaterial);\n\n rWall.position.x = HALLLONG / 2;\n rWall.position.y = HALLHEIGHT / 2;\n rWall.position.z = HALLWIDTH / 2;\n\tscene.add(rWall);\n\n var lWall = new t.Mesh(hWallGeometry, hWallMaterial);\n lWall.position.x = HALLLONG / 2;\n lWall.position.y = HALLHEIGHT / 2;\n lWall.position.z = - HALLWIDTH / 2;\n\tscene.add(lWall);\n\n var wWallGeometry = new t.CubeGeometry(0, HALLHEIGHT, HALLWIDTH);\n\n var wWallTexture = t.ImageUtils.loadTexture(WALLMATERIAL);\n wWallTexture.wrapS = wWallTexture.wrapT = THREE.RepeatWrap;\n wWallTexture.repeat.set(64, 16);\n var wWallMaterial = new t.MeshLambertMaterial({ map: wWallTexture });\n\n var fWall = new t.Mesh(wWallGeometry, wWallMaterial);\n fWall.position.x = HALLLONG;\n fWall.position.y = HALLHEIGHT / 2;\n fWall.position.z = 0;\n\tscene.add(fWall);\n\n var bWall = new t.Mesh(wWallGeometry, wWallMaterial);\n bWall.position.x = 0;\n bWall.position.y = HALLHEIGHT / 2;\n bWall.position.z = 0;\n\tscene.add(bWall);\n\n // Geometry: logo\n var logoGeometry = new t.CubeGeometry(0, 20, 98);\n var logoMaterial = new t.MeshLambertMaterial({map: t.ImageUtils.loadTexture('/assets/logo.png')});\n var fLogo = new t.Mesh(logoGeometry, logoMaterial);\n\n fLogo.position.x = HALLLONG - 1;\n fLogo.position.y = HALLHEIGHT * 2 / 3;\n scene.add(fLogo);\n\n // Geometry: logo\n var doorGeometry = new t.CubeGeometry(50, 100, 0);\n var doorMaterial = new t.MeshLambertMaterial({map: t.ImageUtils.loadTexture('/assets/door.png')});\n\n var lDoor = new t.Mesh(doorGeometry, doorMaterial);\n lDoor.position.x = 200;\n lDoor.position.y = HALLHEIGHT / 3;\n lDoor.position.z = - HALLWIDTH / 2 + 1;\n scene.add(lDoor);\n\n var rDoor = new t.Mesh(doorGeometry, doorMaterial);\n rDoor.position.x = 400;\n rDoor.position.y = HALLHEIGHT / 3;\n rDoor.position.z = HALLWIDTH / 2 - 1;\n scene.add(rDoor);\n\n // Some posters\n var posterHeight = HALLHEIGHT * 2 / 3;\n var posters = {\n 'jimi_hendrix.jpg' : [ 50, 1 ],\n 'bob-dylan.jpg' : [ 500, 1 ],\n 'Queen.jpg' : [ 300, -1 ],\n 'rolling.jpg' : [ 500, -1 ],\n 'the-beatles.jpeg' : [ 600, -1 ]\n }\n\n $.each(posters, function(image, position) {\n var texture = new t.ImageUtils.loadTexture('/assets/posters/' + image);\n var geometry = new t.CubeGeometry(texture.image.width / 10, texture.image.height / 10, 0);\n var material = new t.MeshLambertMaterial({ map: texture });\n var poster = new t.Mesh(geometry, material);\n poster.position.x = position[0];\n poster.position.y = posterHeight;\n poster.position.z = HALLWIDTH / 2 * position[1] - position[1];\n scene.add(poster);\n });\n \n\n /*\n var addDefaultFloor = function(){\n // FLOOR\n var floorTexture = new THREE.ImageUtils.loadTexture( '/assets/suelo.png' );\n floorTexture.wrapS = floorTexture.wrapT = THREE.RepeatWrapping;\n floorTexture.repeat.set( 150, 150 );\n var floorMaterial = new THREE.MeshBasicMaterial( { map: floorTexture } );\n var floorGeometry = new THREE.PlaneGeometry(10000, 10000, 10, 10);\n var floor = new THREE.Mesh(floorGeometry, floorMaterial);\n floor.position.y = -0.5;\n floor.doubleSided = true;\n scene.add(floor);\n };\n */\n\t\n /*\n\t// Geometry: walls\n\tvar cube = new t.CubeGeometry(UNITSIZE, WALLHEIGHT, UNITSIZE);\n\tvar materials = [\n\t new t.MeshLambertMaterial({/*color: 0x00CCAA,/map: t.ImageUtils.loadTexture('images/wall-1.jpg')}),\n\t new t.MeshLambertMaterial({/*color: 0xC5EDA0,/map: t.ImageUtils.loadTexture('images/wall-2.jpg')}),\n\t new t.MeshLambertMaterial({color: 0xFBEBCD}),\n\t ];\n\tfor (var i = 0; i < mapW; i++) {\n\t\tfor (var j = 0, m = map[i].length; j < m; j++) {\n\t\t\tif (map[i][j]) {\n\t\t\t\tvar wall = new t.Mesh(cube, materials[map[i][j]-1]);\n\t\t\t\twall.position.x = (i - units/2) * UNITSIZE;\n\t\t\t\twall.position.y = WALLHEIGHT/2;\n\t\t\t\twall.position.z = (j - units/2) * UNITSIZE;\n\t\t\t\tscene.add(wall);\n\t\t\t}\n\t\t}\n\t}\n\t\n */\n\n\t// Lighting\n\tvar directionalLight1 = new t.DirectionalLight( 0xF7EFBE, 0.7 );\n directionalLight1.position.set( 0.5, 1, 0.5 );\n\tscene.add( directionalLight1 );\n\n\tvar directionalLight2 = new t.DirectionalLight( 0xF7EFBE, 0.5 );\n\tdirectionalLight2.position.set( -0.5, -1, -0.5 );\n\tscene.add( directionalLight2 );\n}", "title": "" }, { "docid": "515384c789624930515f2b3c2ee66cbd", "score": "0.5309953", "text": "function makeBase(){\r\n var base = new THREE.Object3D();\r\n\r\n //make wire decal\r\n var wireGeom = new THREE.BoxGeometry(9, 0.75, 9);\r\n var wireframe = new THREE.WireframeGeometry( wireGeom );\r\n var wireSupport = new THREE.LineSegments( wireframe );\r\n wireSupport.material.color.setHex(hexColor);\r\n base.add(wireSupport);\r\n\r\n //make solid base decal\r\n var solidSupportGeom = new THREE.BoxGeometry(9, 0.75, 9);\r\n var solidSupportMaterial = new THREE.MeshBasicMaterial( {color: hexColor} );\r\n var solidSupport = new THREE.Mesh( solidSupportGeom, solidSupportMaterial );\r\n solidSupport.position.set(0,-0.5,0);\r\n base.add(solidSupport);\r\n\r\n //Making the bottom support legs\r\n var bodyPts = Array.prototype.concat(bottomLegs);\r\n var bodyPoints = makePoints(bodyPts);\r\n var spline = makeCurves(bodyPoints, 1);\r\n var firstLeg = makeLatheObj(spline);\r\n\r\n //position and rotate legs\r\n var secondLeg = firstLeg.clone();\r\n secondLeg.rotation.x = THREE.Math.degToRad(10);\r\n secondLeg.rotation.z = THREE.Math.degToRad(20);\r\n secondLeg.position.set(8, -15, -5);\r\n\r\n var thirdLeg = firstLeg.clone();\r\n thirdLeg.rotation.x = THREE.Math.degToRad(10);\r\n thirdLeg.rotation.z = THREE.Math.degToRad(-20);\r\n thirdLeg.position.set(-8, -15, -5);\r\n\r\n var fourthLeg = firstLeg.clone();\r\n fourthLeg.rotation.x = THREE.Math.degToRad(-10);\r\n fourthLeg.position.set(8,-15,5);\r\n fourthLeg.rotation.z = THREE.Math.degToRad(20);\r\n firstLeg.rotation.x = THREE.Math.degToRad(-10);\r\n firstLeg.rotation.z = THREE.Math.degToRad(-20);\r\n firstLeg.position.set(-8, -15, 5);\r\n\r\n //put the middle together\r\n base.add(firstLeg);\r\n base.add(secondLeg);\r\n base.add(thirdLeg);\r\n base.add(fourthLeg);\r\n\r\n //make trapezoid center\r\n var x = 0;\r\n var y = 0;\r\n var trapezoidShape = new THREE.Shape();\r\n trapezoidShape.moveTo( x, y );\r\n trapezoidShape.lineTo(x + 1, y + 3);\r\n trapezoidShape.lineTo( x + 5, y + 3);\r\n trapezoidShape.lineTo(x + 6, y);\r\n trapezoidShape.moveTo(x + 6, y);\r\n trapezoidShape.quadraticCurveTo(3, 3, x, y);\r\n\r\n var trapezoidGeom = new THREE.ShapeGeometry(trapezoidShape);\r\n var trapezoidMaterial = new THREE.MeshBasicMaterial( {color: hexColor} );\r\n var trapezoid = new THREE.Mesh( trapezoidGeom, trapezoidMaterial );\r\n\r\n var trap2 = trapezoid.clone();\r\n var trap3 = trapezoid.clone();\r\n var trap4 = trapezoid.clone();\r\n\r\n trapezoid.position.set(-3,-3,4);\r\n trap2.rotation.y = Math.PI\r\n trap2.position.set(3,-3, -4);\r\n trap3.rotation.y = Math.PI /2\r\n trap3.position.set(4.5, -3, 3)\r\n trap4.rotation.y = - Math.PI /2\r\n trap4.position.set(-4.5, -3, -3)\r\n\r\n base.add(trapezoid);\r\n base.add(trap2);\r\n base.add(trap3);\r\n base.add(trap4);\r\n\r\n return base\r\n }", "title": "" }, { "docid": "5bf424dbaf80beacce5e3f5fc958aee3", "score": "0.5303214", "text": "updateCutPlanes() {\n if (!this.mesh) {\n return;\n }\n const mtx = new THREE.Matrix4();\n if (this.renderScene === SCENE_TYPE_SPHERE) {\n mtx.getInverse(mtx.extractRotation(this.meshSphere.matrix));\n } else {\n mtx.getInverse(mtx.extractRotation(this.mesh.matrix));\n }\n const xAxis = new THREE.Vector3(-1.0, 0.0, 0.0);\n const yAxis = new THREE.Vector3(0.0, -1.0, 0.0);\n const zAxis = new THREE.Vector3(0.0, 0.0, -1.0);\n const centerPt = new THREE.Vector3().copy(this.planeCenterPt);\n centerPt.applyMatrix4(mtx);\n xAxis.applyMatrix4(mtx);\n yAxis.applyMatrix4(mtx);\n zAxis.applyMatrix4(mtx);\n this.matFF.uniforms.PlaneX.value.x = xAxis.x;\n this.matFF.uniforms.PlaneX.value.y = xAxis.y;\n this.matFF.uniforms.PlaneX.value.z = xAxis.z;\n this.matFF.uniforms.PlaneX.value.w = -centerPt.dot(xAxis);\n\n this.matFF.uniforms.PlaneY.value.x = yAxis.x;\n this.matFF.uniforms.PlaneY.value.y = yAxis.y;\n this.matFF.uniforms.PlaneY.value.z = yAxis.z;\n this.matFF.uniforms.PlaneY.value.w = -centerPt.dot(yAxis);\n\n this.matFF.uniforms.PlaneZ.value.x = -zAxis.x;\n this.matFF.uniforms.PlaneZ.value.y = zAxis.y;\n this.matFF.uniforms.PlaneZ.value.z = zAxis.z;\n this.matFF.uniforms.PlaneZ.value.w = -centerPt.dot(zAxis);\n }", "title": "" }, { "docid": "92c0d16752bb118cd44560077335de55", "score": "0.5301469", "text": "function init_threeScene(spec){\n\n\n CANVASELEMENT=spec.canvasElement;\n\n //INIT THE THREE.JS context\n THREERENDERER=new THREE.WebGLRenderer({\n context: spec.GL,\n canvas: CANVASELEMENT\n });\n\n //COMPOSITE OBJECT WHICH WILL FOLLOW THE HEAD\n //in fact we create 2 objects to be able to shift the pivot point\n THREEFACEOBJ3D=new THREE.Object3D();\n THREEFACEOBJ3D.frustumCulled=true;\n THREEFACEOBJ3DPIVOTED=new THREE.Object3D();\n THREEFACEOBJ3DPIVOTED.frustumCulled=true;\n THREEFACEOBJ3DPIVOTED.position.set(0, -SETTINGS.pivotOffsetYZ[0], -SETTINGS.pivotOffsetYZ[1]);\n THREEFACEOBJ3D.add(THREEFACEOBJ3DPIVOTED);\n\t\n\t const mat=new THREE.ShaderMaterial({\n vertexShader: THREE.ShaderLib.basic.vertexShader,\n fragmentShader: \"precision lowp float;\\n void main(void){\\n gl_FragColor=vec4(1.,0.,0.,1.);\\n }\",\n uniforms: THREE.ShaderLib.basic.uniforms,\n colorWrite: false\n });\n\n //IMPORT THE GLTF MODEL\n //from https://threejs.org/examples/#webgl_loader_gltf\n var gltfLoader = new THREE.GLTFLoader();\n gltfLoader.load( SETTINGS.gltfModelURL, function ( gltf ) {\n\n gltf.scene.traverse( function ( child ) {\n if ( child.isMesh && child.name == \"mesh_1\") {\n //occluderGeometry.computeVertexNormals(); mat=new THREE.MeshNormalMaterial({side: THREE.DoubleSide});\n child.renderOrder=-1; //render first\n child.material=mat;\n\t\t\t\tchild.material.transparent = true;\n\t\t\t\tchild.material.opacity = 0.4;\n }\n\t\t\tif ( child.isMesh && child.name == \"mesh_0\") {\n\t\t\t\t\tvar l = new THREE.Vector3();\n\t\t\t\t\tl = child.getWorldPosition();\n\t\t\t\t\t\n\t\t\t\t\tvar c = new THREE.Vector3();\n\t\t\t\t\tc = child.localToWorld(l);\n\t\t\t\t\t\n\t\t\t\t\tx = c.x;\n\t\t\t\t\ty = c.y;\n\t\t\t\t\tz = c.z;\n\t\t\t\t \n\t\t\t\t\tgreen1 = child;\n\t\t\t\t\tchild.material=mat;\n\t\t\t\t\t\n }\n\t\t\t\n\t\t\tif ( child.isMesh && child.name == \"mesh_2\") {\n\t\t\t\t\tvar l = new THREE.Vector3();\n\t\t\t\t\tl = child.getWorldPosition();\n\t\t\t\t\t\n\t\t\t\t\tvar c = new THREE.Vector3();\n\t\t\t\t\tc = child.localToWorld(l);\n\t\t\t\t\t\n\t\t\t\t\tx2 = c.x;\n\t\t\t\t\ty2 = c.y;\n\t\t\t\t\tz2 = c.z;\n\t\t\t\t \n\t\t\t\t\tgreen2 = child;\n\t\t\t\t\tchild.material=mat;\n\t\t\t\t\t\n }\n\t\t\tif ( child.isMesh && child.name == \"mesh_3\") {\n\t\t\t\t\tchild.material=mat;\n\t\t\t\t\t\n }\n } );\n gltf.scene.frustumCulled=false;\n \n //center and scale the object\n var bbox=new THREE.Box3().expandByObject(gltf.scene);\n\n //center the model :\n var centerBBox=bbox.getCenter(new THREE.Vector3());\n\n gltf.scene.position.add(new THREE.Vector3(0,SETTINGS.offsetYZ[0], SETTINGS.offsetYZ[1]));\n\n //scale the model according to its width\n var sizeX=bbox.getSize(new THREE.Vector3()).x;\n gltf.scene.scale.multiplyScalar((SETTINGS.scale/sizeX) * 1.05);\n\n //dispatch the model\n THREEFACEOBJ3DPIVOTED.add( gltf.scene );\n\n\n var loader = new THREE.TextureLoader().load('image/1.png');\n\n // Load an image file into a custom material\n var material = new THREE.MeshBasicMaterial({\n map: loader,\n color: '#FFF',\n shader: 'flat',\n side: 'double',\n transparent: true,\n alphaTest: 0.5\n });\n\n // create a plane geometry for the image with a width of 10\n // and a height that preserves the image's aspect ratio\n var geometry = new THREE.PlaneGeometry(1, 2);\n\n // combine our image geometry and material into a mesh\n var mesh = new THREE.Mesh(geometry, material);\n\n // set the position of the image mesh in the x,y,z dimensions\n mesh.position.set(x - 0.11,y + 0.5,z-0.9);\n\n mesh.rotation.set(1.4443595413034305,0,0);\n\n mesh.scale.multiplyScalar(1);\n\n //dispatch the model\n green1.add( mesh ); \n\n \n var loader = new THREE.TextureLoader().load('image/1.png');\n\n // Load an image file into a custom material\n var material = new THREE.MeshBasicMaterial({\n map: loader,\n color: '#FFF',\n shader: 'flat',\n side: 'double',\n transparent: true,\n alphaTest: 0.5\n });\n\n // create a plane geometry for the image with a width of 10\n // and a height that preserves the image's aspect ratio\n var geometry = new THREE.PlaneGeometry(1, 2);\n\n // combine our image geometry and material into a mesh\n var mesh = new THREE.Mesh(geometry, material);\n\n // set the position of the image mesh in the x,y,z dimensions\n mesh.position.set(x + 0.10,y + 0.5,z-0.9);\n\n mesh.rotation.set(1.444359541303435,0,0);\n\n mesh.scale.multiplyScalar(1);\n\n //dispatch the model\n green2.add( mesh );\n\n }); //end gltfLoader.load callback\n\n //CREATE THE SCENE\n THREESCENE=new THREE.Scene();\n THREESCENE.add(THREEFACEOBJ3D);\n\n\n //init video texture with red\n THREEVIDEOTEXTURE=new THREE.DataTexture( new Uint8Array([255,0,0]), 1, 1, THREE.RGBFormat);\n THREEVIDEOTEXTURE.needsUpdate=true;\n\n //CREATE THE VIDEO BACKGROUND\n var videoMaterial=new THREE.RawShaderMaterial({\n depthWrite: false,\n depthTest: false,\n vertexShader: \"attribute vec2 position;\\n\\\n varying vec2 vUV;\\n\\\n void main(void){\\n\\\n gl_Position=vec4(position, 0., 1.);\\n\\\n vUV=0.5+vec2(-0.5,0.5)*position; //inverse X axis for mirror\\n\\\n }\",\n fragmentShader: \"precision lowp float;\\n\\\n uniform sampler2D samplerVideo;\\n\\\n varying vec2 vUV;\\n\\\n void main(void){\\n\\\n gl_FragColor=texture2D(samplerVideo, vUV);\\n\\\n }\",\n uniforms:{\n samplerVideo: {value: THREEVIDEOTEXTURE}\n }\n });\n var videoGeometry=new THREE.BufferGeometry()\n var videoScreenCorners=new Float32Array([-1,-1, 1,-1, 1,1, -1,1]);\n videoGeometry.addAttribute( 'position', new THREE.BufferAttribute( videoScreenCorners, 2 ) );\n videoGeometry.setIndex(new THREE.BufferAttribute(new Uint16Array([0,1,2, 0,2,3]), 1));\n var videoMesh=new THREE.Mesh(videoGeometry, videoMaterial);\n videoMesh.onAfterRender=function(){\n //replace THREEVIDEOTEXTURE.__webglTexture by the real video texture\n THREERENDERER.properties.update(THREEVIDEOTEXTURE, '__webglTexture', spec.videoTexture);\n THREEVIDEOTEXTURE.magFilter=THREE.LinearFilter;\n THREEVIDEOTEXTURE.minFilter=THREE.LinearFilter;\n delete(videoMesh.onAfterRender);\n };\n videoMesh.renderOrder=-1000; //render first\n videoMesh.frustumCulled=false;\n THREESCENE.add(videoMesh);\n \n //CREATE THE CAMERA\n THREECAMERA=new THREE.PerspectiveCamera(SETTINGS.cameraFOV, 1, 0.1, 100);\n set_fullScreen();\n} //end init_threeScene()", "title": "" }, { "docid": "d4cc6f6b502261b67e1a5e6d99783081", "score": "0.5282535", "text": "function createDiscontiniousMeshGeometry(lBorderPoints, rBorderPoints) {\n\n\tvar dashPnts = 5;\n\tvar gapPnts = 3;\n\n\tvar geometry = new THREE.BufferGeometry();\n\tvar vertices = [];\n\n\tfor (var i = 0; i < Math.min(lBorderPoints.length, rBorderPoints.length) - 1; i++) {\n \n\t\t// 0 -- 1 -- 2 -- 3 -- 4 -- 5 xx 6 xx 7 xx 8 -- 9 ...\n\t\tif (i % (dashPnts + gapPnts) < dashPnts) {\n\t\t\tvertices = vertices.concat([rBorderPoints[i].x, rBorderPoints[i].y, rBorderPoints[i].z]);\n\t\t\tvertices = vertices.concat([rBorderPoints[i + 1].x, rBorderPoints[i + 1].y, rBorderPoints[i + 1].z]);\n\t\t\tvertices = vertices.concat([lBorderPoints[i + 1].x, lBorderPoints[i + 1].y, lBorderPoints[i + 1].z]);\n\n\t\t\tvertices = vertices.concat([rBorderPoints[i].x, rBorderPoints[i].y, rBorderPoints[i].z]);\n\t\t\tvertices = vertices.concat([lBorderPoints[i + 1].x, lBorderPoints[i + 1].y, lBorderPoints[i + 1].z]);\n\t\t\tvertices = vertices.concat([lBorderPoints[i].x, lBorderPoints[i].y, lBorderPoints[i].z]);\n\t\t}\n\t}\n\n\tvertices = Float32Array.from(vertices)\n\t// itemSize = 3 becuase there are 3 values (components) per vertex\n\tgeometry.addAttribute('position', new THREE.BufferAttribute(vertices, 3));\n\n\treturn geometry;\n}", "title": "" }, { "docid": "9bc721f1be169a0646de50104cbc3345", "score": "0.5275326", "text": "function initObject() {\r\n var material1 = new THREE.MeshPhongMaterial({\r\n color: bgColor,\r\n opacity: 0.85,\r\n transparent: true,\r\n polygonOffset: true,\r\n polygonOffsetFactor: 1, // positive value pushes polygon further away\r\n polygonOffsetUnits: 1\r\n });\r\n var material2 = new THREE.MeshPhongMaterial({\r\n color: solidColor,\r\n specular: solidColor,\r\n shininess: 100.0,\r\n });\r\n var manager = new THREE.LoadingManager();\r\n manager.onLoad = function () {\r\n document.getElementById(\"loading\").style.display = \"none\";\r\n };\r\n (new THREE.STLLoader(manager)).load(model, function(geometry) {\r\n mesh2 = new THREE.Mesh(geometry, material2);\r\n mesh2.geometry.computeFaceNormals();\r\n mesh2.geometry.computeVertexNormals();\r\n scene.add(mesh2);\r\n scene.remove(mesh2);\r\n });\r\n (new THREE.STLLoader(manager)).load(model, function(geometry) {\r\n mesh1 = new THREE.Mesh(geometry, material1);\r\n mesh1.geometry.computeFaceNormals();\r\n mesh1.geometry.computeVertexNormals();\r\n scene.add(mesh1);\r\n var geo = new THREE.EdgesGeometry(mesh1.geometry); // or WireframeGeometry\r\n var mat = new THREE.LineBasicMaterial({\r\n color: edgeColor,\r\n linewidth: 2\r\n });\r\n var outline = new THREE.LineSegments(geo, mat);\r\n mesh1.add(outline);\r\n var middle = new THREE.Vector3(); // Compute the middle\r\n geometry.computeBoundingBox();\r\n geometry.boundingBox.getCenter(middle);\r\n mesh1.position.x = -1 * middle.x; // Center it\r\n mesh1.position.y = -1 * middle.y;\r\n mesh1.position.z = -1 * middle.z;\r\n var largestDimension = Math.max(geometry.boundingBox.max.x,\r\n geometry.boundingBox.max.y, geometry.boundingBox.max.z); // Pull the camera away as needed\r\n camera.position.z = largestDimension * distScale;\r\n doFrame();\r\n });\r\n}", "title": "" }, { "docid": "7a21b12a15ab556070b21827a7d0e255", "score": "0.5220152", "text": "function generateCubeGeometry() {\n\tvar cubeMesh={vertices:[],texCoords:[],normals:[]};\n\t// TARA: Vertex positions (I tried to make them all clockwise)\n\tcubeMesh.vertices = [\n\t\t// Front face\n\t\tvec3( 1, 1, 1),\n\t\tvec3( 1, -1, 1),\n\t\tvec3(-1, -1, 1),\n\t\tvec3( 1, 1, 1),\n\t\tvec3(-1, -1, 1),\n\t\tvec3(-1, 1, 1),\n\t\t// Back face\n\t\tvec3(-1, -1, -1),\n\t\tvec3(-1, 1, -1),\n\t\tvec3( 1, 1, -1),\n\t\tvec3(-1, -1, -1),\n\t\tvec3( 1, 1, -1),\n\t\tvec3( 1, -1, -1),\n\t\t// Top face\n\t\tvec3(-1, 1, -1),\n\t\tvec3( 1, 1, 1),\n\t\tvec3(-1, 1, 1),\n\t\tvec3( 1, 1, -1),\n\t\tvec3(-1, 1, -1),\n\t\tvec3( 1, 1, 1),\n\t\t// Bottom face\n\t\tvec3(-1, -1, -1),\n\t\tvec3( 1, -1, -1),\n\t\tvec3( 1, -1, 1),\n\t\tvec3(-1, -1, 1),\n\t\tvec3(-1, -1, -1),\n\t\tvec3( 1, -1, 1),\n\t\t// Right face\n\t\tvec3( 1, -1, -1),\n\t\tvec3( 1, 1, -1),\n\t\tvec3( 1, 1, 1),\n\t\tvec3( 1, -1, 1),\n\t\tvec3( 1, -1, -1),\n\t\tvec3( 1, 1, 1),\n\t\t// Left face\n\t\tvec3(-1, -1, -1),\n\t\tvec3(-1, 1, 1),\n\t\tvec3(-1, -1, 1),\n\t\tvec3(-1, 1, -1),\n\t\tvec3(-1, -1, -1),\n\t\tvec3(-1, 1, 1)\n\t];\n\t// TARA: Ignore the coordinates that are all the same throughout the vertices of a face\n\t// and then make -1 a 0. (E.g. for front face all z coordinates are 1, ignore them)\n\tcubeMesh.texCoords = [\n\t\t// Front face\n\t\tvec2(1,1),\n\t\tvec2(1,0),\n\t\tvec2(0,0),\n\t\tvec2(0,0),\n\t\tvec2(1,1),\n\t\tvec2(0,1),\n\t\t// Back face\n\t\tvec2(0,0),\n\t\tvec2(0,1),\n\t\tvec2(1,1),\n\t\tvec2(0,0),\n\t\tvec2(1,1),\n\t\tvec2(1,0),\n\t\t// Top face\n\t\tvec2(0,0),\n\t\tvec2(1,1),\n\t\tvec2(0,1),\n\t\tvec2(1,0),\n\t\tvec2(0,0),\n\t\tvec2(1,1),\n\t\t// Bottom face\n\t\tvec2(0,0),\n\t\tvec2(1,0),\n\t\tvec2(1,1),\n\t\tvec2(0,1),\n\t\tvec2(0,0),\n\t\tvec2(1,1),\n\t\t// Right face\n\t\tvec2(0,0),\n\t\tvec2(1,0),\n\t\tvec2(1,1),\n\t\tvec2(0,1),\n\t\tvec2(0,0),\n\t\tvec2(1,1),\n\t\t// Left face\n\t\tvec2(0,0),\n\t\tvec2(1,1),\n\t\tvec2(0,1),\n\t\tvec2(1,0),\n\t\tvec2(0,0),\n\t\tvec2(1,1)\n\t];\n\t// TARA: Finally, the normals. Do the opposite as for texture coordinates. Focus\n\t// on the ones that are the same and then make the others 0. (E.g. for front face,\n\t// since all z coordinates are 1, the normal vector will be (0,0,1) for all vertices)\n\tcubeMesh.normals = [\n\t\t// Front face\n\t\tvec3(0,0,1),\n\t\tvec3(0,0,1),\n\t\tvec3(0,0,1),\n\t\tvec3(0,0,1),\n\t\tvec3(0,0,1),\n\t\tvec3(0,0,1),\n\t\t// Back face\n\t\tvec3(0,0,-1),\n\t\tvec3(0,0,-1),\n\t\tvec3(0,0,-1),\n\t\tvec3(0,0,-1),\n\t\tvec3(0,0,-1),\n\t\tvec3(0,0,-1),\n\t\t// Top face\n\t\tvec3(0,1,0),\n\t\tvec3(0,1,0),\n\t\tvec3(0,1,0),\n\t\tvec3(0,1,0),\n\t\tvec3(0,1,0),\n\t\tvec3(0,1,0),\n\t\t// Bottom face\n\t\tvec3(0,-1,0),\n\t\tvec3(0,-1,0),\n\t\tvec3(0,-1,0),\n\t\tvec3(0,-1,0),\n\t\tvec3(0,-1,0),\n\t\tvec3(0,-1,0),\n\t\t// Right face\n\t\tvec3(1,0,0),\n\t\tvec3(1,0,0),\n\t\tvec3(1,0,0),\n\t\tvec3(1,0,0),\n\t\tvec3(1,0,0),\n\t\tvec3(1,0,0),\n\t\t// Left face\n\t\tvec3(-1,0,0),\n\t\tvec3(-1,0,0),\n\t\tvec3(-1,0,0),\n\t\tvec3(-1,0,0),\n\t\tvec3(-1,0,0),\n\t\tvec3(-1,0,0)\n\t];\n\n\treturn cubeMesh;\n}", "title": "" }, { "docid": "19e1dbd18464e7c8eacc2913e1a6c700", "score": "0.5189857", "text": "createTileMaps() {\n if ((this.m_volumeData === null) || (this.m_volumeHeader === null)) {\n return;\n }\n const volTexture = this.m_volTexture;\n const xDim = this.m_volumeHeader.m_pixelWidth;\n const yDim = this.m_volumeHeader.m_pixelHeight;\n const zDim = this.m_volumeHeader.m_pixelDepth;\n\n // remove old rendered mesh\n if (this.m_mesh !== null) {\n this.m_scene.remove(this.m_mesh);\n this.m_mesh = null;\n this.m_material = null;\n }\n\n this.m_matIndex = -1;\n // let numMaterials = 0;\n // let w = 0;\n // let h = 0;\n let wPhys = 0.0;\n let hPhys = 0.0;\n\n //\n // 2 3\n //\n // 0 1\n //\n this.m_geometry.faceVertexUvs[0][0][0].y = 1.0;\n this.m_geometry.faceVertexUvs[0][0][1].y = 1.0;\n this.m_geometry.faceVertexUvs[0][0][2].y = 0.0;\n this.m_geometry.faceVertexUvs[0][1][0].y = 0.0;\n this.m_geometry.faceVertexUvs[0][1][1].y = 0.0;\n this.m_geometry.faceVertexUvs[0][1][2].y = 1.0;\n\n if (this.m_sliceAxis === Graphics2d.SLICE_AXIS_Z) {\n // Transverse (Z)\n // w = xDim;\n // h = yDim;\n // const xyDim = xDim * yDim;\n wPhys = this.m_volumeBox.x;\n hPhys = this.m_volumeBox.y;\n } else if (this.m_sliceAxis === Graphics2d.SLICE_AXIS_Y) {\n // Coronal (Y)\n // w = xDim;\n // h = zDim;\n // const xyDim = xDim * yDim;\n wPhys = this.m_volumeBox.x;\n hPhys = this.m_volumeBox.z;\n } else if (this.m_sliceAxis === Graphics2d.SLICE_AXIS_X) {\n // Sagital (X)\n // w = yDim;\n // h = zDim;\n // const xyDim = xDim * yDim;\n wPhys = this.m_volumeBox.y;\n hPhys = this.m_volumeBox.z;\n }\n\n //\n // fix screen coordinates\n //\n // v2 ----- v3\n // | |\n // | |\n // v0 ----- v1\n const wScreen = this.m_width;\n const hScreen = this.m_height;\n\n this.m_wProjScreen = wScreen;\n this.m_hProjScreen = this.m_wProjScreen * hPhys / wPhys;\n if (this.m_hProjScreen > hScreen) {\n this.m_hProjScreen = hScreen;\n this.m_wProjScreen = this.m_hProjScreen * wPhys / hPhys;\n if (this.m_wProjScreen > wScreen) {\n console.log('Too bad logic');\n }\n }\n // normalize to [0..1]\n this.m_wProjScreen /= wScreen;\n this.m_hProjScreen /= hScreen;\n\n // console.log(`wProjScreen = ${this.m_wProjScreen} hProjScreen = ${this.m_hProjScreen}`);\n\n // scale to 2: screen size in [0..2]\n const MULT_TWICE = 2;\n const wProjScreen = this.m_wProjScreen * MULT_TWICE;\n const hProjScreen = this.m_hProjScreen * MULT_TWICE;\n\n this.m_geometry.vertices[2].x = -1.0;\n this.m_geometry.vertices[2].y = +1.0;\n this.m_geometry.vertices[0].x = -1.0;\n this.m_geometry.vertices[3].y = +1.0;\n\n // assign screen rect to render , in [-1..+1]\n this.m_geometry.vertices[1].x = wProjScreen - 1.0;\n this.m_geometry.vertices[3].x = wProjScreen - 1.0;\n this.m_geometry.vertices[0].y = 1.0 - hProjScreen;\n this.m_geometry.vertices[1].y = 1.0 - hProjScreen;\n\n this.m_geometry.verticesNeedUpdate = true;\n this.m_geometry.uvsNeedUpdate = true;\n\n const matTex2d = new MaterialTex2d();\n this.m_materialsTex2d = matTex2d;\n // this.m_materialsTex2d.push(matTex2d);\n\n const sliceIndex = Math.floor(this.m_sliderPosition * zDim);\n matTex2d.create(volTexture, xDim, yDim, zDim, this.m_sliceAxis, sliceIndex, this.m_isRoiVolume);\n const mat = matTex2d.m_material;\n if (this.m_material === null) {\n this.m_material = mat;\n this.m_mesh = new THREE.Mesh(this.m_geometry, this.m_material);\n this.m_scene.add(this.m_mesh);\n }\n this.updateTexMapWithNewSliderPos();\n\n this.createMarkLinesAndText();\n const SCREEN_MULT = 2.0;\n // update 2d tools with new volume data\n if (this.m_sliceAxis === Graphics2d.SLICE_AXIS_Z) {\n this.m_distanceTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.y / (SCREEN_MULT * this.m_hProjScreen));\n this.m_areaTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.y / (SCREEN_MULT * this.m_hProjScreen));\n this.m_rectTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.y / (SCREEN_MULT * this.m_hProjScreen));\n this.m_contrastBrightTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.y / (SCREEN_MULT * this.m_hProjScreen));\n } else if (this.m_sliceAxis === Graphics2d.SLICE_AXIS_Y) {\n this.m_distanceTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n this.m_areaTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n this.m_rectTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n this.m_contrastBrightTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n } else if (this.m_sliceAxis === Graphics2d.SLICE_AXIS_X) {\n this.m_distanceTool.setPixelSize(this.m_volumeBox.y / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n this.m_areaTool.setPixelSize(this.m_volumeBox.y / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n this.m_rectTool.setPixelSize(this.m_volumeBox.y / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n this.m_contrastBrightTool.setPixelSize(this.m_volumeBox.y / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n }\n this.m_pickTool.setProjScreen(this.m_wProjScreen, this.m_hProjScreen);\n this.m_pickTool.setHeader(this.m_volumeHeader);\n this.m_pickTool.setData(this.m_volumeData);\n this.m_materialsTex2d.m_uniforms.xPixelSize.value = 1 / this.m_volumeHeader.m_pixelWidth;\n this.m_materialsTex2d.m_uniforms.yPixelSize.value = 1 / this.m_volumeHeader.m_pixelHeight;\n\n this.m_readyCounter++;\n // console.log('Graphics2d.createTileMaps() is finished');\n }", "title": "" }, { "docid": "b72ae8c6bcbab6ddd2c1b697f461a6be", "score": "0.5188745", "text": "setnewNormal() {\n // loop through all vertices\n for (var i = 0; i <= this.div; i++) {\n for (var j = 0; j <= this.div; j++) {\n // first set corner vertices\n // left bottom\n if (i == 0 && j == 0) {\n var v0 = vec3.create();\n var v1 = vec3.create();\n var v2 = vec3.create();\n \n // n = (v1 - v0) x (v2 - v0)\n this.getVertex(v0, i, j);\n this.getVertex(v1, i, j + 1);\n this.getVertex(v2, i + 1, j);\n\n var crossvector1 = vec3.create();\n var crossvector2 = vec3.create();\n\n this.subarray(v0, v1, crossvector1);\n this.subarray(v0, v2, crossvector2);\n\n var norm = vec3.create();\n this.cross(crossvector1, crossvector2, norm);\n // for left bottom coner, only one face\n var avg_norm = vec3.create();\n this.normarray(norm, avg_norm);\n\n this.nBuffer[3 * (i * (this.div + 1) + j)] = avg_norm[0];\n this.nBuffer[3 * (i * (this.div + 1) + j) + 1] = avg_norm[1];\n this.nBuffer[3 * (i * (this.div + 1) + j) + 2] = avg_norm[2];\n // right bottom\n } else if (i == 0 && j == this.div) {\n var v0 = vec3.create();\n var v1 = vec3.create();\n var v2 = vec3.create();\n var v3 = vec3.create();\n\n this.getVertex(v0, i, j);\n this.getVertex(v1, i, j - 1);\n this.getVertex(v2, i + 1, j - 1);\n this.getVertex(v3, i + 1, j);\n // two faces for this corner\n // sum these two normals and then take the average\n var crossvector1 = vec3.create();\n var crossvector2 = vec3.create();\n var crossvector3 = vec3.create();\n\n this.subarray(v0, v1, crossvector1);\n this.subarray(v0, v2, crossvector2);\n this.subarray(v0, v3, crossvector3);\n\n var norm1 = vec3.create();\n this.cross(crossvector2, crossvector1, norm1);\n var norm2 = vec3.create();\n this.cross(crossvector3, crossvector2, norm2);\n\n var totalnorm = vec3.create();\n this.addarray(norm1, norm2, totalnorm);\n\n var avg_norm = vec3.create();\n this.normarray([totalnorm[0] / 2, totalnorm[1] / 2, totalnorm[2] / 2], avg_norm);\n\n this.nBuffer[3 * (i * (this.div + 1) + j)] = avg_norm[0];\n this.nBuffer[3 * (i * (this.div + 1) + j) + 1] = avg_norm[1];\n this.nBuffer[3 * (i * (this.div + 1) + j) + 2] = avg_norm[2];\n // left top\n } else if (i == this.div && j == 0) {\n var v0 = vec3.create();\n var v1 = vec3.create();\n var v2 = vec3.create();\n var v3 = vec3.create();\n\n this.getVertex(v0, i, j);\n this.getVertex(v1, i - 1, j);\n this.getVertex(v2, i - 1, j + 1);\n this.getVertex(v3, i, j + 1);\n\n var crossvector1 = vec3.create();\n var crossvector2 = vec3.create();\n var crossvector3 = vec3.create();\n // two faces\n // sum and take average\n this.subarray(v0, v1, crossvector1);\n this.subarray(v0, v2, crossvector2);\n this.subarray(v0, v3, crossvector3);\n\n var norm1 = vec3.create();\n this.cross(crossvector1, crossvector2, norm1);\n var norm2 = vec3.create();\n this.cross(crossvector2, crossvector3, norm2);\n\n var totalnorm = vec3.create();\n this.addarray(norm1, norm2, totalnorm);\n\n var avg_norm = vec3.create();\n this.normarray([totalnorm[0] / 2, totalnorm[1] / 2, totalnorm[2] / 2], avg_norm);\n\n this.nBuffer[3 * (i * (this.div + 1) + j)] = avg_norm[0];\n this.nBuffer[3 * (i * (this.div + 1) + j) + 1] = avg_norm[1];\n this.nBuffer[3 * (i * (this.div + 1) + j) + 2] = avg_norm[2];\n // right top\n } else if (i == this.div && j == this.div) {\n var v0 = vec3.create();\n var v1 = vec3.create();\n var v2 = vec3.create();\n\n this.getVertex(v0, i, j);\n this.getVertex(v1, i, j - 1);\n this.getVertex(v2, i - 1, j);\n\n var crossvector1 = vec3.create();\n var crossvector2 = vec3.create();\n\n this.subarray(v0, v1, crossvector1);\n this.subarray(v0, v2, crossvector2);\n // one face\n var norm = vec3.create();\n this.cross(crossvector1, crossvector2, norm);\n\n var avg_norm = vec3.create();\n this.normarray(norm, avg_norm);\n\n this.nBuffer[3 * (i * (this.div + 1) + j)] = avg_norm[0];\n this.nBuffer[3 * (i * (this.div + 1) + j) + 1] = avg_norm[1];\n this.nBuffer[3 * (i * (this.div + 1) + j) + 2] = avg_norm[2];\n // left edge of the terrain without corner\n } else if (i == 0 && j != 0 && j != this.div) {\n var v0 = vec3.create();\n var v1 = vec3.create();\n var v2 = vec3.create();\n var v3 = vec3.create();\n var v4 = vec3.create();\n // each of these vertices have four faces around it\n this.getVertex(v0, i, j);\n this.getVertex(v1, i, j - 1);\n this.getVertex(v2, i + 1, j - 1);\n this.getVertex(v3, i + 1, j);\n this.getVertex(v4, i, j + 1);\n\n var crossvector1 = vec3.create();\n var crossvector2 = vec3.create();\n var crossvector3 = vec3.create();\n var crossvector4 = vec3.create();\n\n this.subarray(v0, v1, crossvector1);\n this.subarray(v0, v2, crossvector2);\n this.subarray(v0, v3, crossvector3);\n this.subarray(v0, v4, crossvector4);\n // take sum of 4 faces and them take average\n var norm1 = vec3.create();\n this.cross(crossvector2, crossvector1, norm1);\n var norm2 = vec3.create();\n this.cross(crossvector3, crossvector2, norm2);\n var norm3 = vec3.create();\n this.cross(crossvector4, crossvector3, norm3);\n\n var totalnorm = vec3.create();\n this.addarray(norm1, norm2, totalnorm);\n this.addarray(norm3, totalnorm, totalnorm);\n\n var avg_norm = vec3.create();\n this.normarray([totalnorm[0] / 3, totalnorm[1] / 3, totalnorm[2] / 3], avg_norm);\n\n this.nBuffer[3 * (i * (this.div + 1) + j)] = avg_norm[0];\n this.nBuffer[3 * (i * (this.div + 1) + j) + 1] = avg_norm[1];\n this.nBuffer[3 * (i * (this.div + 1) + j) + 2] = avg_norm[2];\n // left edge\n } else if (j == 0 && i != 0 && i != this.div) {\n var v0 = vec3.create();\n var v1 = vec3.create();\n var v2 = vec3.create();\n var v3 = vec3.create();\n var v4 = vec3.create();\n\n this.getVertex(v0, i, j);\n this.getVertex(v1, i - 1, j);\n this.getVertex(v2, i - 1, j + 1);\n this.getVertex(v3, i, j + 1);\n this.getVertex(v4, i + 1, j);\n\n var crossvector1 = vec3.create();\n var crossvector2 = vec3.create();\n var crossvector3 = vec3.create();\n var crossvector4 = vec3.create();\n\n this.subarray(v0, v1, crossvector1);\n this.subarray(v0, v2, crossvector2);\n this.subarray(v0, v3, crossvector3);\n this.subarray(v0, v4, crossvector4);\n\n var norm1 = vec3.create();\n this.cross(crossvector1, crossvector2, norm1);\n var norm2 = vec3.create();\n this.cross(crossvector2, crossvector3, norm2);\n var norm3 = vec3.create();\n this.cross(crossvector3, crossvector4, norm3);\n\n var totalnorm = vec3.create();\n this.addarray(norm1, norm2, totalnorm);\n this.addarray(norm3, totalnorm, totalnorm);\n\n var avg_norm = vec3.create();\n this.normarray([totalnorm[0] / 3, totalnorm[1] / 3, totalnorm[2] / 3], avg_norm);\n\n this.nBuffer[3 * (i * (this.div + 1) + j)] = avg_norm[0];\n this.nBuffer[3 * (i * (this.div + 1) + j) + 1] = avg_norm[1];\n this.nBuffer[3 * (i * (this.div + 1) + j) + 2] = avg_norm[2];\n // top edge\n } else if (i == this.div && j != 0 && j != this.div) {\n var v0 = vec3.create();\n var v1 = vec3.create();\n var v2 = vec3.create();\n var v3 = vec3.create();\n var v4 = vec3.create();\n\n this.getVertex(v0, i, j);\n this.getVertex(v1, i, j - 1);\n this.getVertex(v2, i - 1, j);\n this.getVertex(v3, i - 1, j + 1);\n this.getVertex(v4, i, j + 1);\n\n var crossvector1 = vec3.create();\n var crossvector2 = vec3.create();\n var crossvector3 = vec3.create();\n var crossvector4 = vec3.create();\n\n this.subarray(v0, v1, crossvector1);\n this.subarray(v0, v2, crossvector2);\n this.subarray(v0, v3, crossvector3);\n this.subarray(v0, v4, crossvector4);\n\n var norm1 = vec3.create();\n this.cross(crossvector1, crossvector2, norm1);\n var norm2 = vec3.create();\n this.cross(crossvector2, crossvector3, norm2);\n var norm3 = vec3.create();\n this.cross(crossvector3, crossvector4, norm3);\n\n var totalnorm = vec3.create();\n this.addarray(norm1, norm2, totalnorm);\n this.addarray(norm3, totalnorm, totalnorm);\n\n var avg_norm = vec3.create();\n this.normarray([totalnorm[0] / 3, totalnorm[1] / 3, totalnorm[2] / 3], avg_norm);\n\n this.nBuffer[3 * (i * (this.div + 1) + j)] = avg_norm[0];\n this.nBuffer[3 * (i * (this.div + 1) + j) + 1] = avg_norm[1];\n this.nBuffer[3 * (i * (this.div + 1) + j) + 2] = avg_norm[2];\n // right edge\n } else if (j == this.div && i != 0 && i != this.div) {\n var v0 = vec3.create();\n var v1 = vec3.create();\n var v2 = vec3.create();\n var v3 = vec3.create();\n var v4 = vec3.create();\n\n this.getVertex(v0, i, j);\n this.getVertex(v1, i - 1, j);\n this.getVertex(v2, i, j - 1);\n this.getVertex(v3, i + 1, j - 1);\n this.getVertex(v4, i + 1, j);\n\n var crossvector1 = vec3.create();\n var crossvector2 = vec3.create();\n var crossvector3 = vec3.create();\n var crossvector4 = vec3.create();\n\n this.subarray(v0, v1, crossvector1);\n this.subarray(v0, v2, crossvector2);\n this.subarray(v0, v3, crossvector3);\n this.subarray(v0, v4, crossvector4);\n\n var norm1 = vec3.create();\n this.cross(crossvector2, crossvector1, norm1);\n var norm2 = vec3.create();\n this.cross(crossvector3, crossvector2, norm2);\n var norm3 = vec3.create();\n this.cross(crossvector4, crossvector3, norm3);\n\n var totalnorm = vec3.create();\n this.addarray(norm1, norm2, totalnorm);\n this.addarray(norm3, totalnorm, totalnorm);\n\n var avg_norm = vec3.create();\n this.normarray([totalnorm[0] / 3, totalnorm[1] / 3, totalnorm[2] / 3], avg_norm);\n\n this.nBuffer[3 * (i * (this.div + 1) + j)] = avg_norm[0];\n this.nBuffer[3 * (i * (this.div + 1) + j) + 1] = avg_norm[1];\n this.nBuffer[3 * (i * (this.div + 1) + j) + 2] = avg_norm[2];\n // for all of those vertices inside the terrain,\n // neither on corners nor edges\n } else {\n var v0 = vec3.create();\n var v1 = vec3.create();\n var v2 = vec3.create();\n var v3 = vec3.create();\n var v4 = vec3.create();\n var v5 = vec3.create();\n var v6 = vec3.create();\n // such vertices will have 6 points around them.\n this.getVertex(v0, i, j);\n this.getVertex(v1, i + 1, j - 1);\n this.getVertex(v2, i, j - 1);\n this.getVertex(v3, i - 1, j);\n this.getVertex(v4, i - 1, j + 1);\n this.getVertex(v5, i, j + 1);\n this.getVertex(v6, i + 1, j);\n\n var crossvector1 = vec3.create();\n var crossvector2 = vec3.create();\n var crossvector3 = vec3.create();\n var crossvector4 = vec3.create();\n var crossvector5 = vec3.create();\n var crossvector6 = vec3.create();\n\n this.subarray(v0, v1, crossvector1);\n this.subarray(v0, v2, crossvector2);\n this.subarray(v0, v3, crossvector3);\n this.subarray(v0, v4, crossvector4);\n this.subarray(v0, v5, crossvector5);\n this.subarray(v0, v6, crossvector6);\n // So need to take sum of 6 normals and then take average\n var norm1 = vec3.create();\n this.cross(crossvector1, crossvector2, norm1);\n var norm2 = vec3.create();\n this.cross(crossvector2, crossvector3, norm2);\n var norm3 = vec3.create();\n this.cross(crossvector3, crossvector4, norm3);\n var norm4 = vec3.create();\n this.cross(crossvector4, crossvector5, norm3);\n var norm5 = vec3.create();\n this.cross(crossvector5, crossvector6, norm3);\n var norm6 = vec3.create();\n this.cross(crossvector6, crossvector1, norm3);\n\n var totalnorm = vec3.create();\n this.addarray(norm1, norm2, totalnorm);\n this.addarray(norm3, totalnorm, totalnorm);\n this.addarray(norm4, totalnorm, totalnorm);\n this.addarray(norm5, totalnorm, totalnorm);\n this.addarray(norm6, totalnorm, totalnorm);\n\n var avg_norm = vec3.create();\n this.normarray([totalnorm[0] / 6, totalnorm[1] / 6, totalnorm[2] / 6], avg_norm);\n\n this.nBuffer[3 * (i * (this.div + 1) + j)] = avg_norm[0];\n this.nBuffer[3 * (i * (this.div + 1) + j) + 1] = avg_norm[1];\n this.nBuffer[3 * (i * (this.div + 1) + j) + 2] = avg_norm[2];\n }\n }\n }\n\n }", "title": "" }, { "docid": "a942a8845d9d7fdf0cc5159d9f956222", "score": "0.5173254", "text": "extrude(z = 1) {\n let poly = this.clone().setClockwise();\n let faces = [];\n let points = poly.points;\n let length = points.length;\n for (let i=0; i<length; i++) {\n let p0 = points[i];\n let p1 = points[(i + 1) % length];\n faces.push(p0.x, p0.y, p0.z);\n faces.push(p1.x, p1.y, p0.z);\n faces.push(p1.x, p1.y, p1.z + z);\n faces.push(p0.x, p0.y, p0.z);\n faces.push(p1.x, p1.y, p1.z + z);\n faces.push(p0.x, p0.y, p0.z + z);\n }\n return faces;\n }", "title": "" }, { "docid": "812afc36ef0e33324b0ce1cde765a14b", "score": "0.5145706", "text": "function get_point_on_navmesh(accum_begin_apex, accum_end_apex,\n begin_portal, end_portal,\n first_poly_normal, interapex_accum_mat, dest) {\n\n // four-dimensional point vector (w === 1)\n var accum_begin_portal = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"transformMat4\"](begin_portal,\n interapex_accum_mat, _vec4_tmp);\n accum_begin_portal[3] = 1;\n var accum_end_portal = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"transformMat4\"](end_portal,\n interapex_accum_mat, _vec3_tmp);\n\n // four-dimensional direction vector (w === 0)\n var accum_portal_dir = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"subtract\"](accum_end_portal,\n accum_begin_portal, _vec4_tmp2);\n var accum_apex_dir = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"subtract\"](accum_end_apex, accum_begin_apex,\n _vec3_tmp);\n\n var normal = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"cross\"](first_poly_normal, accum_apex_dir, _vec4_tmp3);\n\n if (Math.abs(__WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"dot\"](normal, accum_portal_dir)) < 0.01) {\n var t = 1/2;\n } else {\n // four-dimensional plane representation\n __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"normalize\"](normal, normal);\n normal[3] = - __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"dot\"](normal, accum_end_apex);\n var t = - __WEBPACK_IMPORTED_MODULE_6__libs_gl_matrix_vec4_js__[\"dot\"](normal, accum_begin_portal) /\n __WEBPACK_IMPORTED_MODULE_6__libs_gl_matrix_vec4_js__[\"dot\"](normal, accum_portal_dir);\n }\n\n var portal_dir = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"subtract\"](end_portal, begin_portal, _vec3_tmp);\n return __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"scaleAndAdd\"](begin_portal, portal_dir, t, dest);\n}", "title": "" }, { "docid": "253063e84cec56facbc48306c80508a3", "score": "0.51354533", "text": "function createPlaneGeometry(clipXLeft = 0, clipXRight = 0, clipYTop = 0, clipYBottom = 0, width = 1, height = 1, widthSegments = 1, heightSegments = 1) {\n var geometry = new THREE.PlaneGeometry(width, height, widthSegments, heightSegments);\n //Wenn kein Clipping stattfindet, sind wir fertig\n if (clipXLeft == 0 && clipXRight == 0 && clipYTop == 0 && clipYBottom == 0)\n return geometry;\n else {\n //das Koordinatensystem von einer Plane der Groeße w,h geht von (-w/2,-h/2) bis (w/2,h/2)\n //UV Koordinaten gehen von (0,0), bis (1,1), deshalb muss ein der Offset addiert werden und durch die Range geteilt werden.\n var offset = new THREE.Vector2(width / 2, height / 2);\n var range = new THREE.Vector2(width, height);\n //Die PlaneGeometry besteht aus 2 Dreiecken, das \"Zuschneiden\" erfolgt durch umrechnen der UV Koordinaten.\n let faces = geometry.faces;\n //geometry.faceVertexUvs[0] enthaelt die UV Koordinaten beider Dreicke, die die Plane ausmachen\n //Es wird zu beginn als leere Liste instatiiert, da wir die UV Koordinaten neu berechnen wollen\n geometry.faceVertexUvs[0] = [];\n //Scale in x und y Richtung ist 100% minus alles, was auf der jeweiligen Achse von beiden Seiten abgeschnitten wird.\n let xScaleClipping = 1 - clipXLeft - clipXRight,\n yScaleClipping = 1 - clipYBottom - clipYTop;\n\n for (let i = 0; i < faces.length; i++) {//Die Koordinaten beider Dreiecke werden in UV Koordinaten umgerechnet.//Bsp fuer width=1,height=1\n\n let v1 = geometry.vertices[faces[i].a],//v1 fuer i=0 {x:-0.5,y:0.5,z:0}//v1 fuer i=1 {x:-0.5,y:-0.5,z:0}\n v2 = geometry.vertices[faces[i].b],//v2 fuer i=0 {x:-0.5,y:-0.5,z:0}//v2 fuer i=1 {x:0.5,y:-0.5,z:0}\n v3 = geometry.vertices[faces[i].c];//v3 fuer i=0 {x:0.5,y:0.5,z:0}//v3 fuer i=1 {x:0.5,y:0.5,z:0}\n\n //in diesem Teil werden die UV Koordinaten des jeweiligen Dreiecks berechnet und hochgeladen\n geometry.faceVertexUvs[0].push([\n //Zuerst wird offset addiert, damit die Koordinaten bei 0 anfangen.\n //Danach wird das Bild durch die Division durch die Range auf das Interval [0,1] runtergerechnet. \n //Danach wird mit dem Scale multipliziert(1-was auf der Achse weggeschnitten werden soll), da wir etwas wegschneiden und z.B. nur 90% anzeigen wollen.\n //Zum Schluss wird das Bild verschoben um das was links und unten (0,0) abgeschnitten werden soll.\n //Bsp. wir wollen links 5% und rechts 10% abschneiden, dann ist der Scale 85% und wir beginnen ab 5%.\n new THREE.Vector2(((v1.x + offset.x) / range.x) * xScaleClipping + clipXLeft, ((v1.y + offset.y) / range.y) * yScaleClipping + clipYBottom),\n new THREE.Vector2(((v2.x + offset.x) / range.x) * xScaleClipping + clipXLeft, ((v2.y + offset.y) / range.y) * yScaleClipping + clipYBottom),\n new THREE.Vector2(((v3.x + offset.x) / range.x) * xScaleClipping + clipXLeft, ((v3.y + offset.y) / range.y) * yScaleClipping + clipYBottom)\n ]);\n }\n //Wir geben an, dass wir die UV Koordinaten veraendert haben und diese aktualisiert werden muessen.\n geometry.uvsNeedUpdate = true;\n //die Geometry wird zu einer BufferGeometry konvertiert (aus Effizienzgruenden)\n return new THREE.BufferGeometry().fromGeometry(geometry);\n }\n}", "title": "" }, { "docid": "ec480680366b0ffdab39dce7fea3724c", "score": "0.5135205", "text": "calculateNormals() {\n if (this.vertices === null) throw new Error('Vertices array is null');\n let indices = this.vertexIndices;\n if (indices == null) throw new Error('Position indices is null');\n // One vec3 per one face. so indices / 3 * 3.\n let normals = new Float32Array(indices.length);\n let normalIndices = createIndicesArray(indices.length / 3, indices.length);\n let normalId = 0;\n for (let faceId = 0; faceId < indices.length; faceId += 3) {\n const vertexId1 = indices[faceId];\n const vertexId2 = indices[faceId + 1];\n const vertexId3 = indices[faceId + 2];\n // Calculate normal vector.\n let origin = this.vertices.slice(vertexId1 * 3, vertexId1 * 3 + 3);\n let p1 = vec3.create(), p2 = vec3.create();\n let uv = vec3.create();\n vec3.subtract(p1, this.vertices.slice(vertexId2 * 3, vertexId2 * 3 + 3),\n origin);\n vec3.subtract(p2, this.vertices.slice(vertexId3 * 3, vertexId3 * 3 + 3),\n origin);\n vec3.cross(uv, p1, p2);\n vec3.normalize(uv, uv);\n // Done. Store them in normals buffer, and set indices to it.\n normals.set(uv, normalId * 3);\n normalIndices[faceId] = normalId;\n normalIndices[faceId + 1] = normalId;\n normalIndices[faceId + 2] = normalId;\n normalId ++;\n }\n this.normals = normals;\n this.normalIndices = normalIndices;\n }", "title": "" }, { "docid": "f2d744d97e2447c4f837e40d2d35a5ad", "score": "0.5129397", "text": "computeNormals() {\n\n // Perform facewinding to ensure the faces normals point outwards\n new Facewinder(this.mesh);\n }", "title": "" }, { "docid": "d7b11fbc96418f5ffc30c821df16baae", "score": "0.5128455", "text": "function Cube(gl){\n var vertexBuffer;\n var normalBuffer;\n var texBuffer;\n var indexBuffer;\n var FSIZE;\n var numVertices;\n \n \n // vertices of the cube, we are duplicating points because the faces have different normals\n var vertices = new Float32Array([\n 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, -0.5,-0.5, 0.5, 0.5,-0.5, 0.5, // front face\n 0.5, 0.5, 0.5, 0.5,-0.5, 0.5, 0.5,-0.5,-0.5, 0.5, 0.5,-0.5, // right face\n 0.5, 0.5,-0.5, 0.5,-0.5,-0.5, -0.5,-0.5,-0.5, -0.5, 0.5,-0.5, // back face\n -0.5, 0.5,-0.5, -0.5,-0.5,-0.5, -0.5,-0.5, 0.5, -0.5, 0.5, 0.5, // left face\n 0.5, 0.5, 0.5, 0.5, 0.5,-0.5, -0.5, 0.5,-0.5, -0.5, 0.5, 0.5, // top face\n 0.5,-0.5, 0.5, -0.5,-0.5, 0.5, -0.5,-0.5,-0.5, 0.5,-0.5,-0.5, // bottom face\n ]);\n \n \n var normals = new Float32Array([\n 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, // front face\n 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, // right face\n 0.0, 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, 0.0,-1.0, // back face\n -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, // left face\n 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, // top face\n 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, // bottom face\n ]);\n \n var textureCoordinates = new Float32Array([\n 0.5, 0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.0, // front face\n 0.5, 0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.0, // right face\n 0.5, 0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.0, // back face\n 0.5, 0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.0, // left face\n 0.5, 0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.0, // top face\n 0.5, 0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.0 // bottom face\n ]);\n \n\n \n var indices = new Uint8Array([\n 0,1,2, 0,2,3, // front face\n 4,5,6, 4,6,7, // right face\n 8,9,10, 8,10,11, // back face\n 12,13,14, 12,14,15, // left face\n 16,17,18, 16,18,19, // top face\n 20,21,22, 20,22,23 // bottom face\n ]);\n \n\n \n vertexBuffer = createBuffer(gl, gl.ARRAY_BUFFER, vertices, 'vertex', gl.STATIC_DRAW);\n normalBuffer = createBuffer(gl, gl.ARRAY_BUFFER, normals, 'normal', gl.STATIC_DRAW);\n indexBuffer = createBuffer(gl, gl.ELEMENT_ARRAY_BUFFER, indices, 'index', gl.STATIC_DRAW);\n texBuffer = createBuffer(gl, gl.ARRAY_BUFFER, textureCoordinates, 'texture coordinate', gl.STATIC_DRAW);\n\n this.draw = function() {\n\n \n gl.uniformMatrix4fv(gl.u_ModelMatrix, false, flatten(gl.currentTransform));\n\n enableAttribute(gl, vertexBuffer, 'a_Position', 3, 0, 0);\n enableAttribute(gl, normalBuffer, 'a_Normal', 3, 0, 0);\n enableAttribute(gl, texBuffer, 'a_TexCoord', 2, 0, 0);\n \n \n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\n gl.drawElements(gl.TRIANGLES, indices.length, gl.UNSIGNED_BYTE, 0);\n \n }\n \n \n \n}", "title": "" }, { "docid": "91c9d42fc4ce31afe86ae82538d34db7", "score": "0.512254", "text": "function setupScene() {\n var units = mapW;\n\n // Geometry: floor\n var floor = new t.Mesh(\n new t.PlaneGeometry(units * UNITSIZE, units * UNITSIZE, 100, 100),\n new t.MeshLambertMaterial({color: 0xEDCBA0})\n );\n\n floor.rotation.x = -Math.PI / 2;\n scene.add(floor);\n\n // Geometry: walls\n var cube = new t.CubeGeometry(UNITSIZE, WALLHEIGHT, UNITSIZE);\n var materials = [\n new t.MeshLambertMaterial({map: new t.TextureLoader().load('assets/hull.png')}),\n new t.MeshLambertMaterial({map: new t.TextureLoader().load('assets/hull_2.jpg')}),\n new t.MeshLambertMaterial({color: 0xFBEBCD}),\n ];\n\n for (var i = 0; i < mapW; i++) {\n for (var j = 0, m = map[i].length; j < m; j++) {\n if (map[i][j]) {\n var wall = new t.Mesh(cube, materials[map[i][j]-1]);\n wall.position.x = (i - units/2) * UNITSIZE;\n wall.position.y = WALLHEIGHT/2;\n wall.position.z = (j - units/2) * UNITSIZE;\n scene.add(wall);\n }\n }\n }\n\n // Lighting\n var directionalLight1 = new t.DirectionalLight( 0xF7EFBE, 0.7 );\n directionalLight1.position.set( 0.5, 1, 0.5 );\n scene.add( directionalLight1 );\n var directionalLight2 = new t.DirectionalLight( 0xF7EFBE, 0.5 );\n directionalLight2.position.set( -0.5, -1, -0.5 );\n scene.add( directionalLight2 );\n}", "title": "" }, { "docid": "27e41b5067bdc2408154a962a7de0795", "score": "0.51201665", "text": "function createLeg(left){\n var leg = new THREE.Object3D();\n var tempCube = createCube(100, 100, 50);\n if(left)\n tempCube.position.x = -25;\n else\n tempCube.position.x = 25;\n tempCube.position.y = -100;\n tempCube.scale.set(0.3, 1, 1);\n leg.add(tempCube);\n return leg;\n}", "title": "" }, { "docid": "64bb563340f8b6f76578eaa849057321", "score": "0.5119623", "text": "function Mesh(jsonObj, id, scale) {\n var mesh = jsonObj.meshes[0];\n this.vertices = mesh.vertices;\n this.vertexCount = mesh.vertices.length / 3; \n this.scale = scale || 3;\n // this.translatex = window.meshCenter[0];\n // this.translatey = window.meshCenter[1];\n this.visible = true;\n this.verticesGrabbed = 0;\n this.id = id;\n\n // animation state --- -1 means no animation\n this.t = 0;\n this.notifyRelease = false; // notify when grabbed vertices needs to be released\n this.grab = false; // set to true if this mesh should start gathering vertices\n\n /* flatten faces array */\n this.faces = [];\n for(var i = 0, l = mesh.faces.length; i < l; i++) {\n this.faces.push(mesh.faces[i][0], mesh.faces[i][1], mesh.faces[i][2]);\n }\n\n\n /* flatten colors array */\n // .ply format creates an array of array of colors, and there's only one array of colors in each mesh\n this.colors = mesh.colors[0];\n this.opacityMult = 1.25;\n\n\n // blender is swapping z with y\n // also the y direction needs to be flipped\n var lastId = meshesProgram.lastId;\n this.transformedVertices = [];\n for(var i = 0, l = mesh.vertices.length / 3; i < l; i++) {\n this.transformedVertices.push(new Point(\n +mesh.vertices[i * 3 + 0] * this.scale, // + this.translatex, \n -mesh.vertices[i * 3 + 2] * this.scale, // + this.translatey, \n false, \n lastId + i\n ));\n }\n meshesProgram.lastId = lastId + i;\n\n\n\n\n\n\n\n // those vertices will be gathered from the array -> points[] when points[i].meshId equals this mesh index;\n this.verticesFromPoints = new Float32Array(this.vertexCount * 2); \n /**\n * Iterate through all the points in -> points[] \n * if all the vertices were grabbed for a given mesh, \n * start populating mesh.verticesFromPoints with values directly taken from points[] \n */\n this.fillVerticesFromPoints = function() {\n // we didn't grab enough vertices yet, skip this mesh\n if(this.verticesGrabbed !== this.vertexCount) return;\n \n for(var i = 0; i < points.length; i++) {\n\n // this point is not associated with the selected mesh\n if(points[i].meshId !== this.id) continue;\n\n var vx = points[i].x;\n var vy = points[i].y;\n\n // if this mesh has 127 vertices, meshVertexId will be a number between 0 to 126\n var vid = points[i].meshVertexId;\n\n this.verticesFromPoints[vid * 2 + 0] = vx;\n this.verticesFromPoints[vid * 2 + 1] = vy;\n }\n };\n\n /**\n * fade-out animation completed, reset this mesh and release the grabbed vertices\n */\n this.reset = function() {\n this.verticesGrabbed = 0;\n\n // animation state --- -1 means no animation\n this.t = 0;\n this.notifyRelease = false; // notify when grabbed vertices needs to be released\n\n // release grabbed vertices\n for(var i = 0; i < points.length; i++) {\n if(points[i].meshId === this.id) {\n points[i].meshId = -1;\n points[i].meshVertexId = -1;\n }\n }\n\n this.grab = false;\n };\n}", "title": "" }, { "docid": "d74f62f21569c2938bda68d586c11b31", "score": "0.5114492", "text": "static get_mesh( e_name, json, bin, mat, m_names=null ){\n\t\tlet e = App.$Draw( e_name );\n\t\tthis.load_mesh_into( e, json, bin, mat, m_names, false );\n\t\treturn e;\n\t}", "title": "" }, { "docid": "95399945e7738459546810e623cb2045", "score": "0.510978", "text": "_generateSurfaceIds(mesh) {\n const bufferGeometry = mesh.geometry;\n const numVertices = bufferGeometry.attributes.position.count;\n const numIndices = bufferGeometry.index.count;\n const indexBuffer = bufferGeometry.index.array;\n const vertexBuffer = bufferGeometry.attributes.position.array;\n // For each vertex, search all its neighbors\n const vertexMap = {};\n for (let i = 0; i < numIndices; i += 3) {\n const i1 = indexBuffer[i + 0];\n const i2 = indexBuffer[i + 1];\n const i3 = indexBuffer[i + 2];\n\n add(i1, i2);\n add(i1, i3);\n add(i2, i3);\n }\n function add(a, b) {\n if (vertexMap[a] == undefined) vertexMap[a] = [];\n if (vertexMap[b] == undefined) vertexMap[b] = [];\n\n if (vertexMap[a].indexOf(b) == -1) vertexMap[a].push(b);\n if (vertexMap[b].indexOf(a) == -1) vertexMap[b].push(a);\n }\n\n // Find cycles\n const frontierNodes = Object.keys(vertexMap).map((v) => Number(v));\n const exploredNodes = {};\n const vertexIdToSurfaceId = {};\n\n while (frontierNodes.length > 0) {\n const node = frontierNodes.pop();\n if (exploredNodes[node]) continue;\n\n // Get all neighbors recursively\n const surfaceVertices = getNeighborsNonRecursive(node);\n // Mark them as explored\n for (let v of surfaceVertices) {\n exploredNodes[v] = true;\n vertexIdToSurfaceId[v] = this.surfaceId;\n }\n\n this.surfaceId += 1;\n }\n function getNeighbors(node, explored) {\n const neighbors = vertexMap[node];\n let result = [node];\n explored[node] = true;\n\n for (let n of neighbors) {\n if (explored[n]) continue;\n explored[n] = true;\n const newNeighbors = getNeighbors(n, explored);\n result = result.concat(newNeighbors);\n }\n\n return result;\n }\n\n function getNeighborsNonRecursive(node) {\n const frontier = [node];\n const explored = {};\n const result = [];\n\n while (frontier.length > 0) {\n const currentNode = frontier.pop();\n if (explored[currentNode]) continue;\n const neighbors = vertexMap[currentNode];\n result.push(currentNode);\n\n explored[currentNode] = true;\n\n for (let n of neighbors) {\n if (!explored[n]) {\n frontier.push(n);\n }\n }\n }\n\n return result;\n }\n\n return vertexIdToSurfaceId;\n }", "title": "" }, { "docid": "7f41ca4d119facebefa9f82e8ae333fe", "score": "0.51033026", "text": "getMesh(object3D){\n let mesh = null;\n object3D.traverse( (child) => {\n if ( child instanceof THREE.Mesh ) {\n mesh = child;\n }\n });\n return mesh;\n }", "title": "" }, { "docid": "3c548c76e743fbdb59b622fe959bb381", "score": "0.5101497", "text": "function l$4(l,e){0===e.normalType||1===e.normalType?(l.include(o$9,e),l.varyings.add(\"vNormalWorld\",\"vec3\"),l.varyings.add(\"vNormalView\",\"vec3\"),l.vertex.uniforms.add(\"uTransformNormal_GlobalFromModel\",\"mat3\"),l.vertex.uniforms.add(\"uTransformNormal_ViewFromGlobal\",\"mat3\"),l.vertex.code.add(t$l`\n void forwardNormal() {\n vNormalWorld = uTransformNormal_GlobalFromModel * normalModel();\n vNormalView = uTransformNormal_ViewFromGlobal * vNormalWorld;\n }\n `)):2===e.normalType?(l.include(t$8,e),l.varyings.add(\"vNormalWorld\",\"vec3\"),l.vertex.code.add(t$l`\n void forwardNormal() {\n vNormalWorld = ${1===e.viewingMode?t$l`normalize(vPositionWorldCameraRelative);`:t$l`vec3(0.0, 0.0, 1.0);`}\n }\n `)):l.vertex.code.add(t$l`\n void forwardNormal() {}\n `);}", "title": "" }, { "docid": "9a715bc14d37085adc62b114126959b0", "score": "0.5093555", "text": "constructor(parent, position, normal, playerUpDirection, output, hostObjects, ringColor, portalPoints = []) {\n super()\n this.parent = parent\n this.pos = position.clone()\n this.output = output\n this.hostObjects = hostObjects\n this.plane = new THREE.Plane(new Vector3(0, 1, 0), 0)\n this.debugMeshes = new Group()\n\n // create onb for bb transformations\n this.ty = normal.clone().normalize()\n this.tz = playerUpDirection.clone().projectOnPlane(this.ty).normalize()\n if (this.tz.length() < 0.1) {\n this.tz = new Vector3(0, 1, 0)\n }\n this.tx = this.tz.clone().cross(this.ty)\n\n // set portal corner points\n this.portalPoints = portalPoints;\n if (portalPoints === undefined || portalPoints.length == 0) {\n this.portalPoints = [this.pos.clone().add(this.tz.clone().multiplyScalar(portal_depth/2 + 2*portal_eps).add(this.tx.clone().multiplyScalar(portal_width/2 + 2*portal_eps))), \n this.pos.clone().add(this.tz.clone().multiplyScalar(-portal_depth/2 - 2*portal_eps).add(this.tx.clone().multiplyScalar(portal_width/2 + 2*portal_eps))), \n this.pos.clone().add(this.tz.clone().multiplyScalar(-portal_depth/2 - 2*portal_eps).add(this.tx.clone().multiplyScalar(-portal_width/2 - 2*portal_eps))), \n this.pos.clone().add(this.tz.clone().multiplyScalar(portal_depth/2 + 2*portal_eps).add(this.tx.clone().multiplyScalar(-portal_width/2 - 2*portal_eps)))]\n }\n\n // for visualization purposes\n let xHelper = new THREE.ArrowHelper(this.tx, position, 1, 0xff0000)\n let yHelper = new THREE.ArrowHelper(this.ty, position, 1, 0x00ff00)\n let zHelper = new THREE.ArrowHelper(this.tz, position, 1, 0x0000ff)\n this.debugMeshes.add(xHelper, yHelper, zHelper)\n\n let tRot = new THREE.Matrix4().makeBasis(this.tx, this.ty, this.tz)\n\n this.transform = tRot.clone().setPosition(position)\n this.plane.applyMatrix4(this.transform)\n this.plane.translate(normal.clone().multiplyScalar(0.0001));\n\n // create the 3d model for the portal\n const VERT_SHADER = `\n void main() \n {\n vec4 modelViewPosition = modelViewMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewPosition;\n }\n `\n\n const FRAG_SHADER = `\n uniform sampler2D texture1;\n uniform float ww;\n uniform float wh;\n void main() {\n gl_FragColor = texture2D(texture1, gl_FragCoord.xy / vec2(ww, wh));\n }\n `\n\n const geometry = new THREE.BoxGeometry( portal_width, portal_height, portal_depth );\n const uniforms = {\n texture1: {type: 't', value: new THREE.Texture()},\n ww: {type: 'f', value: 1}, // not correct values at time of creation necessarily, will be updated later in render loop\n wh: {type: 'f', value: 1}\n }\n const material = new THREE.ShaderMaterial({\n vertexShader: VERT_SHADER,\n fragmentShader: FRAG_SHADER,\n uniforms: uniforms,\n stencilWrite: true, // stencil optimization, only for culling portal\n stencilFunc: THREE.EqualStencilFunc,\n stencilRef: 1,\n stencilFail: THREE.ReplaceStencilOp,\n });\n\n this.mesh = new THREE.Mesh( geometry, material );\n this.mesh.applyMatrix4(this.transform)\n this.mesh.updateMatrix()\n this.mesh.matrixAutoUpdate = false\n this.add(this.mesh)\n\n\n // constructing the portal borders\n const ringGeometry = new THREE.PlaneGeometry(consts.PORTAL_WIDTH + 2 * consts.PORTAL_RING_THICKNESS, consts.PORTAL_DEPTH + 2 * consts.PORTAL_RING_THICKNESS);\n // https://stackoverflow.com/questions/33571642/why-do-transparent-materials-result-in-occlusion\n const ringMaterial = new THREE.MeshBasicMaterial({\n color: ringColor,\n side: THREE.FrontSide,\n opacity: 1,\n transparent: true,\n map: consts.RING_TEXTURE,\n depthWrite: false,\n })\n this.ringMesh = new THREE.Mesh(ringGeometry, ringMaterial)\n this.ringMesh.applyMatrix4(new THREE.Matrix4().makeRotationX(-Math.PI/2))\n this.ringMesh.applyMatrix4(this.transform)\n this.ringMesh.position.add(normal.clone().multiplyScalar(consts.PORTAL_HEIGHT / 2 + 0.001))\n this.ringMesh.updateMatrix()\n this.ringMesh.matrixAutoUpdate = false\n this.add(this.ringMesh)\n\n // CDBB: collision disable BB\n // STBB: should teleport BB\n\n // matrix for the CDBB\n // CDBB is centered at portal\n let tCDBB = this.transform.clone()\n // STBB is centered at 1/4 height of CDBB behind the portal\n // because height of STBB is half height of CDBB\n let pSTBB = position.clone().add(normal.clone().multiplyScalar(-portal_cdbb_height / 4))\n let tSTBB = tRot.clone().setPosition(pSTBB)\n\n this.CDBB = new GeneralBB(portal_width, portal_cdbb_height, portal_depth, tCDBB, 0xff0000)\n this.STBB = new GeneralBB(portal_width, portal_cdbb_height/2, portal_depth, tSTBB, 0x00ff00)\n\n this.debugMeshes.add(this.CDBB.helper)\n this.debugMeshes.add(this.STBB.helper)\n this.debugMeshes.visible = globals.DEBUG\n this.add(this.debugMeshes)\n \n // if valid placement, add and render\n parent.addToUpdateList( this );\n }", "title": "" }, { "docid": "2da6f26cb8e9ecb57885dab4b050a4ba", "score": "0.5087046", "text": "render(useCameraPostProcess = false, dumpForDebug = false) {\n var scene = this.getScene();\n if (!scene) {\n return;\n }\n var engine = scene.getEngine();\n if (this.useCameraPostProcesses !== undefined) {\n useCameraPostProcess = this.useCameraPostProcesses;\n }\n if (this._waitingRenderList) {\n this.renderList = [];\n for (var index = 0; index < this._waitingRenderList.length; index++) {\n var id = this._waitingRenderList[index];\n let mesh = scene.getMeshById(id);\n if (mesh) {\n this.renderList.push(mesh);\n }\n }\n this._waitingRenderList = undefined;\n }\n // Is predicate defined?\n if (this.renderListPredicate) {\n if (this.renderList) {\n this.renderList.length = 0; // Clear previous renderList\n }\n else {\n this.renderList = [];\n }\n var scene = this.getScene();\n if (!scene) {\n return;\n }\n var sceneMeshes = scene.meshes;\n for (var index = 0; index < sceneMeshes.length; index++) {\n var mesh = sceneMeshes[index];\n if (this.renderListPredicate(mesh)) {\n this.renderList.push(mesh);\n }\n }\n }\n this.onBeforeBindObservable.notifyObservers(this);\n // Set custom projection.\n // Needs to be before binding to prevent changing the aspect ratio.\n let camera = this.activeCamera ?? scene.activeCamera;\n if (camera) {\n if (camera !== scene.activeCamera) {\n scene.setTransformMatrix(camera.getViewMatrix(), camera.getProjectionMatrix(true));\n }\n engine.setViewport(camera.viewport, this.getRenderWidth(), this.getRenderHeight());\n }\n this._defaultRenderListPrepared = false;\n if (this.is2DArray) {\n for (let layer = 0; layer < this.getRenderLayers(); layer++) {\n this.renderToTarget(0, useCameraPostProcess, dumpForDebug, layer, camera);\n scene.incrementRenderId();\n scene.resetCachedMaterial();\n }\n }\n else if (this.isCube) {\n for (var face = 0; face < 6; face++) {\n this.renderToTarget(face, useCameraPostProcess, dumpForDebug, undefined, camera);\n scene.incrementRenderId();\n scene.resetCachedMaterial();\n }\n }\n else {\n this.renderToTarget(0, useCameraPostProcess, dumpForDebug, undefined, camera);\n }\n this.onAfterUnbindObservable.notifyObservers(this);\n if (scene.activeCamera) {\n // Do not avoid setting uniforms when multiple scenes are active as another camera may have overwrite these\n if (scene.getEngine().scenes.length > 1 || (this.activeCamera && this.activeCamera !== scene.activeCamera)) {\n scene.setTransformMatrix(scene.activeCamera.getViewMatrix(), scene.activeCamera.getProjectionMatrix(true));\n }\n engine.setViewport(scene.activeCamera.viewport);\n }\n scene.resetCachedMaterial();\n }", "title": "" }, { "docid": "aac3d7e77a5acc5dd06f71eea467e859", "score": "0.50869", "text": "function buildTriangleList() {\r\n\t// console.log(faces)\r\n\tfor (var i = 0; i < faces.length; i++) {\r\n\t\tvar a = faces[i].a;\r\n\t\tvar b = faces[i].b;\r\n\t\tvar c = faces[i].c;\r\n\r\n\t\t// vertices\r\n\t\tarrayVertex.push(vertices[a].x); arrayVertex.push(vertices[a].y); arrayVertex.push(vertices[a].z);\r\n\t\tarrayVertex.push(vertices[b].x); arrayVertex.push(vertices[b].y); arrayVertex.push(vertices[b].z);\r\n\t\tarrayVertex.push(vertices[c].x); arrayVertex.push(vertices[c].y); arrayVertex.push(vertices[c].z);\r\n\r\n\t\tvar norm = getNorm(vertices[a], vertices[b], vertices[c]);\r\n\r\n\t\t// normals\r\n\t\tarrayNormal.push(norm[0]); arrayNormal.push(norm[1]); arrayNormal.push(norm[2]);\r\n\t\tarrayNormal.push(norm[0]); arrayNormal.push(norm[1]); arrayNormal.push(norm[2]);\r\n\t\tarrayNormal.push(norm[0]); arrayNormal.push(norm[1]); arrayNormal.push(norm[2]);\r\n\r\n\t\t// colors\r\n\t\tarrayColor.push(vertices[a].r); arrayColor.push(vertices[a].g); arrayColor.push(vertices[a].b);\r\n\t\tarrayColor.push(vertices[b].r); arrayColor.push(vertices[b].g); arrayColor.push(vertices[b].b);\r\n\t\tarrayColor.push(vertices[c].r); arrayColor.push(vertices[c].g); arrayColor.push(vertices[c].b);\r\n\r\n\t\t// uv\r\n\t\tarrayTexture.push(vertices[a].u); arrayTexture.push(vertices[a].v);\r\n\t\tarrayTexture.push(vertices[b].u); arrayTexture.push(vertices[b].v);\r\n\t\tarrayTexture.push(vertices[c].u); arrayTexture.push(vertices[c].v);\r\n\r\n\t\tif(i < 5){\r\n\t\t\t// console.log(arrayNormal)\r\n\t\t}\r\n\t\t// index\r\n\t\tarrayIndex.push(i);\r\n\t}\r\n}", "title": "" }, { "docid": "61668216481da2d5611c47eeaa42a652", "score": "0.5082739", "text": "async generateSTL (mesh) {\n // based on : https://all3dp.com/what-is-stl-file-format-extension-3d-printing/\n // TODO: convert to binary stl : http://www.johann-oberdorfer.eu/blog/2018/01/12/18-01-12_stl_converter/\n var output = 'solid exportedMesh\\r\\n';\n var vertices = mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind);\n var indices = mesh.getIndices();\t\n \n for(var i = 0; i<indices.length; i+=3){\n var id = [indices[i]*3,indices[i+1]*3,indices[i+2]*3];\n var v = [\n new BABYLON.Vector3(vertices[id[0]], vertices[id[0]+1], vertices[id[0]+2]),\n new BABYLON.Vector3(vertices[id[1]], vertices[id[1]+1], vertices[id[1]+2]),\n new BABYLON.Vector3(vertices[id[2]], vertices[id[2]+1], vertices[id[2]+2])\n ];\n var p1p2 = v[0].subtract(v[1]); \t\t\n var p3p2 = v[2].subtract(v[1]); \n var n = (BABYLON.Vector3.Cross(p1p2, p3p2)).normalize();\n \n output+='facet normal '+n.x+' '+n.y+' '+n.z+'\\r\\n';\n output+='\\touter loop\\r\\n';\n output+='\\t\\tvertex '+v[0].x+' '+v[0].y+' '+v[0].z+'\\r\\n';\n output+='\\t\\tvertex '+v[1].x+' '+v[1].y+' '+v[1].z+'\\r\\n';\n output+='\\t\\tvertex '+v[2].x+' '+v[2].y+' '+v[2].z+'\\r\\n';\t\t\n output+='\\tendloop\\r\\n';\n output+='endfacet\\r\\n';\n }\n output += 'endsolid exportedMesh';\n\n return output\n }", "title": "" }, { "docid": "817fa478780d92ccfd70877bf056bca2", "score": "0.50705266", "text": "function gen_mesh_render(WebGLRenderingContext ctx, Mesh mesh, ShaderProgram drawprogram, \r\n ShaderProgram vertprogram, int recalcflags) \r\n{\r\n if (mesh.verts.length == 0) \r\n return;\r\n \r\n function tess_finish(job) {\r\n mesh.flag |= MeshFlags.TESS_JOB_FINISHED;\r\n }\r\n \r\n if (mesh.render == 0) {\r\n mesh.render = new render();\r\n mesh.regen_render();\r\n }\r\n \r\n //if (recalcflags & MeshRecalcFlags.REGEN_COS)\r\n // recalcflags |= MeshRecalcFlags.REGEN_TESS;\r\n \r\n if ((recalcflags & MeshRecalcFlags.REGEN_TESS) != 0) {\r\n recalcflags |= MeshRecalcFlags.REGEN_NORS | MeshRecalcFlags.REGEN_COS | MeshRecalcFlags.REGEN_COLORS;\r\n \r\n gen_tris(mesh);\r\n \r\n /*\r\n var i = 0;\r\n \r\n for (var t of (new gen_tris_job(mesh))) {\r\n i += 1;\r\n if (i == 15000) {\r\n console.log(\"infitie loop in gen tris job\");\r\n gen_tris(mesh);\r\n break;\r\n }\r\n }\r\n // */\r\n } else if (recalcflags & MeshRecalcFlags.REGEN_COS) {\r\n if (mesh.flag & MeshFlags.TESS_JOB_FINISHED) {\r\n recalcflags |= MeshRecalcFlags.REGEN_NORS | MeshRecalcFlags.REGEN_COS | MeshRecalcFlags.REGEN_COLORS | MeshRecalcFlags.REGEN_TESS;\r\n \r\n mesh.flag &= ~MeshFlags.TESS_JOB_FINISHED;\r\n } else {\r\n gen_tris(mesh);\r\n \r\n var gen = new gen_tris_job(mesh);\r\n var i = 0;\r\n \r\n var job = new Joblet(mesh, gen, undefined, 10, undefined, tess_finish);\r\n \r\n g_app_state.jobs.queue_replace(job);\r\n \r\n /*\r\n recalcflags |= MeshRecalcFlags.REGEN_NORS | MeshRecalcFlags.REGEN_COS | MeshRecalcFlags.REGEN_COLORS | MeshRecalcFlags.REGEN_TESS;\r\n for (var iter of job) {\r\n i++;\r\n if (i > 10000) {\r\n console.log(\"infinite loop\")\r\n break;\r\n }\r\n }\r\n // */\r\n }\r\n }\r\n \r\n mesh.render.drawprogram = drawprogram;\r\n mesh.render.vertprogram = vertprogram;\r\n \r\n var totloop = 0;\r\n \r\n for (var f of mesh.faces) {\r\n f.flag &= ~Flags.DIRTY;\r\n \r\n for (var list of f.looplists) {\r\n totloop += list.length;\r\n }\r\n }\r\n \r\n mesh.verts.index_update()\r\n \r\n var normals = new Array<float>();\r\n var colors = new Array<float>();\r\n var no;\r\n \r\n for (var v of mesh.verts) {\r\n no = v.no;\r\n \r\n v.flag &= ~Flags.DIRTY;\r\n \r\n if (recalcflags & MeshRecalcFlags.REGEN_NORS) {\r\n normals.push(no[0]);\r\n normals.push(no[1]);\r\n normals.push(no[2]);\r\n }\r\n \r\n if ((recalcflags & MeshRecalcFlags.REGEN_COLORS) != 0) {\r\n var color = get_element_color(v, mesh.verts.highlight);\r\n colors.push(color[0]);\r\n colors.push(color[1]);\r\n colors.push(color[2]);\r\n colors.push(color[3]);\r\n }\r\n }\r\n \r\n if (recalcflags & MeshRecalcFlags.REGEN_NORS) {\r\n normals = new Float32Array(normals);\r\n }\r\n \r\n colors = new Float32Array(colors);\r\n \r\n var verts = new Array();\r\n var i = 0;\r\n var co;\r\n \r\n if (mesh.flag & MeshFlags.USE_MAP_CO) {\r\n for (var v of mesh.verts) {\r\n co = v.mapco;\r\n verts.push(co[0]);\r\n verts.push(co[1]);\r\n verts.push(co[2]);\r\n }\r\n } else {\r\n for (var v of mesh.verts) {\r\n co = v.co;\r\n verts.push(co[0]);\r\n verts.push(co[1]);\r\n verts.push(co[2]);\r\n }\r\n }\r\n verts = new Float32Array(verts);\r\n\r\n if (recalcflags & MeshRecalcFlags.REGEN_NORS) {\r\n mesh.render.kill_buf(\"norbuf\");\r\n mesh.render.norbuf = ctx.createBuffer();\r\n ctx.bindBuffer(ctx.ARRAY_BUFFER, mesh.render.norbuf);\r\n ctx.bufferData(ctx.ARRAY_BUFFER, normals, ctx.STATIC_DRAW);\r\n }\r\n \r\n mesh.render.kill_buf(\"vertbuf\");\r\n mesh.render.vertbuf = ctx.createBuffer();\r\n \r\n ctx.bindBuffer(ctx.ARRAY_BUFFER, mesh.render.vertbuf);\r\n ctx.bufferData(ctx.ARRAY_BUFFER, verts, ctx.STATIC_DRAW);\r\n \r\n if ((recalcflags & MeshRecalcFlags.REGEN_COLORS) != 0) {\r\n mesh.render.kill_buf(\"vcolorbuf\");\r\n mesh.render.vcolorbuf = ctx.createBuffer();\r\n ctx.bindBuffer(ctx.ARRAY_BUFFER, mesh.render.vcolorbuf);\r\n ctx.bufferData(ctx.ARRAY_BUFFER, colors, ctx.STATIC_DRAW);\r\n }\r\n \r\n ctx.bindBuffer(ctx.ARRAY_BUFFER, null);\r\n \r\n var idxs = new Array<short>();\r\n var ls = mesh.looptris;\r\n \r\n /*\r\n if (recalcflags & MeshRecalcFlags.REGEN_TESS) {\r\n for (var i=0; i<Math.floor(ls.length/3); i++) {\r\n ls[i*3].f.flag &= ~Flags.DIRTY;\r\n \r\n idxs.push(ls[i*3].v.index);\r\n idxs.push(ls[i*3+1].v.index);\r\n idxs.push(ls[i*3+2].v.index);\r\n }\r\n idxs = new Uint16Array(idxs);\r\n \r\n if (outline_tris) {\r\n var tlines = new Array();\r\n var ls = mesh.looptris;\r\n \r\n for (var i=0; i<Math.floor(ls.length/3); i++) {\r\n for (var j=0; j<3; j++) {\r\n tlines.push(ls[i*3+j].v.index);\r\n tlines.push(ls[i*3+(j+1)%3].v.index);\r\n }\r\n }\r\n \r\n tlines = new Uint16Array(tlines);\r\n \r\n mesh.render.kill_buf(\"outlinebuf\");\r\n mesh.render.outlinebuf = ctx.createBuffer();\r\n ctx.bindBuffer(ctx.ELEMENT_ARRAY_BUFFER, mesh.render.outlinebuf);\r\n ctx.bufferData(ctx.ELEMENT_ARRAY_BUFFER, tlines, ctx.STATIC_DRAW);\r\n }\r\n \r\n //triangles\r\n mesh.render.kill_buf(\"indexbuf\");\r\n mesh.render.indexbuf = ctx.createBuffer();\r\n ctx.bindBuffer(ctx.ELEMENT_ARRAY_BUFFER, mesh.render.indexbuf);\r\n ctx.bufferData(ctx.ELEMENT_ARRAY_BUFFER, idxs, ctx.STATIC_DRAW);\r\n \r\n //edges, for interpolating vertex selection\r\n var edgeidxs = new Array<short>();\r\n for (var e of mesh.edges) {\r\n e.flag &= ~Flags.DIRTY;\r\n edgeidxs.push(e.v1.index);\r\n edgeidxs.push(e.v2.index);\r\n }\r\n \r\n //non-vertex-selection-interpolated edges\r\n edgeidxs = new Uint16Array(edgeidxs);\r\n mesh.render.kill_buf(\"edgeindexbuf\");\r\n mesh.render.edgeindexbuf = ctx.createBuffer();\r\n ctx.bindBuffer(ctx.ELEMENT_ARRAY_BUFFER, mesh.render.edgeindexbuf);\r\n ctx.bufferData(ctx.ELEMENT_ARRAY_BUFFER, edgeidxs, ctx.STATIC_DRAW);\r\n \r\n }*/\r\n \r\n var edgebuf = new Array<float>();\r\n for (var e of mesh.edges) {\r\n for (i=0; i<3; i++) {\r\n edgebuf.push(e.v1.co[i]);\r\n }\r\n for (i=0; i<3; i++) {\r\n edgebuf.push(e.v2.co[i]);\r\n }\r\n }\r\n \r\n edgebuf = new Float32Array(edgebuf);\r\n \r\n var ecolorbuf = new Array<float>();\r\n for (var e of mesh.edges) {\r\n if ((recalcflags & MeshRecalcFlags.REGEN_COLORS) != 0) {\r\n var color = get_element_color(e, mesh.edges.highlight);\r\n for (i=0; i<2; i++) {\r\n ecolorbuf.push(color[0]);\r\n ecolorbuf.push(color[1]);\r\n ecolorbuf.push(color[2]);\r\n ecolorbuf.push(color[3]);\r\n }\r\n }\r\n }\r\n ecolorbuf = new Float32Array(ecolorbuf);\r\n \r\n mesh.render.kill_buf(\"edgebuf\");\r\n mesh.render.edgebuf = ctx.createBuffer();\r\n ctx.bindBuffer(ctx.ARRAY_BUFFER, mesh.render.edgebuf);\r\n ctx.bufferData(ctx.ARRAY_BUFFER, edgebuf, ctx.STATIC_DRAW);\r\n\r\n if (recalcflags & MeshRecalcFlags.REGEN_COLORS) {\r\n mesh.render.kill_buf(\"ecolorbuf\");\r\n mesh.render.ecolorbuf = ctx.createBuffer();\r\n ctx.bindBuffer(ctx.ARRAY_BUFFER, mesh.render.ecolorbuf);\r\n ctx.bufferData(ctx.ARRAY_BUFFER, ecolorbuf, ctx.STATIC_DRAW);\r\n }\r\n \r\n ctx.bindBuffer(ctx.ELEMENT_ARRAY_BUFFER, null);\r\n ctx.bindBuffer(ctx.ARRAY_BUFFER, null);\r\n\r\n mesh.render.numIndices = idxs.length;\r\n \r\n /*triangle data*/\r\n var tri_vbuff = new Array<float>();\r\n var tri_nbuff = new Array<float>();\r\n var i = 0;\r\n for (var i=0; i<ls.length; i++) {\r\n if (ls[i] == undefined || ls[i].v == undefined) {\r\n for (var j=0; j<3; j++) {\r\n tri_vbuff.push(0.0);\r\n }\r\n continue;\r\n }\r\n \r\n tri_vbuff.push(ls[i].v.co[0]);\r\n tri_vbuff.push(ls[i].v.co[1]);\r\n tri_vbuff.push(ls[i].v.co[2]);\r\n }\r\n \r\n for (var i=0; i<ls.length; i++) {\r\n if (ls[i] == undefined || ls[i].v == undefined) {\r\n for (var j=0; j<3; j++) {\r\n tri_nbuff.push(0.0);\r\n }\r\n continue;\r\n }\r\n \r\n if (recalcflags & MeshRecalcFlags.REGEN_NORS) {\r\n if (ls[i].f.flags & Flags.SHADE_SMOOTH) {\r\n tri_nbuff.push(ls[i].v.no[0]);\r\n tri_nbuff.push(ls[i].v.no[1]);\r\n tri_nbuff.push(ls[i].v.no[2]);\r\n } else {\r\n tri_nbuff.push(ls[i].f.no[0]);\r\n tri_nbuff.push(ls[i].f.no[1]);\r\n tri_nbuff.push(ls[i].f.no[2]);\r\n }\r\n }\r\n }\r\n \r\n tri_vbuff = new Float32Array(tri_vbuff);\r\n if (recalcflags & MeshRecalcFlags.REGEN_NORS) {\r\n tri_nbuff = new Float32Array(tri_nbuff);\r\n }\r\n \r\n var tri_cbuff = new Array<float>();\r\n var i = 0;\r\n for (var i=0; i<ls.length; i++) {\r\n if (ls[i] == undefined || ls[i].v == undefined) {\r\n for (var j=0; j<4; j++) {\r\n tri_cbuff.push(j == 3 ? 1.0 : 0.0);\r\n }\r\n continue;\r\n }\r\n \r\n var f = ls[i].f;\r\n \r\n if ((recalcflags & MeshRecalcFlags.REGEN_COLORS) != 0) {\r\n var color = get_element_color(f, mesh.faces.highlight, true);\r\n \r\n tri_cbuff.push(color[0]);\r\n tri_cbuff.push(color[1]);\r\n tri_cbuff.push(color[2]);\r\n tri_cbuff.push(color[3]);\r\n }\r\n }\r\n tri_cbuff = new Float32Array(tri_cbuff);\r\n \r\n var faceverts = new Array<float>();\r\n var facecolors = new Array<float>();\r\n var center;\r\n for (var f of mesh.faces) {\r\n if (mesh.flag & MeshFlags.USE_MAP_CO)\r\n center = f.mapcenter;\r\n else\r\n center = f.center;\r\n \r\n faceverts.push(center[0]);\r\n faceverts.push(center[1]);\r\n faceverts.push(center[2]);\r\n \r\n if ((recalcflags & MeshRecalcFlags.REGEN_COLORS) != 0) {\r\n var color = get_element_color(f, mesh.faces.highlight, false);\r\n \r\n facecolors.push(color[0]);\r\n facecolors.push(color[1]);\r\n facecolors.push(color[2]);\r\n facecolors.push(color[3]);\r\n }\r\n }\r\n \r\n faceverts = new Float32Array(faceverts);\r\n facecolors = new Float32Array(facecolors);\r\n mesh.render.totface = mesh.faces.length;\r\n\r\n mesh.render.kill_buf(\"faceverts\");\r\n mesh.render.faceverts = ctx.createBuffer();\r\n ctx.bindBuffer(ctx.ARRAY_BUFFER, mesh.render.faceverts);\r\n ctx.bufferData(ctx.ARRAY_BUFFER, faceverts, ctx.STATIC_DRAW);\r\n\r\n if ((recalcflags & MeshRecalcFlags.REGEN_COLORS) != 0) {\r\n mesh.render.kill_buf(\"facecolors\");\r\n mesh.render.facecolors = ctx.createBuffer();\r\n ctx.bindBuffer(ctx.ARRAY_BUFFER, mesh.render.facecolors);\r\n ctx.bufferData(ctx.ARRAY_BUFFER, facecolors, ctx.STATIC_DRAW);\r\n }\r\n \r\n mesh.render.kill_buf(\"tri_vbuff\");\r\n mesh.render.tri_vbuff = ctx.createBuffer();\r\n ctx.bindBuffer(ctx.ARRAY_BUFFER, mesh.render.tri_vbuff);\r\n ctx.bufferData(ctx.ARRAY_BUFFER, tri_vbuff, ctx.STATIC_DRAW);\r\n\r\n if ((recalcflags & MeshRecalcFlags.REGEN_COLORS) != 0) {\r\n mesh.render.kill_buf(\"tri_cbuff\");\r\n mesh.render.tri_cbuff = ctx.createBuffer();\r\n ctx.bindBuffer(ctx.ARRAY_BUFFER, mesh.render.tri_cbuff);\r\n ctx.bufferData(ctx.ARRAY_BUFFER, tri_cbuff, ctx.STATIC_DRAW);\r\n }\r\n \r\n if (recalcflags & MeshRecalcFlags.REGEN_NORS) {\r\n mesh.render.kill_buf(\"tri_nbuff\");\r\n mesh.render.tri_nbuff = ctx.createBuffer();\r\n ctx.bindBuffer(ctx.ARRAY_BUFFER, mesh.render.tri_nbuff);\r\n ctx.bufferData(ctx.ARRAY_BUFFER, tri_nbuff, ctx.STATIC_DRAW);\r\n }\r\n \r\n mesh.render.tri_totvert = ls.length;\r\n \r\n /*face center dots*/\r\n \r\n // Enable all of the vertex attribute arrays.\r\n ctx.enableVertexAttribArray(0);\r\n ctx.enableVertexAttribArray(2);\r\n //ctx.enableVertexAttribArray(1);\r\n ctx.enableVertexAttribArray(3);\r\n \r\n // Set up all the vertex attributes for vertices, normals and texCoords\r\n ctx.bindBuffer(gl.ARRAY_BUFFER, mesh.render.vertbuf);\r\n ctx.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);\r\n\r\n if (mesh.render.norbuf != undefined && mesh.render.norbuf != 0) {\r\n ctx.bindBuffer(gl.ARRAY_BUFFER, mesh.render.norbuf);\r\n ctx.vertexAttribPointer(2, 3, gl.FLOAT, false, 0, 0);\r\n } else {\r\n ctx.disableVertexAttribArray(2);\r\n }\r\n \r\n if (mesh.render.vcolorbuf != 0) {\r\n ctx.bindBuffer(gl.ARRAY_BUFFER, mesh.render.vcolorbuf);\r\n ctx.vertexAttribPointer(1, 4, gl.FLOAT, false, 0, 0);\r\n }\r\n \r\n /*ctx.bindBuffer(gl.ARRAY_BUFFER, mesh.render.texbuf);\r\n ctx.vertexAttribPointer(3, 2, gl.FLOAT, false, 0, 0);*/\r\n \r\n if ((recalcflags & MeshRecalcFlags.REGEN_COLORS) || (recalcflags & MeshRecalcFlags.REGEN_TESS))\r\n gen_mesh_selbufs(ctx, mesh);\r\n \r\n mesh.render.recalc = 0;\r\n}", "title": "" }, { "docid": "e54b3deeebcdd038e0c716e69b09bc7e", "score": "0.50689065", "text": "function extract_triangles_position(submesh, dest) {\n\n if (!dest)\n dest = [];\n\n var positions = submesh.va_frames[0][\"a_position\"];\n\n return ext_triangles(positions, submesh, dest);;\n}", "title": "" }, { "docid": "34cd50dd1e196e4bb69e6948d325d072", "score": "0.50481826", "text": "function findHorizonEdges(mesh, lightFaceIndices) {\n var edgeCounts = {};\n for (var i = 0; i < lightFaceIndices.length; ++i) {\n var face = mesh.faces[lightFaceIndices[i]];\n addEdgeToCount(face.a, face.b, edgeCounts);\n addEdgeToCount(face.b, face.c, edgeCounts);\n addEdgeToCount(face.c, face.a, edgeCounts);\n }\n var horizonEdges = [];\n\n // The original normal ordering is maintained in the e3dge count and used to construct\n // horizon\n for (var key in edgeCounts) {\n if (edgeCounts[key].n === 1) {\n horizonEdges.push(edgeCounts[key].originalOrder);\n }\n }\n return horizonEdges;\n}", "title": "" }, { "docid": "63beba994b5fe1325f9489d59dff62a4", "score": "0.50453496", "text": "function camera_follow_ground(ground_meshes_list) {\n\t// determine if a valid ground mesh is under the camera\n\tlet ray_origin = scene.activeCamera.position;\n\tlet ray_direction = new BABYLON.Vector3(0, -1, 0);\n\tlet ray_length = 2.5;\n\tlet ray = new BABYLON.Ray(ray_origin, ray_direction, ray_length);\n\tlet picking_info = scene.pickWithRay(\n\t\tray,\n\t\tfunction (mesh) {\n\t\t\tfor (var i = 0; i < ground_meshes_list.length; i++) {\n\t\t\t\tif (ground_meshes_list[i].id == mesh.id) { return true; }\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t);\n\t// follow the ground\n\tif (picking_info.hit) {\n\t\tvar diffY = scene.activeCamera.position.y - (picking_info.pickedPoint.y + 1.75);\n\t\t//console.log(\"camera is \" + diffY + \" over mesh \" + picking_info.pickedMesh.id);\n\t\t//\tif (Math.abs(diffY < 1.0)) {\n\t\tif (diffY < 0.0 || diffY > 0.0) {\n\t\t\tscene.activeCamera.position.y = picking_info.pickedPoint.y + 1.75;\n\t\t}\n\t\t//\t}\n\t\t// NB(Anton) if i just say cam_pos = position then it does a silly reference instead of a copy\n\t\tprev_cam_pos.x = scene.activeCamera.position.x;\n\t\tprev_cam_pos.y = scene.activeCamera.position.y;\n\t\tprev_cam_pos.z = scene.activeCamera.position.z;\n\t\treturn;\n\t}\n\n\t// TODO(Anton) if fallen below world for some reason pop back up\n\tray_direction = new BABYLON.Vector3(0, 1, 0);\n\tray_length = 4.0; // 4m above camera + amount camera would be offset above that\n\tray = new BABYLON.Ray(ray_origin, ray_direction, ray_length);\n\tpicking_info = scene.pickWithRay(\n\t\tray,\n\t\tfunction (mesh) {\n\t\t\tfor (var i = 0; i < ground_meshes_list.length; i++) {\n\t\t\t\tif (ground_meshes_list[i].id == mesh.id) { return true; }\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t);\n\tif (picking_info.hit) {\n\t\tvar diffY = scene.activeCamera.position.y - (picking_info.pickedPoint.y + 1.75);\n\t\tif (Math.abs(diffY) < 3.0) {\n\t\t\tconsole.log(\"camera was \" + diffY + \" under the nav mesh, so popping back up\");\n\t\t\tscene.activeCamera.position.y = picking_info.pickedPoint.y + 1.75;\n\t\t\tprev_cam_pos.x = scene.activeCamera.position.x;\n\t\t\tprev_cam_pos.y = scene.activeCamera.position.y;\n\t\t\tprev_cam_pos.z = scene.activeCamera.position.z;\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// if there was no nav mesh below / or / above\n\t//\tconsole.log(\" out of bounds! moving camera from \" + scene.activeCamera.position + \" back to \" + prev_cam_pos);\n\tscene.activeCamera.position.x = prev_cam_pos.x;\n\tscene.activeCamera.position.y = prev_cam_pos.y;\n\tscene.activeCamera.position.z = prev_cam_pos.z;\n\n\t// TODO(Anton) check if we're /really/ out of xz or y bounds and reset back to original position\n}", "title": "" }, { "docid": "bffaef3a757ee4a9318e1de047f024bb", "score": "0.5037234", "text": "function meshChunk(self, chunk) {\n var noa = self.noa\n var matGetter = noa.registry.getBlockFaceMaterialAccessor()\n var colGetter = noa.registry.getMaterialVertexColorAccessor()\n // returns an array of chunk#Submesh\n var blockFaceMats = noa.registry._blockMats\n return chunk.mesh(matGetter, colGetter, self.useAO, self.aoVals, self.revAoVal, blockFaceMats)\n}", "title": "" }, { "docid": "9f9a3c243acb55124206af315b000ab1", "score": "0.5035024", "text": "getVertexNormal() {\r\n for (var i = 0; i <= this.div ; i++) {\r\n for (var j = 0; j <= this.div; j++) {\r\n var idx = j * (this.div + 1) + i;\r\n var count = 0;\r\n var normal = vec3.fromValues(0,0,0);\r\n if (i > 0 && j > 0) {\r\n var fid1 = this.div * 2 * (j - 1) + 2 * (i - 1);\r\n var temp = vec3.fromValues(this.faceNormals[fid1*3],this.faceNormals[fid1*3+1],this.faceNormals[fid1*3+2]);\r\n //console.log(vec3.length(normal));\r\n vec3.add(normal,normal,temp);\r\n //console.log(vec3.length(normal),temp);\r\n var fid2 = this.div * 2 * (j - 1) + 2 * (i - 1) + 1;\r\n temp = vec3.fromValues(this.faceNormals[fid2*3],this.faceNormals[fid2*3+1],this.faceNormals[fid2*3+2]);\r\n //console.log(normal)\r\n vec3.add(normal,normal,temp);\r\n //console.log(normal,temp);\r\n //console.log(i,j,fid1,fid2,temp,this.faceNormals.length);\r\n count += 2;\r\n }\r\n if (i < this.div && j < this.div) {\r\n var fid1 = this.div * 2 * j + 2 * i;\r\n var temp = vec3.fromValues(this.faceNormals[fid1*3],this.faceNormals[fid1*3+1],this.faceNormals[fid1*3+2]);\r\n vec3.add(normal,normal,temp);\r\n var fid2 = this.div * 2 * j + 2 * i + 1;\r\n temp = vec3.fromValues(this.faceNormals[fid2*3],this.faceNormals[fid2*3+1],this.faceNormals[fid2*3+2]);\r\n vec3.add(normal,normal,temp);\r\n //console.log(i,j,fid1,fid2);\r\n count += 2;\r\n }\r\n if (i > 0 && j < this.div) {\r\n var fid1 = this.div * 2 * j + 2 * i - 1;\r\n var temp = vec3.fromValues(this.faceNormals[fid1*3],this.faceNormals[fid1*3+1],this.faceNormals[fid1*3+2]);\r\n vec3.add(normal,normal,temp);\r\n //console.log(i,j,fid1);\r\n count += 1;\r\n }\r\n if (j > 0 && i < this.div) {\r\n var fid1 = this.div * 2 * (j - 1) + 2 * i;\r\n var temp = vec3.fromValues(this.faceNormals[fid1*3],this.faceNormals[fid1*3+1],this.faceNormals[fid1*3+2]);\r\n vec3.add(normal,normal,temp);\r\n //console.log(i,j,fid1);\r\n count += 1;\r\n }\r\n //console.log(vec3.length(normal),count)\r\n vec3.normalize(normal,normal);\r\n //console.log(vec3.length(normal))\r\n //idx = i * (this.div + 1) + j;\r\n this.nBuffer[idx*3] = normal[0];\r\n this.nBuffer[idx*3+1] = normal[1];\r\n this.nBuffer[idx*3+2] = normal[2];\r\n }\r\n }\r\n}", "title": "" }, { "docid": "cd3bf425fa0b09aed0140f5bdf2eaf4f", "score": "0.5032312", "text": "createOrClearMesh (meshName) {\n if (!(meshName in this.displayMeshes)) {\n this.displayMeshes[meshName] = new THREE.Object3D()\n } else {\n glgeom.clearObject3D(this.displayMeshes[meshName])\n }\n if (!(meshName in this.pickingMeshes)) {\n this.pickingMeshes[meshName] = new THREE.Object3D()\n } else {\n glgeom.clearObject3D(this.pickingMeshes[meshName])\n }\n }", "title": "" }, { "docid": "391c848abc8ec631aec48d87049f2532", "score": "0.5029469", "text": "generateTriangles() {\n /* Set up vertices */\n let dx = (this.maxX-this.minX)/this.div;\n let dy = (this.maxY-this.minY)/this.div;\n for(let i = 0; i <= this.div; i++){\n let y = this.minY + dy*i;\n for(let j = 0; j <= this.div; j++){ \n let x = this.minX + dx*j;\n this.positionData.push(x);\n this.positionData.push(y);\n this.positionData.push(0);\n }\n }\n\n /* Set up faces */\n for(let y = 0; y < this.div; y++){\n for(let x = 0; x < this.div; x++){\n let bottomLeft = y*(this.div+1) + x;\n let bottomRight = bottomLeft + 1;\n let topLeft = bottomLeft + this.div + 1;\n let topRight = topLeft + 1;\n\n this.faceData.push(bottomLeft);\n this.faceData.push(bottomRight);\n this.faceData.push(topLeft);\n\n this.faceData.push(bottomRight);\n this.faceData.push(topRight);\n this.faceData.push(topLeft);\n }\n }\n\n // We'll need these to set up the WebGL buffers.\n this.numVertices = this.positionData.length/3;\n this.numFaces = this.faceData.length/3;\n }", "title": "" }, { "docid": "f4d49c24e7f8627d9a74d3b8e137ff03", "score": "0.5023597", "text": "function o$9(o,d){0===d.normalType&&(o.attributes.add(\"normal\",\"vec3\"),o.vertex.code.add(t$l`\n vec3 normalModel() {\n return normal;\n }\n `)),1===d.normalType&&(o.include(o$a),o.attributes.add(\"normalCompressed\",\"vec2\"),o.vertex.code.add(t$l`\n vec3 normalModel() {\n return decodeNormal(normalCompressed);\n }\n `)),3===d.normalType&&(o.extensions.add(\"GL_OES_standard_derivatives\"),o.fragment.code.add(t$l`\n vec3 screenDerivativeNormal(vec3 positionView) {\n return normalize(cross(dFdx(positionView), dFdy(positionView)));\n }\n `));}", "title": "" }, { "docid": "7bd81608a2639d4b2d4318d7b51b568a", "score": "0.5020797", "text": "function MarchingCube(voxel, isolevel, material) {\n var geometry = new THREE.Geometry();\n var vertexIndex = 0;\n var vertexlist = new Array(12);\n\n var cubeIndex = 0;\n\n if (voxel.verts.p0.value < isolevel) {\n cubeIndex |= 1;\n voxel.verts.p0.inside = true;\n } //0\n if (voxel.verts.p1.value < isolevel) {\n cubeIndex |= 2;\n voxel.verts.p1.inside = true;\n } //1\n if (voxel.verts.p2.value < isolevel) {\n cubeIndex |= 4;\n voxel.verts.p2.inside = true;\n } //2\n if (voxel.verts.p3.value < isolevel) {\n cubeIndex |= 8;\n voxel.verts.p3.inside = true;\n } //3\n if (voxel.verts.p4.value < isolevel) {\n cubeIndex |= 16;\n voxel.verts.p4.inside = true;\n } //4\n if (voxel.verts.p5.value < isolevel) {\n cubeIndex |= 32;\n voxel.verts.p5.inside = true;\n } //5\n if (voxel.verts.p6.value < isolevel) {\n cubeIndex |= 64;\n voxel.verts.p6.inside = true;\n } //6\n if (voxel.verts.p7.value < isolevel) {\n cubeIndex |= 128;\n voxel.verts.p7.inside = true;\n } //7\n\n var bits = THREE.edgeTable[ cubeIndex ];\n //if (bits === 0 ) continue;\n\n if (bits & 1) {\n vertexlist[0] = vertexInterpolation(isolevel, voxel.verts.p0.position, voxel.verts.p1.position, voxel.verts.p0.value, voxel.verts.p1.value);\n }\n if (bits & 2) {\n vertexlist[1] = vertexInterpolation(isolevel, voxel.verts.p1.position, voxel.verts.p2.position, voxel.verts.p1.value, voxel.verts.p2.value);\n }\n if (bits & 4) {\n vertexlist[2] = vertexInterpolation(isolevel, voxel.verts.p2.position, voxel.verts.p3.position, voxel.verts.p2.value, voxel.verts.p3.value);\n }\n if (bits & 8) {\n vertexlist[3] = vertexInterpolation(isolevel, voxel.verts.p3.position, voxel.verts.p0.position, voxel.verts.p3.value, voxel.verts.p0.value);\n }\n if (bits & 16) {\n vertexlist[4] = vertexInterpolation(isolevel, voxel.verts.p4.position, voxel.verts.p5.position, voxel.verts.p4.value, voxel.verts.p5.value);\n }\n if (bits & 32) {\n vertexlist[5] = vertexInterpolation(isolevel, voxel.verts.p5.position, voxel.verts.p6.position, voxel.verts.p5.value, voxel.verts.p6.value);\n }\n if (bits & 64) {\n vertexlist[6] = vertexInterpolation(isolevel, voxel.verts.p6.position, voxel.verts.p7.position, voxel.verts.p6.value, voxel.verts.p7.value);\n }\n if (bits & 128) {\n vertexlist[7] = vertexInterpolation(isolevel, voxel.verts.p7.position, voxel.verts.p4.position, voxel.verts.p7.value, voxel.verts.p4.value);\n }\n if (bits & 256) {\n vertexlist[8] = vertexInterpolation(isolevel, voxel.verts.p0.position, voxel.verts.p4.position, voxel.verts.p0.value, voxel.verts.p4.value);\n }\n if (bits & 512) {\n vertexlist[9] = vertexInterpolation(isolevel, voxel.verts.p1.position, voxel.verts.p5.position, voxel.verts.p1.value, voxel.verts.p5.value);\n }\n if (bits & 1024) {\n vertexlist[10] = vertexInterpolation(isolevel, voxel.verts.p2.position, voxel.verts.p6.position, voxel.verts.p2.value, voxel.verts.p6.value);\n }\n if (bits & 2048) {\n vertexlist[11] = vertexInterpolation(isolevel, voxel.verts.p3.position, voxel.verts.p7.position, voxel.verts.p3.value, voxel.verts.p7.value);\n }\n\n // The following is from Lee Stemkoski's example and\n // deals with construction of the polygons and adding to\n // the scene.\n // http://stemkoski.github.io/Three.js/Marching-Cubes.html\n // construct triangles -- get correct vertices from triTable.\n var i = 0;\n cubeIndex <<= 4; // multiply by 16...\n // \"Re-purpose cubeindex into an offset into triTable.\"\n // since each row really isn't a row.\n // the while loop should run at most 5 times,\n // since the 16th entry in each row is a -1.\n while (THREE.triTable[ cubeIndex + i ] != -1) {\n var index1 = THREE.triTable[cubeIndex + i];\n var index2 = THREE.triTable[cubeIndex + i + 1];\n var index3 = THREE.triTable[cubeIndex + i + 2];\n geometry.vertices.push(vertexlist[index1].clone());\n geometry.vertices.push(vertexlist[index2].clone());\n geometry.vertices.push(vertexlist[index3].clone());\n var face = new THREE.Face3(vertexIndex, vertexIndex + 1, vertexIndex + 2);\n geometry.faces.push(face);\n geometry.faceVertexUvs[ 0 ].push([ new THREE.Vector2(0, 0), new THREE.Vector2(0, 1), new THREE.Vector2(1, 1) ]);\n vertexIndex += 3;\n i += 3;\n }\n\n geometry.computeCentroids();\n geometry.computeFaceNormals();\n geometry.computeVertexNormals();\n\n voxel.geometry = geometry;\n voxel.material = material;\n\n geometry.dynamic = true;\n geometry.verticesNeedUpdate = true;\n geometry.elementsNeedUpdate = true;\n geometry.morphTargetsNeedUpdate = true;\n geometry.uvsNeedUpdate = true;\n geometry.normalsNeedUpdate = true;\n geometry.colorsNeedUpdate = true;\n geometry.tangentsNeedUpdate = true;\n\n return voxel;\n}", "title": "" }, { "docid": "1c6d7ff5ff758ce5ad88647d0208a140", "score": "0.50152755", "text": "onWorkerMessage (msg) {\n\n\n const state = this.react.getState()\n\n const data = msg.data \n\n const material = this.levelMaterials[data.level]\n\n // build mesh from the meta data \n const mesh = this.buildMesh(data, material)\n\n // set levelIdx \n const levelIdx = data.levelCount - data.level - 1\n\n // set the level info in the state or create them\n const level = state.levels[levelIdx] || {\n strokeColor: this.levelColors[data.level],\n fillColor: this.levelColors[data.level],\n name: `Level ${data.level+1}`,\n walls: {\n name: `Walls [Level #${data.level+1}]`,\n active: false,\n meshes: []\n },\n floor: {\n meshes: data.floorDbIds.map((dbId) => {\n return Toolkit.buildComponentMesh(\n this.viewer, this.viewer.model,\n dbId, null, material)\n }),\n name: `Floor [Level #${data.level+1}]`,\n dbIds: data.floorDbIds,\n active: false,\n paths: []\n },\n report: {\n level: `Level ${data.level+1}`,\n boundingBox: msg.levelBox,\n walls: []\n }\n }\n\n // retrieve specific level\n state.levels[levelIdx] = level\n\n // push new mesh into the level\n level.walls.meshes.push(mesh)\n\n // The map() method creates a new array with the results \n // of calling a function for every array element.\n // create paths for the floor of the level\n const lines = data.pathEdges.map((edge) => {\n\n const geometry = new THREE.Geometry()\n\n edge.start.z += 0.05\n edge.end.z += 0.05\n\n geometry.vertices.push(\n new THREE.Vector3(\n edge.start.x,\n edge.start.y,\n edge.start.z))\n\n geometry.vertices.push(\n new THREE.Vector3(\n edge.end.x,\n edge.end.y,\n edge.end.z))\n\n geometry.computeLineDistances()\n\n return new THREE.Line(geometry,\n this.linesMaterial,\n THREE.LinePieces)\n })\n\n level.floor.paths.push({\n lines\n })\n\n const wall = {\n path: data.pathEdges,\n dbId: mesh.dbId\n }\n\n Toolkit.getProperties(\n this.viewer.model,\n mesh.dbId).then((properties) => {\n\n wall.properties = properties\n })\n\n level.report.walls.push(wall)\n\n const progress =\n (++this.nbMeshesLoaded) * 100 /\n (data.levelCount * data.wallCount)\n\n if (progress === 100) {\n\n this.notification.dismissAfter = 2000\n this.notification.status = 'success'\n }\n\n this.notification.message =\n `Processing Meshes `+\n `- Progress: ${progress.toFixed(2)}%`\n\n this.options.notify.update(this.notification)\n\n this.react.setState({\n levels: state.levels\n })\n }", "title": "" }, { "docid": "35b9e4e40eb9940d08b620969762e783", "score": "0.50087804", "text": "function meshChunk(self, chunk) {\n var noa = self.noa\n var matGetter = noa.registry.getBlockFaceMaterialAccessor()\n var colGetter = noa.registry.getMaterialVertexColorAccessor()\n // returns an array of chunk#Submesh\n var blockFaceMats = noa.registry._blockMats\n return chunk.mesh(matGetter, colGetter, self.useAO, self.aoVals, self.revAoVal, blockFaceMats )\n}", "title": "" }, { "docid": "9d57fb1a682e4cf0b1459f9734fe27c3", "score": "0.4993338", "text": "onWorkerMessageProcessSection(msg) {\n\n\n const state = this.react.getState()\n\n const data = msg.data \n\n // here the wall are originall asscoiated with the level\n // it is in, however, section do not have material associated\n // with it. I will use a hacky solution right now\n const sectionLevel = parseInt(data.section.split(' ')[1]) - 1\n const material = this.levelMaterials[sectionLevel ]\n\n // build mesh from the meta data \n const mesh = this.buildMesh(data, material)\n\n // set levelIdx \n const sectionId = data.section\n\n // set the level info in the state or create them\n // however this is effectively putting the mesh meta info\n // inside an object associated with an level, however\n // for the expressed purpose of displaying sections,\n // I dont want to place the mesh info inside the level\n const section = state.sections[sectionId] || {\n strokeColor: this.levelColors[sectionLevel],\n fillColor: this.levelColors[sectionLevel],\n name: `${sectionId}`,\n walls: {\n name: `Walls [Section #${sectionId}]`,\n active: false,\n meshes: []\n },\n floor: {\n meshes: [],\n name: `Floor [Section #${sectionId}]`,\n dbIds: data.dbId,\n active: false,\n paths: []\n },\n report: {\n level: `Level ${sectionLevel+1}`,\n boundingBox: msg.sectionBox,\n walls: []\n }\n }\n\n // retrieve specific level\n state.sections[sectionId] = section\n\n // push new mesh into the level\n section.floor.meshes.push(mesh)\n\n // The map() method creates a new array with the results \n // of calling a function for every array element.\n // create paths for the floor of the level\n const lines = data.pathEdges.map((edge) => {\n\n const geometry = new THREE.Geometry()\n\n edge.start.z += 0.05\n edge.end.z += 0.05\n\n geometry.vertices.push(\n new THREE.Vector3(\n edge.start.x,\n edge.start.y,\n edge.start.z))\n\n geometry.vertices.push(\n new THREE.Vector3(\n edge.end.x,\n edge.end.y,\n edge.end.z))\n\n geometry.computeLineDistances()\n\n return new THREE.Line(geometry,\n this.linesMaterial,\n THREE.LinePieces)\n })\n\n section.floor.paths.push({\n lines\n })\n\n // const wall = {\n // path: data.pathEdges,\n // dbId: mesh.dbId\n // }\n\n // Toolkit.getProperties(\n // this.viewer.model,\n // mesh.dbId).then((properties) => {\n\n // wall.properties = properties\n // })\n\n // level.report.walls.push(wall)\n\n // const progress =\n // (++this.nbMeshesLoaded) * 100 /\n // (data.levelCount * data.wallCount)\n\n // if (progress === 100) {\n\n // this.notification.dismissAfter = 2000\n // this.notification.status = 'success'\n // }\n\n // this.notification.message =\n // `Processing Meshes `+\n // `- Progress: ${progress.toFixed(2)}%`\n\n // this.options.notify.update(this.notification)\n\n this.react.setState({\n sections: state.sections\n })\n }", "title": "" }, { "docid": "68c5516ab744379677ec0411a48f4a01", "score": "0.49928904", "text": "function Gemelli() {\r\n const positions = [];\r\n const colors = [];\r\n const indices = [];\r\n let normals = [];\r\n\r\n let index = 0;\r\n const indexArray = [];\r\n let vertex = new THREE.Vector3();\r\n\r\n let i_max = 100;\r\n let j_max = 50;\r\n\r\n let r, g, b;\r\n for (let i = 0; i <= i_max; i++) {\r\n const indexRow = [];\r\n for (let j = 0; j <= j_max; j++) {\r\n r = i / i_max;\r\n g = 0.5;\r\n b = j / j_max;\r\n\r\n vertex.x =\r\n 6 *\r\n Math.cos((j / 50) * 1.9 * Math.PI + 0.55 * Math.PI) *\r\n Math.cos((3 * i) / 25);\r\n vertex.y =\r\n 6 *\r\n Math.cos((j / 50) * 1.9 * Math.PI + 0.55 * Math.PI) *\r\n Math.sin((3 * i) / 25);\r\n vertex.z =\r\n 8 * Math.sin((j / 50) * 1.9 * Math.PI + 0.55 * Math.PI) + (3 * i) / 4;\r\n\r\n positions.push(vertex.x, vertex.y, vertex.z);\r\n colors.push(r, g, b);\r\n indexRow.push(index++);\r\n }\r\n indexArray.push(indexRow);\r\n }\r\n\r\n for (let i = 0; i < i_max; i++) {\r\n for (let j = 0; j < j_max; j++) {\r\n // we use the index array to access the correct indices\r\n const a = indexArray[i][j];\r\n const b = indexArray[i + 1][j];\r\n const c = indexArray[i + 1][j + 1];\r\n const d = indexArray[i][j + 1];\r\n // faces\r\n indices.push(a, b, d);\r\n indices.push(b, c, d);\r\n //normal\r\n let normal = new THREE.Vector3();\r\n normal.crossVectors( new THREE.Vector3(\r\n positions[3*d]-positions[3*b],\r\n positions[3*d+1]-positions[3*b+1],\r\n positions[3*d+2]-positions[3*b+2]),\r\n new THREE.Vector3(\r\n positions[3*b]-positions[3*a],\r\n positions[3*b+1]-positions[3*a+1],\r\n positions[3*b+2]-positions[3*a+2]\r\n ))\r\n normal.normalize();\r\n normals.push(normal.x, normal.y, normal.z);\r\n }\r\n }\r\n\r\n let geometry = new THREE.BufferGeometry();\r\n geometry.setAttribute(\r\n \"position\",\r\n new THREE.Float32BufferAttribute(positions, 3)\r\n );\r\n geometry.setAttribute(\"color\", new THREE.Float32BufferAttribute(colors, 3));\r\n geometry.setAttribute( 'normal', new THREE.Float32BufferAttribute( normals, 3 ) );\r\n geometry.setIndex(indices);\r\n return geometry;\r\n}", "title": "" }, { "docid": "cb477780ccdb28e780a8b83b08289705", "score": "0.49895355", "text": "function cube_mesh(args) {\n\n var resolution = args.resolution || 10;\n var scale = typeof(args.scale) === \"number\" ? [args.scale, args.scale, args.scale] : (args.scale || [1.0, 1.0, 1.0]);\n\n var radius = resolution >> 1;\n var side_len = 2*radius + 1;\n function p(x,y,s) { \n return x + side_len * (y + side_len * s); \n }\n \n var positions = new Array(6 * side_len * side_len);\n var faces = []; \n \n for(var d=0; d<3; ++d) {\n var u = (d+1)%3;\n var v = (d+2)%3;\n \n for(var s=0; s<2; ++s) {\n var f = 2*d + s;\n var x = new Array(3);\n \n x[u] = -radius;\n x[v] = -radius;\n x[d] = (1 - 2*s) * radius;\n \n for(var j=0; j<side_len; ++j, ++x[v]) {\n x[u] = -radius;\n for(var i=0; i<side_len; ++i, ++x[u]) {\n var pos = new Array(3);\n for(var k=0; k<3; ++k) {\n pos[k] = x[k] * scale[k] / radius;\n }\n \n positions[p(i, j, f)] = pos;\n \n if(i < side_len-1 && j < side_len-1) {\n if(s) {\n faces.push([ p(i,j,f), p(i,j+1,f), p(i+1,j,f) ]);\n faces.push([ p(i+1,j,f), p(i,j+1,f), p(i+1,j+1,f) ]); \n } else {\n faces.push([ p(i,j,f), p(i+1,j,f), p(i,j+1,f) ]);\n faces.push([ p(i,j+1,f), p(i+1,j,f), p(i+1,j+1,f) ]);\n }\n }\n }\n }\n }\n }\n\n //Glue 6 faces together and return\n var tol = 0.5 * Math.min(scale[0], Math.min(scale[1], scale[2])) / radius;\n return repair.fuse_vertices({positions: positions, faces: faces}, tol);\n}", "title": "" }, { "docid": "443ab7ad8109d1ec09ae91541b4295d8", "score": "0.4987825", "text": "floor() {\n return new Vector3(Math.floor(this._x), Math.floor(this._y), Math.floor(this._z));\n }", "title": "" }, { "docid": "cd7659932f1dce9df10bf605b18d25cc", "score": "0.49869782", "text": "function createTextureCube( ) {\n\n var r = \"textures/bridge/\";\n var urls = [ r + \"posx.jpg\", r + \"negx.jpg\",\n r + \"posy.jpg\", r + \"negy.jpg\",\n r + \"posz.jpg\", r + \"negz.jpg\" ];\n\n textureCube = THREE.ImageUtils.loadTextureCube( urls );\n textureCube.format = THREE.RGBFormat;\n textureCube.mapping = THREE.CubeReflectionMapping;\n\n //var shader = THREE.FresnelShader;\n //var uniforms = THREE.UniformsUtils.clone( shader.uniforms );\n //\n //uniforms[ \"tCube\" ].value = textureCube;\n //\n //var parameters = { fragmentShader: shader.fragmentShader, vertexShader: shader.vertexShader, uniforms: uniforms };\n //var material = new THREE.ShaderMaterial( parameters );\n\n\n //scene.matrixAutoUpdate = false;\n\n //// Skybox\n //\n //var shader = THREE.ShaderLib[ \"cube\" ];\n //shader.uniforms[ \"tCube\" ].value = textureCube;\n //\n //var material = new THREE.ShaderMaterial( {\n //\n // fragmentShader: shader.fragmentShader,\n // vertexShader: shader.vertexShader,\n // uniforms: shader.uniforms,\n // side: THREE.BackSide\n //\n // } ),\n //\n // mesh = new THREE.Mesh( new THREE.BoxGeometry( 10000, 10000, 10000 ), material );\n //mesh.name=\"backdrop\";\n //scene.add( mesh );\n\n\n //var geometry = new THREE.CylinderGeometry( 1, 25, 1, 12 );\n //var material = new THREE.MeshBasicMaterial( {\n // color: 0x00FF00,\n // opacity: 0.25,\n // transparent: true\n //} )\n //cylinder = new THREE.Mesh( geometry, material );\n //cylinder.name = \"cursor\";\n //cylinder.position.z = 750;\n //cylinder.rotateX(3.1415/2);\n //\n //\n //var geometry1 = new THREE.CylinderGeometry( 4, 5, 1, 4 );\n //var material1 = new THREE.MeshBasicMaterial( {\n // color: 0xff0000,\n // opacity: 0.25,\n // transparent: true\n //} )\n //cylinderSmall = new THREE.Mesh( geometry1, material1 );\n //cylinderSmall.name = \"cursortip\";\n //cylinderSmall.position.z = 750;\n //cylinderSmall.rotateX(3.1415/2);\n //\n //scene.add( cylinder );\n //scene.add( cylinderSmall );\n\n ///////////////////////////////\n return textureCube;\n}", "title": "" }, { "docid": "692cc75aac729a1d97df8c0bad54d8d8", "score": "0.49801198", "text": "calculateNormals() {\n // Calculate normals on all faces\n let fnormals = [];\n let v1 = glMatrix.vec3.create();\n let v2 = glMatrix.vec3.create();\n let v3 = glMatrix.vec3.create();\n for(let i = 0; i < this.numFaces; i++){\n let f = i*3;\n this.getVertex(v1, this.faceData[f]);\n this.getVertex(v2, this.faceData[f+1]);\n this.getVertex(v3, this.faceData[f+2]);\n\n glMatrix.vec3.sub(v2, v2, v1);\n glMatrix.vec3.sub(v3, v3, v1);\n\n let n = glMatrix.vec3.create();\n glMatrix.vec3.cross(n, v2, v3);\n\n // TODO: I don't quite understand the difference between\n // triangle and parallelogram area weighting since this\n // 1/2 factor should end up canceling when I normalize later...\n glMatrix.vec3.scale(n, n, 0.5);\n \n fnormals.push(n);\n }\n\n // Interpolate normals for each vertex\n for(let y = 0; y <= this.div; y++){\n for(let x = 0; x <= this.div; x++){\n let faces = this.getNeighboringFaces(x, y);\n\n let n = glMatrix.vec3.create();\n faces.forEach((f) => glMatrix.vec3.add(n, n, fnormals[f]));\n glMatrix.vec3.normalize(n, n);\n\n this.normalData.push(...n)\n }\n }\n }", "title": "" }, { "docid": "ae1f9fbca1e995de38d0f3d0690fc633", "score": "0.4971061", "text": "function RepositionShadow() {\n\n\tobjRightX = objOriginX + (objWidth / 2);\n\tobjLeftX = objOriginX - (objWidth / 2);\n\tobjFloorY = objOriginY - (objHeight / 2) + SHADOW_OFFSET;\n\tobjBackZ = objOriginZ + (objDepth / 2);\n\tobjFrontZ = objOriginZ - (objDepth / 2);\n\n\tvar wall : GameObject = GameObject.Find(WALL_NAME);\n\tobjToWallDistance = Mathf.Abs(wall.renderer.transform.position.z - objOriginZ - objDepth / 2) - SHADOW_OFFSET;\n\t\n\tif(objToWallDistance > 5) isInLane = true;\n\telse isInLane = false;\n\n\tif(shadowV == null)\n\t\tCreateVerticalShadow();\n\n\tshadowMeshV.vertices = \n\t\t[Vector3(objRightX, objFloorY + heightScaleOffset, objBackZ + objToWallDistance),\n\t\t Vector3(objRightX - objWidth, objFloorY + heightScaleOffset, objBackZ + objToWallDistance),\n\t\t Vector3(objRightX - objWidth, objFloorY + objHeight + heightScaleOffset, objBackZ + objToWallDistance),\n\t\t Vector3(objRightX, objFloorY + objHeight + heightScaleOffset, objBackZ + objToWallDistance)];\n\n\tcolliderV.center = Vector3(objRightX - objWidth/2, objFloorY + objHeight/2, objBackZ + objToWallDistance);\n\n\t// Define triangles\n\tif (reverseTriWinding) {\n\t\tshadowMeshV.triangles = [2, 1, 0, 3, 2, 0];\n\t}\n\telse {\n\t\tshadowMeshV.triangles = [0, 1, 2, 0, 2, 3];\n\t}\n\n\tshadowMeshV.RecalculateNormals();\t// Define normals\n\tshadowMeshV.uv = [Vector2 (0, 0), Vector2 (0, 1), Vector2(1, 1), Vector2 (1, 0)];\t// Define UVs\n\n\t// Apply mesh\n\tshadowV.GetComponent(MeshFilter).mesh = shadowMeshV;\n\n\tif(isInLane)\n\t\tshadowV.renderer.material = shadowTextureFront;\n\telse\n\t\tshadowV.renderer.material = shadowTextureFloor2Wall;\n\n\tif(!againstWall){\n\t\tshadowMeshH.vertices = \n\t\t\t[Vector3(objRightX, objFloorY, objBackZ + objToWallDistance),\n\t\t\t Vector3(objRightX - objWidth, objFloorY, objBackZ + objToWallDistance),\n\t\t\t Vector3(objRightX - objWidth, objFloorY, objBackZ),\n\t\t\t Vector3(objRightX, objFloorY, objBackZ)]; \n\n\t\t// Define triangles\n\t\tif (reverseTriWinding) {\n\t\t\tshadowMeshH.triangles = [2, 1, 0, 3, 2, 0];\n\t\t}\n\t\telse {\n\t\t\tshadowMeshH.triangles = [0, 1, 2, 0, 2, 3];\n\t\t}\n\n\t\tshadowMeshH.RecalculateNormals();\t// Define normals\n\t\tshadowMeshH.uv = [Vector2 (0, 0), Vector2 (0, 1), Vector2(1, 1), Vector2 (1, 0)];\t// Define UVs\n\n\t\tshadowH.GetComponent(MeshFilter).mesh = shadowMeshH;\n\t\tshadowH.renderer.material = shadowTextureWall;\n\t}\n}", "title": "" }, { "docid": "ecf3db1dff9fec28bea9d6fd2cf4562b", "score": "0.4965792", "text": "function initWebGLScene () {\n \n // Setting the renderer (with shadows)\n renderer = new THREE.WebGLRenderer( { antialias: true } );\n renderer.setSize( window.innerWidth, window.innerHeight );\n \n // Switch off the shadows for safari due to the three.js bug with it\n if( !$.browser.safari && $.browser.version != \"534.57.2\"){\n renderer.shadowMapEnabled = true;\n renderer.shadowMapSoft = true;\n }\n \n $('body').append( renderer.domElement );\n \n //*** Adding the grounds\n // material for the grounds\n var gridTex = THREE.ImageUtils.loadTexture(staticUrl+\"img/grid_pattern1.jpg\");\n gridTex.wrapS = gridTex.wrapT = THREE.RepeatWrapping;\n gridTex.repeat.set( 5, 5 );\n \n var gridTex2 = THREE.ImageUtils.loadTexture(staticUrl+\"img/grid_pattern2.jpg\");\n gridTex2.wrapS = gridTex2.wrapT = THREE.RepeatWrapping;\n gridTex2.repeat.set( schema.rows.length, schema.cols.length );\n \n var materialX = new THREE.MeshPhongMaterial({\n ambient : 0x444444,\n color : 0x777777,\n shininess : 70, \n specular : 0x888888,\n shading : THREE.SmoothShading,\n side: THREE.DoubleSide,\n map:gridTex2\n });\n \n var materialYZ = new THREE.MeshPhongMaterial({\n ambient : 0x444444,\n color : 0x999999,\n shininess : 70, \n specular : 0x888888,\n shading : THREE.SmoothShading,\n side: THREE.DoubleSide,\n map:gridTex\n });\n \n // Creating the ground-x\n var geometry = new THREE.PlaneGeometry( \n squareStep*schema.rows.length, \n squareStep*schema.cols.length );\n \n var groundX = new THREE.Mesh( geometry, materialX );\n groundX.rotation.x -= Math.PI/2;\n groundX.castShadow = false;\n groundX.receiveShadow = true;\n groundX.position.y = yDeviation;\n scene.add( groundX );\n \n // Creating the ground-y\n var geometry = new THREE.PlaneGeometry( \n squareStep*schema.rows.length, \n valHeight );\n \n var groundY = new THREE.Mesh( geometry, materialYZ );\n groundY.castShadow = false;\n groundY.receiveShadow = true;\n groundY.position.z = zDeviation;\n scene.add( groundY );\n \n // craating the groynd-z\n var geometry = new THREE.PlaneGeometry( \n squareStep*schema.cols.length, \n valHeight );\n \n var groundZ = new THREE.Mesh( geometry, materialYZ );\n groundZ.rotation.y -= Math.PI/2;\n groundZ.castShadow = false;\n groundZ.receiveShadow = true;\n groundZ.position.x = xDeviation;\n scene.add( groundZ );\n //////////////////\n \n \n //*** Adding texts for the scales\n for( var i=0; i<schema.cols.length; i++ ) {\n sTextCols[i] = new ScaleText(schema.cols[i].name, \n \"col\", \n i, \n schema.cols[i].color);\n sTextCols[i].addText(groundX);\n }\n \n for( var i=0; i<schema.rows.length; i++ ) {\n sTextRows[i] = new ScaleText(schema.rows[i].name, \"row\", i, scaleTextColor);\n sTextRows[i].addText(groundX);\n }\n \n var yStep = valHeight/niceScale.tickNum;\n for ( var i=0; i<=niceScale.tickNum; i++ ) {\n var val = niceScale.niceMin + i*niceScale.tickSpacing;\n var stringVal = val.toString();\n sTextVals[i] = new ScaleText(stringVal, \"val\", i, scaleTextColor, yStep);\n sTextVals[i].addText(groundZ);\n }\n \n \n //*** Adding bars\n for ( var i=0; i<schema.cols.length; i++ ) {\n for (var j=0; j<schema.rows.length; j++ ) {\n bars.push( new BarCube( schema.cols[i].color, j, i, \n dataValues[i][j], valTextColor, 'full', null,\n { row:schema.rows[j].name, \n col:schema.cols[i].name },\n niceScale.niceMin, \n niceScale.range, \n valHeight ) );\n bars[bars.length-1].addBar(scene);\n // Adds the bars objects to ones that need to be checked for intersection\n // This is used for the moseover action\n intersobj[bars.length-1] = bars[bars.length-1].barobj;\n intersobj[bars.length-1].barid = bars.length-1;\n }\n }\n \n //////////////////\n \n \n //*** Adding the lights\n var light = new THREE.DirectionalLight( 0x999999 );\n light.position.set( 1, -1, 1 ).normalize();\n scene.add( light );\n \n var light = new THREE.DirectionalLight( 0x999999 );\n light.position.set( -1, 1, -1 ).normalize();\n scene.add( light );\n \n light = new THREE.SpotLight( 0xd8d8d8, 2 );\n light.position.set( 600, 3000, 1500 );\n light.target.position.set( 0, 0, 0 );\n \n light.shadowCameraNear = 1000;\n light.shadowCameraFar = 5000;\n light.shadowCameraFov = 40;\n light.castShadow = true;\n light.shadowDarkness = 0.3;\n light.shadowBias = 0.0001;\n // light.shadowCameraVisible = true;\n scene.add( light );\n ////////////////////\n \n}", "title": "" }, { "docid": "15301e2a753844df13a875946b17e196", "score": "0.49645734", "text": "function Int_navmesh(ns, exports) {\n\nvar m_geom = Object(__WEBPACK_IMPORTED_MODULE_1__geometry_js__[\"a\" /* default */])(ns);\n\n// TODO: reduce count of tmp variables\nvar _vec3_tmp = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"create\"]();\nvar _vec3_tmp2 = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"create\"]();\n\nvar _vec4_tmp = __WEBPACK_IMPORTED_MODULE_6__libs_gl_matrix_vec4_js__[\"create\"]();\nvar _vec4_tmp2 = __WEBPACK_IMPORTED_MODULE_6__libs_gl_matrix_vec4_js__[\"create\"]();\nvar _vec4_tmp3 = __WEBPACK_IMPORTED_MODULE_6__libs_gl_matrix_vec4_js__[\"create\"]();\n\nvar _mat4_tmp = __WEBPACK_IMPORTED_MODULE_3__libs_gl_matrix_mat4_js__[\"create\"]();\nvar _mat4_tmp2 = __WEBPACK_IMPORTED_MODULE_3__libs_gl_matrix_mat4_js__[\"create\"]();\nvar _mat4_tmp3 = __WEBPACK_IMPORTED_MODULE_3__libs_gl_matrix_mat4_js__[\"create\"]();\n\nvar _accum_left_portal_tmp = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"create\"]();\nvar _accum_right_portal_tmp = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"create\"]();\nvar _accum_left_tmp = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"create\"]();\nvar _accum_right_tmp = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"create\"]();\nvar _apex_normal_tmp = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"create\"]();\n\nfunction merge_vertices(geometry) {\n var vertices_map = {}; // Hashmap for looking up vertex by position\n // coordinates (and making sure they are unique)\n var unique = [];\n var changes = [];\n var v, key;\n var precision_points = 4; // number of decimal points, eg. 4 for epsilon of 0.0001\n var precision = Math.pow(10, precision_points);\n var i, il, face;\n var indices;\n\n for (i = 0, il = geometry.vertices.length; i < il; i++) {\n v = geometry.vertices[i];\n\n key = Math.round(v[0] * precision) + '_' + Math.round(v[1] * precision) +\n '_' + Math.round(v[2] * precision);\n\n if (vertices_map[key] === undefined) {\n vertices_map[key] = i;\n unique.push(v);\n changes[i] = unique.length - 1;\n } else {\n changes[i] = changes[vertices_map[key]];\n }\n }\n\n // If faces are completely degenerate after merging vertices, we\n // have to remove them from the geometry.\n var face_indices_to_remove = [];\n\n for (i = 0, il = geometry.faces.length; i < il; i++) {\n face = geometry.faces[i];\n face.indices[0] = changes[face.indices[0]];\n face.indices[1] = changes[face.indices[1]];\n face.indices[2] = changes[face.indices[2]];\n\n indices = [face.indices[0], face.indices[1], face.indices[2]];\n\n // If any duplicate vertices are found in a Face3\n // we have to remove the face as nothing can be saved\n for (var n = 0; n < 3; n++) {\n if (indices[n] == indices[(n + 1) % 3]) {\n face_indices_to_remove.push(i);\n break;\n }\n }\n }\n\n for (i = face_indices_to_remove.length - 1; i >= 0; i--) {\n var idx = face_indices_to_remove[i];\n geometry.faces.splice(idx, 1);\n }\n\n // Use unique set of vertices\n var diff = geometry.vertices.length - unique.length;\n geometry.vertices.length = 0;\n\n for (i = 0; i < unique.length; i++)\n geometry.vertices.push(unique[i])\n\n return diff;\n\n}\n\nfunction get_edge_key(vertex_ids_1, vertex_ids_2) {\n if (vertex_ids_1 > vertex_ids_2)\n return vertex_ids_2 + \"-\" + vertex_ids_1;\n else\n return vertex_ids_1 + \"-\" + vertex_ids_2;\n}\n\nfunction build_polygons_from_geometry(geometry) {\n var polygons = [];\n var vertices = geometry.vertices;\n // Convert the faces into a custom format that supports more than 3 vertices\n var polygon_id = 0;\n for (var i = 0; i < geometry.faces.length; i++) {\n var face = geometry.faces[i];\n polygons.push({\n id: polygon_id++,\n vertex_ids: face.indices,\n centroid: face.centroid,\n normal: face.normal,\n neighbours: []\n });\n }\n var navigation_mesh = {\n polygons: polygons,\n vertices: vertices\n };\n\n // Build a list of adjacent polygons\n var dict_edge_polygon = {};\n for (var i = 0; i < polygons.length; i++) {\n for (var j = 0; j < 3; j++) {\n var edge_key = get_edge_key(polygons[i].vertex_ids[j],\n polygons[i].vertex_ids[(j + 1) % 3]);\n\n if (!(edge_key in dict_edge_polygon))\n dict_edge_polygon[edge_key] = [];\n dict_edge_polygon[edge_key].push(polygons[i]);\n }\n }\n\n var keys = Object.keys(dict_edge_polygon);\n for (var i = 0, l = keys.length; i < l; i++) {\n var edge_key = keys[i];\n for (var j = 0; j < dict_edge_polygon[edge_key].length; j++)\n for (var k = j + 1; k < dict_edge_polygon[edge_key].length; k++) {\n dict_edge_polygon[edge_key][j].neighbours.push(\n dict_edge_polygon[edge_key][k]);\n dict_edge_polygon[edge_key][k].neighbours.push(\n dict_edge_polygon[edge_key][j]);\n }\n }\n\n return navigation_mesh;\n}\n\nfunction compute_centroids(geometry) {\n var f, face;\n for (f = 0; f < geometry.faces.length; f++) {\n\n face = geometry.faces[f];\n __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"add\"](geometry.vertices[face.indices[0]], geometry.vertices[face.indices[1]], _vec3_tmp);\n __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"add\"](_vec3_tmp, geometry.vertices[face.indices[2]], _vec3_tmp);\n\n __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"scale\"](_vec3_tmp, 1/3, face.centroid);\n }\n}\n\nfunction compute_normals(geometry) {\n for (var i = 0; i < geometry.faces.length; i++) {\n\n var face = geometry.faces[i];\n\n var v1 = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"subtract\"](geometry.vertices[face.indices[1]],\n geometry.vertices[face.indices[0]], _vec3_tmp);\n var v2 = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"subtract\"](geometry.vertices[face.indices[2]],\n geometry.vertices[face.indices[0]], _vec3_tmp2);\n var normal = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"cross\"](v1, v2, _vec3_tmp);\n __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"normalize\"](normal, normal);\n __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"copy\"](normal, face.normal);\n }\n}\n\nfunction build_navigation_mesh(geometry) {\n compute_centroids(geometry);\n compute_normals(geometry);\n merge_vertices(geometry);\n var navmesh = build_polygons_from_geometry(geometry);\n return navmesh\n}\n\nfunction round_number(number, decimals) {\n return parseFloat(number.toFixed(decimals));\n}\n\nfunction build_islands(navmesh) {\n var polygons = navmesh.polygons;\n var islands = [];\n var island_count = 0;\n var spread_island_id = function (polygon) {\n var neighbours = polygon.neighbours;\n for (var i = 0; i < neighbours.length; i++) {\n var neighbour = neighbours[i];\n if (neighbour.island == undefined) {\n neighbour.island = polygon.island;\n spread_island_id(neighbour);\n }\n }\n };\n for (var i = 0; i < polygons.length; i++) {\n var polygon = polygons[i];\n if (polygon.island == undefined) {\n polygon.island = island_count++;\n spread_island_id(polygon)\n }\n if (!islands[polygon.island])\n islands[polygon.island] = [];\n\n islands[polygon.island].push(polygons[i]);\n }\n\n return islands;\n}\n\nfunction indexOf(l, v) {\n if (l.indexOf)\n return l.indexOf(v);\n else\n for (var i = 0; i < l.length; i++) {\n if (l[i] == v)\n return i;\n }\n return -1;\n}\n\nvar get_shared_vertices_in_order = function (a, b) {\n function shift_l(uintvec) {\n var a = uintvec[0];\n uintvec[0] = uintvec[1];\n uintvec[1] = uintvec[2];\n uintvec[2] = a;\n }\n var a_list = a.vertex_ids;\n var b_list = b.vertex_ids;\n var shared_vertices = [];\n for (var i = 0; i < a_list.length; i++) {\n if (indexOf(b_list, a_list[i]) >= 0) {\n shared_vertices.push(a_list[i])\n }\n }\n if (shared_vertices.length < 2)\n return [];\n if (indexOf(shared_vertices, a_list[0]) >= 0 &&\n indexOf(shared_vertices, a_list[a_list.length - 1]) >= 0) {\n // Vertices on both edges are bad, so shift them once to the left\n shift_l(a_list);\n }\n if (indexOf(shared_vertices, b_list[0]) >= 0 &&\n indexOf(shared_vertices, b_list[b_list.length - 1]) >= 0) {\n // Vertices on both edges are bad, so shift them once to the left\n shift_l(b_list);\n }\n // Again!\n shared_vertices = [];\n for (var i = 0; i < a_list.length; i++) {\n if (indexOf(b_list, a_list[i]) >= 0)\n shared_vertices.push(a_list[i]);\n }\n return shared_vertices;\n};\n\nfunction group_navmesh(navmesh) {\n\n var ret = {};\n var vert = navmesh.vertices;\n for (var i = 0; i < vert.length; i++) {\n vert[i][0] = round_number(vert[i][0], 2);\n vert[i][1] = round_number(vert[i][1], 2);\n vert[i][2] = round_number(vert[i][2], 2);\n }\n\n ret.vertices = navmesh.vertices;\n var islands = build_islands(navmesh);\n ret.islands = [];\n\n var find_polygon_index = function (island, p) {\n for (var i = 0; i < island.length; i++) {\n if (p === island[i]) return i;\n }\n };\n\n for (var i = 0; i < islands.length; i++) {\n var new_island = [];\n var island = islands[i]\n for (var j = 0; j < island.length; j++) {\n var neighbours = [];\n var poly = island[j];\n for (var k = 0; k < poly.neighbours.length; k++) {\n neighbours.push(find_polygon_index(island, poly.neighbours[k]));\n }\n // Build a portal list to each neighbour\n var portals = [];\n for (var k = 0; k < poly.neighbours.length; k++) {\n portals.push(get_shared_vertices_in_order(poly, poly.neighbours[k]));\n }\n\n poly.centroid[0] = round_number(poly.centroid[0], 2);\n poly.centroid[1] = round_number(poly.centroid[1], 2);\n poly.centroid[2] = round_number(poly.centroid[2], 2);\n\n new_island.push({\n id: find_polygon_index(island, poly),\n neighbours: neighbours,\n vertex_ids: poly.vertex_ids,\n centroid: poly.centroid,\n normal: poly.normal,\n portals: portals,\n // astar\n f: 0,\n g: 0,\n h: 0,\n cost: 1.0,\n visited: false,\n closed: false,\n parent: null\n // end astar\n });\n\n }\n ret.islands.push(new_island);\n }\n return ret;\n}\n\nexports.navmesh_build_from_bufs_data = function(bufs_data) {\n var vertices = m_geom.get_vbo_source_by_type(bufs_data.vbo_source_data, m_geom.VBO_FLOAT);\n var indices = bufs_data.ibo_array;\n var faces = [];\n for (var i = 0; i < indices.length; i += 3) {\n faces.push({\n indices: new Uint32Array([indices[i], indices[i + 1], indices[i + 2]]),\n centroid: new Float32Array(3),\n normal: new Float32Array(3)\n })\n }\n var vert = [];\n for (var i = 0; i < vertices.length; i += 3) {\n var v = new Float32Array(3);\n v[0] = vertices[i];\n v[1] = vertices[i + 1];\n v[2] = vertices[i + 2];\n vert.push(v);\n }\n var geometry = {\n vertices: vert,\n faces: faces\n };\n return group_navmesh(build_navigation_mesh(geometry))\n};\n\nexports.navmesh_get_island = function(navmesh, position, distance_to_closest) {\n var closest_node_group = null;\n var distance = Number.MAX_VALUE;\n var islands = navmesh.islands;\n for (var i = 0; i < islands.length; i++) {\n for (var j = 0; j < islands[i].length; j++) {\n var node = islands[i][j];\n\n __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"subtract\"](node.centroid, position, _vec3_tmp);\n var measured_distance = distance_to_closest(position, node.centroid,\n node.vertex_ids, navmesh.vertices, distance);\n\n if (measured_distance < distance) {\n closest_node_group = i;\n distance = measured_distance;\n }\n }\n }\n\n return closest_node_group;\n};\n\n/**\n * A* search algorithm\n * https://github.com/bgrins/javascript-astar/\n */\nfunction astar_search(graph, start_node, end_node, start_pos, target_pos, vertices) {\n function init(graph) {\n for (var x = 0; x < graph.length; x++) {\n var node = graph[x];\n node.f = 0;\n node.g = 0;\n node.h = 0;\n node.cost = 1.0;\n node.visited = false;\n node.closed = false;\n node.parent = null;\n }\n }\n\n function heuristic(pos1, pos2) {\n __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"subtract\"](pos1, pos2, _vec3_tmp)\n return __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"dot\"](_vec3_tmp, _vec3_tmp);\n }\n\n function get_neighbours(graph, node) {\n var ret = [];\n for (var e = 0; e < node.neighbours.length; e++) {\n ret.push(graph[node.neighbours[e]]);\n }\n return ret;\n }\n\n init(graph);\n var open_heap = __WEBPACK_IMPORTED_MODULE_2__math_js__[\"a\" /* binary_heap_new */](function (node) {\n return node.f;\n });\n __WEBPACK_IMPORTED_MODULE_2__math_js__[\"c\" /* binary_heap_push */](open_heap, start_node);\n\n while (open_heap.content.length > 0) {\n // Grab the lowest f(x) to process next. Heap keeps this sorted for us.\n var current_node = __WEBPACK_IMPORTED_MODULE_2__math_js__[\"b\" /* binary_heap_pop */](open_heap);\n // End case -- result has been found, return the traced path.\n if (current_node === end_node) {\n var curr = current_node;\n var ret = [];\n while (curr.parent) {\n ret.push(curr);\n curr = curr.parent;\n }\n // push first step of path\n ret.push(start_node)\n\n return ret.reverse();\n }\n\n // Normal case -- move current_node from open to closed, process each\n // of its neighbours.\n current_node.closed = true;\n\n // Find all neighbours for the current node. Optionally find diagonal\n // neighbours as well (false by default).\n var neighbours = get_neighbours(graph, current_node);\n\n for (var i = 0, il = neighbours.length; i < il; i++) {\n var neighbour = neighbours[i];\n\n if (neighbour.closed) {\n // Not a valid node to process, skip to next neighbour.\n continue;\n }\n\n // The g score is the shortest distance from start to current node.\n // We need to check if the path we have arrived at this neighbour\n // is the shortest one we have seen yet.\n var g_score = current_node.g + __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"dist\"](neighbour.centroid,\n current_node.centroid);\n var been_visited = neighbour.visited;\n\n if (!been_visited || g_score < neighbour.g) {\n\n // Found an optimal (so far) path to this node.\n // Take score for node to see how good it is.\n neighbour.visited = true;\n neighbour.parent = current_node;\n\n neighbour.h = neighbour.h || (heuristic(neighbour.centroid, target_pos) + heuristic(neighbour.centroid, start_pos));\n neighbour.g = g_score;\n neighbour.f = neighbour.g + neighbour.h;\n if (!been_visited) {\n // Pushing to heap will put it in proper place based on the 'f' value.\n __WEBPACK_IMPORTED_MODULE_2__math_js__[\"c\" /* binary_heap_push */](open_heap, neighbour);\n } else {\n // Already seen the node, but since it has been rescored we\n // need to reorder it in the heap\n __WEBPACK_IMPORTED_MODULE_2__math_js__[\"d\" /* binary_heap_rescore_element */](open_heap, neighbour);\n }\n }\n }\n }\n // No result was found - empty array signifies failure to find path.\n return [];\n}\n\nfunction push_vec3(array, vec3) {\n array.push(vec3[0]);\n array.push(vec3[1]);\n array.push(vec3[2]);\n}\n\nfunction get_rotation_sign(origin, p1, p2, normal) {\n var dir_o_p1 = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"subtract\"](p1, origin, _vec3_tmp);\n var dir_o_p2 = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"subtract\"](p2, origin, _vec3_tmp2);\n var cross = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"cross\"](dir_o_p1, dir_o_p2, _vec3_tmp);\n return __WEBPACK_IMPORTED_MODULE_4__util_js__[\"_50\" /* sign */](__WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"dot\"](normal, cross));\n}\n\nfunction vequal(a, b) {\n __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"subtract\"](a, b, _vec3_tmp);\n return __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"dot\"](_vec3_tmp, _vec3_tmp) < 0.00001;\n}\n\n// uses _vec3_tmp, _vec3_tmp2, _mat4_tmp3\nfunction update_accum_mat(accum_mat, curr_portal, prev_portal) {\n var curr_portal_dir = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"subtract\"](curr_portal.right,\n curr_portal.left, _vec3_tmp);\n var prev_normal = prev_portal.normal;\n var curr_normal = curr_portal.normal;\n\n var angle = Math.acos(__WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"dot\"](prev_normal, curr_normal));\n var is_right = __WEBPACK_IMPORTED_MODULE_4__util_js__[\"_50\" /* sign */](__WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"dot\"](curr_portal_dir,\n __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"cross\"](prev_normal, curr_normal, _vec3_tmp2)));\n angle *= -is_right;\n\n var mat = __WEBPACK_IMPORTED_MODULE_3__libs_gl_matrix_mat4_js__[\"identity\"](_mat4_tmp3);\n __WEBPACK_IMPORTED_MODULE_3__libs_gl_matrix_mat4_js__[\"translate\"](mat, curr_portal.left, mat);\n __WEBPACK_IMPORTED_MODULE_3__libs_gl_matrix_mat4_js__[\"rotate\"](mat, angle, curr_portal_dir, mat)\n __WEBPACK_IMPORTED_MODULE_3__libs_gl_matrix_mat4_js__[\"translate\"](mat, __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"scale\"](curr_portal.left, -1, _vec3_tmp2), mat);\n __WEBPACK_IMPORTED_MODULE_3__libs_gl_matrix_mat4_js__[\"multiply\"](accum_mat, mat, accum_mat)\n return accum_mat;\n}\n\n// uses _vec3_tmp, _vec4_tmp, _vec4_tmp2, _vec4_tmp3\nfunction get_point_on_navmesh(accum_begin_apex, accum_end_apex,\n begin_portal, end_portal,\n first_poly_normal, interapex_accum_mat, dest) {\n\n // four-dimensional point vector (w === 1)\n var accum_begin_portal = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"transformMat4\"](begin_portal,\n interapex_accum_mat, _vec4_tmp);\n accum_begin_portal[3] = 1;\n var accum_end_portal = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"transformMat4\"](end_portal,\n interapex_accum_mat, _vec3_tmp);\n\n // four-dimensional direction vector (w === 0)\n var accum_portal_dir = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"subtract\"](accum_end_portal,\n accum_begin_portal, _vec4_tmp2);\n var accum_apex_dir = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"subtract\"](accum_end_apex, accum_begin_apex,\n _vec3_tmp);\n\n var normal = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"cross\"](first_poly_normal, accum_apex_dir, _vec4_tmp3);\n\n if (Math.abs(__WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"dot\"](normal, accum_portal_dir)) < 0.01) {\n var t = 1/2;\n } else {\n // four-dimensional plane representation\n __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"normalize\"](normal, normal);\n normal[3] = - __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"dot\"](normal, accum_end_apex);\n var t = - __WEBPACK_IMPORTED_MODULE_6__libs_gl_matrix_vec4_js__[\"dot\"](normal, accum_begin_portal) /\n __WEBPACK_IMPORTED_MODULE_6__libs_gl_matrix_vec4_js__[\"dot\"](normal, accum_portal_dir);\n }\n\n var portal_dir = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"subtract\"](end_portal, begin_portal, _vec3_tmp);\n return __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"scaleAndAdd\"](begin_portal, portal_dir, t, dest);\n}\n\n// uses _mat4_tmp\n// dep: uses _vec3_tmp, _vec3_tmp2, _vec4_tmp, _vec4_tmp2, _vec4_tmp3, _mat4_tmp3\nfunction update_crucial_on_navmesh(portals, accum_new_apex, new_apex_index,\n old_portal_apex, old_apex_index, apex_normal, pts_dest, return_normals,\n normals_dest) {\n var interapex_accum_mat = __WEBPACK_IMPORTED_MODULE_3__libs_gl_matrix_mat4_js__[\"identity\"](_mat4_tmp);\n for (var j = old_apex_index; j < new_apex_index; j++) {\n if (portals[j].is_crucial) {\n if (j > old_apex_index || !j) {\n // use m_vec3.create(), bcz it is a new point.\n var navmesh_point = get_point_on_navmesh(\n accum_new_apex, old_portal_apex,\n portals[j].left, portals[j].right,\n apex_normal, interapex_accum_mat,\n __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"create\"]());\n push_vec3(pts_dest, navmesh_point);\n if (return_normals)\n push_vec3(normals_dest, portals[j].normal);\n\n if (j)\n update_accum_mat(interapex_accum_mat, portals[j], portals[j-1]);\n }\n }\n }\n}\n\n/**\n * Pulling the string\n * https://skatgame.net/mburo/ps/thesis_demyen_2006.pdf\n */\nfunction string_pull(portals, return_normals) {\n var pts = [];\n var normals = [];\n // Init scan state\n var portal_apex, portal_left, portal_right;\n var accum_portal_left, accum_portal_right, apex_normal;\n var apex_index = 0;\n var left_index = 0;\n var right_index = 0;\n portal_apex = portals[0].right;\n portal_left = portals[0].left;\n portal_right = portals[0].right;\n accum_portal_left = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"copy\"](portal_left, _accum_left_portal_tmp);\n accum_portal_right = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"copy\"](portal_right, _accum_right_portal_tmp);\n apex_normal = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"copy\"](portals[0].normal, _apex_normal_tmp);\n\n // Add start point.\n push_vec3(pts, portal_apex);\n if (return_normals)\n push_vec3(normals, portals[0].normal);\n\n var accum_mat = __WEBPACK_IMPORTED_MODULE_3__libs_gl_matrix_mat4_js__[\"identity\"](_mat4_tmp2);\n\n function update_apex(point, index) {\n apex_index = index;\n left_index = apex_index;\n right_index = apex_index;\n\n portal_apex = point;\n portal_left = portal_apex;\n portal_right = portal_apex;\n __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"copy\"](point, accum_portal_left);\n __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"copy\"](point, accum_portal_right);\n __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"copy\"](portals[apex_index].normal, apex_normal);\n }\n\n for (var i = 1; i < portals.length; i++) {\n var left = portals[i].left;\n var right = portals[i].right;\n var accum_left = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"transformMat4\"](left, accum_mat, _accum_left_tmp);\n var accum_right = __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"transformMat4\"](right, accum_mat, _accum_right_tmp);\n if (portals[i].is_crucial)\n update_accum_mat(accum_mat, portals[i], portals[i-1]);\n\n // Update right vertex.\n if (get_rotation_sign(portal_apex, accum_portal_right, accum_right,\n apex_normal) <= 0.0) {\n var eq = vequal(portal_apex, portal_right);\n if (eq || get_rotation_sign(portal_apex, accum_portal_left,\n accum_right, apex_normal) > 0.0) {\n // Tighten the funnel.\n portal_right = right;\n __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"copy\"](accum_right, accum_portal_right);\n right_index = i;\n } else {\n var left_is_apex = vequal(accum_portal_left, portal_apex);\n if (!left_is_apex)\n update_crucial_on_navmesh(portals, accum_portal_left,\n left_index, portal_apex, apex_index, apex_normal, pts,\n return_normals, normals);\n accum_mat = __WEBPACK_IMPORTED_MODULE_3__libs_gl_matrix_mat4_js__[\"identity\"](accum_mat);\n\n // Make current left the new apex.\n // Right over left, insert left to path and\n // restart scan from portal left point.\n update_apex(portal_left, left_index);\n\n // Restart scan\n i = apex_index;\n\n if (!left_is_apex) {\n push_vec3(pts, portal_apex);\n if (return_normals)\n push_vec3(normals, portals[i].normal);\n }\n\n continue;\n }\n }\n\n // Update left vertex.\n if (get_rotation_sign(portal_apex, accum_portal_left, accum_left,\n apex_normal) >= 0.0) {\n var eq = vequal(portal_apex, portal_left);\n if (eq || get_rotation_sign(portal_apex, accum_portal_right,\n accum_left, apex_normal) < 0.0) {\n // Tighten the funnel.\n portal_left = left;\n __WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"copy\"](accum_left, accum_portal_left);\n left_index = i;\n } else {\n var right_is_apex = vequal(accum_portal_right, portal_apex);\n if (!right_is_apex)\n update_crucial_on_navmesh(portals, accum_portal_right,\n right_index, portal_apex, apex_index, apex_normal, pts,\n return_normals, normals);\n accum_mat = __WEBPACK_IMPORTED_MODULE_3__libs_gl_matrix_mat4_js__[\"identity\"](accum_mat);\n\n // Make current right the new apex.\n // Left over right, insert right to path and\n // restart scan from portal right point.\n update_apex(portal_right, right_index);\n\n // Restart scan\n i = apex_index;\n if (!right_is_apex) {\n push_vec3(pts, portal_apex);\n if (return_normals)\n push_vec3(normals, portals[i].normal);\n }\n\n continue;\n }\n }\n }\n\n var last_index = portals.length - 1;\n var last_portal_left = portals[last_index].left;\n var is_last_apex = vequal(portal_apex, last_portal_left);\n if (!is_last_apex) {\n update_crucial_on_navmesh(portals, accum_portal_left, last_index,\n portal_apex, apex_index, apex_normal, pts, return_normals,\n normals);\n }\n\n if (!is_last_apex || !apex_index) {\n // Append last point to path.\n push_vec3(pts, last_portal_left);\n }\n\n if (return_normals) {\n push_vec3(normals, portals[last_index].normal);\n return {\n \"positions\": new Float32Array(pts),\n \"normals\": new Float32Array(normals)\n }\n } else\n return {\n \"positions\": new Float32Array(pts),\n \"normals\": null\n }\n}\n\nfunction is_point_in_poly(poly, pt) {\n for (var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i)\n ((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) ||\n (poly[j][1] <= pt[1] && pt[1] < poly[i][1])) &&\n (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) /\n (poly[j][1] - poly[i][1]) + poly[i][0]) && (c = !c);\n return c;\n}\n\nexports.is_vector_in_poly = is_vector_in_poly;\nfunction is_vector_in_poly(vector, vertex_ids, vertices) {\n var polygon_vertices = [];\n for (var i = 0; i < vertex_ids.length; i++) {\n var id = vertex_ids[i];\n polygon_vertices.push(vertices[id]);\n }\n if (is_point_in_poly(polygon_vertices, vector))\n return true;\n return false;\n}\n\nfunction get_navmesh_closest_node(all_nodes, vertices, position,\n allowed_distance, distance_function) {\n\n var closest_node = null;\n var distance = Number.MAX_VALUE;\n\n for (var i = 0; i < all_nodes.length; i++) {\n var node = all_nodes[i];\n\n var measured_distance = distance_function(position, node.centroid,\n\n node.vertex_ids, vertices, distance);\n\n if (measured_distance < distance) {\n closest_node = node;\n distance = measured_distance;\n }\n }\n\n if (allowed_distance > 0 && distance > allowed_distance)\n return null;\n else\n return closest_node;\n}\n\nfunction get_portal_from_to(a, b) {\n for (var i = 0; i < a.neighbours.length; i++) {\n if (a.neighbours[i] === b.id) {\n return a.portals[i];\n }\n }\n};\n\nfunction channel_push(portals, p1, p2, is_crucial, normal) {\n portals.push({\n left: p1,\n right: p2,\n is_crucial: is_crucial,\n normal: normal\n });\n}\n\nfunction get_pulled_string(path, start_pos, target_pos, vertices, return_normals) {\n var channel_portals = [];\n\n channel_push(channel_portals, start_pos, start_pos, false,\n path[0] && path[0].normal || __WEBPACK_IMPORTED_MODULE_4__util_js__[\"f\" /* AXIS_Z */]);\n\n for (var i = 0; i < path.length; i++) {\n var polygon = path[i];\n var next_polygon = path[i + 1];\n if (next_polygon) {\n // TODO: remove magic constant\n var is_crucial = Math.abs(__WEBPACK_IMPORTED_MODULE_5__libs_gl_matrix_vec3_js__[\"dot\"](polygon.normal,\n next_polygon.normal)) < 0.999;\n\n var portals = get_portal_from_to(polygon, next_polygon);\n channel_push(channel_portals,\n vertices[portals[0]],\n vertices[portals[1]],\n is_crucial,\n next_polygon.normal\n );\n }\n }\n\n channel_push(channel_portals, target_pos, target_pos, false,\n channel_portals[channel_portals.length - 1].normal);\n\n return string_pull(channel_portals, return_normals);\n}\n\nexports.navmesh_find_path = function(navmesh, start_pos, target_pos, options) {\n var path = find_path(navmesh, start_pos, target_pos, options);\n if (!path || !path.length)\n return null;\n\n // We got the corridor\n // Now pull the rope\n if (options.do_not_pull_string) {\n return get_centroid_string(path, options.return_normals);\n } else {\n var vertices = navmesh.vertices;\n return get_pulled_string(path, start_pos, target_pos, vertices,\n options.return_normals);\n }\n}\n\nfunction get_centroid_string(path, return_normals) {\n if (return_normals) {\n var string = new Float32Array(3 * path.length);\n for (var i = 0; i < path.length; i++)\n string.set(path[i].centroid, 3 * i);\n return {\n \"positions\": string,\n \"normals\": null\n };\n } else {\n var positions = new Float32Array(3 * path.length);\n var normals = new Float32Array(3 * path.length);\n for (var i = 0; i < path.length; i++) {\n positions.set(path[i].centroid, 3 * i);\n normals.set(path[i].normal, 3 * i)\n }\n return {\n \"positions\": positions,\n \"normals\": normals\n };\n }\n}\n\nfunction find_path(navmesh, start_pos, target_pos, options) {\n var island = options.island;\n var all_nodes = navmesh.islands[island];\n var vertices = navmesh.vertices;\n var start_node = get_navmesh_closest_node(all_nodes, vertices, start_pos,\n options.allowed_distance, options.distance_to_closest);\n\n if (!start_node)\n return null;\n\n var target_node = get_navmesh_closest_node(all_nodes, vertices, target_pos,\n options.allowed_distance, options.distance_to_farthest);\n\n if (!target_node)\n return null;\n\n return astar_search(all_nodes, start_node, target_node, start_pos,\n target_pos, vertices);\n}\n\n}", "title": "" }, { "docid": "3320fa94fe9726f6346ecbe56207cabf", "score": "0.4960889", "text": "function createBody(baseWidth, topWidth, mainHeight, topHeight) {\n var geom = new THREE.Geometry();\n\n // add the front vertices\n geom.vertices.push(new THREE.Vector3(0, 0, 0));\n geom.vertices.push(new THREE.Vector3(baseWidth, 0, 0));\n geom.vertices.push(new THREE.Vector3(baseWidth*0.5+topWidth*0.5, mainHeight, -(baseWidth*0.5-topWidth*0.5)));\n geom.vertices.push(new THREE.Vector3(baseWidth*0.5-topWidth*0.5, mainHeight, -(baseWidth*0.5-topWidth*0.5)));\n\n //add the back vertices\n geom.vertices.push(new THREE.Vector3(0, 0, -baseWidth));\n geom.vertices.push(new THREE.Vector3(baseWidth, 0, -baseWidth));\n geom.vertices.push(new THREE.Vector3(baseWidth*0.5+topWidth*0.5, mainHeight, -(baseWidth*0.5+topWidth*0.5)));\n geom.vertices.push(new THREE.Vector3(baseWidth*0.5-topWidth*0.5, mainHeight, -(baseWidth*0.5+topWidth*0.5)));\n\n //add the tip vertex\n geom.vertices.push(new THREE.Vector3(0.5*baseWidth, mainHeight+topHeight, -0.5*baseWidth));\n\n //All of the faces\n geom.faces.push(new THREE.Face3(0, 1, 2));//front\n geom.faces.push(new THREE.Face3(2, 3, 0));\n\n geom.faces.push(new THREE.Face3(4, 6, 5));//back\n geom.faces.push(new THREE.Face3(4, 7, 6));\n\n geom.faces.push(new THREE.Face3(1, 5, 6));//side right\n geom.faces.push(new THREE.Face3(1, 6, 2));\n\n geom.faces.push(new THREE.Face3(0, 3, 7));//side left\n geom.faces.push(new THREE.Face3(7, 4, 0));\n\n geom.faces.push(new THREE.Face3(7, 2, 6));//top face\n geom.faces.push(new THREE.Face3(7, 3, 2));\n\n //top pyramid faces\n geom.faces.push(new THREE.Face3(2, 6, 8));\n geom.faces.push(new THREE.Face3(3, 2, 8));\n geom.faces.push(new THREE.Face3(3, 8, 7));\n geom.faces.push(new THREE.Face3(7, 8, 6));\n\n\n // calculate the normals for shading\n geom.computeFaceNormals();\n geom.computeVertexNormals(true);\n\n return geom;\n}", "title": "" }, { "docid": "84594e0d30274dcae2f0a78ce62753a9", "score": "0.49584392", "text": "function zonotopeGeometry3(zonotopeFacetList) {\n var f, v;\n\n var geometry = new THREE.Geometry();\n var vertexMap = {};\n var vertexList = [];\n var currentVertexIndex = 0;\n\n var facetIndex, facetVertexIndex;\n for ( facetIndex = 0; facetIndex < zonotopeFacetList.length; ++facetIndex ) {\n f = zonotopeFacetList[facetIndex];\n for ( facetVertexIndex = 0; facetVertexIndex < f.vertices.length; ++facetVertexIndex ) {\n v = f.vertices[facetVertexIndex];\n v.vertexListIndex = currentVertexIndex;\n geometry.vertices.push( new THREE.Vector3(v.x, v.y, v.z) );\n if ( facetVertexIndex >= 2 ) {\n // add a new triangle\n geometry.faces.push( new THREE.Face3(f.vertices[0].vertexListIndex, // reference point\n f.vertices[facetVertexIndex-1].vertexListIndex, // neighbor\n f.vertices[facetVertexIndex].vertexListIndex,\n new THREE.Vector3(f.normal.x, f.normal.y, f.normal.z)));\n }\n ++currentVertexIndex;\n }\n }\n geometry.mergeVertices();\n return geometry;\n}", "title": "" }, { "docid": "69412449b807ce5e21f4af793405d029", "score": "0.49575323", "text": "function main() {\n const canvas = document.querySelector('#c');\n canvas.width = width;\n canvas.height = height;\n\n const renderer = new THREE.WebGLRenderer({\n canvas,\n alpha: true,\n // premultipliedAlpha: true,\n });\n\n const fov = 60;\n // const aspect = 2; // the canvas default\n const aspect = canvas.clientWidth / canvas.clientHeight\n const near = 0.1;\n const far = 10;\n const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);\n camera.position.set(0, 0, 1);\n camera.lookAt(0, 0, -1);\n\n const controls = new OrbitControls(camera, canvas);\n controls.target.set(0, 0, -1);\n controls.update();\n\n const scene = new THREE.Scene();\n const scene2 = new THREE.Scene();\n\n const geometry = new THREE.WireframeGeometry(new THREE.BoxGeometry(1, 1, 1))\n const referenceCube = new THREE.LineSegments(geometry, new THREE.LineBasicMaterial({ color: 0x00ff00 }));\n referenceCube.position.set(-0.5, 0, -1);\n\n const mesh = new THREE.LineSegments(geometry, new THREE.LineBasicMaterial({ color: 0xff0000 }));\n mesh.position.set(0.5, 0, -2);\n\n scene.add(referenceCube); \n // TODO only one scene will be needed probably, and this should be renamed\n scene2.add(mesh);\n \n // TODO remove me\n const L = 0.5\n const DZ = -2\n const X = [\n [-L, -L, -L + DZ, 1],\n [L, -L, -L + DZ, 1],\n [L, L, -L + DZ, 1],\n [-L, L, L + DZ, 1],\n [L, -L, L + DZ, 1],\n [L, L, L + DZ, 1],\n ]\n \n const x = X.map(X => new THREE.Vector4(...X)\n .applyMatrix4(camera.projectionMatrix))\n .map(x => [x.x / x.z, x.y / x.z, 1])\n\n const P = DLT(X, x);\n\n function resizeRendererToDisplaySize(renderer) {\n const canvas = renderer.domElement;\n const width = canvas.clientWidth;\n const height = canvas.clientHeight;\n const needResize = canvas.width !== width || canvas.height !== height;\n if (needResize) {\n renderer.setSize(width, height, false);\n }\n return needResize;\n }\n\n function render() {\n if (resizeRendererToDisplaySize(renderer)) {\n const canvas = renderer.domElement;\n camera.aspect = canvas.clientWidth / canvas.clientHeight;\n }\n\n camera.updateProjectionMatrix();\n renderer.render(scene, camera);\n\n // replace camera's projection matrix with the one calculated by DLT\n camera.projectionMatrix.set(\n ...P.map(x => x * (camera.projectionMatrix.elements[5] / P[5])), // match scaling\n 0, 0, -1, 0\n );\n\n // render scene2 with the projection matrix calculated by DLT\n renderer.autoClear = false;\n renderer.render(scene2, camera);\n\n // setTimeout(render, 33)\n requestAnimationFrame(render);\n\n }\n\n // requestAnimationFrame(render);\n}", "title": "" }, { "docid": "48773bdc678f6f79268194b356748504", "score": "0.49573767", "text": "getFaceNormal() {\r\n for (var i = 0; i < this.div; i++) {\r\n for (var j = 0; j < this.div; j++) {\r\n\r\n var idx = i * this.div + j;\r\n var v0 = vec3.fromValues(this.vBuffer[this.fBuffer[idx*6]*3],this.vBuffer[this.fBuffer[idx*6]*3+1],this.vBuffer[this.fBuffer[idx*6]*3+2]);\r\n var v1 = vec3.fromValues(this.vBuffer[this.fBuffer[idx*6+1]*3],this.vBuffer[this.fBuffer[idx*6+1]*3+1],this.vBuffer[this.fBuffer[idx*6+1]*3+2]);\r\n var v2 = vec3.fromValues(this.vBuffer[this.fBuffer[idx*6+2]*3],this.vBuffer[this.fBuffer[idx*6+2]*3+1],this.vBuffer[this.fBuffer[idx*6+2]*3+2]);\r\n var v3 = vec3.fromValues(this.vBuffer[this.fBuffer[idx*6+4]*3],this.vBuffer[this.fBuffer[idx*6+4]*3+1],this.vBuffer[this.fBuffer[idx*6+4]*3+2]);\r\n \r\n var n1 = vec3.create();\r\n var n2 = vec3.create();\r\n         var v0v1 = vec3.create();\r\n         vec3.sub(v0v1, v1, v0);\r\n  \r\n         var v0v2 = vec3.create();\r\n         vec3.sub(v0v2, v2, v0);\r\n\r\n var v0v3 = vec3.create();\r\n         vec3.sub(v0v3, v3, v0);\r\n  \r\n         vec3.cross(n1, v0v2, v0v1);\r\n vec3.cross(n2, v0v3, v0v2);\r\n\r\n vec3.normalize(n1,n1);\r\n vec3.normalize(n2,n2);\r\n\r\n //console.log(n1,n2,v0,v1,v2,v3);\r\n\r\n\r\n this.faceNormals.push(n1[0]);\r\n this.faceNormals.push(n1[1]);\r\n this.faceNormals.push(n1[2]);\r\n this.faceNormals.push(n2[0]);\r\n this.faceNormals.push(n2[1]);\r\n this.faceNormals.push(n2[2]);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "310e7559507b93ec238b9b8c7ae57f92", "score": "0.4951456", "text": "function createLevel2Floors(){\r\n floor1 = new Physijs.BoxMesh(new THREE.BoxGeometry(2, 1, 2), Physijs\r\n .createMaterial(new THREE.MeshBasicMaterial({\r\n color : 0xee2233,\r\n visible : false,\r\n opacity : 1\r\n }), 1, 0.2), 0);\r\n\r\n floor1.position.set(7.8, -0.5, -3.8);\r\n floor1.scale.set(12.5, 1, 20.2);\r\n scene.add(floor1);\r\n\r\n floor2 = new Physijs.BoxMesh(new THREE.BoxGeometry(2, 1, 2), Physijs\r\n .createMaterial(new THREE.MeshBasicMaterial({\r\n color : 0xee2233,\r\n visible : false,\r\n opacity : 1\r\n }), 1, 0.2), 0);\r\n\r\n floor2.position.set(-14.8, -0.5, -3.8);\r\n floor2.scale.set(5.6, 1, 20.2);\r\n scene.add(floor2);\r\n floor3 = new Physijs.BoxMesh(new THREE.BoxGeometry(2, 1, 2), Physijs\r\n .createMaterial(new THREE.MeshBasicMaterial({\r\n color : 0xee2233,\r\n visible : false,\r\n opacity : 1\r\n }), 1, 0.2), 0);\r\n\r\n floor3.position.set(-7, -0.5, -1);\r\n floor3.scale.set(2.5, 1, 18.2);\r\n scene.add(floor3);\r\n floor4 = new Physijs.BoxMesh(new THREE.BoxGeometry(2, 1, 2), Physijs\r\n .createMaterial(new THREE.MeshBasicMaterial({\r\n color : 0xee2233,\r\n visible : false,\r\n opacity : 1\r\n }), 1, 0.2), 0);\r\n\r\n floor4.position.set(27.2, -0.5, -3.8);\r\n floor4.scale.set(2.2, 1,20.2 );\r\n scene.add(floor4);\r\n\r\n floor5 = new Physijs.BoxMesh(new THREE.BoxGeometry(2, 1, 2), Physijs\r\n .createMaterial(new THREE.MeshBasicMaterial({\r\n color : 0xee2233,\r\n visible : false,\r\n opacity : 1\r\n }), 1, 0.2), 0);\r\n\r\n floor5.position.set(36.2, -0.5, 8.2);\r\n floor5.scale.set(2.2, 1, 10.2);\r\n scene.add(floor5);\r\n floor6 = new Physijs.BoxMesh(new THREE.BoxGeometry(2, 1, 2), Physijs\r\n .createMaterial(new THREE.MeshBasicMaterial({\r\n color : 0xee2233,\r\n visible : false,\r\n opacity : 1\r\n }), 1, 0.2), 0);\r\n floor6.position.set(31.8, -0.5, 18.8);\r\n floor6.scale.set(2.2, 1, 10.2);\r\n scene.add(floor6);\r\n floor7 = new Physijs.BoxMesh(new THREE.BoxGeometry(2, 1, 2), Physijs\r\n .createMaterial(new THREE.MeshBasicMaterial({\r\n color : 0xee2233,\r\n visible : false,\r\n opacity : 1\r\n }), 1, 0.2), 0);\r\n floor7.position.set(31.6, -0.5, 1.6);\r\n floor7.scale.set(2.2, 1, 2.6);\r\n scene.add(floor7);\r\n floor8 = new Physijs.BoxMesh(new THREE.BoxGeometry(2, 1, 2), Physijs\r\n .createMaterial(new THREE.MeshBasicMaterial({\r\n color : 0xee2233,\r\n visible : false,\r\n opacity : 1\r\n }), 1, 0.2), 0);\r\n floor8.position.set(22.6, -0.5, -25.4);\r\n floor8.scale.set(2.2, 1, 5.2);\r\n scene.add(floor8);\r\n floor9 = new Physijs.BoxMesh(new THREE.BoxGeometry(2, 1, 2), Physijs\r\n .createMaterial(new THREE.MeshBasicMaterial({\r\n color : 0xee2233,\r\n visible : false,\r\n opacity : 1\r\n }), 1, 0.2), 0);\r\n floor9.position.set(22.6, -0.5, 0.8);\r\n floor9.scale.set(2.6, 1, 16);\r\n scene.add(floor9);\r\n}", "title": "" }, { "docid": "032a13252707bc38dc3dc3be311855a1", "score": "0.49511367", "text": "function createMeshVertices(M, N, uvToShape, arg) {\n let v = [];\n let addVertex = a => {\n // console.log(\"adding: \" +a.length+\" vertices\");\n for (let i = 0 ; i < a.length ; i++)\n v.push(a[i]);\n }\n //Start with v= 0 , u = 1\n var vValue = 0.;\n var uValue = 1.;\n var unitHeight= 1/(N-1);\n var unitWidth = 1/(M-1);\n var direction;\n\n // Loop through ROWS\n for (var i=0; i < (N-1); i++){\n vValue = i / (N - 1);\n if (i % 2 == 0){\n direction = \"left\";\n } else{\n direction = \"right\";\n }\n //Loop through COLUMNS\n for (var j=0; j < (M-1); j++){\n //If we are at the beginning of the row strip & DONT REPEAT THE LAST ONE\n if (j == 0 && i == 0){\n var firstPoint = uvToShape(uValue,vValue,arg);\n\n addVertex(firstPoint);\n }\n if (direction == \"left\"){\n uValue = 1. - (j/ (M-1));\n var point2 = uvToShape(uValue,vValue+unitHeight, arg);\n var point3 = uvToShape(uValue-unitWidth,vValue, arg);\n var lastPoint = uvToShape(uValue - unitWidth, vValue + unitHeight, arg);\n \n }\n else if (direction == \"right\"){\n uValue = (j/ (M-1));\n var point2 = uvToShape(uValue,vValue+unitHeight,arg);\n var point3 = uvToShape(uValue+unitWidth,vValue,arg);\n var lastPoint = uvToShape(uValue + unitWidth, vValue + unitHeight, arg);\n\n }\n addVertex(point2);\n addVertex(point3);\n // If we are at the end of the row strip, include lastPoint\n if ((j == (M-2))){\n addVertex(lastPoint);\n\n }\n }\n }\n return v;\n\n}", "title": "" }, { "docid": "0a5f135256aef11494981b5de2692f9c", "score": "0.49491894", "text": "createFloor(color, width, height) {\n let fillStyle = this.model.fillStyle\n\n var floorMaterial\n\n if (fillStyle.type == 'pattern' && fillStyle.image) {\n var floorTexture = this._textureLoader.load(this.app.url(fillStyle.image), texture => {\n texture.minFilter = THREE.LinearFilter\n texture.repeat.set(1, 1)\n this.render_threed()\n })\n\n floorMaterial = new THREE.MeshStandardMaterial({\n map: floorTexture,\n side: THREE.DoubleSide\n })\n } else {\n floorMaterial = new THREE.MeshStandardMaterial({\n color: color,\n side: THREE.FrontSide\n })\n }\n\n var floorGeometry = new THREE.BoxBufferGeometry(1, 1, 1)\n var floor = new THREE.Mesh(floorGeometry, floorMaterial)\n\n floor.scale.set(width, height, 5)\n floor.rotation.x = -Math.PI / 2\n floor.position.y = -2\n\n floor.name = 'floor'\n\n this._scene3d.add(floor)\n }", "title": "" }, { "docid": "2c297336e53cac74f19b4968cb03fc8c", "score": "0.49424404", "text": "modify(geometry) {\n const positionAttr = geometry.getAttribute(\"position\");\n const position = Array.from(positionAttr.array);\n const uvAttr = geometry.getAttribute(\"uv\");\n const uv = uvAttr !== undefined ? Array.from(uvAttr.array) : undefined;\n const edgeAttr = geometry.getAttribute(\"edge\");\n const edge = edgeAttr !== undefined ? Array.from(edgeAttr.array) : undefined;\n const wallAttr = geometry.getAttribute(\"wall\");\n const wall = wallAttr !== undefined ? Array.from(wallAttr.array) : undefined;\n const indexAttr = geometry.getIndex();\n const indices = Array.from(indexAttr.array);\n // A cache containing the indices of the vertices added\n // when subdiving the faces of the geometry.\n const cache = new Map();\n /**\n * Returns the index of the vertex positioned in the middle of the given vertices.\n */\n function middleVertex(i, j) {\n // Build a unique `key` for the pair of indices `(i, j)`.\n const key = `${Math.min(i, j)}_${Math.max(i, j)}`;\n const h = cache.get(key);\n if (h !== undefined) {\n // Nothing to do, a vertex in the middle of (i, j) was already created.\n return h;\n }\n // The position of the new vertex.\n tmpVectorA.set(position[i * 3], position[i * 3 + 1], position[i * 3 + 2]);\n tmpVectorB.set(position[j * 3], position[j * 3 + 1], position[j * 3 + 2]);\n tmpVectorC.lerpVectors(tmpVectorA, tmpVectorB, 0.5);\n // The index of the new vertex.\n const index = position.length / 3;\n position.push(...tmpVectorC.toArray());\n // Cache the position of the new vertex.\n cache.set(key, index);\n // The uvs of the new vertex.\n if (uv !== undefined) {\n tmpVectorA.set(uv[i * 2], uv[i * 2 + 1], 0);\n tmpVectorB.set(uv[j * 2], uv[j * 2 + 1], 0);\n tmpVectorC.lerpVectors(tmpVectorA, tmpVectorB, 0.5);\n uv.push(tmpVectorC.x, tmpVectorC.y);\n }\n // The edge and wall attributes of the new vertex.\n // If a new vertex has been introduced between i and j, connect the elements\n // accordingly.\n if (edge !== undefined) {\n if (edge[i] === j) {\n edge.push(j);\n edge[i] = index;\n }\n else if (edge[j] === i) {\n edge.push(i);\n edge[j] = index;\n }\n else {\n edge.push(-1);\n }\n }\n if (wall !== undefined) {\n if (wall[i] === j) {\n wall.push(j);\n wall[i] = index;\n }\n else if (wall[j] === i) {\n wall.push(i);\n wall[j] = index;\n }\n else {\n wall.push(-1);\n }\n }\n return index;\n }\n const newIndices = [];\n while (indices.length >= 3) {\n const v0 = indices.shift();\n const v1 = indices.shift();\n const v2 = indices.shift();\n tmpVectorA.set(position[v0 * 3], position[v0 * 3 + 1], position[v0 * 3 + 2]);\n tmpVectorB.set(position[v1 * 3], position[v1 * 3 + 1], position[v1 * 3 + 2]);\n tmpVectorC.set(position[v2 * 3], position[v2 * 3 + 1], position[v2 * 3 + 2]);\n const edgeToSplit = this.shouldSplitTriangle(tmpVectorA, tmpVectorB, tmpVectorC);\n switch (edgeToSplit) {\n case 0: {\n const v3 = middleVertex(v0, v1);\n indices.push(v0, v3, v2, v3, v1, v2);\n break;\n }\n case 1: {\n const v3 = middleVertex(v1, v2);\n indices.push(v0, v1, v3, v0, v3, v2);\n break;\n }\n case 2: {\n const v3 = middleVertex(v2, v0);\n indices.push(v0, v1, v3, v3, v1, v2);\n break;\n }\n case undefined: {\n newIndices.push(v0, v1, v2);\n break;\n }\n default:\n throw new Error(\"failed to subdivide the given geometry\");\n }\n }\n positionAttr.array = new Float32Array(position);\n positionAttr.count = position.length / positionAttr.itemSize;\n positionAttr.needsUpdate = true;\n geometry.setIndex(newIndices);\n if (uv !== undefined) {\n uvAttr.array = new Float32Array(uv);\n uvAttr.count = uv.length / uvAttr.itemSize;\n uvAttr.needsUpdate = true;\n }\n if (edge !== undefined) {\n edgeAttr.array = new Float32Array(edge);\n edgeAttr.count = edge.length / edgeAttr.itemSize;\n edgeAttr.needsUpdate = true;\n }\n return geometry;\n }", "title": "" }, { "docid": "bc71fd5223e612e3604f701877c95d41", "score": "0.4938186", "text": "shapeTerrain() {\n const iterations = 100;\n const initialDelta = 0.01;\n const deltaDropoff = 1.01;\n\n // Keep track of min and max Z values\n this.minZ = 0;\n this.maxZ = 0;\n\n // Set full range to be the whole terrain for now\n let dx = this.maxX - this.minX;\n let dy = this.maxY - this.minY;\n const range = Math.sqrt(dx*dx + dy*dy);\n \n let delta = initialDelta;\n for(let i = 0; i < iterations; i++){\n /* Generate random point in terrain */\n let x = Math.random()*(this.maxX - this.minX) + this.minX;\n let y = Math.random()*(this.maxY - this.minY) + this.minY;\n let p = glMatrix.vec2.fromValues(x, y);\n \n /* Generate random normal vector */\n let n = glMatrix.vec2.create();\n glMatrix.vec2.random(n);\n\n /* Update vertices based on which side of the plane they are on */\n for(let j = 0; j < this.numVertices; j++){\n let v = glMatrix.vec3.create();\n this.getVertex(v, j);\n\n let d = glMatrix.vec2.create();\n glMatrix.vec2.sub(d, v, p);\n let dist = glMatrix.vec2.length(d);\n\n if(dist < range){\n // Modifier determines if we lift or sink this vertex\n let modifier = Math.sign(glMatrix.vec2.dot(d, n));\n\n let ratio = dist/range;\n let sigmoid = 1 - ratio*ratio;\n sigmoid *= sigmoid;\n\n v[2] += modifier * delta * sigmoid;\n \n // Update min/max Z values\n if(v[2] > this.maxZ) this.maxZ = v[2];\n if(v[2] < this.minZ) this.minZ = v[2];\n\n this.setVertex(v, j);\n }\n }\n \n delta /= deltaDropoff;\n }\n }", "title": "" }, { "docid": "445812bee4239beb867994c1cff1cf17", "score": "0.49224538", "text": "function main() {\r\n canvas = document.getElementById(\"myGLCanvas\");\r\n console.log(canvas);\r\n gl = createGLContext(canvas);\r\n // Get extension for 4 byte integer indices for drawElements\r\n var ext = gl.getExtension('OES_element_index_uint');\r\n if (ext ==null){\r\n alert(\"OES_element_index_uint is unsupported by your browser and terrain generation cannot proceed.\");\r\n }\r\n else{\r\n console.log(\"OES_element_index_uint is supported!\");\r\n }\r\n setupShaders();\r\n setupCubeShaders(); // lookup positions in setupCubeShaders attached to program obj\r\n setupMesh(hostUrl + render_mesh_name);\r\n // Create a buffer for positions\r\n gl.useProgram(cubeShaderProgram);\r\n skyboxPositionBuffer = gl.createBuffer();\r\n // Bind it to ARRAY_BUFFER (think of it as ARRAY_BUFFER = positionBuffer)\r\n gl.bindBuffer(gl.ARRAY_BUFFER, skyboxPositionBuffer);\r\n // Put the positions in the buffer\r\n setGeometry(gl);\r\n\r\n // Create a texture.\r\n skyboxTexture = gl.createTexture();\r\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, skyboxTexture);\r\n\r\n // create all the faces mapped to their urls\r\n const faceInfos = [\r\n {\r\n target: gl.TEXTURE_CUBE_MAP_POSITIVE_X,\r\n url: hostUrl + 'pos-x.png'\r\n },\r\n {\r\n target: gl.TEXTURE_CUBE_MAP_NEGATIVE_X,\r\n url: hostUrl + 'neg-x.png'\r\n },\r\n {\r\n target: gl.TEXTURE_CUBE_MAP_POSITIVE_Y,\r\n url: hostUrl + 'pos-y.png'\r\n },\r\n {\r\n target: gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,\r\n url: hostUrl + 'neg-y.png'\r\n },\r\n {\r\n target: gl.TEXTURE_CUBE_MAP_POSITIVE_Z,\r\n url: hostUrl + 'pos-z.png'\r\n },\r\n {\r\n target: gl.TEXTURE_CUBE_MAP_NEGATIVE_Z,\r\n url: hostUrl + 'neg-z.png'\r\n },\r\n ];\r\n // add all the texture images to the buffer\r\n faceInfos.forEach((faceInfo) => {\r\n const {target, url} = faceInfo;\r\n\r\n // Upload the canvas to the cubemap face.\r\n const level = 0;\r\n const internalFormat = gl.RGBA;\r\n const width = 512;\r\n const height = 512;\r\n const format = gl.RGBA;\r\n const type = gl.UNSIGNED_BYTE;\r\n\r\n // setup each face so it's immediately renderable\r\n gl.texImage2D(target, level, internalFormat, width, height, 0, format, type, null);\r\n\r\n // Asynchronously load an image\r\n const image = new Image();\r\n image.src = url;\r\n // once the image loads, add its data and options to the buffer\r\n image.addEventListener('load', function() {\r\n // Now that the image has loaded make copy it to the texture.\r\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, skyboxTexture);\r\n gl.texImage2D(target, level, internalFormat, format, type, image);\r\n gl.generateMipmap(gl.TEXTURE_CUBE_MAP);\r\n });\r\n });\r\n gl.generateMipmap(gl.TEXTURE_CUBE_MAP);\r\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);\r\n\r\n var fieldOfViewRadians = degToRad(60);\r\n\r\n requestAnimationFrame(drawScene);\r\n\r\n // Draw the scene.\r\n function drawScene() {\r\n shouldReflect = document.getElementById(\"Reflect\").checked\r\n document.getElementById(\"eY\").value=rotY;\r\n // Tell WebGL how to convert from clip space to pixels\r\n gl.viewport(0, 0, canvas.width, canvas.height);\r\n\r\n gl.enable(gl.DEPTH_TEST);\r\n\r\n // Clear the canvas AND the depth buffer.\r\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\r\n\r\n // Tell it to use our program (pair of shaders)\r\n gl.useProgram(cubeShaderProgram);\r\n\r\n // Turn on the position attribute\r\n gl.enableVertexAttribArray(cubeShaderProgram.cubeVertexPositionAttribute);\r\n\r\n // Bind the position buffer.\r\n gl.bindBuffer(gl.ARRAY_BUFFER, skyboxPositionBuffer);\r\n\r\n // Tell the position attribute how to get data out of positionBuffer (ARRAY_BUFFER)\r\n var size = 2; // 2 components per iteration\r\n var type = gl.FLOAT; // the data is 32bit floats\r\n var normalize = false; // don't normalize the data\r\n var stride = 0; // 0 = move forward size * sizeof(type) each iteration to get the next position\r\n var offset = 0; // start at the beginning of the buffer\r\n gl.vertexAttribPointer(\r\n cubeShaderProgram.cubeVertexPositionAttribute, size, type, normalize, stride, offset);\r\n\r\n // Compute the projection matrix\r\n var aspect = canvas.width / canvas.height;\r\n mat4.perspective(pMatrix, fieldOfViewRadians, aspect, 1, 2000);\r\n\r\n // camera going in circle 2 units from origin looking at origin\r\n viewPoint = vec3.fromValues(0, 0, 1.6);\r\n cameraPos = vec3.fromValues(0, 0, 0);\r\n\r\n // Compute the camera's matrix using look at.\r\n var cameraMatrix = mat4.create();\r\n mat4.lookAt(cameraMatrix, cameraPos, viewPoint, upVec);\r\n mat4.rotateY(cameraMatrix, cameraMatrix, degToRad(rotY));\r\n // Make a view matrix from the camera matrix.\r\n mat4.invert(vMatrix, cameraMatrix);\r\n\r\n // the inverse of the view direction multiplied by the projection matrix, inverted\r\n var viewDirectionProjectionMatrix = mat4.create();\r\n mat4.multiply(viewDirectionProjectionMatrix, pMatrix, vMatrix);\r\n\r\n mat4.invert(viewDirectionProjectionMatrix, viewDirectionProjectionMatrix);\r\n\r\n // Set the uniforms\r\n gl.uniformMatrix4fv(\r\n cubeShaderProgram.cubeViewDirectionProjection, false,\r\n viewDirectionProjectionMatrix);\r\n\r\n // Tell the shader to use texture unit 0 for u_skybox\r\n gl.uniform1i(cubeShaderProgram.cubeTextureUniform, 0);\r\n\r\n // Draw the geometry.\r\n gl.bindBuffer(gl.ARRAY_BUFFER, skyboxPositionBuffer);\r\n gl.drawArrays(gl.TRIANGLES, 0, 1 * 6);\r\n\r\n drawTeapot();\r\n requestAnimationFrame(drawScene);\r\n }\r\n}", "title": "" }, { "docid": "d993e4510c3a04c4b76f7a2e2a8fb0cb", "score": "0.4922198", "text": "function getMeshPoints(room){\n\tvar mesh = list.Flatten(revit.selectParameter(room, \"geometry\").Out)\n\tvar points = mesh[0].vertices\n\treturn points;\n}", "title": "" }, { "docid": "d85ddd75ba30f2cfa00dca844c3e9be5", "score": "0.4921757", "text": "function meshToGeometry(mdata) {\n\n\t var mesh = mdata.mesh;\n\t var geometry = createBufferGeometry();\n\n\t if (globals.isNodeJS()) {\n\t //Used by SVF post-processing tools\n\t geometry.packId = mdata.packId;\n\t geometry.meshIndex = mdata.meshIndex;\n\t }\n\n\t geometry.byteSize = 0;\n\n\t geometry.vb = mesh.vb;\n\t geometry.vbbuffer = undefined;\n\t geometry.vbNeedsUpdate = true;\n\t geometry.byteSize += mesh.vb.byteLength;\n\n\t geometry.vbstride = mesh.vbstride;\n\t if (mesh.isLines) /* mesh is SVF lines */\n\t geometry.isLines = mesh.isLines;\n\t if (mdata.is2d) /* mesh is from F2D */\n\t geometry.is2d = true;\n\n\t geometry.numInstances = mesh.numInstances;\n\n\t for (var attributeName in mesh.vblayout) {\n\t var attributeData = mesh.vblayout[attributeName];\n\n\t //geometry.addAttribute(attributeName, findBufferAttribute(attributeData, geometry.numInstances));\n\t geometry.attributes[attributeName] = findBufferAttribute(attributeName, attributeData, geometry.numInstances);\n\t }\n\n\t //Index buffer setup\n\t if (!globals.memoryOptimizedLoading) {\n\t geometry.addAttribute(\"index\", new THREE.BufferAttribute(mesh.indices, 1));\n\t } else {\n\n\t geometry.attributes.index = indexAttr;\n\t geometry.ib = mesh.indices;\n\t geometry.ibbuffer = undefined;\n\t }\n\n\t geometry.attributesKeys = findAttributesKeys(geometry);\n\n\t geometry.byteSize += mesh.indices.byteLength;\n\n\t //TODO: Not sure chunking into list of smaller offset/counts\n\t //is required for LMV data since it's already broken up.\n\t //if (mesh.indices.length > 65535)\n\t if (mesh.vb.length / mesh.vbstride > 65535)\n\t THREE.warn(\"Mesh with >65535 vertices. It will fail to draw.\");\n\n\t //TODO: This is a transient object that gets freed once the geometry\n\t //is added to the GeometryList. We can save on the object creation\n\t //eventually when we do micro optimizations.\n\t geometry.boundingBox = new THREE.Box3().copy(mesh.boundingBox);\n\t geometry.boundingSphere = new THREE.Sphere().copy(mesh.boundingSphere);\n\n\t //MEM\n\t geometry.drawcalls = null;\n\t geometry.offsets = null;\n\n\t mdata.geometry = geometry;\n\n\t mdata.mesh = null;\n\t }", "title": "" }, { "docid": "071186aebd2eb96b579908564fdd9436", "score": "0.49193075", "text": "function checkIntersection() {\n\n console.log(\"checkIntersection - BEGIN\");\n //Setting raycaster from camera to where mous is pointing\n raycaster.setFromCamera( mouse, camera );\n var intersects = raycaster.intersectObjects( [ loaded_mesh ] );\n\n //Check if raycaster retrieve an object\n if ( intersects.length > 0 ) {\n //Take first element intersecting raycaster\n var p = intersects[ 0 ].point;\n\n //Set helper position to retrieved object\n mouseHelper.position.copy( p );\n intersection.point.copy( p );\n\n //Clone the normal of the face retirieved by raycaster\n var n = intersects[ 0 ].face.normal.clone();\n\n //Create line that is aligned with normal vector\n\t n.multiplyScalar( 100 );\n n.add( intersects[ 0 ].point );\n intersection.normal.copy( intersects[ 0 ].face.normal );\n mouseHelper.lookAt( n );\n line.geometry.vertices[ 0 ].copy( intersection.point );\n line.geometry.vertices[ 1 ].copy( n );\n line.geometry.verticesNeedUpdate = true;\n intersection.intersects = true;\n\n //Update the point that the camera is looking at\n camlookatpoint = line.geometry.vertices[ 0 ].copy( intersection.point );\n //Update camera position to be along normal\n camposalongnormal = line.geometry.vertices[ 1 ].copy( n );\n\n //Debugging logs\n if(DebugMode == true)\n {\n console.log(\"camlookatpoint\");\n console.log(camlookatpoint);\n console.log(\"camposalongnormal\");\n console.log(camposalongnormal);\n console.log('camcurrentlook');\n console.log(camera.getWorldDirection());\n console.log('camcurrentposition');\n console.log(camera.position);\n }\n\n //Update Sphere/Object data used to Freeze 3D marker\n CurrSphereData[0] = camlookatpoint;\n CurrSphereData[1] = camposalongnormal;\n\n //Update 3D marker position and direction\n if(InEditMode == true){\n\n //Update position\n mesh.position.copy(camlookatpoint);\n mesh.visible = true;\n //Updating direction\n var focalPoint = new THREE.Vector3(\n mesh.position.x + camposalongnormal.x,\n mesh.position.y + camposalongnormal.y,\n mesh.position.z + camposalongnormal.z\n );\n\n //Setting 3D marker direction along normal\n mesh.lookAt(focalPoint);\n }\n else{\n //Do nothing\n }\n\n }\n else {\n //No intersecting objects\n intersection.intersects = false;\n }\n}", "title": "" }, { "docid": "64f7abf638d729240b62dd269f899b11", "score": "0.491111", "text": "function vtkOpenGLRenderer(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLRenderer'); // Builds myself.\n\n publicAPI.buildPass = function (prepass) {\n if (prepass) {\n if (!model.renderable) {\n return;\n } // make sure we have a camera\n\n\n if (!model.renderable.isActiveCameraCreated()) {\n model.renderable.resetCamera();\n }\n\n publicAPI.updateLights();\n publicAPI.prepareNodes();\n publicAPI.addMissingNode(model.renderable.getActiveCamera());\n publicAPI.addMissingNodes(model.renderable.getViewPropsWithNestedProps());\n publicAPI.removeUnusedNodes();\n }\n };\n\n publicAPI.updateLights = function () {\n var count = 0;\n var lights = model.renderable.getLightsByReference();\n\n for (var index = 0; index < lights.length; ++index) {\n if (lights[index].getSwitch() > 0.0) {\n count++;\n }\n }\n\n if (!count) {\n vtkDebugMacro('No lights are on, creating one.');\n model.renderable.createLight();\n }\n\n return count;\n };\n\n publicAPI.opaqueZBufferPass = function (prepass) {\n if (prepass) {\n var clearMask = 0;\n var gl = model.context;\n\n if (!model.renderable.getTransparent()) {\n model.context.clearColor(1.0, 0.0, 0.0, 1.0);\n clearMask |= gl.COLOR_BUFFER_BIT;\n }\n\n if (!model.renderable.getPreserveDepthBuffer()) {\n gl.clearDepth(1.0);\n clearMask |= gl.DEPTH_BUFFER_BIT;\n gl.depthMask(true);\n }\n\n var ts = publicAPI.getTiledSizeAndOrigin();\n gl.enable(gl.SCISSOR_TEST);\n gl.scissor(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize);\n gl.viewport(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize);\n gl.colorMask(true, true, true, true);\n gl.clear(clearMask);\n gl.enable(gl.DEPTH_TEST);\n }\n }; // Renders myself\n\n\n publicAPI.cameraPass = function (prepass) {\n if (prepass) {\n publicAPI.clear();\n }\n };\n\n publicAPI.getAspectRatio = function () {\n var size = model.parent.getSizeByReference();\n var viewport = model.renderable.getViewportByReference();\n return size[0] * (viewport[2] - viewport[0]) / ((viewport[3] - viewport[1]) * size[1]);\n };\n\n publicAPI.getTiledSizeAndOrigin = function () {\n var vport = model.renderable.getViewportByReference(); // if there is no window assume 0 1\n\n var tileViewPort = [0.0, 0.0, 1.0, 1.0]; // find the lower left corner of the viewport, taking into account the\n // lower left boundary of this tile\n\n var vpu = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"default\"].clampValue(vport[0] - tileViewPort[0], 0.0, 1.0);\n var vpv = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"default\"].clampValue(vport[1] - tileViewPort[1], 0.0, 1.0); // store the result as a pixel value\n\n var ndvp = model.parent.normalizedDisplayToDisplay(vpu, vpv);\n var lowerLeftU = Math.round(ndvp[0]);\n var lowerLeftV = Math.round(ndvp[1]); // find the upper right corner of the viewport, taking into account the\n // lower left boundary of this tile\n\n var vpu2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"default\"].clampValue(vport[2] - tileViewPort[0], 0.0, 1.0);\n var vpv2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"default\"].clampValue(vport[3] - tileViewPort[1], 0.0, 1.0); // also watch for the upper right boundary of the tile\n\n if (vpu2 > tileViewPort[2] - tileViewPort[0]) {\n vpu2 = tileViewPort[2] - tileViewPort[0];\n }\n\n if (vpv2 > tileViewPort[3] - tileViewPort[1]) {\n vpv2 = tileViewPort[3] - tileViewPort[1];\n }\n\n var ndvp2 = model.parent.normalizedDisplayToDisplay(vpu2, vpv2); // now compute the size of the intersection of the viewport with the\n // current tile\n\n var usize = Math.round(ndvp2[0]) - lowerLeftU;\n var vsize = Math.round(ndvp2[1]) - lowerLeftV;\n\n if (usize < 0) {\n usize = 0;\n }\n\n if (vsize < 0) {\n vsize = 0;\n }\n\n return {\n usize: usize,\n vsize: vsize,\n lowerLeftU: lowerLeftU,\n lowerLeftV: lowerLeftV\n };\n };\n\n publicAPI.clear = function () {\n var clearMask = 0;\n var gl = model.context;\n\n if (!model.renderable.getTransparent()) {\n var background = model.renderable.getBackgroundByReference(); // renderable ensures that background has 4 entries.\n\n model.context.clearColor(background[0], background[1], background[2], background[3]);\n clearMask |= gl.COLOR_BUFFER_BIT;\n }\n\n if (!model.renderable.getPreserveDepthBuffer()) {\n gl.clearDepth(1.0);\n clearMask |= gl.DEPTH_BUFFER_BIT;\n gl.depthMask(true);\n }\n\n gl.colorMask(true, true, true, true);\n var ts = publicAPI.getTiledSizeAndOrigin();\n gl.enable(gl.SCISSOR_TEST);\n gl.scissor(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize);\n gl.viewport(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize);\n gl.clear(clearMask);\n gl.enable(gl.DEPTH_TEST);\n /* eslint-enable no-bitwise */\n };\n\n publicAPI.releaseGraphicsResources = function () {\n if (model.selector !== null) {\n model.selector.releaseGraphicsResources();\n }\n };\n\n publicAPI.setOpenGLRenderWindow = function (rw) {\n if (model.openGLRenderWindow === rw) {\n return;\n }\n\n publicAPI.releaseGraphicsResources();\n model.openGLRenderWindow = rw;\n model.context = null;\n\n if (rw) {\n model.context = model.openGLRenderWindow.getContext();\n }\n };\n} // ----------------------------------------------------------------------------", "title": "" }, { "docid": "566adcc94cb68550b2ee15d96c599756", "score": "0.49090487", "text": "function init(points) {\n\n var extremePoints = findExtremePoints(points);\n var mostDistantExtremePointIndices = findMostDistantExpremePointIndices(extremePoints);\n\n // The remaining points with the most distant ones removed\n // Sort so that the lower index remains consistent\n mostDistantExtremePointIndices.sort();\n var remaining = extremePoints.slice(0);\n remaining.splice(mostDistantExtremePointIndices[1], 1);\n remaining.splice(mostDistantExtremePointIndices[0], 1);\n\n var a = extremePoints[mostDistantExtremePointIndices[0]];\n var b = extremePoints[mostDistantExtremePointIndices[1]];\n var c = findMostDistantToLine(remaining, a, b);\n\n // Correct normal for positive apex distance\n var basePlane = new Plane(a,c,b);\n var apex = findMostDistantFromPlane(basePlane, points);\n\n // Correct normal so that right-hand base normal points away from apex\n var base = apex.distance > 0 ? [a,b,c] : [a,c,b];\n var mesh = {\n vertices: base.concat(apex.point),\n faces: [{a:0, b:1, c:2}, {a:0, b:3, c:1}, {a:3, b:2, c:1}, {a:0, b:2, c:3}]\n };\n\n assignPointsToFaces(points, mesh);\n return mesh;\n\n}", "title": "" }, { "docid": "2859c0856d0bbc54b2044665378c893f", "score": "0.4901427", "text": "function e(a){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[0]:a.material}", "title": "" }, { "docid": "fff4b6ac1db350e6ed5721f1ca52cea7", "score": "0.48981208", "text": "function initScene() {\n\n scene = new THREE.Scene();\n scene.background = new THREE.Color(0xbfd1e5);\n // scene.fog = new THREE.FogExp2(0xbfd1e5, 0.0015);\n\n camera = new THREE.PerspectiveCamera(90, window.innerWidth / window.innerHeight, 0.1, 1000);\n camera.position.set(-180, 250, -150);\n\n dirlight = new THREE.DirectionalLight(0xd3d3d3, 1);\n dirlight.position.set(100, 100, 10);\n dirlight.target.position.set(0, 0, 0);\n dirlight.castShadow = true;\n dirlight.shadow.mapSize.width = cameraMapSize;\n dirlight.shadow.mapSize.height = cameraMapSize;\n // dirlight.shadow.camera.near = 0.1;\n // dirlight.shadow.camera.far = 500.0;\n dirlight.shadow.camera.near = cameraNear;\n dirlight.shadow.camera.far = cameraNear * 1000;\n dirlight.shadow.camera.left = cameraTRBL;\n dirlight.shadow.camera.right = -cameraTRBL;\n dirlight.shadow.camera.top = cameraTRBL;\n dirlight.shadow.camera.bottom = -cameraTRBL;\n\n scene.add(dirlight);\n\n ambientLight = new THREE.AmbientLight(0xFFFFFF, 0.3);\n scene.add(ambientLight);\n\n hemiLight = new THREE.HemisphereLight(0xbfd1e5, 0xFFFFFF, 1);\n hemiLight.color.setHSL(0.8, 0.8, 0.8);\n hemiLight.groundColor.setHSL(0.1, 1, 0.4);\n hemiLight.position.set(100, 100, 10);\n scene.add(hemiLight);\n\n\n // Ground\n const mesh = new THREE.Mesh(new THREE.PlaneBufferGeometry(15000, 15000),\n new THREE.MeshPhongMaterial({ color: 0xFFFFFF, wireframe: false, depthWrite: false }));\n mesh.rotation.x = - Math.PI / 2;\n mesh.receiveShadow = true;\n mesh.castShadow = false;\n scene.add(mesh);\n\n const gridHelper = new THREE.GridHelper(15000, 100, 0x000000, 0x000000);\n gridHelper.material.opacity = 0.2;\n gridHelper.material.transparent = true;\n scene.add(gridHelper);\n\n window.addEventListener('resize', onWindowResize);\n}", "title": "" }, { "docid": "0b9f2a413c20d4b150ddba43c3f58720", "score": "0.48914894", "text": "function createCube(gl) {\n\n // Vertex Data\n let vertexBuffer;\n vertexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n let verts = [\n // Front face\n -1.0, -1.0, 1.0,\n 1.0, -1.0, 1.0,\n 1.0, 1.0, 1.0, -1.0, 1.0, 1.0,\n\n // Back face\n -1.0, -1.0, -1.0, -1.0, 1.0, -1.0,\n 1.0, 1.0, -1.0,\n 1.0, -1.0, -1.0,\n\n // Top face\n -1.0, 1.0, -1.0, -1.0, 1.0, 1.0,\n 1.0, 1.0, 1.0,\n 1.0, 1.0, -1.0,\n\n // Bottom face\n -1.0, -1.0, -1.0,\n 1.0, -1.0, -1.0,\n 1.0, -1.0, 1.0, -1.0, -1.0, 1.0,\n\n // Right face\n 1.0, -1.0, -1.0,\n 1.0, 1.0, -1.0,\n 1.0, 1.0, 1.0,\n 1.0, -1.0, 1.0,\n\n // Left face\n -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, -1.0\n ];\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(verts), gl.STATIC_DRAW);\n\n // Color data\n let colorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);\n let faceColors = [\n [1.0, 0.0, 0.0, 1.0], // Front face\n [0.0, 1.0, 0.0, 1.0], // Back face\n [0.0, 0.0, 1.0, 1.0], // Top face\n [1.0, 1.0, 0.0, 1.0], // Bottom face\n [1.0, 0.0, 1.0, 1.0], // Right face\n [0.0, 1.0, 1.0, 1.0] // Left face\n ];\n let vertexColors = [];\n for (let i in faceColors) {\n let color = faceColors[i];\n for (let j = 0; j < 4; j++) {\n vertexColors = vertexColors.concat(color);\n }\n }\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexColors), gl.STATIC_DRAW);\n\n // Index data (defines the triangles to be drawn)\n let cubeIndexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, cubeIndexBuffer);\n let cubeIndices = [\n 0, 1, 2, 0, 2, 3, // Front face\n 4, 5, 6, 4, 6, 7, // Back face\n 8, 9, 10, 8, 10, 11, // Top face\n 12, 13, 14, 12, 14, 15, // Bottom face\n 16, 17, 18, 16, 18, 19, // Right face\n 20, 21, 22, 20, 22, 23 // Left face\n ];\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(cubeIndices), gl.STATIC_DRAW);\n\n let cube = {\n buffer: vertexBuffer,\n colorBuffer: colorBuffer,\n indices: cubeIndexBuffer,\n vertSize: 3,\n nVerts: 24,\n colorSize: 4,\n nColors: 24,\n nIndices: 36,\n primtype: gl.TRIANGLES\n };\n\n return cube;\n}", "title": "" }, { "docid": "462dd8f0dcf156b344335485b6f9840b", "score": "0.4891254", "text": "function initPlaneBuffers(gl) {\r\n\r\n const positions = [\r\n // Front face\r\n -1.0, -1.0, 1.0,\r\n 1.0, -1.0, 1.0,\r\n 1.0, 1.0, 1.0,\r\n -1.0, 1.0, 1.0,\r\n \r\n // Back face\r\n -1.0, -1.0, -1.0,\r\n -1.0, 1.0, -1.0,\r\n 1.0, 1.0, -1.0,\r\n 1.0, -1.0, -1.0,\r\n \r\n // Top face\r\n -1.0, 1.0, -1.0,\r\n -1.0, 1.0, 1.0,\r\n 1.0, 1.0, 1.0,\r\n 1.0, 1.0, -1.0,\r\n \r\n // Bottom face\r\n -1.0, -1.0, -1.0,\r\n 1.0, -1.0, -1.0,\r\n 1.0, -1.0, 1.0,\r\n -1.0, -1.0, 1.0,\r\n \r\n // Right face\r\n 1.0, -1.0, -1.0,\r\n 1.0, 1.0, -1.0,\r\n 1.0, 1.0, 1.0,\r\n 1.0, -1.0, 1.0,\r\n \r\n // Left face\r\n -1.0, -1.0, -1.0,\r\n -1.0, -1.0, 1.0,\r\n -1.0, 1.0, 1.0,\r\n -1.0, 1.0, -1.0,\r\n ];\r\n\r\n const indices = [\r\n 0, 1, 2, 0, 2, 3, // front\r\n 4, 5, 6, 4, 6, 7, // back\r\n 8, 9, 10, 8, 10, 11, // top\r\n 12, 13, 14, 12, 14, 15, // bottom\r\n 16, 17, 18, 16, 18, 19, // right\r\n 20, 21, 22, 20, 22, 23, // left\r\n ];\r\n\r\n const vertexNormals = [\r\n // Front\r\n 0.0, 0.0, 1.0,\r\n 0.0, 0.0, 1.0,\r\n 0.0, 0.0, 1.0,\r\n 0.0, 0.0, 1.0,\r\n \r\n // Back\r\n 0.0, 0.0, -1.0,\r\n 0.0, 0.0, -1.0,\r\n 0.0, 0.0, -1.0,\r\n 0.0, 0.0, -1.0,\r\n \r\n // Top\r\n 0.0, 1.0, 0.0,\r\n 0.0, 1.0, 0.0,\r\n 0.0, 1.0, 0.0,\r\n 0.0, 1.0, 0.0,\r\n \r\n // Bottom\r\n 0.0, -1.0, 0.0,\r\n 0.0, -1.0, 0.0,\r\n 0.0, -1.0, 0.0,\r\n 0.0, -1.0, 0.0,\r\n \r\n // Right\r\n 1.0, 0.0, 0.0,\r\n 1.0, 0.0, 0.0,\r\n 1.0, 0.0, 0.0,\r\n 1.0, 0.0, 0.0,\r\n \r\n // Left\r\n -1.0, 0.0, 0.0,\r\n -1.0, 0.0, 0.0,\r\n -1.0, 0.0, 0.0,\r\n -1.0, 0.0, 0.0\r\n ];\r\n\r\n\r\n\r\n return initBuffers(gl, positions, indices, vertexNormals, null, 36);\r\n}", "title": "" }, { "docid": "44c87afff4f3ea15e80c6270ec5b3807", "score": "0.48784915", "text": "function flipNormals(intersections){\n for(let i of intersections){\n i.surface.normal = scale(-1, i.surface.normal);;\n }\n }", "title": "" }, { "docid": "3e1710033b15064f32c0dd3bd485c0b2", "score": "0.48772174", "text": "render()\n {\n let n = this.n;\n // LINES\n if ( n > 1 && this.enable_line)\n {\n let geometry = new THREE.Geometry();\n let color = new THREE.Color();\n let c = this.line_color;\n color.setRGB(c.r,c.g,c.b);\n let material = new THREE.LineBasicMaterial({\n color: color,\n linewidth: this.line_width,\n });\n for (let i = 0; i < n; i++)\n {\n geometry.vertices.push(\n new THREE.Vector3((this.xs[i] || 0), (this.ys[i] || 0), (this.zs[i] || 0))\n );\n }\n if (this.line_scan !== undefined)\n {\n this.remove(this.line_scan);\n }\n this.line_scan = new THREE.Line(geometry, material);\n this.add(this.line_scan);\n }\n // POINTS\n if ( n > 0 && this.enable_points)\n {\n let geometry = new THREE.Geometry();\n let color = new THREE.Color();\n let c = this.points_color;\n color.setRGB(c.r,c.g,c.b);\n let material = new THREE.PointsMaterial({\n color: color,\n size: this.points_width,\n opacity: this.points_color.a\n });\n for (let i = 0; i < n; i++)\n {\n geometry.vertices.push(\n new THREE.Vector3((this.xs[i] || 0), (this.ys[i] || 0), (this.zs[i] || 0))\n );\n }\n if (this.points_scan !== undefined)\n {\n this.remove(this.points_scan);\n }\n this.points_scan = new THREE.Points(geometry, material);\n this.add(this.points_scan);\n }\n // SURFACE\n if ( n > 2 && this.enable_surface)\n {\n let geometry = new THREE.Geometry();\n let color = new THREE.Color();\n let c = this.surface_color;\n color.setRGB(c.r,c.g,c.b);\n let material = new THREE.MeshBasicMaterial({\n color: color,\n opacity: this.surface_color.a\n })\n for (let i = 0; i < n; i++)\n {\n geometry.vertices.push(\n new THREE.Vector3((this.xs[i] || 0), (this.ys[i] || 0), (this.zs[i] || 0))\n );\n }\n geometry.vertices.push(\n new THREE.Vector3((this.xs[0] || 0), (this.ys[0] || 0), (this.zs[0] || 0))\n );\n for (let i = 1; i < n-1; i++)\n {\n geometry.faces.push(new THREE.Face3(0, i, i+1));\n }\n // geometry.computeFaceNormals();\n // geometry.computeVertexNormals();\n if (this.surface_scan !== undefined)\n {\n this.remove(this.surface_scan);\n }\n this.surface_scan = new THREE.Mesh(geometry, material);\n this.add(this.surface_scan);\n }\n }", "title": "" }, { "docid": "8d4d08bfbe24abfb584bc4664e379388", "score": "0.48744968", "text": "createFrustum(camera, frustum, flip = false) {\n const planes = [];\n const vertices = [];\n\n const origin = camera.position;\n\n // Obtain vertices in world space\n for (let vindex = 0, vcount = this.geometry.vertices.length; vindex < vcount; ++vindex) {\n const local = this.geometry.vertices[vindex].clone();\n const world = this.localToWorld(local);\n vertices.push(world);\n }\n\n // Check distance to portal\n const distance = this.portal.plane.distanceToPoint(this.worldToLocal(origin.clone()));\n const close = distance < 1.0 && distance > -1.0;\n\n // If the portal is very close, use the portal vertices unedited; otherwise, clip the portal\n // vertices by the provided frustum.\n const clipped = close ? vertices : THREEUtil.clipVerticesByFrustum(vertices, frustum);\n\n // If clipping the portal vertices resulted in a polygon with fewer than 3 vertices, return\n // null to indicate a new frustum couldn't be produced.\n if (clipped.length < 3) {\n return null;\n }\n\n // Produce side planes for new frustum\n for (let vindex = 0, vcount = clipped.length; vindex < vcount; ++vindex) {\n const vertex1 = clipped[vindex];\n const vertex2 = clipped[(vindex + 1) % vcount];\n\n const plane = new THREE.Plane().setFromCoplanarPoints(origin, vertex1, vertex2);\n if (flip) plane.negate();\n planes.push(plane);\n }\n\n // Copy the original far plane (index: last - 1)\n const farPlaneIndex = frustum.planes.length - 2;\n const farPlane = frustum.planes[farPlaneIndex];\n planes.push(farPlane);\n\n // Create a near plane matching the portal\n const nearPlane = new THREE.Plane().setFromCoplanarPoints(clipped[0], clipped[1], clipped[2]);\n if (flip) nearPlane.negate();\n planes.push(nearPlane);\n\n const newFrustum = { planes };\n\n return newFrustum;\n }", "title": "" }, { "docid": "7f5a69273eb4dec1227494aa71618580", "score": "0.4873681", "text": "_hitTestFace(face, origin, direction) {\n const add = XRMathHelper.add;\n const sub = XRMathHelper.sub;\n const mul = XRMathHelper.mul;\n const normalize = XRMathHelper.normalize;\n const dot = XRMathHelper.dot;\n const cross = XRMathHelper.cross;\n const neg = XRMathHelper.neg;\n\n //1. Calculate plane normal in world coordinates.\n const point_A = face.vertices[0];\n const point_B = face.vertices[1];\n const point_C = face.vertices[2];\n\n const edge_AB = sub(point_B, point_A);\n const edge_AC = sub(point_C, point_A);\n\n const normal = normalize(cross(edge_AB, edge_AC));\n\n const numerator = dot(sub(point_A, origin), normal);\n const denominator = dot(direction, normal);\n\n if (Math.abs(denominator) < XRMathHelper.EPSILON) {\n // Planes are nearly parallel - there's either infinitely many intersection points or 0.\n // Both cases signify a \"no hit\" for us.\n return null;\n } else {\n // Single intersection point between the infinite plane and the line (*not* ray).\n // Need to calculate the hit test matrix taking into account the face vertices.\n const distance = numerator / denominator;\n if (distance < 0) {\n // Line - plane intersection exists, but not the half-line - plane does not.\n return null;\n } else {\n const intersection_point = add(origin, mul(distance, direction));\n // Since we are treating the face as a solid, flip the normal so that its\n // half-space will contain the ray origin.\n const y_axis = denominator > 0 ? neg(normal) : normal;\n\n let z_axis = null;\n const cos_direction_and_y_axis = dot(direction, y_axis);\n if (Math.abs(cos_direction_and_y_axis) > (1 - XRMathHelper.EPSILON)) {\n // Ray and the hit test normal are co-linear - try using the 'up' or 'right' vector's projection on the face plane as the Z axis.\n // Note: this edge case is currently not covered by the spec.\n const up = {x: 0.0, y: 1.0, z: 0.0, w: 0.0};\n const right = {x: 1.0, y: 0.0, z: 0.0, w: 0.0};\n\n z_axis = Math.abs(dot(up, y_axis)) > (1 - XRMathHelper.EPSILON)\n ? sub(up, mul(dot(right, y_axis), y_axis)) // `up is also co-linear with hit test normal, use `right`\n : sub(up, mul(dot(up, y_axis), y_axis)); // `up` is not co-linear with hit test normal, use it\n } else {\n // Project the ray direction onto the plane, negate it and use as a Z axis.\n z_axis = neg(sub(direction, mul(cos_direction_and_y_axis, y_axis))); // Z should point towards the ray origin, not away.\n }\n\n z_axis = normalize(z_axis);\n const x_axis = normalize(cross(y_axis, z_axis));\n\n // Filter out the points not in polygon.\n if (!XRMathHelper.pointInFace(intersection_point, face)) {\n return null;\n }\n\n const hitResult = {planeId: 0n};\n hitResult.distance = distance; // Extend the object with additional information used by higher layers.\n // It will not be serialized over mojom.\n\n const matrix = new Array(16);\n\n matrix[0] = x_axis.x;\n matrix[1] = x_axis.y;\n matrix[2] = x_axis.z;\n matrix[3] = 0;\n\n matrix[4] = y_axis.x;\n matrix[5] = y_axis.y;\n matrix[6] = y_axis.z;\n matrix[7] = 0;\n\n matrix[8] = z_axis.x;\n matrix[9] = z_axis.y;\n matrix[10] = z_axis.z;\n matrix[11] = 0;\n\n matrix[12] = intersection_point.x;\n matrix[13] = intersection_point.y;\n matrix[14] = intersection_point.z;\n matrix[15] = 1;\n\n hitResult.mojoFromResult = getPoseFromTransform(\n XRMathHelper.decomposeRigidTransform(matrix));\n return hitResult;\n }\n }\n }", "title": "" }, { "docid": "b38b7e1c9f2d0bba0339901df912823b", "score": "0.48699537", "text": "function initGeom()\n{\n\tvar originX = turnstile.position.x;\n\tvar originY = turnstile.position.y;\n\tvar originZ = turnstile.position.z;\n\n\tvar offset = 20;\n\n\tfirstCubeVertices =\n\t\t[new THREE.Vector3(\n\t\toriginX - offset, originY + offset, originZ - offset),\n\t\tnew THREE.Vector3(\n\t\toriginX + offset, originY + offset, originZ - offset),\n\t\tnew THREE.Vector3(\n\t\toriginX + offset, originY - offset, originZ - offset),\n\t\tnew THREE.Vector3(\n\t\toriginX - offset, originY - offset, originZ - offset),\n\n\t\tnew THREE.Vector3(\n\t\toriginX - offset, originY + offset, originZ + offset),\n\t\tnew THREE.Vector3(\n\t\toriginX + offset, originY + offset, originZ + offset),\n\t\tnew THREE.Vector3(\n\t\toriginX + offset, originY - offset, originZ + offset),\n\t\tnew THREE.Vector3(\n\t\toriginX - offset, originY - offset, originZ + offset)];\n\n\tvar vertex00 = 0;\n\tvar vertex01 = 1;\n\tvar vertex02 = 2;\n\tvar vertex03 = 3;\n\tvar vertex04 = 4;\n\tvar vertex05 = 5;\n\tvar vertex06 = 6;\n\tvar vertex07 = 7;\n\tfirstCubeFaces =\n\t\t[new THREE.Face3(vertex00, vertex01, vertex02),\n\t\tnew THREE.Face3(vertex02, vertex03, vertex00),\n\n\t\tnew THREE.Face3(vertex04, vertex05, vertex06),\n\t\tnew THREE.Face3(vertex06, vertex07, vertex04),\n\n\t\tnew THREE.Face3(vertex00, vertex01, vertex05),\n\t\tnew THREE.Face3(vertex05, vertex04, vertex00),\n\n\t\tnew THREE.Face3(vertex05, vertex01, vertex02),\n\t\tnew THREE.Face3(vertex02, vertex06, vertex05),\n\n\t\tnew THREE.Face3(vertex07, vertex06, vertex02),\n\t\tnew THREE.Face3(vertex02, vertex03, vertex07),\n\n\t\tnew THREE.Face3(vertex00, vertex04, vertex07),\n\t\tnew THREE.Face3(vertex07, vertex03, vertex00)];\n\n\tvar colors = [0xa491ee, 0xee91e6, 0xee9d91, 0x948f61, 0x9cee91, 0x91eedf];\n\n\tvar color;\n\tvar colorIndex = 0;\n\tfor (var i = 0; i < firstCubeFaces.length; ++i)\n\t{\n\t\tif (i % 2 == 0)\n\t\t{\n\t\t\tcolor = colors[colorIndex];\n\t\t\t++colorIndex;\n\t\t}\n\t\tfirstCubeFaces[i].color.setHex(color);\n\t}\n}", "title": "" }, { "docid": "7a65229403c8dd1f3a82462743103042", "score": "0.48589197", "text": "function CreateHorizontalShadow(){\n\tshadowH = new GameObject(gameObject.name + \"_Shadow_H\", MeshRenderer, MeshFilter, MeshCollider);\n\tshadowH.tag = \"Shadow\";\n\n\tshadowMeshH = new Mesh();\t// Make a new shadow mesh\n\tshadowMeshH.name = gameObject.name + \"_Shadow_Mesh_H\";\n\tshadowMeshH.vertices = [Vector3(objRightX, objFloorY, objBackZ + objToWallDistance),\n\t\t\t\t\t Vector3(objRightX - objWidth, objFloorY, objBackZ + objToWallDistance),\n\t\t\t\t\t Vector3(objRightX - objWidth, objFloorY, objBackZ),\n\t\t\t\t\t Vector3(objRightX, objFloorY, objBackZ)]; \t\t\t\t\t \n\n\t// Define triangles\n\tif (reverseTriWinding) {\n\t\tshadowMeshH.triangles = [2, 1, 0, 3, 2, 0];\n\t}\n\telse {\n\t\tshadowMeshH.triangles = [0, 1, 2, 0, 2, 3];\n\t}\n\n\tshadowMeshH.RecalculateNormals();\t// Define normals\n\tshadowMeshH.uv = [Vector2 (0, 0), Vector2 (0, 1), Vector2(1, 1), Vector2 (1, 0)];\t// Define UVs\n\n\t// Add a collider to the shadow so that Hank can touch it\n\n\tvar meshColliderH : MeshCollider = shadowH.GetComponent(\"MeshCollider\");\n\tmeshColliderH.sharedMesh = shadowMeshH;\n\n\tif(isInLane)\n\t\tshadowH.renderer.material = shadowTextureFront;\n\telse\n\t\tshadowH.renderer.material = shadowTextureFloor2Wall;\n\n\tvar meshFilterHor : MeshFilter = shadowH.GetComponent(\"MeshFilter\");\n\tmeshFilterHor.sharedMesh = shadowMeshH;\n}", "title": "" }, { "docid": "161330efab7adbb619c1bf4aa4c66f9e", "score": "0.4854811", "text": "getMesh()\n {\n return this.m_Mesh;\n }", "title": "" }, { "docid": "161330efab7adbb619c1bf4aa4c66f9e", "score": "0.4854811", "text": "getMesh()\n {\n return this.m_Mesh;\n }", "title": "" }, { "docid": "8abe18541e3824a2f668759e829410ba", "score": "0.48477873", "text": "function createMesh(geoNum){\n return new THREE.Mesh(geometry(geoNum),material)\n}", "title": "" }, { "docid": "426b73858db233f321978b1f8e880fc2", "score": "0.4846971", "text": "init() {\n const count2 = this.count << 1\n const count4 = this.count << 2\n\n let idx1 = 0\n let idx2 = 0\n let idx3 = 0\n let idx6 = 0\n let idx8 = 0\n\n const positions = new Float32Array( this.count * 12 )\n for( let i = 0; i < this.count; i++ ) {\n let x = Math.random() * 800 - 400\n let y = Math.random() * 800 - 400\n let z = Math.random() * 800 - 400\n\n for( let j = 0; j < 4; j++ ) { \n positions[ idx6 + 0 ] = x\n positions[ idx6 + 1 ] = y\n positions[ idx6 + 2 ] = z\n\n idx6 += 3\n }\n }\n idx6 = 0\n\n // unique number to define the points of the plane\n const uids = new Float32Array( count4 )\n for( let i = 0; i < count4; i++ ) {\n let uid = Math.random() * 10000\n for( let j = 0; j < 4; j++ ) {\n uids[ idx1 ] = uid\n idx1 += 1\n }\n }\n idx1 = 0\n idx2 = 0\n\n let signX = 1\n let signY = 1\n\n // To determine how to place the vertices around the center\n const sides = new Float32Array( count4 * 2 )\n // To map a texture on the planes\n const uvs = new Float32Array( count4 * 2 )\n for( let i = 0; i < count2; i++ ) {\n // 0\n sides[ idx8 + 0 ] = -1 * signX\n sides[ idx8 + 1 ] = -1 * signY\n\n uvs[ idx8 + 0 ] = 0\n uvs[ idx8 + 1 ] = 0\n // 1\n sides[ idx8 + 2 ] = -1 * signX\n sides[ idx8 + 3 ] = 1 * signY\n\n uvs[ idx8 + 2 ] = 0\n uvs[ idx8 + 3 ] = 1\n // 2\n sides[ idx8 + 4 ] = 1 * signX\n sides[ idx8 + 5 ] = -1 * signY\n\n uvs[ idx8 + 4 ] = 1\n uvs[ idx8 + 5 ] = 0\n // 3\n sides[ idx8 + 6 ] = 1 * signX\n sides[ idx8 + 7 ] = 1 * signY\n\n uvs[ idx8 + 6 ] = 1\n uvs[ idx8 + 7 ] = 1\n\n idx8 += 8\n }\n\n idx2 = 0\n const index = new Uint32Array( count4 * 3 )\n for( let i = 0; i < this.count; i++ ) {\n index[ idx6 + 0 ] = idx2\n index[ idx6 + 1 ] = index[ idx6 + 4 ] = idx2 + 1\n index[ idx6 + 2 ] = index[ idx6 + 3 ] = idx2 + 2\n index[ idx6 + 5 ] = idx2 + 3\n\n idx2 += 4\n idx6 += 12\n }\n\n this.addAttribute( \"uid\", new THREE.BufferAttribute( uids, 1 ) )\n this.addAttribute( \"position\", new THREE.BufferAttribute( positions, 3 ) )\n this.addAttribute( \"side\", new THREE.BufferAttribute( sides, 2 ) )\n this.addAttribute( \"uv\", new THREE.BufferAttribute( uvs, 2 ) )\n this.setIndex( new THREE.BufferAttribute( index, 1 ) )\n }", "title": "" }, { "docid": "173e8827ed3a5d1f8390c460521a4da4", "score": "0.4846021", "text": "function vtkOpenGLRenderer(publicAPI, model) {\n // Set our className\n model.classHierarchy.push('vtkOpenGLRenderer');\n\n // Builds myself.\n publicAPI.buildPass = (prepass) => {\n if (prepass) {\n if (!model.renderable) {\n return;\n }\n\n // make sure we have a camera\n if (!model.renderable.isActiveCameraCreated()) {\n model.renderable.resetCamera();\n }\n publicAPI.updateLights();\n publicAPI.prepareNodes();\n publicAPI.addMissingNode(model.renderable.getActiveCamera());\n publicAPI.addMissingNodes(model.renderable.getViewPropsWithNestedProps());\n publicAPI.removeUnusedNodes();\n }\n };\n\n publicAPI.updateLights = () => {\n let count = 0;\n\n const lights = model.renderable.getLightsByReference();\n for (let index = 0; index < lights.length; ++index) {\n if (lights[index].getSwitch() > 0.0) {\n count++;\n }\n }\n\n if (!count) {\n vtkDebugMacro('No lights are on, creating one.');\n model.renderable.createLight();\n }\n\n return count;\n };\n\n publicAPI.opaqueZBufferPass = (prepass) => {\n if (prepass) {\n let clearMask = 0;\n const gl = model.context;\n if (!model.renderable.getTransparent()) {\n model.context.clearColor(1.0, 0.0, 0.0, 1.0);\n clearMask |= gl.COLOR_BUFFER_BIT;\n }\n\n if (!model.renderable.getPreserveDepthBuffer()) {\n gl.clearDepth(1.0);\n clearMask |= gl.DEPTH_BUFFER_BIT;\n gl.depthMask(true);\n }\n\n const ts = publicAPI.getTiledSizeAndOrigin();\n gl.enable(gl.SCISSOR_TEST);\n gl.scissor(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize);\n gl.viewport(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize);\n\n gl.colorMask(true, true, true, true);\n gl.clear(clearMask);\n\n gl.enable(gl.DEPTH_TEST);\n }\n };\n\n // Renders myself\n publicAPI.cameraPass = (prepass) => {\n if (prepass) {\n publicAPI.clear();\n }\n };\n\n publicAPI.getAspectRatio = () => {\n const size = model.parent.getSizeByReference();\n const viewport = model.renderable.getViewportByReference();\n return (\n (size[0] * (viewport[2] - viewport[0])) /\n ((viewport[3] - viewport[1]) * size[1])\n );\n };\n\n publicAPI.getTiledSizeAndOrigin = () => {\n const vport = model.renderable.getViewportByReference();\n\n // if there is no window assume 0 1\n const tileViewPort = [0.0, 0.0, 1.0, 1.0];\n\n // find the lower left corner of the viewport, taking into account the\n // lower left boundary of this tile\n const vpu = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[0] - tileViewPort[0], 0.0, 1.0);\n const vpv = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[1] - tileViewPort[1], 0.0, 1.0);\n\n // store the result as a pixel value\n const ndvp = model.parent.normalizedDisplayToDisplay(vpu, vpv);\n const lowerLeftU = Math.round(ndvp[0]);\n const lowerLeftV = Math.round(ndvp[1]);\n\n // find the upper right corner of the viewport, taking into account the\n // lower left boundary of this tile\n let vpu2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[2] - tileViewPort[0], 0.0, 1.0);\n let vpv2 = vtk_js_Sources_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__[\"clampValue\"](vport[3] - tileViewPort[1], 0.0, 1.0);\n // also watch for the upper right boundary of the tile\n if (vpu2 > tileViewPort[2] - tileViewPort[0]) {\n vpu2 = tileViewPort[2] - tileViewPort[0];\n }\n if (vpv2 > tileViewPort[3] - tileViewPort[1]) {\n vpv2 = tileViewPort[3] - tileViewPort[1];\n }\n const ndvp2 = model.parent.normalizedDisplayToDisplay(vpu2, vpv2);\n\n // now compute the size of the intersection of the viewport with the\n // current tile\n let usize = Math.round(ndvp2[0]) - lowerLeftU;\n let vsize = Math.round(ndvp2[1]) - lowerLeftV;\n\n if (usize < 0) {\n usize = 0;\n }\n if (vsize < 0) {\n vsize = 0;\n }\n\n return { usize, vsize, lowerLeftU, lowerLeftV };\n };\n\n publicAPI.clear = () => {\n let clearMask = 0;\n const gl = model.context;\n\n if (!model.renderable.getTransparent()) {\n const background = model.renderable.getBackgroundByReference();\n // renderable ensures that background has 4 entries.\n model.context.clearColor(\n background[0],\n background[1],\n background[2],\n background[3]\n );\n clearMask |= gl.COLOR_BUFFER_BIT;\n }\n\n if (!model.renderable.getPreserveDepthBuffer()) {\n gl.clearDepth(1.0);\n clearMask |= gl.DEPTH_BUFFER_BIT;\n gl.depthMask(true);\n }\n\n gl.colorMask(true, true, true, true);\n\n const ts = publicAPI.getTiledSizeAndOrigin();\n gl.enable(gl.SCISSOR_TEST);\n gl.scissor(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize);\n gl.viewport(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize);\n\n gl.clear(clearMask);\n\n gl.enable(gl.DEPTH_TEST);\n /* eslint-enable no-bitwise */\n };\n\n publicAPI.releaseGraphicsResources = () => {\n if (model.selector !== null) {\n model.selector.releaseGraphicsResources();\n }\n };\n\n publicAPI.setOpenGLRenderWindow = (rw) => {\n if (model.openGLRenderWindow === rw) {\n return;\n }\n publicAPI.releaseGraphicsResources();\n model.openGLRenderWindow = rw;\n model.context = null;\n if (rw) {\n model.context = model.openGLRenderWindow.getContext();\n }\n };\n}", "title": "" }, { "docid": "40ae7f386bebe958868e58d9ba80ebb4", "score": "0.48439506", "text": "function mkCorridorWall_3 () {\n\tvar shape = new THREE.Shape();\n \tvar options = {amount: 0,bevelThickness: 2,bevelSize: 1,bevelSegments: 3,bevelEnabled: false,curveSegments: 12,steps: 1};\n\tshape.moveTo(0, 0)\t\t\n\t// straight line upwards\n\tshape.lineTo(10.7, 0);\n\tshape.lineTo(10.7, 2.4);\n\tshape.lineTo(12,2.4);\n\tshape.lineTo(12,3);\n\tshape.lineTo(0,3);\n\tshape.lineTo(0,0);\n\tvar wallGeometry = new THREE.ExtrudeGeometry(shape,options);\n var wall = createMesh(wallGeometry, \"wall-green.jpg\");\n wall.rotation.x = Math.PI/2;\n return wall;\n}", "title": "" }, { "docid": "4992e3cffe23ca843a04f95d5b039db8", "score": "0.48427314", "text": "normals() {\n const normalsArray = [];\n for (let face of this.faces) {\n normalsArray.push(normal(face.map(vidx => this.vertices[vidx])));\n }\n return normalsArray;\n }", "title": "" } ]
00767c9836795c62b353c9225cb2bf17
to use fetch in node file
[ { "docid": "20691f44fcee01b1e8080a2a3e973ae5", "score": "0.0", "text": "async function turnPizzasIntoPages({graphql,actions}){\n const pizzaTemplate=path.resolve('./src/templates/Pizza.js') //get the template\n const {data}=await graphql //build a query to get all pizzas. it has to run as a function\n (` \n query {\n pizzas:allSanityPizza {\n nodes {\n name \n slug{\n current\n }\n }\n }\n }\n `)\n data.pizzas.nodes.forEach(pizza =>{ //loop over the query result to get details of each pizza\n actions.createPage( //create a page. it is a built-in method\n {\n path:`pizza/${pizza.slug.current}`, //give the path = same path as defined when click on single pizza \"review PizzaList component\"\n component:pizzaTemplate, //page template\n context:{ //define the context to let data be accessed. it will be accessed via \"pageContext\"\n slug:pizza.slug.current,\n }\n }\n )\n })\n}", "title": "" } ]
[ { "docid": "eb2728b0ab940da7e8f24cf48f783282", "score": "0.67007643", "text": "constructor() {\n this.fetch = require(`../fetch/fetch.js`)\n }", "title": "" }, { "docid": "301d0b2dc9e5348ede8cfcc118170abf", "score": "0.6391722", "text": "async function getFetch() {\n if(fetch)\n return fetch;\n return import('unfetch');\n}", "title": "" }, { "docid": "725f9e4391581e5894acaa7061396282", "score": "0.63733697", "text": "async fetch (txid) { throw new Error('Not implemented') }", "title": "" }, { "docid": "58839176316a5f7f4449d8bddaea354b", "score": "0.62096584", "text": "_fetch(propName, url) {\n return url;\n }", "title": "" }, { "docid": "9252a0f78866d3ab35d0dd47aa20b047", "score": "0.6183003", "text": "getLazyLoadFrame() {\n return `// LACUNA LAZY LOAD FALLBACK\nfunction lacuna_lazy_load(id, callback){\n fetch(\"http://127.0.0.1:${settings.LAZY_LOAD_SERVER_PORT}/lazyload/\", {\n method: \"POST\",\n headers: { \"Accept\": \"application/json\", \"Content-Type\": \"application/json\" },\n body: JSON.stringify({id})\n }).then(response => {\n return response.text();\n }).then(callback);\n}\\n`\n }", "title": "" }, { "docid": "9962123c261a311e812285332e1ace45", "score": "0.61358964", "text": "allFetch(context) {\n request(\"http://localhost:7070/init\", (err, res, body) =>\n // eslint-disable-next-line\n err ? console.log(err) : context.commit(\"fetchAddress\", body)\n );\n }", "title": "" }, { "docid": "05067b1add96f6f3aae56832f2155b5f", "score": "0.6110359", "text": "function myFetch(url)\n{\n let pr = new Promise(function(resolve, reject) { //!!!*******!!!***la fonction function est immediatement executé,\n // mais le xhr et la methode resolve (wrapper autour de la fct qui est passee en parametre du then qd on appelle myFetch)\n // est mis dans le thread web API et ds la callstack queue\n let xhr=new XMLHttpRequest();\n xhr.open('GET', url);\n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4) {\n resolve(xhr.responseText);\n }\n };\n xhr.send();\n });\n\n\n //On sait que fetch renvoie une promise\n return pr;\n}", "title": "" }, { "docid": "86f7f0d2c11930c48950a3363b985742", "score": "0.6081353", "text": "_fetch(options) {\n let body = options.body ? options.body : undefined;\n const request = new Request(`${this.dbServerURL}/${options.path}`, {\n method: options.method,\n headers: new Headers({\n 'Content-type': 'application/json'\n }),\n body: body\n });\n return fetch(request);\n }", "title": "" }, { "docid": "4efe28d9789c472c266d4af62a952b7f", "score": "0.6073161", "text": "function myFetch() {\n return _myFetch.apply(this, arguments);\n} // Filler space", "title": "" }, { "docid": "54fd3bef56b905069811268272b21bd8", "score": "0.60371953", "text": "function mainFetch() {\n fetch(URL)\n .then(resp => resp.json())\n .then(users => renderUser(users[3]));\n}", "title": "" }, { "docid": "104a6cf8799cf8b81fef169c306954db", "score": "0.6025879", "text": "function fetchFirst() {\n // fetch(0);\n}", "title": "" }, { "docid": "b0066cf50fc1cdc72ef1c3a923dde6c2", "score": "0.60044557", "text": "function fetchGetReq() {\n var url = 'https://stark-beyond-53579.herokuapp.com/abc';\n var url1 = 'http://localhost:3000/abc';\n fetch(url1)\n .then(function(res) {\n return res.json();\n }).then(function(data) {\n return data;\n }).then(function(val) {\n console.log(val);\n addingNews(val);\n }).then(function() {\n });\n}", "title": "" }, { "docid": "f7403c7818db516456e133350bca9e51", "score": "0.59991306", "text": "constructor(fetch) {\n this.fetch = fetch;\n }", "title": "" }, { "docid": "f2469d1317288fe6a645ce9a120f356d", "score": "0.59789515", "text": "function testo() {\n\tvar fetch = require('cross-fetch');\n\n\tfetch('https://opentdb.com/api.php?amount=10#')\n\t\t.then(res => res.json())\n\t\t.then(data => console.log(data));\n}", "title": "" }, { "docid": "c1767c92f37bb9d5de40a744936d9fe9", "score": "0.5974973", "text": "async function fetchData() {\r\n await fetch(\"monLien\");\r\n // attend que le await soit exécuté avant sz faire la suite\r\n executeFonction();\r\n}", "title": "" }, { "docid": "8378715b35a821b8f9211e3484f6fe73", "score": "0.5941463", "text": "function normalFetch() {\n fetch('https://api.github.com/users/joshtom')\n .then(status)\n .then(json)\n .then((data) => {\n console.log('Request succeeded with json response', data);\n })\n .catch((err) => {\n console.log('Request failed', err);\n })\n}", "title": "" }, { "docid": "35d9cebd8cfacb1f1a10ebf6b08a0c38", "score": "0.5935232", "text": "async getReq(url) {\n //the await acts as a resolve or as a .then\n const response = await fetch(url)\n const respData = response.json();\n \n //return\n return respData;\n \n //end GetReq func\n }", "title": "" }, { "docid": "08a5516d28e53b27ed3bf8bf910ac155", "score": "0.59280586", "text": "_fetch(propName, url) {\n const fetch = this.component.props.fetch;\n\n if (fetch) {\n return fetch(url, {\n propName,\n layer: this.layer\n });\n }\n\n return super._fetch(propName, url);\n }", "title": "" }, { "docid": "bd5d0248aff8941afd1e966d6fae03e4", "score": "0.5894201", "text": "async function fetchData() {\n await fetch(\"monlien\");\n //attend que le await soit exécuté avant de faire la suite\n\n await executeFonction();\n}", "title": "" }, { "docid": "668e0b8f76ed879f748f50e9af53eaf8", "score": "0.5886846", "text": "function fetchData() {\n // TODO\n \tfetch('examples/data.json')\n\t\n\t.then(validateResponse)\t\n\t.then(readResponseAsJSON)\t\n\t.then(showData)\t\n\t.catch(logError);\n\n}", "title": "" }, { "docid": "e79325bd23a21f5d8d640926346643e7", "score": "0.58673644", "text": "async function fetch()\n {\n jsonData = await FetchPatient(req, res);\n }", "title": "" }, { "docid": "0214461025a76b6c36c49d134f773b48", "score": "0.58577573", "text": "async _fetch(opts) {\n opts = _.extend({\n method: 'GET',\n url: null,\n body: null,\n callback: null\n }, opts);\n\n var reqOpts = {\n method: opts.method,\n headers: {\n }\n };\n \n if (this._sessionToken) {\n reqOpts.headers['Authorization'] = 'Bearer ' + this._sessionToken;\n }\n\n if (opts.method === 'POST' || opts.method === 'PUT') {\n reqOpts.headers['Accept'] = 'application/json';\n reqOpts.headers['Content-Type'] = 'application/json';\n }\n\n if (opts.body) {\n reqOpts.body = JSON.stringify(opts.body);\n }\n\n return await fetch(this.API_BASE_URL + opts.url, reqOpts);\n\n }", "title": "" }, { "docid": "0bca11817963c13aafe7a64a73cd23a0", "score": "0.5840621", "text": "async function fetchData(url) {\n\n //Skickar anropet till webbservern och väntar på svar\n //Svaret kommer och man tar ut json datat\n let promise = await fetch(url).then(res => res.json());\n\n //Returnera json från funktionen\n return promise;\n\n}", "title": "" }, { "docid": "5aae450bbcfb4f44c414bdfcd481e673", "score": "0.5826819", "text": "pingAPI() {\n let request = new Request(site + \"/ping\", {\n method: \"GET\",\n headers: new Headers({\n \"Content-Type\": \"application/json\",\n }),\n });\n fetch(request).catch(function (err) {\n console.log(err);\n });\n }", "title": "" }, { "docid": "b55c7f52a1fb098a8b2702c8b1bd4997", "score": "0.5820913", "text": "doFetch(serverurl) {\n this.loading = true;\n return fetch(serverurl)\n .then(result => result.json())\n .then(this.processDataFromAPI)\n .then((data) =>{\n this.loading = false;\n return data;\n })\n .catch(function (e) {\n console.log(e);\n });\n }", "title": "" }, { "docid": "b6888c8259b46dbbaeb494b9d7d29c50", "score": "0.57752216", "text": "async function getComFromServer() {\n const request = new Request('http://localhost:3002/story/', {\n method: 'GET',\n headers: new Headers({\n Accept: 'application/json',\n 'Content-Type': 'appliaction/json',\n }),\n })\n const response = await fetch(request)\n const data = await response.json()\n const comments = data.rows\n // const totalpages = data.totalPage\n setCom(comments)\n // setPage(totalpages)\n //console.log(data.rows)\n }", "title": "" }, { "docid": "d44894689dc129665cbd494b5ce6570f", "score": "0.577072", "text": "function fetchData(url){\n return fetch(url)\n .then(response => response.json())\n .catch(err => console.log(err))\n }", "title": "" }, { "docid": "ee23752021fd450d00ee57b346336f73", "score": "0.57656807", "text": "async get(url){\n // *** await : yni await fetch(url); sabr kon ta kamel ejara bshe bad brx toye reponse\n let response = await fetch(url);\n let users = await response.json();\n return users;\n }", "title": "" }, { "docid": "8d95bfca7eeb3552d3833c813d226577", "score": "0.575034", "text": "static async fetchAll() {\n try {\n const todos = await fs.readFileAsync(p);\n return JSON.parse(todos);\n } catch (e) {\n console.error(e);\n }\n }", "title": "" }, { "docid": "ba10a837dde889b5949f8d7703f6d126", "score": "0.57377076", "text": "hitServer() {\n return fetch('http://54.213.83.132/hackoregon/http/oregon_individual_contributors/5/')\n .then(response => response.json())\n .then(data => this.setState({ data: data }))\n .catch(error => console.log(error))\n }", "title": "" }, { "docid": "02aa7eb30192688c1d8d1870f615763d", "score": "0.5733592", "text": "async request (path) {\n const headers = {\n 'User-Agent': this.config.userAgent\n }\n const url = this.config.apiHostName + path;\n return fetch(url, { headers }).then(res => res.json())\n }", "title": "" }, { "docid": "3938cd75c1b9c3d410587660e870d990", "score": "0.57286036", "text": "async function fetchData(url)\n{\n //Skickar anropet till webbservern och väntar på svar\n let promise = await fetch(url);\n\n //Svaret kommer och man tar ut json datat\n let data = await promise.json();\n\n //Returnera json från funktionen\n return data;\n\n}", "title": "" }, { "docid": "0b870cf34598c31abf236660c1fb9f65", "score": "0.57261664", "text": "async function get(){\n \n}", "title": "" }, { "docid": "edb6c8971b17173c7dc7385364514aaa", "score": "0.57174796", "text": "getComments(){\n return fetch(`${url}comments`)\n .then(res=>res.json())\n .then(res=>res)\n }", "title": "" }, { "docid": "af88ff440e2d54d3df3a3fed8ab58391", "score": "0.57109404", "text": "get(url){\n return new Promise((resolve,reject)=> {\n fetch(url)\n .then(res=>res.json())\n .then(data=>resolve(data)) //we can just return it without consoling\n .catch(err=>reject(err));\n }); \n \n }", "title": "" }, { "docid": "a23724fe75827322bc1c0f185b433fb7", "score": "0.5693509", "text": "get(url) {\n // Need to wrap fetch in a Promise to return the values instead of simply logging them\n return new Promise((resolve, reject) => {\n // We call resolve when we went to send the intended response and reject when we want to throw an error \n fetch(url)\n .then(response => response.json())\n .then(jsonData => resolve(jsonData)) //returns promise\n .catch(err => reject(err));\n })\n }", "title": "" }, { "docid": "fd09e39694a53376ed6b3a7a9364b46b", "score": "0.56927377", "text": "function getPosts(){\n return fetch('http://jsonplaceholder.typicode.com/posts');\n}", "title": "" }, { "docid": "861237556be95e7e512a61c1d52f132c", "score": "0.5691376", "text": "function fetchNode_food(){\n\tcallAjax(\"GET\", initialize_food, {\"action\": \"get_food\"});\n}", "title": "" }, { "docid": "a9b36dbdea1f84acce00e18151c1c849", "score": "0.5688582", "text": "async function fetchasync(uri) {\n\tlet response = await fetch(uri, {mode: 'no-cors'});\n\treturn await response.json();\n}", "title": "" }, { "docid": "850e95dad0dd6bcc01e5bde415e447a2", "score": "0.56764746", "text": "function quickFetch(url, func, param){\n fetch(url)\n .then(function(response){\n if (response.status !== 200){\n console.log('There was an error with your fetch. Response was not 200.')\n }\n return response.json()\n })\n .then(function(data){\n param = data;\n func(param)\n })\n}", "title": "" }, { "docid": "953e72a5b88582331d0381c7357ab5e0", "score": "0.56723493", "text": "get(url){\n return new Promise((resolve, reject)=> {\n //fetch itself returns a promise\n fetch(url)\n //map it to json\n .then(res => res.json())\n .then(data => resolve(data))\n .catch(err => reject(err))\n })\n }", "title": "" }, { "docid": "1595bac8cdf400c6e7877e5a7b7055c3", "score": "0.56721383", "text": "async fetchUser(context) {\n const res = await fetch(\"https://showtimelespetitsmusclesback.herokuapp.com/users\", {\n \"method\": \"GET\",\n\n })\n const data = await res.json();\n context.commit(\"setUserList\", data);\n // console.log(data)\n }", "title": "" }, { "docid": "0be41b54ed7bfe343b40af4ce1cdb93e", "score": "0.5670334", "text": "fetch(callback) {\n this._setWantSubscribe('fetch', callback)\n }", "title": "" }, { "docid": "2ad01c495a6167eeebf23b3299ee3745", "score": "0.56687695", "text": "async fetchFile({ path }) {\n const url = `${HACKY_SERVER_SOURCE_BASE}/${path}`;\n\n const resp = await this._cachingFetch(url);\n const data = await resp.json();\n\n return data;\n }", "title": "" }, { "docid": "5e53a393ab1019f40f764f5be6138f71", "score": "0.56627953", "text": "loadDatabaseInfo() {\r\n return fetch(\"http://localhost:8088/contacts\").then(response => response.json())\r\n }", "title": "" }, { "docid": "619584bce2aca2c42e5147f332342797", "score": "0.5657589", "text": "buscaDaConta() {\n return fetch(\"./usuario.json\", { method: \"get\" })\n }", "title": "" }, { "docid": "fb1d92313fee6afcc5fc3d3fb83c806d", "score": "0.56537366", "text": "async bodyOperation(url, data, operation){\n const results = await fetch(url,{\n method: operation,\n body: data\n })\n .then((response) => response.json())\n .catch((error) => {\n console.error(error);\n alert(error);\n });\n return results;\n }", "title": "" }, { "docid": "4c674fa9c70abb15848bd741fe663c6c", "score": "0.56422794", "text": "function fetch (opts, then) {\n var url = fetch_query(opts);\n var body = \"\";\n var headers = { 'User-Agent': Defaults.agent\n , 'Content-Type': Defaults['content-type']\n , 'Content-Length': 0\n , 'Accept': Defaults.accept };\n\n var req ={ uri: url, body: body, json: true, headers: headers, method: 'POST'\n , rejectUnauthorized: false };\n return request(req, then);\n}", "title": "" }, { "docid": "71c51a956bc235e0592729ed40400799", "score": "0.5639504", "text": "hitServer() {\n const self = this;\n return fetch('http://54.213.83.132/hackoregon/http/oregon_individual_contributors/5/')\n .then(function(response) {\n return response.json();\n })\n .then(function(data) {\n self.setState({ data: data })\n })\n .catch(function(error) {\n console.log(error)\n });\n }", "title": "" }, { "docid": "236a4fb4ac18a5ba82f8f3c589d41aa6", "score": "0.5635452", "text": "function fetchData() {\n fetch('https://jsonplaceholder.typicode.com/users')\n .then(validateResponse)\n .then(readResponseAsJSON)\n .then(dataResult)\n .catch(logError);\n}", "title": "" }, { "docid": "c846f4c97e5a7e30894e3815644de019", "score": "0.5634557", "text": "async function fetchData() {\r\n const res = await fetch(spaceXUrl)\r\n const data = await res.json()\r\n}", "title": "" }, { "docid": "ca65e3112d8e35ebc8a6599237350013", "score": "0.5633419", "text": "fetchContent({path, owner, repository, decode}){\n return this.getData({path:`/repos/${owner}/${repository}/contents/${path}`})\n .then(response => {\n if(decode==true) {\n response.data.contentText = new Buffer(response.data.content, response.data.encoding).toString(\"ascii\")\n }\n return response.data;\n });\n }", "title": "" }, { "docid": "97fc3a3bc4654afb5b30889d7866ec56", "score": "0.56287813", "text": "async function getData(url){ //asincronismos\n const response = await fetch(url);//petición gracias a que ees asincroma \n // podemos guardar el resultado en una variable para traer la promesa y se envuelve \n const data = await response.json();\n return data; //retorna los datos de las peliculas \n }", "title": "" }, { "docid": "7e3d01b9b35ce3c8495cf75492889665", "score": "0.5625087", "text": "root() {\n return fetch(this.url);\n }", "title": "" }, { "docid": "95b84556961846de3eadd5c47201286d", "score": "0.5621371", "text": "function fetchAndParse(gexf_url, callback) {\n if (typeof callback === 'function') {\n return fetch(gexf_url, function (gexf) {\n callback(Graph(gexf));\n });\n } else return Graph(fetch(gexf_url));\n }", "title": "" }, { "docid": "d4c57a89966a8a49c671eb197e126e04", "score": "0.56205416", "text": "fetchDefault() {\n \n var that = this;\n return new Promise(function (resolve, reject) {\n\n var filePath = path.join(labelsDir, 'widget.json');\n \n fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){\n if (err) {\n winston.error('Error getting labels', err);\n return reject({ msg: 'Error reading object.' });\n }\n winston.debug('label fetched', data);\n return resolve(JSON.parse(data));\n });\n });\n}", "title": "" }, { "docid": "2477c0f12dd5a3f605dd17f0b7d27fb5", "score": "0.5617318", "text": "_fetch(url) {\n fetch(url).then(res => {\n if(res.status === 200) {\n return res.text();\n } else {\n throw new Error(res.status);\n }\n })\n .then(text => {\n text = text.replace(/whhuanan/g, '\"whhuanan\"');\n this.response = JSON.parse(text);\n const responseEvent = new CustomEvent('swapi-response', {\n detail: this.response\n });\n this.dispatchEvent(responseEvent);\n }).catch(e => {\n const responseEvent = new CustomEvent('swapi-error', {\n detail: {\n code: e,\n sourse: 'request'\n }\n });\n this.dispatchEvent(responseEvent);\n });\n }", "title": "" }, { "docid": "ea6c936e65c3bb8ad19fdc86b937c68a", "score": "0.5614909", "text": "async function fetchNews(req, res) { \n main.run(req.params && req.params.owner, req.query.persist)\n .then(news => {\n console.log('Sync successful', JSON.stringify(news)); \n res.status(200).json({\"status\":\"success\", \"news\": news});\n })\n .catch(error => {\n console.error(`Sync failed ${error.message}`, error); \n res.status(200).json({\"status\":\"failed\", \"cause\": error.message});\n });\n}", "title": "" }, { "docid": "e432e028880d1d8ceb853788637e297a", "score": "0.5613312", "text": "async function callFetchWithGets3(){\n let headers = new Headers();\n const options = {\n method : 'GET',\n mode: 'cors',\n headers: headers\n }\n const output = document.getElementById(\"json3\");\n const response = await fetch(`${url}${'soundtrack/Guitar_hero/'}`, options);\n\n if (response.status >= 200 && response.status <= 300){\n console.log(\"Funcionou/GET\");\n output.innerHTML = await response.text();\n } else {\n console.log(\"Deu errado\");\n }\n}", "title": "" }, { "docid": "bce0b02fb353ac11f21a688bc658a936", "score": "0.5610142", "text": "function doFetch(theurl, response) {\n var foundHeader = \"\";\n console.log(\"DEBUG: full path = \" + WORKDIRECTORY + theurl.substr(7));\n theurl = theurl.substr(6);\n var extension = theurl.indexOf('.') + 1;\n var extensionValue = theurl.substr(extension);\n // Loop through the VALIDEXT array to find the matching header for the extension\n for (i=0; i<VALIDEXT.length; i++) {\n if (extensionValue == VALIDEXT[i][0]) {\n\t foundHeader = VALIDEXT[i][1];\n }\n }\n response.setHeader(\"Content-Type\", foundHeader);\n return new Promise((resolve, reject) => {\n fs.readFile(WORKDIRECTORY + theurl.match(FILE)[0], (err, data) => {\n // If there is an error, write an error message to the response\n if (err) {\n var errorMessage =\n \"ERROR: unable to fetch URL \" + theurl.match(FILE)[0];\n console.log(errorMessage);\n\tresponse.statusCode = 403;\n response.write(errorMessage + '\\n');\n response.statusMessage = errorMessage;\n resolve(errorMessage);\n // Else, write a message to the response that the file was fetched\n } else {\n var fetchedMessage =\n \"FETCH: the URL \" + theurl.match(FILE)[0] + \" was fetched.\";\n response.statusCode = 200;\n response.statusMessage = fetchedMessage;\n response.write(data);\n resolve(fetchedMessage);\n }\n });\n });\n}", "title": "" }, { "docid": "efde251b0d46eaa870a6aadb25e17e83", "score": "0.5610089", "text": "getProfile(){\n fetch('/profile', {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n \n })\n\n\n}", "title": "" }, { "docid": "56f943552f454d4cef06d5070955f17b", "score": "0.56079817", "text": "fetchGET(link) {\n const headers = this.getHeaders();\n return fetch(link, { headers: headers }).then(response => {\n if (response.ok) {\n return response.json();\n }\n });\n }", "title": "" }, { "docid": "1f7c72d1d75db0ef98dc5a5881579fa9", "score": "0.5607345", "text": "bodyOperation(url, data, operation){\n fetch(url,{\n method: operation,\n body: data\n })\n .then((response) => response.json())\n .then((response)=> alert(JSON.stringify(response)))\n .catch((error) => {\n console.error(error);\n });\n}", "title": "" }, { "docid": "1c67d540a7ac20cfe61431de7d015dbb", "score": "0.5605631", "text": "async function fetchDevel() {\n const module = await import(\"./lib/fetchDevel.js\");\n return module.default;\n}", "title": "" }, { "docid": "12e6b2cfff2cc67c8c5c1659f3630544", "score": "0.55877453", "text": "async load() {\n \n }", "title": "" }, { "docid": "cfe42e0f3d5e84d8216606d69af862fa", "score": "0.5582634", "text": "fetchUserInformation() {\n return {\n remote()\n {\n \treturn new Promise(function (resolve, reject) {\n\t\t\t\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\t\t\t\txhr.open('GET', \"http://localhost:2643/api/userInformation\", true);\n\t\t\t\t\t\txhr.setRequestHeader(\"Accept\", \"application/json\");\n\t\t\t\t\t\txhr.setRequestHeader(\"Access-Control-Allow-Origin\", \"*\");\n\t\t\t\t\t\txhr.onload = function () {\n\t\t\t\t\t\tif (xhr.status == 200) {\n\t\t\t\t\t\tvar data =xhr.responseText;\n\t\t\t\t\t//\tconsole.log(data);\n\t\t\t\t\t\n\t\t\t\t\tif(true){\n\t\t\t\t\t\t\t\t//console.log(JSON.parse(data));\n\t\t\t\t\t\t\t\tvar user = JSON.parse(data);\n\t\t\t\t\t\t\t\tresolve(user);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\treject('Something went wrong!!');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t};\n\t\t\t\t\txhr.send();\n });\n },\n local() {\n return null;\n },\n\n \tsuccess: UserAction.fetchUser\n \n \n }\n\t}", "title": "" }, { "docid": "e37c0d2d936c836283c04b033a404c39", "score": "0.5582242", "text": "function fetchData(url, page) {\n console.log(\"fetching\" + url);\n fetch(url, {\n headers: {\n \"X-Auth-Token\": \"bddc8f1b00114b5683e99c5eea4268ac\"\n },\n //mode: \"cors\"\n })\n .then(function (response) {\n document.body.style.cursor = 'wait'\n console.log(response)\n return response.json()\n })\n .then(function (myJson) {\n document.body.style.cursor = 'auto'\n ProcessAndRender(myJson, page);\n })\n .catch(err => console.log(err))\n}", "title": "" }, { "docid": "c17e2ddb04af1be9f1e6366d6a6475c0", "score": "0.55801517", "text": "async ResourceExternalSelected(url,method,body){\r\n const st=this.setting\r\n let headers = new Headers(); \r\n headers.append('Content-Type', 'application/json');\r\n headers.set('Authorization', 'Basic ' + Buffer.from(st.user + \":\" + st.password).toString('base64'));\r\n return fetch(url, \r\n {\r\n method,\r\n headers,\r\n body\r\n })\r\n }", "title": "" }, { "docid": "70eb039a3cfef4c70bf98c3594e9292c", "score": "0.5577527", "text": "function getFetch(url)\n{\n return fetch(url)\n .then(res =>res.text())\n .then(data =>{\n return JSON.parse(data);\n })\n .catch(()=>{\n return null;\n });\n}", "title": "" }, { "docid": "4c50a1d28771d97198b4978e52c8c4c6", "score": "0.5571767", "text": "function fetching(url, gotData){\n fetch(url)\n .then(req => req.json())\n .then(data => {\n gotData(data)\n } )\n}", "title": "" }, { "docid": "6cc2fa4b3df2404462865557948f758b", "score": "0.5571282", "text": "fetchResult() {\n let encodedExpr = encodeURIComponent(this.state.expression.toLowerCase()); //take user input & encode expression into URL format\n const url = `https://newton.now.sh/api/v2/${this.state.operation}/${encodedExpr}`\n fetch(url) \n .then(res => res.json()) //turn results to JSON obj\n .then(({ operation, expression, result }) => { //Use arrow function to unbind 'this', so 'this' refers to the instance of UserInput object as defined above \n this.setState({\n isLoaded: true,\n result\n })\n })\n .catch((error) => this.setState({ error }))\n }", "title": "" }, { "docid": "9d33732682bab41f6031f668c8f74e99", "score": "0.5570727", "text": "function networkCall() {\n return {\n type: 'GET_COLLECTION_CONTENT',\n promise: () => {\n return new Promise((resolve, reject) => {\n fetch({\n url: 'example.com/api',\n type: 'GET',\n });\n });\n },\n };\n}", "title": "" }, { "docid": "90211aff038e2265edc6f900404d4e79", "score": "0.5559634", "text": "async function callFetchWithGets2(){\n let headers = new Headers();\n const options = {\n method : 'GET',\n mode: 'cors',\n headers: headers\n }\n const output = document.getElementById(\"json2\");\n const response = await fetch(`${url}${'soundtrack/Madden_NFL_10/'}`, options);\n\n if (response.status >= 200 && response.status <= 300){\n console.log(\"Funcionou/GET\");\n output.innerHTML = await response.text();\n } else {\n console.log(\"Deu errado\");\n }\n}", "title": "" }, { "docid": "5c27ceb5a868da30987d2750982075f6", "score": "0.55563545", "text": "async fetch(params) {\n const opts = _.extend({\n method: 'GET',\n url: null,\n body: null,\n callback: null,\n }, params);\n\n const reqOpts = {\n method: opts.method,\n headers: {\n },\n };\n\n if (this.sessionToken) {\n reqOpts.headers.Authorization = `Bearer ${this.sessionToken}`;\n }\n\n if (opts.method === 'POST' || opts.method === 'PUT') {\n // reqOpts.headers.Accept = 'application/json';\n reqOpts.headers['Content-Type'] = 'application/json';\n }\n\n if (opts.body) {\n reqOpts.body = JSON.stringify(opts.body);\n }\n\n const url = this.API_BASE_URL + opts.url;\n const res = {};\n\n const response = await fetch(url, reqOpts);\n res.status = response.status;\n res.headers = response.headers.map;\n\n const contentType = response.headers.get('content-type');\n if (!_.isNull(contentType) && contentType.indexOf('application/json') !== -1) {\n return response.json()\n .then((json) => {\n res.data = json;\n return res;\n })\n .catch(() => res);\n }\n\n return response.text()\n .then((text) => {\n res.data = text;\n return res;\n })\n .catch(() => res);\n }", "title": "" }, { "docid": "dcea635e003207d4f6ac6bff0191420c", "score": "0.5555928", "text": "function loadWithAPI(url) {\n\treturn fetch(url)\n}", "title": "" }, { "docid": "ac9296bd2ceee88ba6b3901f4e6a3e84", "score": "0.55527914", "text": "async fetchUser({commit},id){\nvar myHeaders = new Headers();\nmyHeaders.append(\"Authorization\", `Bearer ${token}`);\n\nvar requestOptions = {\nmethod: 'GET',\nheaders: myHeaders,\n\nredirect: 'follow'\n};\n\nfetch(`${url}/users/${id}`, requestOptions)\n.then(response => response.json())\n.then(result => {\n commit('UserById',result);\n \n\n})\n.catch(error => console.log('error', error));\n }", "title": "" }, { "docid": "f2c20fef7c4b038a5c7c651454e2ebb0", "score": "0.5536147", "text": "storeGet(name) {\n console.log('Game : storeGet : enter : name : '+name);\n \n fetch('/cwords/name/'+name)\n .then(\n response => {\n return response.json();\n }\n )\n .then(\n data => {\n console.log('Game : storeGet : fetch : data : ...'+JSON.stringify(data)+'...');\n let cwObj = JSON.parse(data.contents)\n this.resultGet(cwObj, true, name);\n }\n )\n .catch(\n err => {\n console.log('Game : storeGet : catch : err as json : ...'+JSON.stringify(err)+'...');\n console.log('Game : storeGet : catch : err as string : ...'+err+'...');\n console.log('Game : storeGet : catch : err as err : ...'+err.message+'...'+err.stack+'...');\n this.resultGet(null, false, name);\n }\n ) \n }", "title": "" }, { "docid": "8fba7cbe54ccbc0ad69dbc1da57f481c", "score": "0.5535644", "text": "function getdetail(updatedurl){\r\n fetch(updatedurl).then(res =>{\r\n return res.json()\r\n }).then(data => {\r\n main(data)\r\n }).catch(err =>{\r\n console.log(err)\r\n })\r\n}", "title": "" }, { "docid": "2a53e9535dc7bdbac3ddf310034d256d", "score": "0.55310786", "text": "async function fetch1(){\r\n const response = await fetch('https://jsonplaceholder.typicode.com/todos');\r\n const data =await response.json();\r\n console.log(data);\r\n}", "title": "" }, { "docid": "c6e1066557c7e699ba9d69dfb3e11d1b", "score": "0.5527693", "text": "function fetch(request, response, type, err, content)\n{\n var url = request.url.toLowerCase();\n var contents = arrayBufferToString(content);\n\n if(isSearch(url))\n {\n searching.bridge(request, response, type, err, contents);\n }\n else if(url.indexOf(\"person\") >= 0)\n {\n person.bridge(request, response, type, err, contents);\n }\n else if(url.indexOf(\"duchy\") >= 0)\n {\n duchy.bridge(request, response, type, err, contents);\n }\n else if(url.indexOf(\"county\") >= 0)\n {\n county.bridge(request, response, type, err, contents);\n }\n else if(url.indexOf(\"barony\") >= 0)\n {\n barony.bridge(request, response, type, err, contents);\n }\n else if(url.indexOf(\"manor\") >= 0)\n {\n manor.bridge(request, response, type, err, contents);\n }\n else if(url.indexOf(\"kingdom\") >= 0)\n {\n kingdom.bridge(request, response, type, err, contents);\n }\n else if(url.indexOf(\"library\") >= 0)\n {\n library.bridge(request, response, type, err, contents);\n }\n else if(url.indexOf(\"catalogue\") >= 0)\n {\n catalogue.bridge(request, response, type, err, contents);\n }\n else if(url.indexOf(\"cinema\") >= 0)\n {\n cinema.bridge(request, response, type, err, contents);\n }\n else if(url.indexOf(\"television\") >= 0)\n {\n television.bridge(request, response, type, err, contents);\n }\n else if(url.indexOf(\"theology\") >= 0)\n {\n theology.bridge(request, response, type, err, contents);\n }\n else if(url.indexOf(\"philosophy\") >= 0)\n {\n philosophy.bridge(request, response, type, err, contents);\n }\n else fail(response, NotFound, \"Bad database request.\");\n}", "title": "" }, { "docid": "081fb03c18956a09a5689069dfd0bfe6", "score": "0.5524452", "text": "async fetch(URI, method, data) {\n let params = {\n method: method,\n headers: MoulinetteClient.HEADERS\n }\n if( data ) { params.body = JSON.stringify(data) }\n\n const response = await fetch(`${MoulinetteClient.SERVER_URL}${URI}`, params).catch(function(e) {\n console.log(`MoulinetteClient | Cannot establish connection to server ${MoulinetteClient.SERVER_URL}`, e)\n });\n return response\n }", "title": "" }, { "docid": "900e2a3afa6499fa9651f57c39d2bf68", "score": "0.5521483", "text": "function genFetch(url) {\n let status = \"pending\";\n let result;\n let suspender = fetch(url)\n .then((res) => res.json())\n // Fetch request has gone well\n .then((success) => {\n status = \"fulfilled\";\n result = success;\n })\n // Fetch request has failed\n .catch((error) => {\n status = \"rejected\";\n result = error;\n });\n\n const read = () => {\n if (status === \"pending\") {\n throw suspender; // Suspend(A way to tell React data is still fetching)\n } else if (status === \"rejected\") {\n throw result; // Result is an error\n } else if (status === \"fulfilled\") {\n return result; // Result is a fulfilled promise\n }\n };\n\n return { read }\n}", "title": "" }, { "docid": "767549c3a37ff871301d4f5083f83365", "score": "0.5518974", "text": "function doFetchSimple(url) {\n var _this14 = this;\n\n return new Promise(function (resolve, reject) {\n _this14.GetSimple(url, resolve, reject);\n });\n }", "title": "" }, { "docid": "8907b82fda9879d81301918a9a871420", "score": "0.5502359", "text": "async function fetchAndDecode(url, type) {\r\n\r\n let content;\r\n const response = await fetch(url);\r\n if (!response.ok) {\r\n throw new Error(`HTTP error! status: ${response.status}`);\r\n }\r\n if (type === 'blob') {\r\n content = await response.blob(); // contecnt is the blob\r\n } else if (type === 'text') {\r\n content = await response.text(); // content is the text\r\n }\r\n return content; //since the function has an async keyword on it, it will return a promise which is resolved with content \r\n \r\n}", "title": "" }, { "docid": "2d9a89644a89287e410131fe3ff041ce", "score": "0.5500682", "text": "async function cargarUrl(url){\n let respuesta =await fetch(url);\n return respuesta.json();\n\n}", "title": "" }, { "docid": "a987c72814fbd8285746c925e556b865", "score": "0.54985064", "text": "function loadBase() {\n fetch('../base')\n .then((response) => {\n return response.json();\n })\n .then((commands) => {\n commands.msg.forEach((command) =>{\n eval(command);\n })\n });\n}", "title": "" }, { "docid": "f50405bb96c0749a7d5000dbd35bf4a7", "score": "0.5496885", "text": "async fetchRemoteData() {\n if (this.alreadyFetched || !this.dcid) {\n return;\n }\n\n await getRemotePropertyLabels(this.dcid).then(async (allLabels) => {\n await this.createAssertionsFromLabels(allLabels.outLabels,\n /* isInverse */ false);\n await this.createAssertionsFromLabels(allLabels.inLabels,\n /* isInverse */ true);\n });\n this.alreadyFetched = true;\n }", "title": "" }, { "docid": "307341319f390ddcfa14c1ab7f4a43a5", "score": "0.54953843", "text": "fetch() {\n this.getCode();\n }", "title": "" }, { "docid": "c4c707dcc36736b5fa9fb1704677071a", "score": "0.54917294", "text": "async function callFetchWithGet(){\n let headers = new Headers();\n const options = {\n method : 'GET',\n mode: 'cors',\n headers: headers\n }\n const output = document.getElementById(\"json\");\n const response = await fetch(`${url}${'cantores/'}`, options);\n\n if (response.status >= 200 && response.status <= 300){\n console.log(\"Funcionou/GET\");\n output.innerHTML = await response.text();\n } else {\n console.log(\"Deu errado\");\n }\n}", "title": "" }, { "docid": "24ad94ac802f4847437746665005fd81", "score": "0.5490612", "text": "function load_github_content(locals, name, path, host) {\n locals.content[name]=\"Content not found\";\n if (!host) host=\"raw.githubusercontent.com\";\n\ttry {\n var url = \"https://\" +host + \"/\" + path;\n request(url,{\n headers: {'User-Agent': 'neo4j.org',accept:'application/vnd.github.VERSION.raw'},\n auth : {user:github_personal_token,pass:'x-oauth-basic'}, encoding:\"UTF-8\"\n },function(err,res,data) {\n if (err) {\n console.log(\"Error loading content for\",name,host,path,err);\n locals.content[name]=\"Content from http://\"+host+\"/\"+path+\" not loaded!\";\n return;\n }\n// console.log(\"response for\",url,res.headers);\n // todo store res.headers.etag for conditional requests to save rates\n //\n locals.content[name] = data;\n });\n\t} catch(e) {\n\t\tconsole.log(\"Error loading content for\",name,host,path,e)\n\t\tlocals.content[name]=\"Content from http://\"+host+\"/\"+path+\" not loaded!\";\n\t}\n}", "title": "" }, { "docid": "aed0460cf3980907fb5c72071e181d12", "score": "0.54901916", "text": "function getNode(nid){\n $.get(url+\"/node/\"+nid+\"?_format=hal_json\").done(function(response){\n console.info(response);\n });\n }", "title": "" }, { "docid": "55ef7ea5443c3ec78639eecfd593401b", "score": "0.5489562", "text": "async function request(url) {\n\t\ttry {\n\t let result = await fetch(url);\n\t \tlet data = await result.text();\n\t\t\t\treturn data;\n\t\t\t\t\t} catch(err) {\n\t \t\t\t// catches errors both in fetch and result\n\t\t\t\t\t\talert(err);\n \t\t\t\t\t}\n\t}", "title": "" }, { "docid": "b9e0b28aeceff0db0c07d37bff982769", "score": "0.5481321", "text": "fetchJsonPromise(filename) {\n const resourceUrl = this.state.textCategory + filename;\n const jsonPromise = new Promise((resolve) =>\n resolve(fetch(resourceUrl)\n .then(res => res.json())));\n return jsonPromise;\n }", "title": "" }, { "docid": "477294eaeccd5aeb6a2bd1b739d0b8a1", "score": "0.54805505", "text": "function getPosts() {\n return fetch(\"https://jsonplaceholder.typicode.com/posts\");\n}", "title": "" }, { "docid": "37ecce3146ba0c482e8f1ec337a1307e", "score": "0.54785275", "text": "function networkFetch(url) {\r\n return `${url} - Response from network`;\r\n}", "title": "" }, { "docid": "1e22b657eec2996596c4cc7400f3da3d", "score": "0.54750633", "text": "function fetch(request, response, type, err, contents)\n{\n \"use strict\";\n var query = \"SELECT * FROM FILM ORDER BY topTen DESC, rank DESC;\";\n\n db.all(query, ready);\n\n function ready(err, data)\n {\n if(err) throw err;\n makeCinema(response, type, err, contents, data);\n }\n}", "title": "" }, { "docid": "79f999fa63c457584f48241db93074c6", "score": "0.54743975", "text": "function getFetch(uri) {\n return _fetchWithSession(uri);\n}", "title": "" }, { "docid": "2dc6047d430b8c1f09c916ed0a77db7a", "score": "0.54737955", "text": "_transport(...args) {\n return window.fetch(...args);\n }", "title": "" }, { "docid": "5057e9f66a8b841aed5c9578f4dc1c46", "score": "0.54737103", "text": "async load (address) {}", "title": "" }, { "docid": "a34931681f546549ba98d94d27ac9e82", "score": "0.5464519", "text": "async function fetch(url) {\n const { data } = await axios.get('https://app.scrapingbee.com/api/v1', {\n params: {\n 'api_key': SCRAPINGBEE,\n 'url': url\n }\n })\n return cheerio.load(data)\n}", "title": "" }, { "docid": "c4279f67b3c595367aa2e2916561b5e9", "score": "0.5461216", "text": "function postToOne(){\n var url = 'http://localhost:3001/test/one';\n\n\nfetch(url, {\n method: 'POST', //1 we are feching a new url. the rouft in the server haneldes a POST request, so our metheod is POST. Remember that the two must match the route request and the method.\n headers: new Headers({\n 'Content-Type': 'application/json'\n })\n}).then(\n function(response){ //2 WE pass the response into a Promise that returns the response as plain text. \n return response.text()\n })\n .catch(\n function(error){ //3 We handled an error, of an error comes back\n console.log('Error:', error)\n })\n .then(function(response){ //4 In the final then(), we simply proint the plain text response to the console\n console.log('Success:', response)\n })\n}", "title": "" } ]
820481ae43f373cd12a9b1d1606b1ca1
Force a specific size of the canvas
[ { "docid": "7ae3e581e9c0ed9639f5288f197452df", "score": "0.0", "text": "setSize(width, height, forceSetSize = false) {\n if (!this._renderingCanvas) {\n return false;\n }\n width = width | 0;\n height = height | 0;\n if (!forceSetSize && this._renderingCanvas.width === width && this._renderingCanvas.height === height) {\n return false;\n }\n this._renderingCanvas.width = width;\n this._renderingCanvas.height = height;\n return true;\n }", "title": "" } ]
[ { "docid": "16684ed910a6751cebba59988ec13212", "score": "0.76149315", "text": "function sizeCanvas() {\n setCanvasDimensions(window.innerWidth - 8, window.innerHeight - 45);\n\n redraw();\n}", "title": "" }, { "docid": "4422aff9c37e19818b5e088c13ff28ab", "score": "0.7529445", "text": "function Setsize() {\n // delimitar el interior de pantalla\n maxWidth = window.innerWidth;\n maxHeight = window.innerHeight;\n // el ancho y alto se delimita al max medida de arriba\n canvas.width = maxWidth;\n canvas.height = maxHeight;\n}", "title": "" }, { "docid": "a57817f0c0a2d72107d737b4516b6999", "score": "0.7447374", "text": "function setCanvasSize(canvas) {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n }", "title": "" }, { "docid": "6d7abd2aedc37576e9ee1f366fa1abda", "score": "0.7374521", "text": "function resizeCanvas() {\n canvas.width = canvasContainer.clientWidth;\n canvas.height = canvasContainer.clientHeight - 4;\n}", "title": "" }, { "docid": "afe577cd4278ee7d46f93e9ec49a924a", "score": "0.73578", "text": "function resizeCanvas(){\r\n \tif(canvasContainer!=undefined){\r\n\t\tcanvasContainer.scaleX=canvasContainer.scaleY=scalePercent;\r\n\t}\r\n}", "title": "" }, { "docid": "9e01ec319faeca9b642685cd7ff260d1", "score": "0.72624964", "text": "function setsize() {\n win_width = window.innerWidth;\n win_height = window.innerHeight;\n canvas.width = win_width;\n canvas.height = win_height;\n}", "title": "" }, { "docid": "6554dcae8b97d433ff4d77527d9b96e9", "score": "0.71787804", "text": "function resetCanvasSize(cWidth, cHeight, canvas)\n{\n canvas.width = cWidth;\n canvas.height = cHeight;\n}", "title": "" }, { "docid": "100dff827b679602f8555e00452e88df", "score": "0.7164043", "text": "_resizeCanvas() {\n this.canvas.width(window.innerWidth - 1 + 'px');\n this.canvas.height(window.innerHeight - 1 + 'px');\n }", "title": "" }, { "docid": "2d0cfab372309cb277c1338f7c298d7a", "score": "0.71539307", "text": "function resizeHandler() {\n\tcanvas.height = HH;\n\tcanvas.width = WW;\n}", "title": "" }, { "docid": "a8b51c4054b1efe8258ecebd74dd764d", "score": "0.7094128", "text": "function canvasResizing()\n {\n var w = $(\"#canvas_area\").width();\n var h = $(\"#canvas_area\").height();\n $(\"#canvas\").attr(\"width\", w); \n $(\"#canvas\").attr(\"height\", h); \n $(\"#canvas\").css(\"width\", w);\n $(\"#canvas\").css(\"height\", h);\n CommonManager.setClientWidth(w);\n CommonManager.setClientHeight(h);\n Adp.GL.viewport(0, 0, w, h);\n }", "title": "" }, { "docid": "0e7e4ca8cd30f1ff5da4d5aaf919e640", "score": "0.70904577", "text": "function setCanvasSize() {\r\n var windowWidth = window.innerWidth;\r\n var windowHeight = window.innerHeight;\r\n\tif (resolutionScale) {\r\n\t\tcanvas.width = resolutionScale*windowWidth;\r\n\t\tcanvas.height = resolutionScale*windowHeight;\r\n\t}\r\n\telse {\r\n\t\tcanvas.width = windowWidth;\r\n\t\tcanvas.height = windowHeight;\r\n\t}\r\n\tcanvas.style.width = windowWidth+\"px\";\r\n\tcanvas.style.height = windowHeight+\"px\";\r\n}", "title": "" }, { "docid": "57400c885394435aed113def81796055", "score": "0.70779824", "text": "function resizeCanvas(){\n const width = Math.min($(\"#drawDiv\").width(), 750);\n const height = Math.min($(\"#drawDiv\").height(), 1400);\n $(canvas).attr('width', width * 0.9);\n $(canvas).attr('height', Math.max(height * 0.7 - 100, 400));\n }", "title": "" }, { "docid": "2db13294946038eca9b20a306a7889d9", "score": "0.707701", "text": "function setCanvasSize(x,y) {\n ctx.canvas.width = x;\n ctx.canvas.height = y;\n \n // board starts off same size as canvas\n // NOTE: x and y are reversed because Aidan is a freak! :-)\n game.board.width = y;\n game.board.height = x;\n }", "title": "" }, { "docid": "25ae654d8bfd1bb461944874864ed190", "score": "0.7076274", "text": "function resizeCanvas(){\r\n self.canvas.width = window.innerWidth;\r\n self.canvas.height = window.innerHeight;\r\n }", "title": "" }, { "docid": "22a2166d646c0aaad459c6b9e34183dc", "score": "0.70709884", "text": "function setCanvasSize(width, height) {\n gMeme.canvasWidth = 450;\n var ratio = gMeme.canvasWidth / width;\n gMeme.canvasHeight = height * ratio;\n}", "title": "" }, { "docid": "9d184e5c22448947c1a4e4257f6bc7d6", "score": "0.70527613", "text": "function resize_canvas() {\n var relative = document.getElementById(\"soil-layer-form\");\n canvas.width = $(relative).width();\n canvas.height = $(relative).height();\n }", "title": "" }, { "docid": "92e9af435c7816a8d2533b9ba4a35f64", "score": "0.7034364", "text": "function resizeCanvas() {\n canvas.height = window.innerHeight - 5\n canvas.width = window.innerWidth - 5\n}", "title": "" }, { "docid": "bdff0132b187fe4d44b00e6e5c37e642", "score": "0.7032438", "text": "function resizeCanvas() {\r\n canvas.width = window.innerWidth;\r\n canvas.height = window.innerHeight;\r\n if(canvas.width > 500) {\r\n canvas.width = 500;\r\n }\r\n if(canvas.height > 600) {\r\n canvas.height = 600;\r\n }\r\n}", "title": "" }, { "docid": "7f018f9cb1ce2caa5d21de639d0f11cb", "score": "0.7026757", "text": "setCanvasSize() {\n // Set canvas size and scale according to the device pixel ratio\n let dpr = window.devicePixelRatio || 1;\n if (this.resolutionScaling === DROPPED_RES && this.normalisedRendering) dpr *= 0.5;\n dpr *= this.resolutionScaling;\n this.gl.canvas.width = window.innerWidth * dpr;\n this.gl.canvas.height = window.innerHeight * dpr;\n this.gl.viewport(0, 0, this.gl.canvas.width, this.gl.canvas.height);\n }", "title": "" }, { "docid": "8ef3ad3b4b7bd43e38ab89e5dfe0a05c", "score": "0.6995163", "text": "function resizeCanvas() {\n var canvas = document.getElementById('canvas');\n var parent = canvas.parentNode.getBoundingClientRect();\n\n canvas.width = parent.width;\n canvas.height = parent.height;\n}", "title": "" }, { "docid": "cd8806105ea68bc45c2352faaa38cb92", "score": "0.6993842", "text": "function resizeCanvas() {\n\tcanvas.style.width = '100%';\n\tcanvas.style.height = '100%';\n\t\n\tcanvas.width = canvas.offsetWidth;\n\tcanvas.height = canvas.offsetHeight;\n \n sceneManager.onWindowResize();\n}", "title": "" }, { "docid": "ea1f50d12400f0fd744f89cdb06668c2", "score": "0.69702053", "text": "function fitToContainer(){\n canvas.style.width='100%';\n canvas.style.height= canvasHeight + 'px';\n canvas.width = canvas.offsetWidth;\n canvas.height = canvas.offsetHeight;\n }", "title": "" }, { "docid": "4f7f7323094ee37dd0b0121706a65f71", "score": "0.69631803", "text": "function canvasResize(){\n\tscreenWidth = window.innerWidth;\n\n\tcanvasPosition = canvas.getBoundingClientRect(); // Gets the canvas position\n\tcanvas.width = screenWidth - 20;\n}", "title": "" }, { "docid": "9c917f60ab5bcee1f26ade1fb6812333", "score": "0.6950493", "text": "function resize_canvas() {\n\tif (canvas.width != window.innerWidth) {\n\t\tcanvas.width = window.innerWidth;\n\t}\n\n\tif (canvas.height != window.innerHeight) {\n\t\tcanvas.height = window.innerHeight;\n\t}\n}", "title": "" }, { "docid": "01200f0b5f9ea4ac282fd79259471d11", "score": "0.6949752", "text": "function resize(){\n ctx.canvas.width = window.innerWidth*.75;\n ctx.canvas.height = window.innerHeight;\n}", "title": "" }, { "docid": "4b4720d4f01417ea5bedaeaa60ce8490", "score": "0.69376606", "text": "resizeCanvas()\n\t{\n\t\tif(Context.canvas.width != window.innerWidth - 20 || \n\t\t\tContext.canvas.height != window.innerHeight - 50)\n\t\t{\n\t\t\tthis.canvas.width = window.innerWidth - 20;\n\t\t\tthis.canvas.height = window.innerHeight - 50;\n\t\t\tself.mainRect.init(window.innerWidth - 20, window.innerHeight - 50);\n\t\t}\n\t}", "title": "" }, { "docid": "fc2410206b9573db979b65058e7b2f53", "score": "0.6927798", "text": "function updateCanvasSize() {\n w = window.innerWidth;\n h = window.innerHeight;\n canvas.width = w;\n canvas.height = h;\n}", "title": "" }, { "docid": "e4a9bf78890f578fbc39704b8b4c9be2", "score": "0.6919326", "text": "function ResizeCanvasToFit() {\n var sketchHolder = document.getElementById(\"rendering-canvas\");\n if (sketchHolder.offsetWidth != width || sketchHolder.offsetHeight != height) {\n resizeCanvas(sketchHolder.offsetWidth, sketchHolder.offsetHeight);\n }\n}", "title": "" }, { "docid": "39468fbe6b115d5257e34b3ffcb202b5", "score": "0.6909509", "text": "resizeCanvas() {\n\n\t\tthis.canvas.setDimensions({\n\t\t\twidth: window.innerWidth,\n\t\t\theight: window.innerHeight*0.9-28\n\t\t})\n\t\tthis.canvas.calcOffset()\n\t\tthis.canvas.renderAll()\n\t}", "title": "" }, { "docid": "e7018be81afb5e9974ff6eef3d5709f4", "score": "0.6900125", "text": "function setSize(width,height) {\n me.canvas.width = width*me.size;\n me.canvas.height = height*me.size;\n\n }", "title": "" }, { "docid": "f63206a85e64dfc6ae31abe52677a909", "score": "0.6899228", "text": "function canvasResize() {\n canvas.width = canvasDiv.clientWidth * 200 / 390;\n canvas.height = canvasDiv.clientHeight * 400 / 480;\n redraw();\n }", "title": "" }, { "docid": "2a76befab773b8eb05b6ecd517dfcb41", "score": "0.6896869", "text": "resizeCanvas() {\n this.canvas.width = $('#canvasContainer')[0].clientWidth;\n }", "title": "" }, { "docid": "19f8e4cfd82bbb94ce0abebbbf721afe", "score": "0.6889635", "text": "setCanvasDimensions() {\n this.canvasDimensions = {\n width: this.canvasElement.offsetWidth,\n height: this.canvasElement.offsetHeight\n };\n\n this.canvasElement.width = this.canvasDimensions.width;\n this.canvasElement.height = this.canvasDimensions.height;\n }", "title": "" }, { "docid": "27f955820835f073040776ae423a28c3", "score": "0.6884076", "text": "function AdjustHeightWidthOfMyCanvas(){\n var c = $(\"#myCanvas25\");\n var container = $(c).parent();\n var maxWidth = $(container).width();\n var maxHeight = $(container).height();\n c.attr('width', maxWidth);\n c.attr('height', maxHeight);\n stepX = Math.floor((maxWidth-50)/9);\n stepY = Math.floor((maxHeight-50)/9);\n maxX = stepX * 9;\n }", "title": "" }, { "docid": "59c6412108825d203dc1a11c452793b1", "score": "0.68783563", "text": "function resizeCanvas() {\n\tcanvas.width = window.innerWidth - BORDER;\n\tcanvas.height = window.innerHeight - BORDER;\n}", "title": "" }, { "docid": "6d3c02528aef7064adc008edc89ed5c2", "score": "0.6866357", "text": "resizeCanvas() {\n const { context } = store.getState();\n const canvas = context.canvas;\n const { width, height } = canvas.getBoundingClientRect();\n\n if (canvas.width !== width || canvas.height !== height) {\n const { devicePixelRatio: ratio = 1 } = window;\n canvas.width = width * ratio;\n canvas.height = height * ratio;\n context.scale(ratio, ratio);\n }\n }", "title": "" }, { "docid": "218678a983f4f829f73070b765f5e940", "score": "0.6865694", "text": "function canvasSize() {\n if (wWidth <= wHeight) {\n if (wWidth <= 400) {\n canvas.width = wWidth;\n canvas.height = canvas.width / ratio;\n } else {\n canvas.width = 400;\n canvas.height = canvas.width / ratio;\n }\n } else {\n if (wHeight <= 400) {\n canvas.height = wHeight;\n canvas.width = canvas.height / ratio;\n } else {\n canvas.height = 400;\n canvas.width = canvas.height / ratio;\n }\n }\n\n if (wWidth >= 320 && wWidth <= 414) {\n canvas.width = 300;\n canvas.height = canvas.width / ratio;\n }\n }", "title": "" }, { "docid": "575c3f267d4d8011d3f50108c06ef964", "score": "0.6851883", "text": "function resizeCanvas() {\n var elContainer = document.querySelector('.canvas-container');\n // Note: changing the canvas dimension this way clears the canvas\n gCanvas.width = elContainer.offsetWidth; // show width & height in CSS\n gCanvas.height = elContainer.offsetHeight;\n}", "title": "" }, { "docid": "de42812d64f79841ce380655ea05eeb2", "score": "0.68344355", "text": "function resizeCanvas(){\n\tw = $(document).width() / 2 + 200;\n\th = $(document).height() / 2 + 200 / 6;\n\t// wm = w / 400;\n\t// hm = h / 900;\n\n\t$(\"canvas\").css({\"width\":w,\"height\":h});\n\t// $(\"canvas\").width = w;\n\t// $(\"canvas\").height = h;\n}", "title": "" }, { "docid": "ab293d44065568ca3fdaf9dc8a6d4052", "score": "0.6834256", "text": "function resizeCanvas() {\n var size = getCanvasSize();\n canvas.width = size.w;\n canvas.height = size.h;\n\n // set canvas offsets (to center image)\n canvas.offX = canvas.width / 2 - canvas.gameWidth / 2;\n canvas.offY = canvas.height / 2 - canvas.gameHeight / 2;\n}", "title": "" }, { "docid": "7ca7b979bc09b1384220ef6e2764a79d", "score": "0.68335396", "text": "function resizeCanvas() {\n let body = document.querySelector('body');\n let w = window.getComputedStyle(body).getPropertyValue('width');\n let h = window.getComputedStyle(body).getPropertyValue('height');\n canvas.width = parseInt(w, 10);\n canvas.height = parseInt(h, 10);\n}", "title": "" }, { "docid": "216d2b0d8857c07837ca6565da45bc14", "score": "0.68265086", "text": "function resizeCanvas() {\r\n canvas.width = window.innerWidth;\r\n canvas.height = window.innerHeight;\r\n draw();\r\n }", "title": "" }, { "docid": "bbe8b6015b41adf4573437566d265880", "score": "0.6825712", "text": "setCanvasSize(width, height) {\r\n this.canvasWidth = width;\r\n this.canvasHeight = height;\r\n const { canvas, canvasWidth, canvasHeight, pixelRatio } = this;\r\n const ctx = canvas.getContext(\"2d\");\r\n // appropriately scale canvas to map to device ratio\r\n canvas.width = canvasWidth * pixelRatio;\r\n canvas.height = canvasHeight * pixelRatio;\r\n canvas.style.width = canvasWidth + \"px\";\r\n canvas.style.height = canvasHeight + \"px\";\r\n ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\r\n }", "title": "" }, { "docid": "c6faf30ecdba21c8b764c72e52f429df", "score": "0.6818742", "text": "function setCanvasSize(x,y) { \r\n\r\n\tif (!autoCanvasSize && x === undefined) {\t\t// If auto-resizing is turned off... exit function.\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar paddingHorizontal = 30;\r\n\tvar paddingVertical = 60;\r\n\r\n\t// Get variable values\r\n\t//\tvar controlButtonsHeight = $('#controlButtons').height();\r\n\tvar windowWidth;\r\n\tvar windowHeight;\r\n\r\n\tif (x !== undefined) {\r\n\t\twindowWidth = x;\r\n\t} else {\r\n\t\twindowWidth = $(window).width();\r\n\t}\r\n\r\n\tif (y !== undefined) {\r\n\t\twindowHeight = y;\r\n\t} else {\r\n\t\twindowHeight = $(window).height();\r\n\t}\r\n\r\n\r\n\t//\tif (!controlButtonsHeight) {\r\n\t\tcontrolButtonsHeight = 34; // If JQuery cannot get the footer height on page load, set a fixed height here\r\n\t//\t}\r\n\r\n\t// Calculate\r\n\tvar canvasWidth = windowWidth - paddingHorizontal;\r\n\tvar canvasHeight = windowHeight - controlButtonsHeight - paddingVertical;\r\n\r\n\tlog(\"canvasHeight: \" + canvasHeight + \" - windowHeight: \" + windowHeight + \" - controlButtonsHeight: \" + controlButtonsHeight + \" - paddingVertical: \" + paddingVertical);\r\n\r\n\t// Meet Mins & Maxs\r\n\tif (canvasWidth < minCanvasWidth) {\r\n\t\tcanvasWidth = minCanvasWidth;\r\n\t}\r\n\tif (canvasHeight < minCanvasHeight) {\r\n\t\tcanvasHeight = minCanvasHeight;\r\n\t}\r\n\r\n\tif (squareResize) {\t\t\t\t\t// Set in nBody.js\r\n\t\tcanvasWidth = canvasHeight;\t\t\t// Set to a square based on the canvas height.\r\n\t}\r\n\r\n\t// Set Global Simulator Variables\r\n\tcanvas_height = canvasHeight;\r\n\tcanvas_width = canvasWidth;\r\n\r\n\t//\t$(\"#canvas\").width(canvasWidth).height(canvasHeight); // Reset DIV container containing Canvas -- WARNING: Stretches content\r\n $(\"#canvas\").attr({ width: canvasWidth, height: canvasHeight });\t\t// This works without stretching content\r\n}", "title": "" }, { "docid": "8bf2e1f876dc600f5eacfbe5883f2fd5", "score": "0.6818257", "text": "function resize(){\n\tcanvas.width = window.innerWidth;\n\tcanvas.height = window.innerHeight;\n\n\twidth = canvas.width;\n\theight = canvas.height;\n}", "title": "" }, { "docid": "7b41d7111834956e1da022ba31cf4bd3", "score": "0.6813419", "text": "function resizeCanvas() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n }", "title": "" }, { "docid": "ea0d7ac7279b37d59a786429140c9e5b", "score": "0.6811894", "text": "function fitToContainer() {\n\tcanvas.style.width = '100%';\n\tcanvas.style.height = '100%';\n\tcanvas.width = canvas.offsetWidth;\n\tcanvas.height = canvas.offsetHeight;\n}", "title": "" }, { "docid": "9cfa1104eb9a2f9a6abeda6015df0080", "score": "0.6804376", "text": "function resize_canvas() {\n // Lookup the size the browser is displaying the canvas.\n var displayWidth = canvas.clientWidth;\n var displayHeight = canvas.clientHeight;\n\n // Check if the canvas is not the same size.\n if (canvas.width != displayWidth ||\n canvas.height != displayHeight) {\n\n // Make the canvas the same size\n canvas.width = displayWidth;\n canvas.height = displayHeight;\n }\n}", "title": "" }, { "docid": "93f7bba968471ce3c2e524237e54df01", "score": "0.68014425", "text": "function setResize() {\n $(\"#canvasResize\").css(\"left\",$(\"#mainCanvas\").position().left + parseInt($(\"#canvasWidth\").val()) - rOffset);\n $(\"#canvasResize\").css(\"top\",$(\"#mainCanvas\").position().top + parseInt($(\"#canvasHeight\").val()) - rOffset);\n}", "title": "" }, { "docid": "999c838c6de5bb662305977bf7a2b5af", "score": "0.67938715", "text": "function resize() {\n c2.width = canvas.width = innerWidth;\n c2.height = canvas.height = innerHeight;\n update(true);\n}", "title": "" }, { "docid": "670028e6e368ae18cfb41fe43f791af0", "score": "0.6788118", "text": "function sizeChangeCallback() {\n\tFB.Canvas.setSize();\n}", "title": "" }, { "docid": "2fd4d1afa9e17f0ec1fe7ddf37e2f82f", "score": "0.67856205", "text": "resize(forceSetSize = false) {\n let width;\n let height;\n if (DomManagement.IsWindowObjectExist()) {\n width = this._renderingCanvas ? (this._renderingCanvas.clientWidth || this._renderingCanvas.width) : window.innerWidth;\n height = this._renderingCanvas ? (this._renderingCanvas.clientHeight || this._renderingCanvas.height) : window.innerHeight;\n }\n else {\n width = this._renderingCanvas ? this._renderingCanvas.width : 100;\n height = this._renderingCanvas ? this._renderingCanvas.height : 100;\n }\n this.setSize(width / this._hardwareScalingLevel, height / this._hardwareScalingLevel, forceSetSize);\n }", "title": "" }, { "docid": "5edbb6d923ba8205d75d48a34f31d48b", "score": "0.6782771", "text": "function resize_canvas()\n {\n canvas = document.getElementById(\"canvas\");\n if (canvas.width < window.innerWidth)\n {\n canvas.width = window.innerWidth;\n }\n if (canvas.height < window.innerHeight)\n {\n canvas.height = window.innerHeight;\n }\n }", "title": "" }, { "docid": "b53ad49aa009a00778b610d2bb34590e", "score": "0.67822266", "text": "function resizeCanvas() {\n if (!canvas) {\n console.log(\"No canvas?\");\n return;\n }\n const { innerWidth, innerHeight } = window;\n canvas.width = innerWidth;\n canvas.height = innerHeight;\n console.log(\"Resized Canvas!\");\n}", "title": "" }, { "docid": "8618ebd4aa61ea50a07e6b0605263f94", "score": "0.67804134", "text": "function rescaleCanvas(){\n Canvas.height = window.innerHeight;\n Canvas.width = window.innerWidth;\n }", "title": "" }, { "docid": "7795b2e92b1c5fda8f07c5b4a50ec894", "score": "0.677006", "text": "function updateCanvas(){\n\tcanvs.width = window.innerWidth * 0.78;\n canvs.height = window.innerHeight * 0.75;\n}", "title": "" }, { "docid": "ee67de096f75ce58fd398187a03938bc", "score": "0.6758941", "text": "function resizeCanvas()\r\n{\r\n\tGlobal.canvas.width = window.innerWidth;\r\n\tGlobal.canvas.height = window.innerHeight;\r\n}", "title": "" }, { "docid": "f28233e06215392005d3389345d9413a", "score": "0.67469764", "text": "function canvasWidthChange()\n{ \n canvasMain.width = w + 1;\n canvasMain.width = w; \n}", "title": "" }, { "docid": "e1d3a670d3125d8eeecb7436ddcfda09", "score": "0.6743951", "text": "function canvasResize(){\n\tscreenWidth = window.innerWidth;\n\tscreenHeight = window.innerHeight;\n\n\tcanvasPosition = canvas.getBoundingClientRect(); // Gets the canvas position\n\tcanvas.width = screenWidth - 4;\n\tcanvas.height = screenHeight - 4;\n}", "title": "" }, { "docid": "de97cb85dd19086516596969b8d7f043", "score": "0.67413867", "text": "function resize(){\n //ctx.scale(0.1 ,0.1);\n ctx.canvas.width = 320;\n ctx.canvas.height = 320;\n\n ctx.beginPath();\n var rect = ctx.rect(20 , 20 , 280 , 280 );\n ctx.fillStyle = \"black\";\n ctx.fill();\n}", "title": "" }, { "docid": "87e5d8f21bfe0a1425e3db1bc391c80e", "score": "0.6714496", "text": "sizeCanvas() {\n // If the browser is large enough scale the canvas to its maximum dimensions.\n if (document.body.clientWidth > Dim.maxWidth && window.innerHeight > Dim.maxHeight) {\n Dim.canvasEl.width = Dim.maxWidth;\n this.width = Dim.maxWidth;\n Dim.canvasEl.height = Dim.maxHeight;\n this.height = Dim.maxHeight;\n }\n else {\n // If both width and height are smaller than max determine which ratio is smallest and rescale accordingly.\n // Else if its just width than scale to width otherwise its height and scale to height. \n document.body.clientWidth < Dim.maxWidth && document.body.clientHeight < Dim.maxHeight\n ? document.body.clientWidth / Dim.maxWidth <= document.body.clientHeight / Dim.maxHeight\n ? this.scaleToWidth()\n : this.scaleToHeight()\n : document.body.clientWidth < Dim.maxWidth\n ? this.scaleToWidth()\n : this.scaleToHeight();\n }\n this.shrink = this.width / Dim.maxWidth;\n }", "title": "" }, { "docid": "f0538c1f18facc9eecad8831d1d0048b", "score": "0.6714363", "text": "function resizeCanvas() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n redraw();\n}", "title": "" }, { "docid": "e62c69dfb3bde38101376a9a195cd234", "score": "0.6694344", "text": "function setupCanvasSize() {\n margin = {top: 20, left: 80, bottom: 20, right: 30};\n width = 960 - margin.left - margin.right;\n height = 520 - margin.top - margin.bottom;\n}", "title": "" }, { "docid": "e62c69dfb3bde38101376a9a195cd234", "score": "0.6694344", "text": "function setupCanvasSize() {\n margin = {top: 20, left: 80, bottom: 20, right: 30};\n width = 960 - margin.left - margin.right;\n height = 520 - margin.top - margin.bottom;\n}", "title": "" }, { "docid": "78d99604ee385e03fd26636012276cff", "score": "0.66943365", "text": "onResize() {\n this.setCanvasDimensions();\n }", "title": "" }, { "docid": "0cce6ce56e199519f673ca7958dd292d", "score": "0.6692868", "text": "function resizeCanvas() {\n canvas.setWidth(window.innerWidth);\n canvas.setHeight(window.innerHeight);\n canvas.renderAll();\n}", "title": "" }, { "docid": "88b5fa016ba481b657be89b2d66d44d5", "score": "0.66883856", "text": "function resize_canvas( new_settings )\n{\n\tcanvas_element.width = new_settings[ 'canvas-width' ];\n\tcanvas_element.height = new_settings[ 'canvas-height' ];\n\t\n\tdocument.getElementById( 'canvas-overlay' ).width = new_settings[ 'canvas-width' ];\n\tdocument.getElementById( 'canvas-overlay' ).height = new_settings[ 'canvas-height' ];\n\t\n\t$( '.canvas-content' ).css( 'width', new_settings[ 'canvas-width' ] );\n\t$( '.canvas-content' ).css( 'height', new_settings[ 'canvas-height' ] );\n\t\n\tcanvas_element_dimensions_have_changed();\n\t\n\tcreate_iteration_pixels_skeleton( new_settings[ 'canvas-height' ] );\n\t\n\tvertically_align_canvas();\n\t\n\tremove_canvas_html_spacing();\n}", "title": "" }, { "docid": "923bd09179b1496f995bc6a58c8292ee", "score": "0.668415", "text": "function resizeCanvas() {\n $(canvas).width($(window).width());\n canvasWidth = $(canvas).width();\n canvasHeight = $(canvas).height();\n}", "title": "" }, { "docid": "3eb830071d167ee907fd7af942344fd9", "score": "0.66803044", "text": "function onResize() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n}", "title": "" }, { "docid": "8e053ddeafecda3b9ad7570c82718e7d", "score": "0.667709", "text": "fitToContainer() {\n this.w = this.canvas.width = this.canvas.offsetWidth;\n this.h = this.canvas.height = this.canvas.offsetHeight;\n }", "title": "" }, { "docid": "1f8d6e9375abc61ea844c8de9b73e273", "score": "0.6675984", "text": "function fitCanvas() {\n canvas.width = document.body.clientWidth\n canvas.height = document.body.clientHeight;\n }", "title": "" }, { "docid": "08cffd989a108bb9cd10d7014f7debc8", "score": "0.6671573", "text": "function resize_canvas() {\n if (height != window.innerHeight || width != height / 1.5) {\n if(window.innerHeight / 1.5 > window.innerWidth) //mobile or narrow window\n {\n var width = window.innerWidth;\n var height = width * 1.5;\n size_mult = height / 900;\n \n canvas.style.width = height.toString() + \"px\";\n canvas.style.width = width.toString() + \"px\";\n canvas.height = height;\n canvas.width = width\n canvas.style.marginTop = window.innerHeight - height + \"px\"\n document.body.style.backgroundColor = \"#2EAADC\";\n }\n else //normal screen\n {\n var height = window.innerHeight;\n var width = height / 1.5;\n size_mult = height / 900;\n \n canvas.style.width = height.toString() + \"px\";\n canvas.style.width = width.toString() + \"px\";\n canvas.height = height;\n canvas.width = width\n canvas.style.marginTop = \"0px\";\n document.body.style.backgroundColor = \"#ffffff\";\n }\n }\n}", "title": "" }, { "docid": "9b4998822db013e37a045a279fdedc97", "score": "0.66594297", "text": "function onResize() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n }", "title": "" }, { "docid": "2d87148a6a6533fc6289072239dd786b", "score": "0.6653532", "text": "function fitResponsiveCanvas(canvas) {\n\tcanvas.setHeight(window.innerHeight - 65);\n\tcanvas.setWidth(window.innerWidth - 400);\n\tcanvas.renderAll();\n}", "title": "" }, { "docid": "8acf0f05f2ee289027f4e06e3b21c53f", "score": "0.6648115", "text": "function changeCanvasOptions() {\n\tconsole.log('caught click')\n\tvar w = parseInt($('#opt_width').val(), 10);\n\tvar h = parseInt($('#opt_height').val(), 10);\n\n\tconsole.log(w);\n\tconsole.log(h);\n\n\tif(isNaN(w) || isNaN(h)) {\n\t\t$('#opt_size_warning').show();\n\t\treturn;\n\t}\n\n\t$('#opt_size_warning').hide();\n\n\tvar canvas = $('#boid')[0];\n\tvar ctx = canvas.getContext('2d');\n\tctx.clearRect(0, 0, width, height);\n\n\twidth = w;\n\theight = h;\n\n\tcanvas.width = width;\n\tcanvas.height = height;\n\n}", "title": "" }, { "docid": "059b543a64b4f9d841d46690dca2d914", "score": "0.66466737", "text": "function setupCanvas(){\n canvas = document.querySelector(\"#myCanvas\");\n ctx = canvas.getContext(\"2d\");\n canvas.style = \"position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; margin: auto\";\n canvas.style.border = \"6px solid red\"; \n canvas.width = w;\n canvas.height = h;\n}", "title": "" }, { "docid": "ad31abd47cf0e23f86f567768b351ec6", "score": "0.66461295", "text": "function updateSize() {\n\t\tfontSize = parseInt($scope.gimme(\"FontSize\"));\n\t\tif(fontSize < 5) {\n\t\t\tfontSize = 5;\n\t\t}\n\n\t\tvar rw = $scope.gimme(\"DrawingArea:width\");\n\t\tif(typeof rw === 'string') {\n\t\t\trw = parseFloat(rw);\n\t\t}\n\t\tif(rw < 1) {\n\t\t\trw = 1;\n\t\t}\n\n\t\tvar rh = $scope.gimme(\"DrawingArea:height\");\n\t\tif(typeof rh === 'string') {\n\t\t\trh = parseFloat(rh);\n\t\t}\n\t\tif(rh < 1) {\n\t\t\trh = 1;\n\t\t}\n\n\t\tif(myCanvas === null) {\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tmyCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tmyCanvas.width = rw;\n\t\tmyCanvas.height = rh;\n\n\t\tif(dropCanvas === null) {\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theDropCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tdropCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$log.log(preDebugMsg + \"no canvas to draw on!\");\n\t\t\t}\n\t\t}\n\t\tif(dropCanvas) {\n\t\t\tdropCanvas.width = rw;\n\t\t\tdropCanvas.height = rh;\n\t\t}\n\n\t\tif(selectionCanvas === null) {\n\t\t\tvar selectionCanvasElement = $scope.theView.parent().find('#theSelectionCanvas');\n\t\t\tif(selectionCanvasElement.length > 0) {\n\t\t\t\tselectionCanvas = selectionCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$log.log(preDebugMsg + \"no selectionCanvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tselectionCanvas.width = rw;\n\t\tselectionCanvas.height = rh;\n\t\tselectionCanvas.style.left = 0;\n\t\tselectionCanvas.style.top = 0;\n\n\t\tif(selectionHolderElement === null) {\n\t\t\tselectionHolderElement = $scope.theView.parent().find('#selectionHolder');\n\t\t}\n\t\tselectionHolderElement.width = rw;\n\t\tselectionHolderElement.height = rh;\n\t\tselectionHolderElement.top = 0;\n\t\tselectionHolderElement.left = 0;\n\n\t\tvar selectionRectElement = $scope.theView.parent().find('#selectionRectangle');\n\t\tselectionRectElement.width = rw;\n\t\tselectionRectElement.height = rh;\n\t\tselectionRectElement.top = 0;\n\t\tselectionRectElement.left = 0;\n\t\tif(selectionRectElement.length > 0) {\n\t\t\tselectionRect = selectionRectElement[0];\n\t\t\tselectionRect.width = rw;\n\t\t\tselectionRect.height = rh;\n\t\t\tselectionRect.top = 0;\n\t\t\tselectionRect.left = 0;\n\t\t}\n\t}", "title": "" }, { "docid": "aa10c2b4385396377b3d757cbcf37a2e", "score": "0.6639923", "text": "function resizeCanvas() {\n resize(windowWidth, windowHeight);\n}", "title": "" }, { "docid": "ba5270c61ad9ce75aca3d810d2fae18e", "score": "0.66213566", "text": "function resizeCanvas() {\n htmlCanvas.width = window.innerWidth;\n htmlCanvas.height = window.innerHeight;\n redraw();\n }", "title": "" }, { "docid": "9cc619ede6c078dd5f302b98a40167f9", "score": "0.6615886", "text": "function resize (canvas, factor) {\n\n canvas = resolveCanvas(canvas);\n var w = canvas.width;\n var h = canvas.height;\n canvas.style.width = '' + (w * factor) + 'px';\n canvas.style.height = '' + (h * factor) + 'px';\n }", "title": "" }, { "docid": "f05112cffe76d3bda9b117b90fc498f9", "score": "0.66058934", "text": "function borraCanvas() {\n canvas.width = 500;\n canvas.height = 500;\n}", "title": "" }, { "docid": "e839d4af6807f8127c2d6dad94ce8f0e", "score": "0.6605225", "text": "function plotter_resize(canvas, width, height)\n{\n P = plotter_data[canvas];\n var scope = P.scope;\n scope.view.setViewSize(width, height);\n if (scope.view.center.x > scope.view.center.y) { P.view_size = scope.view.center.y; }\n else { P.view_size = scope.view.center.x; }\n}", "title": "" }, { "docid": "77e7a1558d7daca4221650f13e272433", "score": "0.66052115", "text": "function resizeFit() {\n var div = document.getElementById('sketch-holder');\n var ts1 = floor(div.offsetWidth / cols);\n var ts2 = floor(div.offsetHeight / rows);\n ts = Math.min(ts1, ts2);\n resizeCanvas(cols * ts, rows * ts, true);\n}", "title": "" }, { "docid": "86a60aef0c4a695e6dccbf8f23a38550", "score": "0.66008186", "text": "function resize() {\n // resize canvas\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight - (window.innerHeight/3);\n // re-render canvas to prevent canvas from being blank\n renderCanvas();\n}", "title": "" }, { "docid": "3ba4098e280fac0fbc6ca43df7382a2f", "score": "0.6591335", "text": "function resizeCanvas() {\n scrn.reSize();\n}", "title": "" }, { "docid": "16a7c23119a43368f22bb6f1fd29079f", "score": "0.659073", "text": "function resizeCanvas() {\n\t\t// When zoomed out to less than 100%, for some very strange reason,\n\t\t// some browsers report devicePixelRatio as less than 1\n\t\t// and only part of the canvas is cleared then.\n\t\tvar ratio = Math.max(window.devicePixelRatio || 1, 1);\n\t\tcanvas.width = canvas.offsetWidth * ratio;\n\t\tcanvas.height = canvas.offsetHeight * ratio;\n\t\tcanvas.getContext(\"2d\").scale(ratio, ratio);\n\t}", "title": "" }, { "docid": "c7bb701386c308ff9b113d96015ef9b9", "score": "0.65879625", "text": "function resizeCanvas() {\n // When zoomed out to less than 100%, for some very strange reason,\n // some browsers report devicePixelRatio as less than 1\n // and only part of the canvas is cleared then.\n var ratio = Math.max(window.devicePixelRatio || 1, 1);\n canvas.width = canvas.offsetWidth * ratio;\n canvas.height = canvas.offsetHeight * ratio;\n canvas.getContext(\"2d\").scale(ratio, ratio);\n}", "title": "" }, { "docid": "e4105770a2984de01167fe80ce38bfd4", "score": "0.65750074", "text": "function onResize() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n }", "title": "" }, { "docid": "80640a0bc638da1edb27907cbb37d945", "score": "0.65722877", "text": "function sizeCanvas() {\n const canvas = document.getElementById(\"boids\");\n width = window.innerWidth*simScaling;\n height = window.innerHeight*simScaling;\n console.log(\"Width: \"+width);\n console.log(\"Height: \"+height);\n canvas.width = width;\n canvas.height = height;\n}", "title": "" }, { "docid": "80640a0bc638da1edb27907cbb37d945", "score": "0.65722877", "text": "function sizeCanvas() {\n const canvas = document.getElementById(\"boids\");\n width = window.innerWidth*simScaling;\n height = window.innerHeight*simScaling;\n console.log(\"Width: \"+width);\n console.log(\"Height: \"+height);\n canvas.width = width;\n canvas.height = height;\n}", "title": "" }, { "docid": "f7c9a0dbc420d0704c10f8271a1eb6ea", "score": "0.6569165", "text": "function resize()\r\n{\r\n var RATIO = 10/16; //canvas WIDTH/HEIGHT\r\n var CURR_WIDTH = WIDTH; //resize canvas\r\n var CURR_HEIGHT = HEIGHT; //resize canvas\r\n\r\n //resize width in proportion to height\r\n CURR_HEIGHT = window.innerHeight;\r\n CURR_WIDTH = CURR_HEIGHT * RATIO;\r\n\t\r\n if(CURR_WIDTH > window.innerWidth)\r\n {\r\n CURR_WIDTH = window.innerWidth;\r\n CURR_HEIGHT = CURR_WIDTH / RATIO;\r\n }\r\n\r\n //some extra space to scroll past the address bar\r\n if (android || ios) \r\n {\r\n //document.body.style.height = (window.innerHeight + 50) + 'px';\r\n }\r\n\r\n //scale it with CSS\r\n canvas.style.width = CURR_WIDTH + 'px';\r\n canvas.style.height = CURR_HEIGHT + 'px';\r\n //some mobile browsers don't fire without a delay\r\n window.setTimeout(function() \r\n {\r\n window.scrollTo(0,1);\r\n }, 1);\r\n\t\r\n\tscale = CURR_WIDTH/WIDTH;\r\n}", "title": "" }, { "docid": "89919af107b8a97ba83c8d2520351c02", "score": "0.65639734", "text": "function borraCanvas() {\n canvas.width = 750;\n canvas.height = 500;\n}", "title": "" }, { "docid": "56845ad767c68ce28733f91a3e50521d", "score": "0.6561537", "text": "setSize(obj) {\n this.ctx.canvas.width =\n typeof obj === 'object'\n ? obj[0] * window.devicePixelRatio\n : window.innerWidth * window.devicePixelRatio\n this.ctx.canvas.height =\n typeof obj === 'object'\n ? obj[1] * window.devicePixelRatio\n : window.innerHeight * window.devicePixelRatio\n this.ctx.scale(window.devicePixelRatio, window.devicePixelRatio)\n }", "title": "" }, { "docid": "9ffa81fd2f202a4f74320cee9b4ccae1", "score": "0.6555762", "text": "function resizeCanvas(){\n\n // BUG this doesn't take account of the previous zoom level!!! to be fixed\n\n //ctx.canvas.width = window.innerWidth-10;\n //ctx.canvas.height = window.innerHeight-85;\n //ctx.clearRect(0,0,canvas.width,canvas.height);\n //drawMainStage(img);\n}", "title": "" }, { "docid": "6f46f88d6ce8cbf502ddd2a3cebaab9e", "score": "0.6553443", "text": "function setSettings() {\n let currentCanvas = document.getElementById(\"resolution\")\n let newCanvasSize = currentCanvas.value;\n if (!isNaN(newCanvasSize) && newCanvasSize >= 2 && newCanvasSize <= 150) {\n canvasSize = newCanvasSize;\n } else {\n if (newCanvasSize === \"\") {\n currentCanvas.style.borderColor = \"darkgray\";\n } else {\n currentCanvas.style.borderColor = \"tomato\";\n }\n }\n updateColorSetting(true);\n updateColorSetting(false);\n}", "title": "" }, { "docid": "8488ed374cbde8b557258e68d581a2e0", "score": "0.6548763", "text": "function onResize() {\r\n canvas.width = window.innerWidth;\r\n canvas.height = window.innerHeight;\r\n }", "title": "" }, { "docid": "71f3dd9e1886a39c2acc5af94b69c6ec", "score": "0.6547587", "text": "function setupCanvas() {\n\tconst dpr = window.devicePixelRatio || 1.0;\n const aspectRatio = canvas.width / canvas.height;\n const size = canvas.parentNode.offsetWidth * 0.8;\n canvas.style.width = size + \"px\";\n canvas.style.height = size / aspectRatio + \"px\";\n canvas.width = size;\n canvas.height = size / aspectRatio;\n updatePlot();\n}", "title": "" }, { "docid": "aec2cf6c309e21cfdff2b4f8fa7d7509", "score": "0.65472066", "text": "function scaleCanvas() {\n canvasSize = BASE_CANVAS_SIZE * Math.min(document.body.clientWidth, document.body.clientHeight) / BASE_SIZE;\n CANVAS_FOREGROUND.width = CANVAS_FOREGROUND.height = canvasSize;\n window.requestAnimationFrame(render);\n}", "title": "" }, { "docid": "dc4816ae18bc449faa625faa8f4f3d5f", "score": "0.65465176", "text": "function resizeCanvas() {\n // When zoomed out to less than 100%, for some very strange reason,\n // some browsers report devicePixelRatio as less than 1\n // and only part of the canvas is cleared then.\n var ratio = Math.max(window.devicePixelRatio || 1, 1);\n canvas.width = canvas.offsetWidth * ratio;\n canvas.height = canvas.offsetHeight * ratio;\n canvas.getContext(\"2d\").scale(ratio, ratio);\n }", "title": "" }, { "docid": "bb7f9de90c89bb710a83fbb3891d5a28", "score": "0.6542706", "text": "function FixDpi()\n { \n // Change the canvas size according to the windows dpi\n let styleHeight = +getComputedStyle(gameBoardCanvas).getPropertyValue(\"height\").slice(0, -2);\n let styleWidth = +getComputedStyle(gameBoardCanvas).getPropertyValue(\"width\").slice(0, -2);\n gameBoardCanvas.setAttribute(\"height\", styleHeight * dpi);\n gameBoardCanvas.setAttribute(\"width\", styleWidth * dpi);\n }", "title": "" }, { "docid": "417e9fdc1732b4fd0fc160b3ce294ca8", "score": "0.65410787", "text": "resizeCanvas(w, h, s = false) {\n\n var ratio = this.buffer_w / this.buffer_h;\n\n if (h / this.buffer_h < w / this.buffer_w) w = h * ratio;\n else h = w / ratio;\n \n this.canvas_h = this.canvas.canvas.height = h;\n this.canvas_w = this.canvas.canvas.width = w;\n\n this.canvas.imageSmoothingEnabled = s;\n\n }", "title": "" } ]
e867d090d2524a570101fa596b9c7279
The Buffer constructor returns instances of `Uint8Array` that have their prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of `Uint8Array`, so the returned instances will have all the node `Buffer` methods and the `Uint8Array` methods. Square bracket notation works as expected it returns a single octet. The `Uint8Array` prototype remains unmodified.
[ { "docid": "e7e70226a03d0ef9dc14e6d8fbcb7483", "score": "0.0", "text": "function Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}", "title": "" } ]
[ { "docid": "4a2d2514db0926a4682563f5d5744be5", "score": "0.73808503", "text": "function BufferToArrayBuffer(){return new Buffer(this).buffer}", "title": "" }, { "docid": "f4969cdb9157e6399717ff05cd035df6", "score": "0.7354607", "text": "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "title": "" }, { "docid": "f4969cdb9157e6399717ff05cd035df6", "score": "0.7354607", "text": "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "title": "" }, { "docid": "992c43fd93a522089ca253f0df3dd7c9", "score": "0.69948834", "text": "_toBuffer() {\n const buffer = new growable_buffer_1.GrowableBuffer;\n this.addToBuffer(buffer);\n return buffer.toUint8Array();\n }", "title": "" }, { "docid": "78bcb6b76ecc20a435eb309de0c536fd", "score": "0.68936193", "text": "function createByteContainer() {\n if (HAS_BUFFER)\n return new Buffer(0);\n\n return new Uint8Array();\n }", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.68496907", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.68496907", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6839512", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6839512", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6839512", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6839512", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6839512", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6839512", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6839512", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6839512", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6839512", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6839512", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6839512", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "3cec8baa1e907fcc1b63a1d878772d46", "score": "0.67955804", "text": "toBuffer(): typeof Buffer {\n const a = super.toArray().reverse();\n const b = Buffer.from(a);\n if (b.length === 8) {\n return b;\n }\n assert(b.length < 8, 'Numberu64 too large');\n\n const zeroPad = Buffer.alloc(8);\n b.copy(zeroPad);\n return zeroPad;\n }", "title": "" }, { "docid": "9bb0c0b4ee51810133200fdecdc2b52e", "score": "0.678466", "text": "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The \"string\" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "9bb0c0b4ee51810133200fdecdc2b52e", "score": "0.678466", "text": "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The \"string\" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "9bb0c0b4ee51810133200fdecdc2b52e", "score": "0.678466", "text": "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The \"string\" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "9bb0c0b4ee51810133200fdecdc2b52e", "score": "0.678466", "text": "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The \"string\" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "9bb0c0b4ee51810133200fdecdc2b52e", "score": "0.678466", "text": "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The \"string\" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "9bb0c0b4ee51810133200fdecdc2b52e", "score": "0.678466", "text": "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The \"string\" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "862a87dabfb1ad952871d7324f366a44", "score": "0.6750619", "text": "function Buffer(arg,encodingOrOffset,length){// Common case.\n\tif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The \"string\" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "8aa5753adfbc730bd331a2dbd05b2966", "score": "0.674816", "text": "function Buffer(arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1]);\n\t return new Buffer(arg);\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0;\n\t this.parent = undefined;\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg);\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8');\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg);\n\t}", "title": "" }, { "docid": "3eb87b9f60be92fd22b6ec89bc49ccf0", "score": "0.67261654", "text": "get buffer() {\n return this.buf.subarray(0, this.offset)\n }", "title": "" }, { "docid": "237cab9cc2eb398dc9183052fe1f7e04", "score": "0.67137855", "text": "toBytes() {\n return new Uint8Array(this.buffer, 0, this.pos)\n }", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.6650665", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.6650665", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.6650665", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.6650665", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.6650665", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.6650665", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "7c2640afdd88400691acc188585d8c85", "score": "0.6636527", "text": "function Buffer (subject, encoding) {\n var self = this\n if (!(self instanceof Buffer)) return new Buffer(subject, encoding)\n\n var type = typeof subject\n var length\n\n if (type === 'number') {\n length = +subject\n } else if (type === 'string') {\n length = Buffer.byteLength(subject, encoding)\n } else if (type === 'object' && subject !== null) {\n // assume object is array-like\n if (subject.type === 'Buffer' && isArray(subject.data)) subject = subject.data\n length = +subject.length\n } else {\n throw new TypeError('must start with number, buffer, array or string')\n }\n\n if (length > kMaxLength) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum size: 0x' +\n kMaxLength.toString(16) + ' bytes')\n }\n\n if (length < 0) length = 0\n else length >>>= 0 // coerce to uint32\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Preferred: Return an augmented `Uint8Array` instance for best performance\n self = Buffer._augment(new Uint8Array(length)) // eslint-disable-line consistent-this\n } else {\n // Fallback: Return THIS instance of Buffer (created by `new`)\n self.length = length\n self._isBuffer = true\n }\n\n var i\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof subject.byteLength === 'number') {\n // Speed optimization -- use set if we're copying from a typed array\n self._set(subject)\n } else if (isArrayish(subject)) {\n // Treat array-ish objects as a byte array\n if (Buffer.isBuffer(subject)) {\n for (i = 0; i < length; i++) {\n self[i] = subject.readUInt8(i)\n }\n } else {\n for (i = 0; i < length; i++) {\n self[i] = ((subject[i] % 256) + 256) % 256\n }\n }\n } else if (type === 'string') {\n self.write(subject, 0, encoding)\n } else if (type === 'number' && !Buffer.TYPED_ARRAY_SUPPORT) {\n for (i = 0; i < length; i++) {\n self[i] = 0\n }\n }\n\n if (length > 0 && length <= Buffer.poolSize) self.parent = rootParent\n\n return self\n}", "title": "" }, { "docid": "7c2640afdd88400691acc188585d8c85", "score": "0.6636527", "text": "function Buffer (subject, encoding) {\n var self = this\n if (!(self instanceof Buffer)) return new Buffer(subject, encoding)\n\n var type = typeof subject\n var length\n\n if (type === 'number') {\n length = +subject\n } else if (type === 'string') {\n length = Buffer.byteLength(subject, encoding)\n } else if (type === 'object' && subject !== null) {\n // assume object is array-like\n if (subject.type === 'Buffer' && isArray(subject.data)) subject = subject.data\n length = +subject.length\n } else {\n throw new TypeError('must start with number, buffer, array or string')\n }\n\n if (length > kMaxLength) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum size: 0x' +\n kMaxLength.toString(16) + ' bytes')\n }\n\n if (length < 0) length = 0\n else length >>>= 0 // coerce to uint32\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Preferred: Return an augmented `Uint8Array` instance for best performance\n self = Buffer._augment(new Uint8Array(length)) // eslint-disable-line consistent-this\n } else {\n // Fallback: Return THIS instance of Buffer (created by `new`)\n self.length = length\n self._isBuffer = true\n }\n\n var i\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof subject.byteLength === 'number') {\n // Speed optimization -- use set if we're copying from a typed array\n self._set(subject)\n } else if (isArrayish(subject)) {\n // Treat array-ish objects as a byte array\n if (Buffer.isBuffer(subject)) {\n for (i = 0; i < length; i++) {\n self[i] = subject.readUInt8(i)\n }\n } else {\n for (i = 0; i < length; i++) {\n self[i] = ((subject[i] % 256) + 256) % 256\n }\n }\n } else if (type === 'string') {\n self.write(subject, 0, encoding)\n } else if (type === 'number' && !Buffer.TYPED_ARRAY_SUPPORT) {\n for (i = 0; i < length; i++) {\n self[i] = 0\n }\n }\n\n if (length > 0 && length <= Buffer.poolSize) self.parent = rootParent\n\n return self\n}", "title": "" }, { "docid": "7c2640afdd88400691acc188585d8c85", "score": "0.6636527", "text": "function Buffer (subject, encoding) {\n var self = this\n if (!(self instanceof Buffer)) return new Buffer(subject, encoding)\n\n var type = typeof subject\n var length\n\n if (type === 'number') {\n length = +subject\n } else if (type === 'string') {\n length = Buffer.byteLength(subject, encoding)\n } else if (type === 'object' && subject !== null) {\n // assume object is array-like\n if (subject.type === 'Buffer' && isArray(subject.data)) subject = subject.data\n length = +subject.length\n } else {\n throw new TypeError('must start with number, buffer, array or string')\n }\n\n if (length > kMaxLength) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum size: 0x' +\n kMaxLength.toString(16) + ' bytes')\n }\n\n if (length < 0) length = 0\n else length >>>= 0 // coerce to uint32\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Preferred: Return an augmented `Uint8Array` instance for best performance\n self = Buffer._augment(new Uint8Array(length)) // eslint-disable-line consistent-this\n } else {\n // Fallback: Return THIS instance of Buffer (created by `new`)\n self.length = length\n self._isBuffer = true\n }\n\n var i\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof subject.byteLength === 'number') {\n // Speed optimization -- use set if we're copying from a typed array\n self._set(subject)\n } else if (isArrayish(subject)) {\n // Treat array-ish objects as a byte array\n if (Buffer.isBuffer(subject)) {\n for (i = 0; i < length; i++) {\n self[i] = subject.readUInt8(i)\n }\n } else {\n for (i = 0; i < length; i++) {\n self[i] = ((subject[i] % 256) + 256) % 256\n }\n }\n } else if (type === 'string') {\n self.write(subject, 0, encoding)\n } else if (type === 'number' && !Buffer.TYPED_ARRAY_SUPPORT) {\n for (i = 0; i < length; i++) {\n self[i] = 0\n }\n }\n\n if (length > 0 && length <= Buffer.poolSize) self.parent = rootParent\n\n return self\n}", "title": "" }, { "docid": "7c2640afdd88400691acc188585d8c85", "score": "0.6636527", "text": "function Buffer (subject, encoding) {\n var self = this\n if (!(self instanceof Buffer)) return new Buffer(subject, encoding)\n\n var type = typeof subject\n var length\n\n if (type === 'number') {\n length = +subject\n } else if (type === 'string') {\n length = Buffer.byteLength(subject, encoding)\n } else if (type === 'object' && subject !== null) {\n // assume object is array-like\n if (subject.type === 'Buffer' && isArray(subject.data)) subject = subject.data\n length = +subject.length\n } else {\n throw new TypeError('must start with number, buffer, array or string')\n }\n\n if (length > kMaxLength) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum size: 0x' +\n kMaxLength.toString(16) + ' bytes')\n }\n\n if (length < 0) length = 0\n else length >>>= 0 // coerce to uint32\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Preferred: Return an augmented `Uint8Array` instance for best performance\n self = Buffer._augment(new Uint8Array(length)) // eslint-disable-line consistent-this\n } else {\n // Fallback: Return THIS instance of Buffer (created by `new`)\n self.length = length\n self._isBuffer = true\n }\n\n var i\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof subject.byteLength === 'number') {\n // Speed optimization -- use set if we're copying from a typed array\n self._set(subject)\n } else if (isArrayish(subject)) {\n // Treat array-ish objects as a byte array\n if (Buffer.isBuffer(subject)) {\n for (i = 0; i < length; i++) {\n self[i] = subject.readUInt8(i)\n }\n } else {\n for (i = 0; i < length; i++) {\n self[i] = ((subject[i] % 256) + 256) % 256\n }\n }\n } else if (type === 'string') {\n self.write(subject, 0, encoding)\n } else if (type === 'number' && !Buffer.TYPED_ARRAY_SUPPORT) {\n for (i = 0; i < length; i++) {\n self[i] = 0\n }\n }\n\n if (length > 0 && length <= Buffer.poolSize) self.parent = rootParent\n\n return self\n}", "title": "" }, { "docid": "e27d480e56f518250f57a96c7bd17e4c", "score": "0.6634103", "text": "toBuffer() {\n const superbuff = super.toBuffer();\n const outbuff = this.output.toBuffer();\n const bsize = superbuff.length + outbuff.length;\n const barr = [superbuff, outbuff];\n return buffer_1.Buffer.concat(barr, bsize);\n }", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6617508", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6617508", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6617508", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6617508", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6617508", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6617508", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6617508", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6617508", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6617508", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6617508", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "beb956e585082dd11ed59e0d0180c70b", "score": "0.6595316", "text": "function Buffer(arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1]);\n return new Buffer(arg);\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0;\n this.parent = undefined;\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg);\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8');\n }\n\n // Unusual.\n return fromObject(this, arg);\n }", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.6594357", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.65935713", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "da7606ee817e9dd995e6218d7aec0dcb", "score": "0.6590562", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n }", "title": "" } ]
8998757dba5663fa7be1456e1d1373e3
The toplevel container for the entire plot.
[ { "docid": "9420c00d4cdbe1412a68849285ef2634", "score": "0.0", "text": "function Plot(placeholder, data_, options_, plugins) {\n // data is on the form:\n // [ series1, series2 ... ]\n // where series is either just the data as [ [x1, y1], [x2, y2], ... ]\n // or { data: [ [x1, y1], [x2, y2], ... ], label: \"some label\", ... }\n\n var series = [],\n options = {\n // the color theme used for graphs\n colors: [\"#edc240\", \"#afd8f8\", \"#cb4b4b\", \"#4da74d\", \"#9440ed\"],\n legend: {\n show: true,\n noColumns: 1, // number of colums in legend table\n labelFormatter: null, // fn: string -> string\n labelBoxBorderColor: \"#ccc\", // border color for the little label boxes\n container: null, // container (as jQuery object) to put legend in, null means default on top of graph\n position: \"ne\", // position of default legend container within plot\n margin: 5, // distance from grid edge to default legend container within plot\n backgroundColor: null, // null means auto-detect\n backgroundOpacity: 0.85, // set to 0 to avoid background\n sorted: null // default to no legend sorting\n },\n xaxis: {\n show: null, // null = auto-detect, true = always, false = never\n position: \"bottom\", // or \"top\"\n mode: null, // null or \"time\"\n font: null, // null (derived from CSS in placeholder) or object like { size: 11, lineHeight: 13, style: \"italic\", weight: \"bold\", family: \"sans-serif\", variant: \"small-caps\" }\n color: null, // base color, labels, ticks\n tickColor: null, // possibly different color of ticks, e.g. \"rgba(0,0,0,0.15)\"\n transform: null, // null or f: number -> number to transform axis\n inverseTransform: null, // if transform is set, this should be the inverse function\n min: null, // min. value to show, null means set automatically\n max: null, // max. value to show, null means set automatically\n autoscaleMargin: null, // margin in % to add if auto-setting min/max\n ticks: null, // either [1, 3] or [[1, \"a\"], 3] or (fn: axis info -> ticks) or app. number of ticks for auto-ticks\n tickFormatter: null, // fn: number -> string\n labelWidth: null, // size of tick labels in pixels\n labelHeight: null,\n reserveSpace: null, // whether to reserve space even if axis isn't shown\n tickLength: null, // size in pixels of ticks, or \"full\" for whole line\n alignTicksWithAxis: null, // axis number or null for no sync\n tickDecimals: null, // no. of decimals, null means auto\n tickSize: null, // number or [number, \"unit\"]\n minTickSize: null // number or [number, \"unit\"]\n },\n yaxis: {\n autoscaleMargin: 0.02,\n position: \"left\" // or \"right\"\n },\n xaxes: [],\n yaxes: [],\n series: {\n points: {\n show: false,\n radius: 3,\n lineWidth: 2, // in pixels\n fill: true,\n fillColor: \"#ffffff\",\n symbol: \"circle\" // or callback\n },\n lines: {\n // we don't put in show: false so we can see\n // whether lines were actively disabled\n lineWidth: 2, // in pixels\n fill: false,\n fillColor: null,\n steps: false\n // Omit 'zero', so we can later default its value to\n // match that of the 'fill' option.\n },\n bars: {\n show: false,\n lineWidth: 2, // in pixels\n barWidth: 1, // in units of the x axis\n fill: true,\n fillColor: null,\n align: \"left\", // \"left\", \"right\", or \"center\"\n horizontal: false,\n zero: true\n },\n shadowSize: 3,\n highlightColor: null\n },\n grid: {\n show: true,\n aboveData: false,\n color: \"#545454\", // primary color used for outline and labels\n backgroundColor: null, // null for transparent, else color\n borderColor: null, // set if different from the grid color\n tickColor: null, // color for the ticks, e.g. \"rgba(0,0,0,0.15)\"\n margin: 0, // distance from the canvas edge to the grid\n labelMargin: 5, // in pixels\n axisMargin: 8, // in pixels\n borderWidth: 2, // in pixels\n minBorderMargin: null, // in pixels, null means taken from points radius\n markings: null, // array of ranges or fn: axes -> array of ranges\n markingsColor: \"#f4f4f4\",\n markingsLineWidth: 2,\n // interactive stuff\n clickable: false,\n hoverable: false,\n autoHighlight: true, // highlight in case mouse is near\n mouseActiveRadius: 10 // how far the mouse can be away to activate an item\n },\n interaction: {\n redrawOverlayInterval: 1000/60 // time between updates, -1 means in same flow\n },\n hooks: {}\n },\n surface = null, // the canvas for the plot itself\n overlay = null, // canvas for interactive stuff on top of plot\n eventHolder = null, // jQuery object that events should be bound to\n ctx = null, octx = null,\n xaxes = [], yaxes = [],\n plotOffset = { left: 0, right: 0, top: 0, bottom: 0},\n plotWidth = 0, plotHeight = 0,\n hooks = {\n processOptions: [],\n processRawData: [],\n processDatapoints: [],\n processOffset: [],\n drawBackground: [],\n drawSeries: [],\n draw: [],\n bindEvents: [],\n drawOverlay: [],\n shutdown: []\n },\n plot = this;\n\n // public functions\n plot.setData = setData;\n plot.setupGrid = setupGrid;\n plot.draw = draw;\n plot.getPlaceholder = function() { return placeholder; };\n plot.getCanvas = function() { return surface.element; };\n plot.getPlotOffset = function() { return plotOffset; };\n plot.width = function () { return plotWidth; };\n plot.height = function () { return plotHeight; };\n plot.offset = function () {\n var o = eventHolder.offset();\n o.left += plotOffset.left;\n o.top += plotOffset.top;\n return o;\n };\n plot.getData = function () { return series; };\n plot.getAxes = function () {\n var res = {}, i;\n $.each(xaxes.concat(yaxes), function (_, axis) {\n if (axis)\n res[axis.direction + (axis.n != 1 ? axis.n : \"\") + \"axis\"] = axis;\n });\n return res;\n };\n plot.getXAxes = function () { return xaxes; };\n plot.getYAxes = function () { return yaxes; };\n plot.c2p = canvasToAxisCoords;\n plot.p2c = axisToCanvasCoords;\n plot.getOptions = function () { return options; };\n plot.highlight = highlight;\n plot.unhighlight = unhighlight;\n plot.triggerRedrawOverlay = triggerRedrawOverlay;\n plot.pointOffset = function(point) {\n return {\n left: parseInt(xaxes[axisNumber(point, \"x\") - 1].p2c(+point.x) + plotOffset.left, 10),\n top: parseInt(yaxes[axisNumber(point, \"y\") - 1].p2c(+point.y) + plotOffset.top, 10)\n };\n };\n plot.shutdown = shutdown;\n plot.destroy = function () {\n shutdown();\n placeholder.removeData(\"plot\").empty();\n\n series = [];\n options = null;\n surface = null;\n overlay = null;\n eventHolder = null;\n ctx = null;\n octx = null;\n xaxes = [];\n yaxes = [];\n hooks = null;\n highlights = [];\n plot = null;\n };\n plot.resize = function () {\n \tvar width = placeholder.width(),\n \t\theight = placeholder.height();\n surface.resize(width, height);\n overlay.resize(width, height);\n };\n\n // public attributes\n plot.hooks = hooks;\n\n // initialize\n initPlugins(plot);\n parseOptions(options_);\n setupCanvases();\n setData(data_);\n setupGrid();\n draw();\n bindEvents();\n\n\n function executeHooks(hook, args) {\n args = [plot].concat(args);\n for (var i = 0; i < hook.length; ++i)\n hook[i].apply(this, args);\n }\n\n function initPlugins() {\n\n // References to key classes, allowing plugins to modify them\n\n var classes = {\n Canvas: Canvas\n };\n\n for (var i = 0; i < plugins.length; ++i) {\n var p = plugins[i];\n p.init(plot, classes);\n if (p.options)\n $.extend(true, options, p.options);\n }\n }\n\n function parseOptions(opts) {\n\n $.extend(true, options, opts);\n\n // $.extend merges arrays, rather than replacing them. When less\n // colors are provided than the size of the default palette, we\n // end up with those colors plus the remaining defaults, which is\n // not expected behavior; avoid it by replacing them here.\n\n if (opts && opts.colors) {\n \toptions.colors = opts.colors;\n }\n\n if (options.xaxis.color == null)\n options.xaxis.color = $.color.parse(options.grid.color).scale('a', 0.22).toString();\n if (options.yaxis.color == null)\n options.yaxis.color = $.color.parse(options.grid.color).scale('a', 0.22).toString();\n\n if (options.xaxis.tickColor == null) // grid.tickColor for back-compatibility\n options.xaxis.tickColor = options.grid.tickColor || options.xaxis.color;\n if (options.yaxis.tickColor == null) // grid.tickColor for back-compatibility\n options.yaxis.tickColor = options.grid.tickColor || options.yaxis.color;\n\n if (options.grid.borderColor == null)\n options.grid.borderColor = options.grid.color;\n if (options.grid.tickColor == null)\n options.grid.tickColor = $.color.parse(options.grid.color).scale('a', 0.22).toString();\n\n // Fill in defaults for axis options, including any unspecified\n // font-spec fields, if a font-spec was provided.\n\n // If no x/y axis options were provided, create one of each anyway,\n // since the rest of the code assumes that they exist.\n\n var i, axisOptions, axisCount,\n fontSize = placeholder.css(\"font-size\"),\n fontSizeDefault = fontSize ? +fontSize.replace(\"px\", \"\") : 13,\n fontDefaults = {\n style: placeholder.css(\"font-style\"),\n size: Math.round(0.8 * fontSizeDefault),\n variant: placeholder.css(\"font-variant\"),\n weight: placeholder.css(\"font-weight\"),\n family: placeholder.css(\"font-family\")\n };\n\n axisCount = options.xaxes.length || 1;\n for (i = 0; i < axisCount; ++i) {\n\n axisOptions = options.xaxes[i];\n if (axisOptions && !axisOptions.tickColor) {\n axisOptions.tickColor = axisOptions.color;\n }\n\n axisOptions = $.extend(true, {}, options.xaxis, axisOptions);\n options.xaxes[i] = axisOptions;\n\n if (axisOptions.font) {\n axisOptions.font = $.extend({}, fontDefaults, axisOptions.font);\n if (!axisOptions.font.color) {\n axisOptions.font.color = axisOptions.color;\n }\n if (!axisOptions.font.lineHeight) {\n axisOptions.font.lineHeight = Math.round(axisOptions.font.size * 1.15);\n }\n }\n }\n\n axisCount = options.yaxes.length || 1;\n for (i = 0; i < axisCount; ++i) {\n\n axisOptions = options.yaxes[i];\n if (axisOptions && !axisOptions.tickColor) {\n axisOptions.tickColor = axisOptions.color;\n }\n\n axisOptions = $.extend(true, {}, options.yaxis, axisOptions);\n options.yaxes[i] = axisOptions;\n\n if (axisOptions.font) {\n axisOptions.font = $.extend({}, fontDefaults, axisOptions.font);\n if (!axisOptions.font.color) {\n axisOptions.font.color = axisOptions.color;\n }\n if (!axisOptions.font.lineHeight) {\n axisOptions.font.lineHeight = Math.round(axisOptions.font.size * 1.15);\n }\n }\n }\n\n // backwards compatibility, to be removed in future\n if (options.xaxis.noTicks && options.xaxis.ticks == null)\n options.xaxis.ticks = options.xaxis.noTicks;\n if (options.yaxis.noTicks && options.yaxis.ticks == null)\n options.yaxis.ticks = options.yaxis.noTicks;\n if (options.x2axis) {\n options.xaxes[1] = $.extend(true, {}, options.xaxis, options.x2axis);\n options.xaxes[1].position = \"top\";\n // Override the inherit to allow the axis to auto-scale\n if (options.x2axis.min == null) {\n options.xaxes[1].min = null;\n }\n if (options.x2axis.max == null) {\n options.xaxes[1].max = null;\n }\n }\n if (options.y2axis) {\n options.yaxes[1] = $.extend(true, {}, options.yaxis, options.y2axis);\n options.yaxes[1].position = \"right\";\n // Override the inherit to allow the axis to auto-scale\n if (options.y2axis.min == null) {\n options.yaxes[1].min = null;\n }\n if (options.y2axis.max == null) {\n options.yaxes[1].max = null;\n }\n }\n if (options.grid.coloredAreas)\n options.grid.markings = options.grid.coloredAreas;\n if (options.grid.coloredAreasColor)\n options.grid.markingsColor = options.grid.coloredAreasColor;\n if (options.lines)\n $.extend(true, options.series.lines, options.lines);\n if (options.points)\n $.extend(true, options.series.points, options.points);\n if (options.bars)\n $.extend(true, options.series.bars, options.bars);\n if (options.shadowSize != null)\n options.series.shadowSize = options.shadowSize;\n if (options.highlightColor != null)\n options.series.highlightColor = options.highlightColor;\n\n // save options on axes for future reference\n for (i = 0; i < options.xaxes.length; ++i)\n getOrCreateAxis(xaxes, i + 1).options = options.xaxes[i];\n for (i = 0; i < options.yaxes.length; ++i)\n getOrCreateAxis(yaxes, i + 1).options = options.yaxes[i];\n\n // add hooks from options\n for (var n in hooks)\n if (options.hooks[n] && options.hooks[n].length)\n hooks[n] = hooks[n].concat(options.hooks[n]);\n\n executeHooks(hooks.processOptions, [options]);\n }\n\n function setData(d) {\n series = parseData(d);\n fillInSeriesOptions();\n processData();\n }\n\n function parseData(d) {\n var res = [];\n for (var i = 0; i < d.length; ++i) {\n var s = $.extend(true, {}, options.series);\n\n if (d[i].data != null) {\n s.data = d[i].data; // move the data instead of deep-copy\n delete d[i].data;\n\n $.extend(true, s, d[i]);\n\n d[i].data = s.data;\n }\n else\n s.data = d[i];\n res.push(s);\n }\n\n return res;\n }\n\n function axisNumber(obj, coord) {\n var a = obj[coord + \"axis\"];\n if (typeof a == \"object\") // if we got a real axis, extract number\n a = a.n;\n if (typeof a != \"number\")\n a = 1; // default to first axis\n return a;\n }\n\n function allAxes() {\n // return flat array without annoying null entries\n return $.grep(xaxes.concat(yaxes), function (a) { return a; });\n }\n\n function canvasToAxisCoords(pos) {\n // return an object with x/y corresponding to all used axes\n var res = {}, i, axis;\n for (i = 0; i < xaxes.length; ++i) {\n axis = xaxes[i];\n if (axis && axis.used)\n res[\"x\" + axis.n] = axis.c2p(pos.left);\n }\n\n for (i = 0; i < yaxes.length; ++i) {\n axis = yaxes[i];\n if (axis && axis.used)\n res[\"y\" + axis.n] = axis.c2p(pos.top);\n }\n\n if (res.x1 !== undefined)\n res.x = res.x1;\n if (res.y1 !== undefined)\n res.y = res.y1;\n\n return res;\n }\n\n function axisToCanvasCoords(pos) {\n // get canvas coords from the first pair of x/y found in pos\n var res = {}, i, axis, key;\n\n for (i = 0; i < xaxes.length; ++i) {\n axis = xaxes[i];\n if (axis && axis.used) {\n key = \"x\" + axis.n;\n if (pos[key] == null && axis.n == 1)\n key = \"x\";\n\n if (pos[key] != null) {\n res.left = axis.p2c(pos[key]);\n break;\n }\n }\n }\n\n for (i = 0; i < yaxes.length; ++i) {\n axis = yaxes[i];\n if (axis && axis.used) {\n key = \"y\" + axis.n;\n if (pos[key] == null && axis.n == 1)\n key = \"y\";\n\n if (pos[key] != null) {\n res.top = axis.p2c(pos[key]);\n break;\n }\n }\n }\n\n return res;\n }\n\n function getOrCreateAxis(axes, number) {\n if (!axes[number - 1])\n axes[number - 1] = {\n n: number, // save the number for future reference\n direction: axes == xaxes ? \"x\" : \"y\",\n options: $.extend(true, {}, axes == xaxes ? options.xaxis : options.yaxis)\n };\n\n return axes[number - 1];\n }\n\n function fillInSeriesOptions() {\n\n var neededColors = series.length, maxIndex = -1, i;\n\n // Subtract the number of series that already have fixed colors or\n // color indexes from the number that we still need to generate.\n\n for (i = 0; i < series.length; ++i) {\n var sc = series[i].color;\n if (sc != null) {\n neededColors--;\n if (typeof sc == \"number\" && sc > maxIndex) {\n maxIndex = sc;\n }\n }\n }\n\n // If any of the series have fixed color indexes, then we need to\n // generate at least as many colors as the highest index.\n\n if (neededColors <= maxIndex) {\n neededColors = maxIndex + 1;\n }\n\n // Generate all the colors, using first the option colors and then\n // variations on those colors once they're exhausted.\n\n var c, colors = [], colorPool = options.colors,\n colorPoolSize = colorPool.length, variation = 0;\n\n for (i = 0; i < neededColors; i++) {\n\n c = $.color.parse(colorPool[i % colorPoolSize] || \"#666\");\n\n // Each time we exhaust the colors in the pool we adjust\n // a scaling factor used to produce more variations on\n // those colors. The factor alternates negative/positive\n // to produce lighter/darker colors.\n\n // Reset the variation after every few cycles, or else\n // it will end up producing only white or black colors.\n\n if (i % colorPoolSize == 0 && i) {\n if (variation >= 0) {\n if (variation < 0.5) {\n variation = -variation - 0.2;\n } else variation = 0;\n } else variation = -variation;\n }\n\n colors[i] = c.scale('rgb', 1 + variation);\n }\n\n // Finalize the series options, filling in their colors\n\n var colori = 0, s;\n for (i = 0; i < series.length; ++i) {\n s = series[i];\n\n // assign colors\n if (s.color == null) {\n s.color = colors[colori].toString();\n ++colori;\n }\n else if (typeof s.color == \"number\")\n s.color = colors[s.color].toString();\n\n // turn on lines automatically in case nothing is set\n if (s.lines.show == null) {\n var v, show = true;\n for (v in s)\n if (s[v] && s[v].show) {\n show = false;\n break;\n }\n if (show)\n s.lines.show = true;\n }\n\n // If nothing was provided for lines.zero, default it to match\n // lines.fill, since areas by default should extend to zero.\n\n if (s.lines.zero == null) {\n s.lines.zero = !!s.lines.fill;\n }\n\n // setup axes\n s.xaxis = getOrCreateAxis(xaxes, axisNumber(s, \"x\"));\n s.yaxis = getOrCreateAxis(yaxes, axisNumber(s, \"y\"));\n }\n }\n\n function processData() {\n var topSentry = Number.POSITIVE_INFINITY,\n bottomSentry = Number.NEGATIVE_INFINITY,\n fakeInfinity = Number.MAX_VALUE,\n i, j, k, m, length,\n s, points, ps, x, y, axis, val, f, p,\n data, format;\n\n function updateAxis(axis, min, max) {\n if (min < axis.datamin && min != -fakeInfinity)\n axis.datamin = min;\n if (max > axis.datamax && max != fakeInfinity)\n axis.datamax = max;\n }\n\n $.each(allAxes(), function (_, axis) {\n // init axis\n axis.datamin = topSentry;\n axis.datamax = bottomSentry;\n axis.used = false;\n });\n\n for (i = 0; i < series.length; ++i) {\n s = series[i];\n s.datapoints = { points: [] };\n\n executeHooks(hooks.processRawData, [ s, s.data, s.datapoints ]);\n }\n\n // first pass: clean and copy data\n for (i = 0; i < series.length; ++i) {\n s = series[i];\n\n data = s.data;\n format = s.datapoints.format;\n\n if (!format) {\n format = [];\n // find out how to copy\n format.push({ x: true, number: true, required: true });\n format.push({ y: true, number: true, required: true });\n\n if (s.bars.show || (s.lines.show && s.lines.fill)) {\n var autoscale = !!((s.bars.show && s.bars.zero) || (s.lines.show && s.lines.zero));\n format.push({ y: true, number: true, required: false, defaultValue: 0, autoscale: autoscale });\n if (s.bars.horizontal) {\n delete format[format.length - 1].y;\n format[format.length - 1].x = true;\n }\n }\n\n s.datapoints.format = format;\n }\n\n if (s.datapoints.pointsize != null)\n continue; // already filled in\n\n s.datapoints.pointsize = format.length;\n\n ps = s.datapoints.pointsize;\n points = s.datapoints.points;\n\n var insertSteps = s.lines.show && s.lines.steps;\n s.xaxis.used = s.yaxis.used = true;\n\n for (j = k = 0; j < data.length; ++j, k += ps) {\n p = data[j];\n\n var nullify = p == null;\n if (!nullify) {\n for (m = 0; m < ps; ++m) {\n val = p[m];\n f = format[m];\n\n if (f) {\n if (f.number && val != null) {\n val = +val; // convert to number\n if (isNaN(val))\n val = null;\n else if (val == Infinity)\n val = fakeInfinity;\n else if (val == -Infinity)\n val = -fakeInfinity;\n }\n\n if (val == null) {\n if (f.required)\n nullify = true;\n\n if (f.defaultValue != null)\n val = f.defaultValue;\n }\n }\n\n points[k + m] = val;\n }\n }\n\n if (nullify) {\n for (m = 0; m < ps; ++m) {\n val = points[k + m];\n if (val != null) {\n f = format[m];\n // extract min/max info\n if (f.autoscale !== false) {\n if (f.x) {\n updateAxis(s.xaxis, val, val);\n }\n if (f.y) {\n updateAxis(s.yaxis, val, val);\n }\n }\n }\n points[k + m] = null;\n }\n }\n else {\n // a little bit of line specific stuff that\n // perhaps shouldn't be here, but lacking\n // better means...\n if (insertSteps && k > 0\n && points[k - ps] != null\n && points[k - ps] != points[k]\n && points[k - ps + 1] != points[k + 1]) {\n // copy the point to make room for a middle point\n for (m = 0; m < ps; ++m)\n points[k + ps + m] = points[k + m];\n\n // middle point has same y\n points[k + 1] = points[k - ps + 1];\n\n // we've added a point, better reflect that\n k += ps;\n }\n }\n }\n }\n\n // give the hooks a chance to run\n for (i = 0; i < series.length; ++i) {\n s = series[i];\n\n executeHooks(hooks.processDatapoints, [ s, s.datapoints]);\n }\n\n // second pass: find datamax/datamin for auto-scaling\n for (i = 0; i < series.length; ++i) {\n s = series[i];\n points = s.datapoints.points;\n ps = s.datapoints.pointsize;\n format = s.datapoints.format;\n\n var xmin = topSentry, ymin = topSentry,\n xmax = bottomSentry, ymax = bottomSentry;\n\n for (j = 0; j < points.length; j += ps) {\n if (points[j] == null)\n continue;\n\n for (m = 0; m < ps; ++m) {\n val = points[j + m];\n f = format[m];\n if (!f || f.autoscale === false || val == fakeInfinity || val == -fakeInfinity)\n continue;\n\n if (f.x) {\n if (val < xmin)\n xmin = val;\n if (val > xmax)\n xmax = val;\n }\n if (f.y) {\n if (val < ymin)\n ymin = val;\n if (val > ymax)\n ymax = val;\n }\n }\n }\n\n if (s.bars.show) {\n // make sure we got room for the bar on the dancing floor\n var delta;\n\n switch (s.bars.align) {\n case \"left\":\n delta = 0;\n break;\n case \"right\":\n delta = -s.bars.barWidth;\n break;\n default:\n delta = -s.bars.barWidth / 2;\n }\n\n if (s.bars.horizontal) {\n ymin += delta;\n ymax += delta + s.bars.barWidth;\n }\n else {\n xmin += delta;\n xmax += delta + s.bars.barWidth;\n }\n }\n\n updateAxis(s.xaxis, xmin, xmax);\n updateAxis(s.yaxis, ymin, ymax);\n }\n\n $.each(allAxes(), function (_, axis) {\n if (axis.datamin == topSentry)\n axis.datamin = null;\n if (axis.datamax == bottomSentry)\n axis.datamax = null;\n });\n }\n\n function setupCanvases() {\n\n // Make sure the placeholder is clear of everything except canvases\n // from a previous plot in this container that we'll try to re-use.\n\n placeholder.css(\"padding\", 0) // padding messes up the positioning\n .children().filter(function(){\n return !$(this).hasClass(\"flot-overlay\") && !$(this).hasClass('flot-base');\n }).remove();\n\n if (placeholder.css(\"position\") == 'static')\n placeholder.css(\"position\", \"relative\"); // for positioning labels and overlay\n\n surface = new Canvas(\"flot-base\", placeholder);\n overlay = new Canvas(\"flot-overlay\", placeholder); // overlay canvas for interactive features\n\n ctx = surface.context;\n octx = overlay.context;\n\n // define which element we're listening for events on\n eventHolder = $(overlay.element).unbind();\n\n // If we're re-using a plot object, shut down the old one\n\n var existing = placeholder.data(\"plot\");\n\n if (existing) {\n existing.shutdown();\n overlay.clear();\n }\n\n // save in case we get replotted\n placeholder.data(\"plot\", plot);\n }\n\n function bindEvents() {\n // bind events\n if (options.grid.hoverable) {\n eventHolder.mousemove(onMouseMove);\n\n // Use bind, rather than .mouseleave, because we officially\n // still support jQuery 1.2.6, which doesn't define a shortcut\n // for mouseenter or mouseleave. This was a bug/oversight that\n // was fixed somewhere around 1.3.x. We can return to using\n // .mouseleave when we drop support for 1.2.6.\n\n eventHolder.bind(\"mouseleave\", onMouseLeave);\n }\n\n if (options.grid.clickable)\n eventHolder.click(onClick);\n\n executeHooks(hooks.bindEvents, [eventHolder]);\n }\n\n function shutdown() {\n if (redrawTimeout)\n clearTimeout(redrawTimeout);\n\n eventHolder.unbind(\"mousemove\", onMouseMove);\n eventHolder.unbind(\"mouseleave\", onMouseLeave);\n eventHolder.unbind(\"click\", onClick);\n\n executeHooks(hooks.shutdown, [eventHolder]);\n }\n\n function setTransformationHelpers(axis) {\n // set helper functions on the axis, assumes plot area\n // has been computed already\n\n function identity(x) { return x; }\n\n var s, m, t = axis.options.transform || identity,\n it = axis.options.inverseTransform;\n\n // precompute how much the axis is scaling a point\n // in canvas space\n if (axis.direction == \"x\") {\n s = axis.scale = plotWidth / Math.abs(t(axis.max) - t(axis.min));\n m = Math.min(t(axis.max), t(axis.min));\n }\n else {\n s = axis.scale = plotHeight / Math.abs(t(axis.max) - t(axis.min));\n s = -s;\n m = Math.max(t(axis.max), t(axis.min));\n }\n\n // data point to canvas coordinate\n if (t == identity) // slight optimization\n axis.p2c = function (p) { return (p - m) * s; };\n else\n axis.p2c = function (p) { return (t(p) - m) * s; };\n // canvas coordinate to data point\n if (!it)\n axis.c2p = function (c) { return m + c / s; };\n else\n axis.c2p = function (c) { return it(m + c / s); };\n }\n\n function measureTickLabels(axis) {\n\n var opts = axis.options,\n ticks = axis.ticks || [],\n labelWidth = opts.labelWidth || 0,\n labelHeight = opts.labelHeight || 0,\n maxWidth = labelWidth || (axis.direction == \"x\" ? Math.floor(surface.width / (ticks.length || 1)) : null),\n legacyStyles = axis.direction + \"Axis \" + axis.direction + axis.n + \"Axis\",\n layer = \"flot-\" + axis.direction + \"-axis flot-\" + axis.direction + axis.n + \"-axis \" + legacyStyles,\n font = opts.font || \"flot-tick-label tickLabel\";\n\n for (var i = 0; i < ticks.length; ++i) {\n\n var t = ticks[i];\n\n if (!t.label)\n continue;\n\n var info = surface.getTextInfo(layer, t.label, font, null, maxWidth);\n\n labelWidth = Math.max(labelWidth, info.width);\n labelHeight = Math.max(labelHeight, info.height);\n }\n\n axis.labelWidth = opts.labelWidth || labelWidth;\n axis.labelHeight = opts.labelHeight || labelHeight;\n }\n\n function allocateAxisBoxFirstPhase(axis) {\n // find the bounding box of the axis by looking at label\n // widths/heights and ticks, make room by diminishing the\n // plotOffset; this first phase only looks at one\n // dimension per axis, the other dimension depends on the\n // other axes so will have to wait\n\n var lw = axis.labelWidth,\n lh = axis.labelHeight,\n pos = axis.options.position,\n isXAxis = axis.direction === \"x\",\n tickLength = axis.options.tickLength,\n axisMargin = options.grid.axisMargin,\n padding = options.grid.labelMargin,\n innermost = true,\n outermost = true,\n first = true,\n found = false;\n\n // Determine the axis's position in its direction and on its side\n\n $.each(isXAxis ? xaxes : yaxes, function(i, a) {\n if (a && (a.show || a.reserveSpace)) {\n if (a === axis) {\n found = true;\n } else if (a.options.position === pos) {\n if (found) {\n outermost = false;\n } else {\n innermost = false;\n }\n }\n if (!found) {\n first = false;\n }\n }\n });\n\n // The outermost axis on each side has no margin\n\n if (outermost) {\n axisMargin = 0;\n }\n\n // The ticks for the first axis in each direction stretch across\n\n if (tickLength == null) {\n tickLength = first ? \"full\" : 5;\n }\n\n if (!isNaN(+tickLength))\n padding += +tickLength;\n\n if (isXAxis) {\n lh += padding;\n\n if (pos == \"bottom\") {\n plotOffset.bottom += lh + axisMargin;\n axis.box = { top: surface.height - plotOffset.bottom, height: lh };\n }\n else {\n axis.box = { top: plotOffset.top + axisMargin, height: lh };\n plotOffset.top += lh + axisMargin;\n }\n }\n else {\n lw += padding;\n\n if (pos == \"left\") {\n axis.box = { left: plotOffset.left + axisMargin, width: lw };\n plotOffset.left += lw + axisMargin;\n }\n else {\n plotOffset.right += lw + axisMargin;\n axis.box = { left: surface.width - plotOffset.right, width: lw };\n }\n }\n\n // save for future reference\n axis.position = pos;\n axis.tickLength = tickLength;\n axis.box.padding = padding;\n axis.innermost = innermost;\n }\n\n function allocateAxisBoxSecondPhase(axis) {\n // now that all axis boxes have been placed in one\n // dimension, we can set the remaining dimension coordinates\n if (axis.direction == \"x\") {\n axis.box.left = plotOffset.left - axis.labelWidth / 2;\n axis.box.width = surface.width - plotOffset.left - plotOffset.right + axis.labelWidth;\n }\n else {\n axis.box.top = plotOffset.top - axis.labelHeight / 2;\n axis.box.height = surface.height - plotOffset.bottom - plotOffset.top + axis.labelHeight;\n }\n }\n\n function adjustLayoutForThingsStickingOut() {\n // possibly adjust plot offset to ensure everything stays\n // inside the canvas and isn't clipped off\n\n var minMargin = options.grid.minBorderMargin,\n axis, i;\n\n // check stuff from the plot (FIXME: this should just read\n // a value from the series, otherwise it's impossible to\n // customize)\n if (minMargin == null) {\n minMargin = 0;\n for (i = 0; i < series.length; ++i)\n minMargin = Math.max(minMargin, 2 * (series[i].points.radius + series[i].points.lineWidth/2));\n }\n\n var margins = {\n left: minMargin,\n right: minMargin,\n top: minMargin,\n bottom: minMargin\n };\n\n // check axis labels, note we don't check the actual\n // labels but instead use the overall width/height to not\n // jump as much around with replots\n $.each(allAxes(), function (_, axis) {\n if (axis.reserveSpace && axis.ticks && axis.ticks.length) {\n if (axis.direction === \"x\") {\n margins.left = Math.max(margins.left, axis.labelWidth / 2);\n margins.right = Math.max(margins.right, axis.labelWidth / 2);\n } else {\n margins.bottom = Math.max(margins.bottom, axis.labelHeight / 2);\n margins.top = Math.max(margins.top, axis.labelHeight / 2);\n }\n }\n });\n\n plotOffset.left = Math.ceil(Math.max(margins.left, plotOffset.left));\n plotOffset.right = Math.ceil(Math.max(margins.right, plotOffset.right));\n plotOffset.top = Math.ceil(Math.max(margins.top, plotOffset.top));\n plotOffset.bottom = Math.ceil(Math.max(margins.bottom, plotOffset.bottom));\n }\n\n function setupGrid() {\n var i, axes = allAxes(), showGrid = options.grid.show;\n\n // Initialize the plot's offset from the edge of the canvas\n\n for (var a in plotOffset) {\n var margin = options.grid.margin || 0;\n plotOffset[a] = typeof margin == \"number\" ? margin : margin[a] || 0;\n }\n\n executeHooks(hooks.processOffset, [plotOffset]);\n\n // If the grid is visible, add its border width to the offset\n\n for (var a in plotOffset) {\n if(typeof(options.grid.borderWidth) == \"object\") {\n plotOffset[a] += showGrid ? options.grid.borderWidth[a] : 0;\n }\n else {\n plotOffset[a] += showGrid ? options.grid.borderWidth : 0;\n }\n }\n\n $.each(axes, function (_, axis) {\n var axisOpts = axis.options;\n axis.show = axisOpts.show == null ? axis.used : axisOpts.show;\n axis.reserveSpace = axisOpts.reserveSpace == null ? axis.show : axisOpts.reserveSpace;\n setRange(axis);\n });\n\n if (showGrid) {\n\n var allocatedAxes = $.grep(axes, function (axis) {\n return axis.show || axis.reserveSpace;\n });\n\n $.each(allocatedAxes, function (_, axis) {\n // make the ticks\n setupTickGeneration(axis);\n setTicks(axis);\n snapRangeToTicks(axis, axis.ticks);\n // find labelWidth/Height for axis\n measureTickLabels(axis);\n });\n\n // with all dimensions calculated, we can compute the\n // axis bounding boxes, start from the outside\n // (reverse order)\n for (i = allocatedAxes.length - 1; i >= 0; --i)\n allocateAxisBoxFirstPhase(allocatedAxes[i]);\n\n // make sure we've got enough space for things that\n // might stick out\n adjustLayoutForThingsStickingOut();\n\n $.each(allocatedAxes, function (_, axis) {\n allocateAxisBoxSecondPhase(axis);\n });\n }\n\n plotWidth = surface.width - plotOffset.left - plotOffset.right;\n plotHeight = surface.height - plotOffset.bottom - plotOffset.top;\n\n // now we got the proper plot dimensions, we can compute the scaling\n $.each(axes, function (_, axis) {\n setTransformationHelpers(axis);\n });\n\n if (showGrid) {\n drawAxisLabels();\n }\n\n insertLegend();\n }\n\n function setRange(axis) {\n var opts = axis.options,\n min = +(opts.min != null ? opts.min : axis.datamin),\n max = +(opts.max != null ? opts.max : axis.datamax),\n delta = max - min;\n\n if (delta == 0.0) {\n // degenerate case\n var widen = max == 0 ? 1 : 0.01;\n\n if (opts.min == null)\n min -= widen;\n // always widen max if we couldn't widen min to ensure we\n // don't fall into min == max which doesn't work\n if (opts.max == null || opts.min != null)\n max += widen;\n }\n else {\n // consider autoscaling\n var margin = opts.autoscaleMargin;\n if (margin != null) {\n if (opts.min == null) {\n min -= delta * margin;\n // make sure we don't go below zero if all values\n // are positive\n if (min < 0 && axis.datamin != null && axis.datamin >= 0)\n min = 0;\n }\n if (opts.max == null) {\n max += delta * margin;\n if (max > 0 && axis.datamax != null && axis.datamax <= 0)\n max = 0;\n }\n }\n }\n axis.min = min;\n axis.max = max;\n }\n\n function setupTickGeneration(axis) {\n var opts = axis.options;\n\n // estimate number of ticks\n var noTicks;\n if (typeof opts.ticks == \"number\" && opts.ticks > 0)\n noTicks = opts.ticks;\n else\n // heuristic based on the model a*sqrt(x) fitted to\n // some data points that seemed reasonable\n noTicks = 0.3 * Math.sqrt(axis.direction == \"x\" ? surface.width : surface.height);\n\n var delta = (axis.max - axis.min) / noTicks,\n dec = -Math.floor(Math.log(delta) / Math.LN10),\n maxDec = opts.tickDecimals;\n\n if (maxDec != null && dec > maxDec) {\n dec = maxDec;\n }\n\n var magn = Math.pow(10, -dec),\n norm = delta / magn, // norm is between 1.0 and 10.0\n size;\n\n if (norm < 1.5) {\n size = 1;\n } else if (norm < 3) {\n size = 2;\n // special case for 2.5, requires an extra decimal\n if (norm > 2.25 && (maxDec == null || dec + 1 <= maxDec)) {\n size = 2.5;\n ++dec;\n }\n } else if (norm < 7.5) {\n size = 5;\n } else {\n size = 10;\n }\n\n size *= magn;\n\n if (opts.minTickSize != null && size < opts.minTickSize) {\n size = opts.minTickSize;\n }\n\n axis.delta = delta;\n axis.tickDecimals = Math.max(0, maxDec != null ? maxDec : dec);\n axis.tickSize = opts.tickSize || size;\n\n // Time mode was moved to a plug-in in 0.8, and since so many people use it\n // we'll add an especially friendly reminder to make sure they included it.\n\n if (opts.mode == \"time\" && !axis.tickGenerator) {\n throw new Error(\"Time mode requires the flot.time plugin.\");\n }\n\n // Flot supports base-10 axes; any other mode else is handled by a plug-in,\n // like flot.time.js.\n\n if (!axis.tickGenerator) {\n\n axis.tickGenerator = function (axis) {\n\n var ticks = [],\n start = floorInBase(axis.min, axis.tickSize),\n i = 0,\n v = Number.NaN,\n prev;\n\n do {\n prev = v;\n v = start + i * axis.tickSize;\n ticks.push(v);\n ++i;\n } while (v < axis.max && v != prev);\n return ticks;\n };\n\n\t\t\t\taxis.tickFormatter = function (value, axis) {\n\n\t\t\t\t\tvar factor = axis.tickDecimals ? Math.pow(10, axis.tickDecimals) : 1;\n\t\t\t\t\tvar formatted = \"\" + Math.round(value * factor) / factor;\n\n\t\t\t\t\t// If tickDecimals was specified, ensure that we have exactly that\n\t\t\t\t\t// much precision; otherwise default to the value's own precision.\n\n\t\t\t\t\tif (axis.tickDecimals != null) {\n\t\t\t\t\t\tvar decimal = formatted.indexOf(\".\");\n\t\t\t\t\t\tvar precision = decimal == -1 ? 0 : formatted.length - decimal - 1;\n\t\t\t\t\t\tif (precision < axis.tickDecimals) {\n\t\t\t\t\t\t\treturn (precision ? formatted : formatted + \".\") + (\"\" + factor).substr(1, axis.tickDecimals - precision);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n return formatted;\n };\n }\n\n if ($.isFunction(opts.tickFormatter))\n axis.tickFormatter = function (v, axis) { return \"\" + opts.tickFormatter(v, axis); };\n\n if (opts.alignTicksWithAxis != null) {\n var otherAxis = (axis.direction == \"x\" ? xaxes : yaxes)[opts.alignTicksWithAxis - 1];\n if (otherAxis && otherAxis.used && otherAxis != axis) {\n // consider snapping min/max to outermost nice ticks\n var niceTicks = axis.tickGenerator(axis);\n if (niceTicks.length > 0) {\n if (opts.min == null)\n axis.min = Math.min(axis.min, niceTicks[0]);\n if (opts.max == null && niceTicks.length > 1)\n axis.max = Math.max(axis.max, niceTicks[niceTicks.length - 1]);\n }\n\n axis.tickGenerator = function (axis) {\n // copy ticks, scaled to this axis\n var ticks = [], v, i;\n for (i = 0; i < otherAxis.ticks.length; ++i) {\n v = (otherAxis.ticks[i].v - otherAxis.min) / (otherAxis.max - otherAxis.min);\n v = axis.min + v * (axis.max - axis.min);\n ticks.push(v);\n }\n return ticks;\n };\n\n // we might need an extra decimal since forced\n // ticks don't necessarily fit naturally\n if (!axis.mode && opts.tickDecimals == null) {\n var extraDec = Math.max(0, -Math.floor(Math.log(axis.delta) / Math.LN10) + 1),\n ts = axis.tickGenerator(axis);\n\n // only proceed if the tick interval rounded\n // with an extra decimal doesn't give us a\n // zero at end\n if (!(ts.length > 1 && /\\..*0$/.test((ts[1] - ts[0]).toFixed(extraDec))))\n axis.tickDecimals = extraDec;\n }\n }\n }\n }\n\n function setTicks(axis) {\n var oticks = axis.options.ticks, ticks = [];\n if (oticks == null || (typeof oticks == \"number\" && oticks > 0))\n ticks = axis.tickGenerator(axis);\n else if (oticks) {\n if ($.isFunction(oticks))\n // generate the ticks\n ticks = oticks(axis);\n else\n ticks = oticks;\n }\n\n // clean up/labelify the supplied ticks, copy them over\n var i, v;\n axis.ticks = [];\n for (i = 0; i < ticks.length; ++i) {\n var label = null;\n var t = ticks[i];\n if (typeof t == \"object\") {\n v = +t[0];\n if (t.length > 1)\n label = t[1];\n }\n else\n v = +t;\n if (label == null)\n label = axis.tickFormatter(v, axis);\n if (!isNaN(v))\n axis.ticks.push({ v: v, label: label });\n }\n }\n\n function snapRangeToTicks(axis, ticks) {\n if (axis.options.autoscaleMargin && ticks.length > 0) {\n // snap to ticks\n if (axis.options.min == null)\n axis.min = Math.min(axis.min, ticks[0].v);\n if (axis.options.max == null && ticks.length > 1)\n axis.max = Math.max(axis.max, ticks[ticks.length - 1].v);\n }\n }\n\n function draw() {\n\n surface.clear();\n\n executeHooks(hooks.drawBackground, [ctx]);\n\n var grid = options.grid;\n\n // draw background, if any\n if (grid.show && grid.backgroundColor)\n drawBackground();\n\n if (grid.show && !grid.aboveData) {\n drawGrid();\n }\n\n for (var i = 0; i < series.length; ++i) {\n executeHooks(hooks.drawSeries, [ctx, series[i]]);\n drawSeries(series[i]);\n }\n\n executeHooks(hooks.draw, [ctx]);\n\n if (grid.show && grid.aboveData) {\n drawGrid();\n }\n\n surface.render();\n\n // A draw implies that either the axes or data have changed, so we\n // should probably update the overlay highlights as well.\n\n triggerRedrawOverlay();\n }\n\n function extractRange(ranges, coord) {\n var axis, from, to, key, axes = allAxes();\n\n for (var i = 0; i < axes.length; ++i) {\n axis = axes[i];\n if (axis.direction == coord) {\n key = coord + axis.n + \"axis\";\n if (!ranges[key] && axis.n == 1)\n key = coord + \"axis\"; // support x1axis as xaxis\n if (ranges[key]) {\n from = ranges[key].from;\n to = ranges[key].to;\n break;\n }\n }\n }\n\n // backwards-compat stuff - to be removed in future\n if (!ranges[key]) {\n axis = coord == \"x\" ? xaxes[0] : yaxes[0];\n from = ranges[coord + \"1\"];\n to = ranges[coord + \"2\"];\n }\n\n // auto-reverse as an added bonus\n if (from != null && to != null && from > to) {\n var tmp = from;\n from = to;\n to = tmp;\n }\n\n return { from: from, to: to, axis: axis };\n }\n\n function drawBackground() {\n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n\n ctx.fillStyle = getColorOrGradient(options.grid.backgroundColor, plotHeight, 0, \"rgba(255, 255, 255, 0)\");\n ctx.fillRect(0, 0, plotWidth, plotHeight);\n ctx.restore();\n }\n\n function drawGrid() {\n var i, axes, bw, bc;\n\n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n\n // draw markings\n var markings = options.grid.markings;\n if (markings) {\n if ($.isFunction(markings)) {\n axes = plot.getAxes();\n // xmin etc. is backwards compatibility, to be\n // removed in the future\n axes.xmin = axes.xaxis.min;\n axes.xmax = axes.xaxis.max;\n axes.ymin = axes.yaxis.min;\n axes.ymax = axes.yaxis.max;\n\n markings = markings(axes);\n }\n\n for (i = 0; i < markings.length; ++i) {\n var m = markings[i],\n xrange = extractRange(m, \"x\"),\n yrange = extractRange(m, \"y\");\n\n // fill in missing\n if (xrange.from == null)\n xrange.from = xrange.axis.min;\n if (xrange.to == null)\n xrange.to = xrange.axis.max;\n if (yrange.from == null)\n yrange.from = yrange.axis.min;\n if (yrange.to == null)\n yrange.to = yrange.axis.max;\n\n // clip\n if (xrange.to < xrange.axis.min || xrange.from > xrange.axis.max ||\n yrange.to < yrange.axis.min || yrange.from > yrange.axis.max)\n continue;\n\n xrange.from = Math.max(xrange.from, xrange.axis.min);\n xrange.to = Math.min(xrange.to, xrange.axis.max);\n yrange.from = Math.max(yrange.from, yrange.axis.min);\n yrange.to = Math.min(yrange.to, yrange.axis.max);\n\n var xequal = xrange.from === xrange.to,\n yequal = yrange.from === yrange.to;\n\n if (xequal && yequal) {\n continue;\n }\n\n // then draw\n xrange.from = Math.floor(xrange.axis.p2c(xrange.from));\n xrange.to = Math.floor(xrange.axis.p2c(xrange.to));\n yrange.from = Math.floor(yrange.axis.p2c(yrange.from));\n yrange.to = Math.floor(yrange.axis.p2c(yrange.to));\n\n if (xequal || yequal) {\n var lineWidth = m.lineWidth || options.grid.markingsLineWidth,\n subPixel = lineWidth % 2 ? 0.5 : 0;\n ctx.beginPath();\n ctx.strokeStyle = m.color || options.grid.markingsColor;\n ctx.lineWidth = lineWidth;\n if (xequal) {\n ctx.moveTo(xrange.to + subPixel, yrange.from);\n ctx.lineTo(xrange.to + subPixel, yrange.to);\n } else {\n ctx.moveTo(xrange.from, yrange.to + subPixel);\n ctx.lineTo(xrange.to, yrange.to + subPixel);\n }\n ctx.stroke();\n } else {\n ctx.fillStyle = m.color || options.grid.markingsColor;\n ctx.fillRect(xrange.from, yrange.to,\n xrange.to - xrange.from,\n yrange.from - yrange.to);\n }\n }\n }\n\n // draw the ticks\n axes = allAxes();\n bw = options.grid.borderWidth;\n\n for (var j = 0; j < axes.length; ++j) {\n var axis = axes[j], box = axis.box,\n t = axis.tickLength, x, y, xoff, yoff;\n if (!axis.show || axis.ticks.length == 0)\n continue;\n\n ctx.lineWidth = 1;\n\n // find the edges\n if (axis.direction == \"x\") {\n x = 0;\n if (t == \"full\")\n y = (axis.position == \"top\" ? 0 : plotHeight);\n else\n y = box.top - plotOffset.top + (axis.position == \"top\" ? box.height : 0);\n }\n else {\n y = 0;\n if (t == \"full\")\n x = (axis.position == \"left\" ? 0 : plotWidth);\n else\n x = box.left - plotOffset.left + (axis.position == \"left\" ? box.width : 0);\n }\n\n // draw tick bar\n if (!axis.innermost) {\n ctx.strokeStyle = axis.options.color;\n ctx.beginPath();\n xoff = yoff = 0;\n if (axis.direction == \"x\")\n xoff = plotWidth + 1;\n else\n yoff = plotHeight + 1;\n\n if (ctx.lineWidth == 1) {\n if (axis.direction == \"x\") {\n y = Math.floor(y) + 0.5;\n } else {\n x = Math.floor(x) + 0.5;\n }\n }\n\n ctx.moveTo(x, y);\n ctx.lineTo(x + xoff, y + yoff);\n ctx.stroke();\n }\n\n // draw ticks\n\n ctx.strokeStyle = axis.options.tickColor;\n\n ctx.beginPath();\n for (i = 0; i < axis.ticks.length; ++i) {\n var v = axis.ticks[i].v;\n\n xoff = yoff = 0;\n\n if (isNaN(v) || v < axis.min || v > axis.max\n // skip those lying on the axes if we got a border\n || (t == \"full\"\n && ((typeof bw == \"object\" && bw[axis.position] > 0) || bw > 0)\n && (v == axis.min || v == axis.max)))\n continue;\n\n if (axis.direction == \"x\") {\n x = axis.p2c(v);\n yoff = t == \"full\" ? -plotHeight : t;\n\n if (axis.position == \"top\")\n yoff = -yoff;\n }\n else {\n y = axis.p2c(v);\n xoff = t == \"full\" ? -plotWidth : t;\n\n if (axis.position == \"left\")\n xoff = -xoff;\n }\n\n if (ctx.lineWidth == 1) {\n if (axis.direction == \"x\")\n x = Math.floor(x) + 0.5;\n else\n y = Math.floor(y) + 0.5;\n }\n\n ctx.moveTo(x, y);\n ctx.lineTo(x + xoff, y + yoff);\n }\n\n ctx.stroke();\n }\n\n\n // draw border\n if (bw) {\n // If either borderWidth or borderColor is an object, then draw the border\n // line by line instead of as one rectangle\n bc = options.grid.borderColor;\n if(typeof bw == \"object\" || typeof bc == \"object\") {\n if (typeof bw !== \"object\") {\n bw = {top: bw, right: bw, bottom: bw, left: bw};\n }\n if (typeof bc !== \"object\") {\n bc = {top: bc, right: bc, bottom: bc, left: bc};\n }\n\n if (bw.top > 0) {\n ctx.strokeStyle = bc.top;\n ctx.lineWidth = bw.top;\n ctx.beginPath();\n ctx.moveTo(0 - bw.left, 0 - bw.top/2);\n ctx.lineTo(plotWidth, 0 - bw.top/2);\n ctx.stroke();\n }\n\n if (bw.right > 0) {\n ctx.strokeStyle = bc.right;\n ctx.lineWidth = bw.right;\n ctx.beginPath();\n ctx.moveTo(plotWidth + bw.right / 2, 0 - bw.top);\n ctx.lineTo(plotWidth + bw.right / 2, plotHeight);\n ctx.stroke();\n }\n\n if (bw.bottom > 0) {\n ctx.strokeStyle = bc.bottom;\n ctx.lineWidth = bw.bottom;\n ctx.beginPath();\n ctx.moveTo(plotWidth + bw.right, plotHeight + bw.bottom / 2);\n ctx.lineTo(0, plotHeight + bw.bottom / 2);\n ctx.stroke();\n }\n\n if (bw.left > 0) {\n ctx.strokeStyle = bc.left;\n ctx.lineWidth = bw.left;\n ctx.beginPath();\n ctx.moveTo(0 - bw.left/2, plotHeight + bw.bottom);\n ctx.lineTo(0- bw.left/2, 0);\n ctx.stroke();\n }\n }\n else {\n ctx.lineWidth = bw;\n ctx.strokeStyle = options.grid.borderColor;\n ctx.strokeRect(-bw/2, -bw/2, plotWidth + bw, plotHeight + bw);\n }\n }\n\n ctx.restore();\n }\n\n function drawAxisLabels() {\n\n $.each(allAxes(), function (_, axis) {\n var box = axis.box,\n legacyStyles = axis.direction + \"Axis \" + axis.direction + axis.n + \"Axis\",\n layer = \"flot-\" + axis.direction + \"-axis flot-\" + axis.direction + axis.n + \"-axis \" + legacyStyles,\n font = axis.options.font || \"flot-tick-label tickLabel\",\n tick, x, y, halign, valign;\n\n // Remove text before checking for axis.show and ticks.length;\n // otherwise plugins, like flot-tickrotor, that draw their own\n // tick labels will end up with both theirs and the defaults.\n\n surface.removeText(layer);\n\n if (!axis.show || axis.ticks.length == 0)\n return;\n\n for (var i = 0; i < axis.ticks.length; ++i) {\n\n tick = axis.ticks[i];\n if (!tick.label || tick.v < axis.min || tick.v > axis.max)\n continue;\n\n if (axis.direction == \"x\") {\n halign = \"center\";\n x = plotOffset.left + axis.p2c(tick.v);\n if (axis.position == \"bottom\") {\n y = box.top + box.padding;\n } else {\n y = box.top + box.height - box.padding;\n valign = \"bottom\";\n }\n } else {\n valign = \"middle\";\n y = plotOffset.top + axis.p2c(tick.v);\n if (axis.position == \"left\") {\n x = box.left + box.width - box.padding;\n halign = \"right\";\n } else {\n x = box.left + box.padding;\n }\n }\n\n surface.addText(layer, x, y, tick.label, font, null, null, halign, valign);\n }\n });\n }\n\n function drawSeries(series) {\n if (series.lines.show)\n drawSeriesLines(series);\n if (series.bars.show)\n drawSeriesBars(series);\n if (series.points.show)\n drawSeriesPoints(series);\n }\n\n function drawSeriesLines(series) {\n function plotLine(datapoints, xoffset, yoffset, axisx, axisy) {\n var points = datapoints.points,\n ps = datapoints.pointsize,\n prevx = null, prevy = null;\n\n ctx.beginPath();\n for (var i = ps; i < points.length; i += ps) {\n var x1 = points[i - ps], y1 = points[i - ps + 1],\n x2 = points[i], y2 = points[i + 1];\n\n if (x1 == null || x2 == null)\n continue;\n\n // clip with ymin\n if (y1 <= y2 && y1 < axisy.min) {\n if (y2 < axisy.min)\n continue; // line segment is outside\n // compute new intersection point\n x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n y1 = axisy.min;\n }\n else if (y2 <= y1 && y2 < axisy.min) {\n if (y1 < axisy.min)\n continue;\n x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n y2 = axisy.min;\n }\n\n // clip with ymax\n if (y1 >= y2 && y1 > axisy.max) {\n if (y2 > axisy.max)\n continue;\n x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n y1 = axisy.max;\n }\n else if (y2 >= y1 && y2 > axisy.max) {\n if (y1 > axisy.max)\n continue;\n x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n y2 = axisy.max;\n }\n\n // clip with xmin\n if (x1 <= x2 && x1 < axisx.min) {\n if (x2 < axisx.min)\n continue;\n y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n x1 = axisx.min;\n }\n else if (x2 <= x1 && x2 < axisx.min) {\n if (x1 < axisx.min)\n continue;\n y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n x2 = axisx.min;\n }\n\n // clip with xmax\n if (x1 >= x2 && x1 > axisx.max) {\n if (x2 > axisx.max)\n continue;\n y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n x1 = axisx.max;\n }\n else if (x2 >= x1 && x2 > axisx.max) {\n if (x1 > axisx.max)\n continue;\n y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n x2 = axisx.max;\n }\n\n if (x1 != prevx || y1 != prevy)\n ctx.moveTo(axisx.p2c(x1) + xoffset, axisy.p2c(y1) + yoffset);\n\n prevx = x2;\n prevy = y2;\n ctx.lineTo(axisx.p2c(x2) + xoffset, axisy.p2c(y2) + yoffset);\n }\n ctx.stroke();\n }\n\n function plotLineArea(datapoints, axisx, axisy) {\n var points = datapoints.points,\n ps = datapoints.pointsize,\n bottom = Math.min(Math.max(0, axisy.min), axisy.max),\n i = 0, top, areaOpen = false,\n ypos = 1, segmentStart = 0, segmentEnd = 0;\n\n // we process each segment in two turns, first forward\n // direction to sketch out top, then once we hit the\n // end we go backwards to sketch the bottom\n while (true) {\n if (ps > 0 && i > points.length + ps)\n break;\n\n i += ps; // ps is negative if going backwards\n\n var x1 = points[i - ps],\n y1 = points[i - ps + ypos],\n x2 = points[i], y2 = points[i + ypos];\n\n if (areaOpen) {\n if (ps > 0 && x1 != null && x2 == null) {\n // at turning point\n segmentEnd = i;\n ps = -ps;\n ypos = 2;\n continue;\n }\n\n if (ps < 0 && i == segmentStart + ps) {\n // done with the reverse sweep\n ctx.fill();\n areaOpen = false;\n ps = -ps;\n ypos = 1;\n i = segmentStart = segmentEnd + ps;\n continue;\n }\n }\n\n if (x1 == null || x2 == null)\n continue;\n\n // clip x values\n\n // clip with xmin\n if (x1 <= x2 && x1 < axisx.min) {\n if (x2 < axisx.min)\n continue;\n y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n x1 = axisx.min;\n }\n else if (x2 <= x1 && x2 < axisx.min) {\n if (x1 < axisx.min)\n continue;\n y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n x2 = axisx.min;\n }\n\n // clip with xmax\n if (x1 >= x2 && x1 > axisx.max) {\n if (x2 > axisx.max)\n continue;\n y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n x1 = axisx.max;\n }\n else if (x2 >= x1 && x2 > axisx.max) {\n if (x1 > axisx.max)\n continue;\n y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n x2 = axisx.max;\n }\n\n if (!areaOpen) {\n // open area\n ctx.beginPath();\n ctx.moveTo(axisx.p2c(x1), axisy.p2c(bottom));\n areaOpen = true;\n }\n\n // now first check the case where both is outside\n if (y1 >= axisy.max && y2 >= axisy.max) {\n ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.max));\n ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.max));\n continue;\n }\n else if (y1 <= axisy.min && y2 <= axisy.min) {\n ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.min));\n ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.min));\n continue;\n }\n\n // else it's a bit more complicated, there might\n // be a flat maxed out rectangle first, then a\n // triangular cutout or reverse; to find these\n // keep track of the current x values\n var x1old = x1, x2old = x2;\n\n // clip the y values, without shortcutting, we\n // go through all cases in turn\n\n // clip with ymin\n if (y1 <= y2 && y1 < axisy.min && y2 >= axisy.min) {\n x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n y1 = axisy.min;\n }\n else if (y2 <= y1 && y2 < axisy.min && y1 >= axisy.min) {\n x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n y2 = axisy.min;\n }\n\n // clip with ymax\n if (y1 >= y2 && y1 > axisy.max && y2 <= axisy.max) {\n x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n y1 = axisy.max;\n }\n else if (y2 >= y1 && y2 > axisy.max && y1 <= axisy.max) {\n x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n y2 = axisy.max;\n }\n\n // if the x value was changed we got a rectangle\n // to fill\n if (x1 != x1old) {\n ctx.lineTo(axisx.p2c(x1old), axisy.p2c(y1));\n // it goes to (x1, y1), but we fill that below\n }\n\n // fill triangular section, this sometimes result\n // in redundant points if (x1, y1) hasn't changed\n // from previous line to, but we just ignore that\n ctx.lineTo(axisx.p2c(x1), axisy.p2c(y1));\n ctx.lineTo(axisx.p2c(x2), axisy.p2c(y2));\n\n // fill the other rectangle if it's there\n if (x2 != x2old) {\n ctx.lineTo(axisx.p2c(x2), axisy.p2c(y2));\n ctx.lineTo(axisx.p2c(x2old), axisy.p2c(y2));\n }\n }\n }\n\n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n ctx.lineJoin = \"round\";\n\n var lw = series.lines.lineWidth,\n sw = series.shadowSize;\n // FIXME: consider another form of shadow when filling is turned on\n if (lw > 0 && sw > 0) {\n // draw shadow as a thick and thin line with transparency\n ctx.lineWidth = sw;\n ctx.strokeStyle = \"rgba(0,0,0,0.1)\";\n // position shadow at angle from the mid of line\n var angle = Math.PI/18;\n plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/2), Math.cos(angle) * (lw/2 + sw/2), series.xaxis, series.yaxis);\n ctx.lineWidth = sw/2;\n plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/4), Math.cos(angle) * (lw/2 + sw/4), series.xaxis, series.yaxis);\n }\n\n ctx.lineWidth = lw;\n ctx.strokeStyle = series.color;\n var fillStyle = getFillStyle(series.lines, series.color, 0, plotHeight);\n if (fillStyle) {\n ctx.fillStyle = fillStyle;\n plotLineArea(series.datapoints, series.xaxis, series.yaxis);\n }\n\n if (lw > 0)\n plotLine(series.datapoints, 0, 0, series.xaxis, series.yaxis);\n ctx.restore();\n }\n\n function drawSeriesPoints(series) {\n function plotPoints(datapoints, radius, fillStyle, offset, shadow, axisx, axisy, symbol) {\n var points = datapoints.points, ps = datapoints.pointsize;\n\n for (var i = 0; i < points.length; i += ps) {\n var x = points[i], y = points[i + 1];\n if (x == null || x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max)\n continue;\n\n ctx.beginPath();\n x = axisx.p2c(x);\n y = axisy.p2c(y) + offset;\n if (symbol == \"circle\")\n ctx.arc(x, y, radius, 0, shadow ? Math.PI : Math.PI * 2, false);\n else\n symbol(ctx, x, y, radius, shadow);\n ctx.closePath();\n\n if (fillStyle) {\n ctx.fillStyle = fillStyle;\n ctx.fill();\n }\n ctx.stroke();\n }\n }\n\n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n\n var lw = series.points.lineWidth,\n sw = series.shadowSize,\n radius = series.points.radius,\n symbol = series.points.symbol;\n\n // If the user sets the line width to 0, we change it to a very\n // small value. A line width of 0 seems to force the default of 1.\n // Doing the conditional here allows the shadow setting to still be\n // optional even with a lineWidth of 0.\n\n if( lw == 0 )\n lw = 0.0001;\n\n if (lw > 0 && sw > 0) {\n // draw shadow in two steps\n var w = sw / 2;\n ctx.lineWidth = w;\n ctx.strokeStyle = \"rgba(0,0,0,0.1)\";\n plotPoints(series.datapoints, radius, null, w + w/2, true,\n series.xaxis, series.yaxis, symbol);\n\n ctx.strokeStyle = \"rgba(0,0,0,0.2)\";\n plotPoints(series.datapoints, radius, null, w/2, true,\n series.xaxis, series.yaxis, symbol);\n }\n\n ctx.lineWidth = lw;\n ctx.strokeStyle = series.color;\n plotPoints(series.datapoints, radius,\n getFillStyle(series.points, series.color), 0, false,\n series.xaxis, series.yaxis, symbol);\n ctx.restore();\n }\n\n function drawBar(x, y, b, barLeft, barRight, fillStyleCallback, axisx, axisy, c, horizontal, lineWidth) {\n var left, right, bottom, top,\n drawLeft, drawRight, drawTop, drawBottom,\n tmp;\n\n // in horizontal mode, we start the bar from the left\n // instead of from the bottom so it appears to be\n // horizontal rather than vertical\n if (horizontal) {\n drawBottom = drawRight = drawTop = true;\n drawLeft = false;\n left = b;\n right = x;\n top = y + barLeft;\n bottom = y + barRight;\n\n // account for negative bars\n if (right < left) {\n tmp = right;\n right = left;\n left = tmp;\n drawLeft = true;\n drawRight = false;\n }\n }\n else {\n drawLeft = drawRight = drawTop = true;\n drawBottom = false;\n left = x + barLeft;\n right = x + barRight;\n bottom = b;\n top = y;\n\n // account for negative bars\n if (top < bottom) {\n tmp = top;\n top = bottom;\n bottom = tmp;\n drawBottom = true;\n drawTop = false;\n }\n }\n\n // clip\n if (right < axisx.min || left > axisx.max ||\n top < axisy.min || bottom > axisy.max)\n return;\n\n if (left < axisx.min) {\n left = axisx.min;\n drawLeft = false;\n }\n\n if (right > axisx.max) {\n right = axisx.max;\n drawRight = false;\n }\n\n if (bottom < axisy.min) {\n bottom = axisy.min;\n drawBottom = false;\n }\n\n if (top > axisy.max) {\n top = axisy.max;\n drawTop = false;\n }\n\n left = axisx.p2c(left);\n bottom = axisy.p2c(bottom);\n right = axisx.p2c(right);\n top = axisy.p2c(top);\n\n // fill the bar\n if (fillStyleCallback) {\n c.fillStyle = fillStyleCallback(bottom, top);\n c.fillRect(left, top, right - left, bottom - top)\n }\n\n // draw outline\n if (lineWidth > 0 && (drawLeft || drawRight || drawTop || drawBottom)) {\n c.beginPath();\n\n // FIXME: inline moveTo is buggy with excanvas\n c.moveTo(left, bottom);\n if (drawLeft)\n c.lineTo(left, top);\n else\n c.moveTo(left, top);\n if (drawTop)\n c.lineTo(right, top);\n else\n c.moveTo(right, top);\n if (drawRight)\n c.lineTo(right, bottom);\n else\n c.moveTo(right, bottom);\n if (drawBottom)\n c.lineTo(left, bottom);\n else\n c.moveTo(left, bottom);\n c.stroke();\n }\n }\n\n function drawSeriesBars(series) {\n function plotBars(datapoints, barLeft, barRight, fillStyleCallback, axisx, axisy) {\n var points = datapoints.points, ps = datapoints.pointsize;\n\n for (var i = 0; i < points.length; i += ps) {\n if (points[i] == null)\n continue;\n drawBar(points[i], points[i + 1], points[i + 2], barLeft, barRight, fillStyleCallback, axisx, axisy, ctx, series.bars.horizontal, series.bars.lineWidth);\n }\n }\n\n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n\n // FIXME: figure out a way to add shadows (for instance along the right edge)\n ctx.lineWidth = series.bars.lineWidth;\n ctx.strokeStyle = series.color;\n\n var barLeft;\n\n switch (series.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -series.bars.barWidth;\n break;\n default:\n barLeft = -series.bars.barWidth / 2;\n }\n\n var fillStyleCallback = series.bars.fill ? function (bottom, top) { return getFillStyle(series.bars, series.color, bottom, top); } : null;\n plotBars(series.datapoints, barLeft, barLeft + series.bars.barWidth, fillStyleCallback, series.xaxis, series.yaxis);\n ctx.restore();\n }\n\n function getFillStyle(filloptions, seriesColor, bottom, top) {\n var fill = filloptions.fill;\n if (!fill)\n return null;\n\n if (filloptions.fillColor)\n return getColorOrGradient(filloptions.fillColor, bottom, top, seriesColor);\n\n var c = $.color.parse(seriesColor);\n c.a = typeof fill == \"number\" ? fill : 0.4;\n c.normalize();\n return c.toString();\n }\n\n function insertLegend() {\n\n if (options.legend.container != null) {\n $(options.legend.container).html(\"\");\n } else {\n placeholder.find(\".legend\").remove();\n }\n\n if (!options.legend.show) {\n return;\n }\n\n var fragments = [], entries = [], rowStarted = false,\n lf = options.legend.labelFormatter, s, label;\n\n // Build a list of legend entries, with each having a label and a color\n\n for (var i = 0; i < series.length; ++i) {\n s = series[i];\n if (s.label) {\n label = lf ? lf(s.label, s) : s.label;\n if (label) {\n entries.push({\n label: label,\n color: s.color\n });\n }\n }\n }\n\n // Sort the legend using either the default or a custom comparator\n\n if (options.legend.sorted) {\n if ($.isFunction(options.legend.sorted)) {\n entries.sort(options.legend.sorted);\n } else if (options.legend.sorted == \"reverse\") {\n \tentries.reverse();\n } else {\n var ascending = options.legend.sorted != \"descending\";\n entries.sort(function(a, b) {\n return a.label == b.label ? 0 : (\n (a.label < b.label) != ascending ? 1 : -1 // Logical XOR\n );\n });\n }\n }\n\n // Generate markup for the list of entries, in their final order\n\n for (var i = 0; i < entries.length; ++i) {\n\n var entry = entries[i];\n\n if (i % options.legend.noColumns == 0) {\n if (rowStarted)\n fragments.push('</tr>');\n fragments.push('<tr>');\n rowStarted = true;\n }\n\n fragments.push(\n '<td class=\"legendColorBox\"><div style=\"border:1px solid ' + options.legend.labelBoxBorderColor + ';padding:1px\"><div style=\"width:4px;height:0;border:5px solid ' + entry.color + ';overflow:hidden\"></div></div></td>' +\n '<td class=\"legendLabel\">' + entry.label + '</td>'\n );\n }\n\n if (rowStarted)\n fragments.push('</tr>');\n\n if (fragments.length == 0)\n return;\n\n var table = '<table style=\"font-size:smaller;color:' + options.grid.color + '\">' + fragments.join(\"\") + '</table>';\n if (options.legend.container != null)\n $(options.legend.container).html(table);\n else {\n var pos = \"\",\n p = options.legend.position,\n m = options.legend.margin;\n if (m[0] == null)\n m = [m, m];\n if (p.charAt(0) == \"n\")\n pos += 'top:' + (m[1] + plotOffset.top) + 'px;';\n else if (p.charAt(0) == \"s\")\n pos += 'bottom:' + (m[1] + plotOffset.bottom) + 'px;';\n if (p.charAt(1) == \"e\")\n pos += 'right:' + (m[0] + plotOffset.right) + 'px;';\n else if (p.charAt(1) == \"w\")\n pos += 'left:' + (m[0] + plotOffset.left) + 'px;';\n var legend = $('<div class=\"legend\">' + table.replace('style=\"', 'style=\"position:absolute;' + pos +';') + '</div>').appendTo(placeholder);\n if (options.legend.backgroundOpacity != 0.0) {\n // put in the transparent background\n // separately to avoid blended labels and\n // label boxes\n var c = options.legend.backgroundColor;\n if (c == null) {\n c = options.grid.backgroundColor;\n if (c && typeof c == \"string\")\n c = $.color.parse(c);\n else\n c = $.color.extract(legend, 'background-color');\n c.a = 1;\n c = c.toString();\n }\n var div = legend.children();\n $('<div style=\"position:absolute;width:' + div.width() + 'px;height:' + div.height() + 'px;' + pos +'background-color:' + c + ';\"> </div>').prependTo(legend).css('opacity', options.legend.backgroundOpacity);\n }\n }\n }\n\n\n // interactive features\n\n var highlights = [],\n redrawTimeout = null;\n\n // returns the data item the mouse is over, or null if none is found\n function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }\n\n function onMouseMove(e) {\n if (options.grid.hoverable)\n triggerClickHoverEvent(\"plothover\", e,\n function (s) { return s[\"hoverable\"] != false; });\n }\n\n function onMouseLeave(e) {\n if (options.grid.hoverable)\n triggerClickHoverEvent(\"plothover\", e,\n function (s) { return false; });\n }\n\n function onClick(e) {\n triggerClickHoverEvent(\"plotclick\", e,\n function (s) { return s[\"clickable\"] != false; });\n }\n\n // trigger click or hover event (they send the same parameters\n // so we share their code)\n function triggerClickHoverEvent(eventname, event, seriesFilter) {\n var offset = eventHolder.offset(),\n canvasX = event.pageX - offset.left - plotOffset.left,\n canvasY = event.pageY - offset.top - plotOffset.top,\n pos = canvasToAxisCoords({ left: canvasX, top: canvasY });\n\n pos.pageX = event.pageX;\n pos.pageY = event.pageY;\n\n var item = findNearbyItem(canvasX, canvasY, seriesFilter);\n\n if (item) {\n // fill in mouse pos for any listeners out there\n item.pageX = parseInt(item.series.xaxis.p2c(item.datapoint[0]) + offset.left + plotOffset.left, 10);\n item.pageY = parseInt(item.series.yaxis.p2c(item.datapoint[1]) + offset.top + plotOffset.top, 10);\n }\n\n if (options.grid.autoHighlight) {\n // clear auto-highlights\n for (var i = 0; i < highlights.length; ++i) {\n var h = highlights[i];\n if (h.auto == eventname &&\n !(item && h.series == item.series &&\n h.point[0] == item.datapoint[0] &&\n h.point[1] == item.datapoint[1]))\n unhighlight(h.series, h.point);\n }\n\n if (item)\n highlight(item.series, item.datapoint, eventname);\n }\n\n placeholder.trigger(eventname, [ pos, item ]);\n }\n\n function triggerRedrawOverlay() {\n var t = options.interaction.redrawOverlayInterval;\n if (t == -1) { // skip event queue\n drawOverlay();\n return;\n }\n\n if (!redrawTimeout)\n redrawTimeout = setTimeout(drawOverlay, t);\n }\n\n function drawOverlay() {\n redrawTimeout = null;\n\n // draw highlights\n octx.save();\n overlay.clear();\n octx.translate(plotOffset.left, plotOffset.top);\n\n var i, hi;\n for (i = 0; i < highlights.length; ++i) {\n hi = highlights[i];\n\n if (hi.series.bars.show)\n drawBarHighlight(hi.series, hi.point);\n else\n drawPointHighlight(hi.series, hi.point);\n }\n octx.restore();\n\n executeHooks(hooks.drawOverlay, [octx]);\n }\n\n function highlight(s, point, auto) {\n if (typeof s == \"number\")\n s = series[s];\n\n if (typeof point == \"number\") {\n var ps = s.datapoints.pointsize;\n point = s.datapoints.points.slice(ps * point, ps * (point + 1));\n }\n\n var i = indexOfHighlight(s, point);\n if (i == -1) {\n highlights.push({ series: s, point: point, auto: auto });\n\n triggerRedrawOverlay();\n }\n else if (!auto)\n highlights[i].auto = false;\n }\n\n function unhighlight(s, point) {\n if (s == null && point == null) {\n highlights = [];\n triggerRedrawOverlay();\n return;\n }\n\n if (typeof s == \"number\")\n s = series[s];\n\n if (typeof point == \"number\") {\n var ps = s.datapoints.pointsize;\n point = s.datapoints.points.slice(ps * point, ps * (point + 1));\n }\n\n var i = indexOfHighlight(s, point);\n if (i != -1) {\n highlights.splice(i, 1);\n\n triggerRedrawOverlay();\n }\n }\n\n function indexOfHighlight(s, p) {\n for (var i = 0; i < highlights.length; ++i) {\n var h = highlights[i];\n if (h.series == s && h.point[0] == p[0]\n && h.point[1] == p[1])\n return i;\n }\n return -1;\n }\n\n function drawPointHighlight(series, point) {\n var x = point[0], y = point[1],\n axisx = series.xaxis, axisy = series.yaxis,\n highlightColor = (typeof series.highlightColor === \"string\") ? series.highlightColor : $.color.parse(series.color).scale('a', 0.5).toString();\n\n if (x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max)\n return;\n\n var pointRadius = series.points.radius + series.points.lineWidth / 2;\n octx.lineWidth = pointRadius;\n octx.strokeStyle = highlightColor;\n var radius = 1.5 * pointRadius;\n x = axisx.p2c(x);\n y = axisy.p2c(y);\n\n octx.beginPath();\n if (series.points.symbol == \"circle\")\n octx.arc(x, y, radius, 0, 2 * Math.PI, false);\n else\n series.points.symbol(octx, x, y, radius, false);\n octx.closePath();\n octx.stroke();\n }\n\n function drawBarHighlight(series, point) {\n var highlightColor = (typeof series.highlightColor === \"string\") ? series.highlightColor : $.color.parse(series.color).scale('a', 0.5).toString(),\n fillStyle = highlightColor,\n barLeft;\n\n switch (series.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -series.bars.barWidth;\n break;\n default:\n barLeft = -series.bars.barWidth / 2;\n }\n\n octx.lineWidth = series.bars.lineWidth;\n octx.strokeStyle = highlightColor;\n\n drawBar(point[0], point[1], point[2] || 0, barLeft, barLeft + series.bars.barWidth,\n function () { return fillStyle; }, series.xaxis, series.yaxis, octx, series.bars.horizontal, series.bars.lineWidth);\n }\n\n function getColorOrGradient(spec, bottom, top, defaultColor) {\n if (typeof spec == \"string\")\n return spec;\n else {\n // assume this is a gradient spec; IE currently only\n // supports a simple vertical gradient properly, so that's\n // what we support too\n var gradient = ctx.createLinearGradient(0, top, 0, bottom);\n\n for (var i = 0, l = spec.colors.length; i < l; ++i) {\n var c = spec.colors[i];\n if (typeof c != \"string\") {\n var co = $.color.parse(defaultColor);\n if (c.brightness != null)\n co = co.scale('rgb', c.brightness);\n if (c.opacity != null)\n co.a *= c.opacity;\n c = co.toString();\n }\n gradient.addColorStop(i / (l - 1), c);\n }\n\n return gradient;\n }\n }\n }", "title": "" } ]
[ { "docid": "4f877df763d7ed2dd9452c484b5c886f", "score": "0.59775186", "text": "function LabShell() {\n var _this = _super.call(this) || this;\n /**\n * A message hook for child add/remove messages on the main area dock panel.\n */\n _this._dockChildHook = function (handler, msg) {\n switch (msg.type) {\n case 'child-added':\n msg.child.addClass(ACTIVITY_CLASS);\n _this._tracker.add(msg.child);\n break;\n case 'child-removed':\n msg.child.removeClass(ACTIVITY_CLASS);\n _this._tracker.remove(msg.child);\n break;\n default:\n break;\n }\n return true;\n };\n _this._activeChanged = new signaling_1.Signal(_this);\n _this._cachedLayout = null;\n _this._currentChanged = new signaling_1.Signal(_this);\n _this._isRestored = false;\n _this._layoutModified = new signaling_1.Signal(_this);\n _this._layoutDebouncer = new polling_1.Debouncer(function () {\n _this._layoutModified.emit(undefined);\n }, 0);\n _this._restored = new coreutils_1.PromiseDelegate();\n _this._tracker = new widgets_1.FocusTracker();\n _this._mainOptionsCache = new Map();\n _this._sideOptionsCache = new Map();\n _this.addClass(APPLICATION_SHELL_CLASS);\n _this.id = 'main';\n var headerPanel = (_this._headerPanel = new widgets_1.BoxPanel());\n var topHandler = (_this._topHandler = new Private.PanelHandler());\n var bottomPanel = (_this._bottomPanel = new widgets_1.BoxPanel());\n var hboxPanel = new widgets_1.BoxPanel();\n var dockPanel = (_this._dockPanel = new widgets_1.DockPanel());\n messaging_1.MessageLoop.installMessageHook(dockPanel, _this._dockChildHook);\n var hsplitPanel = new widgets_1.SplitPanel();\n var leftHandler = (_this._leftHandler = new Private.SideBarHandler());\n var rightHandler = (_this._rightHandler = new Private.SideBarHandler());\n var rootLayout = new widgets_1.BoxLayout();\n headerPanel.id = 'jp-header-panel';\n topHandler.panel.id = 'jp-top-panel';\n bottomPanel.id = 'jp-bottom-panel';\n hboxPanel.id = 'jp-main-content-panel';\n dockPanel.id = 'jp-main-dock-panel';\n hsplitPanel.id = 'jp-main-split-panel';\n leftHandler.sideBar.addClass(SIDEBAR_CLASS);\n leftHandler.sideBar.addClass('jp-mod-left');\n leftHandler.stackedPanel.id = 'jp-left-stack';\n rightHandler.sideBar.addClass(SIDEBAR_CLASS);\n rightHandler.sideBar.addClass('jp-mod-right');\n rightHandler.stackedPanel.id = 'jp-right-stack';\n hboxPanel.spacing = 0;\n dockPanel.spacing = 5;\n hsplitPanel.spacing = 1;\n headerPanel.direction = 'top-to-bottom';\n hboxPanel.direction = 'left-to-right';\n hsplitPanel.orientation = 'horizontal';\n bottomPanel.direction = 'bottom-to-top';\n widgets_1.SplitPanel.setStretch(leftHandler.stackedPanel, 0);\n widgets_1.SplitPanel.setStretch(dockPanel, 1);\n widgets_1.SplitPanel.setStretch(rightHandler.stackedPanel, 0);\n widgets_1.BoxPanel.setStretch(leftHandler.sideBar, 0);\n widgets_1.BoxPanel.setStretch(hsplitPanel, 1);\n widgets_1.BoxPanel.setStretch(rightHandler.sideBar, 0);\n hsplitPanel.addWidget(leftHandler.stackedPanel);\n hsplitPanel.addWidget(dockPanel);\n hsplitPanel.addWidget(rightHandler.stackedPanel);\n hboxPanel.addWidget(leftHandler.sideBar);\n hboxPanel.addWidget(hsplitPanel);\n hboxPanel.addWidget(rightHandler.sideBar);\n rootLayout.direction = 'top-to-bottom';\n rootLayout.spacing = 0; // TODO make this configurable?\n // Use relative sizing to set the width of the side panels.\n // This will still respect the min-size of children widget in the stacked\n // panel.\n hsplitPanel.setRelativeSizes([1, 2.5, 1]);\n widgets_1.BoxLayout.setStretch(headerPanel, 0);\n widgets_1.BoxLayout.setStretch(topHandler.panel, 0);\n widgets_1.BoxLayout.setStretch(hboxPanel, 1);\n widgets_1.BoxLayout.setStretch(bottomPanel, 0);\n rootLayout.addWidget(headerPanel);\n rootLayout.addWidget(topHandler.panel);\n rootLayout.addWidget(hboxPanel);\n rootLayout.addWidget(bottomPanel);\n // initially hiding header and bottom panel when no elements inside\n _this._headerPanel.hide();\n _this._bottomPanel.hide();\n _this.layout = rootLayout;\n // Connect change listeners.\n _this._tracker.currentChanged.connect(_this._onCurrentChanged, _this);\n _this._tracker.activeChanged.connect(_this._onActiveChanged, _this);\n // Connect main layout change listener.\n _this._dockPanel.layoutModified.connect(_this._onLayoutModified, _this);\n // Catch current changed events on the side handlers.\n _this._leftHandler.sideBar.currentChanged.connect(_this._onLayoutModified, _this);\n _this._rightHandler.sideBar.currentChanged.connect(_this._onLayoutModified, _this);\n return _this;\n }", "title": "" }, { "docid": "45cbccc92906cb1af48b3a65ea0fc9e8", "score": "0.57733387", "text": "getContainer() {\n return document.body;\n }", "title": "" }, { "docid": "b86745ffd05c3f91965390abf79f7d64", "score": "0.5625317", "text": "getContainer() {\n return this.parent;\n }", "title": "" }, { "docid": "b86745ffd05c3f91965390abf79f7d64", "score": "0.5625317", "text": "getContainer() {\n return this.parent;\n }", "title": "" }, { "docid": "c3b2a0475def0b1669bc18e05dc73ae6", "score": "0.5448554", "text": "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 }", "title": "" }, { "docid": "12bad90ad780bf90df5e7163caf86ff9", "score": "0.54172856", "text": "function main(parent) {\n\t\tvar overlay = jQuery('.overlay', parent);\n\n\t\tinitializeOverlay(overlay, parent);\n\t\tresizeOverlay(overlay, parent);\n\t}", "title": "" }, { "docid": "dde52a784379b46f79e031850c66f27c", "score": "0.54004025", "text": "function Main(){\n\n \t$(document).ready(function(){\n \t\t$('body').layout({\n \t\t\tapplyDefaultStyles:true,\n \t\t\tenableCursorHotkey:false,\n \t\t\tnorth:{\n \t\t\t\tresizable:false,\n \t\t\t\tclosable:false,\n \t\t\t},\n \t\t\tsouth:{\n \t\t\t\tresizable:false,\n \t\t\t\tcssReq:{height:\"2px\"},\n \t\t\t},\n \t\t\twest:{\n \t\t\t\tsize:200\n \t\t\t}\n \t\t});\n \t\t$('body').layout().close('west');\n \t\t$('body').layout().close('south');\n \t});\n }", "title": "" }, { "docid": "ac1c4c021dabfe0a773dbdce7ca2609e", "score": "0.5323684", "text": "function joinPane() {\n}", "title": "" }, { "docid": "938fbe79a12f8d72a2790bd45a021cfc", "score": "0.52959925", "text": "function plot_setup(){\n var box = $('<div>')\n .attr('id', 'plot')\n .css('position', 'absolute')\n .css('width', '25vw')\n .css('height', '25vw')\n .css('left', '50vw')\n .css('top', '50vh')\n .css('transform', 'translate(-50%, -50%)')\n .css('border', 'solid black')\n .css('background-color', 'white');\n $('body').append(box);\n return box;\n}", "title": "" }, { "docid": "7937ff5dea1842b4c886cf293213e857", "score": "0.5289185", "text": "getContainer() {\n\n\t\t\tif ( !this.threeOBJ && this.parent ) {\n\n\t\t\t\treturn this.parent.getContainer();\n\n\t\t\t} else if ( this.threeOBJ ) {\n\n\t\t\t\treturn this;\n\n\t\t\t}\n\n\t\t\treturn DEFAULTS.container;\n\n\n\t\t}", "title": "" }, { "docid": "f862981ef99dfe3c76afae3e479c2f64", "score": "0.52674466", "text": "dock() {\n return;\n }", "title": "" }, { "docid": "8d5e2ee94d96edda42398d162187f31a", "score": "0.5267443", "text": "function LContainer() { }", "title": "" }, { "docid": "8d5e2ee94d96edda42398d162187f31a", "score": "0.5267443", "text": "function LContainer() { }", "title": "" }, { "docid": "8d5e2ee94d96edda42398d162187f31a", "score": "0.5267443", "text": "function LContainer() { }", "title": "" }, { "docid": "8d5e2ee94d96edda42398d162187f31a", "score": "0.5267443", "text": "function LContainer() { }", "title": "" }, { "docid": "03a3d3a8c081065bdccd90c4190168db", "score": "0.5255482", "text": "function _createContainer() {\n\t\tr.$iframe.css({\n\t\t\tdisplay: 'inline-block',\n\t\t\tborder: 'none'\n\t\t});\n\n\t\tr.$reader.addClass(areColumnsSupported() ? 'columns' : 'scroll');\n\n\t\t// Container parent styles.\n\t\tr.$container\n\t\t\t.css({\n\t\t\t\toverflow: 'hidden',\n\t\t\t\t'-webkit-tap-highlight-color': 'rgba(0,0,0,0)',\n\t\t\t\t'-webkit-touch-callout': 'none'\n\t\t\t});\n\n\t\t// Capture the anchor links into the content\n\t\tr.$container.on('click', 'a', _clickHandler);\n\t\tr.$container.on('click touchstart', '.cpr-highlight div', _highlightHandler);\n\t\tr.$container.on('touchmove touchend touchcancel', '.cpr-highlight div', function(e){\n\t\t\t// we need to stop all touch events on highlight markers\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t});\n\n\t\t// Capture text selection events and notify client of text value.\n\t\tvar $doc = $(r.document);\n\t\t$doc.bind('selectionchange', function(){\n\t\t\tvar selection = $doc[0].getSelection().toString();\n\t\t\tr.Notify.event($.extend({value: selection}, r.Event.TEXT_SELECTION_EVENT));\n\t\t});\n\t}", "title": "" }, { "docid": "e4938dcb0ae50647766b3d201b57fed4", "score": "0.5248357", "text": "function main(parent) {\n\t\tvar overlay = jQuery('.overlay', parent);\n\n\t\tinitializeOverlay(overlay, parent);\n\t\tsetOverlayPosition(overlay, parent);\n\t}", "title": "" }, { "docid": "b87b723b2cbef3b11d2593f96515d546", "score": "0.5235282", "text": "create() {\n this[Symbols.get(\"$container\")].find(\".pane-content\").append(this.$el);\n this.updateLayout();\n }", "title": "" }, { "docid": "4080bdb0480013c1081b0066300b7a3f", "score": "0.52086836", "text": "newContainer() {\r\n return new display.Container();\r\n }", "title": "" }, { "docid": "83f70e7ccc44df38c0a45159c4e9a605", "score": "0.5204939", "text": "_createInnerWindow(x, y, rectWidth, rectHeight) {\n this.graphics.fillStyle(this.windowColor, this.windowAlpha);\n this.graphics.fillRect(x + 1, y + 1, rectWidth - 1, rectHeight - 1);\n }", "title": "" }, { "docid": "9bfe72ee2860c3018c516850188b556c", "score": "0.5191364", "text": "function setupSimpleFullScreenMoleculeContainer() {\n var size = layout.display.page.height * 0.70;\n molecule_container.resize(size, size);\n }", "title": "" }, { "docid": "83daccba9a2a3d5f38db76c9fcb8e79f", "score": "0.51882035", "text": "render() {\n var width = Math.min(this._callbackObj.Width, this._callbackObj.Options.overview.width);\n var height = Math.min(this._callbackObj.Height, this._callbackObj.Options.overview.height);\n var styleMap = this._callbackObj.Options.styleDefaults._overviewStyles;\n var options = {\n xMin: 0,\n xMax: width,\n yMin: 0,\n yMax: height,\n x1: 0,\n x2: width,\n y1: 0,\n y2: height,\n style: {\n overviewBackgroundColor: styleMap.overview.backgroundColor,\n windowBackgroundColor: styleMap.viewport.backgroundColor,\n windowBorderTopColor: styleMap.viewport.borderColor,\n windowBorderRightColor: styleMap.viewport.borderColor,\n windowBorderBottomColor: styleMap.viewport.borderColor,\n windowBorderLeftColor: styleMap.viewport.borderColor,\n timeAxisBarColor: '#00000000' // render time axis bar invisible - diagram does not need it\n },\n animationOnClick: 'off',\n featuresOff: 'zoom'\n };\n var isEmpty = this._callbackObj.GetAllRoots().length === 0 ? true : false;\n this._viewportConstraints = {\n xMin: isEmpty ? 0 : -Number.MAX_VALUE,\n yMin: isEmpty ? 0 : -Number.MAX_VALUE,\n xMax: isEmpty ? width : Number.MAX_VALUE,\n yMax: isEmpty ? height : Number.MAX_VALUE\n };\n if (!this._callbackObj.IsPanningEnabled()) {\n this.setMouseEnabled(false);\n }\n // now call super to render the scrollbar\n super.render(options, width, height);\n }", "title": "" }, { "docid": "17d14bb6742da1717268c9348e2852f1", "score": "0.5169062", "text": "function _getTopContainer()\r\n{\r\n\tvar\t\tw = window;\r\n\r\n\t// Stop going up when either there is nothing there, or we are already there,\r\n\t// or we don't have access permission go there.\r\n\ttry {\r\n\t while ( w.parent != null && w != w.parent && typeof( w.parent ) != \"undefined\" )\r\n\t {\r\n\t\t\tw.parent._llAccessTest = true;\r\n \t\t\tw = w.parent;\r\n \t\t}\r\n \t} catch ( e ) { }\r\n\r\n\treturn w;\r\n}", "title": "" }, { "docid": "0c83e3a2b4f32b41f1abf418fb83b0a9", "score": "0.5163853", "text": "function initialize(){\n preparePlotArea(); \n\n // Set the dimensions of everything in in the visualization area\n // changed that to be relative to fullscreen now, looking ok so far.\n let visContainer = d3.select(`#fullscreen`).node()\n const visContainerWidth = visContainer.getBoundingClientRect().width; \n const visContainerHeight = visContainer.getBoundingClientRect().height;\n\n const cH = document.getElementById(\"controls\").clientHeight;\n const sH = document.getElementById(\"seqfield\").getBoundingClientRect().height; \n const tH = 110 // timetablevis is generated later, but at fixed height\n const iH = 25 // timepointinfo is generated later, but should be approx 25\n const subH = cH + sH + tH + iH + 10\n\n const ensContainerWidth = visContainerWidth;\n const ensContainerHeight = Math.max(200, //TODO: this still causes trouble\n visContainerHeight - subH);\n const timeScaleWidth = visContainerWidth - 30;\n\n return [visContainerWidth,\n visContainerHeight,\n ensContainerWidth, \n ensContainerHeight,\n timeScaleWidth]\n}", "title": "" }, { "docid": "84699b28c54c33672122d13a3787a3e8", "score": "0.5162662", "text": "get wholePage () { return browser.maximizeWindow(); }", "title": "" }, { "docid": "a0571b00237123c1b0a955aa9f808a61", "score": "0.5157143", "text": "el() {\n // sidebar container of all widgets\n return $(\"#widgetsbar-document\");\n }", "title": "" }, { "docid": "3ce6be2bff8a68e0b26484d9231d048d", "score": "0.5140326", "text": "function main(container, outline, toolbar, sidebar, status) {\n _sidebar = sidebar;\n // Checks if the browser is supported\n if (!mxClient.isBrowserSupported()) {\n // Displays an error message if the browser is not supported.\n mxUtils.error('Browser is not supported!', 200, false);\n } else {\n // Assigns some global constants for general behaviour, eg. minimum\n // size (in pixels) of the active region for triggering creation of\n // new connections, the portion (100%) of the cell area to be used\n // for triggering new connections, as well as some fading options for\n // windows and the rubberband selection.\n mxConstants.MIN_HOTSPOT_SIZE = 16;\n mxConstants.DEFAULT_HOTSPOT = 1;\n \n // Enables guides\n mxGraphHandler.prototype.guidesEnabled = true;\n\n // Alt disables guides\n mxGuide.prototype.isEnabledForEvent = function(evt) {\n return !mxEvent.isAltDown(evt);\n };\n\n // Enables snapping waypoints to terminals\n mxEdgeHandler.prototype.snapToTerminals = true;\n\n // Workaround for Internet Explorer ignoring certain CSS directives\n if (mxClient.IS_QUIRKS) {\n document.body.style.overflow = 'hidden';\n new mxDivResizer(container);\n new mxDivResizer(outline);\n new mxDivResizer(toolbar);\n new mxDivResizer(sidebar);\n new mxDivResizer(status);\n }\n \n // Creates a wrapper editor with a graph inside the given container.\n // The editor is used to create certain functionality for the\n // graph, such as the rubberband selection, but most parts\n // of the UI are custom in this example.\n var editor = new mxEditor();\n var graph = editor.graph;\n var model = graph.getModel();\n _graph = graph;\n\n // Disable highlight of cells when dragging from toolbar\n graph.setDropEnabled(true);\n \n //allow loops\n graph.setAllowLoops(true);\n\n // Show icon while connections are previewed\n graph.connectionHandler.getConnectImage = function(state) {\n return new mxImage(state.style[mxConstants.STYLE_IMAGE], 16, 16);\n };\n\n // Centers the port icon on the target port\n graph.connectionHandler.targetConnectImage = true;\n\n // Does not allow dangling edges\n graph.setAllowDanglingEdges(false);\n\n // Sets the graph container and configures the editor\n editor.setGraphContainer(container);\n var config = mxUtils.load('editors/config/keyhandler-commons.xml').getDocumentElement();\n editor.configure(config);\n \n // Defines the default group to be used for grouping. The\n // default group is a field in the mxEditor instance that\n // is supposed to be a cell which is cloned for new cells.\n // The groupBorderSize is used to define the spacing between\n // the children of a group and the group bounds.\n var group = new mxCell('Group', new mxGeometry(), 'group');\n group.setVertex(true);\n group.setConnectable(false);\n editor.defaultGroup = group;\n editor.groupBorderSize = 20;\n\n //configure drop targets\n graph.isValidDropTarget = function(cell, cells, evt) {\n return true; //will allow all, for now\n };\n \n // Disables drilling into non-swimlanes.\n graph.isValidRoot = function(cell) {\n return this.isValidDropTarget(cell);\n }\n\n // Does not allow selection of locked cells\n graph.isCellSelectable = function(cell) {\n return !this.isCellLocked(cell);\n };\n\n // Returns a shorter label if the cell is collapsed and no\n // label for expanded groups\n graph.getLabel = function(cell) {\n var tmp = mxGraph.prototype.getLabel.apply(this, arguments); // \"supercall\"\n \n if (this.isCellLocked(cell)) {\n // Returns an empty label but makes sure an HTML\n // element is created for the label (for event\n // processing wrt the parent label)\n return '';\n } else if (this.isCellCollapsed(cell)) {\n var index = tmp.indexOf('</h1>');\n if (index > 0) {\n tmp = tmp.substring(0, index+5);\n }\n }\n return tmp;\n }\n\n // Disables HTML labels for swimlanes to avoid conflict\n // for the event processing on the child cells. HTML\n // labels consume events before underlying cells get the\n // chance to process those events.\n //\n // NOTE: Use of HTML labels is only recommended if the specific\n // features of such labels are required, such as special label\n // styles or interactive form fields. Otherwise non-HTML labels\n // should be used by not overidding the following function.\n // See also: configureStylesheet.\n graph.isHtmlLabel = function(cell) {\n return !this.isSwimlane(cell);\n }\n\n //disable folding, for now\n graph.isCellFoldable = function(cell) {\n return false;\n }\n\n // Shows a \"modal\" window when double clicking a vertex.\n /*graph.dblClick = function(evt, cell)\n {\n // Do not fire a DOUBLE_CLICK event here as mxEditor will\n // consume the event and start the in-place editor.\n if (this.isEnabled() &&\n !mxEvent.isConsumed(evt) &&\n cell != null &&\n this.isCellEditable(cell))\n {\n if (this.model.isEdge(cell) ||\n !this.isHtmlLabel(cell))\n {\n this.startEditingAtCell(cell);\n }\n else\n {\n var content = document.createElement('div');\n content.innerHTML = this.convertValueToString(cell);\n showModalWindow(this, 'Properties', content, 400, 300);\n }\n }\n\n // Disables any default behaviour for the double click\n mxEvent.consume(evt);\n };*/\n\n // Enables new connections\n graph.setConnectable(true);\n\n // Adds all required styles to the graph (see below)\n configureStylesheet(graph);\n\n // Adds sidebar icons.\n //\n // NOTE: For non-HTML labels a simple string as the third argument\n // and the alternative style as shown in configureStylesheet should\n // be used. For example, the first call to addSidebar icon would\n // be as follows:\n // addSidebarIcon(graph, sidebar, 'Website', 'images/icons48/earth.png');\n addSidebarIcon(graph, sidebar,'Component','images/icons48/sig.png','component');\n \n //addSidebarIcon(graph, sidebar,'Leaf','images/icons48/leaf.svg','leaf');\n \n // Displays useful hints in a small semi-transparent box.\n var hints = document.createElement('div');\n hints.style.position = 'absolute';\n hints.style.overflow = 'hidden';\n hints.style.width = '230px';\n hints.style.bottom = '56px';\n hints.style.height = '76px';\n hints.style.right = '20px';\n \n hints.style.background = 'black';\n hints.style.color = 'white';\n hints.style.fontFamily = 'Arial';\n hints.style.fontSize = '10px';\n hints.style.padding = '4px';\n\n mxUtils.setOpacity(hints, 50);\n \n mxUtils.writeln(hints, '- Drag an image from the sidebar to the graph');\n mxUtils.writeln(hints, '- Doubleclick on a vertex or edge to edit');\n mxUtils.writeln(hints, '- Shift- or Rightclick and drag for panning');\n mxUtils.writeln(hints, '- Move the mouse over a cell to see a tooltip');\n mxUtils.writeln(hints, '- Click and drag a vertex to move and connect');\n mxUtils.writeln(hints, '- Ports are managed with right click');\n document.body.appendChild(hints);\n \n // Creates a new DIV that is used as a toolbar and adds\n // toolbar buttons.\n var spacer = document.createElement('div');\n spacer.style.display = 'inline';\n spacer.style.padding = '8px';\n \n addToolbarButton(editor, toolbar, 'groupOrUngroup', '(Un)group', 'images/group.png');\n \n /*\n // Defines a new action for deleting or ungrouping\n editor.addAction('groupOrUngroup', function(editor, cell) {\n cell = cell || editor.graph.getSelectionCell();\n if (cell != null && editor.graph.isSwimlane(cell)) {\n editor.execute('ungroup', cell);\n } else {\n editor.execute('group');\n }\n });*/\n\n addToolbarButton(editor, toolbar, 'delete', 'Delete', 'images/delete2.png');\n \n toolbar.appendChild(spacer.cloneNode(true));\n \n addToolbarButton(editor, toolbar, 'cut', 'Cut', 'images/cut.png');\n addToolbarButton(editor, toolbar, 'copy', 'Copy', 'images/copy.png');\n addToolbarButton(editor, toolbar, 'paste', 'Paste', 'images/paste.png');\n\n toolbar.appendChild(spacer.cloneNode(true));\n \n addToolbarButton(editor, toolbar, 'undo', '', 'images/undo.png');\n addToolbarButton(editor, toolbar, 'redo', '', 'images/redo.png');\n \n toolbar.appendChild(spacer.cloneNode(true));\n \n addToolbarButton(editor, toolbar, 'show', 'Show', 'images/camera.png');\n addToolbarButton(editor, toolbar, 'print', 'Print', 'images/printer.png');\n \n toolbar.appendChild(spacer.cloneNode(true));\n\n //Define the export action\n editor.addAction('export', exportToJson);\n addToolbarButton(editor, toolbar, 'export', 'Save', 'images/disk.png');\n\n toolbar.appendChild(spacer.cloneNode(true));\n\n //Define import metamodel action\n document.getElementById('metamodel').addEventListener('change', handleMetamodelSelect, false);\n editor.addAction('import_m', function(editor, cell) {\t\t\t\t\t\n var elem = document.getElementById(\"metamodel\");\n if(elem && document.createEvent) {\n var evt = document.createEvent(\"MouseEvents\");\n evt.initEvent(\"click\", true, false);\n elem.dispatchEvent(evt);\n }\n });\n addToolbarButton(editor, toolbar, 'import_m', 'Open Metamodel', 'images/folder_palette.png');\n\n //Define import model action\n document.getElementById('files').addEventListener('change', handleFileSelect, false);\n editor.addAction('import', function(editor, cell) {\n var isEmpty = _graph.getChildVertices(_graph.getDefaultParent()).length==0;\n if (isEmpty || confirm(\"Current model will be discarded!\") == true) {\n var elem = document.getElementById(\"files\");\n if(elem && document.createEvent) {\n var evt = document.createEvent(\"MouseEvents\");\n evt.initEvent(\"click\", true, false);\n elem.dispatchEvent(evt);\n }\n } \n });\n addToolbarButton(editor, toolbar, 'import', 'Open model', 'images/folder.png');\n \n // Adds toolbar buttons into the status bar at the bottom\n // of the window.\n addToolbarButton(editor, status, 'collapseAll', 'Collapse All', 'images/navigate_minus.png', true);\n addToolbarButton(editor, status, 'expandAll', 'Expand All', 'images/navigate_plus.png', true);\n\n status.appendChild(spacer.cloneNode(true));\n \n addToolbarButton(editor, status, 'enterGroup', 'Enter', 'images/view_next.png', true);\n addToolbarButton(editor, status, 'exitGroup', 'Exit', 'images/view_previous.png', true);\n\n status.appendChild(spacer.cloneNode(true));\n\n addToolbarButton(editor, status, 'zoomIn', '', 'images/zoom_in.png', true);\n addToolbarButton(editor, status, 'zoomOut', '', 'images/zoom_out.png', true);\n addToolbarButton(editor, status, 'actualSize', '', 'images/view_1_1.png', true);\n addToolbarButton(editor, status, 'fit', '', 'images/fit_to_size.png', true);\n \n // Creates the outline (navigator, overview) for moving\n // around the graph in the top, right corner of the window.\n var outln = new mxOutline(graph, outline);\n\n // To show the images in the outline, uncomment the following code\n //outln.outline.labelsVisible = true;\n //outln.outline.setHtmlLabels(true);\n \n // Fades-out the splash screen after the UI has been loaded.\n var splash = document.getElementById('splash');\n if (splash != null) {\n try {\n mxEvent.release(splash);\n mxEffects.fadeOut(splash, 100, true);\n } catch (e) {\n // mxUtils is not available (library not loaded)\n splash.parentNode.removeChild(splash);\n }\n }\n }\n\n graph.popupMenuHandler.factoryMethod = function(menu, cell, evt) {\n return createPopupMenu(graph, menu, cell, evt);\n };\n\n // Needs to set a flag to check for dynamic style changes,\n // that is, changes to styles on cells where the style was\n // not explicitely changed using mxStyleChange\n graph.getView().updateStyle = true;\n \n // Overrides mxGraphModel.getStyle to return a specific style\n // for edges that reflects their target terminal (in this case\n // the strokeColor will be equal to the target's fillColor).\n var previous = graph.model.getStyle;\n \n //Dynamic styles\n graph.model.getStyle = function(cell) {\n if (cell != null) {\n var style = previous.apply(this, arguments);\n if (this.isEdge(cell)) {\n \n var target = this.getTerminal(cell, false);\n var source = this.getTerminal(cell, true);\n style = 'strokeWidth=2;strokeColor=black;';\n\n var dash = false;\n if(target && target.children) {\n target.children.forEach(function (c){\n if(c.meta && c.meta.role==='port') {\n dash = true;\n }\n });\n }\n\n if(source && source.children) {\n source.children.forEach(function (c){\n if(c.meta.role==='port') {\n dash = true;\n }\n });\n }\n\n if (target != null && source !=null) {\n //if one vertex has/is a port, don't draw an arrow\n if(target.meta.role && target.meta.role === 'port' || \n source.meta.role && source.meta.role === 'port' || dash) {\n var state = graph.getView().getState(target);\n style += ';endArrow=dash';\n } else {\n //if value is extends, change arrow head\n if(cell.value && cell.value==\"extends\") {\n style += ';endArrow=extend';\n } else {\n style += ';endArrow=block';\n }\n }\n }\n\n } else if (this.isVertex(cell)) {\n var geometry = this.getGeometry(cell);\n var adjust = false; //adjust label position\n if (cell.children) {\n cell.children.forEach( function (e) {\n if(!e.meta || !e.meta.role || e.meta.role!=='port') {\n adjust = true;\n }\n });\n }\n \n //move label to top\n if(adjust) {\n style += ';verticalAlign=top';\n }\n if(cell.meta.kind && _metamodel) {\n var tc = _metamodel.elements.filter(function f(e) {return e.id == cell.meta.kind})[0];\n if(tc) {\n style+=\";shape=image;image=\"+tc.image+\";\";\n }\n }\n if(cell.meta.role && cell.meta.role ==='port') {\n //draw port input/output image\n if(cell.meta.direction) {\n if(cell.meta.direction === 'input') {\n style+=\";shape=image;image=images/port_in.svg;\";\n } \n if(cell.meta.direction === 'output') {\n style+=\";shape=image;image=images/port_out.svg;\";\n }\n\n if(cell.meta.position==='b') {\n style+=\";rotation=90\";\n } else if(cell.meta.position==='l') {\n style+=\";rotation=180\";\n } else if(cell.meta.position==='t') {\n style+=\";rotation=-90\";\n }\n }\n }\n }\n return style;\n }\n return null;\n };\n\n graph.isCellMovable = function(cell) {\n if(cell && cell.meta && cell.meta.role===\"lbl\") {\n return false;\n }\n return true;\t\t\t\t\n }\n\n graph.isCellConnectable = function(cell) {\n if(cell && cell.meta && cell.meta.role==\"lbl\") {\n return false;\n }\n return true;\t\t\t\t\n }\n \n/*\n graph.addMouseListener( {\n currentState: null,\n currentIconSet: null,\n mouseDown: function(sender, me) {\n console.log(\"mouse down\");\n var tmp = graph.view.getState(me.getCell());\n if(tmp) {\n console.log(tmp);\n cell = tmp;\n console.log(cell.parent);\n tp = cell.parent;\n }\n },\n mouseMove: function(sender, me) {\n //console.log(\"mouse move\");\n },\n mouseUp: function(sender, me) { \n console.log(\"mouse up\");\n if(cell) {\n console.log(cell);\n cell.parent = tp;\n cell = null;\n }\t\t\t\t\t\t\n },\n dragEnter: function(evt, state) {\n //console.log(\"drag enter\");\n },\n dragLeave: function(evt, state) {\n //console.log(\"drag leave\");\n }\n });*/\n\n\n /* //event for edge created\n //https://jgraph.github.io/mxgraph/docs/js-api/files/handler/mxConnectionHandler-js.html\n graphComponent.getConnectionHandler().addListener(mxEvent.CONNECT, new mxIEventListener()\\n{\\n public void invoke(Object sender, mxEventObject evt)\\n {\\n System.out.println(\"edge=\"+evt.getProperty(\"cell\"));\\n }\\n});\\n\n */\n}", "title": "" }, { "docid": "0a15d2442c113f079d0056fd7f2fcdcf", "score": "0.51380134", "text": "show() {\n this.container.show();\n }", "title": "" }, { "docid": "16c6fac7e6c13ac3be655ee918245d0c", "score": "0.51211715", "text": "function DockPanel() {\n _super.call(this);\n this._overlayTimer = 0;\n this._overlayHidden = true;\n this._overlayNode = null;\n this.addClass(DOCK_PANEL_CLASS);\n this._tabBar = new widgets.TabBar();\n this._stackedPanel = new widgets.StackedPanel();\n this._overlayNode = this.createOverlay();\n var layout = new widgets.BoxLayout(widgets.Direction.TopToBottom, 0);\n layout.addWidget(this._tabBar);\n layout.addWidget(this._stackedPanel);\n this.layout = layout;\n this.setFlag(widgets.WidgetFlag.DisallowLayoutChange);\n this.node.appendChild(this._overlayNode);\n }", "title": "" }, { "docid": "ca9bc4e80d273d948b01ff58de1a84d3", "score": "0.51062477", "text": "function Container()\n\t{\n\t DisplayObject.call(this);\n\t\n\t /**\n\t * The array of children of this container.\n\t *\n\t * @member {PIXI.DisplayObject[]}\n\t * @readonly\n\t */\n\t this.children = [];\n\t}", "title": "" }, { "docid": "ccd08e3b282c6b3abeaab54916079fd9", "score": "0.50948066", "text": "newContainer() {\n return new display.Container();\n }", "title": "" }, { "docid": "03edf9657dde5adad1c120195fd86100", "score": "0.5093659", "text": "function getBackgroundContainer(){\n var tmp_container = engine.createContainer();\n var tmp_slate = engine.createSlate();\n \n Logger.log( 'm_menu_widget.getDisplayNode().width = ' + m_menu_widget.getDisplayNode().width );\n tmp_slate = engine.createSlate();\n tmp_slate.width = 410;\n tmp_slate.height = 1080*2;\n tmp_container.x = -96;\n tmp_container.y = -1080;\n \n tmp_slate.shader = ShaderCreatorInstance.createSolidColorShader( RGBLibraryInstance.getBLACK( 1 ) );\n \n tmp_container.addChild( tmp_slate );\n \n return tmp_container;\n }", "title": "" }, { "docid": "d730e3e9b72e0df177bbf2602c64ee52", "score": "0.50906044", "text": "function MainView() {\n var _this = _super.call(this) || this;\n // Initialize the View\n _this.present(_this.racksView);\n return _this;\n }", "title": "" }, { "docid": "5b1361a6c2f3f30fd5440117b06a2a9c", "score": "0.5087526", "text": "function mainLayout(chart){\n var e = FloriaDOM.getElement(chart.id);\n chart.margin = {top: 25, right: 20, bottom: (50+(chart.maxXLayout+20)), left: (50+chart.maxYLayout+25), front: 0, back: 0};\n chart.width = e.offsetWidth - chart.margin.left - chart.margin.right - 7; \n chart.height = e.offsetHeight - chart.margin.top - chart.margin.bottom;\n chart.depth = 100 - chart.margin.front - chart.margin.back; chart.padding = 100; \n chart.color = d3.scaleOrdinal().range(ChartTheme.colors); \n }", "title": "" }, { "docid": "4abd63012bf80d2f48a6836f80c607ac", "score": "0.50823283", "text": "onAdd() {\n this.getPanes().floatPane.appendChild(this.containerDiv);\n }", "title": "" }, { "docid": "97126acf12403a69ecce30dfad09d433", "score": "0.50733113", "text": "el() {\n // sidebar container of all widgets\n return $(\"#widgetsbar\");\n }", "title": "" }, { "docid": "7e9b3a294251f1037314bf7a85fad071", "score": "0.5072063", "text": "function init() {\n this._wm_tracker = Shell.WindowTracker.get_default();\n\n this._overviewHidingSig = Main.overview.connect('hiding', Util.strip_args(Intellifade.syncCheck).bind(this));\n\n if (Settings.transition_with_overview()) {\n this._overviewShownSig = Main.overview.connect('showing', _overviewShown.bind(this));\n } else {\n this._overviewShownSig = Main.overview.connect('shown', _overviewShown.bind(this));\n }\n\n let windows = global.get_window_actors();\n\n for (let window_actor of windows) {\n /* Simulate window creation event, null container because _windowActorAdded doesn't utilize containers */\n _windowActorAdded(null, window_actor, false);\n }\n\n this._workspaceSwitchSig = global.window_manager.connect_after('switch-workspace', _workspaceSwitched.bind(this));\n\n const screen = global.screen || global.display;\n\n if (screen) {\n this._windowRestackedSig = screen.connect_after('restacked', _windowRestacked.bind(this));\n } else {\n log('[Dynamic Panel Transparency] Error could not register \\'restacked\\' event.');\n }\n\n this._windowActorAddedSig = global.window_group.connect('actor-added', _windowActorAdded.bind(this));\n this._windowActorRemovedSig = global.window_group.connect('actor-removed', _windowActorRemoved.bind(this));\n\n this._appFocusedSig = this._wm_tracker.connect_after('notify::focus-app', _windowRestacked.bind(this));\n}", "title": "" }, { "docid": "5b30e72acd06e2a0155f427d0cde96dc", "score": "0.5071161", "text": "onAdd() {\r\n this.getPanes().floatPane.appendChild(this.containerDiv);\r\n }", "title": "" }, { "docid": "08be15b397351ee6bacf18503dde41f7", "score": "0.50680506", "text": "function Footprints_Container() { this.initialize.apply(this, arguments); }", "title": "" }, { "docid": "775bd7ff1e097d68da2d062c69f6b5c3", "score": "0.5047823", "text": "buildContainer() {\n this.container = document.createElement('div');\n this.container.classList.add('datagrid-container');\n this.container.classList.add('panel');\n this.container.setAttribute('id', this.id);\n this.container.setAttribute('aria-expanded', 'true');\n\n if (this.title) {\n this.container.appendChild(this.header);\n }\n\n if (this.showinfo) {\n this.container.appendChild(this.datainfo);\n }\n\n if (this.filterable) {\n this.container.appendChild(this.filterinfo);\n }\n\n this.grid.appendChild(this.thead);\n this.grid.appendChild(this.gridbody);\n\n this.gridwrapper = document.createElement('div');\n this.gridwrapper.classList.add('grid-wrapper');\n this.gridwrapper.appendChild(this.shade.container);\n this.gridwrapper.appendChild(this.grid);\n this.container.appendChild(this.gridwrapper);\n\n if (this.showfooter) {\n this.container.appendChild(this.footer);\n }\n\n this.gridwrapper.onscroll = () => {\n if (this.gridwrapper.scrollLeft > 0) {\n this.grid.classList.add('schoriz');\n } else {\n this.grid.classList.remove('schoriz');\n }\n if (this.gridwrapper.scrollTop > 0) {\n this.grid.classList.add('scvert');\n } else {\n this.grid.classList.remove('scvert');\n }\n };\n\n this.messagebox = document.createElement('div');\n this.messagebox.classList.add('messages');\n this.messagebox.classList.add('hidden');\n this.gridwrapper.appendChild(this.messagebox);\n\n if (this.minimized) { // don't call close() to avoid the callbacks.\n this.container.setAttribute('aria-expanded', 'false');\n this.minimized = true;\n }\n\n if (this.hidden) { this.hide(); }\n\n // FINALLY, we\n this.updateCount();\n\n }", "title": "" }, { "docid": "6925aba82362a9b18f25415c3ab0d016", "score": "0.50367475", "text": "function Overlay() {\n this._timer = -1;\n this._hidden = true;\n this.node = document.createElement('div');\n this.node.classList.add('p-DockPanel-overlay');\n this.node.classList.add('p-mod-hidden');\n this.node.style.position = 'absolute';\n }", "title": "" }, { "docid": "e671b5991249f2589363adc31b5c7380", "score": "0.5034688", "text": "get overlayElement() {\n return this._pane;\n }", "title": "" }, { "docid": "e671b5991249f2589363adc31b5c7380", "score": "0.5034688", "text": "get overlayElement() {\n return this._pane;\n }", "title": "" }, { "docid": "e671b5991249f2589363adc31b5c7380", "score": "0.5034688", "text": "get overlayElement() {\n return this._pane;\n }", "title": "" }, { "docid": "e671b5991249f2589363adc31b5c7380", "score": "0.5034688", "text": "get overlayElement() {\n return this._pane;\n }", "title": "" }, { "docid": "288047ff77080edbb422d168de4151bb", "score": "0.5020163", "text": "function Overlay() {\r\n this._timer = -1;\r\n this._hidden = true;\r\n this.node = document.createElement('div');\r\n this.node.classList.add('p-DockPanel-overlay');\r\n this.node.classList.add('p-mod-hidden');\r\n this.node.style.position = 'absolute';\r\n }", "title": "" }, { "docid": "f944ebcd47dc64651187cfe99f17b0ca", "score": "0.5015986", "text": "function setup() {\n var myCanvas = createCanvas(600,400);\n myCanvas.parent(\"myContainer\");\n}", "title": "" }, { "docid": "310486541dc7ed2371bc5037491c4823", "score": "0.5015318", "text": "function setupSimpleIFrameMoleculeContainer() {\n var size = Math.min(layout.display.page.height * 0.78, layout.display.page.width * 0.75);\n molecule_container.resize(size, size);\n }", "title": "" }, { "docid": "2e95aac95f5b581cb8e3e9b9d0ba544f", "score": "0.50144947", "text": "show() {\n\t\tif (this.xid) {\n\t\t\tglobal.X.MapWindow( this.xid );\n\t\t\t// Make sure the window is in the correct position again.\n\t\t\tthis.redraw();\n\t\t}\n\t}", "title": "" }, { "docid": "034c8e78ddc61dfdcc8e3080d48eb083", "score": "0.5012241", "text": "function getDI(){return nb.getContainer();}", "title": "" }, { "docid": "2a0cd6252b396657c36e2d6e8c5074e8", "score": "0.50002056", "text": "onAdd() {\n this.getPanes().floatPane.appendChild(this.containerDiv);\n }", "title": "" }, { "docid": "2a0cd6252b396657c36e2d6e8c5074e8", "score": "0.50002056", "text": "onAdd() {\n this.getPanes().floatPane.appendChild(this.containerDiv);\n }", "title": "" }, { "docid": "b34a942b29c277a9e8fd0288e171db8c", "score": "0.4994574", "text": "_fullUpdate() {\n var layers = this.getVisibleLayers();\n if (layers.length == 0) {\n this.__checkPaneResize();\n return;\n }\n\n var bounds = this.getBounds();\n\n if (!bounds) {\n return; // the pane has not yet been rendered -> wait for the appear event\n }\n\n this._setLayerWindow(\n layers,\n this.__scrollLeft,\n this.__scrollTop,\n bounds.width,\n bounds.height,\n true\n );\n\n this.__checkPaneResize();\n }", "title": "" }, { "docid": "1919f9c96d03ad6f4a4f331c186fbbaf", "score": "0.4982396", "text": "function open(){\n\t\tresizePopin();\n\t\toptions.show(domElement);\n\t}", "title": "" }, { "docid": "bc587c8499cca9aeda1d998309df896f", "score": "0.49813366", "text": "function showProjectsInOverlay () {\n \n $().w2layout({\n name: 'popupLayout',\n panels: [\n { type: 'left', size: 250, resizable: true, minSize: 200 },\n { type: 'main', minSize: 350, overflow: 'hidden' }\n ]\n });\n \n octo.getUser().repos(function(err, repos) {\n \n if (err) w2alert('No repositories are accessible');\n \n else {\n \n var secret = {id: 'secret', text: 'Your private projects (', group: true, expanded: true, nodes: []};\n var open = {id: 'public', text: 'Your public projects (', group: true, expanded: true, nodes: []};\n var shared = {id: 'shared', text: 'Projects shared with you (', group: true, expanded: true, nodes: []};\n var forked = {id: 'forked', text: 'Projects you have forked (', group: true, expanded: true, nodes: []};\n \n var obj = repos.sort(function(a,b){\n if(a.full_name.toLowerCase() > b.full_name.toLowerCase()) return 1;\n if (a.full_name.toLowerCase() < b.full_name.toLowerCase()) return -1;\n else return 0;\n });\n \n for (var i in obj) {\n var item = obj[i];\n \n if (item.fork)\n forked.nodes.push({\n id: item.full_name + '_' + Math.round(Math.random*1000000),\n text: item.name,\n icon: \"fa fa-code-fork\"\n });\n else if (item.private)\n secret.nodes.push({\n id: item.full_name + '_' + Math.round(Math.random*1000000),\n text: item.name,\n icon: \"fa fa-eye-slash\"\n });\n else if (item.owner.login !== config.user)\n shared.nodes.push({\n id: item.full_name + '_' + Math.round(Math.random*1000000),\n text: '<img class=\"custom-icon\" src=\"' + item.owner.avatarUrl +'\"/> ' + item.fullName\n });\n else\n open.nodes.push({\n id: item.full_name + '_' + Math.round(Math.random*1000000),\n text: item.name,\n icon: \"fa fa-github\"\n });\n }\n \n // update count\n \n open.text += open.nodes.length + ')';\n shared.text += shared.nodes.length + ')';\n secret.text += secret.nodes.length + ')';\n forked.text += forked.nodes.length + ')';\n \n if (w2ui.projectList) w2ui.projectList.destroy();\n \n $().w2sidebar({\n name: 'projectList',\n //topHTML: '<div style=\"background-color: #eee; text-align: center; padding: 10px 5px; border-bottom: 1px solid silver\">YOUR PROJECTS</div>',\n showMax: true,\n nodes: [\n secret,\n open,\n shared,\n forked\n ],\n onDblClick: function (event) {\n var target = event.target.split('/');\n var user = target[0];\n target = target[1].split('_');\n target.pop();\n var repo = target.join('_');\n w2popup.close();\n initAll();\n setTimeout (function () {openProject(user,repo);}, 300);\n }\n });\n \n $('#popup').w2render('popupLayout');\n w2ui.popupLayout.content('left', w2ui.projectList);\n w2ui.popupLayout.content('main', '<h1>Select project</h1>');\n //w2ui.layout.resize();\n w2popup.unlock();\n }\n });\n\n w2popup.open({\n title: 'Open an existing project',\n width: 1200,\n height: 1000,\n body: '<div id=\"popup\"></div>',\n showClose: false,\n maximised: true,\n modal: true,\n onOpen : function (event) {\n event.onComplete = function () {\n $('#projectList').w2render('popupLayout');\n };\n },\n onToggle: function (event) {\n event.onComplete = function () {\n w2ui.projectList.resize();\n };\n }\n });\n w2popup.lock('Loading projects ...', true);\n\n}", "title": "" }, { "docid": "a689528caf7f6ba6403211023ba52407", "score": "0.49736488", "text": "function ShowExampleAppLayout(p_open) {\n ImGui.SetNextWindowSize(new ImGui.Vec2(500, 440), ImGui.Cond.FirstUseEver);\n if (ImGui.Begin(\"Example: Simple layout\", p_open, ImGui.WindowFlags.MenuBar)) {\n IMGUI_DEMO_MARKER(\"Examples/Simple layout\");\n if (ImGui.BeginMenuBar()) {\n if (ImGui.BeginMenu(\"File\")) {\n if (ImGui.MenuItem(\"Close\"))\n p_open(false);\n ImGui.EndMenu();\n }\n ImGui.EndMenuBar();\n }\n // Left\n const selected = STATIC(UNIQUE(\"selected#079abfa7\"), 0);\n {\n ImGui.BeginChild(\"left pane\", new ImGui.Vec2(150, 0), true);\n for (let i = 0; i < 100; i++) {\n // FIXME: Good candidate to use ImGuiSelectableFlags_SelectOnNav\n const label = `MyObject ${i}`;\n if (ImGui.Selectable(label, selected.value === i))\n selected.value = i;\n }\n ImGui.EndChild();\n }\n ImGui.SameLine();\n // Right\n {\n ImGui.BeginGroup();\n ImGui.BeginChild(\"item view\", new ImGui.Vec2(0, -ImGui.GetFrameHeightWithSpacing())); // Leave room for 1 line below us\n ImGui.Text(`MyObject: ${selected.value}`);\n ImGui.Separator();\n if (ImGui.BeginTabBar(\"##Tabs\", ImGui.TabBarFlags.None)) {\n if (ImGui.BeginTabItem(\"Description\")) {\n ImGui.TextWrapped(\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \");\n ImGui.EndTabItem();\n }\n if (ImGui.BeginTabItem(\"Details\")) {\n ImGui.Text(\"ID: 0123456789\");\n ImGui.EndTabItem();\n }\n ImGui.EndTabBar();\n }\n ImGui.EndChild();\n if (ImGui.Button(\"Revert\")) { }\n ImGui.SameLine();\n if (ImGui.Button(\"Save\")) { }\n ImGui.EndGroup();\n }\n }\n ImGui.End();\n }", "title": "" }, { "docid": "3d03924e3e8d5cb0394c2b284bc343a3", "score": "0.49620208", "text": "function getAnnounceContainer() {\n var container = document.getElementById(ParentContainerId);\n if (!container) {\n container = document.createElement(\"div\");\n container.id = ParentContainerId;\n container.classList.add(\"visually-hidden\");\n document.body.appendChild(container);\n }\n return container;\n}", "title": "" }, { "docid": "2a834a0ab0eae4425512929064d7c891", "score": "0.49556902", "text": "function DockArea() {\n _super.call(this);\n this._handleSize = 3;\n this._tabWidth = 175;\n this._tabOverlap = 0;\n this._minTabWidth = 45;\n this._ignoreRemoved = false;\n this._root = null;\n this._dragData = null;\n this._items = [];\n this.addClass(DOCK_AREA_CLASS);\n this._root = this._createSplitter(widgets.Orientation.Horizontal);\n var layout = new widgets.BoxLayout(widgets.Direction.TopToBottom, 0);\n layout.addWidget(this._root);\n this.layout = layout;\n this.setFlag(widgets.WidgetFlag.DisallowLayoutChange);\n }", "title": "" }, { "docid": "29643dd5fe6f7a66632857bf255e352a", "score": "0.49528903", "text": "getMainContainter(){\n document.getElementById('main-container').innerHTML = this.mainContainer;\n }", "title": "" }, { "docid": "a83345d2cfd057cae285e86f3b4d7a56", "score": "0.4948246", "text": "function ShellView() {\n _super.call(this);\n this.addClass(SHELL_VIEW_CLASS);\n this._menuBar = new MenuBar();\n this._topPanel = new shell.ShellPanel(Direction.TopToBottom);\n this._leftPanel = new shell.ShellPanel(Direction.LeftToRight);\n this._rightPanel = new shell.ShellPanel(Direction.RightToLeft);\n this._bottomPanel = new shell.ShellPanel(Direction.BottomToTop);\n this._centerPanel = new shell.ShellPanel(Direction.TopToBottom);\n this._menuManager = new shell.MenuManager(this._menuBar);\n this._topPanel.addClass(TOP_CLASS);\n this._leftPanel.addClass(LEFT_CLASS);\n this._rightPanel.addClass(RIGHT_CLASS);\n this._bottomPanel.addClass(BOTTOM_CLASS);\n this._centerPanel.addClass(CENTER_CLASS);\n this._menuBar.hide();\n this._topPanel.verticalSizePolicy = SizePolicy.Fixed;\n shell.enableAutoHide(this._topPanel);\n shell.enableAutoHide(this._leftPanel);\n shell.enableAutoHide(this._rightPanel);\n shell.enableAutoHide(this._bottomPanel);\n var hSplitter = new SplitPanel(Orientation.Horizontal);\n var vSplitter = new SplitPanel(Orientation.Vertical);\n hSplitter.handleSize = 0;\n vSplitter.handleSize = 0;\n hSplitter.addWidget(this._leftPanel);\n hSplitter.addWidget(this._centerPanel, 1);\n hSplitter.addWidget(this._rightPanel);\n vSplitter.addWidget(hSplitter, 1);\n vSplitter.addWidget(this._bottomPanel);\n var layout = new BoxLayout(Direction.TopToBottom, 0);\n layout.addWidget(this._menuBar);\n layout.addWidget(this._topPanel);\n layout.addWidget(vSplitter, 1);\n this.layout = layout;\n this.setFlag(WidgetFlag.DisallowLayoutChange);\n }", "title": "" }, { "docid": "3fdd29dd3a9b68374a0a78179c736f7b", "score": "0.49353158", "text": "getContainerHeight() {\n let headerHeight = $$.header.height();\n if ($$.adminBar.length) headerHeight += 32;\n\n let containerHeight = $(window).height() - headerHeight;\n\n return containerHeight;\n }", "title": "" }, { "docid": "fefa693afa556cb66c8612e88f40d61c", "score": "0.49352983", "text": "function init() {\n var me = fin.desktop.Window.getCurrent();\n\n me.getBounds(function(bounds) {\n var desiredHeight = 500,\n desiredWidth = 500,\n totalWidth = bounds.width,\n totalHeight = bounds.height,\n windowWidthDiff = totalWidth - window.innerWidth,\n windowWidthHeightDiff = totalHeight - window.innerHeight,\n newWidth = desiredWidth + windowWidthDiff,\n newHeight = desiredHeight + windowWidthHeightDiff;\n\n me.resizeTo(newWidth, newHeight, \"top-left\", function() {\n document.write('window.innerWidth: ', window.innerWidth, ' window.innerHeight: ', window.innerHeight);\n me.show();\n }, me.show);\n });\n}", "title": "" }, { "docid": "3c5f3734b43fb2d5d5c2ced1781b3ed0", "score": "0.49288592", "text": "parent() {\n return super.parent();\n }", "title": "" }, { "docid": "2868c902c76ffec6feaa66466787987e", "score": "0.4927386", "text": "function $GetDesktopContainer() { return __GLOBALS.desktop; }", "title": "" }, { "docid": "bd1d8357877266e7729eaa7d4d5b6193", "score": "0.4925022", "text": "showCenters() {\n this.opts.visualize = \"centers\";\n this.drawCenters();\n this.geometry.isVisible = true;\n }", "title": "" }, { "docid": "b9a89d74550e3d4ead85c652bcb7915a", "score": "0.4925017", "text": "_createContainer() {\n const container = this._document.createElement('div');\n container.classList.add('overlay-container');\n this._document.body.appendChild(container);\n this._containerElement = container;\n }", "title": "" }, { "docid": "b9a89d74550e3d4ead85c652bcb7915a", "score": "0.4925017", "text": "_createContainer() {\n const container = this._document.createElement('div');\n container.classList.add('overlay-container');\n this._document.body.appendChild(container);\n this._containerElement = container;\n }", "title": "" }, { "docid": "dfd6b14cacbef7722fd99d0d6b5e01dd", "score": "0.4915547", "text": "add_menu(){\n mainPanel.resize(800,600);\n }", "title": "" }, { "docid": "c76218003f42370ebe4aaa96d9194b18", "score": "0.49155366", "text": "_createOuterWindow(x, y, rectWidth, rectHeight) {\n this.graphics.lineStyle(\n this.borderThickness,\n this.borderColor,\n this.borderAlpha\n );\n this.graphics.strokeRect(x, y, rectWidth, rectHeight);\n }", "title": "" }, { "docid": "8e0a6be1eefb5048a00bb4ebe3c46d59", "score": "0.4913158", "text": "function initDisplay(){\n\n\n\t// Rotation window\n\tvar rotationMaster= blessed.box({\n\t\ttop: 10,\n\t\tleft: 20,\n\t\twidth: 23,\n\t\theight: 6,\n\t\ttags: true,\n\t\tborder: {\n\t\t\ttype: 'line'\n\t\t},\n\t\tstyle: {\n\t\t\tborder: {\n\t\t\t\t\tfg: '#ffffff'\n\t\t\t}\n\t\t}\n\t});\n\n\t// Velocity window\n\tvar velocityMaster= blessed.box({\n\t\ttop: 10,\n\t\tleft: 50,\n\t\twidth: 15,\n\t\theight: 6,\n\t\ttags: true,\n\t\tborder: {\n\t\t\ttype: 'line'\n\t\t},\n\t\tstyle: {\n\t\t\tborder: {\n\t\t\t\t\tfg: '#ffffff'\n\t\t\t}\n\t\t}\n\t});\n\n\t// Battery window\n\tbatteryMaster= blessed.box({\n\t\ttop: 20,\n\t\tleft: 50,\n\t\twidth: 22,\n\t\theight: 5,\n\t\ttags: true,\n\t\tborder: {\n\t\t\ttype: 'line'\n\t\t},\n\t\tstyle: {\n\t\t\tborder: {\n\t\t\t\t\tfg: '#ffffff'\n\t\t\t}\n\t\t}\n\t});\n\n\t// Altitude window\n\taltMaster = blessed.box({\n\t\ttop: 20,\n\t\tleft: 80,\n\t\twidth: 7,\n\t\theight: 24,\n\t\ttags: true,\n\t\tborder: {\n\t\t\ttype: 'line'\n\t\t},\n\t\tstyle: {\n\t\t\tborder: {\n\t\t\t\t\tfg: '#ffffff'\n\t\t\t}\n\t\t}\n\t});\n\n\t\n\t// BIP\n\tpanel = blessed.box({\n\t\ttop: 30,\n\t\tleft: 10,\n\t\twidth: 52,\n\t\theight: 14,\n\t\tborder:{\n\t\t\ttype: 'line'\n\t\t}\n\t});\n\n\t// Vertical speed indicator\n\tnewBarPN(-100,20,90,vsBar,'vertical',20);\n\t\n\tinitBIP(panel);\n\taddRoll(rotationMaster);\n\taddSpeed(velocityMaster);\n\taddBattery(batteryMaster);\n\taddAlt(altMaster);\n\n\tscreen.append(panel);\n\tscreen.append(rotationMaster);\n\tscreen.append(velocityMaster);\n\tscreen.append(batteryMaster);\n\tscreen.append(altMaster);\n\n\t// Render the screen.\n\tscreen.render();\n}", "title": "" }, { "docid": "bb9b9a97bdb8453de546b7cea6847016", "score": "0.4912548", "text": "function initialized() {\n createFolderItem(\"Documents\", 20, 10);\n createFolderItem(\"Briefcase\", 20, 80);\n createWindow(design, \"data\", \"Window Testtitle - Data Window 1\", 70, 100);\n createWindow(design, \"data\", \"Window Testtitle - Data Window 2\", 420, 100);\n createWindow(design, \"data\", \"Window Testtitle - Data Window 3\", 150, 240);\n\n createWindow(design, \"app\", \"Window Testtitle - App Window 4\", 420, 240);\n //createWindowControl(type, value, parentWindowIndex, parentIndex, offsetX, offsetY, sizeX, sizeY) {\n var lastWindow = canTopData.renderQueueSize - 1;\n createWindowControl(\"inputField\", \"Enter new window title here\", lastWindow, -1, 20, 20, 150, 18, \"setWindowTitle\");\n createWindowControl(\"inputField\", \"Or right in this textfield\", lastWindow, -1, 20, 60, 120, 18, \"setWindowTitle\");\n createWindowControl(\"inputField\", \"Press Enter\", lastWindow, -1, 20, 160, 120, 18, \"setWindowTitle\");\n\n // Main loop\n var queueItem = 0;\n\n function mainloop() {\n drawBackground();\n drawFolderItems();\n\n for (queueItem = 0; queueItem < canTopData.renderQueueSize; queueItem++) {\n drawQueueItem(queueItem);\n if (canTopData.renderQueue[queueItem].type === \"window\") {\n renderWindowContent(queueItem);\n }\n }\n\n if (useDebug) {\n drawGrid();\n drawActiveCell();\n }\n\n if (useCustomMouse) {\n drawMouse();\n }\n\n window.requestAnimationFrame(mainloop);\n }\n\n\n // Bind the mouse to the current window\n canvas.addEventListener(\"mousemove\", function (evt) {\n mouse.x = evt.clientX;\n mouse.y = evt.clientY;\n if (canTopData.activeWindow !== null) {\n var mouseTraps = canTopData.mouseTraps;\n var trap = [];\n var mX = evt.clientX - mouse.offsetX;\n var mY = evt.clientY - mouse.offsetY;\n mouse.current = \"default\";\n\n var parentWindow = getWindowById(canTopData.activeWindow);\n\n for (var trapIndex = 0; trapIndex < mouseTraps.length; trapIndex++) {\n trap = mouseTraps[trapIndex];\n\n if (trap[0] !== canTopData.activeWindow) {\n continue;\n }\n\n if (mX >= parentWindow.contentArea[0] && mX <= (parentWindow.contentArea[0] + parentWindow.contentArea[4][2]) && mY >= parentWindow.contentArea[1] && mY <= (parentWindow.contentArea[1] + parentWindow.contentArea[4][3])) {\n dc.beginPath();\n dc.rect(trap[2] - parentWindow.contentArea[5][0], trap[3] - parentWindow.contentArea[5][1], trap[4], trap[5]);\n dc.closePath();\n if (dc.isPointInPath(mX, mY)) {\n mouse.current = trap[6];\n break;\n }\n }\n }\n }\n });\n\n canvas.addEventListener(\"click\", checkClick);\n canvas.addEventListener(\"mousedown\", activateMovement);\n canvas.addEventListener(\"mouseup\", deactivateMovement);\n canvas.addEventListener(\"mouseout\", deactivateMovement);\n canvas.addEventListener(\"wheel\", checkWheel);\n\n // Get the right offset values after window resizing\n window.addEventListener(\"resize\", function () {\n mouse.offsetX = canvas.offsetLeft;\n mouse.offsetY = canvas.offsetTop;\n });\n\n mainloop();\n }", "title": "" }, { "docid": "1ad35b10936aa09f5b2356466a27a472", "score": "0.4905171", "text": "_createWindow() {\n const gameHeight = this._getGameHeight();\n const gameWidth = this._getGameWidth();\n const dimensions = this._calculateWindowDimensions(gameWidth, gameHeight);\n this.graphics = this.scene.add.graphics();\n\n this._createOuterWindow(\n dimensions.x,\n dimensions.y,\n dimensions.rectWidth,\n dimensions.rectHeight\n );\n this._createInnerWindow(\n dimensions.x,\n dimensions.y,\n dimensions.rectWidth,\n dimensions.rectHeight\n );\n }", "title": "" }, { "docid": "dc9fe85d1789617df5ca20459504dcc5", "score": "0.4904322", "text": "function Overlay(){this._timer=-1;this._hidden=true;this.node=document.createElement('div');this.node.classList.add('lm-DockPanel-overlay');this.node.classList.add('lm-mod-hidden');/* <DEPRECATED> */this.node.classList.add('p-DockPanel-overlay');this.node.classList.add('p-mod-hidden');this.node.style.position='absolute';}", "title": "" }, { "docid": "40fda5a14f920c2bd7974635d954503e", "score": "0.48914447", "text": "function preparePlotArea() { \n //remove the previous content\n let container = d3.select(\"#visualization\")\n container.selectAll('div').remove()\n // create the ensemble visualization area (treemap)\n container\n .append('div')\n .attr('id', 'ensemblevis')\n // create the time point selection panel\n container\n .append('div')\n .attr('id', 'timetablevis')\n // create the info table about the selected time point\n container\n .append('div')\n .attr('id', 'timetableinfo')\n}", "title": "" }, { "docid": "60d52de5de704e5dc41a27a5f2e8ebd8", "score": "0.48855028", "text": "function showAddChartPopup() {\n\tjQuery('#addcharttoHomepage').css('display', 'inline');\n\tplaceAtCenterChartPopup(jQuery('#addcharttoHomepage'));\n}", "title": "" }, { "docid": "04ed5dc537e8a2bd6a75cfa6294f0b9e", "score": "0.48834592", "text": "function _getTopOverlay() {\n\t return {\n\t width: Utils.getFullWindowWidth() + Constants.PX,\n\t height: Components.rect.top + Constants.PX,\n\t top: 0,\n\t left: 0\n\t };\n\t}", "title": "" }, { "docid": "a84034a3f439aeb3a611980bdd9c89d9", "score": "0.48827896", "text": "function initUI() {\n\t\tcontent = new SignItCoreContent();\n\n\t\t// Setup an absolute-positionned anchor we can programatically move\n\t\t// to be able to point exactly some coords with our popup later\n\t\tanchor = $( '<div class=\"signit-popup-anchor\">' );\n\t\t$( 'body' ).append( anchor );\n\n\t\t// Create and add our popup to the DOM\n\t\tpopup = new OO.ui.PopupWidget( {\n\t\t\t$content: content.getContainer(),\n\t\t\tpadded: true,\n\t\t\twidth: 850,\n\t\t\t$floatableContainer: anchor,\n\t\t\tposition: 'above',\n\t\t\talign: 'center',\n\t\t\tautoClose: true,\n\t\t\tautoFlip: true,\n\t\t\thideWhenOutOfView: false,\n\t\t\t$container: $( 'body' ),\n\t\t\tclasses: [ 'signit-popup' ]\n\t\t} );\n\t\t$( 'body' ).append( popup.$element );\n\t}", "title": "" }, { "docid": "f1d4930a0295d25206c2d7afa8971ba0", "score": "0.4881774", "text": "show() {\n this.geometry.show();\n }", "title": "" }, { "docid": "261265659b5b219480e65522f149f73c", "score": "0.4880288", "text": "function pl_Anzeigen() {\r\n\t\t\t\tdocument.getElementById('pl-container').style.display = 'inherit';\r\n\t\t\t }", "title": "" }, { "docid": "194858144ee1bf3c5f1ae8e75c3b5cd1", "score": "0.48771006", "text": "function growCurrentWindow() {\n var win = workspace.activeClient;\n win.geometry = {\n x: win.x - 20,\n y: win.y,\n width: win.width + 40,\n height: win.height,\n }\n}", "title": "" }, { "docid": "a0430137314abe43b3d94906bebd337a", "score": "0.48770663", "text": "displayScene() {\n // entry point for graph rendering\n // Render loop starting at root of graph\n\n this.displayNode(this.components[this.idRoot], this.scene.defaultMaterial, null, 1, 1);\n }", "title": "" }, { "docid": "9da7701b9dd96c3e6b8c460cafdc5b8e", "score": "0.48710778", "text": "function addToDock() {}", "title": "" }, { "docid": "0490eda0871cf9703a96c7787546d348", "score": "0.48699227", "text": "function makeSidePanel() {\n // Create the base side panel, into which other widgets will be added.\n var mainPanel = ui.Panel({\n layout: ui.Panel.Layout.flow('vertical', true),\n style: {\n stretch: 'horizontal',\n height: '100%',\n width: '550px',\n backgroundColor: colors.gray,\n border: BORDER_STYLE,\n }\n });\n\n // Add the app title to the side panel.\n var titleLabel = ui.Label('Collection Mosaic Editor', TITLE_STYLE);\n mainPanel.add(titleLabel);\n\n // Add the app description to the main panel.\n var descriptionText =\n 'This app allows you to interactively explore the effects of ' +\n 'mosaicking different Landsat 8 TOA images using ee.Reducer.median(). ' +\n 'To change which tiles are included in the mosaick, check or uncheck ' +\n 'the thumbnails. To mosaic another area, pan/zoom and click on the map.';\n var descriptionLabel = ui.Label(descriptionText, PARAGRAPH_STYLE);\n mainPanel.add(descriptionLabel);\n\n return mainPanel;\n}", "title": "" }, { "docid": "c9376ecb01d4d7c5a706cabb453d010a", "score": "0.48670462", "text": "function LContainer() {}", "title": "" }, { "docid": "c9376ecb01d4d7c5a706cabb453d010a", "score": "0.48670462", "text": "function LContainer() {}", "title": "" }, { "docid": "6a153d0232c52cae5df3cddc8854edcc", "score": "0.4864551", "text": "function resizeToParent() {\n taClient.resize();\n }", "title": "" }, { "docid": "4d1f6dfa628819c2f5f56a4347a0b513", "score": "0.48634583", "text": "function MainAreaWidget(options) {\n var _this = _super.call(this, options) || this;\n _this._changeGuard = false;\n _this.addClass('jp-MainAreaWidget');\n _this.id = domutils_1.DOMUtils.createDomID();\n var content = (_this._content = options.content);\n var layout = (_this.layout = new widgets_1.BoxLayout({ spacing: 0 }));\n layout.direction = 'top-to-bottom';\n widgets_1.BoxLayout.setStretch(content, 1);\n layout.addWidget(content);\n if (!content.id) {\n content.id = domutils_1.DOMUtils.createDomID();\n }\n content.node.tabIndex = -1;\n _this._updateTitle();\n content.title.changed.connect(_this._updateTitle, _this);\n _this.title.closable = true;\n _this.title.changed.connect(_this._updateContentTitle, _this);\n return _this;\n }", "title": "" }, { "docid": "9fe2dd067a933e7c4dc5b9a3b227e106", "score": "0.48621142", "text": "get documentContainer() {\n return new DockContainer(api.grok_DockManaget_Get_DocumentContainer(this.d));\n }", "title": "" }, { "docid": "b44419981ccbe18d3a3146186d3b10fa", "score": "0.48517656", "text": "function showAllPanes() {\n showInformation();\n showIndicators();\n }", "title": "" }, { "docid": "38a6cc79afe10dbded6bc425d1bb571f", "score": "0.48489615", "text": "positionGlobally() {\n const box = svgHelpers.boxPoints(250, 250, 1, 1);\n SuiDialogBase.position(box, this.dgDom, this.view.tracker.scroller);\n }", "title": "" }, { "docid": "1c35d986cf2d7f8f5e0f7fdb17119657", "score": "0.484812", "text": "_popup(owning_node, elem_or_x, y, closeOnMouseOut = true) {\r\n let x;\r\n\r\n let sarea = this.sareas.active;\r\n\r\n let w = owning_node;\r\n while (w) {\r\n if (w instanceof ScreenArea) {\r\n sarea = w;\r\n break;\r\n }\r\n w = w.parentWidget;\r\n }\r\n\r\n if (typeof elem_or_x === \"object\") {\r\n let r = elem_or_x.getClientRects()[0];\r\n\r\n x = r.x;\r\n y = r.y;\r\n } else {\r\n x = elem_or_x;\r\n }\r\n\r\n x += window.scrollX;\r\n y += window.scrollY;\r\n\r\n let container = UIBase$1.createElement(\"container-x\");\r\n\r\n container.ctx = this.ctx;\r\n container._init();\r\n\r\n let remove = container.remove;\r\n container.remove = () => {\r\n if (this._popups.indexOf(container) >= 0) {\r\n this._popups.remove(container);\r\n }\r\n\r\n return remove.apply(container, arguments);\r\n };\r\n\r\n container.overrideClass(\"popup\");\r\n\r\n container.background = container.getDefault(\"background-color\");\r\n container.style[\"border-radius\"] = container.getDefault(\"border-radius\") + \"px\";\r\n container.style[\"border-color\"] = container.getDefault(\"border-color\");\r\n container.style[\"border-style\"] = container.getDefault(\"border-style\");\r\n container.style[\"border-width\"] = container.getDefault(\"border-width\") + \"px\";\r\n container.style[\"box-shadow\"] = container.getDefault(\"box-shadow\");\r\n\r\n container.style[\"position\"] = UIBase$1.PositionKey;\r\n container.style[\"z-index\"] = \"2205\";\r\n container.style[\"left\"] = x + \"px\";\r\n container.style[\"top\"] = y + \"px\";\r\n container.style[\"margin\"] = \"0px\";\r\n\r\n container.parentWidget = this;\r\n\r\n let mm = new MinMax(2);\r\n let p = new Vector2();\r\n\r\n let _update = container.update;\r\n container.update.after(() => {\r\n container.style[\"z-index\"] = \"2205\";\r\n });\r\n\r\n /*causes weird bugs\r\n container.update = () => {\r\n _update.call(container);\r\n\r\n let rects = container.getClientRects();\r\n mm.reset();\r\n\r\n for (let r of rects) {\r\n p[0] = r.x;\r\n p[1] = r.y;\r\n mm.minmax(p);\r\n\r\n p[0] += r.width;\r\n p[1] += r.height;\r\n mm.minmax(p);\r\n }\r\n\r\n let x = mm.min[0], y = mm.min[1];\r\n\r\n x = Math.min(x, this.size[0]-(mm.max[0]-mm.min[0]));\r\n y = Math.min(y, this.size[1]-(mm.max[1]-mm.min[1]));\r\n\r\n container.style[\"left\"] = x + \"px\";\r\n container.style[\"top\"] = y + \"px\";\r\n }//*/\r\n\r\n document.body.appendChild(container);\r\n //this.shadow.appendChild(container);\r\n this.setCSS();\r\n\r\n this._popups.push(container);\r\n\r\n let touchpick, mousepick, keydown;\r\n\r\n let done = false;\r\n let end = () => {\r\n if (this._popup_safe) {\r\n return;\r\n }\r\n\r\n if (done) return;\r\n\r\n //this.ctx.screen.removeEventListener(\"touchstart\", touchpick, true);\r\n //this.ctx.screen.removeEventListener(\"touchmove\", touchpick, true);\r\n this.ctx.screen.removeEventListener(\"mousedown\", mousepick, true);\r\n this.ctx.screen.removeEventListener(\"mousemove\", mousepick, {passive: true});\r\n this.ctx.screen.removeEventListener(\"mouseup\", mousepick, true);\r\n window.removeEventListener(\"keydown\", keydown);\r\n\r\n done = true;\r\n container.remove();\r\n };\r\n\r\n container.end = end;\r\n\r\n let _remove = container.remove;\r\n container.remove = function () {\r\n if (arguments.length == 0) {\r\n end();\r\n }\r\n _remove.apply(this, arguments);\r\n };\r\n\r\n container._ondestroy = () => {\r\n end();\r\n };\r\n\r\n let bad_time = time_ms();\r\n let last_pick_time = time_ms();\r\n\r\n mousepick = (e, x, y, do_timeout = true) => {\r\n if (!container.isConnected) {\r\n end();\r\n return;\r\n }\r\n\r\n if (sarea && sarea.area) {\r\n sarea.area.push_ctx_active();\r\n sarea.area.pop_ctx_active();\r\n }\r\n //console.log(\"=======================================================popup touch start\");\r\n //console.log(e);\r\n\r\n if (time_ms() - last_pick_time < 350) {\r\n return;\r\n }\r\n last_pick_time = time_ms();\r\n\r\n x = x === undefined ? e.x : x;\r\n y = y === undefined ? e.y : y;\r\n\r\n //let elem = this.pickElement(x, y, 2, 2, undefined, [ScreenBorder]);\r\n let elem = this.pickElement(x, y, {\r\n sx : 2,\r\n sy : 2,\r\n excluded_classes: [ScreenBorder],\r\n mouseEvent : e\r\n });\r\n\r\n let startelem = elem;\r\n\r\n if (elem === undefined) {\r\n if (closeOnMouseOut) {\r\n end();\r\n }\r\n return;\r\n }\r\n\r\n let ok = false;\r\n let elem2 = elem;\r\n\r\n while (elem) {\r\n if (elem === container) {\r\n ok = true;\r\n break;\r\n }\r\n elem = elem.parentWidget;\r\n }\r\n\r\n if (!ok) {\r\n do_timeout = !do_timeout || (time_ms() - bad_time > 100);\r\n\r\n if (closeOnMouseOut && do_timeout) {\r\n end();\r\n }\r\n } else {\r\n bad_time = time_ms();\r\n }\r\n };\r\n\r\n touchpick = (e) => {\r\n let x = e.touches[0].pageX, y = e.touches[0].pageY;\r\n\r\n return mousepick(e, x, y, false);\r\n };\r\n\r\n keydown = (e) => {\r\n if (!container.isConnected) {\r\n window.removeEventListener(\"keydown\", keydown);\r\n return;\r\n }\r\n\r\n switch (e.keyCode) {\r\n case keymap$4[\"Escape\"]:\r\n end();\r\n break;\r\n }\r\n };\r\n\r\n //this.ctx.screen.addEventListener(\"touchstart\", touchpick, true);\r\n //this.ctx.screen.addEventListener(\"touchmove\", touchpick, true);\r\n this.ctx.screen.addEventListener(\"mousedown\", mousepick, true);\r\n this.ctx.screen.addEventListener(\"mousemove\", mousepick, {passive: true});\r\n this.ctx.screen.addEventListener(\"mouseup\", mousepick, true);\r\n window.addEventListener(\"keydown\", keydown);\r\n\r\n /*\r\n container.addEventListener(\"mouseleave\", (e) => {\r\n console.log(\"popup mouse leave\");\r\n if (closeOnMouseOut)\r\n end();\r\n });\r\n container.addEventListener(\"mouseout\", (e) => {\r\n console.log(\"popup mouse out\");\r\n if (closeOnMouseOut)\r\n end();\r\n });\r\n //*/\r\n\r\n this.calcTabOrder();\r\n\r\n return container;\r\n }", "title": "" }, { "docid": "948df6a9ff81386b7926c0d7c2a5db09", "score": "0.4846761", "text": "static center() {\n if (Engine.client === exports.Client.Electron)\n GameWindow.browserWindow.center();\n }", "title": "" }, { "docid": "59442d761bbf8a98ccea3a2227c5c272", "score": "0.48420835", "text": "function getTop()\n{\n setClearSubLayer(main_sub_cat_length);\n} //close the function", "title": "" }, { "docid": "69e6978fae77d3484a8af657ac4fe288", "score": "0.4837698", "text": "function Container(){DisplayObject.call(this); /**\n\t * The array of children of this container.\n\t *\n\t * @member {PIXI.DisplayObject[]}\n\t * @readonly\n\t */this.children=[];} // constructor", "title": "" }, { "docid": "3ef9427afa668db0fc5dac178d6cdfd6", "score": "0.4837023", "text": "createOuterContainerWithStyle(width, height) {\n const divElem = document.createElementNS(null, 'div')\n divElem.setAttributeNS(null, 'class', 'vis-histogram')\n divElem.setAttributeNS(null, 'viewBox', 0 + ' ' + 0 + ' ' + width + ' ' + height)\n divElem.setAttributeNS(null, 'width', '100%')\n divElem.setAttributeNS(null, 'height', '100%')\n\n const addStyleToElem = (attr, stl) => {\n const style = document.createElement('style')\n style.innerText = attr + '{' + stl + '}'\n\n divElem.appendChild(style)\n }\n\n const darkStrokeColor = `rgba(255,255,255,0.7)`\n const buttonLightColor = `#333`\n const darkBtnHoverColor = `rgba(255,255,255,0.5)`\n const darkSelectionFill = `#efefef`\n\n addStyleToElem('.vis-histogram .selection', 'rx: 4px;stroke: transparent;')\n addStyleToElem(\n '.vis-histogram button',\n `\n margin-left: 5px;\n margin-bottom: 5px;\n display: inline-block;\n padding: 2px 10px;\n outline: none;\n background-color: transparent;\n border: 1px solid ${buttonLightColor};\n color: ${buttonLightColor};\n border-radius: 14px;\n font-size: 10px;\n font-family: DejaVuSansMonoBook;\n vertical-align: top;\n transition: all 0.3s ease;\n `\n )\n addStyleToElem(\n '.vis-histogram button:hover',\n `\n background-color: ${buttonLightColor};\n color: ${darkSelectionFill};\n `\n )\n\n addStyleToElem(\n '.dark-theme .vis-histogram button',\n `\n border: 0;\n background-color: ${darkStrokeColor};\n `\n )\n addStyleToElem(\n '.dark-theme .vis-histogram button:hover',\n `\n background-color: ${darkBtnHoverColor};\n `\n )\n addStyleToElem('.dark-theme .vis-histogram .selection', `fill: ${darkSelectionFill}`)\n addStyleToElem('.dark-theme .vis-histogram line', `stroke: ${darkStrokeColor};`)\n addStyleToElem('.dark-theme .vis-histogram .domain', `stroke: ${darkStrokeColor};`)\n addStyleToElem('.dark-theme .vis-histogram text', `fill: ${darkStrokeColor};`)\n\n return divElem\n }", "title": "" }, { "docid": "0680f0226c4d6bcbed91fbd11b9d89a4", "score": "0.48368216", "text": "function create_container($) {\n \n // set body to relative - may not be necessary\n document.body.style.position = \"relative\";\n \n var d = document.createElement('div');\n $(d).css({\n \"background-color\": \"#ffffff\",\n \"border\": \"1px solid #000000\",\n \"font-size\": \"small\",\n \"padding\": \"2px\",\n \"position\": \"fixed\",\n \"right\": \"0\",\n \"top\": \"0\",\n \"bottom\": \"0\",\n \"overflow\": \"scroll\",\n \"zIndex\": \"100000\",\n \"display\": \"none\",\n }).attr('id', 'container');\n $(d).prependTo($(\"body\"));\n \n }", "title": "" }, { "docid": "9403f36d665aca783ca8f962d1662ac3", "score": "0.48326334", "text": "function setUpBasicVisuals(session){\n var artistY = 3 * windowWidth / 8;\n var uSongY = 5 * windowWidth / 8; \n var songY = windowWidth / 2; // song plays are in the center\n \n return new SessionVisualization(session, windowWidth, artistY, uSongY, songY); \n}", "title": "" }, { "docid": "c17499a135990a9022b095046be7c6ff", "score": "0.48274043", "text": "function showContainer() {\n\t\t\t$container.trigger('show.eac');\n\t\t}", "title": "" }, { "docid": "44b0a5db1bcae337990afa88241ab15b", "score": "0.48270178", "text": "getContainer() {\n return this.container;\n }", "title": "" }, { "docid": "a7908056fb6e14b4cff6f4397d8852a4", "score": "0.48216966", "text": "function fitStageIntoParentContainer() {\n var parentContainer = document.querySelector(\"#stage-parent\");\n\n var containerWidth = parentContainer.offsetWidth;\n\n var scale = containerWidth / width;\n\n var width = (window.clientWidth - toolboxPane.clientWidth) - specificationPane.clientWidth;\n var height = (window.clientHeight - navigation.clientHeight) - specificationPane.clientHeight;\n\n stage.width(width);\n stage.height(height);\n stage.draw();\n }", "title": "" }, { "docid": "6be8ff69218515eb6b0f373abd9c315d", "score": "0.48210013", "text": "function Overlay() {\n this._timer = -1;\n this._hidden = true;\n this.node = document.createElement('div');\n this.node.classList.add('lm-DockPanel-overlay');\n this.node.classList.add('lm-mod-hidden');\n /* <DEPRECATED> */\n this.node.classList.add('p-DockPanel-overlay');\n this.node.classList.add('p-mod-hidden');\n this.node.style.position = 'absolute';\n }", "title": "" } ]
cb26e6a130708dfbba45cd7be7ac2bab
Gets a `HarnessPredicate` that can be used to search for a `MatProgressSpinnerHarness` that meets certain criteria.
[ { "docid": "3a907984992bd0ee3dfec8a116c3bb9a", "score": "0.64157736", "text": "static with(options = {}) {\n return new HarnessPredicate(MatLegacyProgressSpinnerHarness, options);\n }", "title": "" } ]
[ { "docid": "d2716075ac3b65bdd98c33b94ad5427b", "score": "0.52170706", "text": "function AutomationPredicate() {}", "title": "" }, { "docid": "18e38ba9df0dbb826363cc6d77e1b772", "score": "0.5163802", "text": "getHarness(query) {\n return this.locatorFor(query)();\n }", "title": "" }, { "docid": "3cb6c3ea4b10c7ebea91c8c4d7a927f0", "score": "0.51249826", "text": "static with(options = {}) {\n return new HarnessPredicate(MatHeaderRowHarness, options);\n }", "title": "" }, { "docid": "d90fc5fafc0c98e5ca9d03ac5c8b430d", "score": "0.5115602", "text": "async hasHarness(query) {\n return (await this.locatorForOptional(query)()) !== null;\n }", "title": "" }, { "docid": "0180e73ceac65bb229307c19cefe0db8", "score": "0.5109443", "text": "static with(options = {}) {\n return new HarnessPredicate(MatDialogHarness, options);\n }", "title": "" }, { "docid": "73efced46ef7e9645eb6003a590e89b9", "score": "0.5101424", "text": "static with(options = {}) {\n return new HarnessPredicate(MatSnackBarHarness, options);\n }", "title": "" }, { "docid": "92c854fb14db3b01c44cf2a4bea05bb3", "score": "0.5082527", "text": "async function shouldSquashPredicate() {\n let matcher = await getMatcher();\n return (pinnedTab, newTab) => {\n if (!isEligibleForSquash(pinnedTab, newTab))\n return false;\n return matcher.match(pinnedTab, newTab);\n };\n}", "title": "" }, { "docid": "af94efd7b256a51a42045cbdcc8e4fd9", "score": "0.5060285", "text": "static with(options = {}) {\n return new HarnessPredicate(MatRowHarness, options);\n }", "title": "" }, { "docid": "089024d80e2966a23dd3cef60d2e153f", "score": "0.49925816", "text": "static with(options = {}) {\n return new HarnessPredicate(MatLegacySnackBarHarness, options);\n }", "title": "" }, { "docid": "9f67a59e0968e4edcbe363eee680624a", "score": "0.4836012", "text": "static with(options = {}) {\n return new HarnessPredicate(MatFooterRowHarness, options);\n }", "title": "" }, { "docid": "9049bd32da9ab600bc66095bd6322faf", "score": "0.4723731", "text": "function checkWith(predicate) {\n return suspend(() => predicate() ? P.unit : P.retry);\n}", "title": "" }, { "docid": "73de42e5956d35d2eee1607c8962aee5", "score": "0.4670218", "text": "getHarnessOrNull(query) {\n return this.locatorForOptional(query)();\n }", "title": "" }, { "docid": "1c0728c583af9136a15b35ab62cd530a", "score": "0.46508238", "text": "function Predicate () {}", "title": "" }, { "docid": "032db2d7445a589008fda97128cdd61d", "score": "0.46455815", "text": "static with(options = {}) {\n return new HarnessPredicate(this, options);\n }", "title": "" }, { "docid": "591bdc11913b7b72cbea789c46fda9e5", "score": "0.45927584", "text": "function Predicate(t) { return Fn (t) (Boolean_); }", "title": "" }, { "docid": "16c4d1d9590311d9a2345ed9de8bc9a9", "score": "0.4585856", "text": "static with(options = {}) {\n return new HarnessPredicate(MatLegacyRadioButtonHarness, options)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabelText(), label))\n .addOption('name', options.name, async (harness, name) => (await harness.getName()) === name)\n .addOption('checked', options.checked, async (harness, checked) => (await harness.isChecked()) == checked);\n }", "title": "" }, { "docid": "b04282230ec9e47dc9b6ff7b3cfb5b53", "score": "0.4571428", "text": "function Predicate() {}", "title": "" }, { "docid": "b04282230ec9e47dc9b6ff7b3cfb5b53", "score": "0.4571428", "text": "function Predicate() {}", "title": "" }, { "docid": "b04282230ec9e47dc9b6ff7b3cfb5b53", "score": "0.4571428", "text": "function Predicate() {}", "title": "" }, { "docid": "739cc3dce8f2011e6a10cbd2945ce9a5", "score": "0.4470806", "text": "function Predicate(){}", "title": "" }, { "docid": "f55ce36aae4cfaa15c27d4681b9b2518", "score": "0.44653147", "text": "function Predicate() { }", "title": "" }, { "docid": "f55ce36aae4cfaa15c27d4681b9b2518", "score": "0.44653147", "text": "function Predicate() { }", "title": "" }, { "docid": "726468696b507a4bb8232992407bd6c4", "score": "0.4298343", "text": "isEnabled(opts = {}) {\n const { filterMask } = opts, otherOpts = __rest(opts, [\"filterMask\"]);\n return this._node.eachWait(this._node.all, element => element.wait.isEnabled(otherOpts), filterMask, true);\n }", "title": "" }, { "docid": "fb899cc85bebfa8810113cb94ad98a52", "score": "0.4233208", "text": "function _predicateWrap(predPicker) {\n return function(preds /* , args */) {\n var predIterator = function() {\n var args = arguments;\n return predPicker(function(predicate) {\n return predicate.apply(null, args);\n }, preds);\n };\n return arguments.length > 1 ?\n // Call function immediately if given arguments\n predIterator.apply(null, _slice(arguments, 1)) :\n // Return a function which will call the predicates with the provided arguments\n arity(max(pluck('length', preds)), predIterator);\n };\n }", "title": "" }, { "docid": "12ee829f3d712bbff60912092f78a469", "score": "0.42143634", "text": "showSpinnerFor (storyName) {\n\n return q.Promise((resolve, reject) => {\n\n // check if story is already loaded\n if (this.promises[storyName].percent === 100) {\n return resolve();\n }\n\n // keep a ref into current showed story\n this.story = this.promises[storyName];\n\n // make loader opacity 1\n TweenMax.set(this.loaderContainer, { opacity: 1, scale: 1 });\n\n // make spinner transparent\n TweenMax.set(this.loaderSpinner, { opacity: 1 });\n\n // put loader into page\n document.body.appendChild(this.loaderContainer);\n\n // wait for spinner loaded\n this.spinnerImageLoaded.then(() => {\n TweenMax.to(this.loaderSpinner, 0.5, { opacity: 1 });\n });\n\n // animate percent\n this.animatePercent();\n\n // wait for story loaded\n this.whenLoaded(storyName)\n .then(this.hideSpinner.bind(this))\n .then(resolve)\n .catch(reject);\n\n });\n\n }", "title": "" }, { "docid": "fbddb1806c99711eb8caa73a553e7fec", "score": "0.41911998", "text": "function check(predicate) {\n return checkWith(() => predicate);\n}", "title": "" }, { "docid": "623a4646dd3920364e8d029c31fa08bd", "score": "0.4147052", "text": "async harnessLoaderFor(selector) {\n return this.createEnvironment(await _assertResultFound(this.getAllRawElements(selector), [\n _getDescriptionForHarnessLoaderQuery(selector),\n ]));\n }", "title": "" }, { "docid": "08e51756d5be22d126ab6d6c7ebcb38f", "score": "0.41319382", "text": "get satisfied() {\n return this.taken >= this.take && this.hours >= this.min_hours;\n }", "title": "" }, { "docid": "27f6d82b312e941181a1cdf5e3658030", "score": "0.41098198", "text": "waitForTarget(predicate, options = {}) {\n return this._browser.waitForTarget((target) => target.browserContext() === this && predicate(target), options);\n }", "title": "" }, { "docid": "27f6d82b312e941181a1cdf5e3658030", "score": "0.41098198", "text": "waitForTarget(predicate, options = {}) {\n return this._browser.waitForTarget((target) => target.browserContext() === this && predicate(target), options);\n }", "title": "" }, { "docid": "27f6d82b312e941181a1cdf5e3658030", "score": "0.41098198", "text": "waitForTarget(predicate, options = {}) {\n return this._browser.waitForTarget((target) => target.browserContext() === this && predicate(target), options);\n }", "title": "" }, { "docid": "e0f3c0a9023b9e5a34543c8589bca688", "score": "0.40728787", "text": "function getBreezePredicate() {\n\n }", "title": "" }, { "docid": "0f2e387421a6c2e4d713fa84d5f9f3ed", "score": "0.40346828", "text": "isEnabled(opts) {\n return this._node.__eventually(() => this._node.wait.isEnabled(opts));\n }", "title": "" }, { "docid": "a62daac0b09fef39ccbb707fdea2e283", "score": "0.40321594", "text": "validateFilterFacet() {\n return this\n .waitForElementVisible('@filterFacet', 10000, (res) => {\n if (res.value) {\n this\n .assert.visible('@filterFacet');\n } else {\n this\n .assert.ok(false, '[FAIL] - Something went wrong when validating filter facet');\n }\n }, '[STEP] - \"Filter facet should be displayed');\n }", "title": "" }, { "docid": "e43bf2d4dacc4950e248792441708e18", "score": "0.40281296", "text": "static with(options = {}) {\n return new HarnessPredicate(MatLegacyRadioGroupHarness, options).addOption('name', options.name, this._checkRadioGroupName);\n }", "title": "" }, { "docid": "acbb129c457bd2447ff811ee74dc5867", "score": "0.4027841", "text": "function testLogicalAND(val){\n if (val <= 50 && val >= 25){\n return \"Yes\";\n }\n return \"No\";\n}", "title": "" }, { "docid": "7bbab2db670f367e723858c1eec20876", "score": "0.39880693", "text": "function predicate (val) {\n\tif (val < 3) {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "d37be74f8923b8c2e7e2f3a1fbabd043", "score": "0.3983453", "text": "isEnabled(opts = {}) {\n const { filterMask } = opts, otherOpts = __rest(opts, [\"filterMask\"]);\n return this._node.eachCheck(this._node.all, element => element.eventually.isEnabled(otherOpts), filterMask, true);\n }", "title": "" }, { "docid": "71187a2d5cb4f2227a17557015d9572c", "score": "0.39582548", "text": "function handleConditionalRequirements(courses) { \n let result_OR = false\n for(let or = 0; or < courses.length; or++) {\n let result_AND = true\n for(let and = 0; and < courses[or].length; and++) {\n result_AND = result_AND && lookup.get(courses[or][and]).isSelected\n }\n result_OR = result_OR || result_AND \n }\n return result_OR\n }", "title": "" }, { "docid": "a0813d156073b793c807f7aaeca6aa58", "score": "0.39515954", "text": "function randomCondition(percentageTrue) {\r\n const rand = Math.random();\r\n return rand < percentageTrue;\r\n}", "title": "" }, { "docid": "5d75df42a63afb5cfd3f388a32cd5cbc", "score": "0.39302242", "text": "enterPredicate(ctx) {\n\t}", "title": "" }, { "docid": "c61d4c8d307a2771ace87a73ead8d582", "score": "0.38844833", "text": "function _getDescriptionForHarnessLoaderQuery(selector) {\n return `HarnessLoader for element matching selector: \"${selector}\"`;\n}", "title": "" }, { "docid": "ccd555f47800a0de3b4535cd7f2ed0d6", "score": "0.3861253", "text": "function createLessThanFilter(base) {\n // YOUR CODE BELOW HERE //\n \n return anyValue => anyValue < base;\n \n}", "title": "" }, { "docid": "188e67c5a9683f974b2bdb08b46d141f", "score": "0.38527742", "text": "function createLessThanFilter(base) {\n // YOUR CODE BELOW HERE //\n return function (givenValue){\n return givenValue < base\n }\n \n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "67d5cbf75081027c9e31c867c3004ac0", "score": "0.38325405", "text": "shouldSkip () {\n const {skema} = this\n\n if (!skema.hasWhen()) {\n return this._shouldSkip()\n }\n\n return skema.when(\n this.args, this.context, this.options)\n .then(hit => {\n if (!hit) {\n // Skip\n return true\n }\n\n return this._shouldSkip()\n })\n }", "title": "" }, { "docid": "6c51ffbd1437c90707eddb3a28e5f189", "score": "0.38295165", "text": "statusFilter(recipe) {\n if (this.state.brewStatus === \"Finished\") {\n return new Date(recipe.endTime) < new Date();\n } else if (this.state.brewStatus === \"Brewing\") {\n return new Date(recipe.endTime) > new Date();\n }\n }", "title": "" }, { "docid": "40699b79e06102feffbf89fc7e3c9f17", "score": "0.38264504", "text": "async elementIsEnabled(selector) {\n await selector.waitForExist();\n await selector.waitForEnabled();\n const isEnabled = await selector.isEnabled();\n return await browser.waitUntil(async function () {\n return isEnabled;\n }, this.timeout);\n }", "title": "" }, { "docid": "c9a74c71e8306185fccc1a8556509cee", "score": "0.38258117", "text": "findControl(predicate) {\r\n // check all sections\r\n for (let i = 0; i < this.sections.length; i++) {\r\n // check all columns\r\n for (let j = 0; j < this.sections[i].columns.length; j++) {\r\n // check all controls\r\n for (let k = 0; k < this.sections[i].columns[j].controls.length; k++) {\r\n // check to see if the predicate likes this control\r\n if (predicate(this.sections[i].columns[j].controls[k])) {\r\n return this.sections[i].columns[j].controls[k];\r\n }\r\n }\r\n }\r\n }\r\n // we found nothing so give nothing back\r\n return null;\r\n }", "title": "" }, { "docid": "ab38a5d1b499c82cc236ce4d71f54dcb", "score": "0.3819589", "text": "function testLogicalAnd(val) {\n if (val <= 50 && val >= 25) { //And is called with &&\n return \"Yes\"\n }\n return \"No\"\n}", "title": "" }, { "docid": "d7a36dd69777e430e509c37891d2b99b", "score": "0.3817523", "text": "function createLessThanFilter(base) {\n // YOUR CODE BELOW HERE //\n return function(value){\n if(base > value){\n return true;\n } else {\n return false;\n }\n };\n \n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "c04d6ac5609f3852801d634bb04cd4dc", "score": "0.38122597", "text": "function fullPageSpinnerVisible() {\n\tvar state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\tvar _ref = arguments[1];\n\tvar type = _ref.type;\n\n\tswitch (type) {\n\t\tcase __WEBPACK_IMPORTED_MODULE_0_actions_types__[\"H\" /* FULL_PAGE_SPINNER_ACTIVATE */]:\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\tcase __WEBPACK_IMPORTED_MODULE_0_actions_types__[\"I\" /* FULL_PAGE_SPINNER_DISABLED */]:\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\tdefault:\n\t\t\t{\n\t\t\t\treturn state;\n\t\t\t}\n\t}\n}", "title": "" }, { "docid": "be1891d3f8476a2bd9d51a6a0bba141d", "score": "0.3807847", "text": "function createLessThanFilter(base) {\n // YOUR CODE BELOW HERE //\n //I-base\n //O-function that gives true or false based on less than comparison\n //C-\n //E-\n //Ok, have a much better grasp on it now, and this is a cleaner version of the code from above but for \"less than\"\n return function testCompare(value) {\n if (value<base) {\n return true\n } else {\n return false\n }\n }\n \n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "7cd9b9651b4c6598f41f51b28bf96526", "score": "0.37894043", "text": "shouldContinue(candidate) {\n return sum(candidate) <= this.sum;\n }", "title": "" }, { "docid": "8779af2cca3694eaec5fc8bd4cd0663a", "score": "0.3777991", "text": "function innerSpinnerVisible() {\n\tvar state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\tvar _ref = arguments[1];\n\tvar type = _ref.type,\n\t payload = _ref.payload;\n\n\tswitch (type) {\n\t\tcase __WEBPACK_IMPORTED_MODULE_0_actions_types__[\"_36\" /* SPINNER_ACTIVATE */]:\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\tcase __WEBPACK_IMPORTED_MODULE_0_actions_types__[\"_37\" /* SPINNER_DISABLED */]:\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\tdefault:\n\t\t\t{\n\t\t\t\treturn state;\n\t\t\t}\n\t}\n}", "title": "" }, { "docid": "f05d7c250c9720e3937571f3919396ab", "score": "0.37680775", "text": "function _getDescriptionForComponentHarnessQuery(query) {\n const harnessPredicate = query instanceof HarnessPredicate ? query : new HarnessPredicate(query, {});\n const { name, hostSelector } = harnessPredicate.harnessType;\n const description = `${name} with host element matching selector: \"${hostSelector}\"`;\n const constraints = harnessPredicate.getDescription();\n return (description +\n (constraints ? ` satisfying the constraints: ${harnessPredicate.getDescription()}` : ''));\n}", "title": "" }, { "docid": "56d60c1437bca72b66ff2198203a04a6", "score": "0.37648666", "text": "function fromPredicate(predicate) {\n return a => predicate(a) ? some(a) : none;\n}", "title": "" }, { "docid": "6747b98c54093bd0db7896a157e3af01", "score": "0.37642807", "text": "function Predicate(predicate){\n this.predicate = predicate;\n}", "title": "" }, { "docid": "f5598a496ae5ace50e88f0401301328e", "score": "0.37640443", "text": "function fromPredicate_(a, predicate) {\n return predicate(a) ? some(a) : none;\n}", "title": "" }, { "docid": "fe86c017e8b01ab79cee8c36f1f32f28", "score": "0.37577033", "text": "function isQuality$1(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fe86c017e8b01ab79cee8c36f1f32f28", "score": "0.37577033", "text": "function isQuality$1(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "f917d2a1575c2049b41dbb132d76149f", "score": "0.37555584", "text": "function truthTest(name, test) {\n return function(chunk, context, bodies, params) {\n return filter(chunk, context, bodies, params, name, test);\n };\n }", "title": "" }, { "docid": "6171094d4db6bcf25b0da9af88ecfb1e", "score": "0.37544423", "text": "function MatchesWaiter(options) {\n this.from = options.from || 0;\n this.size = options.size || 10;\n\n this.deferred = new $.Deferred();\n}", "title": "" }, { "docid": "b5027988e3a11a54ad976f7d43500148", "score": "0.3752269", "text": "function partition(source, predicate, thisArg) {\n return [\n (0,filter/* filter */.h)(predicate, thisArg)(new Observable/* Observable */.y((0,subscribeTo/* subscribeTo */.s)(source))),\n (0,filter/* filter */.h)((0,not/* not */.f)(predicate, thisArg))(new Observable/* Observable */.y((0,subscribeTo/* subscribeTo */.s)(source)))\n ];\n}", "title": "" }, { "docid": "7d6486f7e5669c535dc5e490e72afe38", "score": "0.37508735", "text": "function partition(stream, predicate) {\n var pred = predicate;\n switch (typeof predicate) {\n case 'string':\n // treat a string as a prefix\n var len = predicate.length;\n pred = function(data) {\n return data.substring(0, len) == predicate;\n };\n break;\n case 'function':\n break;\n case 'object':\n // Regular expressions and things like regular expressions\n if (predicate.test) {\n pred = function(data) {\n return predicate.test(data);\n };\n break; // break to right scope?\n }\n default:\n throw \"I don't know how to use a predicate that's a \" + (typeof predicate);\n }\n\n var q = new TupleQueue(function(data) {\n if (pred(data)) {\n return q.emitData(data);\n }\n else {\n // or another stream?\n q.emit('notdata', data);\n return true;\n }\n });\n stream.pipe(q);\n return q;\n}", "title": "" }, { "docid": "333ef571e4f887a5c7b5e023acd151e7", "score": "0.37501377", "text": "clickCategoryFilter() {\n return this\n .waitForElementVisible('@categoryFilter', 10000, (res) => {\n if (res.value) {\n this\n .click('@categoryFilter');\n } else {\n this\n .assert.ok(false, '[INFO] - Something went wrong when clicking category filter');\n }\n }, '[STEP] - Category filter should be clicked (eg. Toys)');\n }", "title": "" }, { "docid": "ace9a437c9f4a0b2e09f28988249f011", "score": "0.3746149", "text": "function pitFilterPredicate( pitContainer ) {\n\t\t\tvar filtered = false;\n\n\t\t\tallowedPropertiesByKey.forEach( updateFiltered );\n\n\t\t\treturn !filtered;\n\n\t\t\tfunction updateFiltered( filterName, allowedProperties ){\n\t\t\t\tvar propertyPath = filterablePropertiesForTarget[ filterName ],\n\t\t\t\t\t\tvalue = resolveOnObject( pitContainer, propertyPath );\n\n\t\t\t\tfiltered = filtered || allowedProperties.indexOf( value ) === -1;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "8eecf1a4993bfb57b046a45def9b75db", "score": "0.37439278", "text": "function testLogicalAnd(val) {\n if (val <= 50 && val >= 25) {\n return \"yes\";\n }\n\n return \"No\";\n}", "title": "" }, { "docid": "fcccf46486953531f318e63de2fbd129", "score": "0.37436885", "text": "function createLessThanFilter(base) {\n // YOUR CODE BELOW HERE //\n // return a function that test whether a value is less than the base\n return function(val){\n if(val < base){\n return true;\n } else {\n return false;\n }\n }\n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "8883cfb00bc1ed19e1b2248b98a3c6d6", "score": "0.3734561", "text": "function runnablePlan(step) {\n if (step === 'ResourceFlexibility') {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "005fea7c49c38cd426c09504d46b7cd9", "score": "0.37263447", "text": "function testLogicalAnd(val) {\n\tif (val <= 50 && val >= 25) {\n\t\treturn \"Yes\";\n\t}\n\treturn \"No\";\n}", "title": "" }, { "docid": "b3ed33ee3c91171953d2dca3f39d6aba", "score": "0.37254867", "text": "function test (beforePercentage, perc) {\n if (beforePercentage < 25 && perc >= 25 && perc < 50) {\n console.log(`${beforePercentage} ${perc} it is 25%`)\n } else if (beforePercentage < 50 && perc >= 50 && perc <= 75) {\n console.log(`${beforePercentage} ${perc} it is 50%`)\n } else if (beforePercentage < 75 && perc >= 75 && perc <= 75) {\n console.log(`${beforePercentage} ${perc} it is 75%`)\n } else if (beforePercentage < 100 && perc >= 100) {\n console.log(`${beforePercentage} ${perc} it is 100%`)\n }\n}", "title": "" }, { "docid": "3d80305b8a1477d99f305c410e6bb56b", "score": "0.37233412", "text": "function isThenable(p) {\n return p !== undefined && typeof p.then === 'function';\n}", "title": "" }, { "docid": "5786300831ff2f5101d565cc61461da9", "score": "0.37223613", "text": "function partition(predicate, thisArg) {\n return function (source) {\n return [\n (0,filter/* filter */.h)(predicate, thisArg)(source),\n (0,filter/* filter */.h)((0,not/* not */.f)(predicate, thisArg))(source)\n ];\n };\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" }, { "docid": "fcdc826951c93250c486fd2ed406f727", "score": "0.37218818", "text": "function isQuality(spec) {\n return spec.q > 0;\n}", "title": "" } ]
28a143fae6a366415d372b51b1d0f64f
v8 likes predictible objects
[ { "docid": "5eda6cb4f4707fa36cbceb42f873714d", "score": "0.0", "text": "function Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}", "title": "" } ]
[ { "docid": "fa0a589c9fbee24be823d1c7c704488c", "score": "0.5595244", "text": "like() {\n return Object(_operations_js__WEBPACK_IMPORTED_MODULE_7__[\"spPost\"])(this.clone(Comment, \"Like\"));\n }", "title": "" }, { "docid": "b2ae3f027838506b24ccc22b570a5e01", "score": "0.5433492", "text": "likePost() { throw new Error('not implemented'); }", "title": "" }, { "docid": "b544b927ba41fa22f1fe4ec80f895d11", "score": "0.5323876", "text": "censor(censor) {\n let i = 0;\n return (key, value) => {\n if(i !== 0 && typeof censor === 'object' && typeof value === 'object' && censor === value) {\n return '[Circular]';\n }\n\n if(i >= 29) {\n // seems to be a harded maximum of 30 serialized objects?\n return '[Unknown]';\n }\n\n ++i; // so we know we aren't using the original object anymore\n\n return value;\n };\n }", "title": "" }, { "docid": "53cf7fc3e5697aca08b8eeba5778849e", "score": "0.51830256", "text": "function model(){\n\tthis.keywordsLiked = {};\n\tthis.keywordsDisliked = {};\n\tthis.domainsLiked = {};\n\tthis.domainsDisliked = {};\n\tthis.ignoredWords = ['the', 'was', 'is', 'done', 'my'];\n\tthis.HNkey = 'HNfilterData';\n\t// votesDefault = 50;\t//starting value for votes\n}", "title": "" }, { "docid": "d59c191c48d41f8af82d2164fe2d14db", "score": "0.51302594", "text": "function like (data, archetype) {\n var name;\n\n for (name in archetype) {\n if (archetype.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], archetype[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "9ac02f32fcc050cd586452a857b847dc", "score": "0.506539", "text": "function like(data, archetype) {\n var name;\n\n for (name in archetype) {\n if (archetype.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], archetype[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "cc5751a3d7000f8476c095397ad036fb", "score": "0.50613195", "text": "unlike() {\n return Object(_operations_js__WEBPACK_IMPORTED_MODULE_7__[\"spPost\"])(this.clone(Comment, \"Unlike\"));\n }", "title": "" }, { "docid": "7a0f7a6e7e4d1e0d44baa8dee3bfa24c", "score": "0.49471256", "text": "function s(e,t,i,o){r=r||n(25);const s=Object.keys(e),l=s.length;let u,p;for(let n=0;n<l;++n){u=e[p=s[n]],c(p,a.isPOJO(u)&&Object.keys(u).length&&(!u[o.typeKey]||\"type\"===o.typeKey&&u.type.type)?u:null,t,i,s,o)}}", "title": "" }, { "docid": "4499b6036025fe952536d2f21237d48b", "score": "0.48934332", "text": "function guess() {\n classifier.predict(video.elt, 5, gotResult);\n}", "title": "" }, { "docid": "06930128da19142ee42df55d893edb02", "score": "0.48895636", "text": "function c(e,t,i,o){a=a||n(18);const r=Object.keys(e),c=r.length;let p,u;for(let n=0;n<c;++n){p=e[u=r[n]],l(u,s.isPOJO(p)&&Object.keys(p).length&&(!p[o.typeKey]||\"type\"===o.typeKey&&p.type.type)?p:null,t,i,r,o)}}", "title": "" }, { "docid": "1b3a58c2807112d938417e9f10bfe559", "score": "0.48840564", "text": "function likes(tweep) {\n for (aTweep of tweeps) {\n if (aTweep.who == tweep) {\n aTweep.like = true\n }\n }\n}", "title": "" }, { "docid": "f42c8f58d600d5f1b3d6bb3879b9076b", "score": "0.4820379", "text": "function example3() {\n\n Object.getPrototypeOf(obj);\n Object.setPrototypeOf(obj, newProto); //can be used instead of Object.create(proto)\n}", "title": "" }, { "docid": "274f1213963415c7aba5df6d91f926b7", "score": "0.48182148", "text": "function BeTrueMatcher() {}", "title": "" }, { "docid": "949af10bc805e53439b56671dc2077d4", "score": "0.47792873", "text": "function omnTaglike()\r\n{\r\n\tss_link_click_track('prop15,prop16,prop17,eVar9,eVar10,eVar11,events','event78',\r\n\t\t\t\t\t\t\tomn_ss_products,'like,'\r\n\t\t\t\t\t\t\t+ s.pageName + '>like,'\r\n\t\t\t\t\t\t\t+ s.pageName + '>product detail/review>like,like,'\r\n\t\t\t\t\t\t\t+ s.pageName + '>like,'\r\n\t\t\t\t\t\t\t+ s.pageName + '>product detail/review>like,events','o','facebook like');\r\n}", "title": "" }, { "docid": "97bc627c7fe0e4c9527441d9b0f79dce", "score": "0.4779006", "text": "function TheTest(x){return isObject(x)}", "title": "" }, { "docid": "35865681d88e2fc963e48b5ff56561d5", "score": "0.4751071", "text": "static get observedAttributes() {\n return [\"say\", \"a11y\"];\n }", "title": "" }, { "docid": "37b5ac62dbe26789aaf7ca826bebab13", "score": "0.47405848", "text": "function Rihanna(saying){\n this.thing = saying;\n}", "title": "" }, { "docid": "c685a54025cde919e413c1c975737067", "score": "0.47239366", "text": "function DartObject(o) {\n this.o = o;\n}", "title": "" }, { "docid": "b32296c9277f12125b2b12f11cd351cf", "score": "0.472281", "text": "function Vy(){var t=this;hr()(this,{$source:{enumerable:!0,get:function(){return t.$olObject}},$map:{enumerable:!0,get:function(){return t.$services&&ll()(t.$services)}},$view:{enumerable:!0,get:function(){return t.$services&&t.$services.view}},$sourceContainer:{enumerable:!0,get:function(){return t.$services&&t.$services.sourceContainer}}})}", "title": "" }, { "docid": "17fa7421196ca7d84648f12399e4059b", "score": "0.4722762", "text": "function ExposedObjects() {\n return {\n animationEngine:G.aengine,\n t:'test'\n };\n }", "title": "" }, { "docid": "de160b6f98ea1070bef0c6bf5180f2f6", "score": "0.47148448", "text": "function objectCode(){}", "title": "" }, { "docid": "3a62a8301de6600c012cd2a6134741ec", "score": "0.47024447", "text": "static describe () {\n\t\treturn {\n\t\t\ttag: 'unrelate-codemark',\n\t\t\tsummary: 'Unrelate two related codemarks',\n\t\t\taccess: 'Codemarks must be from the same team, and the user must be a member of the team.',\n\t\t\tdescription: 'Unrelate two related codemarks. The relationship is bi-directional, and will be removed in both directions.',\n\t\t\tinput: {\n\t\t\t\tsummary: 'Specify each codemark ID in the request path, the order is irrelevant',\n\t\t\t\tlooksLike: {}\n\t\t\t},\n\t\t\treturns: 'A codemarks array, with directives indicating how to update the codemarks',\n\t\t\tpublishes: 'The response data will be published on the team channel for the team that owns the codemarks',\n\t\t\terrors: [\n\t\t\t\t'updateAuth',\n\t\t\t\t'notFound'\n\t\t\t]\n\t\t};\n\t}", "title": "" }, { "docid": "08f52ad198bcbc3c9809bc2ce14e9e62", "score": "0.46896207", "text": "function Note(){\n // Note is the basic class for sounding items. It's also used for\n // ligature components (why?)\n /** @property {?} */\n this.objType = \"Note\";\n /** @property {?} */\n this.text = false;\n /** @property {?} */\n this.staffPos = false;\n /** @property {?} */\n this.pitch = false;\n /** @property {?} */\n this.rhythm = false;\n /** @property {?} */\n this.sup = false;\n /** @property {?} */\n this.flipped = false;\n /** @property {?} */\n this.startX = false;\n /** @property {?} */\n this.startY = false;\n /** @property {?} */\n this.domObj = false;\n /** @property {?} */\n this.click = false;\n /** @property {?} */\n this.voidnotes = false;\n /** @property {?} */\n this.subType = false;\n /** @property {?} */\n this.example = false;\n /** @property {?} */\n this.dot = false;\n /** @property {?} */\n this.MEIObj = false;\n /** @property {?} */\n this.glyph = false;\n /** @property {?} */\n this.UUID = \"ID\"+uuid()\n /** @property {?} */\n this.forceTail = false; // This is only for ligatures, but the parser will put it here\n /** @property {?} */\n // Copy current classes\n this.classList = [];\n if(currentExample.classes && currentExample.classes.classes.length){\n this.classList = currentExample.classes.classes.slice(0);\n }\n /** width */\n this.width = function(){\n var width = 0;\n if(this.rhythm){\n width += baseDictionary[currentSubType][this.rhythm][2]*rastralSize;\n }\n return width;\n };\n /** \n * These positions may seem oddly left-tilted, but the coordinate\n * is to the left of the comment *, not the centre\n */\n this.commentPos = function(){\n // These positions may seem oddly left-tilted, but the coordinate\n // is to the left of the comment *, not the centre\n if(\"LBS\".indexOf(this.rhythm)>-1){\n return [this.startX + rastralSize/5, yPos(cury, staffPosition(this))];\n } else if (this.rhythm===\"M\"){\n return [this.startX + rastralSize/2, yPos(cury, staffPosition(this))];\n } else {\n // Tail up, so place on the same height, but right of the tail\n return [this.startX + (2*rastralSize/3), yPos(cury, staffPosition(this))];\n }\n };\n /** negativeSpace */\n this.negativeSpace = function(){\n if(\"MLB\".indexOf(this.rhythm)>-1){\n return rastralSize/6;\n } else {\n return rastralSize/2;\n }\n };\n /** Writes note tot text */\n this.toText = function(){\n var text = \"\";\n if(this.sup) text+= \"^\";\n if(this.flipped) text += \"-\";\n if(this.rhythm) text += this.rhythm;\n text += this.pitch ? this.pitch : this.staffPos.toString(16).toUpperCase();\n return text;\n };\n /** Writes Note as MEI element */\n this.toMEI = function (doc, parent){\n if(!parent) parent = doc.currentParent;\n var el = doc.createElementNS(\"http://www.music-encoding.org/ns/mei\", \"note\");\n\t\taddUUIDs(this, el, curDoc);\n el.setAttribute(\"dur\", rhythms[this.rhythm]);\n if(this.dot) this.dot.toMEI(doc, el);\n MEIAddPosition(this, el);\n\t\tif(this.rhythm===\"s\"){\n\t\t}\n if((voidRule(this) && currentSubType===\"full\") \n || (fullRule(this) && currentSubType===\"void\")){\n el.setAttribute(\"colored\", \"true\");\n }\n // sup outside of ligatures (within ligatures we have LigatureNote objects) is used for divisio. Put notes into chord\n // sup can follow as well accidentals, make sure that previous is a note\n if(this.sup && this.previous.objType===\"Note\")\n {\n var prevElement = parent.lastElementChild;\n var chord;\n // check for previous chord\n if(prevElement.localName === \"chord\")\n {\n chord = prevElement;\n chord.appendChild(el);\n }\n // or create new chord if note\n else if(prevElement.localName === \"note\")\n {\n chord = doc.createElementNS(\"http://www.music-encoding.org/ns/mei\", \"chord\");\n chord.setAttribute(\"xml:id\", \"ID\"+uuid());\n // put previous non-sup note into chord and current note\n chord.appendChild(prevElement);\n chord.appendChild(el);\n parent.appendChild(chord);\n }\n else\n {\n // unlikely fallback just in case\n parent.appendChild(el);\n }\n\n // check for coloration: this is not semantic coloration if not every note is coloured\n if(doc.evaluate(\"count(./*[@colored])<=count(./*)\", chord, nsResolver, 3).booleanValue)\n {\n let coloredNotes = doc.evaluate(\"./*[@colored]\", chord, nsResolver, 6);\n \n for(let i = 0; i < coloredNotes.snapshotLength; i++)\n {\n coloredNotes.snapshotItem(i).setAttribute(\"head.fill\", \"solid\");\n coloredNotes.snapshotItem(i).removeAttribute(\"colored\");\n }\n }\n }\n else\n {\n parent.appendChild(el);\n }\n \n\t\tif(this.text) this.text.toMEI(doc, el, this);\n this.MEIObj = el;\n return el;\n };\n /** edit Note */\n this.edit = function(event) {\n return durationSelector(this, event.pageX, event.pageY);\n };\n /** Draw Note to SVG */\n this.draw = function(){\n var myglyph = false;\n var spos = staffPosition(this);\n var oldx = curx;\n if(this.sup){\n if(currentReading){\n // This is a Choice element, and so we have to look in the choice\n curx = currentReading.eventi ? currentReading.content[currentReading.eventi-1].startX : (SVG.className.baseVal.indexOf(\"VariantReading\")>-1 ? curx : currentExample.events[eventi-1].startX);\n } else if (currentExample.events[eventi-1].objType===\"MusicalChoice\"){\n // This means that the note stacks with *something* assume,\n // for sanity's sake that it stacks with the notes in the\n // choice *and* the preceding note (otherwise, it's seriously\n // confusing -- that said, FIXME, this assumption probably\n // isn't justified)\n // curx = currentExample.events[eventi-2].startX;\n // assumption2 -- it's the same as the beginning of the variant\n curx = currentExample.events[eventi-1].startX;\n } else {\n curx = currentExample.events[eventi-1].startX;\n }\n } else if(this.text && underlays.length){\n // Check for text issues\n curx = Math.max(curx, underlayRight(this.text.position));\n }\n // put context into object to avoid trouble when drawing out of\n // order (first draw is always in order)\n this.startX = curx;\n this.startY = cury;\n this.subType = currentSubType;\n this.voidnotes = voidRule(this);//voidnotesp(this);\n this.fullnotes = fullRule(this);\n var half = halfFullRule(this);\n if(half && (!this.rhythm || !/[M|L|B]/.exec(this.rhythm))) half = false;\n this.example = currentExample;\n var extraClasses = \"\";\n // Now check for styles\n if(this.classList.length){\n extraClasses = classString(this.classList);\n drawClasses(this.classList, this);\n }\n if(this.fullnotes) extraClasses += \" full\";\n // Draw any underlaid text\n if(this.text){\n this.text.draw();\n } \n if((spos || spos===0) && this.rhythm) {\n var subType = half ? (half === 1 ? \"lhalf\" : \"rhalf\") : this.subType;\n this.domObj = svgGroup(SVG, \"notegroup\"+extraClasses+(editable ? \" clickable\" : \"\")\n +(half ? \" halffull\"+half : \"\"), \n this.UUID);\n var obj;\n if(getNoteGlyph(currentSubType, this.rhythm, this.flipped, subType, \n this.voidnotes, this.fullnotes)){\n myglyph = getNoteGlyph(currentSubType, this.rhythm, this.flipped, subType, this.voidnotes, this.fullnotes);\n this.glyph = myglyph;\n var oldSVG = SVG;\n SVG = this.domObj;\n obj = myglyph.draw(curx, yPos(cury, spos), rastralSize, \n \"mensural \" + this.rhythm+(this.pitch ? this.pitch : this.staffPos));\n SVG = oldSVG;\n curx+= myglyph.advanceWidth(rastralSize);\n } \n if(editable) {\n $(this.domObj).click(domClickfun(this.domObj, editObject(this), false, false, false));\n $(this.domObj).hover(shiftHoverToShift(this, 1), hoverOutShiftChecked());\n }\n if(!myglyph){\n if(this.flipped){\n var charData = this.voidnotes ?\n voidFlippedDictionary[subType][this.rhythm] :\n flippedDictionary[subType][this.rhythm];\n } else {\n var charData = this.voidnotes ?\n voidBaseDictionary[subType][this.rhythm] :\n baseDictionary[subType][this.rhythm];\n }\n obj = svgText(this.domObj, curx, texty(charData[1]*prop, spos),\n \"mensural \" + this.rhythm+(this.pitch ? this.pitch : spos), false,\n musicStyle(), charData[0]);\n curx += charData[2] * rastralSize;\n }\n setDotPos(spos);\n }\n if(this.dot) this.dot.draw();\n curx = Math.max(oldx, curx);\n return this.domObj;\n };\n // Note\n}", "title": "" }, { "docid": "25e93796142c020de26fa0b5168076c9", "score": "0.46794423", "text": "function censor(censorObj) {\n var i = 0;\n\n return function (key, value) {\n if (i !== 0 && typeof (censorObj) === 'object' && typeof (value) == 'object' && censorObj == value)\n return '[Circular]';\n\n if (i >= 29) // seems to be a harded maximum of 30 serialized objects?\n return '[Unknown]';\n\n ++i; // so we know we aren't using the original object anymore\n\n return value;\n };\n}", "title": "" }, { "docid": "18d6bf2b6a5b46935a684b5cf4037cc7", "score": "0.4661007", "text": "constructor() {\n this.likes = [];\n }", "title": "" }, { "docid": "0d6d48d1b26c4b433762c9280bcb274c", "score": "0.46525124", "text": "function wildPokemon(type) {\n this.type = type;\n}", "title": "" }, { "docid": "8ebeea89a840a263ae317a8ffef015e0", "score": "0.46368545", "text": "function isLiked (video,userId){\n //for (video of playlist.videos){\n var isLiked = false;\n\n if (video.likes == undefined){\n isLiked = false;\n }\n\n else{\n for(i = 0; i < video.likes.length; i++) {\n if (video.likes[i]==userId){\n isLiked = true;\n video.isLiked = true;\n break;\n }\n }\n }\n\n if (isLiked == false){\n video.isLiked = false;\n }\n // }\n //isFavourite (playlist,userId)\n}", "title": "" }, { "docid": "358ffbd31e71c67f097b5d6cbd788ede", "score": "0.46304265", "text": "function classifyPose() {\n if (pose && working) {\n inputs = [];\n for (let i = 0; i < pose.landmarks.length; i++) {\n inputs.push(pose.landmarks[i][0]);\n inputs.push(pose.landmarks[i][1]);\n inputs.push(pose.landmarks[i][2]);\n }\n brain.classify(inputs, gotResult);\n }\n }", "title": "" }, { "docid": "76ac54cfa9f21efb59daf4be21a77e19", "score": "0.46288607", "text": "function analyzeVerb(wordObject) {\n var isVerby = false, count = 0, root = \"\", pos = [];\n isVerby = wordObject.syllables.every(function (syllable) {\n count += 1;\n if (count === 1) {\n if (syllable.hasTag(['vp'])) { count -= 1; return true; }\n root = syllable.getText();\n pos = syllable.getTags(['v', 'pro']);\n return pos.length;\n }\n return syllable.hasTag(['vs1', 'vs2', 'vs3', 'vs4', 'vs5',\n 'vs6', 'vs7', 'vs8', 'vs9', 'vsr']);\n });\n if (isVerby) {\n wordObject.addTag(pos);\n wordObject.addRoot(root, pos);\n }\n }", "title": "" }, { "docid": "1d503c30418b4580248ffcf16493ec87", "score": "0.46258655", "text": "function BotLike() {\n const stream = Bot.stream('statuses/filter', {\n track: TWITTER_SEARCH_LIKED,\n language: 'pt',\n });\n\n stream.on('tweet', (tweet) => {\n if (isReply(tweet)) {\n console.warn('Tweet is a retweet!');\n } else {\n Bot.post(\n 'favorites/create',\n {\n id: tweet.id_str,\n },\n (error, response) => {\n if (error) {\n console.log('Bot could not like, : ' + error);\n } else {\n console.log('Bot liked : ' + response.text);\n }\n }\n );\n }\n });\n}", "title": "" }, { "docid": "5380ca1e497768547ce6c6d7703bbcdd", "score": "0.46170256", "text": "function i(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach((function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)}))}", "title": "" }, { "docid": "29befab0560cb56cab09a01b60a34e73", "score": "0.45984504", "text": "function whatIDontLike(thing)\r\n{console.log(\"I dont like \" + thing)}", "title": "" }, { "docid": "7525f714139bd47e707663841a58e90c", "score": "0.4596521", "text": "static objectLike(pattern) {\n return new ObjectMatch(\"objectLike\", pattern);\n }", "title": "" }, { "docid": "5664eb4c3994fa19496723d8d21ebced", "score": "0.45913363", "text": "function VocabularyResult(){\n\t\"use strict\";\n}", "title": "" }, { "docid": "0f8f96c4fd88ea608d5785204b2eff63", "score": "0.45900244", "text": "function inspired(){\n\treturn roomObject(\n\t\t'Inspired',\n\t\t'Not sure if you\\'ve read it, but there\\'s this book called inspired...'\n\t);\n} //check", "title": "" }, { "docid": "240d9f625197f082c60b1ff8f34a34d9", "score": "0.45753202", "text": "function classifyVideo() {\n classifier.predict(gotResult);\n}", "title": "" }, { "docid": "240d9f625197f082c60b1ff8f34a34d9", "score": "0.45753202", "text": "function classifyVideo() {\n classifier.predict(gotResult);\n}", "title": "" }, { "docid": "b9b596b725c1d0df29637da0c2a02524", "score": "0.45672408", "text": "function Lo(){var t=this;Kt()(this,{$source:{enumerable:!0,get:function(){return t.$olObject}},$map:{enumerable:!0,get:function(){return t.$services&&Re()(t.$services)}},$view:{enumerable:!0,get:function(){return t.$services&&t.$services.view}},$sourceContainer:{enumerable:!0,get:function(){return t.$services&&t.$services.sourceContainer}}})}", "title": "" }, { "docid": "1ba46cb22982d1621ffd71cd19a0cf3d", "score": "0.45655146", "text": "function demoReflection() {\n\n let person = new Person('Alice');\n\n log(String); // output: function String() { [native code] }\n log(new String()); // output:\n\n\n log('\\n');\n\n log('Print all object keys:');\n\n logKeys(String);\n logKeys(new String());\n logKeys(new String('test'));\n logKeys('test');\n logKeys(person);\n\n logKeys2(new String());\n logKeys2(new String('test'));\n logKeys2('test');\n logKeys2(person);\n\n logKeysAndValues(new String());\n logKeysAndValues(new String('test'));\n logKeysAndValues('test');\n logKeysAndValues(person);\n\n log(getFunctions(person));\n logFunctionMembers(person);\n\n log(getFunctions(Person));\n logFunctionMembers(Person);\n\n log('');\n log('Analyzing person object defined as JSON object:');\n person = {\n age: 21,\n name: 'Bob',\n greeting: function() { return `Hi, my name is ${this.name}.`; }\n };\n log(`keys (via for..in) = ${getKeysVia_For_In(person)}`);\n log(`keys (via Object.getOwnPropertyNames) = ${Object.getOwnPropertyNames(person)}`);\n\n log('');\n log('Analyzing String:');\n log(`keys (via for..in) = ${getKeysVia_For_In(String)}`);\n log(`keys (via Object.getOwnPropertyNames) = ${Object.getOwnPropertyNames(String)}`);\n}", "title": "" }, { "docid": "1a4b17827687e40e4ff23f33790fe4a5", "score": "0.45637134", "text": "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "title": "" }, { "docid": "21c572d15c1f1f146ccdb33062b2ce4f", "score": "0.45563686", "text": "getStringExamples() {\n return [\"{score: 10}\"]\n }", "title": "" }, { "docid": "d1f6bcc38eacd801bb38ad35ce355349", "score": "0.45470637", "text": "function c(n,i,a){(a?Reflect.getOwnMetadataKeys(i,a):Reflect.getOwnMetadataKeys(i)).forEach(function(e){var t=a?Reflect.getOwnMetadata(e,i,a):Reflect.getOwnMetadata(e,i);a?Reflect.defineMetadata(e,t,n,a):Reflect.defineMetadata(e,t,n)})}", "title": "" }, { "docid": "a3c4d434fa9ef7e16ae99a2134fbb376", "score": "0.45372775", "text": "function matchLikeProfiles(profiles, likes)\n{\n for(var i in likes) {\n for(var j in profiles) {\n if(likes[i].user_id == profiles[j].id) {\n likes[i].name = profiles[j].name;\n likes[i].pic_square = profiles[j].pic_square;\n break;\n }\n }\n }\n \n}", "title": "" }, { "docid": "06ce373903f0c464e0d73afe6e32b7de", "score": "0.45360795", "text": "function CustomObject(){}", "title": "" }, { "docid": "ef36c11d30e20e720218a3b138d61a78", "score": "0.45353553", "text": "function isFriend(name, object) {\n\n}", "title": "" }, { "docid": "404c1c0579861732cb05fcd38e46ead6", "score": "0.4529434", "text": "info(ignore=[]) {\r\n\t\tlet always = ['data','session','player','videos','zip','common','spmap','compress'];\r\n\t\tlet exclude = [...new Set([...always ,...ignore])]\r\n\t\ttry{\r\n\t\t\tlet props = Object.keys(this);\r\n\t\t\tlet meta = {};\r\n\t\t\tprops.forEach((k)=>{\r\n\t\t\t\tif (!exclude.includes(k)) {\r\n\t\t\t\t\tswitch (typeof this[k]) {\r\n\t\t\t\t\t\tcase 'boolean':\r\n\t\t\t\t\t\t\tmeta[k]=this[k];\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'string':\r\n\t\t\t\t\t\t\tif (this[k].length) {\r\n\t\t\t\t\t\t\t\tmeta[k]=this[k];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'number':\r\n\t\t\t\t\t\t\tif (this[k]>0) {\r\n\t\t\t\t\t\t\t\tif (['published','updated','downloaded','joined','profiled','latest'].includes(k)) {\r\n\t\t\t\t\t\t\t\t\tmeta[k]=ut.tsAge(this[k])+' ago'; \r\n\t\t\t\t\t\t\t\t\tif (meta[k] == 'now ago') meta[k] = 'now';\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tmeta[k]=this[k];\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'function': break;\r\n\t\t\t\t\t\tcase 'object':\r\n\t\t\t\t\t\t\tif ((Array.isArray(this[k])) && (this[k].length)) {\r\n\t\t\t\t\t\t\t\tmeta[k]=this[k];\r\n\t\t\t\t\t\t\t} else if ((this[k]) && (Object.keys(this[k]).length)) {\r\n\t\t\t\t\t\t\t\tmeta[k]=this[k];\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault: \r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\treturn meta;\r\n\t\t} catch(e) {\r\n\t\t\treturn {\r\n\t\t\t\terror: e\r\n\t\t\t};\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "be64fde73d4195e2a7c61ef1d0be00a2", "score": "0.45261252", "text": "static get observedAttributes() {\n return ['extractable',\n 'breadth',\n 'color',\n 'visibility',\n 'raycast',\n 'rotation',\n 'rotate-to-angles',\n 'rotate-by-angles',\n 'spin',\n 'quad-scale',\n 'scale',\n 'scale-to',\n 'scale-by',\n 'extracted-scale',\n 'extracted-size',\n 'extracted-link',\n 'move-to',\n 'move-by',\n 'src',\n 'instance',\n 'z-offset'\n ];\n }", "title": "" }, { "docid": "a0b3c815d194ff97bf5eca74bfcb931d", "score": "0.45197353", "text": "function superheroLike(obj, strPoder) {\n obj.poder = strPoder;\n obj.voo = 0;\n obj.voar = function() {\n obj.voo += 1;\n };\n\n return obj;\n}", "title": "" }, { "docid": "c4419e486c9e9fa2c03d1ab0d74c09f4", "score": "0.45180327", "text": "inspect(object) {}", "title": "" }, { "docid": "aef167367214bb8143852fcc0f24c21e", "score": "0.4515156", "text": "static WirteObject(obj) {\n var offSet = 0;\n var cacheBuffer = new ArrayBuffer(128);\n var dataView = new DataView(cacheBuffer);\n var byteInfoArray = Buffer.ClassInfoMap.get(obj.constructor.prototype[\"objkey\"]);\n for (let i = 0; i < byteInfoArray.length; i++) {\n let byteInfo = byteInfoArray[i];\n let byteLength = this.writeProperty(dataView, offSet, byteInfo.Type, obj[byteInfo.PropertyKey]);\n offSet += byteLength;\n }\n var buffer = cacheBuffer.slice(0, offSet);\n return buffer;\n }", "title": "" }, { "docid": "e682e87e0fa06908077295838c9f43a2", "score": "0.4509716", "text": "function tr(axiom) {\n\n var skip = false;\n for (var k in rmObjMap) {\n var obj = rmObjMap[k];\n if (owl.objectInAxiomSignature(obj)) {\n skip = true;\n break;\n }\n }\n if (skip) {\n // drop the axiom\n return [];\n }\n\n if (axiom.getProperty != null) {\n var nlxProp = axiom.getProperty();\n var piri = nlxProp.getIRI().toString();\n if (ignoreMap[piri]) {\n return [];\n }\n if (noChangeMap[piri]) {\n return;\n }\n var p = mapProperty(nlxProp, exMap);\n if (p!=null) {\n var sub;\n var ob;\n if (axiom.getObject != null) {\n sub = owl.class(axiom.getSubject());\n ob = owl.someValuesFrom(p, owl.class(axiom.getObject()));\n }\n else {\n sub = owl.class(axiom.getSubject());\n ob = owl.someValuesFrom(p, owl.class(axiom.getValue()));\n\n }\n return owl.subClassOf(sub, ob);\n }\n p = mapProperty(nlxProp, aMap);\n if (p!=null) {\n if (p == \"a\") {\n }\n // annotation\n var sub = axiom.getSubject();\n if (sub.getIRI != null) {\n sub = sub.getIRI();\n }\n var ob;\n if (axiom.getObject != null) {\n ob = axiom.getObject();\n }\n else {\n ob = axiom.getValue();\n }\n //console.log(typeof ob + \" // \" + ob);\n if (ob.getIRI != null) {\n ob = ob.getIRI();\n }\n return owl.annotationAssertion(p, sub, ob);\n }\n var db = xrefMap[piri];\n if (db != null) {\n var p = owl.annotationProperty(\"http://www.geneontology.org/formats/oboInOwl#hasDbXref\");\n var sub = axiom.getSubject();\n if (sub.getIRI != null) {\n sub = sub.getIRI();\n }\n var ob;\n if (axiom.getObject != null) {\n ob = axiom.getObject();\n }\n else {\n ob = axiom.getValue();\n }\n return owl.annotationAssertion(p, sub, db + \":\" + ob);\n }\n console.log(\"NO_PROP_MAP: \" + nlxProp);\n return;\n }\n if (axiom instanceof OWLDeclarationAxiom) {\n // drop\n return [];\n }\n if (axiom instanceof OWLClassAssertionAxiom) {\n var c = axiom.getClassExpression();\n var i = axiom.getIndividual();\n if (c.isAnonymous() || i.isAnonymous()) {\n }\n else {\n return owl.subClassOf(owl.class(i.getIRI()),\n owl.class(c.getIRI()));\n }\n }\n if (axiom instanceof OWLSameIndividualAxiom) {\n var objs = javautil.collectionToJsArray(axiom.getIndividuals());\n return owl.equivalentClasses(owl.class(objs[0]), owl.class(objs[1])); // assume 2 members\n }\n console.log(\"NO_MAP: \" + axiom);\n return null;\n}", "title": "" }, { "docid": "4a98c5083bafc4a062c6c318527c254a", "score": "0.4504626", "text": "visit(obj) {\r\n const offset = this.offsetTable[obj];\r\n const type = this.bytes[offset];\r\n const objType = (type & 0xf0) >> 4; // First 4 bits\r\n const objInfo = type & 0x0f; // Second 4 bits\r\n switch (objType) {\r\n case 0x0: {\r\n // Simple\r\n switch (objInfo) {\r\n case 0x0: {\r\n // null object (v1.0 and later)\r\n return {\r\n $key: 'null',\r\n $value: null\r\n };\r\n }\r\n case 0x8: {\r\n // false\r\n return {\r\n $key: 'false',\r\n $value: false\r\n };\r\n }\r\n case 0x9: {\r\n // true\r\n return {\r\n $key: 'true',\r\n $value: true\r\n };\r\n }\r\n case 0xc: {\r\n // URL with no base URL (v1.0 and later)\r\n // TODO Implement binary URL parsing (not yet even implemented in Core Foundation as of revision 855.17)\r\n // throw new UnsupportedOperationException(\r\n console.error(`The given binary property list contains a URL object. Parsing of this object type is not yet implemented.`);\r\n break;\r\n }\r\n case 0xd: {\r\n // URL with base URL (v1.0 and later)\r\n // TODO Implement binary URL parsing (not yet even implemented in Core Foundation as of revision 855.17)\r\n // throw new UnsupportedOperationException(\r\n console.error(`The given binary property list contains a URL object. Parsing of this object type is not yet implemented.`);\r\n break;\r\n }\r\n case 0xe: {\r\n // 16-byte UUID (v1.0 and later)\r\n // TODO Implement binary UUID parsing (not yet even implemented in Core Foundation as of revision 855.17)\r\n // throw new UnsupportedOperationException(\r\n console.error(`The given binary property list contains a UUID object. Parsing of this object type is not yet implemented.`);\r\n break;\r\n }\r\n default: {\r\n // throw new PropertyListFormatException(`The given binary property list contains an object of unknown type (${objType})`);\r\n console.error(`The given binary property list contains an object of unknown type (${objType})`);\r\n }\r\n }\r\n break;\r\n }\r\n case 0x1: {\r\n // integer\r\n const len = Math.pow(2, objInfo);\r\n const value = this.buffer2String(this.bytes, offset + 1, offset + 1 + len);\r\n return {\r\n $key: 'integer',\r\n $value: parseInt(value, 10)\r\n };\r\n }\r\n case 0x2: {\r\n // real\r\n const len = Math.pow(2, objInfo);\r\n const value = this.buffer2String(this.bytes, offset + 1, offset + 1 + len);\r\n return {\r\n $key: 'float',\r\n $value: parseFloat(value)\r\n };\r\n }\r\n case 0x3: {\r\n // Date\r\n if (objInfo !== 0x3) {\r\n // throw new PropertyListFormatException(`The given binary property list contains a date object of an unknown type (${objInfo})`);\r\n console.error(`The given binary property list contains a date object of an unknown type (${objInfo})`);\r\n }\r\n return {\r\n $key: 'date',\r\n $value: new Date(this.buffer2String(this.bytes, offset + 1, offset + 9))\r\n };\r\n }\r\n case 0x4: {\r\n // Data: interpreted as Base-64 encoded\r\n const lengthAndOffset = this.readLengthAndOffset(objInfo, offset);\r\n const len = lengthAndOffset[0];\r\n const dataOffset = lengthAndOffset[1];\r\n const value = this.buffer2String(this.bytes, offset + dataOffset, offset + dataOffset + len);\r\n return {\r\n $key: 'data',\r\n $value: value\r\n };\r\n }\r\n case 0x5: {\r\n // ASCII string\r\n const lengthAndOffset = this.readLengthAndOffset(objInfo, offset);\r\n const len = lengthAndOffset[0]; // Each character is 1 byte\r\n const strOffset = lengthAndOffset[1];\r\n const value = this.buffer2String(this.bytes, offset + strOffset, offset + strOffset + len, 'ascii');\r\n return {\r\n $key: 'ascii',\r\n $value: value\r\n };\r\n }\r\n case 0x6: {\r\n // UTF-16-BE string\r\n const lengthAndOffset = this.readLengthAndOffset(objInfo, offset);\r\n const characters = lengthAndOffset[0];\r\n const strOffset = lengthAndOffset[1];\r\n // UTF-16 characters can have variable length, but the Core Foundation reference implementation\r\n // assumes 2 byte characters, thus only covering the Basic Multilingual Plane\r\n const len = characters * 2;\r\n const startIndex = strOffset;\r\n const endIndex = offset + strOffset + len;\r\n const value = this.buffer2String(this.bytes, startIndex, (startIndex + offset) * 2 ** 8 + endIndex, 'base64');\r\n // const value = this.buffer2String(this.bytes, offset + strOffset, offset + strOffset + length, 'base64');\r\n if (this.isBase64(value)) {\r\n return this.parse64Content(value);\r\n }\r\n else {\r\n return {\r\n $key: 'utf-16',\r\n $value: value\r\n };\r\n }\r\n }\r\n case 0x7: {\r\n // UTF-8 string (v1.0 and later)\r\n const lengthAndOffset = this.readLengthAndOffset(objInfo, offset);\r\n const strOffset = lengthAndOffset[1];\r\n const characters = lengthAndOffset[0];\r\n // UTF-8 characters can have variable length, so we need to calculate the byte length dynamically\r\n // by reading the UTF-8 characters one by one\r\n const len = this.calculateUtf8StringLength(this.bytes, offset + strOffset, characters);\r\n const value = this.buffer2String(this.bytes, offset + strOffset, offset + strOffset + len);\r\n return {\r\n $key: 'utf-8',\r\n $value: value\r\n };\r\n }\r\n case 0x8: {\r\n // UID (v1.0 and later)\r\n const len = objInfo + 1;\r\n const value = new UID(obj.valueOf(), this.copyOfRange(this.bytes, offset + 1, offset + 1 + len), this.buffer2String(this.bytes, offset + 1, offset + 1 + len));\r\n return {\r\n $key: 'uid',\r\n $value: value\r\n };\r\n }\r\n case 0xa: {\r\n // Array\r\n const lengthAndOffset = this.readLengthAndOffset(objInfo, offset);\r\n const len = lengthAndOffset[0];\r\n const arrayOffset = lengthAndOffset[1];\r\n const value = new Array(len);\r\n for (let i = 0; i < len; i++) {\r\n const objRef = this.parseUnsignedInt(this.bytes, offset + arrayOffset + i * this.objectRefSize, offset + arrayOffset + (i + 1) * this.objectRefSize);\r\n value.push(this.visit(objRef));\r\n }\r\n return {\r\n $key: 'array',\r\n $value: value\r\n };\r\n }\r\n case 0xb: {\r\n // Ordered set (v1.0 and later)\r\n const lengthAndOffset = this.readLengthAndOffset(objInfo, offset);\r\n const len = lengthAndOffset[0];\r\n const contentOffset = lengthAndOffset[1];\r\n const value = new Set();\r\n for (let i = 0; i < len; i++) {\r\n const objRef = this.parseUnsignedInt(this.bytes, offset + contentOffset + i * this.objectRefSize, offset + contentOffset + (i + 1) * this.objectRefSize);\r\n value.add(this.visit(objRef));\r\n }\r\n return {\r\n $key: 'order-set',\r\n $value: value\r\n };\r\n }\r\n case 0xc: {\r\n // Set (v1.0 and later)\r\n const lengthAndOffset = this.readLengthAndOffset(objInfo, offset);\r\n const len = lengthAndOffset[0];\r\n const contentOffset = lengthAndOffset[1];\r\n const value = new Set();\r\n for (let i = 0; i < len; i++) {\r\n const objRef = this.parseUnsignedInt(this.bytes, offset + contentOffset + i * this.objectRefSize, offset + contentOffset + (i + 1) * this.objectRefSize);\r\n value.add(this.visit(objRef));\r\n }\r\n return {\r\n $key: 'set',\r\n $value: value\r\n };\r\n }\r\n case 0xd: {\r\n // Dictionary\r\n const lengthAndOffset = this.readLengthAndOffset(objInfo, offset);\r\n const len = lengthAndOffset[0];\r\n const contentOffset = lengthAndOffset[1];\r\n const value = new Map();\r\n for (let i = 0; i < len; i++) {\r\n const keyRef = this.parseUnsignedInt(this.bytes, offset + contentOffset + i * this.objectRefSize, offset + contentOffset + (i + 1) * this.objectRefSize);\r\n const valRef = this.parseUnsignedInt(this.bytes, offset +\r\n contentOffset +\r\n len * this.objectRefSize +\r\n i * this.objectRefSize, offset +\r\n contentOffset +\r\n len * this.objectRefSize +\r\n (i + 1) * this.objectRefSize);\r\n const key = this.visit(keyRef);\r\n const val = this.visit(valRef);\r\n value.set(key.$key.toString(), val);\r\n }\r\n return {\r\n $key: 'dictionary',\r\n $value: value\r\n };\r\n }\r\n default: {\r\n // throw new PropertyListFormatException(`The given binary property list contains an object of unknown type (${objType})`);\r\n console.error(`The given binary property list contains an object of unknown type (${objType})`);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "fc30cc8ce706575a78cbd34645fd4626", "score": "0.4494794", "text": "function vr(t) {\n return new pe(t,\n /* useProto3Json= */\n !0);\n}", "title": "" }, { "docid": "511eec58bb39be01ea2013ad466e0e53", "score": "0.44901425", "text": "static isInterdictable(elem) {\n var _a, _b, _c;\n // Don't polyfill if there's already a <ruffle-embed> inside the <object>.\n if (elem.getElementsByTagName(\"ruffle-embed\").length > 0) {\n return false;\n }\n // Don't polyfill if no movie specified.\n const data = (_a = elem.attributes.getNamedItem(\"data\")) === null || _a === void 0 ? void 0 : _a.value.toLowerCase();\n const params = paramsOf(elem);\n let isSwf;\n // Check for SWF file.\n if (data) {\n isSwf = (0,_ruffle_player__WEBPACK_IMPORTED_MODULE_0__.isSwfFilename)(data);\n }\n else if (params && params.movie) {\n isSwf = (0,_ruffle_player__WEBPACK_IMPORTED_MODULE_0__.isSwfFilename)(params.movie);\n }\n else {\n // Don't polyfill when no file is specified.\n return false;\n }\n // Check ActiveX class ID.\n const classid = (_b = elem.attributes\n .getNamedItem(\"classid\")) === null || _b === void 0 ? void 0 : _b.value.toLowerCase();\n if (classid === _ruffle_player__WEBPACK_IMPORTED_MODULE_0__.FLASH_ACTIVEX_CLASSID.toLowerCase()) {\n // classid is an old-IE style embed that would not work on modern browsers.\n // Often there will be an <embed> inside the <object> that would take precedence.\n // Only polyfill this <object> if it doesn't contain a polyfillable <embed>.\n return !Array.from(elem.getElementsByTagName(\"embed\")).some(_ruffle_embed__WEBPACK_IMPORTED_MODULE_2__.RuffleEmbed.isInterdictable);\n }\n else if (classid != null && classid !== \"\") {\n // Non-Flash classid.\n return false;\n }\n // Check for MIME type.\n const type = (_c = elem.attributes.getNamedItem(\"type\")) === null || _c === void 0 ? void 0 : _c.value.toLowerCase();\n if (type === _ruffle_player__WEBPACK_IMPORTED_MODULE_0__.FLASH_MIMETYPE.toLowerCase() ||\n type === _ruffle_player__WEBPACK_IMPORTED_MODULE_0__.FUTURESPLASH_MIMETYPE.toLowerCase() ||\n type === _ruffle_player__WEBPACK_IMPORTED_MODULE_0__.FLASH7_AND_8_MIMETYPE.toLowerCase() ||\n type === _ruffle_player__WEBPACK_IMPORTED_MODULE_0__.FLASH_MOVIE_MIMETYPE.toLowerCase()) {\n return true;\n }\n else if (type != null && type !== \"\") {\n return false;\n }\n // If no MIME/class type is specified, polyfill if movie is an SWF file.\n return isSwf;\n }", "title": "" }, { "docid": "76475125020172eb13d95c6b8be86754", "score": "0.44881248", "text": "static get observedAttributes(){ return ['c','l'];}", "title": "" }, { "docid": "2638c4a8645a0f28b40889ba52a3ffa8", "score": "0.44814712", "text": "function isJSONExample(node) {\n\t return node.kind() == \"JSONExample\" && node.RAMLVersion() == \"RAML08\";\n\t}", "title": "" }, { "docid": "69cbcefd3b4ea26d52bdadff0f6902ce", "score": "0.44783628", "text": "function getmyLikes(likesresponse){\n myLikes = likesresponse.data; //get the array of the person's likes\n //for loop to look through likes for the id of the likes: in var myLikes\n \n for(var i=0; i<likesresponse.data.length; i++){\n var likeids = likesresponse.data[i].id;\n //console.log(likeids);\n if(myLikes[i].hasOwnProperty(\"id\")){\n allLikes.push(likeids);\n }\n }\n}", "title": "" }, { "docid": "14072eb5c4810980ba3cd09f0fb6a04b", "score": "0.44715428", "text": "function Object() {}", "title": "" }, { "docid": "14072eb5c4810980ba3cd09f0fb6a04b", "score": "0.44715428", "text": "function Object() {}", "title": "" }, { "docid": "14072eb5c4810980ba3cd09f0fb6a04b", "score": "0.44715428", "text": "function Object() {}", "title": "" }, { "docid": "bc9ac973535c293da008fa5b81708c46", "score": "0.44695938", "text": "function whatIDontLike(virus) {\r\n console.log(\"I don't like \" + virus);\r\n}", "title": "" }, { "docid": "f92dcdf1eefd374b8502c42b77c45dbb", "score": "0.44693467", "text": "static get observedAttributes() {\n return [\"label\"];\n }", "title": "" }, { "docid": "ec69cb28e03871b3ac7e838d9320def1", "score": "0.44639772", "text": "__getPredictionData(prediction) {\n //face\n const { topLeft, bottomRight } = prediction.boundingBox;\n const width = bottomRight[0] - topLeft[0];\n const height = bottomRight[1] - topLeft[1];\n const center = [topLeft[0] + width / 2, topLeft[1] + height / 2];\n\n let {\n lipsLowerInner,\n lipsUpperInner,\n rightEyeLower1,\n rightEyeUpper1,\n leftEyeLower1,\n leftEyeUpper1,\n } = prediction.annotations;\n\n lipsLowerInner = lipsLowerInner[5];\n lipsUpperInner = lipsUpperInner[5];\n rightEyeLower1 = rightEyeLower1[4];\n rightEyeUpper1 = rightEyeUpper1[4];\n leftEyeLower1 = leftEyeLower1[4];\n leftEyeUpper1 = leftEyeUpper1[4];\n\n const eyeDist = distanceCoordinates(rightEyeLower1, leftEyeLower1);\n const noseTip = prediction.scaledMesh[4];\n const scale = eyeDist / FACE_SCALE;\n return {\n scale,\n face: { topLeft, bottomRight, width, height, center },\n eyes: {\n rightEyeLower1,\n rightEyeUpper1,\n leftEyeLower1,\n leftEyeUpper1,\n eyeDist,\n },\n nose: {\n tip: noseTip,\n },\n mouth: { lipsLowerInner, lipsUpperInner },\n };\n // return {\n // topLeft,\n // bottomRight,\n // width,\n // height,\n // center,\n // nose,\n // lipsLowerInner,\n // lipsUpperInner,\n // rightEyeLower1,\n // rightEyeUpper1,\n // leftEyeLower1,\n // leftEyeUpper1,\n // eyeDist,\n // scale,\n // };\n }", "title": "" }, { "docid": "f1b8848694352101a45278741076bf96", "score": "0.44597682", "text": "function setLikes(toy, p) {\n let likes = \"Likes\"\n if(toy[\"likes\"] == 1) {\n likes = \"Like\"\n }\n p.innerText = `${toy[\"likes\"]} ${likes}`\n}", "title": "" }, { "docid": "6d9e2b3cfc415f7b63752765a3dc92df", "score": "0.44594574", "text": "predict() {\n //returns prediction using random elements from this object's arrays \n console.log(`A very Interesting future awaits, On the exact date of ${this.getDate()} the person known as ${this.randomPerson()}, will be entrusted with taking ${this.randomThing()} to a mysterious land known as ${this.randomPlace()} ${this.randomReason()}.`)\n }", "title": "" }, { "docid": "84828f658e3bbbbfbd6f4bfaa20949a4", "score": "0.44495967", "text": "static describe () {\n\t\treturn {\n\t\t\ttag: 'follow',\n\t\t\tsummary: 'Follow a codemark',\n\t\t\taccess: 'User must be a member of the team that owns the codemark, or if the codemark is within a private channel or DM, user must be a member of that stream.',\n\t\t\tdescription: 'Add the current user as a follower of the codemark specified.',\n\t\t\tinput: 'Specify the codemark ID in the request path',\n\t\t\treturns: {\n\t\t\t\tsummary: 'A codemark, with directives indicating how to update the codemark',\n\t\t\t\tlooksLike: {\n\t\t\t\t\tcodemark: '<some directive>'\n\t\t\t\t}\n\t\t\t},\n\t\t\tpublishes: 'The response data will be published on the team channel for the team that owns the codemarks',\n\t\t\terrors: [\n\t\t\t\t'updateAuth',\n\t\t\t\t'notFound'\n\t\t\t]\n\t\t};\n\t}", "title": "" }, { "docid": "3be1c144922d03e9e56501f87012802e", "score": "0.44471243", "text": "function likeQuote(quote, likesSpan) {\n quote.likes++\n fetch(URL + '/' + quote.id, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(quote)\n })\n .then(res => res.json())\n .then(json => {\n likesSpan.textContent = quote.likes\n })\n }", "title": "" }, { "docid": "499457135fee666987e85364fbcfc360", "score": "0.44464657", "text": "function classifyVideo() {\n classifier.classify(gotResult);\n}", "title": "" }, { "docid": "73e95ff8f772e1fb01e5de92b0e1232e", "score": "0.44453594", "text": "function dscLike()\n {\n \n setActiveButton(\"dscLike\");\n let data = posts;\n\n\n // bubble sort for shorting time complexity = O(n * n)\n\n for(let i = 0 ; i < data.length ; i++)\n {\n for(let j = 0 ; j < data.length - i - 1 ; j++)\n {\n if(data[j].numLikes > data[j+1].numLikes)\n {\n let temp = data[j];\n data[j] = data[j+1];\n data[j+1] = temp;\n }\n }\n }\n\n setPosts(data.reverse())\n\n }", "title": "" }, { "docid": "5ed7c0808d58a6431b4ef4e278b529f0", "score": "0.44409117", "text": "sayAsNoun(text) {\n return this.w(text, { role: \"amazon:NN\" });\n }", "title": "" }, { "docid": "9b3e9d025a4c2e17c144553634e068e9", "score": "0.44407934", "text": "visitObj(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "ffc229f9589d9726aa79781088550563", "score": "0.4440741", "text": "likedByUser() {\n let likers = this.likers();\n return likers.includes(this.props.user);\n }", "title": "" }, { "docid": "4fbdce670c6b2a8d0e63b351ec97d6a2", "score": "0.44324863", "text": "function Brain(thinking){\n this.thought = thinking;\n}", "title": "" }, { "docid": "3e54703c4fe83464bd47436f8752c101", "score": "0.4430794", "text": "async function predict() {\n // predict can take in an image, video or canvas html element\n var image = document.getElementById('mush-image');\n var my_index = 0\n\n const prediction = await model.predict(image, false);\n for (let i = 0; i < maxPredictions; i++) {\n if ( i == 0 ) {\n my_index = i;\n } else {\n if (prediction[i].probability > prediction[my_index].probability){\n my_index = i;\n } else{\n continue;\n }\n }\n\n\n }\n const classPrediction =\n prediction[my_index].className + '일 확률이 ' + prediction[my_index].probability.toFixed(2) * 100 + '% 입니다';\n labelContainer.childNodes[my_index].innerHTML = classPrediction;\n}", "title": "" }, { "docid": "855340caf5856117b57f0313a086038a", "score": "0.44307673", "text": "function test() {\n let o = {\n private: 1\n };\n log(o);\n /*\n const Babel = require(\"@babel/core\");\n let ast = Babel.parseSync(\"let a='x', o = {}; o[x]\");\n log(ast.program.body[1].expression.property);\n return;\n let rt = require('./machine').YagaReaderTable;\n // log(rt.match('((.jsPrim'));\n let reader = yaga.Reader(rt);\n let exprs = reader.readFile(__dirname + '\\\\test.yaga');\n log(exprs);\n */\n}", "title": "" }, { "docid": "b5844c1ac6353581e2a9347c6a685759", "score": "0.44264957", "text": "static fromNativeObjectElement(elem) {\n const externalName = (0,_register_element__WEBPACK_IMPORTED_MODULE_1__.registerElement)(\"ruffle-object\", RuffleObject);\n const ruffleObj = (document.createElement(externalName));\n // Avoid copying embeds-inside-objects to avoid double polyfilling.\n for (const embedElem of Array.from(elem.getElementsByTagName(\"embed\"))) {\n if (_ruffle_embed__WEBPACK_IMPORTED_MODULE_2__.RuffleEmbed.isInterdictable(embedElem)) {\n embedElem.remove();\n }\n }\n // Avoid copying objects-inside-objects to avoid double polyfilling.\n // This may happen when Internet Explorer's conditional comments are used.\n for (const objectElem of Array.from(elem.getElementsByTagName(\"object\"))) {\n if (RuffleObject.isInterdictable(objectElem)) {\n objectElem.remove();\n }\n }\n ruffleObj.copyElement(elem);\n return ruffleObj;\n }", "title": "" }, { "docid": "3741770d7b1f3cdfdab32e684ec8663c", "score": "0.4418838", "text": "function mixinObjectEval(proto) {\n return Obj.create(proto,{\n put: {value: function (name, value,strict) {\n value=reflectedValue(value);\n var target=this.__obj;\n if (strict) (function() {\"use strict\";target[name]=value})();\n else target[name]=value;\n }},\n get: {value: function (name) {return this.__createObjMirrorOn(this.__obj[name])}},\n invoke: {value: function(name,arg0) {\n var func = reflectedValue(this.get(name));\n return this.__createObjMirrorOn(func.apply(this.Obj,[].slice.call(arguments,1).map(function(v){return reflectedValue(v)})));\n }},\n toString: {value:function() {return \"Object Introspection+Eval Mirror #\"+this.__id}}\n });\n }", "title": "" }, { "docid": "b367751d35b57f8d4820595cb6f76661", "score": "0.44186115", "text": "function L(e,t){return e&&Object.prototype.hasOwnProperty.call(e,t)}", "title": "" }, { "docid": "02f759ccbb734c5139a43072c5e9c88c", "score": "0.44159746", "text": "predict() {\r\n throw new ReferenceError('Missing predict method implementation');\r\n }", "title": "" }, { "docid": "ca8d24acac5899de4dd8197c9b538810", "score": "0.4408141", "text": "isUnusedFallbackObject() {\n let parent = this.parentNode;\n const element = (0,_register_element__WEBPACK_IMPORTED_MODULE_2__.lookupElement)(\"ruffle-object\");\n if (element !== null) {\n while (parent != document && parent != null) {\n if (parent.nodeName === element.name) {\n return true;\n }\n parent = parent.parentNode;\n }\n }\n return false;\n }", "title": "" }, { "docid": "ac79c54363c14bf1d0590b04b6068b91", "score": "0.4404793", "text": "function whatIDontLike(disliked) {\n console.log(\"I don't like \" + disliked);\n}", "title": "" }, { "docid": "c1c6ebf1e6d68335213fc3967edb2393", "score": "0.44019726", "text": "function tagTester(name) {\n var tag = \"[object \" + name + \"]\";\n return function (obj) {\n return toString.call(obj) === tag;\n };\n }", "title": "" }, { "docid": "7736246e458a341c4785cae5c314dece", "score": "0.43899494", "text": "like() {\n new Like(this.getLinkObject()).save();\n }", "title": "" }, { "docid": "1cbafae669308f62d3e55a9cf8ed287d", "score": "0.438983", "text": "function Go(){var t=this;Kt()(this,{$style:{enumerable:!0,get:function(){return t.$olObject}},$map:{enumerable:!0,get:function(){return t.$services&&Re()(t.$services)}},$view:{enumerable:!0,get:function(){return t.$services&&t.$services.view}},$stylesContainer:{enumerable:!0,get:function(){return t.$services&&t.$services.stylesContainer}}})}", "title": "" }, { "docid": "9dd1d666624b01bc5ad316e23e29d65d", "score": "0.43847254", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "title": "" }, { "docid": "1c46e9a7742b555e41adfa13a581e000", "score": "0.43847254", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt', 'kts' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "title": "" }, { "docid": "1c46e9a7742b555e41adfa13a581e000", "score": "0.43847254", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt', 'kts' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "title": "" }, { "docid": "1c46e9a7742b555e41adfa13a581e000", "score": "0.43847254", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt', 'kts' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "title": "" }, { "docid": "17cda68506bed33128e0ebfb00dfc655", "score": "0.43772104", "text": "export( obj ) {}", "title": "" }, { "docid": "793a9ffd0b56cef4f4bc2baac296d26f", "score": "0.4377085", "text": "function likes3(names) {\n return {\n 0: \"no one likes this\",\n 1: `${names[0]} likes this`,\n 2: `${names[0]} and ${names[1]} like this`,\n 3: `${names[0]}, ${names[1]} and ${names[2]} like this`,\n 4: `${names[0]}, ${names[1]} and ${names.length - 2} others like this`,\n }[Math.min(4, names.length)];\n}", "title": "" }, { "docid": "36f4dc6c095c5b0dac6771c3235d7a27", "score": "0.43745145", "text": "predict(input, lang) {\n\n let contents = fs.readFileSync(this.modelPath, 'utf8');\n let model = JSON.parse(contents);\n let manager = new NerManager({ threshold: 0.8 });\n manager.load(model);\n\n return manager.findEntities(input, lang)\n .then(entities => {\n return entities;\n });\n\n }", "title": "" }, { "docid": "a13a9fc18c6f5d716e21edc68878eed5", "score": "0.43713218", "text": "getLikes() {\n\t \treturn this.likes;\n\t }", "title": "" }, { "docid": "027ce51259afc1085b9ddb7847ca1a81", "score": "0.43708503", "text": "function isAV(v) {\n return v instanceof Object && !(v instanceof NonAV);\n}", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.43648756", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.43648756", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.43648756", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.43648756", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.43648756", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.43648756", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.43648756", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.43648756", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" } ]
e313960626e51bbf57711b55b3d59aaa
Helper logging function that timestamps each message and optionally outputs to a file as well
[ { "docid": "bb07c0536313d96c89b50c0ce35d5bd6", "score": "0.0", "text": "function log(msg, logFileName, consoleFormatter) {\n \"use strict\";\n assert.notStrictEqual(msg, undefined, \"Trying to print undefined. This usually indicates a bug upstream from the log function.\");\n if (msg instanceof Function) {\n msg = msg();\n }\n const taggedMsg = `[${getDateTimeString()}${(logFileName !== undefined ? `, ${logFileName.toUpperCase()}` : \"\")}] ${msg}`;\n // Explicitly passing null, not undefined, as the consoleFormatter\n // means to skip the console output completely\n // tslint:disable-next-line:no-null-keyword\n if (consoleFormatter !== null) {\n if (consoleFormatter !== undefined) {\n console.log(consoleFormatter(taggedMsg));\n }\n else {\n console.log(taggedMsg);\n }\n }\n if (logFileName !== undefined) {\n const fd = fs.openSync(logFileName, \"a\");\n fs.writeSync(fd, taggedMsg + \"\\r\\n\");\n fs.closeSync(fd);\n }\n}", "title": "" } ]
[ { "docid": "88aba8c0b598c392d0e9a83289f7a61b", "score": "0.6728417", "text": "function log(round,event,msg)\n{\n\tprint(\"[\"+round+\":\"+event+\"]\"+msg+\"RT=[\"+Time.unscaledTime);\n\toutputFile.WriteLine(\"[\"+Time.unscaledTime+\":\"+round+\":\"+event+\"]\"+msg);\n\toutputFile.Flush();\n}", "title": "" }, { "docid": "57d8172e495352bf8283e2d4567ef2d5", "score": "0.6575751", "text": "function logToFile(){\n let log = '';\n let ts = Date.now();\n let dateTime = (new Date(ts)).toISOString();\n\n log += `${dateTime}\\n\\n`;\n\n log += ' --------- PASSED ----------\\n'; \n if(passedMessages.length <= 0) log += 'none\\n';\n passedMessages.forEach((m, i) => log += `${i + 1}. ${m}\\n`);\n log += '\\n';\n\n log += ' --------- WARNING ----------\\n'; \n if(warningMessages.length <= 0) log += 'none\\n';\n warningMessages.forEach((m, i) => log += `${i + 1}. ${m}\\n`);\n log += '\\n';\n\n log += ' --------- CRITICAL ----------\\n'; \n if(criticalMessages.length <= 0) log += 'none\\n';\n criticalMessages.forEach((m, i) => log += `${i + 1}. ${m}\\n`);\n log += '\\n';\n\n fs.writeFile('validation.log', log);\n}", "title": "" }, { "docid": "008111f18206818b430ec7b64244a2c5", "score": "0.6538158", "text": "function LogToFile(args)\n{\n var d = new Date();\n if (arguments.length) {\n msg = d.getFullYear() + '-' + Pad2(d.getMonth()+1) + '-' + Pad2(d.getDate()) + ' ' +\n Pad2(d.getHours()) + ':' + Pad2(d.getMinutes()) + ':' +\n Pad2(d.getSeconds()) + ' ' + Array.from(arguments).join(' ');\n } else {\n msg = '';\n }\n fs.appendFile('cute_server_'+d.getFullYear()+Pad2(d.getMonth()+1)+'.log', msg+'\\n', \n function(error) {\n if (error) console.log(error, 'writing log file');\n }\n );\n return msg;\n}", "title": "" }, { "docid": "68e30878c173311142729e203eeb9717", "score": "0.6231153", "text": "write(message) {\n message_log.write(message)\n }", "title": "" }, { "docid": "bd402d56c4b87776844e99089eb017c6", "score": "0.6225941", "text": "function logMe(input){\n var now = new Date();\n var output = now.toTimeString() + \": \" + input;\n $.writeln(output);\n var logFile = File(\"/path/to/logfile.txt\");\n logFile.open(\"e\");\n logFile.writeln(output);\n logFile.close();\n}", "title": "" }, { "docid": "bd402d56c4b87776844e99089eb017c6", "score": "0.6225941", "text": "function logMe(input){\n var now = new Date();\n var output = now.toTimeString() + \": \" + input;\n $.writeln(output);\n var logFile = File(\"/path/to/logfile.txt\");\n logFile.open(\"e\");\n logFile.writeln(output);\n logFile.close();\n}", "title": "" }, { "docid": "ad7e387d9558353a61c9b0006e2dad52", "score": "0.6158569", "text": "function log(option,user,action,data,to){\n let log ='';\n if(option==1)\n log = user+\"|\"+action+\"|\"+data+\"|\"+to+\"|\"+new Date().toLocaleString()+\"\\n\";\n else{ // user is the string sent \n log = user+\"|\"+Date.now()+\"\\n\";\n }\n fs.appendFile('daily.log',log,function(){\n //do nothing \n });\n}", "title": "" }, { "docid": "25b652e5cf1b7ba2342d904a5a83bfb7", "score": "0.61583537", "text": "log(date = null) {\n\n let stageName = this.getStageName();\n let time = date ? this.getTime(date) : null;\n\n let str = \"Order ID - (\" + this.id + \") - is \" + stageName + (time ? ' | time = ' + time : '');\n console.log(str);\n fs.appendFileSync('./log/log.txt', str + '\\n');\n\n }", "title": "" }, { "docid": "5bb0d4ba54786948757378f942e0e40a", "score": "0.59440625", "text": "function logResults() {\n fs.appendFile(\"log.txt\", logString, \"utf8\", function(err) {\n if (err) throw err;\n });\n}", "title": "" }, { "docid": "30a8d43b730637566e6aa5a666736cae", "score": "0.5942677", "text": "function createLog(){\n var a = \"log_\" + moment().format('YYMMDD-HHmm') + \".txt\";\n logName = a;\n fs.writeFile(a,\"Starting Log:\\n\",(err)=>{\n if(err) throw(err); \n });\n}", "title": "" }, { "docid": "3d8bae7243f97be4eb417132ab73a259", "score": "0.5931524", "text": "function log(event_name, thing) {\n // Create a HH:MM:SS:iii timestamp\n function create_timestamp() {\n const now = new Date();\n\n const hours = now.getHours().toString().padStart(2, '0');\n const minutes = now.getMinutes().toString().padStart(2, '0');\n const seconds = now.getSeconds().toString().padStart(2, '0');\n const millis = now.getMilliseconds().toString().padStart(3, '0');\n\n return `${hours}:${minutes}:${seconds}.${millis}`;\n }\n\n function new_entry() {\n // Copy from template\n const entry = entry_template.cloneNode(/* deep */ true);\n delete entry.id;\n entry.hidden = false;\n entry.classList.add(event_name.replace('.', '-'));\n\n // Timestamp\n entry.getElementsByClassName('timestamp')[0].textContent = create_timestamp();\n\n // Event\n const event_link = document.createElement('a');\n event_link.href = event_link_map[event_name];\n event_link.target = '_blank';\n event_link.textContent = event_name;\n entry.getElementsByClassName('event')[0].append(event_link);\n\n // Message\n entry.getElementsByClassName('entry-text')[0].textContent = thing.toString();\n\n return entry;\n }\n\n // Creates a new log entry group and adds it at the beginning of the log\n function new_entry_group() {\n // eslint-disable-next-line no-shadow\n const entry_group = document.createElement('div');\n entry_group.classList.add('entry-group');\n html_log_header.insertAdjacentElement('afterend', entry_group);\n return entry_group;\n }\n\n /* Group events if they happen within 100ms (= new_entry_timeout) of each other */\n if (create_entry_group) {\n entry_group = new_entry_group();\n }\n // Reset timeout\n clearTimeout(entry_group_timer);\n create_entry_group = false;\n entry_group_timer = setTimeout(() => { create_entry_group = true; }, new_entry_timeout);\n\n const entry = new_entry();\n entry_group.insertAdjacentElement('afterbegin', entry);\n}", "title": "" }, { "docid": "5147c2ec5d969afcb1b342eb67bd15e4", "score": "0.5922069", "text": "log(message, update) {\n if (this.logLevel < 3) {\n return\n }\n\n this.write(message, !update)\n }", "title": "" }, { "docid": "7c33d9d820ded669f04c89c81c352082", "score": "0.5915276", "text": "function lemurlog_DoWriteLogFile(fileName, text) {\n lemurlog_WriteLogFile(fileName, text);\n lemurlog_checkAutoUpload();\n}", "title": "" }, { "docid": "a312ec3a6afa0d1076e82e75327aa8c4", "score": "0.59148866", "text": "function logResults(data) {\n fs.appendFile(\"log.txt\", data, function (err) {\n if (err) throw err;\n });\n}", "title": "" }, { "docid": "84f2c67bb2a5851a6df640eb043b7bd4", "score": "0.58891815", "text": "function logResults (data){\n fs.appendFile(\"log.txt\", data, function (err) {\n if (err) throw err;\n });\n}", "title": "" }, { "docid": "03222972df5c3ab44d2c324c4c924c36", "score": "0.5887763", "text": "function dataLog() {\n fs.appendFile(\"./log.txt\", \", \" + arguTwo)}", "title": "" }, { "docid": "19ad4fcf89b9cc2fb9e9cde333497895", "score": "0.58815724", "text": "function log() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n}", "title": "" }, { "docid": "9d06f34e3cf8fc38ba9c9c816c4d89bd", "score": "0.58794403", "text": "function Log(content) {\n var now = new Date(Date.now());\n var time_str = \"[\"+(now.getMonth()+1).toString() + \"/\" + now.getDate().toString() +\"/\"+ now.getFullYear().toString() + \" \" + now.getHours().toString() + \":\" + now.getMinutes().toString() + \":\" + now.getSeconds().toString() + \"] \";\n console.log(time_str+content);\n fs.appendFileSync(logfile, time_str+content + '\\r\\n');\n}", "title": "" }, { "docid": "3d8a7fcfb958c1a0680fc2fa97e4a36d", "score": "0.58621496", "text": "function writeStatsLog(logFn, event_log_file, data) {\n var fs = require('fs'); // Lazy\n fs.writeFile(event_log_file, util.inspect(data), function(err) {\n if(err)\n console.log(err);\n else {\n logFn(\"Event timing data logged to [%s].\", event_log_file); \n }\n }); \n}", "title": "" }, { "docid": "dd75d44dfccd612a7dce67566469ceb3", "score": "0.5849487", "text": "function writeLog(txt) {\n\tvar dt = dateTime.create();\n\tvar log = dt.format('Y-m-d H:M:S');\n\tlog += '\\n';\n\tlog += txt;\n\tlog += '\\n';\n\tfs.appendFileSync('log.txt', log);\n}", "title": "" }, { "docid": "ace4daf91694a65f600d46fe4dc63c9c", "score": "0.58470637", "text": "function log() {\n\t\t return stream.write(util.format.apply(util, arguments) + '\\n');\n\t\t}", "title": "" }, { "docid": "d7bf066180c0c0230e60e67e83714f47", "score": "0.58286035", "text": "function appendToLog(data, source) {\n\n if (source === 'twitter') {\n fs.appendFile('twitter_log.txt', JSON.stringify(data, null, '\\t'), 'utf8', function(error, response) {\n if (error) {\n return console.log(error);\n }\n console.log('Log has been updated!');\n })\n }\n\n if (source === 'movie') {\n fs.appendFile('movie_log.txt', JSON.stringify(data, null, '\\t'), 'utf8', function(error, response) {\n if (error) {\n return console.log(error);\n }\n console.log('Log has been updated!');\n })\n }\n \n if (source === 'spotify') {\n fs.appendFile('spotify_log.txt', JSON.stringify(data, null, '\\t'), 'utf8', function(error, response) {\n if (error) {\n return console.log(error);\n }\n console.log('Log has been updated!');\n })\n }\n}", "title": "" }, { "docid": "d282fcf64baf31e8cce2b838e2c744f1", "score": "0.5817314", "text": "function log() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n}", "title": "" }, { "docid": "d282fcf64baf31e8cce2b838e2c744f1", "score": "0.5817314", "text": "function log() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n}", "title": "" }, { "docid": "d50e885eb133a3e903cb47ffeadecdd5", "score": "0.5813393", "text": "function writeToLog(errMessage) { \n\n //fs is required to create/write to the log file\n var fs = require('fs');\n\n //Create new date object, which stores the current date & time by default\n var dateTime = new Date();\n\n\t// updates logfile.txt \t\n fs.appendFile(pathtolog, dateTime + \":\\t\" + errMessage + \"\\n\", function (err) {\n if (err) throw err;\n console.log(\"Written to log: \" + errMessage);\n });\n}", "title": "" }, { "docid": "5e6ba5fd2bf154852f91e367acb9cbfe", "score": "0.5810598", "text": "function writeToLog(data) {\n fs.appendFile(\"log.txt\", '\\r\\n\\r\\n', function (err) {\n if (err) {\n return console.log(err);\n }\n });\n\n fs.appendFile(\"log.txt\", (data), function (err) {\n if (err) {\n return console.log(err);\n }\n console.log(space + \"log.txt was updated!\");\n });\n}", "title": "" }, { "docid": "412606c46aa66f22f7ae02618b3c50f1", "score": "0.580765", "text": "function log() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n }", "title": "" }, { "docid": "20eafa7ccc9a3bf7844fc7d882a74f68", "score": "0.58032084", "text": "function writeToLog(data) {\n fs.appendFile(\"log.txt\", '\\r\\n\\r\\n', function(err) {\n if (err) {\n return console.log(err);\n }\n });\n\n fs.appendFile(\"log.txt\", (data), function(err) {\n if (err) {\n return console.log(err);\n }\n console.log(space + \"log.txt was updated!\");\n });\n}", "title": "" }, { "docid": "9be6cba0fead83f1081684d083a43c06", "score": "0.58001435", "text": "function log() {\n\t return stream.write(util.format.apply(util, arguments) + '\\n');\n\t}", "title": "" }, { "docid": "9be6cba0fead83f1081684d083a43c06", "score": "0.58001435", "text": "function log() {\n\t return stream.write(util.format.apply(util, arguments) + '\\n');\n\t}", "title": "" }, { "docid": "e51b5bc6086e88999d5f6f58ab6a8765", "score": "0.5792635", "text": "function log$2() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n}", "title": "" }, { "docid": "a558468f45a51ea6fed3daf72e45ed48", "score": "0.5782652", "text": "function writeLogs() {\n cslogging.loadConfig('./testConfig.json');\n\n // the configFile set the maxSize to be 1K and maxFiles to be 10\n // So we need to write out a bit more then 10*1K of bytes of logs\n var testLogger = cslogging.getLogger('test');\n\n console.log('writing logs!');\n for(var i=0; i < 20; i++) {\n var chr = String.fromCharCode(97 + i);\n var logwriting = createLogWritingFunction(testLogger, chr, 1000);\n\n setTimeout(logwriting, i*100);\n }\n\n}", "title": "" }, { "docid": "69afcccd3214fbe2d2a8bea7f214def2", "score": "0.5782528", "text": "function writeToLog(data) {\n\n fs.appendFile(\"log.txt\", data, function(err) {\n if (err) {\n return console.log(err);\n }\n console.log(space + \"log.txt was updated!\" + \"\\n\");\n whatIsNext();\n });\n}", "title": "" }, { "docid": "885eaf259681735870afb929b7077a50", "score": "0.5778553", "text": "function log() {\n\t console.log('%s - %s', timestamp(), format.apply(null, arguments));\n\t}", "title": "" }, { "docid": "eecbbc08a3ead305ee17d90854300063", "score": "0.5764843", "text": "function log() {\n return stream.write(util.format.apply(this, arguments) + '\\n');\n }", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "8b18f5125f4f755f7ef9da16803d3d38", "score": "0.57451844", "text": "function log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}", "title": "" }, { "docid": "09120700f27cd65f946c7a50245b711d", "score": "0.5725258", "text": "function logger(object,event){\n\n var ti = new Date();\n // for main logs\n if(event == 'main'){\n\tfs.writeFile('/var/log/raswall/main.log',ti.toUTCString() + ' SQ ' + object.type + ' : ' + object.data + '\\n', options,function(err){\n });\n }\n // for user specfic logs \n else if(event == 'user'){\n fs.writeFile('/var/log/raswall/users/'+object.username ,ti.toUTCString() + ' SQ ' + object.type + ' : ' + object.data + '\\n', options,function(err){\n });\n }\n\n else if(event == 'debug'){\n fs.writeFile('/var/log/raswall/debug.log' ,ti.toUTCString() + ' SQ ' + object.type + ' : ' + object.data + '\\n', options,function(err){\n });\n }\n}", "title": "" }, { "docid": "179d8d9b2f48017bbdcc6647bb6f0ab4", "score": "0.57196015", "text": "function logResults(action, response, autoplay) {\n\n var text = action + \", \" + response + \", \" + autoplay + \"\\n\";\n\n fs.appendFile(\"log.txt\", text, function (err) {\n\n if (err) {\n console.log(\"Danger! Danger Will Robinson!\");\n }\n\n })\n}", "title": "" }, { "docid": "2cd4eca7241071efba717e2ee96040c6", "score": "0.5713703", "text": "function log() {\n\t return stream.write(util.format.apply(this, arguments) + '\\n');\n\t}", "title": "" }, { "docid": "2cd4eca7241071efba717e2ee96040c6", "score": "0.5713703", "text": "function log() {\n\t return stream.write(util.format.apply(this, arguments) + '\\n');\n\t}", "title": "" }, { "docid": "2cd4eca7241071efba717e2ee96040c6", "score": "0.5713703", "text": "function log() {\n\t return stream.write(util.format.apply(this, arguments) + '\\n');\n\t}", "title": "" }, { "docid": "2cd4eca7241071efba717e2ee96040c6", "score": "0.5713703", "text": "function log() {\n\t return stream.write(util.format.apply(this, arguments) + '\\n');\n\t}", "title": "" }, { "docid": "2cd4eca7241071efba717e2ee96040c6", "score": "0.5713703", "text": "function log() {\n\t return stream.write(util.format.apply(this, arguments) + '\\n');\n\t}", "title": "" }, { "docid": "2cd4eca7241071efba717e2ee96040c6", "score": "0.5713703", "text": "function log() {\n\t return stream.write(util.format.apply(this, arguments) + '\\n');\n\t}", "title": "" }, { "docid": "2cd4eca7241071efba717e2ee96040c6", "score": "0.5713703", "text": "function log() {\n\t return stream.write(util.format.apply(this, arguments) + '\\n');\n\t}", "title": "" }, { "docid": "cdccd4429d2d7e0d5199aceb5dcce234", "score": "0.571366", "text": "function logger(content,level) {\n\n var datestring = new Date().toISOString().split('T')[0];\n var timestring = new Date().toISOString().replace('T',' ');\n\n var filename = datestring+'-server.log';\n var line = timestring + level + content + \"\\n\";\n\n fs.appendFile(filename, line, function (err) {\n if (err) throw err;\n });\n}", "title": "" }, { "docid": "75e0efbcf134a9d128efee5dba010d9e", "score": "0.5703276", "text": "function log() {\n return stream.write(util$3.format.apply(util$3, arguments) + '\\n');\n}", "title": "" }, { "docid": "75e0efbcf134a9d128efee5dba010d9e", "score": "0.5703276", "text": "function log() {\n return stream.write(util$3.format.apply(util$3, arguments) + '\\n');\n}", "title": "" }, { "docid": "fb88e09737ebb7e8921c6788c6d8d613", "score": "0.5698719", "text": "function log() {\n\t console.log('%s - %s', timestamp(), format$1.apply(null, arguments));\n\t}", "title": "" }, { "docid": "fb88e09737ebb7e8921c6788c6d8d613", "score": "0.5698719", "text": "function log() {\n\t console.log('%s - %s', timestamp(), format$1.apply(null, arguments));\n\t}", "title": "" }, { "docid": "fb88e09737ebb7e8921c6788c6d8d613", "score": "0.5698719", "text": "function log() {\n\t console.log('%s - %s', timestamp(), format$1.apply(null, arguments));\n\t}", "title": "" }, { "docid": "e7e42f32389f70819d4ee1784f6dbc8d", "score": "0.5682327", "text": "function logger(message) {\n fs.appendFile(LOG_FILE, message + '\\n');\n}", "title": "" } ]
7caa4c28d3f081c33ce2d2557796532d
var currentTime = hour(); create feed and lastFed variable here
[ { "docid": "687871342b588d2cd622ff31dfa545a9", "score": "0.0", "text": "function preload() {\r\n sadDog = loadImage(\"Dog.png\");\r\n happyDog = loadImage(\"happy dog.png\");\r\n}", "title": "" } ]
[ { "docid": "4a204265886bd43eba6b71ac546fd872", "score": "0.64626706", "text": "function update() {\n var time = (new Date()).getHours(); // returns 0-23\n var after;\n if (time >= 21) {\n after = n['9pm'];\n } else if (time >= 0 && time < 3) {\n after = n['midnight'];\n } else if (time >= 3 && time < 6) {\n after = n['3am'];\n } else if (time >= 6 && time < 9) {\n after = n['6am'];\n } else {\n after = n['other'];\n }\n setSong(after);\n setPic(after);\n}", "title": "" }, { "docid": "5650c93ace15a8f3a66efe64248dc46b", "score": "0.6174682", "text": "_setupDate(postId,timestamp){const post=this.postElement;$('.fp-time',post).attr('href',`/post/${postId}`);$('.fp-time',post).text(friendlyPix.Post.getTimeText(timestamp));// Update the time counter every minutes.\nthis.timers.push(setInterval(()=>$('.fp-time',post).text(friendlyPix.Post.getTimeText(timestamp)),60000))}", "title": "" }, { "docid": "19e4e5026bfe6e3a5b53d0940967439e", "score": "0.61439735", "text": "getFedTime(lastFed){\r\n this.lastFed = lastFed;\r\n }", "title": "" }, { "docid": "a11d0eb89853bf21f5140c737c0f51e6", "score": "0.6113741", "text": "function timeUpdate() {\n day = pullDayFromStorage(day);\n pastPresentFuture(day);\n storage(day);\n display(day);\n }", "title": "" }, { "docid": "dc1ca8ea35e462f7097846d9079eea8b", "score": "0.607007", "text": "function clock(){\n pullTweets();\n }", "title": "" }, { "docid": "ee4d15b4c8694a483e3a22c30e96f3f1", "score": "0.60358995", "text": "function trackTime() {\n \n let currentHour = moment().hour();\n \n $(\".entry\").each(function () {\n let timeSlot = parseInt($(this).attr(\"data-time\"));\n console.log(this);\n console.log(timeSlot, currentHour);\n\n if (timeSlot < currentHour) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n } else if (timeSlot === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n $(this).removeClass(\"future\");\n } else {\n $(this).removeClass(\"present\");\n $(this).removeClass(\"past\");\n $(this).addClass(\"future\");\n }\n \n\n\n\n });\n\n \n }", "title": "" }, { "docid": "d5b27985368084b9b8041857bb75bed9", "score": "0.59855014", "text": "function updateHomeTime(){\n\t\tvar now = new Date();\n\t\thome_time = new Date(now.getFullYear(), now.getMonth(), now.getDate(), home_hour, home_minute)\n\t}", "title": "" }, { "docid": "c8bec3d12b9560a8e39a39ff74bb78f2", "score": "0.5949875", "text": "function timeTracker() {\n //that obtains the current hour\n var currentHour = moment().hours();\n console.log(currentHour);\n\n //in a for each loop for each timeblock\n $(\".time-block\").each(function () {\n //checks to see if we've moved past this time, using the id of the time block (must change it to a number)\n let trackHour = parseInt($(this).attr(\"id\"));\n console.log(trackHour);\n\n //if we have moved past the current hour\n if (trackHour < currentHour) {\n //change class to past\n $(this).addClass(\"past\");\n\n } // or if we are on the current hour, change it to present\n else if (trackHour === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n } // or if it is still in the future, change class to future\n else {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n };\n })\n }", "title": "" }, { "docid": "70c7a9575171bea0e4e2c2f3371b81e7", "score": "0.59430385", "text": "function time(){\n\nif (current_time > firstTrainTimeSS) {\n var ftt_ct = current_time.diff(firstTrainTimeSS, \"minutes\");\n} else {\n var ftt_ct = (current_time.diff(firstTrainTimeSS, \"minutes\"))* -1;\n}\n var temp = Math.trunc(ftt_ct/frequencySS)\n temp2 = (temp*frequencySS)\n temp3 = (ftt_ct-temp2)\n minutesAway = frequencySS - temp3\n nextArrival = moment().add(minutesAway, 'm');\n nextArrival = moment(nextArrival).format('HH:mm')\n}", "title": "" }, { "docid": "0d1cd187e63b6823f476321c3d92415e", "score": "0.5920125", "text": "function setTime() {\r\n time.hour = today.getHours();\r\n time.minutes = today.getMinutes();\r\n time.seconds = today.getSeconds();\r\n}", "title": "" }, { "docid": "34488a14b31d2a572826909f3ab5cb76", "score": "0.5917713", "text": "function tick(){\n currentHour = moment().format('HH');\n //when there is a change in hour update the color of the blocks\n if(lastHour !== currentHour){\n updateTimeClasses();\n }\n lastHour = currentHour;\n }", "title": "" }, { "docid": "68e8ffe02efad1f65b06798d27d20b23", "score": "0.5912157", "text": "function getTime() {\n window.setInterval(function() {\n time = moment().format(\"hh:mm:ss a\");\n minutes = moment().format(\"mm:ss\");\n console.log(minutes);\n if (time == \"00:00:00 am\") {\n $(\"#currentDay\").text(date);\n localStorage.removeItem(\"events\");\n getEvents();\n }\n if (minutes == \"00:00\") {\n $(\".event\").removeClass(\"past present future\")\n setBackground();\n }\n }, 1000);\n $(\"#currentDay\").text(date);\n setBackground();\n }", "title": "" }, { "docid": "f4c0884d4c3d1e9a468337114eed4027", "score": "0.59106594", "text": "function setDate(){\r\n d = new Date()\r\n if (m != d.getMinutes()) {\r\n m = d.getMinutes();\r\n $('<div class=\"timestamp\">' + d.getHours() + ':' + m + '</div>').appendTo($('.message:last'));\r\n }\r\n}", "title": "" }, { "docid": "10e27fa78bf0310875ae23658b9a7dfd", "score": "0.5905078", "text": "function tracker() {\n var hour = moment().hour();\n console.log(hour);\n $(\".row\").each(function () {\n console.log($(this));\n\n console.log($(this).data(\"hour\"));\n var blockHour = $(this).data(\"hour\");\n console.log(blockHour);\n var blockHour = parseInt(blockHour);\n\n //past hours\n if (blockHour < hour) {\n $(this).addClass(\"past\");\n } else if (blockHour === hour) {\n $(this).addClass(\"present\");\n } else {\n $(this).addClass(\"future\");\n }\n });\n }", "title": "" }, { "docid": "6d6bd785bab82cc91c726d3fa22b39a5", "score": "0.5902349", "text": "function assignment31_34Q11() {\r\n var current = new Date();\r\n var ahead = current.getHours();\r\n document.write(\"<p>Current date: <b>\" + current + \"</b></p>\");\r\n current.setHours(ahead - 1);\r\n document.write(\"<p>1 hour ago, it was <b>\" + current + \"</b></p>\");\r\n document.write(\"<p>Click on Refresh to go back home page</p>\");\r\n}", "title": "" }, { "docid": "63b282cd8f20eb7fc6f0a36bc5ae3c1b", "score": "0.59013873", "text": "function Feed(){\r\n dog.addImage(happyDog);\r\n \r\n foodS = foodObj.getFoodStock();\r\nfoodObj.updateFoodStock(foodS-1);\r\n database.ref('/').update({\r\n foodStock:foodObj.getFoodStock(),\r\n FeedTime:hour()\r\n \r\n })\r\n\r\n }", "title": "" }, { "docid": "ab1f5d0c60a611f2291057af8b319598", "score": "0.5875872", "text": "function updateBackground() {\n\n //get the time using moment.js\n $(\"#currentDay\").text(moment().format('MMMM Do YYYY, h:mm:ss a'));\n var currentHour = moment().hour();\n console.log(currentHour);\n\n $(\".time-block\").each(function () {\n var hour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n if (hour < currentHour) {\n $(this).addClass(\"past\");\n }\n else if (hour === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n }\n else {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n }\n });\n }", "title": "" }, { "docid": "b07d0852a9839267d2febefe804e7120", "score": "0.5857789", "text": "function currentTime() {\n var today = new Date();\n var hourNow = today.toLocaleTimeString();\n var dateNow = today.toDateString();\n\n return '<h3>' + hourNow + '</h3>' + dateNow + '<br></br>';\n}", "title": "" }, { "docid": "de22142458ac8737c04696e7cd7a2266", "score": "0.58401626", "text": "function updateTime() {\n\n}", "title": "" }, { "docid": "4dfba7d50350eaf15765880ea644fa1b", "score": "0.5836482", "text": "lastTimeData() {\n var currentDate = new Date();\n var Hours = this.addZero(currentDate.getHours());\n var Minutes = this.addZero(currentDate.getMinutes());\n var Seconds = this.addZero(currentDate.getSeconds());\n var lastTime = Hours + \":\" + Minutes + \":\" + Seconds;\n this.lastAccess.date = lastTime;\n\n }", "title": "" }, { "docid": "7e3b55c2eff69231ab177d6d3f9ed781", "score": "0.5824199", "text": "function currentTime() {\r\n\r\n var currentHour = moment().hours()\r\n console.log(currentHour);\r\n\r\n $('.time-block').each( function(){\r\n var blockHour = parseInt($(this).attr('id').split('hour-')[1 - 18])\r\n console.log(blockHour);\r\n\r\n if (blockHour < currentHour) {\r\n $(this).children('textarea').addClass('past');\r\n }\r\n\r\n else if (blockHour === currentHour) {\r\n $(this).children('textarea').removeClass('past');\r\n $(this).children('textarea').addClass('present');\r\n }\r\n\r\n else {\r\n $(this).children('textarea').removeClass('past');\r\n $(this).children('textarea').removeClass('present');\r\n $(this).children('textarea').addClass('future');\r\n }\r\n\r\n });\r\n }", "title": "" }, { "docid": "99b400d8bec3f182b7366645c41b7705", "score": "0.57945645", "text": "function updateTime() {\n drawShadow({ x: 30, y: 30 }, morning);\n timeUI.setAttribute(\"datetime\", morning);\n timeUI.innerHTML = String(morning).split(\"GMT\")[0];\n}", "title": "" }, { "docid": "cc6d246b46079b6b5131a4c565b1a893", "score": "0.5793003", "text": "function startTime() {\n var today = new Date();\n today = today.toLocaleString('en-US', {\n hour: 'numeric',\n minute: 'numeric',\n hour12: true\n });\n var time = new Date().getHours();\n\n if (time < 12) {\n document.getElementById('time_greetings_msg').innerHTML = 'Good Morning';\n } else if (time >= 12 && time < 17) {\n document.getElementById('time_greetings_msg').innerHTML = 'Good afternoon ';\n } else {\n document.getElementById('time_greetings_msg').innerHTML = 'Good evening ,' + localStorage.getItem('userID');\n }\n}", "title": "" }, { "docid": "eff9c86e9244dcbba4c277e7dc5c677b", "score": "0.5792824", "text": "function currentTime() {\n $('#fullClock').html(moment().format('MMMM Do YYYY, h:mm a'));\n $('#smallClock').html(moment().format('h:mm a'));\n }", "title": "" }, { "docid": "e70c6bf76cdcbd7bcbb8e12f47fbe747", "score": "0.5780508", "text": "function eventSet() {\n\n var today = new Date()\n var hour = today.getHours()\n\n\n if (events[hour]){\n\n $(\"#currEv\").html(\"Current Event: \" + events[hour])\n\n }\n\n if (events[hour + 1]){\n\n $(\"#nextEv\").html(\"Upcoming Event: \" + events[hour + 1])\n\n }\n\n if(!events[hour] || events[hour] === \"\" || events[hour] === \"<br>\"){\n\n $(\"#currEv\").empty()\n\n }\n\n if (!events[hour + 1] || events[hour + 1] === \"\" || events[hour + 1] === \"<br>\"){\n\n $(\"#nextEv\").empty()\n\n }\n\n //Check every minute\n setTimeout(function() {\n eventSet()\n } , 60000)\n\n}", "title": "" }, { "docid": "161f0f57d5edbb20306ab0b22614907a", "score": "0.5774226", "text": "function hourTracker() {\n\n var currentHour = moment().hour();\n\n // grabs each time block and converts to it's individual integer //\n $(\".time-block\").each(function() {\n var blockHour = parseInt($(this).attr(\"id\").split(\"hour\")[1]);\n console.log(blockHour); \n\n // color codes for past/present/future //\n if (blockHour === currentHour) {\n $(this).css(\"background-color\", \"yellow\");\n }\n \n if (blockHour < currentHour) {\n $(this).css(\"background-color\", \"gray\");\n }\n\n if (blockHour > currentHour) {\n $(this).css(\"background-color\", \"green\");\n }\n \n })\n \n }", "title": "" }, { "docid": "7f748099a24e047f42671c3358a0abae", "score": "0.576258", "text": "function timeUpdate() {\n\t\t\t}", "title": "" }, { "docid": "914c8c6aa624507aeb9d869e29e76da4", "score": "0.57613003", "text": "function callTime(hour) {\n if (hour < today) {\n return \"past\";\n } else if (hour > today) {\n return \"future\";\n } else if (hour === today) {\n return \"present\";\n }\n\n\n}", "title": "" }, { "docid": "801c84192fdf2ca66354813640cfacda", "score": "0.5738793", "text": "function getTime() {\n\tnow = new Date();\n console.log('get time: ', now);\n\tcurrentTime.hour = now.getHours();\n\tcurrentTime.minutes = now.getMinutes();\n\tdayOfTheWeek = now.getDay();\n\n\tif (dayOfTheWeek === 7 || dayOfTheWeek === 0) {\n\t\tisWeekend = true;\n\t} else {\n\t\tisWeekend = false;\n\t}\n}", "title": "" }, { "docid": "92b95fd5c64c3f60c8c34c325fff9e26", "score": "0.572812", "text": "function estimatedTime() {\r\n\tgetRates(); // Compute heating and cooling rates\r\n\r\n\tlet deltaT = parseInt(spa.ST,16) - parseInt(spa.CT,16);\r\n\tlet rate = 0;\r\n\r\n\tif (deltaT > 0) { // We're heating\r\n\t\trate = spa.rates.heat\r\n\t} else if (deltaT < 0) { // We're letting it cool\r\n\t\trate = spa.rates.cool\r\n\t}\r\n\r\n\tlet time = new Date();\r\n\tif (rate != 0) {\r\n\t\ttime.setMinutes(time.getMinutes() + deltaT/rate);\r\n\t\tspa.estimatedTime = `(${time.getHours().toString().padStart(2,\"0\")}:${time.getMinutes().toString().padStart(2,\"0\")})`;\r\n\t\tspa.deltaT = deltaT; // Just for something to check for background color in script.js\r\n\t} else {\r\n\t\tspa.estimatedTime = \"\";\r\n\t}\r\n\r\n\tio.emit('data',{estimatedTime : spa.estimatedTime}); // Converting date objet to HH:MM\r\n}", "title": "" }, { "docid": "488506476c4b4a2e0c606cac4d42ad1e", "score": "0.5721258", "text": "function hourUpdater() {\n var dt = new Date();\n var currentTime = dt.getHours();\n\n\n\n $(\".time-block\").each(function() {\n\n // take the value frome each id and setting to the variable block.\n var block = parseInt($(this).attr(\"id\").split(\"hour\")[1]);\n console.log(block, currentTime)\n console.log(dt);\n\n if (block < currentTime) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n }\n\n else if (block === currentTime) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n $(this).removeClass(\"future\");\n }\n\n else {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n }\n\n\n })\n\n}", "title": "" }, { "docid": "a078c4d43c4eaed3afb4363552270f3d", "score": "0.5718752", "text": "function tick () {\n let dateHours = new Date().toLocaleString('en-US', { hour: 'numeric', hour12: true }).split(' ').join('').toLowerCase()\n let dateDay = new Date().getDay()\n globalDateDay = dateDay\n globalHours = dateHours\n if (!playing || (new Date().getMinutes() == \"00\" && dateHours !== lastEventSentHour)) {\n lastEventSentHour = dateHours\n chrome.storage.local.get(['state'], result => {\n if ((result['state'] && result['state'] === 'pause') && (!grandfatherMode || !~gmHours.indexOf(globalHours))) return\n if (kkSliderCheck()) playRandomKK()\n else {\n playSong(globalHours)\n }\n })\n }\n}", "title": "" }, { "docid": "ee21597c975655eb642d9abb60a9f850", "score": "0.57187486", "text": "function updateTime() {\n element.text(getMoment().format(format) + ' (' + getMoment().fromNow() + ')');\n }", "title": "" }, { "docid": "ea0d5c0e8882a55538bbc68726cfa3fd", "score": "0.5717826", "text": "function feedDog() {\r\n dog.addImage(happyDog);\r\n \r\n foodObj.updateFoodStock(foodObj.getFoodStock() - 1);\r\n if (foodStock != 0) {\r\n bottle.visible = true;\r\n }\r\n foodObj.getFedTime(lastFed);\r\n database.ref('/').update({\r\n Food:foodObj.getFoodStock(),\r\n FeedTime:hour()\r\n })\r\n \r\n}", "title": "" }, { "docid": "3fcd44cb67fe36d5abe6daa6054be695", "score": "0.5698162", "text": "function showTime() {\n todaysDate = new Date();\n todaysHour = todaysDate.getHours()\n todaysDateDisplay.html(todaysDate)\n updateTime()\n}", "title": "" }, { "docid": "a1393bb358f162dbd633939eb962f772", "score": "0.56975234", "text": "function watch() {\n\tvar time = new Date(),\n\t hour = time.getHours(),\n\t minit = time.getMinutes(),\n\t sec = time.getSeconds(),\n\t daynight = ' PM';\n\n\t // AM/PM\n if (hour < 12) {\n \tdaynight = ' AM';\n }\n // 0 = 12 \n\t if( hour == 0) {\n hour = 12;\n\t }\n // converting 12 hour\n\t if(hour > 12) {\n\t hour = hour - 12;\t \n\t }\n\t // adding 0\n\t if (hour < 10 ) {\n\t \thour = '0' + hour;\n\t }\n\t if (minit < 10 ) {\n\t \tminit = '0' + minit;\n\t }\n\t if (sec < 10 ) {\n\t \tsec = '0' + sec;\n\t }\n\ndocument.getElementById(\"live-time\").innerHTML = hour + ':' + minit + ':' + sec + daynight ;\t \n}", "title": "" }, { "docid": "8c2143619dc7d325c7c385918b57e17c", "score": "0.5696127", "text": "function hourly() {\n nukeSoloEvents(3600);\n}", "title": "" }, { "docid": "1fcda1db016e5483225904645d957116", "score": "0.56950307", "text": "function updateTime() {\n var now = moment();\n displayTime.text(now.format(\"h:mm:ss a, dddd, MMMM Do YYYY\"));\n // if (currentHour !== now.format(\"H\")) {\n // updateBlocks();\n // }\n}", "title": "" }, { "docid": "b76e3e9a7de5adaee568d4d256603e9d", "score": "0.56896853", "text": "function feedDog(){\n\n dog.addImage(happyDogImg);\n\n if(foodS<=0){\n foodS=0;\n }else{\n foodS = foodS-1;\n }\n \n database.ref('/').update({\n FeedTime:hour(),\n Food:foodS\n })\n}", "title": "" }, { "docid": "b6f8bc2df98e095fb212e424688bd30b", "score": "0.56863713", "text": "function comHour(){\n var currentHour = moment().hour();\n var timeBlocks = $(\".time-block\");\n\n $(timeBlocks).each(function() {\n var timeBlock = $(this);\n var timeBlockId = timeBlock.attr('id');\n var hour = parseInt(timeBlockId.split('-')[1])\n if (hour < currentHour) {\n timeBlock.addClass(\"past\")\n } else if (hour === currentHour) {\n timeBlock.removeClass(\"past\")\n timeBlock.addClass(\"present\")\n } else {\n timeBlock.removeClass(\"past\")\n timeBlock.removeClass(\"present\")\n timeBlock.addClass(\"future\")\n }\n });\n }", "title": "" }, { "docid": "8fe984c42adf11cf72f4e939521aee33", "score": "0.5679723", "text": "function watch(){\n\t\t\tlet x=new Date();\n\t\t\tlet clock=document.getElementById('time');\n\n\t\t\tlet hours=x.getHours();\n\t\t\tif(hours<10) hours='0'+hours;\n\t\t\tclock.children[0].innerHTML=hours;\n\n\t\t\tlet min=x.getMinutes();\n\t\t\tif(min<10) min='0'+min;\n\t\t\tclock.children[1].innerHTML=min;\n\n\t\t\tlet sec =x.getSeconds();\n\t\t\tif(sec<10) sec='0'+sec;\n\t\t\tclock.children[2].innerHTML=sec;\n\t\t}", "title": "" }, { "docid": "f1faaee74f6037351b073bc5a35221ec", "score": "0.56696004", "text": "function requestLast24h() {\n\t\n\tlet dateFrom = new Date();\n\tlet dateTo = new Date();\n\tdateFrom.setHours(dateTo.getHours() - 24);\n\n\t$.ajax({\n\t\turl: getURL() + '/api/things/temporal/' + dateFrom.toISOString() + '/' + dateTo.toISOString(),\n\t\tglobal: false,\n\t\ttype: 'GET',\n\t\tasync: false,\n\t\tsuccess: function(things) {\n\t\t\tdrawMarkers(things);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "f26cb2106b2b2ebc1c991841497a7f9b", "score": "0.56676054", "text": "function getDateAntTime() {\n timeFactory.getTimeAndDate()\n .then(function (response) {\n vm.today = response.data.today;\n vm.current_time = response.data.current_time;\n });\n }", "title": "" }, { "docid": "7798ee5aafd4ba698ed42adae25ebdeb", "score": "0.5665599", "text": "function GenerateTimestamps()\n{\n // Get the current hour.\n var oDate = new Date();\n var lNow = oDate.getTime();\n var lCurrentHour = parseInt(lNow / 3600000);\n// lCurrentHour++;\n lCurrentHour *= 3600000;\n \n for (var i = 0; i < MAX_HOURS; i++)\n {\n m_oTimestamps[i] = lCurrentHour;\n lCurrentHour -= 3600000;\n }\n}", "title": "" }, { "docid": "2253ac69b886d9eb193672ad10daad40", "score": "0.5660201", "text": "function getInitialTime() {\n changeTime();\n}", "title": "" }, { "docid": "c48dcb1c31d68cf8ea305064969484ea", "score": "0.5640877", "text": "function updateTime() {\n const today = new Date();\n const time = today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds();\n timeNode.innerHTML = time;\n}", "title": "" }, { "docid": "605433f263e7321b484783972a0864c8", "score": "0.56356764", "text": "static updateTime(t) {\n return new He(t);\n }", "title": "" }, { "docid": "c9c3ad4a27ca82b1120a7989cf472414", "score": "0.56317425", "text": "function hourUpdater() {\r\n // get current number of hours\r\n var currentHour = moment().hours();\r\n\r\n // loop over time blocks\r\n $('.time-block').each(function () {\r\n var timeBlock = parseInt($(this).attr('id').split('hour')[1]);\r\n\r\n // check if we've moved past this time\r\n if (timeBlock < currentHour) {\r\n $(this).removeClass(\"future\");\r\n $(this).removeClass(\"present\");\r\n $(this).addClass(\"past\");\r\n }\r\n else if (timeBlock === currentHour) {\r\n $(this).removeClass(\"past\");\r\n $(this).removeClass(\"future\");\r\n $(this).addClass(\"present\");\r\n }\r\n else {\r\n $(this).removeClass(\"present\");\r\n $(this).removeClass(\"past\");\r\n $(this).addClass(\"future\");\r\n }\r\n })\r\n }", "title": "" }, { "docid": "e67da87083ad85468a4da12b0f058c3e", "score": "0.5627994", "text": "function hourUpdater() {\n\n $(\".time-block\").each(function() {\n var currentHour = moment().hours();\n var blockHour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n\n if(blockHour < currentHour) {\n ($(this)).addClass(\"past\").removeClass(\"future present\");\n }else if(blockHour > currentHour) {\n ($(this)).addClass(\"future\").removeClass(\"past present\");\n }else {\n ($(this)).addClass(\"present\").removeClass(\"past future\");\n }\n });\n }", "title": "" }, { "docid": "e220c63101054358f2701b9728b0d783", "score": "0.5625034", "text": "function updateTime()\n{\n\tlastCallTime = new Date().getTime();\n}", "title": "" }, { "docid": "190864da82e22b584784ddeed4cbf4bf", "score": "0.56214553", "text": "function pollTime(){\n var timestamp = new Date().toLocaleTimeString();\n return timestamp;\n}", "title": "" }, { "docid": "767c14fdf08220cc9488788a8a08ddec", "score": "0.5620861", "text": "function updateActivity() {\n let currentHour = moment().hours();\n\n $(\".time-block\").each(function(){\n let activityHour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n\n if (activityHour < currentHour){\n $(this).addClass(\"past\");\n }\n else if (activityHour === currentHour){\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n }\n else {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n }\n });\n}", "title": "" }, { "docid": "a9a2e01b46952537f4d80f4e799e7db3", "score": "0.56081045", "text": "function current() {\n update = setInterval(function () {\n let currentTime = DateTime.local()\n .toLocaleString(DateTime.TIME_24_WITH_SECONDS)\n .split(\":\")\n .join(\"\");\n (currentHour.innerText = currentTime.substring(0, 2)),\n (currentMinutes.innerText = currentTime.substring(2, 4)),\n (currentSeconds.innerText = currentTime.substring(4, 6));\n }, 1000);\n}", "title": "" }, { "docid": "c3eb7c2ec97b456cd0ac046c1ad81b80", "score": "0.56017196", "text": "function updateDateTime() {\n $(\"#currentDay\").text(moment().format(\"MMMM Do YYYY, h:mm:ss a\"));\n\n localStorage.setItem(\"dailyPersonalPlanner_currentHour\", moment().format(\"H\"));\n\n renderPlannerBackground();\n}", "title": "" }, { "docid": "2eed5f93610ed74593a5f36c698b725a", "score": "0.5599698", "text": "function currentDateHour() {\n // All moment() and format() is coming from Moment.js library\n \n // Gets current time and date from Moment.js. Moment returns an object full of all the necessary required information.\n const momentObj = moment();\n // Converts the converts moment object into the correct date format. Day spelled out, Month Spelled out, and day in number format. Thursday, November 20th\n const currentDate = momentObj.format(\"dddd, MMMM Do\");\n // const currentDate = \"Wednesday, November 20th\";\n // Converts the moment object into the current hour from 1-24\n const currentHour = momentObj.format(\"k\");\n // const currentHour = \"22\";\n const current = {\n date: currentDate,\n hour: currentHour\n };\n\n // Used so that when the function is called the value it returns is the object current.\n return current;\n }", "title": "" }, { "docid": "f53e5b4b823eaf48e2941e2daea4d4a2", "score": "0.55982894", "text": "function clock() {\n //Setting variable for present time clock fromat\n var local = moment().format(\"hh:mm:ss\");\n //Setting variable for unix time format\n var xTime = moment().format(\"X\");\n //Inserting variable \"local\" - clock display into the HTML <span> tag id \"localTime\"\n $(\"#localTime\").html(local);\n }", "title": "" }, { "docid": "07915a9d78e016158bbb16ceeac184cb", "score": "0.55950963", "text": "function hourUpdater() {\n \n var currentHour = moment().hours();\n \n $(\".time-block\").each(function() {\n var blockHour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n if (blockHour < currentHour) {\n $(this).addClass(\"past\");\n }\n else if (blockHour === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n }\n else {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n }\n });\n }", "title": "" }, { "docid": "342a2399c78557bd08207acc4329fc40", "score": "0.5590612", "text": "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "title": "" }, { "docid": "5b2d4c0812ab3915b558758175809b4c", "score": "0.558602", "text": "function renderTemporal(){\n for (i=0; i<24; i++) {\n if (i<hour){\n $(\"#\"+ i + \"Input\").attr(\"temporal\", \"past\")\n }\n else if (i==hour){\n $(\"#\"+ i + \"Input\").attr(\"temporal\", \"present\")\n }\n else {\n $(\"#\"+ i + \"Input\").attr(\"temporal\", \"future\")\n }\n }\n}", "title": "" }, { "docid": "ff8e816cb99c8a3186bcfdc80a739808", "score": "0.5577727", "text": "function get24Data(url){\n\t\tvar currentDate = new Date();\n\t currentDate.setHours(currentDate.getHours()-24);\n//\t\talert(currentDate);\n\t\tvar n = currentDate.toISOString();\n\t\turl = url.concat(\"&since=\"+n+\"\");\n\t\t$http.get(url)\n\t\t.then(function(response){\n\t\t\t$scope.first = response.data.length;\n\t\t\t\n\t});\n\t}", "title": "" }, { "docid": "c4f798a6514a373f2a01c0657c08eb94", "score": "0.5575817", "text": "function refreshTime() {\n \n // Get the current time and date\n var sDate = moment().format(\"dddd, MMMM Do YYYY\");\n\n // Store the current hour, strictly formatted into 24 hour time\n nCurrentHour = Number(moment().format(\"H\") % 24);\n\n // Color the rows, and display the date\n colorCodeHours(nCurrentHour);\n eTimeDisplay.html(sDate);\n}", "title": "" }, { "docid": "b94a9cd52c1e9d2e781c33d7254c3b91", "score": "0.55720633", "text": "function hourUpdater() {\n var currentHour = moment().format('H')\n $('.colour').each(function() {\n var blockTime = parseInt($(this).prop('id'));\n if (blockTime == currentHour) {\n $(this).addClass(\"present\");\n // $(this).removeClass(\"future\");\n // $(this).removeClass(\"past\");\n } else if (blockTime < currentHour){\n $(this).addClass(\"past\");\n // $(this).removeClass(\"present\");\n // $(this).removeClass(\"future\");\n }else {\n $(this).addClass(\"future\");\n // $(this).removeClass(\"present\");\n // $(this).removeClass(\"past\");\n }\n });\n }", "title": "" }, { "docid": "380ac9d81f9341b5a4d8edb5435082a4", "score": "0.5569273", "text": "function init(time) {\n\ttimestamp = time; // copy the timestamp\n\tupdateTime(); // update the time\n\tsetInterval(updateTime, 60000); // every minute, update the remaining time\n}", "title": "" }, { "docid": "6bab62f157f7c92b4324660637b5d222", "score": "0.556894", "text": "function getLocalStorage() {\n var currentHour = moment().hour();\n console.log(currentHour);\n $(\".time-block\").each(function () {\n var id = $(this).children(\".hour\").attr(\"id\");\n // color codes based on hour\n $(this).children(\".description\").val(localStorage.getItem(id));\n if (currentHour > id) {\n $(this).addClass(\"past\");\n } else if (currentHour < id) {\n $(this).addClass(\"future\");\n } else {\n $(this).addClass(\"present\");\n }\n });\n }", "title": "" }, { "docid": "b9f22978b62d23301be10c53ba487db2", "score": "0.5568147", "text": "function updateTimeFrames() {\n var d = new Date();\n var hour = d.getHours();\n\n for (var i = 0; i < hourNames.length; i++) {\n var elem = $('#' + hourNames[i] + 'note');\n resetClasses(elem);\n //easy way to find hour in list it is the index (zero based) !!!\n // the hour returned is 24hr based so the list\n if ((hour === 0) || (hour > (i + 1))) {\n elem[0].classList.add(\"past\");\n } else if (hour === (i + 1)) {\n elem[0].classList.add(\"present\");\n } else {\n elem[0].classList.add(\"future\");\n }\n }\n}", "title": "" }, { "docid": "07553c60fe7a32030369eeb8a1744b4f", "score": "0.55648756", "text": "function currentTemperature(response) {\n document.querySelector(\"#cityDisplay\").innerHTML = response.data.name;\n document.querySelector(\".forecast-descrip\").innerHTML = response.data.weather[0].description;\n document.querySelector(\"#temperature\").innerHTML = Math.round(response.data.main.temp) + \"˚C\";\n document.querySelector(\"#humidity\").innerHTML = `Humidity: ${response.data.main.humidity}%`;\n document.querySelector(\"#wind\").innerHTML = `Wind: ${3.6 * Math.round(response.data.wind.speed)}km/h`;\n document.querySelector(\".forecast-icon\").setAttribute(\"src\",`https://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`);\n temperature = response.data.main.temp;\n fiveDayForecast (response.data.coord);\n let localTimeUnix = ((new Date().getTime()/1000) + response.data.timezone)*1000;\n let localTime = new Date(localTimeUnix);\n let localHour = localTime.toLocaleString(\"en-US\", {weekday: \"long\", hour: \"numeric\", minute: \"numeric\", hourCycle: \"h23\" })\n let dayHour = localTime.toLocaleString(\"en-US\", {hour: \"numeric\", hourCycle: \"h23\"});\ndocument.querySelector(\"#local-time\").innerHTML = `Local Time: ${localHour}`;\n\nif (dayHour > 5 && dayHour < 12) {\n document.querySelector(\".weather-app\").setAttribute(\"id\", \"morning\");\n \n} else if (dayHour >= 12 && dayHour < 18) {\n document.querySelector(\".weather-app\").setAttribute(\"id\", \"afternoon\");\n} else if (dayHour >= 18 && dayHour < 21) {\n document.querySelector(\".weather-app\").setAttribute(\"id\", \"evening\");\n} else if (dayHour >= 21 || dayHour < 5) {\n document.querySelector(\".weather-app\").setAttribute(\"id\", \"night\");\n}\n\nconsole.log(dayHour);\n\n function fiveDayForecast (position) {\n let lon = position.lon;\n let lat = position.lat;\n let apiKey = \"6000bf93e246aa260b6c47805cd04cb3\"\n let apiUrl = `https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&exclude=current,minutely,alerts&appid=${apiKey}&units=metric`\n axios.get(apiUrl).then(getForecast);\n}\n}", "title": "" }, { "docid": "4a1377cb51fd88325d2a384ce99e162b", "score": "0.5555433", "text": "function getCurrentTime(){\nvar today = new Date();\n\nvar h = today.getHours();\nvar m = today.getMinutes();\nvar s = today.getSeconds();\nvar timeOfDay = \"AM\"\n\n\nm = appendZero(m);\ns = appendZero(s);\nh = appendZero(h);\n\nif(h == 0)\n h = 12;\n\nif(h > 12){\n h = h - 12;\n timeOfDay = \"PM\";\n}\n\n\ndocument.getElementById('currentTime').innerHTML =\nh + \":\" + m + \":\" + s + \" \" + timeOfDay ;\n\nsetTimeout(getCurrentTime, 1000);\n}", "title": "" }, { "docid": "7ec2f0d44d299f44af851e0f01f0593a", "score": "0.5545183", "text": "function update() {\n var timeNow = moment().hours();\n $(\".time-block\").each(function () {\n var divHour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n \n if (divHour < timeNow) {\n $(this).addClass(\"past\");\n }\n else if (divHour === timeNow) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n }\n else {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\"); \n }\n });\n}", "title": "" }, { "docid": "f6d2f2ecef0e5d6af83a25398eec47eb", "score": "0.5542925", "text": "function getCurrentTemp(marker, number_of_entries) {\n\n var request = $.ajax({\n url: \"api/getChannelFeeds\",\n type: \"POST\",\n data: {number_of_entries: number_of_entries},\n cache: false\n });\n\n request.done(function(msg) {\n\n if (msg == \"noFeed\") {\n console.log(\"No feed were found.\");\n\n } else {\n\n tempDataSerie[\"timestamp\"] = [];\n tempDataSerie[\"timestamp_raw\"] = [];\n tempDataSerie[\"temp\"] = [];\n tempDataSerie[\"lat\"] = [];\n tempDataSerie[\"lon\"] = [];\n\n for (let i = 0; i < msg[0].feeds.length; i++) {\n\n let created_at_tmp = msg[0].feeds[i].created_at;\n let currentTemp_tmp = parseFloat(msg[0].feeds[i].field1);\n let lat_tmp = parseFloat(msg[0].feeds[i].field2);\n let lon_tmp = parseFloat(msg[0].feeds[i].field3);\n\n var localTimestamp_tmp = new Date(created_at_tmp);\n var localTimestampString_tmp = dateFormat(localTimestamp_tmp, 'yyyy-mm-dd HH:MM:ss');\n\n tempDataSerie[\"timestamp_raw\"].push(localTimestamp_tmp);\n tempDataSerie[\"timestamp\"].push(localTimestampString_tmp);\n tempDataSerie[\"temp\"].push(currentTemp_tmp);\n tempDataSerie[\"lat\"].push(lat_tmp);\n tempDataSerie[\"lon\"].push(lon_tmp);\n }\n\n // Retrieves the last temperature data entry\n var currentTemp = tempDataSerie[\"temp\"][tempDataSerie[\"temp\"].length - 1];\n var localTimestamp = tempDataSerie[\"timestamp_raw\"][tempDataSerie[\"timestamp\"].length - 1];\n var localTimestampString = tempDataSerie[\"timestamp\"][tempDataSerie[\"timestamp\"].length - 1];\n var lat = tempDataSerie[\"lat\"][tempDataSerie[\"lat\"].length - 1];\n var lon = tempDataSerie[\"lon\"][tempDataSerie[\"lon\"].length - 1];\n\n if (myLineChart) {\n myLineChart.data.datasets[0].data = tempDataSerie[\"temp\"];\n myLineChart.data.labels = tempDataSerie[\"timestamp\"];\n myLineChart.update();\n }\n\n // Displays the latest temperature data\n var tempData = {currentTemp: currentTemp, createdAt: localTimestampString};\n ReactDOM.render(<DispTempData tempData={tempData}/>, document.getElementById('temperatureDisplay'));\n\n ////////////////////////////////////////////////////////////////////////////////////////////\n // SET COLORS BASED ON TEMPERATURE AND TEMPERATURE SETTINGS\n // IF NO SWITCH IS ON: KEEP DEFAULT BLUE COLOR\n // [ALARM T, ∞) RED\n // [COMFORT MIN, COMFORT MAX] GREEN\n // (COMFORT MAX, ALARM MAX) ORANGE GRADIENT\n // (ALARM MIN, COMFORT MIN) ORANGE GRADIENT\n // !ALARM: - (COMFORT, ∞) 0R (-∞, COMFORT) SINGLE ORANGE COLOR\n // NOTE: ALARM MAX > COMFORT MAX > COMFORT MIN > ALARM MIN\n // NO SETTING IS REQUIRED. ALL COMBINATIONS ARE ACCEPTED.\n // THE TEMPERATURE MAX AND MIN SETTINGS ARE HANDLED ON THE SERVER SIDE\n\n let currentColor = getTemperatureColor(currentTemp);\n\n // https://github.com/anomal/RainbowVis-JS\n // Library for colour data visualization. Map numbers to a smooth-transitioning colour legend.\n let orangeAlarm = \"#FF7416\"; // The orange color closest to alarm temp limit (darkest)\n let orangeComfort = \"#FFB836\"; // The orange color closest to comfort temp limit (brightest)\n let red = \"#EB4549\";\n let green = \"#76C760\";\n let defaultBlue = \"rgba(0,0,0,0.0)\";\n\n if (currentColor === \"default\") {\n $(\".dispTempData\").css(\"background-color\", defaultBlue); //DEFAULT BLUE\n\n } else if (currentColor === \"alarm\") {\n $(\".dispTempData\").css(\"background-color\", red); //RED\n\n } else if (currentColor === \"low_gradient_warning\") {\n var rainbowLG = new Rainbow();\n rainbowLG.setSpectrum(orangeAlarm, orangeComfort);\n rainbowLG.setNumberRange(settings.min_temp_alarm+1, settings.min_temp_comfort-1); //(alarmMin, comfortMin).\n let color = rainbowLG.colourAt(currentTemp);\n let colorHex = \"#\" + color;\n $(\".dispTempData\").css(\"background-color\", colorHex); //ORANGE LOW END GRADIENT\n\n } else if (currentColor === \"high_gradient_warning\") {\n var rainbowHG = new Rainbow();\n rainbowHG.setSpectrum(orangeComfort, orangeAlarm);\n rainbowHG.setNumberRange(settings.max_temp_comfort+1, settings.max_temp_alarm-1); //(comfortMax, alarmMax)\n let color = rainbowHG.colourAt(currentTemp);\n let colorHex = \"#\" + color;\n $(\".dispTempData\").css(\"background-color\", colorHex); //ORANGE HIGH END GRADIENT\n\n } else if (currentColor === \"warning\") {\n $(\".dispTempData\").css(\"background-color\", orangeAlarm); //SINGLE ORANGE COLOR\n\n } else if (currentColor === \"comfort\") {\n $(\".dispTempData\").css(\"background-color\", green); //GREEN\n\n }\n\n var now = new Date();\n var localTimestampNow = new Date(now);\n\n/* console.log(\"Now : \" + localTimestampNow);\n console.log(\"Last reading: \" + localTimestamp);*/\n\n // http://stackoverflow.com/questions/18623783/get-the-time-difference-between-two-datetimes\n // Attributions to Matt Johnson\n // Get the time between two date times\n var timeFromLastReadingSeconds = moment.utc(moment(now).diff(moment(localTimestamp))).format(\"HH:mm:ss\")\n\n var diffMs = moment(now,\"DD/MM/YYYY HH:mm:ss\").diff(moment(localTimestamp,\"DD/MM/YYYY HH:mm:ss\"));\n var diffDuration = moment.duration(diffMs);\n var s = Math.floor(diffDuration.asHours()) + moment.utc(diffMs).format(\":mm:ss\");\n\n var timeFromLastReadingDays = diffDuration._days;\n var timeFromLastReadingMinutes = diffDuration._data.minutes;\n var timeFromLastReadingHours = diffDuration._data.hours;\n\n/*\n console.log(\"Time from last reading: \" + timeFromLastReadingSeconds + \" s\");\n*/\n\n/* timeFromLastReadingDays = 0;\n timeFromLastReadingMinutes = 2;*/\n\n if (timeFromLastReadingDays > 0 || timeFromLastReadingMinutes >= 3) {\n $(\".dispTimeData\").css(\"background-color\", \"#EB4549\"); //RED\n\n function blink(selector){\n $(selector).fadeOut(1200, function(){\n $(this).fadeIn(1200, function(){\n blink(this);\n });\n });\n }\n blink('.dispTimeData');\n }\n\n // Add popup to map with temperature, time and product info\n var popupContent = \"<b>\" + settings.product_alias + \"</b><br>Current&nbsptemp: \" + currentTemp + \" °C.<br> Time from last reading: \";\n if (timeFromLastReadingDays === 1) {\n popupContent += timeFromLastReadingDays + \" day.\";\n } else if (timeFromLastReadingDays > 1) {\n popupContent += timeFromLastReadingDays + \" days.\";\n } else {\n if (timeFromLastReadingHours > 0) {\n popupContent += timeFromLastReadingHours + \" hours and \";\n }\n popupContent += timeFromLastReadingMinutes + \" minutes.\";\n }\n\n // If temperature sensor's location is available - set map view to the sensor's position\n // Otherwise keep the default view bounds of Sweden\n if (map && lat && lon) {\n var latlng = L.latLng(lat, lon);\n marker = L.marker(latlng).addTo(map);\n marker.bindPopup(popupContent);\n map.flyTo(latlng, 14);\n }\n }\n });\n\n request.fail(function(jqXHR, textStatus) {\n console.log(textStatus);\n });\n}", "title": "" }, { "docid": "bbc97aace47a5f36d267451b337598b3", "score": "0.55410206", "text": "function setHour() {\n //set current hour (military time)\n var currentHour = moment().hour();\n\n // Loop through grid rows based on id\n $(\".time-block\").each(function() {\n\n // assign each row an hour based on id (military time)\n var rowHour = parseInt($(this).attr(\"id\"));\n\n // compare row hour to current hour and assign class\n if (currentHour > rowHour) {\n $(this).addClass(\"past\");\n }\n else if (currentHour < rowHour) {\n $(this).addClass(\"future\");\n }\n else if (currentHour === rowHour) {\n $(this).addClass(\"present\");\n }\n })\n }", "title": "" }, { "docid": "33e96d32ea5b6160a8c9f3edb701343c", "score": "0.55320615", "text": "function initTime(){\n date = new Date();\n hours = date.getHours() % 12;\n minutes = date.getMinutes();\n seconds = date.getSeconds();\n }", "title": "" }, { "docid": "6a484410b50d06604723d042936432d6", "score": "0.55220515", "text": "get game_time() { /* ... */ }", "title": "" }, { "docid": "da76172b6f3670a5ffda9366dadd3a4c", "score": "0.5521129", "text": "function giveTimeFH (timestamp){\n\n let now= new Date(timestamp);\n \n let hours= now.getHours();\n\n if (hours<10){\n hours=`0${hours}`;\n }\n\n return `${hours}:00`\n}", "title": "" }, { "docid": "e32834c01f83bf23e32e24d29b5b46d1", "score": "0.5518145", "text": "function currentTime() {\n var currentHour = moment().hours();\n console.log(convert(currentHour));\n $(\".time-block\").each(function(){\n var hourStr = $(this).attr(\"id\");\n var hour = parseInt(hourStr.split(\"-\")[1]);\n if(hour < (convert(currentHour))){\n $(this).addClass(\"past\");\n } else if(hour === (convert(currentHour))){\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n } else {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n }\n })\n}", "title": "" }, { "docid": "0ff76a16829ccdca729770d741e94e19", "score": "0.55134964", "text": "function greetingStatement() {\n var time = new Date().getHours();\n if (time < 12) {\n document.getElementById('fases').innerHTML = 'Have a wonderfull day martians!';\n } else if (time > 12 && time < 17) {\n document.getElementById('fases').innerHTML = 'Enjoy the rest of your afternoon.';\n } else {\n document.getElementById('fases').innerHTML = 'I hope your day was nice!';\n }\n//console.log(time);\n}", "title": "" }, { "docid": "c42f8b9d2103c7de5837fd8fe65ecfe8", "score": "0.55083376", "text": "function currentTime() {\r\n time = new Date();\r\n seconds = time.getSeconds();\r\n minutes = time.getMinutes();\r\n hours = time.getHours();\r\n console.log(seconds + 'seconds ' + minutes + 'minutes ' + hours + 'hours');\r\n}", "title": "" }, { "docid": "cedf53df346a739091531aeef7868f6f", "score": "0.5507708", "text": "function getLastHourData() {\n\n document.getElementById('table-title').innerHTML = \"Values received during the last hour \" + (edgeActivated ? \"on the edge side\" : \"on the cloud side\");\n var side = edgeActivated ? \"edge\" : \"cloud\";\n\n // Variable that contains the time, one hour ago.\n var lastHour = getDateTime();\n\n // Parameters for the scan of the DB.\n var params = {\n TableName: \"CrowdSensingDB\",\n ProjectionExpression: \"#id, #ts, x, y, z, activity, side\",\n FilterExpression: \"#id = :userid and #ts >= :lastHour and side = :side\",\n ExpressionAttributeNames: {\n \"#id\": \"id\",\n \"#ts\": \"timestamp\"\n\n },\n ExpressionAttributeValues: {\n \":userid\": id,\n \":lastHour\": lastHour[1],\n \":side\": side\n }\n };\n //document.getElementById('overall').innerHTML = \"ok2\";\n docClient.scan(params, onScan);\n\n function onScan(err, data) {\n if (err) {\n console.log(\"Error\", err);\n } else {\n document.getElementById('lh-table').innerHTML = \"\";\n\n var c;\n var items = data.Items.reverse();\n var sizeList = Object.keys(items).length;\n\n for (c = 0; c < sizeList; c++) {\n document.getElementById('lh-table').innerHTML += '<tr><td>' + items[c].timestamp + '</td><td>' + (items[c].x).substring(0, 7) + '</td><td>' + (items[c].y).substring(0, 7) + '</td><td>' + (items[c].z).substring(0, 7) + '</td><td class=\"text-primary\">' + items[c].activity + '</td></tr> ';\n }\n\n // If we are on the cloud side, retrieve data from AWS.\n if (cloudActivated)\n updateActivity(items[0].activity);\n }\n };\n }", "title": "" }, { "docid": "eada43bbc9e6d835d3854c322d52d74e", "score": "0.5506748", "text": "function getCurrentTime() {\r\n\tvar getDate, getHour, getMinute, getSecond;\r\n\tgetDate = new Date();\t// holds date object\r\n\tgetHour = getDate.getHours();\t// holds hours value\r\n\tgetMinute = getDate.getMinutes();\t// holds minutes value\r\n\tgetSecond = getDate.getSeconds();\t// holds seconds value\r\n\r\n\t// displaying above values for the start point of clock\r\n\tdisplayCurrentTime(\"hour\", getHour);\r\n\tdisplayCurrentTime(\"minute\", getMinute);\r\n\tdisplayCurrentTime(\"second\", getSecond);\r\n}", "title": "" }, { "docid": "974cc9828fc7225a87f1bbf682f259c8", "score": "0.55024606", "text": "function now() {\n const present = moment().hours()\n const time = $('.clock');\n\n time.each(function () {\n const hour = parseInt($(this).attr('id'))\n if (hour === present) {\n $(this).children('.col-sm-8').attr('class', 'present col-sm-8')\n }\n else if (present == hour-1) {\n $(this).children('.col-sm-8').attr('class', 'almost col-sm-8')\n } \n else if (present > hour) {\n $(this).children('.col-sm-8').attr('class', 'past col-sm-8')\n } else {\n $(this).children('.col-sm-8').attr('class', 'future col-sm-8')\n }\n })\n }", "title": "" }, { "docid": "901049e410300ad44367646af4e85b0c", "score": "0.5501451", "text": "function refreshTime() {\n var now = getTime();\n $('#date').html(now.day + ', ' + now.date + '. ' + now.month);\n $('#time').html(\"<span class='hour'>\" + now.hour + \"</span>:\" + \"<span class='minute'>\" + now.minute + \"</span>:\" + \"<span class='second'>\" + now.second + \"</span>\");\n }", "title": "" }, { "docid": "dd02509a2c2ecb32579eb614b537d78f", "score": "0.55008435", "text": "function updateTime() {\n\tvar today = new Date();\n\tsetTime(today);\n\tsetDate(today);\n}", "title": "" }, { "docid": "139109bc5a553bae0c8a63b38fed0d86", "score": "0.54971427", "text": "function setTime()\n{\n if(hour_offset == 0)\n {\n var current_time = new Date();\n time_in_ms = current_time.getTime() - current_time.getSeconds()*1000; //Store current time in ms, to the nearest minute\n }\n\n var hours_back_ms = hour_offset*3600000;\n \n end_date.setTime(time_in_ms-60000-hours_back_ms); //To the nearest minute, at least 1 minute before current time and date \n start_date.setTime(time_in_ms-120000-hours_back_ms); //To the nearest minute, at least 2 minutes before current time and date\n \n //Header string for data files \n file_date_time = start_date.getHours() + \":\"; \n \n if(start_date.getMinutes() < 10)\n var minute = \"0\" + start_date.getMinutes();\n else\n var minute = start_date.getMinutes();\n \n file_date_time = file_date_time + minute + \" \" + start_date.getDate() + \"/\" + (start_date.getMonth()+1) + \"/\" + start_date.getFullYear() + '\\n'; \n \n if(hour_offset == 0)\n clearDataFiles();\n \n else \n {\n op_fs.appendFile(\"build/first_floor_data.txt\", file_date_time, (err) => {\n if (err) throw err;\n \n op_fs.appendFile(\"build/second_floor_data.txt\", file_date_time, (err) => {\n if (err) throw err; \n mongoDB_connect(); //Call to start downloading data from the database\n \n });\n }); \n }\n}", "title": "" }, { "docid": "0c5fa2a1dbb701d25f74ff27b8d1cae8", "score": "0.5496797", "text": "function blockMaker(y) {\n var beginningTime = y;\n var nowTime = moment().hour();\n console.log(nowTime);\n if (parseInt(beginningTime) < nowTime) {\n return 'past';\n }\n else if (nowTime < parseInt(beginningTime)) {\n return 'future';\n }\n else {\n return 'present';\n }\n}", "title": "" }, { "docid": "6394c53400260a47def984e0e179f03b", "score": "0.54937214", "text": "function updateBuzz() {\n // take a javascript time and convert it into a relative time\n function toRelDate(date) {\n // credit? John Resig of course: http://ejohn.org/blog/javascript-pretty-date/\n var diff = (((new Date()).getTime() - new Date(date).getTime()) / 1000),\n day_diff = day_diff = Math.floor(diff / 86400);\n\n\t var txtDiff = day_diff == 0 && (\n\t\t\t diff < 60 && \"just now\" ||\n\t\t\t diff < 120 && \"1 minute ago\" ||\n\t\t\t diff < 3600 && Math.floor( diff / 60 ) + \" minutes ago\" ||\n\t\t\t diff < 7200 && \"1 hour ago\" ||\n\t\t\t diff < 86400 && Math.floor( diff / 3600 ) + \" hours ago\") ||\n\t\t day_diff == 1 && \"Yesterday\" ||\n\t\t day_diff < 7 && day_diff + \" days ago\" ||\n\t\t day_diff < 31 && Math.ceil( day_diff / 7 ) + \" weeks ago\" ||\n\t\t Math.ceil( day_diff / 30 ) + \" months ago\";\n\n return $(\"<div>\").text(txtDiff).addClass(\"posted\");\n }\n\n var linkRegex = /(?:https?:\\/\\/)(?:[\\da-z\\.-]+)\\.(?:[a-z\\.]{2,6})(?:[\\/\\w\\.-]*)*\\/?(?:#[\\w\\d=\\/\\.-]+)?(?:\\?[_\\.=&\\w\\d=;]+)?/g;\n function linkify(msg) {\n // make links clickable\n msg = msg.replace(linkRegex, function (match) {\n return '<a href=\"' + match + '\">' + match + \"</a>\";\n });\n return msg;\n }\n\n $.get('/media/latest.json', function(feed) {\n function createEntry(obj) {\n var n = $(\"<li>\"), c = n;\n if (obj.who) {\n var w = $(\"<a>\").attr('href', \"http://twitter.com/#!/\" + obj.who);\n w.text(\"@\" + obj.who);\n w.appendTo(c);\n }\n var s = $(\"<span>\");\n s.html(linkify(obj.title));\n s.appendTo(c);\n $(\"<br>\").appendTo(c);\n if (obj.link && obj.link.length) {\n c.append($(\"<div>\").addClass(\"readmore\")\n .append($(\"<a>\").attr('href', obj.link).text(\"Read more...\"))\n .append($(\"<span>\").text(\"|\"))\n );\n }\n if (obj.posted) c.append(toRelDate(obj.posted));\n if (obj.when) c.append($(\"<div>\").text(obj.when).addClass(\"date\"));\n return n;\n }\n\n for (var i = 0; i < feed.tweets.length; i++) {\n $(\"#tweets\").append(createEntry(feed.tweets[i]));\n }\n for (var i = 0; i < feed.posts.length; i++) {\n $(\"#blog\").append(createEntry(feed.posts[i]));\n }\n for (var i = 0; i < feed.events.length; i++) {\n $(\"#events\").append(createEntry(feed.events[i]));\n }\n }, \"json\");\n}", "title": "" }, { "docid": "02dab5276925f5f07458f1f221633aac", "score": "0.54932135", "text": "function forecast_date_now(){\n FORECAST_DATE = new Date();\n FORECAST_DATE.setHours(Math.floor(FORECAST_DATE.getHours()/3.0) * 3);\n FORECAST_DATE.setMinutes(0);\n FORECAST_DATE.setSeconds(0);\n}", "title": "" }, { "docid": "ccdc49c45a1fc973734c3923d8ecda74", "score": "0.54914445", "text": "function setTime(){\n\n\n\n }", "title": "" }, { "docid": "496f823a47d6e8b5c647e5e1184d341b", "score": "0.5486742", "text": "function timeUpdate(){\n var currentHour = moment().hours();\n $(\".time-block\").each(function(){\n var hourAsString = $(this).attr(\"id\");// hour-9\n var hour = parseInt(hourAsString.split(\"-\")[1]);\n if(hour < currentHour){\n //set the background to past\n $(this).addClass(\"past\");\n } else if(hour === currentHour){\n //set the background to present \n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n } else{\n //set background to future\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n }\n })\n}", "title": "" }, { "docid": "0623172a74b7759774669d0cb3c9f7f4", "score": "0.54840827", "text": "beat(){\n let hr=generateRandomBetween(60,80);\n console.log(this.owner+' has a heartbeat of: '+hr);\n }", "title": "" }, { "docid": "bf266b4aaed248a829c5d945903f1c1b", "score": "0.5483251", "text": "function timeTracker() {\r\n\r\n var timeNow = moment().hour();\r\n\r\n $(\".time-block\").each(function () {\r\n var id = $(this).attr(\"id\")\r\n var blockTime = timeCoversion(id);\r\n console.log(timeNow);\r\n console.log(blockTime);\r\n if (blockTime < timeNow) {\r\n $(this).addClass(\"past\");\r\n $(this).removeClass(\"future\");\r\n $(this).removeClass(\"present\");\r\n \r\n }\r\n\r\n else if (blockTime === timeNow) {\r\n $(this).removeClass(\"past\");\r\n $(this).removeClass(\"future\");\r\n $(this).addClass(\"present\");\r\n }\r\n\r\n else {\r\n $(this).removeClass(\"past\");\r\n $(this).addClass(\"future\");\r\n $(this).removeClass(\"present\");\r\n }\r\n })\r\n }", "title": "" }, { "docid": "008f000eeb2e78a31c4acb23341f1784", "score": "0.54831266", "text": "function init() {\n var storedEvents = JSON.parse(localStorage.getItem(\"schedule\"));\n if (storedEvents) {\n schedule = storedEvents;\n }\n var collection = $(\".time-block\");\n collection.each(function (index, element) {\n var time = parseInt($(element).attr(\"data-hour\"));\n if (eventHour > time) {\n $(\"[data-hour=\" + time + \"]\").addClass(\"past\");\n } else if (eventHour < time) {\n $(\"[data-hour=\" + time + \"]\").addClass(\"future\");\n } else {\n $(\"[data-hour=\" + time + \"]\").addClass(\"present\");\n }\n })\n\n renderEvents();\n}", "title": "" }, { "docid": "92c0b3ff99c915e6c756df5eb7726460", "score": "0.54821306", "text": "function currentTime() {\r\n var current = moment().hours()\r\n var time = $('.time-block');\r\n//=========================================================\r\n time.each(function () {\r\n//Rounds the time down to the nearest hour (9-17)\r\n var hour = parseInt($(this).attr('id'))\r\n//=========================================================\r\n//Colors the boxes based on the current time, past time, or future time\r\n if (hour === current) {\r\n $(this).children('.col-sm-10').attr('class', 'present col-sm-10 description')\r\n } else if (current > hour) {\r\n $(this).children('.col-sm-10').attr('class', 'past col-sm-10 description')\r\n } else {\r\n $(this).children('.col-sm-10').attr('class', 'future col-sm-10 description')\r\n }\r\n })\r\n }", "title": "" }, { "docid": "6a6b584fbe26a54b1e8359227701447f", "score": "0.54777735", "text": "function answer29() {\n var d = new Date(2015,11,5)\n d.setHours(23,08,16);\n var e = new Date(2015,11,5)\n e.setHours(22,08,16);\n document.write(\"<cente><h1>Current Date :\"+d + \"<BR>\");\n document.write(\"1 hour ago : \" + \"it was \" +e);\n}", "title": "" }, { "docid": "1b15cff5b022b2c1715861f58418e236", "score": "0.54760593", "text": "function updateCurrentScheduleTime() {\n textBlock.removeClass('past present future');\n $.each(textBlock, function (scheduleBlockHour) {\n if (scheduleBlockHour < (currentTime.hour() - 9)) {\n $(this).addClass('past');\n } else if (scheduleBlockHour == (currentTime.hour() - 9)) {\n $(this).addClass('present');\n } else {\n $(this).addClass('future');\n }\n });\n currentHour = currentTime.hour();\n}", "title": "" }, { "docid": "6b751fa6036279b3785c72d33e6465bb", "score": "0.5473816", "text": "function updateTime() {\r\n var today = new Date();\r\n const hour = formatTime(today.getHours());\r\n const minutes = formatTime(today.getMinutes());\r\n const seconds = formatTime(today.getSeconds());\r\n const now = `${hour}:${minutes}:${seconds}`;\r\n\r\n display.innerText=`${hour}:${minutes}:${seconds}`;\r\n \r\n// check if the alarmList includes the current time , \"now\"\r\n// if yes, ringing() is called\r\n if(alarmList.includes(now) ){\r\n ringing(now);\r\n } \r\n}", "title": "" }, { "docid": "da048369d7d56f8d7b753826d5322c2d", "score": "0.5467118", "text": "function initTime(){\n date=new Date();\n hours=date.getHours()%12;\n minutes=date.getMinutes();\n seconds=date.getSeconds();\n }", "title": "" }, { "docid": "ef8a36db3357ee36e73771c43b41b658", "score": "0.54574645", "text": "function maind(){\n startdate = new Date()\n now(startdate.getYear(),startdate.getMonth(),startdate.getDate(),startdate.getHours(),startdate.getMinutes(),startdate.getSeconds())\n }", "title": "" }, { "docid": "cd4086abaf84d4ae234183185ea0da44", "score": "0.5453432", "text": "function hourCheck() {\n var currentTime = moment().hour();\n \n $(\".time-line\").each(function() {\n var hourBlock = parseInt($(this).attr(\"id\").split(\"time\")[1]);\n\n // an if else statement that assigns a css class to the current hour div for correct color code \n if (hourBlock < currentTime) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n }\n else if (hourBlock === currentTime) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n $(this).removeClass(\"future\");\n }\n else {\n $(this).removeClass(\"present\");\n $(this).removeClass(\"past\");\n $(this).addClass(\"future\");\n } \n })\n }", "title": "" }, { "docid": "4014c89064762d7d5fc3374a991291a7", "score": "0.54449147", "text": "function refreshTime(){\n seconds+=1;\n if(Math.floor((seconds/60))!=0){\n minutes+=1;\n seconds%=60;\n }\n if(Math.floor((minutes/60))!=0){\n hours+=1;\n minutes%=60;\n }\n }", "title": "" }, { "docid": "87943f13e520c584441de51390ebae07", "score": "0.544011", "text": "function refresh(){\n const hours = Math.floor(getTime());\n // creates some reference arrays, the index of these array map the values to each other.\n const hourArray = generateHourArray();\n const IdArray = generateIdArray();\n // using the fact that they map, we filter the Idtags based on the current time.\n const pastIds = IdArray.filter(function(element,index,array){\n if(hourArray[index] < hours){\n return element;\n }\n });\n const presentIds = IdArray.filter(function(element,index,array){\n if(hourArray[index] === hours){\n return element;\n };\n });\n const futureIds = IdArray.filter(function(element,index,array){\n if(hourArray[index] > hours){\n return element;\n };\n }); \n // update the colour scheme.\n pastIds.forEach(element => $(element).addClass('past'));\n presentIds.forEach(element => $(element).addClass('present'));\n futureIds.forEach(element => $(element).addClass('future'));\n \n}", "title": "" }, { "docid": "a877bb532c64c96f511f84e9f6a1bd95", "score": "0.5439624", "text": "function presentTime() {\n var currentTime = moment().hours();\n \n $('.time-block').each(function() {\n \n var currentHour = parseInt($(this).attr('id').split('-')[1]);\n \n if(currentHour < currentTime) {\n $(this).addClass('past');\n } else if(currentHour === currentTime) {\n $(this).removeClass('past');\n $(this).removeClass('future');\n $(this).addClass('present'); \n } else {\n $(this).removeClass('past');\n $(this).removeClass('present');\n $(this).addClass('future'); \n }\n });\n }", "title": "" }, { "docid": "dc25a0935b595100589799ec5fd124ef", "score": "0.5437135", "text": "function currentTime() {\n let date = new Date(); /* creating object of Date class */\n let hour = date.getHours();\n let min = date.getMinutes();\n let sec = date.getSeconds();\n\n hour = updateTime(hour);\n min = updateTime(min);\n sec = updateTime(sec);\n document.getElementById(\"clock\").innerText = hour + \" : \" + min + \" : \" + sec; /* adding time to the div */\n let t = setTimeout(currentTime, 1000); /* setting timer */\n}", "title": "" } ]
2fe613651b92276f299f1e7032f71ba1
this method is called when your extension is deactivated
[ { "docid": "378fa3812b7b2ac968d88b3a86b5bf49", "score": "0.0", "text": "function deactivate() {\n}", "title": "" } ]
[ { "docid": "bb3a684af6a41ca010e389aad5b50045", "score": "0.7944248", "text": "function deactivate() {\r\n console.log(\"Preview Extension Shutdown\");\r\n}", "title": "" }, { "docid": "2518ccd965f2591ac3a2c354e9996c8b", "score": "0.76127964", "text": "function deactivate() {\n extension.nbLine = null;\n extension.editor = null;\n extension.deco.clear();\n extension.deco = null;\n cache_manager_1.default.clearCache();\n}", "title": "" }, { "docid": "474657af44c2ca11668b1587d412d2bc", "score": "0.75463456", "text": "function deactivate() {\n // TODO: clean-up\n}", "title": "" }, { "docid": "4a3c143c21cc55de0f914528e7a97335", "score": "0.7541497", "text": "function deactivate() {\r\n exports.output.appendLine(\"Deactivating extension.\");\r\n}", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "b208fe52afd4b7dc16ff8d3fc54b4f6a", "score": "0.7355134", "text": "function deactivate() { }", "title": "" }, { "docid": "084fac2ebc607e9e9d69cd66736a8e71", "score": "0.7355127", "text": "function deactivate() {\n\tconsole.log('^^^^^^^^^^^^^^^^^^^^插件已退出^^^^^^^^^^^^^^^^^^^^^^')\n}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.7342616", "text": "function deactivate() {}", "title": "" } ]
3766ef0e0249d33934769417678a76fb
Performs regex operations on navigator.userAgent when invoked by getUserEnvironmentDetails to extract Browser info (name & version) and OS info (name & version).
[ { "docid": "6d101b3926934ab3a893084fab58a795", "score": "0.0", "text": "function matchItem(string, data) {\n let i = 0;\n let j = 0;\n let regex;\n let regexv;\n let match;\n let matches;\n let version;\n\n for (i = 0; i < data.length; i += 1) {\n regex = new RegExp(data[i].value, 'i');\n match = regex.test(string);\n if (match) {\n regexv = new RegExp(data[i].version + '[- /:;]([\\\\d._]+)', 'i');\n matches = string.match(regexv);\n version = '';\n if (matches) {\n if (matches[1]) {\n matches = matches[1];\n }\n }\n if (matches) {\n matches = matches.split(/[._]+/);\n for (j = 0; j < matches.length; j += 1) {\n if (j === 0) {\n version += matches[j] + '.';\n } else {\n version += matches[j];\n }\n }\n } else {\n version = '0';\n }\n return {\n name: data[i].name,\n version: parseFloat(version)\n };\n }\n }\n return { name: 'unknown', version: 0 };\n }", "title": "" } ]
[ { "docid": "b6700872223ef655600757918cbdb926", "score": "0.75135434", "text": "function userAgent() {\n\n var nVer = navigator.appVersion;\n var nAgt = navigator.userAgent;\n var browserName = navigator.appName;\n var fullVersion = '' + parseFloat(navigator.appVersion);\n var majorVersion = parseInt(navigator.appVersion, 10);\n var nameOffset, verOffset, ix;\n\n // In Opera, the true version is after \"Opera\" or after \"Version\"\n if ((verOffset = nAgt.indexOf(\"OPR\")) != -1) {\n browserName = \"Opera\";\n fullVersion = nAgt.substring(verOffset + 6);\n if ((verOffset = nAgt.indexOf(\"Version\")) != -1)\n fullVersion = nAgt.substring(verOffset + 8);\n }\n // In Firefox, the true version is after \"Firefox\"\n //Firefox must be tested before IE due to change in IE 11\n else if ((verOffset = nAgt.indexOf(\"Firefox\")) != -1) {\n browserName = \"Firefox\";\n fullVersion = nAgt.substring(verOffset + 8);\n }\n // In MSIE <= 10, the true version is after \"MSIE\" in userAgent\n else if ((verOffset = nAgt.indexOf(\"MSIE\")) != -1) {\n browserName = \"Microsoft Internet Explorer\";\n fullVersion = nAgt.substring(verOffset + 5);\n }\n // In MSIE >= 11, the true version is after \"rv:\" in userAgent\n else if ((verOffset = nAgt.indexOf(\"rv:\")) != -1) {\n browserName = \"Microsoft Internet Explorer\";\n //only get the major und 1 minor release number = 4 chars\n fullVersion = nAgt.substring(verOffset + 3, verOffset + 7);\n }\n // In Chrome, the true version is after \"Chrome\"\n else if ((verOffset = nAgt.indexOf(\"Chrome\")) != -1) {\n browserName = \"Chrome\";\n fullVersion = nAgt.substring(verOffset + 7);\n }\n // In Safari, the true version is after \"Safari\" or after \"Version\"\n else if ((verOffset = nAgt.indexOf(\"Safari\")) != -1) {\n browserName = \"Safari\";\n fullVersion = nAgt.substring(verOffset + 7);\n if ((verOffset = nAgt.indexOf(\"Version\")) != -1)\n fullVersion = nAgt.substring(verOffset + 8);\n }\n // In most other browsers, \"name/version\" is at the end of userAgent\n else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf(\n '/'))) {\n browserName = nAgt.substring(nameOffset, verOffset);\n fullVersion = nAgt.substring(verOffset + 1);\n if (browserName.toLowerCase() == browserName.toUpperCase()) {\n browserName = navigator.appName;\n }\n }\n // trim the fullVersion string at semicolon/space if present\n if ((ix = fullVersion.indexOf(\";\")) != -1)\n fullVersion = fullVersion.substring(0, ix);\n if ((ix = fullVersion.indexOf(\" \")) != -1)\n fullVersion = fullVersion.substring(0, ix);\n\n majorVersion = parseInt('' + fullVersion, 10);\n if (isNaN(majorVersion)) {\n fullVersion = '' + parseFloat(navigator.appVersion);\n majorVersion = parseInt(navigator.appVersion, 10);\n }\n\n var OSName = \"Unknown OS\";\n if (navigator.appVersion.indexOf(\"Win\") != -1)\n OSName = \"Windows\";\n if (navigator.appVersion.indexOf(\"Mac\") != -1)\n OSName = \"MacOS\";\n if (navigator.appVersion.indexOf(\"X11\") != -1)\n OSName = \"UNIX\";\n if (navigator.appVersion.indexOf(\"Linux\") != -1)\n OSName = \"Linux\";\n if (navigator.appVersion.indexOf(\"Android\") != -1)\n OSName = \"Android\";\n if (navigator.appVersion.indexOf(\"IOS\") != -1)\n OSName = \"IOS\";\n\n //Raw Browser info:\n // var txt = \"<p>Browser CodeName: \" + navigator.appCodeName + \"</p>\";\n // txt+= \"<p>Browser Name: \" + navigator.appName + \"</p>\";\n // txt+= \"<p>Browser Version: \" + navigator.appVersion + \"</p>\";\n // txt+= \"<p>Browser Language: \" + navigator.language + \"</p>\";\n // txt+= \"<p>Platform: \" + navigator.platform + \"</p>\";\n // txt+= \"<p>User-agent header: \" + navigator.userAgent + \"</p>\";\n // document.getElementById(\"browserInfo\").innerHTML = txt;\n\n return [browserName, fullVersion, OSName];\n}", "title": "" }, { "docid": "fd13fc6ffe2cadcb52f6369cf9321e61", "score": "0.727384", "text": "function getBrowserInfo() {\n var nVer = navigator.appVersion;\n var nAgt = navigator.userAgent;\n var browserName = navigator.appName;\n var fullVersion = '' + parseFloat(navigator.appVersion);\n var majorVersion = parseInt(navigator.appVersion, 10);\n var nameOffset, verOffset, ix;\n\n // both and safri and chrome has same userAgent\n if (isSafari && !isChrome && nAgt.indexOf('CriOS') !== -1) {\n isSafari = false;\n isChrome = true;\n }\n\n // In Opera, the true version is after 'Opera' or after 'Version'\n if (isOpera) {\n browserName = 'Opera';\n try {\n fullVersion = navigator.userAgent.split('OPR/')[1].split(' ')[0];\n majorVersion = fullVersion.split('.')[0];\n } catch (e) {\n fullVersion = '0.0.0.0';\n majorVersion = 0;\n }\n }\n // In MSIE version <=10, the true version is after 'MSIE' in userAgent\n // In IE 11, look for the string after 'rv:'\n else if (isIE) {\n verOffset = nAgt.indexOf('rv:');\n if (verOffset > 0) { //IE 11\n fullVersion = nAgt.substring(verOffset + 3);\n } else { //IE 10 or earlier\n verOffset = nAgt.indexOf('MSIE');\n fullVersion = nAgt.substring(verOffset + 5);\n }\n browserName = 'IE';\n }\n // In Chrome, the true version is after 'Chrome' \n else if (isChrome) {\n verOffset = nAgt.indexOf('Chrome');\n browserName = 'Chrome';\n fullVersion = nAgt.substring(verOffset + 7);\n }\n // In Safari, the true version is after 'Safari' or after 'Version' \n else if (isSafari) {\n verOffset = nAgt.indexOf('Safari');\n\n browserName = 'Safari';\n fullVersion = nAgt.substring(verOffset + 7);\n\n if ((verOffset = nAgt.indexOf('Version')) !== -1) {\n fullVersion = nAgt.substring(verOffset + 8);\n }\n\n if (navigator.userAgent.indexOf('Version/') !== -1) {\n fullVersion = navigator.userAgent.split('Version/')[1].split(' ')[0];\n }\n }\n // In Firefox, the true version is after 'Firefox' \n else if (isFirefox) {\n verOffset = nAgt.indexOf('Firefox');\n browserName = 'Firefox';\n fullVersion = nAgt.substring(verOffset + 8);\n }\n\n // In most other browsers, 'name/version' is at the end of userAgent \n else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) {\n browserName = nAgt.substring(nameOffset, verOffset);\n fullVersion = nAgt.substring(verOffset + 1);\n\n if (browserName.toLowerCase() === browserName.toUpperCase()) {\n browserName = navigator.appName;\n }\n }\n\n if (isEdge) {\n browserName = 'Edge';\n fullVersion = navigator.userAgent.split('Edge/')[1];\n // fullVersion = parseInt(navigator.userAgent.match(/Edge\\/(\\d+).(\\d+)$/)[2], 10).toString();\n }\n\n // trim the fullVersion string at semicolon/space/bracket if present\n if ((ix = fullVersion.search(/[; \\)]/)) !== -1) {\n fullVersion = fullVersion.substring(0, ix);\n }\n\n majorVersion = parseInt('' + fullVersion, 10);\n\n if (isNaN(majorVersion)) {\n fullVersion = '' + parseFloat(navigator.appVersion);\n majorVersion = parseInt(navigator.appVersion, 10);\n }\n\n return {\n fullVersion: fullVersion,\n version: majorVersion,\n name: browserName,\n isPrivateBrowsing: false\n };\n }", "title": "" }, { "docid": "7cf68fbff58b2fb1a57ee98e34d097d0", "score": "0.7031997", "text": "function UAParser (uastring) {\n\n var ua = uastring || window.navigator.userAgent;\n\n // regexp mapper\n var regxMap = function (ua) {\n var result;\n var i, j, k, l;\n for (i = 1; i < arguments.length; i += 2) {\n var regex = arguments[i];\n var props = arguments[i + 1];\n var isMatchFound = false;\n for (j = 0; j < regex.length; j++) {\n var match = regex[j].exec(ua);\n //console.log(match);\n if (!!match) {\n result = {};\n l = 1;\n for (k = 0; k < props.length; k++) {\n if (typeof props[k] === 'object' && props[k].length === 2) {\n result[props[k][0]] = props[k][1];\n l -= 1;\n } else if (typeof props[k] === 'object' && props[k].length === 3) {\n result[props[k][0]] = (!!match[k + l]) ? match[k + l].replace(props[k][1], props[k][2]) : undefined;\n } else {\n result[props[k]] = (!!match[k + l]) ? match[k + l] : undefined;\n }\n }\n isMatchFound = true;\n break;\n }\n }\n if (!isMatchFound) {\n result = {};\n for (k in props) {\n if (props.hasOwnProperty(k)) {\n if (typeof props[k] == 'object') {\n result[props[k][0]] = undefined;\n } else {\n result[props[k]] = undefined;\n }\n }\n }\n } else {\n return result;\n }\n }\n return result;\n };\n\n var mapper = {\n os : { \n win: function (str, match) {\n switch (match.toLowerCase()) {\n case 'nt 5.0':\n return '2000';\n case 'nt 5.1':\n case 'nt 5.2':\n return 'XP';\n case 'nt 6.0':\n return 'Vista';\n case 'nt 6.1':\n return '7';\n case 'nt 6.2':\n return '8';\n default:\n return match;\n };\n }\n }\n };\n\n this.getBrowser = function (uastring) {\n\n return regxMap(uastring || ua, [\n\n // Mixed\n /(kindle)\\/((\\d+)?[\\w\\.]+)/i, // Kindle\n /(lunascape|maxthon|netfront|jasmine)[\\/\\s]?((\\d+)?[\\w\\.]+)/i, // Lunascape/Maxthon/Netfront/Jasmine\n \n // Presto based\n /(opera\\smini)\\/((\\d+)?[\\w\\.-]+)/i, // Opera Mini\n /(opera\\smobi)\\/((\\d+)?[\\w\\.-]+)/i, // Opera Mobile\n /(opera).*\\/((\\d+)?[\\w\\.]+)/i, // Opera\n\n // Trident based\n /(avant\\sbrowser|iemobile|slimbrowser)[\\/\\s]?((\\d+)?[\\w\\.]*)/i, // Avant/IEMobile/SlimBrowser\n /ms(ie)\\s((\\d+)?[\\w\\.]+)/i, // Internet Explorer\n\n // Webkit/KHTML based\n /(chromium|flock|rockmelt|midori|epiphany)\\/((\\d+)?[\\w\\.]+)/i, // Chromium/Flock/RockMelt/Midori/Epiphany\n /(chrome|omniweb|arora|dolfin)\\/((\\d+)?[\\w\\.]+)/i, // Chrome/OmniWeb/Arora/Dolphin\n ], ['name', 'version', 'major'], [\n /android.+crmo\\/((\\d+)?[\\w\\.]+)/i, // Chrome for Android\n ], [['name', 'Chrome'], 'version', 'major'], [\n /(mobile\\ssafari|safari|konqueror)\\/((\\d+)?[\\w\\.]+)/i, // Safari/Konqueror\n /(applewebkit|khtml)\\/((\\d+)?[\\w\\.]+)/i,\n\n // Gecko based\n /(iceweasel|camino|fennec|maemo|minimo)[\\/\\s]?((\\d+)?[\\w\\.\\+]+)/i, // Iceweasel/Camino/Fennec/Maemo/Minimo\n /(firefox|seamonkey|netscape|navigator|k-meleon|icecat|iceape)\\/((\\d+)?[\\w\\.]+)/i,\n // Firefox/SeaMonkey/Netscape/K-Meleon/IceCat/IceApe\n /(mozilla)\\/([\\w\\.]+).+rv\\:.+gecko\\/\\d+/i, // Mozilla\n\n // Other\n /(lynx|dillo|icab)[\\/\\s]?((\\d+)?[\\w\\.]+)/i, // Lynx/Dillo/iCab\n ], ['name', 'version', 'major']); \n };\n\n this.getEngine = function (uastring) {\n\n return regxMap(uastring || ua, [\n\n /(presto)\\/([\\w\\.]+)/i, // Presto\n /([aple]*webkit|trident)\\/([\\w\\.]+)/i, // Webkit/Trident\n /(khtml)\\/([\\w\\.]+)/i // KHTML\n ], ['name', 'version'], [\n\n /rv\\:([\\w\\.]+).*(gecko)/i // Gecko\n ], ['version', 'name']);\n };\n\n this.getOS = function (uastring) { \n\n return regxMap(uastring || ua, [\n\n // Windows based\n /(windows\\sphone\\sos|windows)\\s+([\\w\\.\\s]+)*/i, // Windows\n ], ['name', ['version', /(nt\\s[\\d\\.]+)/gi, mapper.os.win]], [\n\n // Mobile/Embedded OS\n /(blackberry).+version\\/([\\w\\.]+)/i, // Blackberry\n /(android|symbianos|symbos|webos|palm\\os|qnx|bada|rim\\stablet\\sos)[\\/\\s-]?([\\w\\.]+)*/i,\n // Android/Symbian/WebOS/Palm/QNX/Bada/RIM\n /(nintendo|playstation)\\s([wids3portable]+)/i, // Nintendo/Playstation\n\n // GNU/Linux based\n /(mint)[\\/\\s\\(]?(\\w+)*/i, // Mint\n /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\\/\\s-]?([\\w\\.-]+)*/i,\n // Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware\n // Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk\n /(gnu|linux)\\s?([\\w\\.]+)*/i // Other GNU/Linux\n ], ['name', 'version'], [\n\n /cros\\s([\\w\\.\\s]+)/i // Chromium OS\n ], [['name', 'Chromium OS'], 'version'],[\n\n // Solaris\n /sunos\\s?([\\w\\.\\s]+)*/i // Solaris\n ], [['name', 'Solaris'], 'version'], [\n\n // BSD based\n /\\s(\\w*bsd|dragonfly)\\s?([\\w\\.]+)*/i, // FreeBSD/NetBSD/OpenBSD/DragonFly\n ], ['name', 'version'],[\n\n /(ip[honead]+).*os\\s*([\\w]+)*\\slike\\smac/i // iOS\n ], [['name', /.+/g, 'iOS'], ['version', /_/g, '.']], [\n\n /(mac\\sos)\\sx\\s([\\w\\s\\.]+)/i, // Mac OS\n ], ['name', ['version', /_/g, '.']], [\n\n // Other\n /(macintosh|unix|minix|beos)[\\/\\s]?()*/i\n ], ['name', 'version']);\n };\n\n this.getDevice = function (uastring) { \n\n return regxMap(uastring || ua, [\n\n /\\((ip[honead]+|playbook);/i, // iPod/iPhone/iPad/PlayBook\n /(blackberry)[\\s-]?(\\w+)/i, // BlackBerry\n /(blackberry|benq|nokia|palm(?=\\-)|sonyericsson)[\\s-]?([\\w-]+)*/i, // BenQ/Nokia/Palm/Sony-Ericsson\n /(hp)\\s([\\w\\s]+)/i, // HP iPAQ\n /(hp).+(touchpad)/i, // HP TouchPad\n /(kindle)\\/([\\w\\.]+)/i, // Kindle\n /(lg)[e;\\s-]+(\\w+)*/i, // LG\n /(nintendo|playstation)\\s([wids3portable]+)/i // Nintendo/Playstation\n ], ['name', 'version'], [\n \n /(htc)[;_\\s-]+([\\w\\s]+(?=\\))|[\\w]+)*/i, // HTC\n /(zte)-([\\w]+)*/i\n ], ['name', ['version', /_/g, ' ']], [\n \n /\\s(milestone|mz601|droid[2x]?|xoom)[globa\\s]*\\sbuild\\//i, // Motorola\n /mot[\\s-]?(\\w+)*/i\n ], [['name', 'Motorola'], 'version'], [\n \n /(s[cgp]h-\\w+|gt-\\w+|galaxy\\snexus)/i, // Samsung\n /sam[sung]*[\\s-]*(\\w+-?[\\w-]*)*/i,\n /sec-(sgh\\w+)/i\n ], [['name', 'Samsung'], 'version'], [\n\n /sie-(\\w+)*/i // Siemens\n ], [['name', 'Siemens'], 'version']);\n };\n\n this.setUA = function (uastring) {\n ua = uastring || ua;\n return this.result = {\n browser : this.getBrowser(),\n engine : this.getEngine(),\n os : this.getOS(),\n device : this.getDevice()\n };\n };\n\n this.setUA(ua);\n}", "title": "" }, { "docid": "602baf1a1428f773b1dfd8467740c002", "score": "0.6897528", "text": "function browserSniff() {\n var nVer = navigator.appVersion,\n nAgt = navigator.userAgent,\n browserName = navigator.appName,\n fullVersion = '' + parseFloat(navigator.appVersion),\n majorVersion = parseInt(navigator.appVersion, 10),\n nameOffset,\n verOffset,\n ix;\n\n // MSIE 11\n if (navigator.appVersion.indexOf(\"Windows NT\") !== -1 && navigator.appVersion.indexOf(\"rv:11\") !== -1) {\n browserName = \"IE\";\n fullVersion = \"11;\";\n }\n // MSIE\n else if ((verOffset = nAgt.indexOf(\"MSIE\")) !== -1) {\n browserName = \"IE\";\n fullVersion = nAgt.substring(verOffset + 5);\n }\n // Chrome\n else if ((verOffset = nAgt.indexOf(\"Chrome\")) !== -1) {\n browserName = \"Chrome\";\n fullVersion = nAgt.substring(verOffset + 7);\n }\n // Safari\n else if ((verOffset = nAgt.indexOf(\"Safari\")) !== -1) {\n browserName = \"Safari\";\n fullVersion = nAgt.substring(verOffset + 7);\n if ((verOffset = nAgt.indexOf(\"Version\")) !== -1) {\n fullVersion = nAgt.substring(verOffset + 8);\n }\n }\n // Firefox\n else if ((verOffset = nAgt.indexOf(\"Firefox\")) !== -1) {\n browserName = \"Firefox\";\n fullVersion = nAgt.substring(verOffset + 8);\n }\n // In most other browsers, \"name/version\" is at the end of userAgent\n else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) {\n browserName = nAgt.substring(nameOffset, verOffset);\n fullVersion = nAgt.substring(verOffset + 1);\n if (browserName.toLowerCase() == browserName.toUpperCase()) {\n browserName = navigator.appName;\n }\n }\n // Trim the fullVersion string at semicolon/space if present\n if ((ix = fullVersion.indexOf(\";\")) !== -1) {\n fullVersion = fullVersion.substring(0, ix);\n }\n if ((ix = fullVersion.indexOf(\" \")) !== -1) {\n fullVersion = fullVersion.substring(0, ix);\n }\n // Get major version\n majorVersion = parseInt('' + fullVersion, 10);\n if (isNaN(majorVersion)) {\n fullVersion = '' + parseFloat(navigator.appVersion);\n majorVersion = parseInt(navigator.appVersion, 10);\n }\n // Return data\n return [browserName, majorVersion];\n}", "title": "" }, { "docid": "611919771c3c9a2c61f23857cf63c31c", "score": "0.686413", "text": "function getBrowserInfo() {\n let mobile = /(Mobile|Android|iPhone|iPad)/.test(navigator.userAgent);\n let browsers = {\n IE: false,\n edge: false,\n chrome: false,\n firefox: false,\n safari: false,\n mobile,\n };\n // NOTE: The order matters here!\n let browserPatterns = [\n { key: \"edge\", pattern: /Edge(?:\\W+(\\d+)\\.(\\d+)(?:\\.(\\d+))?)?/ },\n { key: \"IE\", pattern: /MSIE(?:\\W+(\\d+)\\.(\\d+)(?:\\.(\\d+))?)?/ },\n { key: \"IE\", pattern: /Trident(?:.*rv\\:(\\d+)\\.(\\d+)(?:\\.(\\d+))?)?/ },\n { key: \"chrome\", pattern: /Chrome(?:\\W+(\\d+)\\.(\\d+)(?:\\.(\\d+))?)?/ },\n { key: \"firefox\", pattern: /Firefox(?:\\W+(\\d+)\\.(\\d+)(?:\\.(\\d+))?)?/ },\n { key: \"safari\", pattern: /(?:Version\\W+(\\d+)\\.(\\d+)(?:\\.(\\d+))?)?(?:\\W+Mobile\\S*)?\\W+Safari/ },\n ];\n // Find the FIRST matching browser\n for (let { key, pattern } of browserPatterns) {\n let match = pattern.exec(navigator.userAgent);\n if (match) {\n let major = parseInt(match[1], 10) || 0;\n let minor = parseInt(match[2], 10) || 0;\n let patch = parseInt(match[3], 10) || 0;\n browsers[key] = {\n version: parseFloat(`${major}.${minor}`),\n majorVersion: major,\n minorVersion: minor,\n patchVersion: patch,\n [`v${major}`]: true,\n mobile,\n };\n break;\n }\n }\n return browsers;\n}", "title": "" }, { "docid": "bab1238e416a5eacd2aef3e5e6837e64", "score": "0.6861319", "text": "function browserSniff() {\n\t\tvar nVer = navigator.appVersion,\n\t\t\tnAgt = navigator.userAgent,\n\t\t\tbrowserName = navigator.appName,\n\t\t\tfullVersion = ''+parseFloat(navigator.appVersion),\n\t\t\tmajorVersion = parseInt(navigator.appVersion,10),\n\t\t\tnameOffset,\n\t\t\tverOffset,\n\t\t\tix;\n\n\t\t// MSIE 11\n\t\tif ((navigator.appVersion.indexOf(\"Windows NT\") !== -1) && (navigator.appVersion.indexOf(\"rv:11\") !== -1)) {\n\t\t\tbrowserName = \"IE\";\n\t\t\tfullVersion = \"11;\";\n\t\t}\n\t\t// MSIE\n\t\telse if ((verOffset=nAgt.indexOf(\"MSIE\")) !== -1) {\n\t\t\tbrowserName = \"IE\";\n\t\t\tfullVersion = nAgt.substring(verOffset+5);\n\t\t}\n\t\t// Chrome\n\t\telse if ((verOffset=nAgt.indexOf(\"Chrome\")) !== -1) {\n\t\t\tbrowserName = \"Chrome\";\n\t\t\tfullVersion = nAgt.substring(verOffset+7);\n\t\t}\n\t\t// Safari\n\t\telse if ((verOffset=nAgt.indexOf(\"Safari\")) !== -1) {\n\t\t\tbrowserName = \"Safari\";\n\t\t\tfullVersion = nAgt.substring(verOffset+7);\n\t\t\tif ((verOffset=nAgt.indexOf(\"Version\")) !== -1) {\n\t\t\t\tfullVersion = nAgt.substring(verOffset+8);\n\t\t\t}\n\t\t}\n\t\t// Firefox\n\t\telse if ((verOffset=nAgt.indexOf(\"Firefox\")) !== -1) {\n\t\t\tbrowserName = \"Firefox\";\n\t\t\tfullVersion = nAgt.substring(verOffset+8);\n\t\t}\n\t\t// In most other browsers, \"name/version\" is at the end of userAgent\n\t\telse if ( (nameOffset=nAgt.lastIndexOf(' ')+1) < (verOffset=nAgt.lastIndexOf('/')) ) {\n\t\t\tbrowserName = nAgt.substring(nameOffset,verOffset);\n\t\t\tfullVersion = nAgt.substring(verOffset+1);\n\t\t\tif (browserName.toLowerCase()==browserName.toUpperCase()) {\n\t\t\t\tbrowserName = navigator.appName;\n\t\t\t}\n\t\t}\n\t\t// Trim the fullVersion string at semicolon/space if present\n\t\tif ((ix=fullVersion.indexOf(\";\")) !== -1) {\n\t\t\tfullVersion=fullVersion.substring(0,ix);\n\t\t}\n\t\tif ((ix=fullVersion.indexOf(\" \")) !== -1) {\n\t\t\tfullVersion=fullVersion.substring(0,ix);\n\t\t}\n\t\t// Get major version\n\t\tmajorVersion = parseInt(''+fullVersion,10);\n\t\tif (isNaN(majorVersion)) {\n\t\t\tfullVersion = ''+parseFloat(navigator.appVersion);\n\t\t\tmajorVersion = parseInt(navigator.appVersion,10);\n\t\t}\n\t\t// Return data\n\t\treturn [browserName, majorVersion];\n\t}", "title": "" }, { "docid": "e25161ead2c231cd1320f8153868bb28", "score": "0.6844327", "text": "function getBrowserInfo() {\n var ua = navigator.userAgent;\n var M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n var tem = void 0;\n\n if (/trident/i.test(M[1])) {\n tem = /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n\n return 'IE ' + (tem[1] || '');\n }\n\n if (M[1] === 'Chrome') {\n tem = ua.match(/\\b(OPR|Edge)\\/(\\d+)/);\n if (tem !== null) {\n return tem.slice(1).join(' ').replace('OPR', 'Opera');\n }\n }\n\n M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?'];\n if ((tem = ua.match(/version\\/(\\d+)/i)) !== null) {\n M.splice(1, 1, tem[1]);\n }\n\n return M.join(' ');\n}", "title": "" }, { "docid": "e00f5e42c782a551147db8b00cb49c00", "score": "0.6839229", "text": "function _browserSniff() {\n var ua = navigator.userAgent,\n name = navigator.appName,\n fullVersion = '' + parseFloat(navigator.appVersion),\n majorVersion = parseInt(navigator.appVersion, 10),\n nameOffset,\n verOffset,\n ix,\n isIE = false,\n isFirefox = false,\n isChrome = false,\n isSafari = false;\n\n if ((navigator.appVersion.indexOf('Windows NT') !== -1) && (navigator.appVersion.indexOf('rv:11') !== -1)) {\n // MSIE 11\n isIE = true;\n name = 'IE';\n fullVersion = '11';\n } else if ((verOffset = ua.indexOf('MSIE')) !== -1) {\n // MSIE\n isIE = true;\n name = 'IE';\n fullVersion = ua.substring(verOffset + 5);\n } else if ((verOffset = ua.indexOf('Chrome')) !== -1) {\n // Chrome\n isChrome = true;\n name = 'Chrome';\n fullVersion = ua.substring(verOffset + 7);\n } else if ((verOffset = ua.indexOf('Safari')) !== -1) {\n // Safari\n isSafari = true;\n name = 'Safari';\n fullVersion = ua.substring(verOffset + 7);\n if ((verOffset = ua.indexOf('Version')) !== -1) {\n fullVersion = ua.substring(verOffset + 8);\n }\n } else if ((verOffset = ua.indexOf('Firefox')) !== -1) {\n // Firefox\n isFirefox = true;\n name = 'Firefox';\n fullVersion = ua.substring(verOffset + 8);\n } else if ((nameOffset = ua.lastIndexOf(' ') + 1) < (verOffset = ua.lastIndexOf('/'))) {\n // In most other browsers, 'name/version' is at the end of userAgent\n name = ua.substring(nameOffset,verOffset);\n fullVersion = ua.substring(verOffset + 1);\n\n if (name.toLowerCase() === name.toUpperCase()) {\n name = navigator.appName;\n }\n }\n\n // Trim the fullVersion string at semicolon/space if present\n if ((ix = fullVersion.indexOf(';')) !== -1) {\n fullVersion = fullVersion.substring(0, ix);\n }\n if ((ix = fullVersion.indexOf(' ')) !== -1) {\n fullVersion = fullVersion.substring(0, ix);\n }\n\n // Get major version\n majorVersion = parseInt('' + fullVersion, 10);\n if (isNaN(majorVersion)) {\n fullVersion = '' + parseFloat(navigator.appVersion);\n majorVersion = parseInt(navigator.appVersion, 10);\n }\n\n // Return data\n return {\n name: name,\n version: majorVersion,\n isIE: isIE,\n isFirefox: isFirefox,\n isChrome: isChrome,\n isSafari: isSafari,\n isIos: /(iPad|iPhone|iPod)/g.test(navigator.platform),\n isIphone: /(iPhone|iPod)/g.test(navigator.userAgent),\n isTouch: 'ontouchstart' in document.documentElement\n };\n }", "title": "" }, { "docid": "e00f5e42c782a551147db8b00cb49c00", "score": "0.6839229", "text": "function _browserSniff() {\n var ua = navigator.userAgent,\n name = navigator.appName,\n fullVersion = '' + parseFloat(navigator.appVersion),\n majorVersion = parseInt(navigator.appVersion, 10),\n nameOffset,\n verOffset,\n ix,\n isIE = false,\n isFirefox = false,\n isChrome = false,\n isSafari = false;\n\n if ((navigator.appVersion.indexOf('Windows NT') !== -1) && (navigator.appVersion.indexOf('rv:11') !== -1)) {\n // MSIE 11\n isIE = true;\n name = 'IE';\n fullVersion = '11';\n } else if ((verOffset = ua.indexOf('MSIE')) !== -1) {\n // MSIE\n isIE = true;\n name = 'IE';\n fullVersion = ua.substring(verOffset + 5);\n } else if ((verOffset = ua.indexOf('Chrome')) !== -1) {\n // Chrome\n isChrome = true;\n name = 'Chrome';\n fullVersion = ua.substring(verOffset + 7);\n } else if ((verOffset = ua.indexOf('Safari')) !== -1) {\n // Safari\n isSafari = true;\n name = 'Safari';\n fullVersion = ua.substring(verOffset + 7);\n if ((verOffset = ua.indexOf('Version')) !== -1) {\n fullVersion = ua.substring(verOffset + 8);\n }\n } else if ((verOffset = ua.indexOf('Firefox')) !== -1) {\n // Firefox\n isFirefox = true;\n name = 'Firefox';\n fullVersion = ua.substring(verOffset + 8);\n } else if ((nameOffset = ua.lastIndexOf(' ') + 1) < (verOffset = ua.lastIndexOf('/'))) {\n // In most other browsers, 'name/version' is at the end of userAgent\n name = ua.substring(nameOffset,verOffset);\n fullVersion = ua.substring(verOffset + 1);\n\n if (name.toLowerCase() === name.toUpperCase()) {\n name = navigator.appName;\n }\n }\n\n // Trim the fullVersion string at semicolon/space if present\n if ((ix = fullVersion.indexOf(';')) !== -1) {\n fullVersion = fullVersion.substring(0, ix);\n }\n if ((ix = fullVersion.indexOf(' ')) !== -1) {\n fullVersion = fullVersion.substring(0, ix);\n }\n\n // Get major version\n majorVersion = parseInt('' + fullVersion, 10);\n if (isNaN(majorVersion)) {\n fullVersion = '' + parseFloat(navigator.appVersion);\n majorVersion = parseInt(navigator.appVersion, 10);\n }\n\n // Return data\n return {\n name: name,\n version: majorVersion,\n isIE: isIE,\n isFirefox: isFirefox,\n isChrome: isChrome,\n isSafari: isSafari,\n isIos: /(iPad|iPhone|iPod)/g.test(navigator.platform),\n isIphone: /(iPhone|iPod)/g.test(navigator.userAgent),\n isTouch: 'ontouchstart' in document.documentElement\n };\n }", "title": "" }, { "docid": "487e971cff968aa8fc759602740e2bd5", "score": "0.6773126", "text": "function get_browser_info (){\r\n\t\tvar ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || []; \r\n\t\tif(/trident/i.test(M[1])){\r\n\t\t\ttem=/\\brv[ :]+(\\d+)/g.exec(ua) || []; \r\n\t\t\treturn {name:'IE',version:(tem[1]||'')};\r\n\t\t} \r\n\t\tif(M[1]==='Chrome'){\r\n\t\t\ttem=ua.match(/\\bOPR\\/(\\d+)/)\r\n\t\t\tif(tem!=null) {return {name:'Opera', version:tem[1]};}\r\n\t\t} \r\n\t\tM=M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];\r\n\t\tif((tem=ua.match(/version\\/(\\d+)/i))!=null) {M.splice(1,1,tem[1]);}\r\n\t\treturn {\r\n\t\t name: M[0],\r\n\t\t version: M[1]\r\n\t\t};\t\t\r\n\t}", "title": "" }, { "docid": "68c419b7f8aa4a39bba2a6ebcb87934a", "score": "0.6731412", "text": "function fingerprint_browser() {\n var userAgent, name, version;\n try {\n userAgent = navigator.userAgent.toLowerCase(), /msie (\\d+\\.\\d+);/.test(userAgent) ? (//test for MSIE x.x;\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n userAgent.indexOf(\"trident/6\") > -1 && (version = 10), userAgent.indexOf(\"trident/5\") > -1 && (version = 9), \n userAgent.indexOf(\"trident/4\") > -1 && (version = 8), name = \"Internet Explorer\") : userAgent.indexOf(\"trident/7\") > -1 ? (//IE 11+ gets rid of the legacy 'MSIE' in the user-agent string;\n version = 11, name = \"Internet Explorer\") : /edge[\\/\\s](\\d+\\.\\d+)/.test(userAgent) ? (//test for Firefox/x.x or Firefox x.x (ignoring remaining digits);\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Edge\") : /firefox[\\/\\s](\\d+\\.\\d+)/.test(userAgent) ? (//test for Firefox/x.x or Firefox x.x (ignoring remaining digits);\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Firefox\") : /opera[\\/\\s](\\d+\\.\\d+)/.test(userAgent) ? (//test for Opera/x.x or Opera x.x (ignoring remaining decimal places);\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Opera\") : /chrome[\\/\\s](\\d+\\.\\d+)/.test(userAgent) ? (//test for Chrome/x.x or Chrome x.x (ignoring remaining digits);\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Chrome\") : /version[\\/\\s](\\d+\\.\\d+)/.test(userAgent) ? (//test for Version/x.x or Version x.x (ignoring remaining digits);\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Safari\") : /rv[\\/\\s](\\d+\\.\\d+)/.test(userAgent) ? (//test for rv/x.x or rv x.x (ignoring remaining digits);\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Mozilla\") : /mozilla[\\/\\s](\\d+\\.\\d+)/.test(userAgent) ? (//test for Mozilla/x.x or Mozilla x.x (ignoring remaining digits);\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Mozilla\") : /binget[\\/\\s](\\d+\\.\\d+)/.test(userAgent) ? (//test for BinGet/x.x or BinGet x.x (ignoring remaining digits);\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Library (BinGet)\") : /curl[\\/\\s](\\d+\\.\\d+)/.test(userAgent) ? (//test for Curl/x.x or Curl x.x (ignoring remaining digits);\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Library (cURL)\") : /java[\\/\\s](\\d+\\.\\d+)/.test(userAgent) ? (//test for Java/x.x or Java x.x (ignoring remaining digits);\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Library (Java)\") : /libwww-perl[\\/\\s](\\d+\\.\\d+)/.test(userAgent) ? (//test for libwww-perl/x.x or libwww-perl x.x (ignoring remaining digits);\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Library (libwww-perl)\") : /microsoft url control -[\\s](\\d+\\.\\d+)/.test(userAgent) ? (//test for Microsoft URL Control - x.x (ignoring remaining digits);\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Library (Microsoft URL Control)\") : /peach[\\/\\s](\\d+\\.\\d+)/.test(userAgent) ? (//test for Peach/x.x or Peach x.x (ignoring remaining digits);\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Library (Peach)\") : /php[\\/\\s](\\d+\\.\\d+)/.test(userAgent) ? (//test for PHP/x.x or PHP x.x (ignoring remaining digits);\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Library (PHP)\") : /pxyscand[\\/\\s](\\d+\\.\\d+)/.test(userAgent) ? (//test for pxyscand/x.x or pxyscand x.x (ignoring remaining digits);\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Library (pxyscand)\") : /pycurl[\\/\\s](\\d+\\.\\d+)/.test(userAgent) ? (//test for pycurl/x.x or pycurl x.x (ignoring remaining digits);\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Library (PycURL)\") : /python-urllib[\\/\\s](\\d+\\.\\d+)/.test(userAgent) ? (//test for python-urllib/x.x or python-urllib x.x (ignoring remaining digits);\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Library (Python URLlib)\") : /appengine-google/.test(userAgent) ? (//test for AppEngine-Google;\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Cloud (Google AppEngine)\") : /trident/.test(userAgent) ? (//test for Trident;\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Trident\") : /adventurer/.test(userAgent) ? (//test for Orange Adventurer;\n version = Number(RegExp.$1), // capture x.x portion and store as a number\n name = \"Adventurer\") : (version = \"unknown\", name = \"unknown\");\n } catch (err) {\n name = \"error\", version = \"error\";\n }\n return {\n name: name.replace(/\\s+/g, \"\"),\n version: version\n };\n }", "title": "" }, { "docid": "b33383fc1e582013709d3ccf2f331cdc", "score": "0.67056435", "text": "function _getBrowserInfo()\n {\n //detect IE\n var ie_str = _r.isIE();\n\n if (!ie_str)\n {\n //not IE\n\n /*jshint -W116 */\n var ua_str = rScript.getUserAgent(),\n tem,\n M = ua_str.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || []\n ;\n if(M[1]==='chrome')\n {\n tem = ua_str.match(/\\bOPR\\/(\\d+)/i);\n\n if(tem!=null)\n {\n return {name:'opera', version:tem[1]};\n }\n }\n\n M = M[2] ? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];\n if((tem = ua_str.match(/version\\/(\\d+)/i))!=null)\n {\n M.splice(1,1,tem[1]);\n }\n return {\n name: M[0],\n version: M[1]\n };\n /*jshint +W116 */\n }\n else\n {\n //is IE\n return {\n name: 'ie',\n version: ''+ie_str+''\n };\n }\n }", "title": "" }, { "docid": "339e637af66968cc3dfdffe92e4e5918", "score": "0.66699183", "text": "function userInfo () {\n var browser,\n os,\n version,\n string,\n ua = window.navigator.userAgent,\n platform = window.navigator.platform,\n\n info = function () {\n if ( /MSIE/.test(ua) ) {\n browser = 'Internet Explorer';\n if ( /IEMobile/.test(ua) ) {\n browser += ' Mobile';\n }\n version = /MSIE \\d+[.]\\d+/.exec(ua)[0].split(' ')[1]; \n } else if ( /Chrome/.test(ua) ) {\n browser = 'Chrome';\n version = /Chrome\\/[\\d\\.]+/.exec(ua)[0].split('/')[1];\n } else if ( /Opera/.test(ua) ) {\n browser = 'Opera';\n if ( /mini/.test(ua) ) {\n browser += ' Mini';\n } else if ( /Mobile/.test(ua) ) {\n browser += ' Mobile';\n } \n } else if ( /Android/.test(ua) ) {\n browser = 'Android Webkit Browser';\n mobile = true;\n os = /Android\\s[\\.\\d]+/.exec(ua);\n } else if ( /Firefox/.test(ua) ) {\n browser = 'Firefox';\n if ( /Fennec/.test(ua) ) {\n browser += ' Mobile';\n }\n version = /Firefox\\/[\\.\\d]+/.exec(ua)[0].split('/')[1];\n } else if ( /Safari/.test(ua) ) {\n browser = 'Safari';\n if ( (/iPhone/.test(ua)) || (/iPad/.test(ua)) || (/iPod/.test(ua)) ) {\n os = 'iOS';\n }\n }\n\n if ( !version ) {\n version = /Version\\/[\\.\\d]+/.exec(ua);\n if (version) {\n version = version[0].split('/')[1];\n } else {\n version = /Opera\\/[\\.\\d]+/.exec(ua)[0].split('/')[1]\n }\n }\n \n if ( platform === 'MacIntel' || platform === 'MacPPC' ) {\n os = 'Mac OS X ' + /10[\\.\\_\\d]+/.exec(ua)[0];\n if ( /[\\_]/.test(os) ) {\n os = os.split('_').join('.');\n }\n } else if ( platform === 'Win32' ) {\n os = 'Windows 32 bit';\n } else if ( platform == 'Win64' ) {\n os = 'Windows 64 bit';\n } else if ( !os && /Linux/.test(platform) ) {\n os = 'Linux';\n }\n \n if ( !os && /Windows/.test(ua) ) {\n os = 'Windows';\n }\n \n }();\n return {\n browser : browser,\n version : version,\n os : os\n }; \n}", "title": "" }, { "docid": "779e1a20680aafb479ce8097a15391f6", "score": "0.6668852", "text": "function browserCheck()\n{\n var N= navigator.appName, ua= navigator.userAgent, tem;\n var M= ua.match(/(opera|chrome|safari|firefox|msie|trident)\\/?\\s*(\\.?\\d+(\\.\\d+)*)/i);\n if(M && (tem= ua.match(/version\\/([\\.\\d]+)/i))!= null) {M[2]=tem[1];}\n M= M? [M[1], M[2]]: [N, navigator.appVersion,'-?'];\n return M;\n}", "title": "" }, { "docid": "eec66b542dd41da2cf961b8be3f96927", "score": "0.66050136", "text": "function getBrowserInfo() {\n\tif (checkIt('konqueror')) {\n\t\tbrowser = \"Konqueror\";\n\t\tOS = \"Linux\";\n\t}\n\telse if (checkIt('safari')) browser \t= \"Safari\"\n\telse if (checkIt('omniweb')) browser \t= \"OmniWeb\"\n\telse if (checkIt('opera')) browser \t\t= \"Opera\"\n\telse if (checkIt('webtv')) browser \t\t= \"WebTV\";\n\telse if (checkIt('icab')) browser \t\t= \"iCab\"\n\telse if (checkIt('msie')) browser \t\t= \"Internet Explorer\"\n\telse if (!checkIt('compatible')) {\n\t\tbrowser = \"Netscape Navigator\"\n\t\tversion = detect.charAt(8);\n\t}\n\telse browser = \"An unknown browser\";\n\n\tif (!version) version = detect.charAt(place + thestring.length);\n\n\tif (!OS) {\n\t\tif (checkIt('linux')) OS \t\t= \"Linux\";\n\t\telse if (checkIt('x11')) OS \t= \"Unix\";\n\t\telse if (checkIt('mac')) OS \t= \"Mac\"\n\t\telse if (checkIt('win')) OS \t= \"Windows\"\n\t\telse OS \t\t\t\t\t\t\t\t= \"an unknown operating system\";\n\t}\n}", "title": "" }, { "docid": "eec66b542dd41da2cf961b8be3f96927", "score": "0.66050136", "text": "function getBrowserInfo() {\n\tif (checkIt('konqueror')) {\n\t\tbrowser = \"Konqueror\";\n\t\tOS = \"Linux\";\n\t}\n\telse if (checkIt('safari')) browser \t= \"Safari\"\n\telse if (checkIt('omniweb')) browser \t= \"OmniWeb\"\n\telse if (checkIt('opera')) browser \t\t= \"Opera\"\n\telse if (checkIt('webtv')) browser \t\t= \"WebTV\";\n\telse if (checkIt('icab')) browser \t\t= \"iCab\"\n\telse if (checkIt('msie')) browser \t\t= \"Internet Explorer\"\n\telse if (!checkIt('compatible')) {\n\t\tbrowser = \"Netscape Navigator\"\n\t\tversion = detect.charAt(8);\n\t}\n\telse browser = \"An unknown browser\";\n\n\tif (!version) version = detect.charAt(place + thestring.length);\n\n\tif (!OS) {\n\t\tif (checkIt('linux')) OS \t\t= \"Linux\";\n\t\telse if (checkIt('x11')) OS \t= \"Unix\";\n\t\telse if (checkIt('mac')) OS \t= \"Mac\"\n\t\telse if (checkIt('win')) OS \t= \"Windows\"\n\t\telse OS \t\t\t\t\t\t\t\t= \"an unknown operating system\";\n\t}\n}", "title": "" }, { "docid": "eec66b542dd41da2cf961b8be3f96927", "score": "0.66050136", "text": "function getBrowserInfo() {\n\tif (checkIt('konqueror')) {\n\t\tbrowser = \"Konqueror\";\n\t\tOS = \"Linux\";\n\t}\n\telse if (checkIt('safari')) browser \t= \"Safari\"\n\telse if (checkIt('omniweb')) browser \t= \"OmniWeb\"\n\telse if (checkIt('opera')) browser \t\t= \"Opera\"\n\telse if (checkIt('webtv')) browser \t\t= \"WebTV\";\n\telse if (checkIt('icab')) browser \t\t= \"iCab\"\n\telse if (checkIt('msie')) browser \t\t= \"Internet Explorer\"\n\telse if (!checkIt('compatible')) {\n\t\tbrowser = \"Netscape Navigator\"\n\t\tversion = detect.charAt(8);\n\t}\n\telse browser = \"An unknown browser\";\n\n\tif (!version) version = detect.charAt(place + thestring.length);\n\n\tif (!OS) {\n\t\tif (checkIt('linux')) OS \t\t= \"Linux\";\n\t\telse if (checkIt('x11')) OS \t= \"Unix\";\n\t\telse if (checkIt('mac')) OS \t= \"Mac\"\n\t\telse if (checkIt('win')) OS \t= \"Windows\"\n\t\telse OS \t\t\t\t\t\t\t\t= \"an unknown operating system\";\n\t}\n}", "title": "" }, { "docid": "47f725f49578e11957eb56ccb1583e3e", "score": "0.6528729", "text": "function getOSInfo() {\n let osInfo = {\n windows: false,\n mac: false,\n linux: false,\n };\n // NOTE: The order matters here!\n let osPatterns = [\n { key: \"mac\", pattern: /(Mac OS|Macintosh|iPhone|iPad)/ },\n { key: \"windows\", pattern: /(Windows NT|Windows Phone)/ },\n { key: \"linux\", pattern: /(Linux|Android)/ },\n ];\n // Find the FIRST matching OS pattern\n for (let { key, pattern } of osPatterns) {\n let match = pattern.exec(navigator.userAgent);\n if (match) {\n // We found the OS, so mark it as `true` and leave all the others `false`\n osInfo[key] = true;\n break;\n }\n }\n return osInfo;\n}", "title": "" }, { "docid": "d6360c279e435ebd3c67f90535593d75", "score": "0.65013415", "text": "function detect(ua) {\n var os = {};\n var browser = {};\n // var webkit = ua.match(/Web[kK]it[\\/]{0,1}([\\d.]+)/);\n // var android = ua.match(/(Android);?[\\s\\/]+([\\d.]+)?/);\n // var ipad = ua.match(/(iPad).*OS\\s([\\d_]+)/);\n // var ipod = ua.match(/(iPod)(.*OS\\s([\\d_]+))?/);\n // var iphone = !ipad && ua.match(/(iPhone\\sOS)\\s([\\d_]+)/);\n // var webos = ua.match(/(webOS|hpwOS)[\\s\\/]([\\d.]+)/);\n // var touchpad = webos && ua.match(/TouchPad/);\n // var kindle = ua.match(/Kindle\\/([\\d.]+)/);\n // var silk = ua.match(/Silk\\/([\\d._]+)/);\n // var blackberry = ua.match(/(BlackBerry).*Version\\/([\\d.]+)/);\n // var bb10 = ua.match(/(BB10).*Version\\/([\\d.]+)/);\n // var rimtabletos = ua.match(/(RIM\\sTablet\\sOS)\\s([\\d.]+)/);\n // var playbook = ua.match(/PlayBook/);\n // var chrome = ua.match(/Chrome\\/([\\d.]+)/) || ua.match(/CriOS\\/([\\d.]+)/);\n var firefox = ua.match(/Firefox\\/([\\d.]+)/);\n // var safari = webkit && ua.match(/Mobile\\//) && !chrome;\n // var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome;\n var ie = ua.match(/MSIE\\s([\\d.]+)/)\n // IE 11 Trident/7.0; rv:11.0\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\n var edge = ua.match(/Edge\\/([\\d.]+)/); // IE 12 and 12+\n\n var weChat = (/micromessenger/i).test(ua);\n\n // Todo: clean this up with a better OS/browser seperation:\n // - discern (more) between multiple browsers on android\n // - decide if kindle fire in silk mode is android or not\n // - Firefox on Android doesn't specify the Android version\n // - possibly devide in os, device and browser hashes\n\n // if (browser.webkit = !!webkit) browser.version = webkit[1];\n\n // if (android) os.android = true, os.version = android[2];\n // if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.');\n // if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.');\n // if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;\n // if (webos) os.webos = true, os.version = webos[2];\n // if (touchpad) os.touchpad = true;\n // if (blackberry) os.blackberry = true, os.version = blackberry[2];\n // if (bb10) os.bb10 = true, os.version = bb10[2];\n // if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2];\n // if (playbook) browser.playbook = true;\n // if (kindle) os.kindle = true, os.version = kindle[1];\n // if (silk) browser.silk = true, browser.version = silk[1];\n // if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true;\n // if (chrome) browser.chrome = true, browser.version = chrome[1];\n if (firefox) {\n browser.firefox = true;\n browser.version = firefox[1];\n }\n // if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true;\n // if (webview) browser.webview = true;\n\n if (ie) {\n browser.ie = true;\n browser.version = ie[1];\n }\n\n if (edge) {\n browser.edge = true;\n browser.version = edge[1];\n }\n\n // It is difficult to detect WeChat in Win Phone precisely, because ua can\n // not be set on win phone. So we do not consider Win Phone.\n if (weChat) {\n browser.weChat = true;\n }\n\n // os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) ||\n // (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/)));\n // os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos ||\n // (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\\/([\\d.]+)/)) ||\n // (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/))));\n\n return {\n browser: browser,\n os: os,\n node: false,\n // 原生canvas支持,改极端点了\n // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9)\n canvasSupported: !!document.createElement('canvas').getContext,\n svgSupported: typeof SVGRect !== 'undefined',\n // @see <http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript>\n // works on most browsers\n // IE10/11 does not support touch event, and MS Edge supports them but not by\n // default, so we dont check navigator.maxTouchPoints for them here.\n touchEventsSupported: 'ontouchstart' in window && !browser.ie && !browser.edge,\n // <http://caniuse.com/#search=pointer%20event>.\n pointerEventsSupported: 'onpointerdown' in window\n // Firefox supports pointer but not by default, only MS browsers are reliable on pointer\n // events currently. So we dont use that on other browsers unless tested sufficiently.\n // Although IE 10 supports pointer event, it use old style and is different from the\n // standard. So we exclude that. (IE 10 is hardly used on touch device)\n && (browser.edge || (browser.ie && browser.version >= 11))\n };\n}", "title": "" }, { "docid": "315e8e7d3d35ae9ad448adf745f97851", "score": "0.6441237", "text": "function splitUserAgent(str) {\n str = str.trim();\n var uaList = [];\n var tokens = '';\n // Split by spaces, while keeping top level parentheses intact, so\n // \"Mozilla/5.0 (Linux; Android 6.0.1) Mobile Safari/537.36\" becomes\n // ['Mozilla/5.0', '(Linux; Android 6.0.1)', 'Mobile', 'Safari/537.36']\n var parensNesting = 0;\n for(var i = 0; i < str.length; ++i) {\n if (str[i] == ' ' && parensNesting == 0) {\n if (tokens.trim().length != 0) uaList.push(tokens.trim());\n tokens = '';\n } else if (str[i] == '(') ++parensNesting;\n else if (str[i] == ')') --parensNesting;\n tokens = tokens + str[i];\n }\n if (tokens.trim().length > 0) uaList.push(tokens.trim());\n\n // What follows is a number of heuristic adaptations to account for UA strings met in the wild:\n\n // Fuse ['a/ver', '(someinfo)'] together. For example:\n // 'Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5 Build/MOB30M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.81 Mobile Safari/537.36'\n // -> fuse 'AppleWebKit/537.36' and '(KHTML, like Gecko)' together\n for(var i = 1; i < uaList.length; ++i) {\n var l = uaList[i];\n if (isEnclosedInParens(l) && !contains(l, ';') && i > 1) {\n uaList[i-1] = uaList[i-1] + ' ' + l;\n uaList[i] = '';\n }\n }\n uaList = removeEmptyElements(uaList);\n\n // Fuse ['foo', 'bar/ver'] together, if 'foo' has only ascii chars. For example:\n // 'Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5 Build/MOB30M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.81 Mobile Safari/537.36'\n // -> fuse ['Mobile', 'Safari/537.36'] together\n for(var i = 0; i < uaList.length-1; ++i) {\n var l = uaList[i];\n var next = uaList[i+1];\n if (/^[a-zA-Z]+$/.test(l) && contains(next, '/')) {\n uaList[i+1] = l + ' ' + next;\n uaList[i] = '';\n }\n }\n uaList = removeEmptyElements(uaList);\n return uaList;\n}", "title": "" }, { "docid": "a4f1067ba6b4b4d362df067074f71c70", "score": "0.64117324", "text": "function exec(regex) {\n return regex.exec(Detectizr.browser.userAgent);\n }", "title": "" }, { "docid": "f2a700e61e0746523e2ccfa541865eb0", "score": "0.64113367", "text": "function detect(ua) {\n var os = {};\n var browser = {};\n // var webkit = ua.match(/Web[kK]it[\\/]{0,1}([\\d.]+)/);\n // var android = ua.match(/(Android);?[\\s\\/]+([\\d.]+)?/);\n // var ipad = ua.match(/(iPad).*OS\\s([\\d_]+)/);\n // var ipod = ua.match(/(iPod)(.*OS\\s([\\d_]+))?/);\n // var iphone = !ipad && ua.match(/(iPhone\\sOS)\\s([\\d_]+)/);\n // var webos = ua.match(/(webOS|hpwOS)[\\s\\/]([\\d.]+)/);\n // var touchpad = webos && ua.match(/TouchPad/);\n // var kindle = ua.match(/Kindle\\/([\\d.]+)/);\n // var silk = ua.match(/Silk\\/([\\d._]+)/);\n // var blackberry = ua.match(/(BlackBerry).*Version\\/([\\d.]+)/);\n // var bb10 = ua.match(/(BB10).*Version\\/([\\d.]+)/);\n // var rimtabletos = ua.match(/(RIM\\sTablet\\sOS)\\s([\\d.]+)/);\n // var playbook = ua.match(/PlayBook/);\n // var chrome = ua.match(/Chrome\\/([\\d.]+)/) || ua.match(/CriOS\\/([\\d.]+)/);\n var firefox = ua.match(/Firefox\\/([\\d.]+)/);\n // var safari = webkit && ua.match(/Mobile\\//) && !chrome;\n // var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome;\n var ie = ua.match(/MSIE\\s([\\d.]+)/)\n // IE 11 Trident/7.0; rv:11.0\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\n var edge = ua.match(/Edge\\/([\\d.]+)/); // IE 12 and 12+\n\n var weChat = (/micromessenger/i).test(ua);\n\n // Todo: clean this up with a better OS/browser seperation:\n // - discern (more) between multiple browsers on android\n // - decide if kindle fire in silk mode is android or not\n // - Firefox on Android doesn't specify the Android version\n // - possibly devide in os, device and browser hashes\n\n // if (browser.webkit = !!webkit) browser.version = webkit[1];\n\n // if (android) os.android = true, os.version = android[2];\n // if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.');\n // if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.');\n // if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;\n // if (webos) os.webos = true, os.version = webos[2];\n // if (touchpad) os.touchpad = true;\n // if (blackberry) os.blackberry = true, os.version = blackberry[2];\n // if (bb10) os.bb10 = true, os.version = bb10[2];\n // if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2];\n // if (playbook) browser.playbook = true;\n // if (kindle) os.kindle = true, os.version = kindle[1];\n // if (silk) browser.silk = true, browser.version = silk[1];\n // if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true;\n // if (chrome) browser.chrome = true, browser.version = chrome[1];\n if (firefox) {\n browser.firefox = true;\n browser.version = firefox[1];\n }\n // if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true;\n // if (webview) browser.webview = true;\n\n if (ie) {\n browser.ie = true;\n browser.version = ie[1];\n }\n\n if (edge) {\n browser.edge = true;\n browser.version = edge[1];\n }\n\n // It is difficult to detect WeChat in Win Phone precisely, because ua can\n // not be set on win phone. So we do not consider Win Phone.\n if (weChat) {\n browser.weChat = true;\n }\n\n // os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) ||\n // (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/)));\n // os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos ||\n // (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\\/([\\d.]+)/)) ||\n // (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/))));\n\n return {\n browser: browser,\n os: os,\n node: false,\n // 原生canvas支持,改极端点了\n // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9)\n canvasSupported : document.createElement('canvas').getContext ? true : false,\n // @see <http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript>\n // works on most browsers\n // IE10/11 does not support touch event, and MS Edge supports them but not by\n // default, so we dont check navigator.maxTouchPoints for them here.\n touchEventsSupported: 'ontouchstart' in window && !browser.ie && !browser.edge,\n // <http://caniuse.com/#search=pointer%20event>.\n pointerEventsSupported: 'onpointerdown' in window\n // Firefox supports pointer but not by default, only MS browsers are reliable on pointer\n // events currently. So we dont use that on other browsers unless tested sufficiently.\n // Although IE 10 supports pointer event, it use old style and is different from the\n // standard. So we exclude that. (IE 10 is hardly used on touch device)\n && (browser.edge || (browser.ie && browser.version >= 11))\n };\n }", "title": "" }, { "docid": "f2a700e61e0746523e2ccfa541865eb0", "score": "0.64113367", "text": "function detect(ua) {\n var os = {};\n var browser = {};\n // var webkit = ua.match(/Web[kK]it[\\/]{0,1}([\\d.]+)/);\n // var android = ua.match(/(Android);?[\\s\\/]+([\\d.]+)?/);\n // var ipad = ua.match(/(iPad).*OS\\s([\\d_]+)/);\n // var ipod = ua.match(/(iPod)(.*OS\\s([\\d_]+))?/);\n // var iphone = !ipad && ua.match(/(iPhone\\sOS)\\s([\\d_]+)/);\n // var webos = ua.match(/(webOS|hpwOS)[\\s\\/]([\\d.]+)/);\n // var touchpad = webos && ua.match(/TouchPad/);\n // var kindle = ua.match(/Kindle\\/([\\d.]+)/);\n // var silk = ua.match(/Silk\\/([\\d._]+)/);\n // var blackberry = ua.match(/(BlackBerry).*Version\\/([\\d.]+)/);\n // var bb10 = ua.match(/(BB10).*Version\\/([\\d.]+)/);\n // var rimtabletos = ua.match(/(RIM\\sTablet\\sOS)\\s([\\d.]+)/);\n // var playbook = ua.match(/PlayBook/);\n // var chrome = ua.match(/Chrome\\/([\\d.]+)/) || ua.match(/CriOS\\/([\\d.]+)/);\n var firefox = ua.match(/Firefox\\/([\\d.]+)/);\n // var safari = webkit && ua.match(/Mobile\\//) && !chrome;\n // var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome;\n var ie = ua.match(/MSIE\\s([\\d.]+)/)\n // IE 11 Trident/7.0; rv:11.0\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\n var edge = ua.match(/Edge\\/([\\d.]+)/); // IE 12 and 12+\n\n var weChat = (/micromessenger/i).test(ua);\n\n // Todo: clean this up with a better OS/browser seperation:\n // - discern (more) between multiple browsers on android\n // - decide if kindle fire in silk mode is android or not\n // - Firefox on Android doesn't specify the Android version\n // - possibly devide in os, device and browser hashes\n\n // if (browser.webkit = !!webkit) browser.version = webkit[1];\n\n // if (android) os.android = true, os.version = android[2];\n // if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.');\n // if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.');\n // if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;\n // if (webos) os.webos = true, os.version = webos[2];\n // if (touchpad) os.touchpad = true;\n // if (blackberry) os.blackberry = true, os.version = blackberry[2];\n // if (bb10) os.bb10 = true, os.version = bb10[2];\n // if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2];\n // if (playbook) browser.playbook = true;\n // if (kindle) os.kindle = true, os.version = kindle[1];\n // if (silk) browser.silk = true, browser.version = silk[1];\n // if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true;\n // if (chrome) browser.chrome = true, browser.version = chrome[1];\n if (firefox) {\n browser.firefox = true;\n browser.version = firefox[1];\n }\n // if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true;\n // if (webview) browser.webview = true;\n\n if (ie) {\n browser.ie = true;\n browser.version = ie[1];\n }\n\n if (edge) {\n browser.edge = true;\n browser.version = edge[1];\n }\n\n // It is difficult to detect WeChat in Win Phone precisely, because ua can\n // not be set on win phone. So we do not consider Win Phone.\n if (weChat) {\n browser.weChat = true;\n }\n\n // os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) ||\n // (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/)));\n // os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos ||\n // (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\\/([\\d.]+)/)) ||\n // (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/))));\n\n return {\n browser: browser,\n os: os,\n node: false,\n // 原生canvas支持,改极端点了\n // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9)\n canvasSupported : document.createElement('canvas').getContext ? true : false,\n // @see <http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript>\n // works on most browsers\n // IE10/11 does not support touch event, and MS Edge supports them but not by\n // default, so we dont check navigator.maxTouchPoints for them here.\n touchEventsSupported: 'ontouchstart' in window && !browser.ie && !browser.edge,\n // <http://caniuse.com/#search=pointer%20event>.\n pointerEventsSupported: 'onpointerdown' in window\n // Firefox supports pointer but not by default, only MS browsers are reliable on pointer\n // events currently. So we dont use that on other browsers unless tested sufficiently.\n // Although IE 10 supports pointer event, it use old style and is different from the\n // standard. So we exclude that. (IE 10 is hardly used on touch device)\n && (browser.edge || (browser.ie && browser.version >= 11))\n };\n }", "title": "" }, { "docid": "f2a700e61e0746523e2ccfa541865eb0", "score": "0.64113367", "text": "function detect(ua) {\n var os = {};\n var browser = {};\n // var webkit = ua.match(/Web[kK]it[\\/]{0,1}([\\d.]+)/);\n // var android = ua.match(/(Android);?[\\s\\/]+([\\d.]+)?/);\n // var ipad = ua.match(/(iPad).*OS\\s([\\d_]+)/);\n // var ipod = ua.match(/(iPod)(.*OS\\s([\\d_]+))?/);\n // var iphone = !ipad && ua.match(/(iPhone\\sOS)\\s([\\d_]+)/);\n // var webos = ua.match(/(webOS|hpwOS)[\\s\\/]([\\d.]+)/);\n // var touchpad = webos && ua.match(/TouchPad/);\n // var kindle = ua.match(/Kindle\\/([\\d.]+)/);\n // var silk = ua.match(/Silk\\/([\\d._]+)/);\n // var blackberry = ua.match(/(BlackBerry).*Version\\/([\\d.]+)/);\n // var bb10 = ua.match(/(BB10).*Version\\/([\\d.]+)/);\n // var rimtabletos = ua.match(/(RIM\\sTablet\\sOS)\\s([\\d.]+)/);\n // var playbook = ua.match(/PlayBook/);\n // var chrome = ua.match(/Chrome\\/([\\d.]+)/) || ua.match(/CriOS\\/([\\d.]+)/);\n var firefox = ua.match(/Firefox\\/([\\d.]+)/);\n // var safari = webkit && ua.match(/Mobile\\//) && !chrome;\n // var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome;\n var ie = ua.match(/MSIE\\s([\\d.]+)/)\n // IE 11 Trident/7.0; rv:11.0\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\n var edge = ua.match(/Edge\\/([\\d.]+)/); // IE 12 and 12+\n\n var weChat = (/micromessenger/i).test(ua);\n\n // Todo: clean this up with a better OS/browser seperation:\n // - discern (more) between multiple browsers on android\n // - decide if kindle fire in silk mode is android or not\n // - Firefox on Android doesn't specify the Android version\n // - possibly devide in os, device and browser hashes\n\n // if (browser.webkit = !!webkit) browser.version = webkit[1];\n\n // if (android) os.android = true, os.version = android[2];\n // if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.');\n // if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.');\n // if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;\n // if (webos) os.webos = true, os.version = webos[2];\n // if (touchpad) os.touchpad = true;\n // if (blackberry) os.blackberry = true, os.version = blackberry[2];\n // if (bb10) os.bb10 = true, os.version = bb10[2];\n // if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2];\n // if (playbook) browser.playbook = true;\n // if (kindle) os.kindle = true, os.version = kindle[1];\n // if (silk) browser.silk = true, browser.version = silk[1];\n // if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true;\n // if (chrome) browser.chrome = true, browser.version = chrome[1];\n if (firefox) {\n browser.firefox = true;\n browser.version = firefox[1];\n }\n // if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true;\n // if (webview) browser.webview = true;\n\n if (ie) {\n browser.ie = true;\n browser.version = ie[1];\n }\n\n if (edge) {\n browser.edge = true;\n browser.version = edge[1];\n }\n\n // It is difficult to detect WeChat in Win Phone precisely, because ua can\n // not be set on win phone. So we do not consider Win Phone.\n if (weChat) {\n browser.weChat = true;\n }\n\n // os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) ||\n // (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/)));\n // os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos ||\n // (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\\/([\\d.]+)/)) ||\n // (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/))));\n\n return {\n browser: browser,\n os: os,\n node: false,\n // 原生canvas支持,改极端点了\n // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9)\n canvasSupported : document.createElement('canvas').getContext ? true : false,\n // @see <http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript>\n // works on most browsers\n // IE10/11 does not support touch event, and MS Edge supports them but not by\n // default, so we dont check navigator.maxTouchPoints for them here.\n touchEventsSupported: 'ontouchstart' in window && !browser.ie && !browser.edge,\n // <http://caniuse.com/#search=pointer%20event>.\n pointerEventsSupported: 'onpointerdown' in window\n // Firefox supports pointer but not by default, only MS browsers are reliable on pointer\n // events currently. So we dont use that on other browsers unless tested sufficiently.\n // Although IE 10 supports pointer event, it use old style and is different from the\n // standard. So we exclude that. (IE 10 is hardly used on touch device)\n && (browser.edge || (browser.ie && browser.version >= 11))\n };\n }", "title": "" }, { "docid": "f2a700e61e0746523e2ccfa541865eb0", "score": "0.64113367", "text": "function detect(ua) {\n var os = {};\n var browser = {};\n // var webkit = ua.match(/Web[kK]it[\\/]{0,1}([\\d.]+)/);\n // var android = ua.match(/(Android);?[\\s\\/]+([\\d.]+)?/);\n // var ipad = ua.match(/(iPad).*OS\\s([\\d_]+)/);\n // var ipod = ua.match(/(iPod)(.*OS\\s([\\d_]+))?/);\n // var iphone = !ipad && ua.match(/(iPhone\\sOS)\\s([\\d_]+)/);\n // var webos = ua.match(/(webOS|hpwOS)[\\s\\/]([\\d.]+)/);\n // var touchpad = webos && ua.match(/TouchPad/);\n // var kindle = ua.match(/Kindle\\/([\\d.]+)/);\n // var silk = ua.match(/Silk\\/([\\d._]+)/);\n // var blackberry = ua.match(/(BlackBerry).*Version\\/([\\d.]+)/);\n // var bb10 = ua.match(/(BB10).*Version\\/([\\d.]+)/);\n // var rimtabletos = ua.match(/(RIM\\sTablet\\sOS)\\s([\\d.]+)/);\n // var playbook = ua.match(/PlayBook/);\n // var chrome = ua.match(/Chrome\\/([\\d.]+)/) || ua.match(/CriOS\\/([\\d.]+)/);\n var firefox = ua.match(/Firefox\\/([\\d.]+)/);\n // var safari = webkit && ua.match(/Mobile\\//) && !chrome;\n // var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome;\n var ie = ua.match(/MSIE\\s([\\d.]+)/)\n // IE 11 Trident/7.0; rv:11.0\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\n var edge = ua.match(/Edge\\/([\\d.]+)/); // IE 12 and 12+\n\n var weChat = (/micromessenger/i).test(ua);\n\n // Todo: clean this up with a better OS/browser seperation:\n // - discern (more) between multiple browsers on android\n // - decide if kindle fire in silk mode is android or not\n // - Firefox on Android doesn't specify the Android version\n // - possibly devide in os, device and browser hashes\n\n // if (browser.webkit = !!webkit) browser.version = webkit[1];\n\n // if (android) os.android = true, os.version = android[2];\n // if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.');\n // if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.');\n // if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;\n // if (webos) os.webos = true, os.version = webos[2];\n // if (touchpad) os.touchpad = true;\n // if (blackberry) os.blackberry = true, os.version = blackberry[2];\n // if (bb10) os.bb10 = true, os.version = bb10[2];\n // if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2];\n // if (playbook) browser.playbook = true;\n // if (kindle) os.kindle = true, os.version = kindle[1];\n // if (silk) browser.silk = true, browser.version = silk[1];\n // if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true;\n // if (chrome) browser.chrome = true, browser.version = chrome[1];\n if (firefox) {\n browser.firefox = true;\n browser.version = firefox[1];\n }\n // if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true;\n // if (webview) browser.webview = true;\n\n if (ie) {\n browser.ie = true;\n browser.version = ie[1];\n }\n\n if (edge) {\n browser.edge = true;\n browser.version = edge[1];\n }\n\n // It is difficult to detect WeChat in Win Phone precisely, because ua can\n // not be set on win phone. So we do not consider Win Phone.\n if (weChat) {\n browser.weChat = true;\n }\n\n // os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) ||\n // (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/)));\n // os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos ||\n // (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\\/([\\d.]+)/)) ||\n // (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/))));\n\n return {\n browser: browser,\n os: os,\n node: false,\n // 原生canvas支持,改极端点了\n // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9)\n canvasSupported : document.createElement('canvas').getContext ? true : false,\n // @see <http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript>\n // works on most browsers\n // IE10/11 does not support touch event, and MS Edge supports them but not by\n // default, so we dont check navigator.maxTouchPoints for them here.\n touchEventsSupported: 'ontouchstart' in window && !browser.ie && !browser.edge,\n // <http://caniuse.com/#search=pointer%20event>.\n pointerEventsSupported: 'onpointerdown' in window\n // Firefox supports pointer but not by default, only MS browsers are reliable on pointer\n // events currently. So we dont use that on other browsers unless tested sufficiently.\n // Although IE 10 supports pointer event, it use old style and is different from the\n // standard. So we exclude that. (IE 10 is hardly used on touch device)\n && (browser.edge || (browser.ie && browser.version >= 11))\n };\n }", "title": "" }, { "docid": "c6c484a996e63f96bb8cb34a043c3adf", "score": "0.64080006", "text": "function getBrowser(){\n\t\tvar N = navigator.appName, ua=navigator.userAgent, tem;\n\t\tvar M = ua.match(/(opera|chrome|safari|firefox|msie)\\/?\\s*(\\.?\\d+(\\.\\d+)*)/i);\n\t\tif(M && (tem= ua.match(/version\\/([\\.\\d]+)/i))!= null) M[2] = tem[1];\n\t\tM = M ? [M[1], M[2]] : [N, navigator.appVersion, '-?'];\n\t\treturn [M[0], M[1]];\n\t}", "title": "" }, { "docid": "c5cf1ca7189d16cfd27cbffbcd7acc0a", "score": "0.63882554", "text": "function fingerprint_os() {\n var userAgent, platform, name, bits;\n try {\n /* navigator.userAgent is supported by all major browsers */ userAgent = navigator.userAgent.toLowerCase(), \n name = -1 !== userAgent.indexOf(\"windows nt 10.0\") ? \"Windows 10\" : -1 !== userAgent.indexOf(\"windows nt 6.3\") ? \"Windows 8.1\" : -1 !== userAgent.indexOf(\"windows nt 6.2\") ? \"Windows 8\" : -1 !== userAgent.indexOf(\"windows nt 6.1\") ? \"Windows 7\" : -1 !== userAgent.indexOf(\"windows nt 6.0\") ? \"Windows Vista/Windows Server 2008\" : -1 !== userAgent.indexOf(\"windows nt 5.2\") ? \"Windows XP x64/Windows Server 2003\" : -1 !== userAgent.indexOf(\"windows nt 5.1\") ? \"Windows XP\" : -1 !== userAgent.indexOf(\"windows nt 5.01\") ? \"Windows 2000, Service Pack 1 (SP1)\" : -1 !== userAgent.indexOf(\"windows xp\") ? \"Windows XP\" : -1 !== userAgent.indexOf(\"windows 2000\") ? \"Windows 2000\" : -1 !== userAgent.indexOf(\"windows nt 5.0\") ? \"Windows 2000\" : -1 !== userAgent.indexOf(\"windows nt 4.0\") ? \"Windows NT 4.0\" : -1 !== userAgent.indexOf(\"windows nt\") ? \"Windows NT 4.0\" : -1 !== userAgent.indexOf(\"winnt4.0\") ? \"Windows NT 4.0\" : -1 !== userAgent.indexOf(\"winnt\") ? \"Windows NT 4.0\" : -1 !== userAgent.indexOf(\"windows me\") ? \"Windows ME\" : -1 !== userAgent.indexOf(\"win 9x 4.90\") ? \"Windows ME\" : -1 !== userAgent.indexOf(\"windows 98\") ? \"Windows 98\" : -1 !== userAgent.indexOf(\"win98\") ? \"Windows 98\" : -1 !== userAgent.indexOf(\"windows 95\") ? \"Windows 95\" : -1 !== userAgent.indexOf(\"windows_95\") ? \"Windows 95\" : -1 !== userAgent.indexOf(\"win95\") ? \"Windows 95\" : -1 !== userAgent.indexOf(\"ce\") ? \"Windows CE\" : -1 !== userAgent.indexOf(\"win16\") ? \"Windows 3.11\" : -1 !== userAgent.indexOf(\"iemobile\") ? \"Windows Mobile\" : -1 !== userAgent.indexOf(\"wm5 pie\") ? \"Windows Mobile\" : -1 !== userAgent.indexOf(\"windows phone 10.0\") ? \"Windows Phone 10\" : -1 !== userAgent.indexOf(\"windows\") ? \"Windows (Unknown Version)\" : -1 !== userAgent.indexOf(\"openbsd\") ? \"Open BSD\" : -1 !== userAgent.indexOf(\"sunos\") ? \"Sun OS\" : -1 !== userAgent.indexOf(\"ubuntu\") ? \"Ubuntu\" : -1 !== userAgent.indexOf(\"ipad\") ? \"iOS (iPad)\" : -1 !== userAgent.indexOf(\"ipod\") ? \"iOS (iTouch)\" : -1 !== userAgent.indexOf(\"iphone\") ? \"iOS (iPhone)\" : -1 !== userAgent.indexOf(\"mac os x beta\") ? \"Mac O SX Beta\" : -1 !== userAgent.indexOf(\"mac os x 10\") ? /mac os x 10_(\\d+)\\_(\\d+)/.test(userAgent) ? \"Mac OS X 10.\" + RegExp.$1 : \"Mac OS X 10\" : -1 !== userAgent.indexOf(\"mac os x\") ? \"Mac OS X\" : -1 !== userAgent.indexOf(\"mac_68000\") ? \"Mac OS Classic (68000)\" : -1 !== userAgent.indexOf(\"68K\") ? \"Mac OS Classic (68000)\" : -1 !== userAgent.indexOf(\"mac_powerpc\") ? \"Mac OS Classic (PowerPC)\" : -1 !== userAgent.indexOf(\"ppc mac\") ? \"Mac OS Classic (PowerPC)\" : -1 !== userAgent.indexOf(\"macintosh\") ? \"Mac OS Classic\" : -1 !== userAgent.indexOf(\"googletv\") ? \"Android (GoogleTV)\" : -1 !== userAgent.indexOf(\"xoom\") ? \"Android (Xoom)\" : -1 !== userAgent.indexOf(\"htc_flyer\") ? \"Android (HTC Flyer)\" : -1 !== userAgent.indexOf(\"android\") ? \"Android\" : -1 !== userAgent.indexOf(\"symbian\") ? \"Symbian\" : -1 !== userAgent.indexOf(\"series60\") ? \"Symbian (Series 60)\" : -1 !== userAgent.indexOf(\"series70\") ? \"Symbian (Series 70)\" : -1 !== userAgent.indexOf(\"series80\") ? \"Symbian (Series 80)\" : -1 !== userAgent.indexOf(\"series90\") ? \"Symbian (Series 90)\" : -1 !== userAgent.indexOf(\"x11\") ? \"UNIX\" : -1 !== userAgent.indexOf(\"nix\") ? \"UNIX\" : -1 !== userAgent.indexOf(\"linux\") ? \"Linux\" : -1 !== userAgent.indexOf(\"qnx\") ? \"QNX\" : -1 !== userAgent.indexOf(\"os/2\") ? \"IBM OS/2\" : -1 !== userAgent.indexOf(\"beos\") ? \"BeOS\" : -1 !== userAgent.indexOf(\"blackberry95\") ? \"Blackberry (Storm 1/2)\" : -1 !== userAgent.indexOf(\"blackberry97\") ? \"Blackberry (Bold)\" : -1 !== userAgent.indexOf(\"blackberry96\") ? \"Blackberry (Tour)\" : -1 !== userAgent.indexOf(\"blackberry89\") ? \"Blackberry (Curve 2)\" : -1 !== userAgent.indexOf(\"blackberry98\") ? \"Blackberry (Torch)\" : -1 !== userAgent.indexOf(\"playbook\") ? \"Blackberry (Playbook)\" : -1 !== userAgent.indexOf(\"wnd.rim\") ? \"Blackberry (IE/FF Emulator)\" : -1 !== userAgent.indexOf(\"blackberry\") ? \"Blackberry\" : -1 !== userAgent.indexOf(\"palm\") ? \"Palm OS\" : -1 !== userAgent.indexOf(\"webos\") ? \"WebOS\" : -1 !== userAgent.indexOf(\"hpwos\") ? \"WebOS (HP)\" : -1 !== userAgent.indexOf(\"blazer\") ? \"Palm OS (Blazer)\" : -1 !== userAgent.indexOf(\"xiino\") ? \"Palm OS (Xiino)\" : -1 !== userAgent.indexOf(\"kindle\") ? \"Kindle\" : -1 !== userAgent.indexOf(\"wii\") ? \"Nintendo (Wii)\" : -1 !== userAgent.indexOf(\"nintendo ds\") ? \"Nintendo (DS)\" : -1 !== userAgent.indexOf(\"playstation 3\") ? \"Sony (Playstation Console)\" : -1 !== userAgent.indexOf(\"playstation portable\") ? \"Sony (Playstation Portable)\" : -1 !== userAgent.indexOf(\"webtv\") ? \"MSN TV (WebTV)\" : -1 !== userAgent.indexOf(\"inferno\") ? \"Inferno\" : \"Unknown\", \n /* navigator.platform is supported by all major browsers */ platform = navigator.platform.toLowerCase(), \n bits = -1 !== platform.indexOf(\"x64\") ? \"64\" : -1 !== userAgent.indexOf(\"x86_64\") ? \"64\" : -1 !== userAgent.indexOf(\"x86-64\") ? \"64\" : -1 !== userAgent.indexOf(\"win64\") ? \"64\" : -1 !== userAgent.indexOf(\"x64;\") ? \"64\" : -1 !== userAgent.indexOf(\"amd64\") ? \"64\" : -1 !== userAgent.indexOf(\"wow64\") ? \"64\" : -1 !== userAgent.indexOf(\"x64_64\") ? \"64\" : -1 !== userAgent.indexOf(\"ia65\") ? \"64\" : -1 !== userAgent.indexOf(\"sparc64\") ? \"64\" : -1 !== userAgent.indexOf(\"ppc64\") ? \"64\" : -1 !== userAgent.indexOf(\"irix64\") ? \"64\" : -1 !== userAgent.indexOf(\"irix64\") ? \"64\" : \"32\";\n } catch (err) {\n name = \"error\", bits = \"error\";\n }\n return {\n name: name.replace(/\\s+/g, \"\"),\n bits: \"x\" + bits\n };\n }", "title": "" }, { "docid": "b4e2155d6485dcba02d7f8d3c3be4a31", "score": "0.63876176", "text": "function get_browser(){\n var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || []; \n if(/trident/i.test(M[1])){\n tem=/\\brv[ :]+(\\d+)/g.exec(ua) || []; \n return {name:'IE',version:(tem[1]||'')};\n } \n if(M[1]==='Chrome'){\n tem=ua.match(/\\bOPR\\/(\\d+)/)\n if(tem!=null) {return {name:'Opera', version:tem[1]};}\n } \n M=M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];\n if((tem=ua.match(/version\\/(\\d+)/i))!=null) {M.splice(1,1,tem[1]);}\n return {\n name: M[0],\n version: M[1]\n };\n }", "title": "" }, { "docid": "a02a20d4152191d5366ba1d5297eea67", "score": "0.6385881", "text": "getDeviceInfo() {\n let helper = window.navigator.userAgent.match(/\\(([^)]+)\\)/)[1].split(';');\n return {\n OS: this._getOS() || helper[0],\n version: helper[1],\n model: helper[2] || helper[0]\n };\n }", "title": "" }, { "docid": "2cf1950d1405075ed32beb048f0333af", "score": "0.6381079", "text": "function detect(ua) {\n var os = {};\n var browser = {}; // var webkit = ua.match(/Web[kK]it[\\/]{0,1}([\\d.]+)/);\n // var android = ua.match(/(Android);?[\\s\\/]+([\\d.]+)?/);\n // var ipad = ua.match(/(iPad).*OS\\s([\\d_]+)/);\n // var ipod = ua.match(/(iPod)(.*OS\\s([\\d_]+))?/);\n // var iphone = !ipad && ua.match(/(iPhone\\sOS)\\s([\\d_]+)/);\n // var webos = ua.match(/(webOS|hpwOS)[\\s\\/]([\\d.]+)/);\n // var touchpad = webos && ua.match(/TouchPad/);\n // var kindle = ua.match(/Kindle\\/([\\d.]+)/);\n // var silk = ua.match(/Silk\\/([\\d._]+)/);\n // var blackberry = ua.match(/(BlackBerry).*Version\\/([\\d.]+)/);\n // var bb10 = ua.match(/(BB10).*Version\\/([\\d.]+)/);\n // var rimtabletos = ua.match(/(RIM\\sTablet\\sOS)\\s([\\d.]+)/);\n // var playbook = ua.match(/PlayBook/);\n // var chrome = ua.match(/Chrome\\/([\\d.]+)/) || ua.match(/CriOS\\/([\\d.]+)/);\n\n var firefox = ua.match(/Firefox\\/([\\d.]+)/); // var safari = webkit && ua.match(/Mobile\\//) && !chrome;\n // var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome;\n\n var ie = ua.match(/MSIE\\s([\\d.]+)/) // IE 11 Trident/7.0; rv:11.0\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\n var edge = ua.match(/Edge\\/([\\d.]+)/); // IE 12 and 12+\n\n var weChat = /micromessenger/i.test(ua); // Todo: clean this up with a better OS/browser seperation:\n // - discern (more) between multiple browsers on android\n // - decide if kindle fire in silk mode is android or not\n // - Firefox on Android doesn't specify the Android version\n // - possibly devide in os, device and browser hashes\n // if (browser.webkit = !!webkit) browser.version = webkit[1];\n // if (android) os.android = true, os.version = android[2];\n // if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.');\n // if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.');\n // if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;\n // if (webos) os.webos = true, os.version = webos[2];\n // if (touchpad) os.touchpad = true;\n // if (blackberry) os.blackberry = true, os.version = blackberry[2];\n // if (bb10) os.bb10 = true, os.version = bb10[2];\n // if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2];\n // if (playbook) browser.playbook = true;\n // if (kindle) os.kindle = true, os.version = kindle[1];\n // if (silk) browser.silk = true, browser.version = silk[1];\n // if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true;\n // if (chrome) browser.chrome = true, browser.version = chrome[1];\n\n if (firefox) {\n browser.firefox = true;\n browser.version = firefox[1];\n } // if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true;\n // if (webview) browser.webview = true;\n\n\n if (ie) {\n browser.ie = true;\n browser.version = ie[1];\n }\n\n if (edge) {\n browser.edge = true;\n browser.version = edge[1];\n } // It is difficult to detect WeChat in Win Phone precisely, because ua can\n // not be set on win phone. So we do not consider Win Phone.\n\n\n if (weChat) {\n browser.weChat = true;\n } // os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) ||\n // (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/)));\n // os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos ||\n // (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\\/([\\d.]+)/)) ||\n // (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/))));\n\n\n return {\n browser: browser,\n os: os,\n node: false,\n // 原生canvas支持,改极端点了\n // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9)\n canvasSupported: !!document.createElement('canvas').getContext,\n svgSupported: typeof SVGRect !== 'undefined',\n // works on most browsers\n // IE10/11 does not support touch event, and MS Edge supports them but not by\n // default, so we dont check navigator.maxTouchPoints for them here.\n touchEventsSupported: 'ontouchstart' in window && !browser.ie && !browser.edge,\n // <http://caniuse.com/#search=pointer%20event>.\n pointerEventsSupported: // (1) Firefox supports pointer but not by default, only MS browsers are reliable on pointer\n // events currently. So we dont use that on other browsers unless tested sufficiently.\n // For example, in iOS 13 Mobile Chromium 78, if the touching behavior starts page\n // scroll, the `pointermove` event can not be fired any more. That will break some\n // features like \"pan horizontally to move something and pan vertically to page scroll\".\n // The horizontal pan probably be interrupted by the casually triggered page scroll.\n // (2) Although IE 10 supports pointer event, it use old style and is different from the\n // standard. So we exclude that. (IE 10 is hardly used on touch device)\n 'onpointerdown' in window && (browser.edge || browser.ie && browser.version >= 11),\n // passiveSupported: detectPassiveSupport()\n domSupported: typeof document !== 'undefined'\n };\n} // See https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection", "title": "" }, { "docid": "3eae2baa160bb3a4feceec6311b31fbe", "score": "0.6381079", "text": "function detect(ua) {\n var os = {};\n var browser = {}; // var webkit = ua.match(/Web[kK]it[\\/]{0,1}([\\d.]+)/);\n // var android = ua.match(/(Android);?[\\s\\/]+([\\d.]+)?/);\n // var ipad = ua.match(/(iPad).*OS\\s([\\d_]+)/);\n // var ipod = ua.match(/(iPod)(.*OS\\s([\\d_]+))?/);\n // var iphone = !ipad && ua.match(/(iPhone\\sOS)\\s([\\d_]+)/);\n // var webos = ua.match(/(webOS|hpwOS)[\\s\\/]([\\d.]+)/);\n // var touchpad = webos && ua.match(/TouchPad/);\n // var kindle = ua.match(/Kindle\\/([\\d.]+)/);\n // var silk = ua.match(/Silk\\/([\\d._]+)/);\n // var blackberry = ua.match(/(BlackBerry).*Version\\/([\\d.]+)/);\n // var bb10 = ua.match(/(BB10).*Version\\/([\\d.]+)/);\n // var rimtabletos = ua.match(/(RIM\\sTablet\\sOS)\\s([\\d.]+)/);\n // var playbook = ua.match(/PlayBook/);\n // var chrome = ua.match(/Chrome\\/([\\d.]+)/) || ua.match(/CriOS\\/([\\d.]+)/);\n\n var firefox = ua.match(/Firefox\\/([\\d.]+)/); // var safari = webkit && ua.match(/Mobile\\//) && !chrome;\n // var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome;\n\n var ie = ua.match(/MSIE\\s([\\d.]+)/) // IE 11 Trident/7.0; rv:11.0\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\n var edge = ua.match(/Edge\\/([\\d.]+)/); // IE 12 and 12+\n\n var weChat = /micromessenger/i.test(ua); // Todo: clean this up with a better OS/browser seperation:\n // - discern (more) between multiple browsers on android\n // - decide if kindle fire in silk mode is android or not\n // - Firefox on Android doesn't specify the Android version\n // - possibly devide in os, device and browser hashes\n // if (browser.webkit = !!webkit) browser.version = webkit[1];\n // if (android) os.android = true, os.version = android[2];\n // if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.');\n // if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.');\n // if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;\n // if (webos) os.webos = true, os.version = webos[2];\n // if (touchpad) os.touchpad = true;\n // if (blackberry) os.blackberry = true, os.version = blackberry[2];\n // if (bb10) os.bb10 = true, os.version = bb10[2];\n // if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2];\n // if (playbook) browser.playbook = true;\n // if (kindle) os.kindle = true, os.version = kindle[1];\n // if (silk) browser.silk = true, browser.version = silk[1];\n // if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true;\n // if (chrome) browser.chrome = true, browser.version = chrome[1];\n\n if (firefox) {\n browser.firefox = true;\n browser.version = firefox[1];\n } // if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true;\n // if (webview) browser.webview = true;\n\n\n if (ie) {\n browser.ie = true;\n browser.version = ie[1];\n }\n\n if (edge) {\n browser.edge = true;\n browser.version = edge[1];\n } // It is difficult to detect WeChat in Win Phone precisely, because ua can\n // not be set on win phone. So we do not consider Win Phone.\n\n\n if (weChat) {\n browser.weChat = true;\n } // os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) ||\n // (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/)));\n // os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos ||\n // (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\\/([\\d.]+)/)) ||\n // (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/))));\n\n\n return {\n browser: browser,\n os: os,\n node: false,\n // 原生canvas支持,改极端点了\n // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9)\n canvasSupported: !!document.createElement('canvas').getContext,\n svgSupported: typeof SVGRect !== 'undefined',\n // works on most browsers\n // IE10/11 does not support touch event, and MS Edge supports them but not by\n // default, so we dont check navigator.maxTouchPoints for them here.\n touchEventsSupported: 'ontouchstart' in window && !browser.ie && !browser.edge,\n // <http://caniuse.com/#search=pointer%20event>.\n pointerEventsSupported: 'onpointerdown' in window // Firefox supports pointer but not by default, only MS browsers are reliable on pointer\n // events currently. So we dont use that on other browsers unless tested sufficiently.\n // Although IE 10 supports pointer event, it use old style and is different from the\n // standard. So we exclude that. (IE 10 is hardly used on touch device)\n && (browser.edge || browser.ie && browser.version >= 11),\n // passiveSupported: detectPassiveSupport()\n domSupported: typeof document !== 'undefined'\n };\n} // See https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection", "title": "" }, { "docid": "406c220fe7cd8bade64f49908c83b872", "score": "0.63389015", "text": "function get_browser() {\n var ua = navigator.userAgent,\n tem, M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n if (/trident/i.test(M[1])) {\n tem = /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n return {\n name: 'IE',\n version: (tem[1] || '')\n };\n }\n if (M[1] === 'Chrome') {\n tem = ua.match(/\\bOPR\\/(\\d+)/);\n if (tem !== null) {\n return {\n name: 'Opera',\n version: tem[1]\n };\n }\n }\n M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?'];\n if ((tem = ua.match(/version\\/(\\d+)/i)) !== null) {\n M.splice(1, 1, tem[1]);\n }\n return {\n name: M[0],\n version: M[1]\n };\n }", "title": "" }, { "docid": "7d03e9dfa32f73fe3424bb9589731f35", "score": "0.63292634", "text": "function calcBrowser(customUa) {\n var sUserAgent = (customUa || ua).toLowerCase(); // use custom user-agent if given\n\n var rwebkit = /(webkit)[ \\/]([\\w.]+)/;\n var ropera = /(opera)(?:.*version)?[ \\/]([\\w.]+)/;\n var rmsie = /(msie) ([\\w.]+)/;\n var rmsie11 = /(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;\n var redge = /(edge)[ \\/]([\\w.]+)/;\n var rmozilla = /(mozilla)(?:.*? rv:([\\w.]+))?/;\n\n // WinPhone IE11 and MS Edge userAgents contain \"WebKit\" and \"Mozilla\" and therefore must be checked first\n var browserMatch = redge.exec(sUserAgent) ||\n rmsie11.exec(sUserAgent) ||\n rwebkit.exec(sUserAgent) ||\n ropera.exec(sUserAgent) ||\n rmsie.exec(sUserAgent) ||\n sUserAgent.indexOf(\"compatible\") < 0 && rmozilla.exec(sUserAgent) || [];\n\n var oRes = {\n browser: browserMatch[1] || \"\",\n version: browserMatch[2] || \"0\"\n };\n oRes[oRes.browser] = true;\n return oRes;\n }", "title": "" }, { "docid": "f5e1533e80a56cf4846de4b7b0be127f", "score": "0.6306403", "text": "function exec(regex) {\n return regex.exec(Detectizr.browser.userAgent);\n }", "title": "" }, { "docid": "934439a614a461cd277d0ebfb88ac101", "score": "0.6302118", "text": "function j(){return navigator.userAgent}", "title": "" }, { "docid": "02944d5392c37d548878e92beb31072d", "score": "0.6301746", "text": "function getBrowser(){\n // from https://developer.mozilla.org/en-US/docs/Web/API/Window/navigator#Example_1_Browser_detect_and_return_a_string\n // modified to return single words\n var sBrowser, sUsrAg = navigator.userAgent;\n // The order matters here, and this may report false positives for unlisted browsers.\n if (sUsrAg.indexOf(\"Firefox\") > -1) {\n sBrowser = \"Firefox\";\n // \"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0\"\n } else if (sUsrAg.indexOf(\"Opera\") > -1 || sUsrAg.indexOf(\"OPR\") > -1) {\n sBrowser = \"Opera\";\n //\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 OPR/57.0.3098.106\"\n } else if (sUsrAg.indexOf(\"Trident\") > -1) {\n sBrowser = \"IE\";\n // \"Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; Zoom 3.6.0; wbx 1.0.0; rv:11.0) like Gecko\"\n } else if (sUsrAg.indexOf(\"Edge\") > -1) {\n sBrowser = \"Edge\";\n // \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299\"\n } else if (sUsrAg.indexOf(\"Chrome\") > -1) {\n sBrowser = \"Chrome\";\n // \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/66.0.3359.181 Chrome/66.0.3359.181 Safari/537.36\"\n } else if (sUsrAg.indexOf(\"Safari\") > -1) {\n sBrowser = \"Safari\";\n // \"Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1 980x1306\"\n } else {\n sBrowser = \"Unknown\";\n }\n return sBrowser;\n}", "title": "" }, { "docid": "b3b1b21e77f11096abee118102012be7", "score": "0.6292295", "text": "function exec(regex) {\n\t\treturn regex.exec(Detectizr.browser.userAgent);\n\t}", "title": "" }, { "docid": "6387ce75acc184a5a999f8cbac4bf2be", "score": "0.62824184", "text": "function detect(ua) {\n\t var os = {};\n\t var browser = {};\n\t // var webkit = ua.match(/Web[kK]it[\\/]{0,1}([\\d.]+)/);\n\t // var android = ua.match(/(Android);?[\\s\\/]+([\\d.]+)?/);\n\t // var ipad = ua.match(/(iPad).*OS\\s([\\d_]+)/);\n\t // var ipod = ua.match(/(iPod)(.*OS\\s([\\d_]+))?/);\n\t // var iphone = !ipad && ua.match(/(iPhone\\sOS)\\s([\\d_]+)/);\n\t // var webos = ua.match(/(webOS|hpwOS)[\\s\\/]([\\d.]+)/);\n\t // var touchpad = webos && ua.match(/TouchPad/);\n\t // var kindle = ua.match(/Kindle\\/([\\d.]+)/);\n\t // var silk = ua.match(/Silk\\/([\\d._]+)/);\n\t // var blackberry = ua.match(/(BlackBerry).*Version\\/([\\d.]+)/);\n\t // var bb10 = ua.match(/(BB10).*Version\\/([\\d.]+)/);\n\t // var rimtabletos = ua.match(/(RIM\\sTablet\\sOS)\\s([\\d.]+)/);\n\t // var playbook = ua.match(/PlayBook/);\n\t // var chrome = ua.match(/Chrome\\/([\\d.]+)/) || ua.match(/CriOS\\/([\\d.]+)/);\n\t var firefox = ua.match(/Firefox\\/([\\d.]+)/);\n\t // var safari = webkit && ua.match(/Mobile\\//) && !chrome;\n\t // var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome;\n\t var ie = ua.match(/MSIE\\s([\\d.]+)/)\n\t // IE 11 Trident/7.0; rv:11.0\n\t || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\n\t var edge = ua.match(/Edge\\/([\\d.]+)/); // IE 12 and 12+\n\n\t // Todo: clean this up with a better OS/browser seperation:\n\t // - discern (more) between multiple browsers on android\n\t // - decide if kindle fire in silk mode is android or not\n\t // - Firefox on Android doesn't specify the Android version\n\t // - possibly devide in os, device and browser hashes\n\n\t // if (browser.webkit = !!webkit) browser.version = webkit[1];\n\n\t // if (android) os.android = true, os.version = android[2];\n\t // if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.');\n\t // if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.');\n\t // if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;\n\t // if (webos) os.webos = true, os.version = webos[2];\n\t // if (touchpad) os.touchpad = true;\n\t // if (blackberry) os.blackberry = true, os.version = blackberry[2];\n\t // if (bb10) os.bb10 = true, os.version = bb10[2];\n\t // if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2];\n\t // if (playbook) browser.playbook = true;\n\t // if (kindle) os.kindle = true, os.version = kindle[1];\n\t // if (silk) browser.silk = true, browser.version = silk[1];\n\t // if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true;\n\t // if (chrome) browser.chrome = true, browser.version = chrome[1];\n\t if (firefox) browser.firefox = true, browser.version = firefox[1];\n\t // if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true;\n\t // if (webview) browser.webview = true;\n\t if (ie) {\n\t browser.ie = true; browser.version = ie[1];\n\t }\n\t if (ie) {\n\t browser.ie = true;\n\t browser.version = ie[1];\n\t }\n\t if (edge) {\n\t browser.edge = true;\n\t browser.version = edge[1];\n\t }\n\n\t // os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) ||\n\t // (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/)));\n\t // os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos ||\n\t // (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\\/([\\d.]+)/)) ||\n\t // (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/))));\n\n\t return {\n\t browser: browser,\n\t os: os,\n\t node: false,\n\t // 原生canvas支持,改极端点了\n\t // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9)\n\t canvasSupported : document.createElement('canvas').getContext ? true : false,\n\t // @see <http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript>\n\t // works on most browsers\n\t // IE10/11 does not support touch event, and MS Edge supports them but not by\n\t // default, so we dont check navigator.maxTouchPoints for them here.\n\t touchEventsSupported: 'ontouchstart' in window && !browser.ie && !browser.edge,\n\t // <http://caniuse.com/#search=pointer%20event>.\n\t pointerEventsSupported: 'onpointerdown' in window\n\t // Firefox supports pointer but not by default,\n\t // only MS browsers are reliable on pointer events currently.\n\t && (browser.edge || (browser.ie && browser.version >= 10))\n\t };\n\t }", "title": "" }, { "docid": "5215ee1d80fce95b115e080c38f09021", "score": "0.6273841", "text": "function get_browser_version(){\n var N=navigator.appName, ua=navigator.userAgent, tem;\n var M=ua.match(/(opera|chrome|safari|firefox|msie)\\/?\\s*(\\.?\\d+(\\.\\d+)*)/i);\n if(M && (tem= ua.match(/version\\/([\\.\\d]+)/i))!= null) M[2]= tem[1];\n M=M? [M[1], M[2]]: [N, navigator.appVersion, '-?'];\n return M[1];\n }", "title": "" }, { "docid": "36dc925f145431dbdad8b418ed245154", "score": "0.6237753", "text": "function identifyBrowser(userAgent, elements) {\n var regexps = {\n 'Chrome': [ /Chrome\\/(\\S+)/ ],\n 'Firefox': [ /Firefox\\/(\\S+)/ ],\n 'MSIE': [ /MSIE (\\S+);/ ],\n 'Opera': [\n /Opera\\/.*?Version\\/(\\S+)/, /* Opera 10 */\n /Opera\\/(\\S+)/ /* Opera 9 and older */\n ],\n 'Safari': [ /Version\\/(\\S+).*?Safari\\// ]\n },\n re, m, browser, version;\n \n if (userAgent === undefined)\n userAgent = navigator.userAgent;\n \n if (elements === undefined)\n elements = 2;\n else if (elements === 0)\n elements = 1337;\n \n for (browser in regexps)\n while (re = regexps[browser].shift())\n if (m = userAgent.match(re)) {\n version = (m[1].match(new RegExp('[^.]+(?:\\.[^.]+){0,' + --elements + '}')))[0];\n return browser;\n }\n \n return null;\n}", "title": "" }, { "docid": "8e80aea865295dd47b7f68dbcab2362e", "score": "0.6228084", "text": "function windowsVersion () {\n var ntToConsumer = {\n '6.3': '8.1',\n '6.2': '8',\n '6.1': '7',\n '6.0': 'Vista',\n '5.2': 'XP x64, Server 2003',\n '5.1': 'XP'\n };\n\n return ntToConsumer[ userAgent.match(/Windows NT (\\d\\.\\d)/)[1] ] || '';\n }", "title": "" }, { "docid": "c7dc6466f63b26c073e938b98c879c2d", "score": "0.61636573", "text": "function getBrowser() {\n var ua = navigator.userAgent, tem,\n M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n if (/trident/i.test(M[1])) {\n tem = /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n return 'IE ' + (tem[1] || '');\n }\n if (M[1] === 'Chrome') {\n tem = ua.match(/\\b(OPR|Edge)\\/(\\d+)/);\n if (tem != null) return tem.slice(1).join(' ').replace('OPR', 'Opera');\n }\n M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?'];\n if ((tem = ua.match(/version\\/(\\d+)/i)) != null) M.splice(1, 1, tem[1]);\n return M.join(' ');\n}", "title": "" }, { "docid": "22d3f9c24366eb35a21a16e0b20eab59", "score": "0.6156754", "text": "function o(){var a=u.toLowerCase();var b=/(webkit)[ \\/]([\\w.]+)/;var e=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var f=/(msie) ([\\w.]+)/;var i=/(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;var q=/(mozilla)(?:.*? rv:([\\w.]+))?/;var Q=b.exec(a)||e.exec(a)||f.exec(a)||i.exec(a)||a.indexOf(\"compatible\")<0&&q.exec(a)||[];var s={browser:Q[1]||\"\",version:Q[2]||\"0\"};s[s.browser]=true;return s}", "title": "" }, { "docid": "22d3f9c24366eb35a21a16e0b20eab59", "score": "0.6156754", "text": "function o(){var a=u.toLowerCase();var b=/(webkit)[ \\/]([\\w.]+)/;var e=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var f=/(msie) ([\\w.]+)/;var i=/(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;var q=/(mozilla)(?:.*? rv:([\\w.]+))?/;var Q=b.exec(a)||e.exec(a)||f.exec(a)||i.exec(a)||a.indexOf(\"compatible\")<0&&q.exec(a)||[];var s={browser:Q[1]||\"\",version:Q[2]||\"0\"};s[s.browser]=true;return s}", "title": "" }, { "docid": "6dfb41c1f995a908c0e9fdd444e32a69", "score": "0.6127992", "text": "function BrowserDetect() {\n var ua = navigator.userAgent.toLowerCase();\n\n // browser engine name\n this.isGecko = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);\n this.isAppleWebKit = (ua.indexOf('applewebkit') != -1);\n\n // browser name\n this.isKonqueror = (ua.indexOf('konqueror') != -1);\n this.isSafari = (ua.indexOf('safari') != - 1);\n this.isOmniweb = (ua.indexOf('omniweb') != - 1);\n this.isOpera = (ua.indexOf('opera') != -1);\n this.isIcab = (ua.indexOf('icab') != -1);\n this.isAol = (ua.indexOf('aol') != -1);\n this.isIE = (ua.indexOf('msie') != -1 && !this.isOpera && (ua.indexOf('webtv') == -1) );\n this.isMozilla = (this.isGecko && ua.indexOf('gecko/') + 14 == ua.length);\n this.isFirefox = (ua.indexOf('firefox/') != -1 || ua.indexOf('firebird/') != -1);\n this.isNS = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && !this.isOpera && !this.isSafari && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) );\n\n // spoofing and compatible browsers\n this.isIECompatible = ( (ua.indexOf('msie') != -1) && !this.isIE);\n this.isNSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.isNS && !this.isMozilla);\n\n // rendering engine versions\n this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );\n this.equivalentMozilla = ( (this.isGecko) ? parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) ) : -1 );\n this.appleWebKitVersion = ( (this.isAppleWebKit) ? parseFloat( ua.substring( ua.indexOf('applewebkit/') + 12) ) : -1 );\n\n // browser version\n this.versionMinor = parseFloat(navigator.appVersion);\n\n // correct version number\n if (this.isGecko && !this.isMozilla) {\n this.versionMinor = parseFloat( ua.substring( ua.indexOf('/', ua.indexOf('gecko/') + 6) + 1 ) );\n }\n else if (this.isMozilla) {\n this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );\n }\n else if (this.isIE && this.versionMinor >= 4) {\n this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );\n }\n else if (this.isKonqueror) {\n this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) );\n }\n else if (this.isSafari) {\n this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('safari/') + 7 ) );\n }\n else if (this.isOmniweb) {\n this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('omniweb/') + 8 ) );\n }\n else if (this.isOpera) {\n this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera') + 6 ) );\n }\n else if (this.isIcab) {\n this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab') + 5 ) );\n }\n\n this.versionMajor = parseInt(this.versionMinor);\n\n // dom support\n this.isDOM1 = (document.getElementById);\n this.isDOM2Event = (document.addEventListener && document.removeEventListener);\n\n // css compatibility mode\n this.mode = document.compatMode ? document.compatMode : 'BackCompat';\n\n // platform\n this.isWin = (ua.indexOf('win') != -1);\n this.isWin32 = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1) );\n this.isMac = (ua.indexOf('mac') != -1);\n this.isUnix = (ua.indexOf('unix') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)\n this.isLinux = (ua.indexOf('linux') != -1);\n\n // specific browser shortcuts\n this.isNS4x = (this.isNS && this.versionMajor == 4);\n this.isNS40x = (this.isNS4x && this.versionMinor < 4.5);\n this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7);\n this.isNS4up = (this.isNS && this.versionMinor >= 4);\n this.isNS6x = (this.isNS && this.versionMajor == 6);\n this.isNS6up = (this.isNS && this.versionMajor >= 6);\n this.isNS7x = (this.isNS && this.versionMajor == 7);\n this.isNS7up = (this.isNS && this.versionMajor >= 7);\n\n this.isIE4x = (this.isIE && this.versionMajor == 4);\n this.isIE4up = (this.isIE && this.versionMajor >= 4);\n this.isIE5x = (this.isIE && this.versionMajor == 5);\n this.isIE55 = (this.isIE && this.versionMinor == 5.5);\n this.isIE5up = (this.isIE && this.versionMajor >= 5);\n this.isIE6x = (this.isIE && this.versionMajor == 6);\n this.isIE6up = (this.isIE && this.versionMajor >= 6);\n\n this.isIE4xMac = (this.isIE4x && this.isMac);\n}", "title": "" }, { "docid": "9d7c6ac9c6c1f7022780797f2713f83a", "score": "0.612221", "text": "function Browseris(){var c=navigator.userAgent.toLowerCase();\nthis.osver=1;\nif(c){var a=c.substring(c.indexOf(\"windows \")+11);\nthis.osver=parseFloat(a);\n}this.major=parseInt(navigator.appVersion);\nthis.nav=((c.indexOf(\"mozilla\")!=-1)&&((c.indexOf(\"spoofer\")==-1)&&(c.indexOf(\"compatible\")==-1)));\nthis.nav6=this.nav&&(this.major==5);\nthis.nav6up=this.nav&&(this.major>=5);\nthis.nav7up=false;\nif(this.nav6up){var b=c.indexOf(\"netscape/\");\nif(b>=0){this.nav7up=parseInt(c.substring(b+9))>=7;\n}}this.ie=(c.indexOf(\"msie\")!=-1);\nthis.aol=this.ie&&c.indexOf(\" aol \")!=-1;\nif(this.ie){var d=c.substring(c.indexOf(\"msie \")+5);\nthis.iever=parseInt(d);\nthis.verIEFull=parseFloat(d);\n}else{this.iever=0;\n}this.ie4up=this.ie&&(this.major>=4);\nthis.ie5up=this.ie&&(this.iever>=5);\nthis.ie55up=this.ie&&(this.verIEFull>=5.5);\nthis.ie6up=this.ie&&(this.iever>=6);\nthis.winnt=((c.indexOf(\"winnt\")!=-1)||(c.indexOf(\"windows nt\")!=-1));\nthis.win32=((this.major>=4)&&(navigator.platform==\"Win32\"))||(c.indexOf(\"win32\")!=-1)||(c.indexOf(\"32bit\")!=-1);\nthis.mac=(c.indexOf(\"mac\")!=-1);\nthis.w3c=this.nav6up;\nthis.safari=(c.indexOf(\"safari\")!=-1);\nthis.safari125up=false;\nif(this.safari&&this.major>=5){var b=c.indexOf(\"safari/\");\nif(b>=0){this.safari125up=parseInt(c.substring(b+7))>=125;\n}}}", "title": "" }, { "docid": "cd8aa3b1252ba395902ce384f27260cd", "score": "0.60886914", "text": "function r(){return(navigator.userAgent||navigator.vendor||window.opera).toLowerCase()}", "title": "" }, { "docid": "cd8aa3b1252ba395902ce384f27260cd", "score": "0.60886914", "text": "function r(){return(navigator.userAgent||navigator.vendor||window.opera).toLowerCase()}", "title": "" }, { "docid": "23d6010384b13f9d76eae3e143fafde0", "score": "0.60834795", "text": "function getOS( )\n{\n var ua = navigator.userAgent;\n var uaindex;\n\n // determine OS\n if ( ua.match(/iPad/i) || ua.match(/iPod/i) || ua.match(/iPhone/i) )\n {\n userOS = 'iOS';\n uaindex = ua.indexOf( 'OS ' );\n }\n else if ( ua.match(/Android/i) )\n {\n userOS = 'Android';\n uaindex = ua.indexOf( 'Android ' );\n }\n else\n {\n userOS = 'unknown';\n }\n\n // determine version\n if ( userOS === 'iOS' && uaindex > -1 )\n {\n userOSver = ua.substr( uaindex + 3, 3 ).replace( '_', '.' );\n }\n else if ( userOS === 'Android' && uaindex > -1 )\n {\n userOSver = ua.substr( uaindex + 8, 3 );\n }\n else\n {\n userOSver = 'unknown';\n }\n}", "title": "" }, { "docid": "f29453f8a744987f3d1f10fe7863f000", "score": "0.6083227", "text": "function getBrowser() {\n\tvar matched = uaMatch( navigator.userAgent );\n\tvar browser = {};\n\tif ( matched.browser ) {\n\t\tbrowser[ matched.browser ] = true;\n\t\tbrowser.version = matched.version;\n\t}\n\t// Chrome is Webkit, but Webkit is also Safari.\n\tif ( browser.chrome ) {\n\t\tbrowser.webkit = true;\n\t} else if ( browser.webkit ) {\n\t\tbrowser.safari = true;\n\t}\n\treturn browser;\n}", "title": "" }, { "docid": "1526f4acaf6f0089cedbd4b609fd77fe", "score": "0.6078382", "text": "function init() {\n var match = parseUA(userAgent);\n var browserName = match.browser;\n var browserVersion = match.version;\n\n isChrome = (browserName === \"chrome\");\n\n isIE = (browserName === \"msie\");\n\n isMozilla = (browserName === \"mozilla\");\n\n isWebkit = isChrome || (browserName === \"webkit\");\n\n isSafari = isWebkit && !isChrome;\n\n isOpera = (browserName === \"opera\");\n\n var browsers = {\n 'Chrome': isChrome,\n 'Firefox': isMozilla,\n 'IE': isIE,\n 'Safari': isSafari,\n 'Opera': isOpera\n };\n\n shortBrowser = _getFirstTruthyPropKey(browsers);\n\n majorVersion = parseInt(browserVersion, 10);\n\n isLinux = platform.indexOf('Linux') !== -1;\n\n isMac = platform.indexOf('Mac') !== -1;\n\n isWin = platform.indexOf('Win') !== -1;\n\n var platforms = {\n 'Win': isWin,\n 'Mac': isMac,\n 'Linux': isLinux\n };\n\n shortPlatform = _getFirstTruthyPropKey(platforms);\n }", "title": "" }, { "docid": "a6b85d9e431694f6745e0e3fc5e098f4", "score": "0.60728604", "text": "function deduceOS(os, token) {\n\n var osNames = {\n 'Windows NT 10.0': '10',\n 'Windows NT 6.3': '8.1',\n 'Windows NT 6.2': '8',\n 'Windows NT 6.1': '7',\n 'Windows NT 6.0': 'Vista',\n 'Windows NT 5.2': 'XP',\n 'Windows NT 5.1': 'XP',\n 'Windows NT 5.0': '2000',\n\n '10.4': 'Tiger',\n '10.5': 'Leopard',\n '10.6': 'Snow Leopard',\n '10.7': 'Lion',\n '10.8': 'Mountain Lion',\n '10.9': 'Mavericks',\n '10.10': 'Yosemite',\n '10.11': 'El Capitan',\n '10.12': 'Sierra',\n '10.13': 'High Sierra',\n '10.14': 'Mojave',\n '10.15': 'Catalina'\n };\n\n function getWindowsVersion(str) {\n var ver = osNames[str];\n return ver ? ver : null;\n }\n\n // Example: \"Intel Mac OS X 10_10_3\" returns \"OS X 10.10 (Yosemite)\"\n function getOSXVersion(str) {\n var info = str.substr(str.indexOf('OS X') + 5);\n var key = (info.indexOf('_') > 1) ? info.split('_') : info.split('.');\n key = (key.length >= 2) ? key.slice(0, 2) : key.concat([0]);\n var version = osNames[key.join('.')] ? key.join('.') + ' (' + osNames[key.join('.')] + ')' : key.join('.');\n return version;\n }\n\n function getAndroidVersion(str) {\n return str.substr(8).split('.').slice(0, 2).join('.');\n }\n\n // Example: \"CPU iPhone OS 11_3 like Mac OS X\" returns \"iOS 11.3\"\n function getIOSVersion(str) {\n return str.substr(str.indexOf(' OS ') + 4).replace(' like Mac OS X', '').split('_').slice(0, 2).join('.');\n }\n\n var platforms = [\n { tag: 'Windows NT', name: 'Windows', fn: getWindowsVersion },\n { tag: 'Intel Mac OS', name: 'macOS', fn: getOSXVersion },\n { tag: 'PPC Mac OS', name: 'macOS', fn: getOSXVersion },\n { tag: 'Android', name: 'Android', fn: getAndroidVersion },\n { tag: 'CPU iPhone OS', name: 'iOS', fn: getIOSVersion },\n { tag: 'CPU OS', name: 'iOS', fn: getIOSVersion },\n { tag: 'Linux' },\n { tag: 'FreeBSD' },\n { tag: 'OpenBSD' },\n { tag: 'NetBSD' },\n { tag: 'SunOS' },\n { tag: 'CrOS', name: 'ChromeOS' }\n ];\n\n function isPartialMatch(platform) {\n return platform.tag === token.substr(0, platform.tag.length);\n }\n\n var match = platforms.find(isPartialMatch);\n if (match) {\n var name = match.name ? match.name : match.tag;\n os.name = name.split(' ').shift();\n os.version = match.fn ? match.fn(token) : null;\n\n if (os.name === 'macOS') {\n // For El Capitan (10.11) and older versions.\n os.name = (parseInt(os.version.replace('10.', ''), 10) <= 11) ? 'OS X' : 'macOS';\n }\n }\n\n return os;\n }", "title": "" }, { "docid": "d61bf65d289ae2e1fa7221fdb14e5d0e", "score": "0.60362935", "text": "function uaVersion(ua, baseua) {\n\t_baseua = baseua || Browser.base;\n\treturn _baseua==\"Safari\" ? ua.match(/Version\\/([\\.0-9]+)\\s/)[1] :\n\t\t\t\t_baseua==\"Opera\" ? ua.match(/\\/([\\.0-9]+)$/)[1] : \n\t\t\t\t_baseua==\"Chrome\" ? ua.match(/Chrome\\/([\\.0-9]+)/)[1] :\n\t\t\t\t_baseua==\"Firefox\" ? ua.match(/Firefox\\/([\\.0-9]+)$/)[1] :\n\t\t\t\t_baseua==\"IE\" ? ua.match(/ rv\\:([\\.0-9]+).*?$/)[1] :\n\t\t\t\t_baseua==\"Edge\" ? ua.match(/ rv\\:([\\.0-9]+).*?$/)[1] :\n\t\t\t\t\"version undetected\";\n}", "title": "" }, { "docid": "67b334e4496e8a3797235375a0b263f2", "score": "0.6032171", "text": "function css_browser_selector(u){var uaInfo={},screens=[320,480,640,768,1024,1152,1280,1440,1680,1920,2560],allScreens=screens.length,ua=u.toLowerCase(),is=function(t){return RegExp(t,\"i\").test(ua);},version=function(p,n){n=n.replace(\".\",\"_\");var i=n.indexOf('_'),ver=\"\";while(i>0){ver+=\" \"+p+n.substring(0,i);i=n.indexOf('_',i+1);}ver+=\" \"+p+n;return ver;},g='gecko',w='webkit',c='chrome',f='firefox',s='safari',o='opera',m='mobile',a='android',bb='blackberry',lang='lang_',dv='device_',html=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\\s(\\d+)/.test(ua))?('ie ie'+(/trident\\/4\\.0/.test(ua)?'8':RegExp.$1)):is('firefox/')?g+\" \"+f+(/firefox\\/((\\d+)(\\.(\\d+))(\\.\\d+)*)/.test(ua)?' '+f+RegExp.$2+' '+f+RegExp.$2+\"_\"+RegExp.$4:''):is('gecko/')?g:is('opera')?o+(/version\\/((\\d+)(\\.(\\d+))(\\.\\d+)*)/.test(ua)?' '+o+RegExp.$2+' '+o+RegExp.$2+\"_\"+RegExp.$4:(/opera(\\s|\\/)(\\d+)\\.(\\d+)/.test(ua)?' '+o+RegExp.$2+\" \"+o+RegExp.$2+\"_\"+RegExp.$3:'')):is('konqueror')?'konqueror':is('blackberry')?(bb+(/Version\\/(\\d+)(\\.(\\d+)+)/i.test(ua)?\" \"+bb+RegExp.$1+\" \"+bb+RegExp.$1+RegExp.$2.replace('.','_'):(/Blackberry ?(([0-9]+)([a-z]?))[\\/|;]/gi.test(ua)?' '+bb+RegExp.$2+(RegExp.$3?' '+bb+RegExp.$2+RegExp.$3:''):''))):is('android')?(a+(/Version\\/(\\d+)(\\.(\\d+))+/i.test(ua)?\" \"+a+RegExp.$1+\" \"+a+RegExp.$1+RegExp.$2.replace('.','_'):'')+(/Android (.+); (.+) Build/i.test(ua)?' '+dv+((RegExp.$2).replace(/ /g,\"_\")).replace(/-/g,\"_\"):'')):is('chrome')?w+' '+c+(/chrome\\/((\\d+)(\\.(\\d+))(\\.\\d+)*)/.test(ua)?' '+c+RegExp.$2+((RegExp.$4>0)?' '+c+RegExp.$2+\"_\"+RegExp.$4:''):''):is('iron')?w+' iron':is('applewebkit/')?(w+' '+s+(/version\\/((\\d+)(\\.(\\d+))(\\.\\d+)*)/.test(ua)?' '+s+RegExp.$2+\" \"+s+RegExp.$2+RegExp.$3.replace('.','_'):(/ Safari\\/(\\d+)/i.test(ua)?((RegExp.$1==\"419\"||RegExp.$1==\"417\"||RegExp.$1==\"416\"||RegExp.$1==\"412\")?' '+s+'2_0':RegExp.$1==\"312\"?' '+s+'1_3':RegExp.$1==\"125\"?' '+s+'1_2':RegExp.$1==\"85\"?' '+s+'1_0':''):''))):is('mozilla/')?g:'',is(\"android|mobi|mobile|j2me|iphone|ipod|ipad|blackberry|playbook|kindle|silk\")?m:'',is('j2me')?'j2me':is('ipad|ipod|iphone')?((/CPU( iPhone)? OS (\\d+[_|\\.]\\d+([_|\\.]\\d+)*)/i.test(ua)?'ios'+version('ios',RegExp.$2):'')+' '+(/(ip(ad|od|hone))/gi.test(ua)?RegExp.$1:\"\")):is('playbook')?'playbook':is('kindle|silk')?'kindle':is('playbook')?'playbook':is('mac')?'mac'+(/mac os x ((\\d+)[.|_](\\d+))/.test(ua)?(' mac'+(RegExp.$2)+' mac'+(RegExp.$1).replace('.',\"_\")):''):is('win')?'win'+(is('windows nt 6.2')?' win8':is('windows nt 6.1')?' win7':is('windows nt 6.0')?' vista':is('windows nt 5.2')||is('windows nt 5.1')?' win_xp':is('windows nt 5.0')?' win_2k':is('windows nt 4.0')||is('WinNT4.0')?' win_nt':''):is('freebsd')?'freebsd':(is('x11|linux'))?'linux':'',(/[; |\\[](([a-z]{2})(\\-[a-z]{2})?)[)|;|\\]]/i.test(ua))?(lang+RegExp.$2).replace(\"-\",\"_\")+(RegExp.$3!=''?(' '+lang+RegExp.$1).replace(\"-\",\"_\"):''):'',(is('ipad|iphone|ipod')&&!is('safari'))?'ipad_app':''];function screenSize(){var w=window.outerWidth||html.clientWidth;var h=window.outerHeight||html.clientHeight;uaInfo.orientation=((w<h)?\"portrait\":\"landscape\");html.className=html.className.replace(/ ?orientation_\\w+/g,\"\").replace(/ [min|max|cl]+[w|h]_\\d+/g,\"\");for(var i=(allScreens-1);i>=0;i--){if(w>=screens[i]){uaInfo.maxw=screens[i];break;}}widthClasses=\"\";for(var info in uaInfo){widthClasses+=\" \"+info+\"_\"+uaInfo[info];}html.className=(html.className+widthClasses);return widthClasses;}window.onresize=screenSize;screenSize();var cssbs=(b.join(' '))+\" js \";html.className=(cssbs+html.className.replace(/\\b(no[-|_]?)?js\\b/g,\"\")).replace(/^ /,\"\").replace(/ +/g,\" \");return cssbs;}", "title": "" }, { "docid": "428c7ef55b0bac41c67ffdbc17b5f771", "score": "0.6015729", "text": "function g(a){var b=(a||U).toLowerCase(),c=/(webkit)[ \\/]([\\w.]+)/,d=/(opera)(?:.*version)?[ \\/]([\\w.]+)/,e=/(msie) ([\\w.]+)/,f=/(trident)\\/[\\w.]+;.*rv:([\\w.]+)/,g=/(edge)[ \\/]([\\w.]+)/,h=/(mozilla)(?:.*? rv:([\\w.]+))?/,i=g.exec(b)||f.exec(b)||c.exec(b)||d.exec(b)||e.exec(b)||b.indexOf(\"compatible\")<0&&h.exec(b)||[],j={browser:i[1]||\"\",version:i[2]||\"0\"};return j[j.browser]=!0,j}", "title": "" }, { "docid": "2b13fba9ed318373979bdad322787ed0", "score": "0.59292156", "text": "function parseUA (ua) {\n ua = ua.toLowerCase();\n\n var match = /(chrome)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(webkit)(?:.*version\\/)([\\w.]+)/.exec ( ua ) ||\n /(webkit)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(opera)(?:.*version|)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(msie) ([\\w.]+)/.exec( ua ) ||\n ua.indexOf(\"compatible\") < 0 && /(mozilla)(?:.*? rv:([\\w.]+)|)/.exec( ua ) ||\n [];\n\n // IE 11\n if (match[ 1 ] === \"mozilla\" && /\\btrident\\b/.test( ua )) {\n match[ 1 ] = \"msie\";\n }\n\n return {\n browser: match[ 1 ] || \"\",\n version: match[ 2 ] || \"0\"\n };\n }", "title": "" }, { "docid": "460ed786615807661945d577214b02bb", "score": "0.59283686", "text": "function i(){return(navigator.userAgent||navigator.vendor||window.opera).toLowerCase()}", "title": "" }, { "docid": "eb962146d3a55a80126902d79d5b2f91", "score": "0.58972985", "text": "function getBrowserVersion() {\n console.log(\"browser: \" + window.navigator.appName);\n}", "title": "" }, { "docid": "32b3015165626f62e040e25618908b9a", "score": "0.5875895", "text": "function xbDetectBrowser()\n{\n var oldOnError = window.onerror;\n var element = null;\n\n window.onerror = null;\n \n // work around bug in xpcdom Mozilla 0.9.1\n window.saveNavigator = window.navigator;\n\n navigator.OS = '';\n navigator.version = parseFloat(navigator.appVersion);\n navigator.org = '';\n navigator.family = '';\n\n var platform;\n if (typeof(window.navigator.platform) != 'undefined')\n {\n platform = window.navigator.platform.toLowerCase();\n if (platform.indexOf('win') != -1)\n navigator.OS = 'win';\n else if (platform.indexOf('mac') != -1)\n navigator.OS = 'mac';\n else if (platform.indexOf('unix') != -1 || platform.indexOf('linux') != -1 || platform.indexOf('sun') != -1)\n navigator.OS = 'nix';\n }\n\n var i = 0;\n var ua = window.navigator.userAgent.toLowerCase();\n \n if (ua.indexOf('opera') != -1)\n {\n i = ua.indexOf('opera');\n navigator.family = 'opera';\n navigator.org = 'opera';\n navigator.version = parseFloat('0' + ua.substr(i+6), 10);\n }\n else if ((i = ua.indexOf('msie')) != -1)\n {\n navigator.org = 'microsoft';\n navigator.version = parseFloat('0' + ua.substr(i+5), 10);\n \n if (navigator.version < 4)\n navigator.family = 'ie3';\n else\n navigator.family = 'ie4'\n }\n else if (ua.indexOf('gecko') != -1)\n {\n navigator.family = 'gecko';\n var rvStart = ua.indexOf('rv:');\n var rvEnd = ua.indexOf(')', rvStart);\n var rv = ua.substring(rvStart+3, rvEnd);\n var rvParts = rv.split('.');\n var rvValue = 0;\n var exp = 1;\n\n for (var i = 0; i < rvParts.length; i++)\n {\n var val = parseInt(rvParts[i]);\n rvValue += val / exp;\n exp *= 100;\n }\n navigator.version = rvValue;\n\n if (ua.indexOf('netscape') != -1)\n navigator.org = 'netscape';\n else if (ua.indexOf('compuserve') != -1)\n navigator.org = 'compuserve';\n else\n navigator.org = 'mozilla';\n }\n else if ((ua.indexOf('mozilla') !=-1) && (ua.indexOf('spoofer')==-1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera')==-1)&& (ua.indexOf('webtv')==-1) && (ua.indexOf('hotjava')==-1))\n {\n var is_major = parseFloat(navigator.appVersion);\n \n if (is_major < 4)\n navigator.version = is_major;\n else\n {\n i = ua.lastIndexOf('/')\n navigator.version = parseFloat('0' + ua.substr(i+1), 10);\n }\n navigator.org = 'netscape';\n navigator.family = 'nn' + parseInt(navigator.appVersion);\n }\n else if ((i = ua.indexOf('aol')) != -1 )\n {\n // aol\n navigator.family = 'aol';\n navigator.org = 'aol';\n navigator.version = parseFloat('0' + ua.substr(i+4), 10);\n }\n else if ((i = ua.indexOf('hotjava')) != -1 )\n {\n // hotjava\n navigator.family = 'hotjava';\n navigator.org = 'sun';\n navigator.version = parseFloat(navigator.appVersion);\n }\n\n window.onerror = oldOnError;\n}", "title": "" }, { "docid": "371bd3350297f3ab672a9db8c020051e", "score": "0.58542", "text": "function e(a){var q=(a||u).toLowerCase();var B1=/(webkit)[ \\/]([\\w.]+)/;var C1=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var D1=/(msie) ([\\w.]+)/;var E1=/(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;var F1=/(edge)[ \\/]([\\w.]+)/;var G1=/(mozilla)(?:.*? rv:([\\w.]+))?/;var H1=F1.exec(q)||E1.exec(q)||B1.exec(q)||C1.exec(q)||D1.exec(q)||q.indexOf(\"compatible\")<0&&G1.exec(q)||[];var I1={browser:H1[1]||\"\",version:H1[2]||\"0\"};I1[I1.browser]=true;return I1;}", "title": "" }, { "docid": "0e9fb4908daa0a19977736ecd5ea01b4", "score": "0.5853015", "text": "function detectOS() {\n var os = navigator.appVersion.substr(5, 3).toLowerCase();\n return os;\n}", "title": "" }, { "docid": "30d0c6a62abae9c5d3b0d932b974163f", "score": "0.5848306", "text": "function detectOS(string) {\r\n\tplace = navigator.userAgent.toLowerCase().indexOf(string) + 1;\r\n\tif (place>0) return true;\r\n\telse return false;\r\n}", "title": "" }, { "docid": "2a0d206a96324cdd2bdeb8609fa37296", "score": "0.5845003", "text": "function sniff(){this.version=\"1.3\",this.browserType,this.browserVersion,this.mobile,this.browserVersionExtended=null;for(var e,i=/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),s=!1,t=navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/iPhone|iPad|iPod/i)||navigator.userAgent.match(/Opera Mini/i)||navigator.userAgent.match(/IEMobile/i)||null,n=navigator.appName,o=navigator.userAgent,r=o.match(/(opera|chrome|safari|firefox|msie|trident|edge)\\/?\\s*(\\.?\\d+(\\.\\d+)*)/i),a=o.match(/(opera|chrome|safari|firefox|msie|trident|edge)\\/?\\s*(\\.?\\d+(\\.\\d+)*)/gi),d=0;d<a.length;d++)if(a[d].toLowerCase().indexOf(\"edge\")>=0){var m=a[d].split(\"/\"),f=m[0].toLowerCase(),l=m[1];s=!0,console.log(\"so qui\")}if(!s){r&&!i&&null!=(e=o.match(/version\\/([\\.\\d]+)/i))&&(r[2]=e[1]),r=r?[r[1],r[2]]:[n,navigator.appVersion,\"-?\"];var f=r[0].toLowerCase(),l=r[1];if(\"trident\"==r[0].toLowerCase()){f=\"msie\",console.log(o),l=o.match(/(rv)\\:?(\\.?\\d+(\\.\\d+)*)/i);for(var c=0;c<l.length;c++)if(!isNaN(parseInt(l[c]))){l=l[c];break}}}this.webview=i,this.mobile=t,this.browserType=f,this.browserVersion=parseInt(l),this.browserVersionExtended=l}", "title": "" }, { "docid": "5a3f82c4f2b0171463860168a04e9275", "score": "0.58241063", "text": "function y(a){var b=(a||u).toLowerCase();var e=/(webkit)[ \\/]([\\w.]+)/;var f=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var i=/(msie) ([\\w.]+)/;var q=/(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;var s=/(mozilla)(?:.*? rv:([\\w.]+))?/;var V=e.exec(b)||f.exec(b)||i.exec(b)||q.exec(b)||b.indexOf(\"compatible\")<0&&s.exec(b)||[];var t={browser:V[1]||\"\",version:V[2]||\"0\"};t[t.browser]=true;return t}", "title": "" }, { "docid": "dfe061b9d493c66ecd4e32360dd81035", "score": "0.582187", "text": "function getBrowser(){\n var ua = navigator.userAgent.toLowerCase();\n var isGt2 = ua.indexOf(\"gt-i9100\") > -1;\n if(isGt2){\n return \"isGt2\";\n }\n var isGt3 = ua.indexOf(\"gt-i9300\") > -1;\n if(isGt3){\n return \"isGt3\";\n }\n var isIpad = ua.indexOf(\"ipad\") > -1;\n if(isIpad){\n return \"ipad\";\n }\n var isIphone = ua.indexOf(\"iphone\") > -1;\n if(isIphone){\n return \"iphone\";\n }\n return \"iphone\";\n\n }", "title": "" }, { "docid": "8a7b4f6dd7fbefb0f04f3c9638cc7a97", "score": "0.5807936", "text": "function uglyBrowserSniff() {\n var browserName;\n\n // Opera 8.0+\n if ((window.opr && opr.addons) || window.opera || (navigator.userAgent.indexOf(' OPR/') >= 0)) {\n browserName = \"Opera\";\n }\n\n // Firefox 1.0+\n if (typeof InstallTrigger !== 'undefined') {\n browserName = \"Firefox\";\n }\n\n // At least Safari 3+: \"[object HTMLElementConstructor]\"\n if (Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0) {\n browserName = \"Safari\";\n }\n\n // Internet Explorer 6-11\n if ((/*@cc_on!@*/false) || (document.documentMode)) {\n browserName = \"IE\";\n }\n\n // Edge 20+\n if (!(document.documentMode) && window.StyleMedia) {\n browserName = \"Edge\";\n }\n\n // Chrome 1+\n if (window.chrome && window.chrome.webstore) {\n browserName = \"Chrome\";\n }\n\n if (browserName == \"Firefox\" || browserName == \"Opera\" || browserName == \"IE\" || browserName == \"Edge\"){\n errorBanner.classList.add('show')\n console.log(browserName)\n };\n }", "title": "" }, { "docid": "f10ef34abd421ab6ae86fdc4df550a51", "score": "0.57857955", "text": "function e(a) {\n var q = (a || u).toLowerCase();\n var B1 = /(webkit)[ \\/]([\\w.]+)/;\n var C1 = /(opera)(?:.*version)?[ \\/]([\\w.]+)/;\n var D1 = /(msie) ([\\w.]+)/;\n var E1 = /(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;\n var F1 = /(edge)[ \\/]([\\w.]+)/;\n var G1 = /(mozilla)(?:.*? rv:([\\w.]+))?/;\n var H1 = F1.exec(q) || E1.exec(q) || B1.exec(q) || C1.exec(q) || D1.exec(q) || q.indexOf(\"compatible\") < 0 && G1.exec(q) || [];\n var I1 = {\n browser: H1[1] || \"\",\n version: H1[2] || \"0\"\n };\n I1[I1.browser] = true;\n return I1;\n }", "title": "" }, { "docid": "360af49342fbd1a758e301648c578eba", "score": "0.57581294", "text": "static getUserAgent() {\n return navigator.userAgent;\n }", "title": "" }, { "docid": "985c553123a3073206588bd1c61ebf77", "score": "0.57515526", "text": "function usersBrowser() {\r\n\t\t\t\textendJqueryBrowser();\r\n\t\t\t\tvar userBrowser = $.browser,\r\n\t\t\t\t\tselectedBrowser,\r\n\t\t\t\t\tisMobileDevice = false,\r\n\t\t\t\t\tanimationEngineCompatible = true;\r\n\t\t\t\tif (userBrowser.msie) {\r\n\t\t\t\t\tselectedBrowser = \"msie\";\r\n\t\t\t\t\t// the animation engine is not supported by any Internet Explorer \r\n\t\t\t\t\tif (userBrowser.version < 8) {\r\n\t\t\t\t\t\tanimationEngineCompatible = false;\r\n\t\t\t\t\t};\t\t\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (userBrowser.mozilla) {\r\n\t\t\t\t\t\tselectedBrowser = \"mozilla\";\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (userBrowser.webkit) {\r\n\t\t\t\t\t\t\tif (navigator.userAgent.indexOf('iPhone') != -1 || navigator.userAgent.indexOf('iPod') != -1) {\r\n\t\t\t\t\t\t\t\tselectedBrowser = \"iPhone_iPod\";\r\n\t\t\t\t\t\t\t\tisMobileDevice = true;\r\n\t\t\t\t\t\t\t\t// check if gesture is avilable on device //\r\n\t\t\t\t\t\t\t\trequestPushHistoryAvailability(checkIosVersion());\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tif (navigator.userAgent.indexOf('iPad') != -1) {\r\n\t\t\t\t\t\t\t\t\tselectedBrowser = \"iPad\";\r\n\t\t\t\t\t\t\t\t\tisMobileDevice = true;\r\n\t\t\t\t\t\t\t\t\t// check //\r\n\t\t\t\t\t\t\t\t\trequestPushHistoryAvailability(checkIosVersion());\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tif ( (navigator.userAgent.indexOf('Android') != -1)) {\r\n\t\t\t\t\t\t\t\t\t\tselectedBrowser = \"Android\";\r\n\t\t\t\t\t\t\t\t\t\tisMobileDevice = true;\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\tselectedBrowser = \"Webkit\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif (userBrowser.opera) {\r\n\t\t\t\t\t\t\t\tselectedBrowser = \"Opera\"\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tif ((navigator.userAgent.indexOf('BlackBerry') != -1) ) {\r\n\t\t\t\t\t\t\t\t\tselectedBrowser = \"BlackBerry\";\r\n\t\t\t\t\t\t\t\t\t// the animation engine is not supported by blackberry\r\n\t\t\t\t\t\t\t\t\tanimationEngineCompatible = false;\r\n\t\t\t\t\t\t\t\t\tisMobileDevice = true;\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tselectedBrowser = \"Unknown\";\r\n\t\t\t\t\t\t\t\t\t// as a fail safe the animation engine is not supported by unknow browsers\r\n\t\t\t\t\t\t\t\t\tanimationEngineCompatible = false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\trequestUsersBrowser(selectedBrowser);\r\n\t\t\t\trequestMobileDeviceUseage(isMobileDevice);\r\n\t\t\t\tmagazineLoader.magazineDebugLog({\"status\":\"debug\",\"namespace\":\"magazineBrowserDetection\", \"functionName\":\"usersBrowser\",\"msg\":\"users browser \" + requestUsersBrowser(),\"lineNumber\": new Error().lineNumber});\r\n\t\t\t\tmagazineLoader.magazineDebugLog({\"status\":\"debug\",\"namespace\":\"magazineBrowserDetection\", \"functionName\":\"usersBrowser\",\"msg\":\"user device, mobile:\" + requestMobileDeviceUseage(),\"lineNumber\": new Error().lineNumber});\r\n\t\t\t\treturn animationEngineCompatible;\r\n\t\t\t}", "title": "" }, { "docid": "56bf9df7a1229ff470f079baff3ad474", "score": "0.5723656", "text": "function DHTMLgoodies_clientInfo() {\n var browser;\t\t\t// Complete user agent information\n\n var isOpera;\t\t\t// Is the browser \"Opera\"\n var isMSIE;\t\t\t\t// Is the browser \"Internet Explorer\"\n var isFirefox;\t\t\t// Is the browser \"Firefox\"\n var navigatorVersion;\t// Browser version\n}", "title": "" }, { "docid": "b47b781993bd228ce399fa4238736b9c", "score": "0.5718442", "text": "function getBrowser(){\n\t\t\t\t\tvar userAgent = navigator.userAgent.toLowerCase();\n\t\t\t\t\tvar chrome = /chrome/.test(userAgent);\n\t\t\t\t\tvar safari= /webkit/.test(userAgent);\n\t\t\t\t\tvar opera=/opera/.test(userAgent);\n\t\t\t\t\tvar msie=/msie/.test( userAgent ) && !/opera/.test( userAgent );\n\t\t\t\t\tvar mozilla= /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) || /firefox/.test(userAgent);\n\n\t\t\t\t\tif(chrome) return \"chrome\";\n\t\t\t\t\tif(mozilla) return \"mozilla\";\n\t\t\t\t\tif(opera) return \"opera\";\n\t\t\t\t\tif(safari) return \"safari\";\n\t\t\t\t\tif(msie) return \"ie\";\n\t\t\t\t}", "title": "" }, { "docid": "e764cc73819e32ea81bde3187c33e729", "score": "0.5714839", "text": "function getOS()\r\n{\r\n var osString = Components.classes[\"@mozilla.org/xre/app-info;1\"]\r\n .getService(Components.interfaces.nsIXULRuntime).OS;\r\n return osString;\r\n}", "title": "" }, { "docid": "4c10f9e14d3a9a109be1504ccab7bfea", "score": "0.5709942", "text": "function detectBrowser() {\r\n\tif ((typeof(navigator) != \"undefined\") && (typeof(navigator.userAgent) != \"undefined\")) {\r\n\t\tvar ua = navigator.userAgent;\r\n\r\n\t\tif (ua.search(/chrome/i) != -1) {\r\n\t\t\treturn \"chrome\";\r\n\t\t}\t\t\r\n\t\t\r\n\t\tif (ua.search(/webkit/i) != -1) {\r\n\t\t\treturn \"safari\";\r\n\t\t}\r\n\t\t\r\n\t\tif (ua.search(/opera/i) != -1) {\r\n\t\t\treturn \"opera\";\r\n\t\t}\t\t\r\n\t\t\r\n\t\tif ((ua.search(/msie/i) != -1) && (ua.search(/opera/i) == -1)) {\r\n\t\t\treturn \"msie\";\r\n\t\t}\r\n\t\t\r\n\t\tif ((ua.search(/mozilla/i) != -1) && (ua.search(/(compatible|webkit)/i) == -1)) {\r\n\t\t\treturn \"mozilla\";\r\n\t\t}\r\n\t\t\r\n\t\treturn \"msie\"; // return msie as default if unable to detect via user agent\r\n\t}\r\n\t\t// The navigator.userAgent object does not exists\r\n\t\treturn \"\";\r\n}", "title": "" }, { "docid": "e4ff0229f9bba5287e5bc1f4f09c4b9b", "score": "0.56985766", "text": "function check_browser_version(appendToBodyAsClass) {\n var browserInfo = is_internet_explore();\n\n if (browserInfo === \"not-ie\") {\n var ua = navigator.userAgent,\n tem,\n M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n\n if (/trident/i.test(M[1])) {\n tem = /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n return 'IE ' + (tem[1] || '');\n }\n\n if (M[1] === 'Chrome') {\n tem = ua.match(/\\b(OPR|Edge)\\/(\\d+)/);\n if (tem != null) return tem.slice(1).join(' ').replace('OPR', 'Opera');\n }\n\n M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?'];\n if ((tem = ua.match(/version\\/(\\d+)/i)) != null) M.splice(1, 1, tem[1]);\n browserInfo = M.join('-').toLowerCase();\n }\n\n if (appendToBodyAsClass) {\n $('body').addClass(browserInfo);\n }\n\n return browserInfo;\n}", "title": "" }, { "docid": "a221773bc4930d20824c475c241507bb", "score": "0.5697527", "text": "function GetBrowserInfo() {\n\t\t\t\tvar isFirefox = typeof InstallTrigger !== 'undefined'; // Firefox 1.0+\n\t\t\t\tvar isChrome = !!window.chrome; \t\t\t // Chrome 1+\n\t\t\t\tif (isFirefox) { return 'firefox'; }\n\t\t\t\telse if (isChrome) { return 'chrome'; }\t\t\n\t\t\t\telse { return 0; }\n\t\t\t}", "title": "" }, { "docid": "bf6e3f51bf778cf2bfc402978d9110be", "score": "0.5694604", "text": "function ttfGetOsVersion() {\n\tvar agent = window.navigator.userAgent,\n\t\tstart = agent.indexOf( 'OS ' );\n\n\tif( ( agent.indexOf( 'iPhone' ) > -1 || agent.indexOf( 'iPad' ) > -1 ) && start > -1 ){\n\t\treturn window.Number( agent.substr( start + 3, 3 ).replace( '_', '.' ) );\n\t} else {\n\t\treturn 0;\n\t};\n\n}", "title": "" }, { "docid": "0b538b9abe6238cf002fd21b4257a0cd", "score": "0.5682808", "text": "function chromeVersion () {\n return userAgent.match(/Chrome\\/(\\d+)/)[1] || '';\n }", "title": "" }, { "docid": "751c4331761f3213b51791021cc17998", "score": "0.56687564", "text": "function n(e){var t=(e||v).toLowerCase();var n=/(webkit)[ \\/]([\\w.]+)/;var r=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var i=/(msie) ([\\w.]+)/;var a=/(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;var o=/(edge)[ \\/]([\\w.]+)/;var s=/(mozilla)(?:.*? rv:([\\w.]+))?/;var u=o.exec(t)||a.exec(t)||n.exec(t)||r.exec(t)||i.exec(t)||t.indexOf(\"compatible\")<0&&s.exec(t)||[];var l={browser:u[1]||\"\",version:u[2]||\"0\"};l[l.browser]=true;return l}", "title": "" }, { "docid": "07a2ff552ae55258e6d6b1503d12abef", "score": "0.56422997", "text": "function sniffer() {\n\t// convert all characters to lowercase to simplify testing\n var agt=navigator.userAgent.toLowerCase();\n //alert(agt);\t\t\t\t\t\t\t\t\t//for curiosity\n // *** BROWSER VERSION NUMBERS***\n this.major = parseInt(navigator.appVersion)\n this.minor = parseFloat(navigator.appVersion)\n\t// *** BROWSER TYPE ***\n this.nav = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1)\n && (agt.indexOf('compatible') == -1)))\n\tthis.ie = (agt.indexOf(\"msie\") != -1)\n\t// *** OS PLATFORM ***\n\tthis.mac = (agt.indexOf(\"mac\")!=-1)\n}", "title": "" }, { "docid": "cc4c10ac03204c2927f24c22585019ab", "score": "0.5641463", "text": "function y(a){var b=(a||u).toLowerCase();var e=/(webkit)[ \\/]([\\w.]+)/;var f=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var i=/(msie) ([\\w.]+)/;var q=/(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;var s=/(edge)[ \\/]([\\w.]+)/;var t=/(mozilla)(?:.*? rv:([\\w.]+))?/;var v=s.exec(b)||q.exec(b)||e.exec(b)||f.exec(b)||i.exec(b)||b.indexOf(\"compatible\")<0&&t.exec(b)||[];var w={browser:v[1]||\"\",version:v[2]||\"0\"};w[w.browser]=true;return w;}", "title": "" }, { "docid": "cc4c10ac03204c2927f24c22585019ab", "score": "0.5641463", "text": "function y(a){var b=(a||u).toLowerCase();var e=/(webkit)[ \\/]([\\w.]+)/;var f=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var i=/(msie) ([\\w.]+)/;var q=/(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;var s=/(edge)[ \\/]([\\w.]+)/;var t=/(mozilla)(?:.*? rv:([\\w.]+))?/;var v=s.exec(b)||q.exec(b)||e.exec(b)||f.exec(b)||i.exec(b)||b.indexOf(\"compatible\")<0&&t.exec(b)||[];var w={browser:v[1]||\"\",version:v[2]||\"0\"};w[w.browser]=true;return w;}", "title": "" }, { "docid": "fc6685a6cf75995d8b2c9007a5f0eb61", "score": "0.5632656", "text": "function getEnv() {\n if (!env) {\n var ua = navigator.userAgent;\n env = {\n };\n\n (env.webkit = /AppleWebKit\\//.test(ua)) ||\n (env.ie = /MSIE|Trident/.test(ua)) ||\n (env.opera = /Opera/.test(ua)) ||\n (env.gecko = /Gecko\\//.test(ua)) ||\n (env.unknown = true);\n if (env.webkit) {\n env.name = 'Webkit';\n } else if (env.ie) {\n env.name = 'MSIE';\n } else if (env.gecko) {\n env.name = 'Gecko';\n } else {\n env.name = 'unknown';\n }\n }\n return env;\n }", "title": "" }, { "docid": "23d69bb6bd4ed1367c01711bb1e17a2e", "score": "0.55873877", "text": "function getOperatingSystem() {\n switch (os_1.default.type()) {\n case \"Windows_NT\":\n return \"(Windows NT 6.1; Win64; x64)\";\n case \"Darwin\":\n return \"(Macintosh; Intel Mac OS X 10_13_6)\";\n case \"Linux\":\n return \"(X11; Linux x86_64)\";\n default:\n return \"(Unknown)\";\n }\n}", "title": "" }, { "docid": "be88ff0773e62fd5a69f03970a7d7f9d", "score": "0.5566023", "text": "function getDeviceInfo(){\n devicePlatform = navigator.platform;\n deviceVersion = navigator.appVersion;\n deviceIsIOS = (devicePlatform == \"iPhone\") || (devicePlatform == \"iPad\") || (devicePlatform == \"iPod\");\n if (deviceIsIOS) {\n if (deviceVersion.indexOf(\"OS 8\") != -1) {\n deviceIOSVersion = 8\n } else if (deviceVersion.indexOf(\"OS 7\") != -1) {\n deviceIOSVersion = 7\n } else if (deviceVersion.indexOf(\"OS 6\") != -1) {\n deviceIOSVersion = 6\n } else if (deviceVersion.indexOf(\"OS 5\") != -1) {\n deviceIOSVersion = 5\n } else {\n deviceIOSVersion = 4 // iOS version <= 4\n }\n }\n}", "title": "" }, { "docid": "9bf59ca31d782648a035e879911b2061", "score": "0.5555656", "text": "function Browser()\n{\n var ua, s, i;\n\n this.isIE = false;\n this.isNS = false;\n this.isOP = false;\n this.name = navigator.appName;\n this.version = null;\n\n ua = navigator.userAgent;\n //alert(navigator.vendor);\n\n // Firefox:\n // Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6\n\n // Explorer:\n // Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)\n\n // Opera:\n // Mozilla/4.0 (compatibile; MSIE 6.0; Windows NT 5.1; en) Opera 8.50\n\n if ((navigator.userAgent).indexOf(\"Opera\")!=-1)\n {\n this.isOP = true;\n } else\n if (navigator.appName==\"Netscape\")\n {\n this.isNS = true;\n //s = \"Netscape6/\";\n //this.version = parseFloat(ua.substr(i + s.length));\n } else\n if ( (navigator.appName).indexOf(\"Microsoft\") != -1 )\n {\n this.isIE = true;\n //s = \"MSIE\";\n //this.version = parseFloat(ua.substr(i + s.length));\n }\n\n return;\n}", "title": "" }, { "docid": "890631856bbe2d3a9fb42144a64038eb", "score": "0.55548275", "text": "function browserspecifics() {\n\n //http://stackoverflow.com/questions/2400935/browser-detection-in-javascript\n\n navigator.sayswho = (function(){\n var ua= navigator.userAgent, tem, \n M= ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n if(/trident/i.test(M[1])){\n tem= /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n return 'IE '+(tem[1] || '');\n }\n if(M[1]=== 'Chrome'){\n tem= ua.match(/\\bOPR\\/(\\d+)/)\n if(tem!= null) return 'Opera '+tem[1];\n }\n M= M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];\n if((tem= ua.match(/version\\/(\\d+)/i))!= null) M.splice(1, 1, tem[1]);\n return M.join(' ');\n })();\n\n}", "title": "" }, { "docid": "c17b32c4e6d92eea73f9a93e450a3422", "score": "0.5553042", "text": "function detectBrowser() {\n document.write(\"<b>\" + termBrowser + \":</b> \" + navigator.appName + \" \" + navigator.appVersion + \"<br />\");\n document.write(\"<b>\" + termPlatform + \":</b> \" + navigator.platform + \"<br />\");\n}", "title": "" }, { "docid": "1dec631a3cbe0bb7a4ec986af50a9337", "score": "0.55489534", "text": "function fnGetBrowserName()\n\t{\n\t\tvar nAgt = navigator.userAgent;\n\t\tif((verOffset=nAgt.indexOf(\"MSIE\"))!=-1) {\n\t\t\t//browserName = \"Microsoft Internet Explorer\";\n\t\t\tbrowserName = BROWSER_IE; \n\t\t}\n\t\telse if((verOffset=nAgt.indexOf(\"Chrome\"))!=-1) {\n\t\t\t//browserName = \"Chrome\";\n\t\t\tbrowserName = BROWSER_CHROME;\n\t\t}\n\t\telse if((verOffset=nAgt.indexOf(\"Firefox\"))!=-1) {\n\t\t\t//browserName = \"Firefox\";\n\t\t\tbrowserName = BROWSER_FIREFOX;\n\t\t}\n\t\telse{\n\t\t\t//browserName = \"Others\";\n\t\t\tbrowserName = BROWSER_OTHERS;\n\t\t}\n\t\treturn browserName;\n\t}", "title": "" }, { "docid": "85089506ab33363c44f22a87fddaa74a", "score": "0.5543682", "text": "function i(e){var n=(e||S).toLowerCase();var i=/(webkit)[ \\/]([\\w.]+)/;var t=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var r=/(msie) ([\\w.]+)/;var o=/(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;var a=/(edge)[ \\/]([\\w.]+)/;var s=/(mozilla)(?:.*? rv:([\\w.]+))?/;var u=a.exec(n)||o.exec(n)||i.exec(n)||t.exec(n)||r.exec(n)||n.indexOf(\"compatible\")<0&&s.exec(n)||[];var d={browser:u[1]||\"\",version:u[2]||\"0\"};d[d.browser]=true;return d}", "title": "" }, { "docid": "85089506ab33363c44f22a87fddaa74a", "score": "0.5543682", "text": "function i(e){var n=(e||S).toLowerCase();var i=/(webkit)[ \\/]([\\w.]+)/;var t=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var r=/(msie) ([\\w.]+)/;var o=/(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;var a=/(edge)[ \\/]([\\w.]+)/;var s=/(mozilla)(?:.*? rv:([\\w.]+))?/;var u=a.exec(n)||o.exec(n)||i.exec(n)||t.exec(n)||r.exec(n)||n.indexOf(\"compatible\")<0&&s.exec(n)||[];var d={browser:u[1]||\"\",version:u[2]||\"0\"};d[d.browser]=true;return d}", "title": "" }, { "docid": "c583fbe5b36c32314e499cc3185f3501", "score": "0.5543279", "text": "function UserAgentService($window) {\n\n var userAgentService = {\n getUserAgent: getUserAgent,\n isMobile: isMobile,\n isIOS: isIOS,\n isAndroid: isAndroid,\n isMobileSafari: isMobileSafari\n };\n\n /**\n * Get userAgent\n */\n function getUserAgent() {\n return $window.navigator.userAgent;\n }\n\n /**\n * Detect if user is using mobile device\n */\n function isMobile() {\n var userAgent = userAgentService.getUserAgent();\n\n if(angular.isDefined(userAgent)) {\n return userAgent.match(/Android/i) !== null || userAgent.match(/webOS/i) !== null ||\n userAgent.match(/iPhone/i) !== null || userAgent.match(/iPad/i) !== null ||\n userAgent.match(/iPod/i) !== null || userAgent.match(/BlackBerry/i) !== null ||\n userAgent.match(/Windows Phone/i) !== null;\n }\n\n return false;\n }\n\n /**\n * Detect if user is using iOS device\n */\n function isIOS() {\n var userAgent = userAgentService.getUserAgent();\n\n if(angular.isDefined(userAgent)) {\n return userAgent.match(/iPhone/i) !== null || userAgent.match(/iPad/i) !== null ||\n userAgent.match(/iPod/i) !== null;\n }\n\n return false;\n }\n\n /**\n * Detect if user is using Android device\n */\n function isAndroid() {\n var userAgent = userAgentService.getUserAgent();\n\n if(angular.isDefined(userAgent)) {\n return userAgent.match(/Android/i) !== null;\n }\n\n return false;\n }\n\n /**\n * Detect if user is using mobile Safari browser\n */\n function isMobileSafari() {\n var userAgent = userAgentService.getUserAgent();\n\n if(angular.isDefined(userAgent)) {\n return (userAgent.match(/iPhone/i) !== null || userAgent.match(/iPad/i) !== null ||\n userAgent.match(/iPod/i) !== null) && userAgent.match(/WebKit/i) !== null &&\n userAgent.match(/CriOS/i) === null;\n }\n\n return false;\n }\n\n return userAgentService;\n\n}", "title": "" }, { "docid": "ab05a9a3727f717e42cac8e01e5e8bd9", "score": "0.553413", "text": "function browserNaV() {\n\tvar NaV=\"\";\n\tif (document.documentMode==\"7\") return \"msie7\";\n\tif ($.browser.msie) NaV=\"msie\"; \n\telse if ($.browser.chrome) NaV=\"chrome\";\n\telse if ($.browser.mozilla) NaV=\"mozilla\";\n\telse if($.browser.opera) NaV=\"opera\"\n\telse if ($.browser.safari) NaV=\"safari\";\n\tNaV+=parseInt($.browser.version);\n\treturn NaV;\n}", "title": "" }, { "docid": "936cc6262f80bbca1ac27ae7837d08da", "score": "0.5522446", "text": "function getBrowser()\n{\n var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor),\n isSafari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor);\n\n if (isChrome) {\n return \"chrome\";\n } else if (isSafari) {\n return \"safari\";\n } else {\n return \"other\";\n }\n}", "title": "" }, { "docid": "5b053521d6bcae35415643b096f4c67b", "score": "0.55189973", "text": "function getOS() {\n var userAgent = window.navigator.userAgent,\n platform = window.navigator.platform,\n macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'],\n windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'],\n iosPlatforms = ['iPhone', 'iPad', 'iPod'],\n os = null;\n\n if (macosPlatforms.indexOf(platform) !== -1) {\n os = 'Mac OS';\n } else if (iosPlatforms.indexOf(platform) !== -1) {\n os = 'iOS';\n } else if (windowsPlatforms.indexOf(platform) !== -1) {\n os = 'Windows';\n } else if (/Android/.test(userAgent)) {\n os = 'Android';\n } else if (!os && /Linux/.test(platform)) {\n os = 'Linux';\n }\n\n return os;\n }", "title": "" }, { "docid": "19ed9df1837e3747c1d36373969dd9b6", "score": "0.5509886", "text": "function getMajorVersion (regExp) {\n var matchArr = userAgt.match(regExp);\n if (matchArr && matchArr.length > 1) {\n var majVer = matchArr[1].split(\".\");\n if (majVer && majVer.length > 0) { return majVer[0]; }\n }\n return this.unknownPlatformVer;\n }", "title": "" }, { "docid": "2c84a7c0adc8ecad9633cf2c55b6bb0d", "score": "0.5493029", "text": "static set userAgent(uA) {\n Browser.uA = uA;\n window.browserDetails = {};\n }", "title": "" }, { "docid": "2c84a7c0adc8ecad9633cf2c55b6bb0d", "score": "0.5493029", "text": "static set userAgent(uA) {\n Browser.uA = uA;\n window.browserDetails = {};\n }", "title": "" }, { "docid": "2c84a7c0adc8ecad9633cf2c55b6bb0d", "score": "0.5493029", "text": "static set userAgent(uA) {\n Browser.uA = uA;\n window.browserDetails = {};\n }", "title": "" }, { "docid": "bd3e4fc6c7cd16f2573cd97106936bdd", "score": "0.54896796", "text": "function getBrowser(req, res, next) {\n req.browser = req.header['user-agent'];\n next();\n}", "title": "" }, { "docid": "4e5d43c246d8e09edf734d5a93a23573", "score": "0.5472338", "text": "function CheckBrowserInfo(infoType)\n{\n\tvar vBrowserInfoName, vReturnValue, vBrowserInfoVersion\n\t//Determine what kind of browser information to return.\n\tswitch (infoType)\n\t{\n\t\tcase \"name\":\n\t\t\tif (is_gecko)\n\t\t\t{\n\t\t\t\t// Star Office (3.0) incorrectly reports itself as nn in \"appName\"\n\t\t\t\t// Check \"appversion\" instead and change if necessary\n\t\t\t\tvBrowserInfoName = (navigator.appVersion && navigator.appVersion.indexOf(\"StarView\") >= 0) ? browserSO : browserNN;\n\t\t\t\tvBrowserInfoName = is_fx ? browserFF : browserNN;\n\t\t\t}\n\t\t\t//Check to see if \"appName\" contains \"Microsoft\".\n\t\t\telse if (is_ie)\n\t\t\t{\n\t\t\t\tvBrowserInfoName = browserIE;\n\t\t\t}\n\t\t\t//Return \"Unknown\" if \"appName\" matches neither \"Netscape\" nor \"Microsoft\" match.\n\t\t\telse if (is_safari)\n\t\t\t{\n\t\t\t\tvBrowserInfoName = browserSafari;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvBrowserInfoName = browserUnknown;\n\t\t\t}\n\t\t\t//Return the browser name.\n\t\t\tvReturnValue = vBrowserInfoName;\n\t\t\tbreak;\n\t\tcase \"version\":\n\t\t\t//Return the browser version.\n\t\t\tvBrowserInfoVersion = is_major;\n\t\t\tvReturnValue = vBrowserInfoVersion;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t//Return nothing if \"infoType\" is not specified.\n\t\t\tvReturnValue = 0;\n\t}\n\t//Return the requested browser information.\n\treturn vReturnValue;\n}", "title": "" }, { "docid": "fd26af053c44e1d937294f19bd83da72", "score": "0.5461869", "text": "function getBrowserVersionOrZero(browserName) {\r\n var match = new RegExp(browserName + '[ /](\\\\d+(\\\\.\\\\d+)?)', 'i').exec(USER_AGENT);\r\n return match ? +match[1] : 0;\r\n}", "title": "" } ]
d24782c1a8da6d13579c150e862ae56e
set attribute for easier reference and set image position to absolute
[ { "docid": "1e79376ab5b2d0ef694df99662ebe8fc", "score": "0.0", "text": "function animateCursor(circle) { \n\n let current = circle.getAttribute('src');\n\n let count = cursorArray.indexOf(current); \n\n if (count < 16) {\n count++;\n\n setTimeout(function() {\n circle.setAttribute('src', cursorArray[count]);\n }, 200);\n } else {\n count = 0;\n\n setTimeout(function() {\n circle.setAttribute('src', cursorArray[count]);\n }, 200);\n } \n}", "title": "" } ]
[ { "docid": "f434aa33eff99dd76c7c3bfc043c526e", "score": "0.6201611", "text": "function setSrc(element, attribute){\r\n element.setAttribute(attribute, element.getAttribute('data-' + attribute));\r\n element.removeAttribute('data-' + attribute);\r\n }", "title": "" }, { "docid": "51673ae21a2e6965df96e35018f3a051", "score": "0.6184779", "text": "function setSrc(element, attribute){\r\n element\r\n .attr(attribute, element.data(attribute))\r\n .removeAttr('data-' + attribute);\r\n }", "title": "" }, { "docid": "ec95dbe3493b99a282d2f2322555d604", "score": "0.6183391", "text": "function setSrc(element, attribute){\n element\n .attr(attribute, element.data(attribute))\n .removeAttr('data-' + attribute);\n }", "title": "" }, { "docid": "ec95dbe3493b99a282d2f2322555d604", "score": "0.6183391", "text": "function setSrc(element, attribute){\n element\n .attr(attribute, element.data(attribute))\n .removeAttr('data-' + attribute);\n }", "title": "" }, { "docid": "ec95dbe3493b99a282d2f2322555d604", "score": "0.6183391", "text": "function setSrc(element, attribute){\n element\n .attr(attribute, element.data(attribute))\n .removeAttr('data-' + attribute);\n }", "title": "" }, { "docid": "00edf8e3684bbdd9e1131b25e4178154", "score": "0.61612046", "text": "function imgPosition() {\r\n var img = $('.img-full-width-case-study .img-content'); \r\n var position = $('.img-full-width-case-study .img-content').attr('data-position');\r\n $(img).css({\r\n backgroundPosition: 100 +'%' + position + '%'\r\n });\r\n}", "title": "" }, { "docid": "0c09633709ec30dc0f8303aebf494c7e", "score": "0.6099836", "text": "function changeAttribute(data_array) {\n// data_array = [ele_object, att_to_change, new_att, remove_attr]\nvar ele_object = data_array[0];\nvar attr_to_change = data_array[1];\nvar new_attr = data_array[2];\nvar remove_attr = data_array[3];\t\t// a string yes/no/change_attr_to if new_attr already exist\n\nvar ele_attr = ele_object.getAttribute(attr_to_change);\nif (ele_attr === null || ele_attr !== new_attr) \t{\n//set the attribute and the image become large\nele_object.setAttribute(attr_to_change, new_attr);\n} else\n if (ele_attr === new_attr && remove_attr === \"yes\") {\n//remove the attribute. the image become small\nele_object.removeAttribute(attr_to_change);\n} \t\nelse if (ele_attr === new_attr && remove_attr === \"no\") {\n//no action taken\n}\nelse if(ele_attr === new_attr && (remove_attr !== \"yes\" || remove_attr !== \"no\" || remove_attr !== \"undefined\")){\nvar change_to = remove_attr;\nele_object.setAttribute(attr_to_change, remove_attr);\n} \n\n}", "title": "" }, { "docid": "b49965a5dc067df2dcf8eb7546dc11b5", "score": "0.60657734", "text": "function init() {\n imgObj = document.getElementById('RMovil');\n imgObj.style.position = 'absolute';\n imgObj.style.top = '0px';\n imgObj.style.left = '143px';\n //document.getElementById(\"Measure\").innerHTML = 0.00;\n}", "title": "" }, { "docid": "6718386b3235659ac215c2077b0c3d5b", "score": "0.60620713", "text": "updatePositionX(x){\n this.imageX = x;\n }", "title": "" }, { "docid": "3644899fbb85f192a23518ec7c5e1b23", "score": "0.6022083", "text": "function setImg(item){\r\n\tlet id = \"drop\"+item.id;\r\n\r\n\tlet dropPos = $(\"#\"+id).position();\r\n\r\n\tlet leftPos = dropPos.left+$(\"#\"+id).width()/2-$(\"#\"+item.id).width()/2;\r\n\tlet topPos = dropPos.top+$(\"#\"+id).height()/2-$(\"#\"+item.id).height()/2;\r\n\r\n\t$(\"#\"+item.id).css({top: topPos, left: leftPos});\r\n\r\n\r\n\tsetCorrect(item, true);\r\n}", "title": "" }, { "docid": "f2f2f665dec93b928ef230beac1a1cde", "score": "0.6011336", "text": "function normalImg(x) {\n x.style.height = \"192px\";\n x.style.width = \"108px\";\n}", "title": "" }, { "docid": "a65a408b4f2d21136a0d6149ec4d9ed3", "score": "0.60052025", "text": "updateImage() {\n document.getElementById(\"img-\" + String(super.getPos())).src = this.getImage();\n }", "title": "" }, { "docid": "866f8ead18336024fd86a81853131443", "score": "0.5980067", "text": "function drawImage(attr) {\n $('.slider-current img').attr('src', `${API_URL}${BIG_SIZE}/${attr}`);\n $('.slider-current img').attr('getimg', attr);\n drawBorder(attr);\n}", "title": "" }, { "docid": "da485517527279fe7044b2e4703dbc92", "score": "0.5940675", "text": "function positionZoomImg() {\n\t$(\"#zoomCon img\").css({\n\t\t\"left\": \"0 !important\",\n\t\t\"top\": \"0 !important\",\n\t})\n\t$(\"#zoomCon\").css({\"overflow\": \"visible !important\"})\n}", "title": "" }, { "docid": "62bc338c0e53deca01508a690ca9f7cc", "score": "0.58924973", "text": "set imageUrl(url) {\n this.setAttribute(\"image-url\", url);\n }", "title": "" }, { "docid": "d7636aea103763adeb987ce26192bb81", "score": "0.5883031", "text": "function changer(pic, attr, attrValue) {\n\tpic.setAttribute(attr, attrValue);\n}", "title": "" }, { "docid": "0515e521ab4334e13582e0fa84395d72", "score": "0.58306354", "text": "function changeappearance() {\n\tvar selection = document.getElementById(\"align\").value;\n\tvar img = document.getElementById(\"myImg\");\n\timg.setAttribute(\"align\",selection);\n}", "title": "" }, { "docid": "0515e521ab4334e13582e0fa84395d72", "score": "0.58306354", "text": "function changeappearance() {\n\tvar selection = document.getElementById(\"align\").value;\n\tvar img = document.getElementById(\"myImg\");\n\timg.setAttribute(\"align\",selection);\n}", "title": "" }, { "docid": "70549ad795c90313a3bf34df6a3e9cba", "score": "0.5796094", "text": "function initImages() {\r\n nouvelleImage(position);\r\n}", "title": "" }, { "docid": "be9c9a7f3d48564317f10e839268975e", "score": "0.57918626", "text": "updateSrc_() {\n const src = buildUrl(this.publicId_, this.options_);\n this.image_.setAttribute('src', src || '');\n }", "title": "" }, { "docid": "ab557a9986ce78c8fc5a61b4f4ea465f", "score": "0.57776713", "text": "static get tag() {\n return \"absolute-position-behavior\";\n }", "title": "" }, { "docid": "e131b96d5899f6de8daed4ced5b89b46", "score": "0.5763037", "text": "function setPosition(){\r\n\tdocument.querySelectorAll('.kraj').forEach(item =>{\r\n\r\n\t \titem.style.position = 'absolute';\r\n\t\tsetImg(item);\r\n\t})\r\n\tcheckEnd();\r\n}", "title": "" }, { "docid": "92aaf99f3524b05dc7d9fbca6cbfcdd3", "score": "0.5748956", "text": "set src(value){\r\n\t\tvar that = this\r\n\t\tthis.__update_handler = this.__update_handler \r\n\t\t\t|| this.update.bind(this)\r\n\t\tvar url = typeof(value) == typeof('str')\r\n\t\t// get/create image...\r\n\t\tvar img = this.image = \r\n\t\t\turl ?\r\n\t\t\t\t//(this.image || document.createElement('img'))\r\n\t\t\t\t// XXX HACK: image-orientation only works if element is attached to DOM...\r\n\t\t\t\t(this.image || this.__shadow.querySelector('img'))\r\n\t\t\t\t: value\r\n\t\timg.removeEventListener('load', this.__update_handler)\r\n\t\timg.addEventListener('load', this.__update_handler)\r\n\t\t// set .src and img.src...\r\n\t\tthis.setAttribute('src', \r\n\t\t\turl ? \r\n\t\t\t\t(img.src = value)\r\n\t\t\t\t: img.src) }", "title": "" }, { "docid": "7a7f2d5ad91985b0633841ac17fb20ac", "score": "0.5748165", "text": "imgpos (lft, hei) {\n try {\n this.image().style({ \"margin-left\" : lft });\n let syn = this.image().effect({ name: \"SyncHei\" });\n if (true === comutl.isinc(syn, \"SyncHei\") ) {\n syn.offset(hei);\n }\n\t} catch (e) {\n console.error(e.stack);\n throw e;\n\t}\n }", "title": "" }, { "docid": "b19d8b794bbab08861433228583fe758", "score": "0.57241076", "text": "place_image (image_name, args) {\n let [x, y, value] = this . positions (args);\n\n let path = '../Images/' + image_name;\n let image = this . board . image (path);\n\n //\n // Scale the image to be 80% of the size a square,\n // and place it 10% away from the edges.\n //\n let rect_size = this . rect_size;\n image . size (rect_size * .8, rect_size * .8);\n image . center (rect_size * x, rect_size * y);\n\n if (\"id\" in args) {\n image . id (args . id);\n }\n if (\"class\" in args) {\n image . addClass (args . class);\n }\n\n return (image);\n }", "title": "" }, { "docid": "e4f357bcb86b4f1c36bb723220839eaf", "score": "0.5721329", "text": "function MakeNormal(i){\r\nImages[i].setAttribute(\"src\",imageArray[i]);\r\n}", "title": "" }, { "docid": "c626233051f96bd508f7b50ec03a1d62", "score": "0.5702264", "text": "function normalImg(x) {\n x.style.height = \"300px\";\n x.style.width = \"300px\";\n}", "title": "" }, { "docid": "49fe39da58812f2fc7e62314d5d9c4d9", "score": "0.5663626", "text": "setImg() {\n this.putImageData(this.currImg, 0, 0);\n }", "title": "" }, { "docid": "3d823312d476b6b6fa5e529848b1a5c7", "score": "0.5656203", "text": "function placement(holder, event, x, y) {\n let img = document.createElement('img');\n if (holder.length > 0) {\n img.setAttribute('src', holder[0]);\n img.setAttribute('id', toString(x) + toString(y))\n event.target.appendChild(img);\n holder.shift();\n }\n}", "title": "" }, { "docid": "79fa434607c7e2fa444b85dd1450152e", "score": "0.56560385", "text": "function cambiaOff() {\n this.src = this.imagenOff.src;//tomamos los valores ya asociados\n}", "title": "" }, { "docid": "b8c9b831a87b74c30d4b171ed3165251", "score": "0.56503874", "text": "function setPhoto(position,preset) {\n $(\".\" + position + \" .photo\").removeClass(\"dashed\");\n if(presetImageName[preset]) {\n if($(\".\" + position + \" .photo\").has(\"img\").length) {\n $(\".\" + position + \" .photo img\").replaceWith(\"<img src=\\\"images/\"+presetImageName[preset]+\".png\\\">\"); \n $(\".\" + position + \" .photo span\").replaceWith(\"<img src=\\\"images/\"+presetImageName[preset]+\".png\\\">\");\n } else {\n $(\".\" + position + \" .photo span\").replaceWith(\"<img src=\\\"images/\"+presetImageName[preset]+\".png\\\">\"); \n }\n } else {\n if($(\".\" + position + \" .photo\").has(\"img\").length.length) {\n $(\".\" + position + \" .photo img\").replaceWith(\"<img src=\\\"images/Blank.png\\\">\");\n } else {\n $(\".\" + position + \" .photo span\").replaceWith(\"<img src=\\\"images/Blank.png\\\">\"); \n }\n }\n}", "title": "" }, { "docid": "c94a1b586ebfcc6f3d7ccad763605da1", "score": "0.5621634", "text": "function setImage(item, index) {\n \n \n if( arrGame[index] === \"player1\" ) {\n \n item.setAttribute('src', player1Mark);\n \n \n } else if( arrGame[index] === \"player2\") {\n \n item.setAttribute('src', player2Mark);\n \n } else {\n \n item.setAttribute('src', \"\");\n \n }\n \n}", "title": "" }, { "docid": "8c223b147ceda4d9cef9fbdf4cf22810", "score": "0.5610884", "text": "function setDefaultAttributes(picture) {\n picture.attr({\n fill: innerPicturesBackgroundColor,\n stroke: innerPicturesBorderColor,\n 'stroke-width': innerPicturesBorderWidth\n });\n\n moveCoordinatesToNextValidPosition();\n}", "title": "" }, { "docid": "5c78eafc59a42b853e9b5af293ab18fc", "score": "0.56080604", "text": "constructor(position, image, click) {\n this.pos = position;\n this.image = image;\n this.click = click;\n }", "title": "" }, { "docid": "e673279764a989eef848e45d8dfc0819", "score": "0.560539", "text": "function image() {\n _image.setAttribute('src', images[secretWords.indexOf(word)])\n}", "title": "" }, { "docid": "8f36583d27da11ca495d53112f479d44", "score": "0.55978096", "text": "set imageName (val){\n this._imageName = val\n this._loadSprite()\n }", "title": "" }, { "docid": "26fc48f97050bac3391e1790d73ec4d1", "score": "0.5596713", "text": "_getImageStyle(size){let offset=\"22%\",diameter=\"56%\";if(\"xs\"===this.size){offset=\"32%\";diameter=\"36%\"}else if(\"sm\"===this.size){offset=\"26%\";diameter=\"48%\"}else if(\"lg\"===this.size){offset=\"20%\";diameter=\"60%\"}else if(\"xl\"===this.size){offset=\"17%\";diameter=\"66%\"}return\"left: \"+offset+\"; top: \"+offset+\"; width: \"+diameter+\"; height: \"+diameter+\";\"}", "title": "" }, { "docid": "b4205dbcc419627412dbb2cd2a1b8f50", "score": "0.5596619", "text": "set attribute(value) {}", "title": "" }, { "docid": "a59d64ac0b2659838919dbdb2b19f6db", "score": "0.5595464", "text": "display() {\r\n\t\timage(this.img, this.location.x, this.location.y);\r\n\t}", "title": "" }, { "docid": "e25b3cdb91e67877a0ad380d1138fbb6", "score": "0.5593696", "text": "set image(val) {\n this._imgSource = val;\n this._width = this._fitWidth();\n this._pattern = null;\n }", "title": "" }, { "docid": "9277a8402a485e62306339746371d9e0", "score": "0.55859005", "text": "function setValue() {\n if (playGame == true) {\n\n $(\".img img:last-child\").remove()\n\n var num = container[generateRandomForArray()];\n var size = generateSize();\n img.append(\"<img class='size' style='width:\" + size + \"px' src ='img/\" + num + \".png'>\");\n //debugger;\n var left = generateRandomWidth();\n //co ordinates on the x -axis\n var top = generateRandomHeight();\n //co ordinates on the y -axis\n img.last().css({\n \"position\": \"absolute\",\n \"top\": top + \"px\",\n \"left\": left + \"px\",\n \"width\": size + \"px\",\n \"height\": size + \"px\"\n });\n }\n }", "title": "" }, { "docid": "3168cc6f7d10656841330468d045b8ba", "score": "0.5576492", "text": "setImage(){\n this.sprite = (this.speedMultiplier > 2) ? this.images[1] : this.images[0];\n }", "title": "" }, { "docid": "0c60432744badc901a9b09909349c398", "score": "0.55750513", "text": "function posImg(position) {\r\n if (!imgFullSize) {\r\n return;\r\n }\r\n\r\n if (position === undefined || position.top === undefined || position.left === undefined) {\r\n position = {top:mousePos.top, left:mousePos.left};\r\n }\r\n\r\n var offset = 20,\r\n padding = 17,\r\n statusBarHeight = 12,\r\n wndWidth = window.innerWidth,\r\n wndHeight = window.innerHeight,\r\n wndScrollLeft = (document.documentElement && document.documentElement.scrollLeft) || document.body.scrollLeft,\r\n wndScrollTop = (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop,\r\n bodyWidth = document.body.clientWidth,\r\n displayOnRight = (position.left - wndScrollLeft < wndWidth / 2);\r\n \r\n function posCaption() {\r\n if (hzCaption) {\r\n hzCaption.css('max-width', imgFullSize.width());\r\n if (hzCaption.height() > 20) {\r\n hzCaption.css('font-weight', 'normal');\r\n }\r\n // This is looped 10x max just in case something\r\n // goes wrong, to avoid freezing the process.\r\n var i = 0;\r\n while (hz.hzImg.height() > wndHeight - statusBarHeight && i++ < 10) {\r\n imgFullSize.height(wndHeight - padding - statusBarHeight - hzCaption.height()).width('auto');\r\n hzCaption.css('max-width', imgFullSize.width());\r\n }\r\n }\r\n }\r\n\r\n if (displayOnRight) {\r\n position.left += offset;\r\n } else {\r\n position.left -= offset;\r\n }\r\n\r\n if (hz.imgLoading) {\r\n position.top -= 10;\r\n if (!displayOnRight) {\r\n position.left -= 25;\r\n }\r\n\r\n } else {\r\n\r\n var fullZoom = options.mouseUnderlap ;\r\n\r\n imgFullSize.width('auto').height('auto');\r\n\r\n // Image natural dimensions\r\n imgDetails.naturalWidth = imgFullSize.width();\r\n imgDetails.naturalHeight = imgFullSize.height();\r\n if (!imgDetails.naturalWidth || !imgDetails.naturalHeight) {\r\n return;\r\n }\r\n\r\n // Width adjustment\r\n if (fullZoom) {\r\n imgFullSize.width(Math.min(imgDetails.naturalWidth, wndWidth - padding + wndScrollLeft));\r\n } else {\r\n if (displayOnRight) {\r\n if (imgDetails.naturalWidth + padding > wndWidth - position.left) {\r\n imgFullSize.width(wndWidth - position.left - padding + wndScrollLeft);\r\n }\r\n } else {\r\n if (imgDetails.naturalWidth + padding > position.left) {\r\n imgFullSize.width(position.left - padding - wndScrollLeft);\r\n }\r\n }\r\n }\r\n\r\n // Height adjustment\r\n if (hz.hzImg.height() > wndHeight - padding - statusBarHeight) {\r\n imgFullSize.height(wndHeight - padding - statusBarHeight).width('auto');\r\n }\r\n\r\n posCaption();\r\n\r\n position.top -= hz.hzImg.height() / 2;\r\n\r\n // Display image on the left side if the mouse is on the right\r\n if (!displayOnRight) {\r\n position.left -= hz.hzImg.width() + padding;\r\n }\r\n\r\n // Horizontal position adjustment if full zoom\r\n if (fullZoom) {\r\n if (displayOnRight) {\r\n position.left = Math.min(position.left, wndScrollLeft + wndWidth - hz.hzImg.width() - padding);\r\n } else {\r\n position.left = Math.max(position.left, wndScrollLeft);\r\n }\r\n }\r\n\r\n // Vertical position adjustments\r\n var maxTop = wndScrollTop + wndHeight - hz.hzImg.height() - padding - statusBarHeight;\r\n if (position.top > maxTop) {\r\n position.top = maxTop;\r\n }\r\n if (position.top < wndScrollTop) {\r\n position.top = wndScrollTop;\r\n }\r\n }\r\n\r\n\r\n // This fixes positioning when the body's width is not 100%\r\n if (body100pct) {\r\n position.left -= (wndWidth - bodyWidth) / 2;\r\n }\r\n\r\n hz.hzImg.css({top:Math.round(position.top), left:Math.round(position.left)});\r\n }", "title": "" }, { "docid": "78a96fd1ac12eeabb98c61e1064400df", "score": "0.5574489", "text": "function setOriginAttribute(orElement, orAttribute) {\r\n orElement.setAttribute(\"origin_\" + orAttribute, orElement.getAttribute(orAttribute));\r\n }", "title": "" }, { "docid": "3ac4dc9e65e91f9c12a5b58a013a5d33", "score": "0.55733603", "text": "function property_set(image) {\r\n\t\tself.width = image.width;\r\n\t\tself.height = image.height;\r\n\r\n\t\tif(typeof on_load ==='function'){ on_load(self); }\r\n\t}", "title": "" }, { "docid": "683109f8bd799165098450a26db1a662", "score": "0.5564942", "text": "pintar(){\n this.tag.setAttribute(\"x\", this.x);\n this.tag.setAttribute(\"y\", this.y);\n }", "title": "" }, { "docid": "53bea628b23414b88e1a3565bb8c1643", "score": "0.5564735", "text": "place(xPos, yPos) {\n this.x = xPos;\n this.y = yPos;\n this.img.css(\"top\", yPos + \"px\");\n this.img.css(\"left\", xPos + \"px\");\n var websiteURL = this.img.attr(\"sid\");\n if (websiteURL) {\n this.img.click(function() {\n window.location.href = websiteURL;\n });\n }\n }", "title": "" }, { "docid": "f577003fce20c843a53e3e47ad4e46dd", "score": "0.55569685", "text": "cardImageLoaded() {\n\t\tif (this.cardImageRef.current) {\n\t\t\t// Not yet seen (default pos)\n\t\t\tif (this.props.cardImgTx === null) {\n\t\t\t\tthis.cardImageRef.current.setAttribute('data-xp', 0);\n\t\t\t\tthis.cardImageRef.current.setAttribute('data-yp', 0);\n\t\t\t} else {\n\t\t\t\tthis.cardImageRef.current.style.transform =\n\t\t\t\tthis.cardImageRef.current.style.webkitTransform =\n\t\t\t\t\t`translate(${this.props.cardImgTx}px, ${this.props.cardImgTy}px)`;\n\t\t\t\tthis.cardImageRef.current.setAttribute('data-xp', this.props.cardImgTx);\n\t\t\t\tthis.cardImageRef.current.setAttribute('data-yp', this.props.cardImgTy);\n\t\t\t}\n\n\t\t\tif (this.props.cardImgH !== null) {\n\t\t\t\tthis.cardImageRef.current.style.height = `${this.props.cardImgH}px`;\n\t\t\t\tthis.cardImageRef.current.style.width = `${this.props.cardImgW}px`;\n\t\t\t} else {\n\t\t\t\tthis.cardImageRef.current.style.height = '';\n\t\t\t\tthis.cardImageRef.current.style.width = '';\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "78d27b21c9a6b7e98abe43a3e4098c15", "score": "0.5554741", "text": "function setImage(x) {\n selectedIndex = setIndex(x);\n indexCheck();\n caption = getCaption(x);\n selectedThumb = $(x).attr('src');\n selectedFull = selectedThumb.replace('-thumb', '-full');\n selectedPre = selectedThumb.replace('-thumb', '-pre');\n }", "title": "" }, { "docid": "ecb599aab13439bc5c55f033e582964e", "score": "0.55382586", "text": "function copyPositionToThumbOverlayImage(objImage){\n\t\t\t\t\t\t\n\t\t\tvar objImageBW = objImage.siblings(\".ug-thumb-image-overlay\");\n\t\t\tif(objImageBW.length == 0)\n\t\t\t\treturn(false);\n\t\t\t\n\t\t\tvar objSize = g_functions.getElementSize(objImage);\n\t\t\t\t\n\t\t\tvar objCss = {\n\t\t\t\t\t\"width\":objSize.width+\"px\",\n\t\t\t\t\t\"height\":objSize.height+\"px\",\n\t\t\t\t\t\"left\":objSize.left+\"px\",\n\t\t\t\t\t\"top\":objSize.top+\"px\"\n\t\t\t\t}\n\t\t\t\t\n\t\t\tobjImageBW.css(objCss);\n\t\t\t\n\t\t\t//show the image\n\t\t\tif(g_temp.customThumbs == false)\n\t\t\t\tobjImageBW.fadeTo(0,1);\n\t\t\t\n\t\t}", "title": "" }, { "docid": "0e0afb5b83b0b901a406fe3ea0e278fe", "score": "0.5537292", "text": "function setPosition() {\n if (container) {\n if (x < container.left) {\n x = container.left;\n } else if (x > container.right - width) {\n x = container.right - width;\n }\n if (y < container.top) {\n y = container.top;\n } else if (y > container.bottom - height) {\n y = container.bottom - height;\n }\n }\n\n elem.css({\n top: y + 'px',\n left: x + 'px'\n });\n }", "title": "" }, { "docid": "825be50be442ce02a305ad5126d53777", "score": "0.552896", "text": "function _setDragImage(element, x, y) {\n if (_dragImage) {\n _dragImage.end();\n _dragImage = null;\n }\n\n if (element && element.cloneNode) {\n _dragImageOffset = {x: x, y: y};\n _dragImage = new DragImage(element, x, y);\n _dragImage.start();\n }\n }", "title": "" }, { "docid": "cb0a7bd975684b7b34196616f6bfb47f", "score": "0.5528307", "text": "function changeWinnerImage(targetElement, image){\n targetElement.setAttribute(\"src\", image);\n}", "title": "" }, { "docid": "c3c43a9bef6ee4bb7a159892a47813e5", "score": "0.5525858", "text": "setShape() {\n $(this.el).css({\n \"width\":this.width,\n \"height\":this.height,\n \"z-index\":\"1\"\n });\n }", "title": "" }, { "docid": "beea816164ae5e8ec5ced5b039917c57", "score": "0.5512925", "text": "displayImage() {\n push();\n translate(this.image.x, this.image.y);\n imageMode(CENTER);\n // scale(0.9);\n image(this.image.file, 0, 0);\n pop();\n }", "title": "" }, { "docid": "9f2b129257a8de64c00dad68f7aa1c07", "score": "0.5509516", "text": "function setPosition(sprite) {\n var e = document.getElementById(sprite.element);\n e.style.left = sprite.x + 'px';\n e.style.top = sprite.y + 'px';\n }", "title": "" }, { "docid": "0682ec76f9a496904fdb16f21bc51994", "score": "0.54994303", "text": "function _copyAttributes(src, tar) {\n if (src.getAttribute('data-width') && src.getAttribute('data-height')) {\n tar.width = src.getAttribute('data-width');\n tar.height = src.getAttribute('data-height');\n }\n else {\n tar.removeAttribute('width');\n tar.removeAttribute('height');\n }\n }", "title": "" }, { "docid": "d870d482bdab1967fc45f64d4edb53c1", "score": "0.54982156", "text": "function newPosition(e) {\n var imageElement = document.getElementById(imageId);\n var imageXY = findPos(imageElement);\n\n var x = e.pageX - imageXY[0];\n var y = e.pageY - imageXY[1];\n\n model.re = model.re - (model.size/model.ppu)/2 + x / model.ppu;\n model.im = model.im + (model.size/model.ppu)/2 - y / model.ppu;\n\n updateImage();\n return;\n}", "title": "" }, { "docid": "931790e89248ed8cd0f204267fb28612", "score": "0.5486133", "text": "function setImage(url){\r\n // Set the SRC value\r\n setSRC(url);\r\n // Set the hidden image \"src\"\r\n setHiddenImage(url);\r\n // Set the displayed poster \"src\"\r\n setPoster(url);\r\n}", "title": "" }, { "docid": "e4de65942326335ccb5411e9ec1514fd", "score": "0.5485779", "text": "set position(value) {\n this.sprite.position = value;\n }", "title": "" }, { "docid": "00220e025f41d0845d42478b3d6b0d94", "score": "0.54836076", "text": "function setImage(obj){\n\t\tvar image = new Image();\n\t\tif(obj.type == 1){\n\t\t\timage.src = app.IMAGES['scrapRed'];\n\t\t}\n\t\telse if(obj.type == 2){\n\t\t\timage.src = app.IMAGES['scrapBlue'];\n\t\t}\n\t\telse if(obj.type == 3){\n\t\t\timage.src = app.IMAGES['scrapYellow'];\n\t\t}\n\t\tobj.image = image;\n\t}", "title": "" }, { "docid": "ab43dbffde10200bc8fcf8c19d2395e2", "score": "0.5483293", "text": "function imagePosition() {\nlet imageElement = document.getElementsByTagName(\"img\");\n Array.from(imageElement).forEach((element) => {\n element.style.display = \"block\";\n element.style.margin = \"auto\";\n });\n}", "title": "" }, { "docid": "282fe0812810900c940327ee9bf57d20", "score": "0.5482665", "text": "constructor(parent, x, y, image) {\n\t\tthis._parent = parent;\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._image = image;\n\t}", "title": "" }, { "docid": "a3f12776f73500b27d6be4a8503757cb", "score": "0.5479941", "text": "setImage(x, y, src) {\n\t\tdocument.getElementById(this.getStageId(x, y)).src = src;\n\t}", "title": "" }, { "docid": "38f3495230d6f9ffb6a72d360a198cb8", "score": "0.5473029", "text": "function setOverlay() {\r\n if (cur_scenic_data == null) return;\r\n\r\n if (imageLayer != null) imageLayer.setMap(null);\r\n\r\n imageLayer = new AMap.ImageLayer({\r\n url: cur_scenic_data.overlay,\r\n bounds: new AMap.Bounds(\r\n cur_scenic_data.bottom_left, //左下角\r\n cur_scenic_data.top_right //右上角\r\n ),\r\n zooms: [5, 28]\r\n });\r\n imageLayer.setzIndex(100);\r\n imageLayer.setMap(map);\r\n}", "title": "" }, { "docid": "e5539064003e448869046c0778430cc5", "score": "0.5466764", "text": "function setPosition() {\n if (container) {\n if (x < container.left) {\n x = container.left;\n } else if (x > container.right - width) {\n x = container.right - width;\n }\n if (y < container.top) {\n y = container.top;\n } else if (y > container.bottom - height) {\n y = container.bottom - height;\n }\n }\n\n elem.css({\n top: y + 'px',\n left: x + 'px'\n });\n }", "title": "" }, { "docid": "29414c69c341aa4504eaa970b563dd88", "score": "0.54438585", "text": "function showPict(pictPosT, pictPosL) {\n\n //get img from specific tag\n var imgThis = $(\"#my_img\").attr('src');\n console.log(imgThis);\n\n $('<img id=\"lightImg\" src=\"\">')\n //$('<div id=\"yeah\"></div>')\n //.html(\"hello\")\n .attr('src', imgThis)\n\n .css({\n 'position' : 'absolute',\n 'top': pictPosT,\n 'left': pictPosL,\n 'opacity': '10'\n })\n //.fadeIn()\n .appendTo('body');\n\n console.log(pictPosT);\n console.log(pictPosL);\n console.log('Displaying the picture');\n\n }", "title": "" }, { "docid": "a81f909b8db843db4c9640ce414c1363", "score": "0.5443731", "text": "changeImage(pos, isLeftDirection) {\n\t\tlet direction = isLeftDirection ? 0 : 1;\n\n\t\tif (control.world[this.x][this.y].isAscendable()) {\n\t\t\tthis.imageName = this.name + IMAGES_NAMES[2 + direction];\n\n\t\t} else if (control.world[this.x][this.y].isClimbable()) {\n\t\t\tthis.imageName = this.name + IMAGES_NAMES[4 + direction];\n\n\t\t} else {\n\t\t\tthis.imageName = this.name + IMAGES_NAMES[pos + direction];\n\t\t}\n\t\tthis.draw(this.x, this.y)\n\t}", "title": "" }, { "docid": "3950e1422db78c816f0f2cc06a79d106", "score": "0.5442308", "text": "display(){\n\t\tif(this.visible){\n\t\t\timageMode(CENTER);\n\t\t\timage(ponyPic, this.x, this.y);\n\t\t}\n\t}", "title": "" }, { "docid": "c3790f7c6e4e3861cea6e47b0b05abc9", "score": "0.54402924", "text": "_onMakeImageCache( image )\n\t{\n\t\timage.setImage( this._currentSide ,this._row, this._column , true , true ); // generate image cache\n\t}", "title": "" }, { "docid": "e658cd19332e7cfc7fd5dc9a45dbae15", "score": "0.54339087", "text": "function setAssociation(assoc) {\n\tvar guid = assoc.guid;\n\tim.setAssociationNamespaceAttribute('zIndex', assoc.zIndex, guid, 'picture-projector');\n\tim.setAssociationNamespaceAttribute('yCord', assoc.yCord, guid, 'picture-projector');\n\tim.setAssociationNamespaceAttribute('xCord', assoc.xCord, guid, 'picture-projector');\n}", "title": "" }, { "docid": "e9be961b4b1022959398a0d046411cc8", "score": "0.54308426", "text": "function setImagePath(ip)\n{\n imagePath = ip;\n}", "title": "" }, { "docid": "edb7985f84e1aa7ba99cedb695b9d50d", "score": "0.5416308", "text": "function asignImage(id, pic, height, width)\r\n{\r\n\tvar nHeight=250, nWidth=250;\r\n\tif ((height >= width) && (height - width<=10))\r\n\t{\r\n\t\tnHeight = 250; nWidth = 250;\r\n\t}\r\n\telse if ((height > width) && (height - width>=10))\r\n\t{\r\n\t\tnHeight = 250; nWidth = 200;\r\n\t}\r\n\telse if ((height < width) && (width - height>=10))\r\n\t{\r\n\t\tnHeight = 200; nWidth = 250;\r\n\t}\r\n\t\r\n\t$(id).attr(\"src\", pic);\r\n\t$(id).attr(\"width\", nWidth+\"px\");\r\n\t$(id).attr(\"height\", nHeight+\"px\");\r\n}", "title": "" }, { "docid": "5b2514a7859b4a1bd503502346d20ff1", "score": "0.5414769", "text": "updateImage() {\n let $image = $(\"#\" + this.recId + \" .rec_item_picture img\");\n\n let fillClass = ($image.height() > $image.width())\n ? 'fillheight'\n : 'fillwidth';\n\n $image.attr('src',this.rec.getImageLink());\n $image.removeClass(\"fillheight fillwidth\").addClass(fillClass);\n }", "title": "" }, { "docid": "16ff34a6edf9f7a8845639e0564b220f", "score": "0.5413091", "text": "function html_applyDefaultStyleToImg(target)\n{\n if (target == null)\n {\n return;\n }\n target.style.border = html_getDefaultBorderStyle();\n target.style.zIndex = html_default_zIndex ;\n target.wasClicked = false ;\n}", "title": "" }, { "docid": "c8b3fa0098e32b411f5b08d98a801ed8", "score": "0.54101247", "text": "function displayImage(imgSrc) {\r\n displayedImage.setAttribute('src', imgSrc);\r\n}", "title": "" }, { "docid": "97636482246a839cc0b44767273de468", "score": "0.540523", "text": "function changeImage() {\n imageArea.setAttribute('src', imageArray[imageIndex]);\n imageIndex++;\n if (imageIndex >= imageArray.length) {\n imageIndex = 0;\n }\n}", "title": "" }, { "docid": "da1286807090222a75ee0ddb062cbedd", "score": "0.5404762", "text": "function initVars(img)\n{\n// There are various entry points, so we call initVars in several places to make sure this variables get updated.\n if(!originalPosition) {\n // remember initial position and size so we can restore it if user cancels\n originalPosition = getOriginalPosition();\n originalSize = $('#size').text();\n originalCursor = jQuery('body').css('cursor');\n }\n}", "title": "" }, { "docid": "277851e4ffb53c18d7f66485e5a3aaea", "score": "0.5400048", "text": "function placeImg(hangmanImg) {\n\t var image = document.createElement(\"img\");\n\t image.setAttribute(\"src\", hangmanImg);\n\t image.setAttribute(\"class\", \"w-75\");\n\t image.setAttribute(\"id\", \"left-image\");\n\t document.getElementById(\"image-space\").innerHTML = \"\";\n\t document.getElementById(\"image-space\").appendChild(image);\n }", "title": "" }, { "docid": "462c3ba506b8668240db92cb588ea6fe", "score": "0.5393647", "text": "function ddgReplaceAttribute(el, attrName, attrValue) {\n if (!attrValue) {\n console.warn('The following element does not contain the attribute: \"' + attrName + '\", ', el);\n return;\n }\n\n // console.log('ddgReplaceAttribute(el, ', attrName, ', ', attrValue, ')', `attrName==='srcset': ${attrName === 'srcset'}`, el);\n\n // todo: saving the attribute before changing it (create an attribute node)\n // el[\"og-\" + attrName] = attrValue;\n // if (typeof (createAndAddAttributeNode) !== 'undefined') {\n // createAndAddAttributeNode(el, \"og-\" + attrName, attrValue);\n // }\n\n if (attrName === 'srcset') {\n const srcset = SrcSet.parse(attrValue).filter(ss => ss.url).map(ss => ({\n url: ddgProxy((ss.url)),\n width: ss.width\n }));\n console.log('srcset: ', attrValue, ' -> ', srcset);\n // for (var i = 0; i < srcset.length; i++)\n // srcset[i].url = ddgProxy(reconstructUrl(srcset[i].url));\n\n el.setAttribute(attrName, SrcSet.stringify(srcset));\n\n console.log('srcset: ', attrValue, '->', SrcSet.stringify(srcset));\n } else {\n el.setAttribute(attrName, ddgProxy(reconstructUrl(attrValue)));\n }\n\n // // adding og links to anchors\n // if (el.tagName == 'A' && !el.classList.contains('proxy-og-link')) {\n // appendOgLink(el, attrValue);\n // }\n\n tokenManager.markAttributeAsReplaced(el, attrName);\n }", "title": "" }, { "docid": "8f9ac0fb32d07c583c82ee90b5298781", "score": "0.538043", "text": "function setPosition(sprite) {\n var e = document.getElementById(sprite.element);\n e.style.left = sprite.x + 'px';\n e.style.top = sprite.y + 'px';\n}", "title": "" }, { "docid": "6824ff021af6d96268dbb11582a31790", "score": "0.5378933", "text": "setDataAttributes () {\n const alignSrcElem = this.target.ownerDocument.querySelector('[data-alpheios_align_src]')\n const alignRef = this.target.dataset.alpheios_align_ref\n this.data = {}\n if (alignSrcElem && alignRef) {\n this.data.translation = {\n src: alignSrcElem.dataset.alpheios_align_src,\n ref: alignRef\n }\n }\n }", "title": "" }, { "docid": "ea63422169f7e8535ca4f7610f91165a", "score": "0.53715324", "text": "function cacheSprite(object, image) {\n object.SPRITE = image;\n }", "title": "" }, { "docid": "b181eb02b59546e67244827745f86f0b", "score": "0.5371005", "text": "function posImg(position) {\n\n if (!imgFullSize) {\n hz.displayImgLoader('error', position);\n return;\n }\n\n // because of iframes, we should use parent window (= main window) for positioning and sizing\n if (position === undefined || position.top === undefined || position.left === undefined) {\n position = {top:mousePos.top, left:mousePos.left};\n }\n\n var offset = 20,\n padding = 10,\n zoom = window.devicePixelRatio || 1.0,\n scrollBarHeight = (hasScrollbarH() ? 17 / zoom : 0),\n statusBarHeight = 30 / zoom,\n scrollBarWidth = 17 / zoom,\n wndWidth = innerWidth,\n wndHeight = innerHeight,\n bodyStyleLeft = Math.abs(parseInt(document.body.style.left) || 0),\n bodyStyleTop = Math.abs(parseInt(document.body.style.top) || 0),\n bodyScrollLeft = document.body.scrollLeft,\n bodyScrollTop = document.body.scrollTop,\n docStyleLeft = (document.documentElement ? (Math.abs(parseInt(document.documentElement.style.left) || 0)) : 0),\n docStyleTop = (document.documentElement ? (Math.abs(parseInt(document.documentElement.style.top) || 0)) : 0),\n docScrollLeft = (document.documentElement ? document.documentElement.scrollLeft : 0),\n docScrollTop = (document.documentElement ? document.documentElement.scrollTop : 0),\n wndScrollLeft = Math.max(bodyStyleLeft, bodyScrollLeft, docStyleLeft, docScrollLeft),\n wndScrollTop = Math.max(bodyStyleTop, bodyScrollTop, docStyleTop, docScrollTop),\n bodyWidth = document.body.clientWidth,\n displayOnRight = (position.left - wndScrollLeft < wndWidth / 2);\n\n function adjustCaption() {\n\n if (hzCaption)\n hzCaption.css('max-width', 0); // needed to avoid a bug when caption is larger than img\n\n // this is looped 10x max just in case something goes wrong, to avoid freezing the process\n let i = 0;\n while (hz.hzImg.height() > wndHeight - statusBarHeight - scrollBarHeight && i++ < 10) {\n imgFullSize.height(wndHeight - padding - statusBarHeight - scrollBarHeight - (hzCaption ? hzCaption.height() : 0)).width('auto');\n }\n\n if (hzCaption) {\n hzCaption.css('max-width', imgFullSize.width());\n if (hzCaption.height() > 20) {\n hzCaption.css('font-weight', 'normal'); // do not use bold font when caption is verbose\n }\n }\n }\n\n if (displayOnRight) {\n position.left += offset;\n } else {\n position.left -= offset;\n }\n\n if ($('#hzImgLoader.imgLoading')[0] != undefined) {\n\n hz.displayImgLoader('loading', position);\n return;\n\n /*position.top -= 10;\n if (!displayOnRight) {\n position.left -= 25;\n }*/\n\n } else {\n\n imgFullSize.width('auto').height('auto');\n hz.hzImg.width('auto').height('auto');\n hz.hzImg.css('visibility', 'visible');\n\n // image natural dimensions\n imgDetails.naturalWidth = imgFullSize.width() * options.zoomFactor;\n imgDetails.naturalHeight = imgFullSize.height() * options.zoomFactor;\n if (!imgDetails.naturalWidth || !imgDetails.naturalHeight) {\n return;\n }\n\n // width adjustment\n var fullZoom = options.mouseUnderlap || fullZoomKeyDown;\n if (fullZoom) {\n imgFullSize.width(Math.min(imgDetails.naturalWidth, wndWidth - padding - 2 * scrollBarWidth));\n } else {\n if (displayOnRight) {\n if (imgDetails.naturalWidth + padding > wndWidth - position.left) {\n imgFullSize.width(wndWidth - position.left - padding + wndScrollLeft);\n }\n } else {\n if (imgDetails.naturalWidth + padding > position.left) {\n imgFullSize.width(position.left - padding - wndScrollLeft);\n }\n }\n }\n\n // height adjustment\n if (hz.hzImg.height() > wndHeight - padding - statusBarHeight - scrollBarHeight - (hzCaption ? hzCaption.height() : 0)) {\n imgFullSize.height(wndHeight - padding - statusBarHeight - scrollBarHeight - (hzCaption ? hzCaption.height() : 0)).width('auto');\n }\n\n adjustCaption();\n\n position.top -= hz.hzImg.height() / 2;\n\n // display image on the left side if the mouse is on the right\n if (!displayOnRight) {\n position.left -= hz.hzImg.width() + padding;\n }\n\n // horizontal position adjustment if full zoom\n if (fullZoom) {\n if (displayOnRight) {\n position.left = Math.min(position.left, wndScrollLeft + wndWidth - hz.hzImg.width() - padding - 2 * scrollBarWidth);\n } else {\n position.left = Math.max(position.left, wndScrollLeft);\n }\n }\n\n // vertical position adjustments\n var maxTop = wndScrollTop + wndHeight - hz.hzImg.height() - padding - statusBarHeight - scrollBarHeight;\n if (position.top > maxTop) {\n position.top = maxTop;\n }\n if (position.top < wndScrollTop + 0.5 * padding) {\n position.top = wndScrollTop + 0.5 * padding;\n }\n\n if (options.ambilightEnabled) {\n updateAmbilight();\n }\n }\n\n if (options.centerImages) {\n hz.hzImg.css('top', (wndHeight / 2 - hz.hzImg.height() / 2 - padding / 2 - statusBarHeight / 2 - scrollBarHeight / 2) + 'px');\n hz.hzImg.css('left', (wndWidth / 2 - hz.hzImg.width() / 2 - padding / 2 - scrollBarWidth / 2) + 'px');\n hz.hzImg.css('position', 'fixed');\n } else {\n // this fixes positioning when the body's width is not 100%\n if (body100pct) {\n position.left -= (wndWidth - bodyWidth) / 2;\n }\n\n // check that image is not too much on the left side\n if (position.left < wndScrollLeft + 0.5 * padding) {\n position.left = wndScrollLeft + 0.5 * padding;\n }\n\n // check that image is not too much on the right side\n if (position.left + imgFullSize.width() + 2 * padding > wndScrollLeft + wndWidth) {\n position.left = wndScrollLeft + 0.5 * padding;\n }\n\n hz.hzImg.css({top:Math.round(position.top), left:Math.round(position.left)});\n }\n\n frameBackgroundColor(options.frameBackgroundColor);\n }", "title": "" }, { "docid": "aa2ba318161061935fd05fd916a9be09", "score": "0.53693074", "text": "function originalPositions(item, position) {\n item.style.position = \"absolute\";\n item.style.top = position.y + \"px\";\n item.style.left = position.x + \"px\";\n }", "title": "" }, { "docid": "664f7f178d69a7af30788c5864c36878", "score": "0.5364966", "text": "function setStyles() {\n var currentImage = localStorage.getItem('image');\n document.getElementById('image').value = currentImage;\n imgElem.setAttribute('src', currentImage);\n}", "title": "" }, { "docid": "d567075b415ede7801af58ff2f3075e1", "score": "0.5355766", "text": "displayImage() {\n push();\n translate(this.imagePositionX, this.imagePositionY);\n imageMode(CENTER);\n // scale(0.9);\n image(this.image, 0, 0, this.imageWidth, this.imageHeight);\n pop();\n }", "title": "" }, { "docid": "9f082b20907b8717c2c0d089123f3961", "score": "0.53501284", "text": "function setPosition(element, rem = false) {\r\n\r\n const pos = element.getAttribute('togglemenu-menu');\r\n\r\n switch (pos) {\r\n\r\n case \"right\":\r\n\r\n if (rem) element.style.right = \"-100%\";\r\n else element.style.right = \"0\";\r\n\r\n break;\r\n\r\n case \"bottom\":\r\n\r\n if (rem) element.style.bottom = \"-100%\";\r\n else element.style.bottom = \"0\";\r\n\r\n break;\r\n\r\n case \"top\":\r\n\r\n if (rem) element.style.top = \"-100%\";\r\n else element.style.top = \"0\";\r\n\r\n break;\r\n\r\n default:\r\n\r\n if (rem) element.style.left = \"-100%\";\r\n else element.style.left = \"0\";\r\n\r\n }\r\n\r\n }", "title": "" }, { "docid": "4b73866395149a692c5e2b39a84d1759", "score": "0.5349424", "text": "function C999_Common_Cuffs_ShowImage() {\n\tOverridenIntroImage = \"Cuffs.jpg\";\n}", "title": "" }, { "docid": "80cd1ee7ec664ebec64cdd365eefc862", "score": "0.53404397", "text": "addAttribLocation(varName, location) {\n this.attribs.set(varName, location);\n }", "title": "" }, { "docid": "c0150fc8aaa976cc20cb09b88c067b74", "score": "0.5339868", "text": "setElementAttribute (reference, attribute, value) {\n let element = little.getElement(reference);\n if(element)\n little.processElement(element, function(element) {\n element.setAttribute(attribute, value);\n });\n else \n elementNotFound();\n \n }", "title": "" }, { "docid": "3cecbea3bdda2ff6bb9119f27e1d559c", "score": "0.53358465", "text": "function setImage(index) {\n\n if (first_bool == true) {\n if (in_animation == true || current.index() - 1 == index)\n return;\n }\n else\n if (in_animation == true || current.index() == index)\n return;\n\n li.removeClass(\"reset active\");\n current.find(\"span\").hide();\n clearTimeout(image_timer); // Manual Override...\n\n if (first_bool == true)\n li.first().addClass(\"reset\");\n\n current.addClass(\"reset\");\n prev = current;\n current = li.eq(index).addClass(\"active\");\n current.find('img').hide();\n override = true;\n effects();\n\n }", "title": "" }, { "docid": "44ccd85849ba0c69a69d5018d59fd9d0", "score": "0.533528", "text": "function set_attribute(attribute_name, value){\n\tsummary_data['attributes'][attribute_name]['base'] = value;\n\tvalidate_attributes(attribute_name);\n}", "title": "" }, { "docid": "a91bea45702adce0cd588accd5796170", "score": "0.5332467", "text": "function makeAbsolute(element, top) {\n if (element) {\n element.style.position = 'absolute';\n element.style.top = top + 'px';\n element.__fm_ghost.show();\n }\n }", "title": "" }, { "docid": "b63e4031a8411e6ca7a8206536a5005f", "score": "0.53291374", "text": "function hover(element) {\r\n element.setAttribute('src', 'images/music1.jpg');\r\n var dynamo = document.getElementById('dynamic');\r\n dynamo.setAttribute('src', 'images/selfhelp2.jpg');\r\n dynamo.setAttribute('width', '50%');\r\n\r\n}", "title": "" }, { "docid": "c934d251c1781da5373b3bbd9cd77f01", "score": "0.53275037", "text": "function set_imgMode(Obj){\n var cval = (parseInt(Obj.value)-1);\n gvar.imgTagMode[cval] = (Obj.checked ? '1' : '0'); \n}", "title": "" }, { "docid": "016ddce505e01c4ed1c870afc3bba62e", "score": "0.5322057", "text": "function attrFunction(){\n this.setAttribute( name, value.apply(this,arguments));\n }", "title": "" }, { "docid": "f0eeec9002344618f2c356d0190d88b3", "score": "0.5318106", "text": "function setImage( element ){\r\n\tvar x;\r\n\tif ( element == man ) {\r\n\t\tx = document.createElement( 'img' );\r\n\t\tx.className = 'boardMan';\r\n\t\tx.src = 'assets/mario.png';\r\n\t} else if ( element == wall ) {\r\n\t\tx = document.createElement( 'img' );\r\n\t\tx.className = 'boardWall';\r\n\t\tx.src = 'assets/wall.png';\r\n\t} else if ( element == box ) {\r\n\t\tx = document.createElement( 'img' );\r\n\t\tx.className = 'boardBox';\r\n\t\tx.src = 'assets/square.png';\r\n\t} else if ( element == goal ) {\r\n\t\tx = document.createElement( 'img' );\r\n\t\tx.className = 'boardGoal';\r\n\t\tx.src = 'assets/goal.png';\r\n\t}\r\n\telse {\r\n\t\tx = document.createTextNode( element );\r\n\t}\r\n\treturn x;\r\n}", "title": "" }, { "docid": "c961566f68e898e9cac6fff68efe4d2f", "score": "0.53159636", "text": "get imageUrl() {\n return this.getAttribute(\"image-url\");\n }", "title": "" }, { "docid": "b2e87dc39fb90c57085faec7e9771b9a", "score": "0.5315092", "text": "function position(v) {\n v.setAttribute(\"x\", s.left);\n v.setAttribute(\"y\", s.top);\n v.setAttribute(\"width\", s.width);\n v.setAttribute(\"height\", s.height);\n }", "title": "" }, { "docid": "5cf19ab98cd97cc80d7b753121476f3b", "score": "0.5315083", "text": "function imagemap(param) {\n if (param.mapId) {\n param.character.domRef.setAttribute(\"usemap\", '#' + param.mapId);\n novel.paused = true;\n novel.ignoreClicks = !(param.screenActive);\n novel.mappedImage = param.character.domRef;\n }\n}", "title": "" } ]
01fa46ced80ed443861b740d8dcb0cbe
Returns value of the given property as a boolean value. The result is false if the property is not present.
[ { "docid": "6f8f7791141705ece670ad3aa9443d09", "score": "0.7282176", "text": "function getBoolean(key, properties) {\n const val = getProperty(key, properties);\n if (val === '') {\n return false;\n } else {\n return val;\n }\n}", "title": "" } ]
[ { "docid": "9ee9601e9fd04da62a2708b6d2145c13", "score": "0.6936794", "text": "function coerceBooleanProperty(value) {\n return value != null && `${value}` !== 'false';\n}", "title": "" }, { "docid": "9ee9601e9fd04da62a2708b6d2145c13", "score": "0.6936794", "text": "function coerceBooleanProperty(value) {\n return value != null && `${value}` !== 'false';\n}", "title": "" }, { "docid": "dfd51bd2b3bb40b34d67638e6c23ad6a", "score": "0.68626714", "text": "function coerceBooleanProperty(value) {\n return value != null && \"\" + value !== 'false';\n}", "title": "" }, { "docid": "255bdc7fc43c0530162730ef380e251a", "score": "0.6318916", "text": "function booleanValue() {\n return true;\n}", "title": "" }, { "docid": "493252bd24c8bbec802132962b351969", "score": "0.63064003", "text": "function objectPropertyHasValue(prop) {\r\n\r\n return !!(typeof prop !== 'undefined' && prop !== \"\");\r\n}", "title": "" }, { "docid": "3b0b3b23f11ded57775acd1a4dd3bbe4", "score": "0.62676615", "text": "static getBoolean(value) { return value; }", "title": "" }, { "docid": "212caf8b72864a6feda19ae6c31ec0ab", "score": "0.6183541", "text": "function GetBoolSetting(key) {\n if (GetSetting(key) == \"true\") {\n return true;\n } else if (GetSetting(key) == \"false\") {\n return false;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "218187f1b48221c0e4615d0607b2898b", "score": "0.6110143", "text": "function hasOption (defValue, options, property, lookingFor) {\n if (typeof options[property] === 'boolean') return options[property]\n if (\n typeof options === 'object' &&\n typeof options[property] === 'object' &&\n typeof options[property][lookingFor] === 'boolean'\n ) {\n return options[property][lookingFor]\n }\n return defValue\n}", "title": "" }, { "docid": "2595ccff48ac7e35e734e67d60c805d9", "score": "0.6085362", "text": "function evaluates_to_true(x) { return x.value ? true : false }", "title": "" }, { "docid": "24f510442693437520b24b14927e3aba", "score": "0.6038594", "text": "function boolean() {\n return define('boolean', (value) => {\n return typeof value === 'boolean';\n });\n }", "title": "" }, { "docid": "0ab8316cd2788b1d0202a2d84104b854", "score": "0.6002062", "text": "function __boolean(value) {\n return typeof value == \"boolean\";\n }", "title": "" }, { "docid": "299dd92a72285d17d03ecf25483f9924", "score": "0.5912304", "text": "function ToBoolean(pobjVal) {\r\n\tvar dblNo = Number.NaN;\r\n\tvar strTmp = null;\r\n\r\n\tif (pobjVal == null || pobjVal == undefined)\r\n\t{\r\n\t\tthrow \"Boolean value is not defined!\";\r\n\t}\r\n\telse if (typeof(pobjVal) == \"boolean\")\r\n\t{\r\n\t\treturn pobjVal;\r\n\t}\r\n\telse if (typeof(pobjVal) == \"number\")\r\n\t{\r\n\t\treturn (pobjval > 0);\r\n\t}\r\n\telse if (IsNumber(pobjVal)) {\r\n\t\tdblNo = ToNumber(pobjVal);\r\n\t\tif (isNaN(dblNo))\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn (dblNo > 0);\r\n\t\t}\r\n\t} else if (typeof(pobjVal) == \"object\") {\r\n\t\tstrTmp = pobjVal.toString();\r\n\t\tif (strTmp.toUpperCase() == \"TRUE\")\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse if (strTmp.toUpperCase() == \"FALSE\")\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t} else if (typeof(pobjVal) == \"string\") {\r\n\t\tif (pobjVal.toUpperCase() == \"TRUE\")\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse if (pobjVal.toUpperCase() == \"FALSE\")\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t} else\r\n\t{\r\n\t\treturn null;\r\n\t}\r\n}", "title": "" }, { "docid": "3257b0d8626ab557e06c0dd897f33f17", "score": "0.5845278", "text": "function boolVal(){\n\t\tCST.addNode(\"boolval\", \"branch\", tokenStream[0]);\n\t\tswitch(getTokenType()){\n\t\t\tcase T_TRUE:\n\t\t\t\tif(checkToken(T_TRUE)){\n\t\t\t\t\tCST.addNode(\"true\", \"leaf\", tokenStream[0]);\n\t\t\t\t\tCST.endChildren();\n\t\t\t\t\tAST.addNode(\"true\", \"leaf\", tokenStream[0]);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase T_FALSE:\n\t\t\t\tif(checkToken(T_FALSE)){\n\t\t\t\t\tCST.addNode(\"false\", \"leaf\", tokenStream[0]);\n\t\t\t\t\tCST.endChildren();\n\t\t\t\t\tAST.addNode(\"false\", \"leaf\", tokenStream[0]);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tputMessage(\"Error expecting boolean value on line \" + getTokenLine());\n\t\t\t\tparseErrorCount++;\n\t\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "daae314a02fd4ed909d207be69a136fc", "score": "0.58442026", "text": "static bool(value) {\n return value === true || value === false || is.toString.call(value) === '[object Boolean]';\n }", "title": "" }, { "docid": "7abd1d757d43f4ce85d4b46425f1816c", "score": "0.58405197", "text": "function attrToBoolean(value) {\n if (value === undefined) {\n // undefined or empty means ignore the value\n return;\n }\n if (value === null || value === '') {\n // null means clear\n return false;\n }\n if (typeof value === 'boolean') {\n // if simple boolean, return the boolean\n return value;\n }\n // if equal to the string 'true' (ignoring case) then return true\n return (/true/i).test(value);\n}", "title": "" }, { "docid": "4b4fff5243278c4ddbbefe7c4e125cdf", "score": "0.5837889", "text": "isPresent() {\n return this._value !== null && this._value !== undefined\n }", "title": "" }, { "docid": "7f0a0c3e119c5a2d5d9fbf44f2099f37", "score": "0.5831683", "text": "function getDesignerPropAsBool(tname) {\n if (document.designerProps.hasTrait(tname))\n return document.designerProps.getTrait(tname).value;\n\n return false;\n}", "title": "" }, { "docid": "e63a944dfceefcc47983f3eb68a80b0a", "score": "0.5822735", "text": "function bool(value) {\n\t return typeof value === 'boolean';\n\t }", "title": "" }, { "docid": "674464d164cdf8ccbb7b33c7becc53f4", "score": "0.58162796", "text": "function canEvaluateProperty(obj, prop) {\n var t = typeof obj[prop];\n return t != UNKNOWN;\n }", "title": "" }, { "docid": "d47fad82ae6a704e5c85090c4cb46f8c", "score": "0.5809468", "text": "function inputToBoolean(value) {\n return value != null && `${value}` !== 'false';\n}", "title": "" }, { "docid": "b73fc58cdca5c54700bd51ec2d35d020", "score": "0.57886755", "text": "function has(o, property) {\n\t if (arguments.length !== 2) {\n\t throw new Error('Expected two arguments to check.has, got only ' + arguments.length);\n\t }\n\t return Boolean(o && property &&\n\t typeof property === 'string' &&\n\t typeof o[property] !== 'undefined');\n\t }", "title": "" }, { "docid": "4688251d00daebf129e78a6680561a89", "score": "0.5766835", "text": "function has(object, key) {\n //loop through each property in the object\n for (let property in object) {\n //If object.property exists...\n if (object[property])\n //...then return true\n {return true;} \n //If object property exists and has a falsey value...\n else if(object[property] === false)\n //...then return true\n {return true;}\n // otherwise return false\n else {return false;}\n \n };\n}", "title": "" }, { "docid": "88138e56b9dd9144e4283a4fc9a11bce", "score": "0.5753513", "text": "propertyIsSet(propertyName) {\n const attribute = this.classModel.attributes.filter(attribute => attribute.name === propertyName);\n const singularRelationship = this.classModel.relationships.filter(relationship => relationship.name === propertyName && relationship.singular);\n const nonSingularRelationship = this.classModel.relationships.filter(relationship => relationship.name === propertyName && !relationship.singular);\n\n if (attribute.length && attribute[0].list) {\n if (!Array.isArray(this[propertyName]) || this[propertyName].length === 0) {\n return false;\n }\n }\n else if (nonSingularRelationship.length) {\n const value = this['_' + propertyName];\n if (Array.isArray(value) && value.length === 0)\n return false;\n if (value !== null && value.size === 0)\n return false;\n }\n else if (singularRelationship.length) {\n if (this['_' + propertyName] === null)\n return false;\n }\n else {\n if (this[propertyName] === null)\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "ac6c5026fe71e6e53ff5cb86b78d6fff", "score": "0.57509196", "text": "function ToBoolean(pobjVal)\r\n{\r\n var dblNo = Number.NaN;\r\n var strTmp = null;\r\n\r\n if (pobjVal == null || pobjVal == undefined)\r\n throw \"Boolean value is not defined!\";\r\n else if (typeof(pobjVal) == \"boolean\")\r\n return pobjVal;\r\n else if (typeof(pobjVal) == \"number\")\r\n return (pobjval > 0);\r\n else if (IsNumber(pobjVal))\r\n {\r\n dblNo = ToNumber(pobjVal);\r\n if (isNaN(dblNo)) \r\n return null;\r\n else\r\n return (dblNo > 0);\r\n }\r\n else if (typeof(pobjVal) == \"object\")\r\n {\r\n strTmp = pobjVal.toString();\r\n if (strTmp.toUpperCase() == \"TRUE\")\r\n return true;\r\n else if (strTmp.toUpperCase() == \"FALSE\")\r\n return false;\r\n else\r\n return null;\r\n }\r\n else if (typeof(pobjVal) == \"string\")\r\n {\r\n if (pobjVal.toUpperCase() == \"TRUE\")\r\n return true;\r\n else if (pobjVal.toUpperCase() == \"FALSE\")\r\n return false;\r\n else\r\n return null;\r\n }\r\n else\r\n return null;\r\n}", "title": "" }, { "docid": "76afad7dfc53f7eb2a023afb3b38aee2", "score": "0.57387984", "text": "function HasValue( elem, propName )\n {\n return attr.has( elem, GetDashSeparatedName( propName ) );\n }", "title": "" }, { "docid": "92dca7284f6e3980a2a8b209e2561032", "score": "0.5737456", "text": "function has(obj, prop){\n return get(obj, prop) !== UNDEF;\n }", "title": "" }, { "docid": "01b9676f7f3163c34efa976e3285103c", "score": "0.56878775", "text": "function hasProperty(obj, propName) {\n if (!obj) {\n return false;\n }\n if (typeof obj !== 'object') {\n return false;\n }\n if (obj.hasOwnProperty(propName)) {\n return true;\n }\n return !!obj[propName];\n }", "title": "" }, { "docid": "7de256c058b013850732640a542d584e", "score": "0.563796", "text": "function haveProperty(properties, property) {\r\n for (var i=0; i<properties.Count(); i++) {\r\n var prop;\r\n prop=properties.GetElementAt(i).QueryInterface(Ci.nsIAtom);\r\n if (prop.toString()==property) return true;\r\n }\r\n return false;\r\n }", "title": "" }, { "docid": "d44e85ccfc08e797ff62cb1e93f98112", "score": "0.56298655", "text": "function HasValue( elem, propName )\n {\n return propName in elem.dataset;\n }", "title": "" }, { "docid": "6f9d23b1f3c54fa02f06575faa5ee351", "score": "0.56206346", "text": "function isDefined(property) {\n\t\t\treturn typeof property !== 'undefined';\n\t\t}", "title": "" }, { "docid": "c4f5f7abc8788d2560e731e2bc6719d6", "score": "0.56205803", "text": "addBool(prop_name, ...args) {return this.add(prop_name,'bool',...args)}", "title": "" }, { "docid": "e34cf87906ed209d23043a77925ef36a", "score": "0.56180346", "text": "function haveProperty(properties, property) {\r\n for (let i=0; i<properties.Count(); i++) {\r\n let prop;\r\n prop=properties.GetElementAt(i).QueryInterface(Ci.nsIAtom);\r\n if (prop.toString()==property) return true;\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "7ac0ad9c886a0ae27c8747203a0b3e92", "score": "0.5614966", "text": "function booleanIsTrue (val) {\n if ((val.toString() === '1') ||\n (val.toString().toLowerCase() === 'true') ||\n (val.toString().toLowerCase() === 'yes')) {\n return true\n } else { return false }\n}", "title": "" }, { "docid": "f0d6132da4b0fcb194bb02222120c15a", "score": "0.5601437", "text": "function checkProperty(property) {\n const hasValue = ![null, undefined].includes(obj[property.name]);\n if (!property.optional && (partial ? obj[property.name] === null : !hasValue)) {\n return { ok: false, reason: `Property at path \"${path}/${property.name}\" is not optional` };\n }\n if (hasValue && property.types.length === 1) {\n return checkType(`${path}/${property.name}`, property.types[0], obj[property.name], false);\n }\n if (hasValue && !property.types.some(type => checkType(`${path}/${property.name}`, type, obj[property.name], false).ok)) {\n return { ok: false, reason: `Property at path \"${path}/${property.name}\" does not match any of ${property.types.length} allowed types` };\n }\n return { ok: true };\n }", "title": "" }, { "docid": "2984099601088eba349e84f910adc1e9", "score": "0.5595635", "text": "function isTrue(value) {\n return !!value;\n}", "title": "" }, { "docid": "f4c11b0a24c9746baf961b42afb8e8f5", "score": "0.55944836", "text": "function hasProperty(obj, property) {\n 'use strict';\n for(var prop in obj) {\n if(prop === property) {\n return true;\n }\n }\n\n return false;\n}", "title": "" }, { "docid": "20a32eb63bbe0cc243d932b737f486b7", "score": "0.55923945", "text": "function toBoolean(v) {\r\n if (isBoolean(v) || isUndefined$1(v) || isNull(v)) {\r\n return v;\r\n }\r\n else {\r\n return (parseFloat(v) > 0\r\n || isInfinite(v)\r\n || v === '1'\r\n || v === 'true'\r\n || v === 'yes'\r\n || v === '+');\r\n }\r\n}", "title": "" }, { "docid": "76c25608422a495d469e8e8c8d552af4", "score": "0.5578456", "text": "function checkProp(prop) {\n return (vrProps.indexOf(prop) !== -1) ? true : false;\n}", "title": "" }, { "docid": "b6631af56d6867c5e18c3086a5022f4d", "score": "0.55633485", "text": "function getBoolAttr(name, value) {\r\n return ' ' + name + '=\"' + !!value + '\"';\r\n }", "title": "" }, { "docid": "f17710bb36cf48970915fe41754c7318", "score": "0.55519044", "text": "hasValue() {\n\t\treturn utils.isString(this.value);\n\t}", "title": "" }, { "docid": "86a40bf5ea3b5535297dca5e9e11e7d4", "score": "0.5519464", "text": "get valid() {\n if (this._notSet || (this._property !== null || this._allowNull)) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "442666da1ce931c39681ed5bed57fcb8", "score": "0.551775", "text": "function _boolean(obj) {\n return exports.PREFIX.boolean + ':' + obj.toString();\n}", "title": "" }, { "docid": "dafac2332f8f930462244df495054ad0", "score": "0.5511329", "text": "get enabled() {\n return this.getBooleanAttribute('enabled');\n }", "title": "" }, { "docid": "dafac2332f8f930462244df495054ad0", "score": "0.5511329", "text": "get enabled() {\n return this.getBooleanAttribute('enabled');\n }", "title": "" }, { "docid": "dafac2332f8f930462244df495054ad0", "score": "0.5511329", "text": "get enabled() {\n return this.getBooleanAttribute('enabled');\n }", "title": "" }, { "docid": "dafac2332f8f930462244df495054ad0", "score": "0.5511329", "text": "get enabled() {\n return this.getBooleanAttribute('enabled');\n }", "title": "" }, { "docid": "dafac2332f8f930462244df495054ad0", "score": "0.5511329", "text": "get enabled() {\n return this.getBooleanAttribute('enabled');\n }", "title": "" }, { "docid": "dafac2332f8f930462244df495054ad0", "score": "0.5511329", "text": "get enabled() {\n return this.getBooleanAttribute('enabled');\n }", "title": "" }, { "docid": "dafac2332f8f930462244df495054ad0", "score": "0.5511329", "text": "get enabled() {\n return this.getBooleanAttribute('enabled');\n }", "title": "" }, { "docid": "d633d3b318485f6c99a1df84faa9bf2e", "score": "0.5510378", "text": "function hasProp (obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n }", "title": "" }, { "docid": "c7c1928194563a5c4f8399d66580c955", "score": "0.5508819", "text": "function coerceToBoolean(value) {\n return typeof value === 'boolean' ? value : value != null && value !== 'false';\n}", "title": "" }, { "docid": "446dda5e5cd0e77d6313ce087889a06e", "score": "0.5508189", "text": "function exampleBoolean() {\n\treturn true; // or false\n}", "title": "" }, { "docid": "b62291f2bb96b60cdc0db0202c6a3bc2", "score": "0.5482389", "text": "function booleanify(val) {\n if (val === \"true\") return true;\n if (val === \"false\") return false;\n return val;\n}", "title": "" }, { "docid": "b419c6ad311410976e504206bd33da3c", "score": "0.5480989", "text": "function hasVal() {\n return !!getVal(); //null, undefined, or 0 can all be non-values\n }", "title": "" }, { "docid": "b0d2b93499fe0b8d7ac4c8445b61aa61", "score": "0.54796946", "text": "function coerceBoolean(val) {\n\t if (typeof val !== \"string\") {\n\t return val;\n\t } else if (val === \"true\") {\n\t return true;\n\t } else if (val === \"false\") {\n\t return false;\n\t } else if (val === \"null\") {\n\t return false;\n\t } else if (val === \"undefined\") {\n\t return false;\n\t }\n\t}", "title": "" }, { "docid": "0bb9b62806bc827bb5c97f71d4017c4a", "score": "0.5471428", "text": "hasValue() {\n return this.field.value !== null\n }", "title": "" }, { "docid": "9dcae0dabf7e9c7439b4ca0329abc2f3", "score": "0.54609627", "text": "function exports(val)\n {\n return val === true || val === false;\n }", "title": "" }, { "docid": "aa884f1beb5fb4f3088badd3ad0509fd", "score": "0.54375064", "text": "function boolean() {\n var BigInt = TypeUtil.getBigIntFactoryFunctionOrError();\n return fLib.or(fLib.boolean(), fLib.literal(\"0\", \"1\", 0, 1, \"false\", \"true\", BigInt(0), BigInt(1)).pipe(function (name, v) {\n switch (v) {\n case \"0\": return false;\n case \"1\": return true;\n case 0: return false;\n case 1: return true;\n case \"false\": return false;\n case \"true\": return true;\n default: {\n var str = String(v);\n if (str == \"0\") {\n return false;\n }\n else if (str == \"1\") {\n return true;\n }\n //Shouldn't happen\n throw new Error(\"Expected \" + name + \" to be one of '0'|'1'|0|1|'false'|'true'|'0n'|'1n'\");\n }\n }\n })).withExpectedInput();\n}", "title": "" }, { "docid": "b3eba87f9018a6951b49ee6e51fcfb28", "score": "0.5436436", "text": "function isTrue (bool){\n\treturn bool === true;\n}", "title": "" }, { "docid": "12c7709bd266f782c4aa7a3053b5845b", "score": "0.543391", "text": "function trueOrFalse(val) {\n if (val) return true;\n return false;\n}", "title": "" }, { "docid": "81ed86d14d3f877cebb07ebe80d97879", "score": "0.5429841", "text": "function has(object, property) {\n return Object.prototype.hasOwnProperty.call(object, property);\n }", "title": "" }, { "docid": "bf14cc0e8acf5e89bb6a2043b351d8b9", "score": "0.542711", "text": "function _exists(prop) {\r\n return prop !== null && prop !== void 0;\r\n}", "title": "" }, { "docid": "60c0d1f8c2322106a3e884478d787f93", "score": "0.54250735", "text": "function hasProperty(object, property){\n if(object.hasOwnProperty(property)){\n return true;\n }\n else{\n return false;\n }\n}", "title": "" }, { "docid": "3af3a64d80b80d3bb9bd051de87f4977", "score": "0.54243726", "text": "function has(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "83a694af643681b66887352ef670327e", "score": "0.54212546", "text": "function toBool(v) {\n if (Utilities.isNumber(v)) {\n return v > 0;\n }\n if (Utilities.isString(v)) {\n return v === \"true\";\n }\n if (typeof v === \"boolean\") {\n return v;\n }\n return false;\n }", "title": "" }, { "docid": "ab554b124b73f47f46605a05ac1873d1", "score": "0.5419301", "text": "static makeBool(obj, name, defaultval, uiname, description, category) {\n obj[name] = defaultval;\n ToolProperty._getToolProps(obj)[name] = new BoolProperty(name, uiname, description, category);\n\n return ToolProperty._getToolProps(obj)[name];\n }", "title": "" }, { "docid": "8fc1f64fecde3314d103328f6f3a551c", "score": "0.5419112", "text": "function EZisTrueLike(value, options)\n{\n\tif (EZ.isTrueLike) return EZ.isTrueLike(value, options);\n\t\n\tif (value === true || value === 'true'\n\t|| value === 'on' || value === 'yes') return true;\n\n\tif (typeof(value) == 'object' && !EZ.isNone(value)) return true;\n\n\treturn false;\n}", "title": "" }, { "docid": "2341b2895a8d06bc09cedfbcc09b8934", "score": "0.5418574", "text": "get prokaryote(){\n if(this._trueNucleus === true){\n return false;\n } else {\n return true;\n }\n }", "title": "" }, { "docid": "85b53a32082b53edf60875b30b4eb1c2", "score": "0.54039794", "text": "function booleanify(val /*: any*/) /*: boolean | any*/ {\n if (val === \"true\" || val == 1) {\n return true;\n }\n\n if (val === \"false\" || val == 0 || !val) {\n return false;\n }\n\n return val;\n }", "title": "" }, { "docid": "05d51a63f59719492467ce80ddc443d6", "score": "0.5399902", "text": "function hasProperty(node, name) {\n var props\n var value\n\n if (!node || !name || typeof node !== 'object' || node.type !== 'element') {\n return false\n }\n\n props = node.properties\n value = props && own.call(props, name) && props[name]\n\n return value !== null && value !== undefined && value !== false\n }", "title": "" }, { "docid": "3ac91b6ff796763585fba3254d371543", "score": "0.53934073", "text": "function ToBoolean(isStrict, annotationOptions) {\n return function (object, propertyName) {\n MetadataStorage_1.defaultMetadataStorage.addValidationMetadata({\n sanitize: true,\n type: SanitizeTypes_1.SanitizeTypes.TO_BOOLEAN,\n object: object,\n propertyName: propertyName,\n value1: isStrict,\n each: annotationOptions && annotationOptions.each ? annotationOptions.each : undefined\n });\n };\n}", "title": "" }, { "docid": "d2e5a87ddea50b4f7ad9f5a7184bbc5a", "score": "0.53776723", "text": "function has(obj, propName) {\n\t\t\treturn hasOwnProperty.call(obj, propName)\n\t\t}", "title": "" }, { "docid": "0fe79682ce4cf1692d48acd8d04d5493", "score": "0.5369631", "text": "async isChecked() {\n const checked = (await this._nativeElement()).getAttribute('aria-checked');\n return coerceBooleanProperty(await checked);\n }", "title": "" }, { "docid": "b435a1917de96a624c5a9fd08ce2a67d", "score": "0.5368318", "text": "function has(obj, propName) {\n return Object.prototype.hasOwnProperty.call(obj, propName);\n }", "title": "" }, { "docid": "7a009e2b4e723508173315deccb45b8d", "score": "0.5359132", "text": "function bool(soup){\n return Boolean(soup)\n}", "title": "" }, { "docid": "0b4f6dad85dac3017fb167d0121dbbf9", "score": "0.53550196", "text": "function has(obj, propName) {\n return Object.prototype.hasOwnProperty.call(obj, propName);\n }", "title": "" }, { "docid": "0b4f6dad85dac3017fb167d0121dbbf9", "score": "0.53550196", "text": "function has(obj, propName) {\n return Object.prototype.hasOwnProperty.call(obj, propName);\n }", "title": "" }, { "docid": "0b4f6dad85dac3017fb167d0121dbbf9", "score": "0.53550196", "text": "function has(obj, propName) {\n return Object.prototype.hasOwnProperty.call(obj, propName);\n }", "title": "" }, { "docid": "0b4f6dad85dac3017fb167d0121dbbf9", "score": "0.53550196", "text": "function has(obj, propName) {\n return Object.prototype.hasOwnProperty.call(obj, propName);\n }", "title": "" }, { "docid": "0b4f6dad85dac3017fb167d0121dbbf9", "score": "0.53550196", "text": "function has(obj, propName) {\n return Object.prototype.hasOwnProperty.call(obj, propName);\n }", "title": "" }, { "docid": "6e1cc09820e5250005a68bd39c1818cd", "score": "0.5354655", "text": "static validatePropertyData(property){\n return [constants.PROPERTY_ON_SALE_STATUS,constants.PROPERTY_REGISTERED_STATUS].includes(property.status);\n }", "title": "" }, { "docid": "bcad82d2ac0dda717a45ee84fd55a1ba", "score": "0.5350765", "text": "supports(property) {\n return typeof property === 'string';\n }", "title": "" }, { "docid": "abc9f51e490e76e097126065cd7a8983", "score": "0.5349345", "text": "function isFunction(property) {\n return typeof property === 'function';\n }", "title": "" }, { "docid": "3d1248ab3518d2a40e5489b84fcf459b", "score": "0.5347128", "text": "function checkTrue(value) {\n return value === true;\n }", "title": "" }, { "docid": "50677eda9f202b5f7b8d6d2d3ef3daa8", "score": "0.5340976", "text": "function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }", "title": "" }, { "docid": "50677eda9f202b5f7b8d6d2d3ef3daa8", "score": "0.5340976", "text": "function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }", "title": "" }, { "docid": "50677eda9f202b5f7b8d6d2d3ef3daa8", "score": "0.5340976", "text": "function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }", "title": "" }, { "docid": "50677eda9f202b5f7b8d6d2d3ef3daa8", "score": "0.5340976", "text": "function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }", "title": "" }, { "docid": "50677eda9f202b5f7b8d6d2d3ef3daa8", "score": "0.5340976", "text": "function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }", "title": "" }, { "docid": "50677eda9f202b5f7b8d6d2d3ef3daa8", "score": "0.5340976", "text": "function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }", "title": "" }, { "docid": "50677eda9f202b5f7b8d6d2d3ef3daa8", "score": "0.5340976", "text": "function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }", "title": "" }, { "docid": "50677eda9f202b5f7b8d6d2d3ef3daa8", "score": "0.5340976", "text": "function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }", "title": "" }, { "docid": "50677eda9f202b5f7b8d6d2d3ef3daa8", "score": "0.5340976", "text": "function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }", "title": "" }, { "docid": "50677eda9f202b5f7b8d6d2d3ef3daa8", "score": "0.5340976", "text": "function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }", "title": "" }, { "docid": "50677eda9f202b5f7b8d6d2d3ef3daa8", "score": "0.5340976", "text": "function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }", "title": "" }, { "docid": "50677eda9f202b5f7b8d6d2d3ef3daa8", "score": "0.5340976", "text": "function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }", "title": "" }, { "docid": "50677eda9f202b5f7b8d6d2d3ef3daa8", "score": "0.5340976", "text": "function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }", "title": "" }, { "docid": "50677eda9f202b5f7b8d6d2d3ef3daa8", "score": "0.5340976", "text": "function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }", "title": "" }, { "docid": "69e6158de0afdef46d7cad805554ae68", "score": "0.53357583", "text": "function isFunction(property) {\n\t\t\treturn typeof property === 'function';\n\t\t}", "title": "" }, { "docid": "799c2cab9e88e43da24bc303431f7196", "score": "0.533268", "text": "boolean(value) {\n if (typeof value === \"boolean\") {\n return value;\n }\n\n if (typeof value === \"string\") {\n value = value.toLowerCase();\n\n if (value === \"true\") {\n return true;\n }\n\n if (value === \"false\") {\n return false;\n }\n }\n\n throw new Error(\"invalid boolean - \" + value);\n }", "title": "" } ]
8c666e0d277e5c8ae14d077dd7ac4835
===================================================================== Resets input text boxes =====================================================================
[ { "docid": "29180870d3df8e6146574170ec32446e", "score": "0.0", "text": "function ResetAddTextBox()\r\n{\r\n var el = iDoc.getElementById(\"addRow\");\r\n el.setAttribute(\"cleared\", 0);\r\n\r\n var el = iDoc.getElementById(\"txtURL\");\r\n el.value = el.getAttribute(\"value\");\r\n StyleSetAttributes(el, \"color: #999999;\");\r\n\r\n el = iDoc.getElementById(\"txtSearch\");\r\n el.value = el.getAttribute(\"value\");\r\n StyleSetAttributes(el, \"color: #999999;\");\r\n\r\n el = iDoc.getElementById(\"txtReplace\");\r\n el.value = el.getAttribute(\"value\");\r\n StyleSetAttributes(el, \"color: #999999;\");\r\n}", "title": "" } ]
[ { "docid": "7f58f9ef02da865ef75275b67d0f6259", "score": "0.7972397", "text": "function reset() {\n document.getElementById(\"text-inputs\").reset();\n}", "title": "" }, { "docid": "7a51f47ed7f35bdd3e1766fa5a92ab03", "score": "0.7893893", "text": "function resetFields() {\n Array.from(byClass('wo_input'))\n .forEach(el => { el.value = '' });\n updateWheel();\n}", "title": "" }, { "docid": "e698bb4fd611581d0ee537d79c8d1fd2", "score": "0.77321786", "text": "function resetFields() {\n inputEmail.current.value = \"\";\n inputFirstName.current.value = \"\";\n inputLastName.current.value = \"\";\n inputPhone.current.value = \"\";\n inputQuestion.current.value = \"\";\n }", "title": "" }, { "docid": "9b0661dc2db58d7937219f37d1817354", "score": "0.76497734", "text": "function resetForm() {\n setInputs(initial);\n }", "title": "" }, { "docid": "e6db02f114cc89528929c7a479421144", "score": "0.762268", "text": "function resetForm() {\n setInputs(initial);\n }", "title": "" }, { "docid": "e6db02f114cc89528929c7a479421144", "score": "0.762268", "text": "function resetForm() {\n setInputs(initial);\n }", "title": "" }, { "docid": "93cae3f6b8c0d8ee6f68207128129485", "score": "0.76189166", "text": "resetVersesInputText() {\n\t\tdocument.getElementById('verseInitialText').value = \"\";\n\t\tdocument.getElementById('verseFinalText').value = \"\";\n\n\t}", "title": "" }, { "docid": "78553d9b1c64b019fba8933ceb581d02", "score": "0.75858164", "text": "function reset()\r\n{\r\n for (let i = 0; i < textInputs.length; ++i)\r\n {\r\n document.getElementById(textInputs[i]).value = \"\";\r\n document.getElementById(errorAreas[i]).innerHTML = \"\";\r\n }\r\n\r\n document.getElementById(\"resultArea\").innerHTML = \"\";\r\n\r\n}", "title": "" }, { "docid": "a77e2377883b5c223e4de44c57b283bf", "score": "0.75720024", "text": "function resetInputField(){\n for (let i=0; i < resetInput.length; i++) {\n resetInput[i].value = \"\";\n resetInput[i].checked = false;\n }\n for (let j = 0; j < resetSelect.length; j++){\n resetSelect[j].value = \"\";\n }\n textArea.value = \"\";\n}", "title": "" }, { "docid": "1dab446fb635c9e51a8e13fa817c4859", "score": "0.75371206", "text": "function resetBox() {\n setInput(\"\");\n }", "title": "" }, { "docid": "5ebceaeb9aae16ec211daf0be0b98fef", "score": "0.7521701", "text": "function clearInputs() {\n $name.val('');\n $destination.val('');\n $firstTime.val('');\n $frequency.val('');\n $key.val('');\n }", "title": "" }, { "docid": "157dc8bf6b57b1a098fe97ca44c7feba", "score": "0.7439558", "text": "function resetInputs() {\n\tlet elementsToReset = document.getElementsByClassName(\"inputBox\");\t\t//Stores the document's inputBox collection inside the elementsToReset javascript variable for a faster access later\n\tlet max = elementsToReset.length;\t\t\t\t\t\t\t\t\t\t//Stores the elementsToReset collection lenght inside the max javascript variable for a faster access later\n\tlet i;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//The index of the for-loop (a classic for-loop is needed to change the elements HTML value attribute)\n\n\tfor (i = 0; i < max; i++) \t\t\t\t\t\t\t\t\t\t\t\t//For every element inside elementsToReset\n\t\telementsToReset[i].value = \"\"; \t\t\t\t\t\t\t\t\t\t//Set its HTML value attribute to \"\" (empties the text fields)\n}", "title": "" }, { "docid": "4b30840ba2acd2eac6e5c00cb87060c1", "score": "0.7417133", "text": "function resetFields()\n{\n\tdocument.getElementById(\"name\").value = \"\";\n\tdocument.getElementById(\"price\").value = \"\";\n\tdocument.getElementById(\"quantity\").value = \"\";\n\tdocument.getElementById(\"description\").value = \"\";\n}", "title": "" }, { "docid": "3864a5aed5ff8bb42f6991e86ee52f5f", "score": "0.7365371", "text": "function onClickReset() {\r\n cleanInputs();\r\n resetFieldsUi();\r\n}", "title": "" }, { "docid": "0287f48dd289ced1db2e02ea75f17ce5", "score": "0.7350031", "text": "function clearInputs() {\n titleInput.val('');\n descriptionInput.val('');\n}", "title": "" }, { "docid": "bdd2984e4ab363570ded9aea7d8b9eed", "score": "0.73409224", "text": "@api\n reset() {\n this.template.querySelectorAll('lightning-input-field')\n .forEach(field => {\n field.reset();\n });\n }", "title": "" }, { "docid": "1446860605d18956fcdca41aef02d467", "score": "0.7330496", "text": "function resetInput() {\n inputContent.value = \"\";\n inputContent.focus();\n}", "title": "" }, { "docid": "d35596c417d429fae26fd4380e5dae13", "score": "0.731942", "text": "clearInputs() {\r\n titleBook.value = '';\r\n authorBook.value = '';\r\n isbnBook.value = ''; \r\n}", "title": "" }, { "docid": "66408b8865e5f3b4f3c5977f848f8626", "score": "0.7315252", "text": "function resetForm() {\n document.getElementById('textbox').value = '';\n }", "title": "" }, { "docid": "8cfd80d8a46cb5a6f55d982a0000297b", "score": "0.7314379", "text": "function reset (){\n\t$( \"#caption-input\" ).removeClass(\"incomplete\");\n\t$( \"#major-input\" ).removeClass(\"incomplete\");\n\t$( \"#caption-input\" ).val(\"\");\n\t$( \"#major-input\" ).val(\"\");\n}", "title": "" }, { "docid": "c5fb847d7556724b4a6e644c3aa3e213", "score": "0.7313746", "text": "function clearInputs() {\n cardioNameInput.value = \"\";\n nameInput.value = \"\";\n setsInput.value = \"\";\n distanceInput.value = \"\";\n durationInput.value = \"\";\n repsInput.value = \"\";\n resistanceDurationInput.value = \"\";\n weightInput.value = \"\";\n}", "title": "" }, { "docid": "c5fb847d7556724b4a6e644c3aa3e213", "score": "0.7313746", "text": "function clearInputs() {\n cardioNameInput.value = \"\";\n nameInput.value = \"\";\n setsInput.value = \"\";\n distanceInput.value = \"\";\n durationInput.value = \"\";\n repsInput.value = \"\";\n resistanceDurationInput.value = \"\";\n weightInput.value = \"\";\n}", "title": "" }, { "docid": "a9551102668e3bbfaea286bf376140fc", "score": "0.73135203", "text": "resetInputs() {\n this.item_name.value = \"\";\n this.resetRadio();\n }", "title": "" }, { "docid": "3b5381121d1632aa4626b05103209710", "score": "0.72862244", "text": "function clearInputs() {\n\n pNameInp.value = \"\";\n pPriceInp.value = \"\";\n pCatInp.value = \"\";\n pDescInp.value = \"\";\n\n}", "title": "" }, { "docid": "3b38d15b49e59a49198039979d4b38fa", "score": "0.7276013", "text": "function clearInputFields() {\n $usernameFld.val(\"\");\n $passwordFld.val(\"\");\n $firstNameFld.val(\"\");\n $lastNameFld.val(\"\");\n $roleFld.val(\"\");\n }", "title": "" }, { "docid": "05a801a9c72843fb1d4f70aa2e698ce9", "score": "0.72687554", "text": "function clear() {\n\t\tfor (var i = 0; i < inputs.length; i++) {\n\t\t\tinputs[i].value = null;\n\t\t}\n\t}", "title": "" }, { "docid": "ad3a40651e0403b005adcfe3b17a3727", "score": "0.72623086", "text": "function resetInputs() {\n const taskName = modal.shadowRoot.getElementById(\"task-name\").elements.wrapper;\n const pomosRequired = modal.shadowRoot.getElementById(\"pomos-required\").elements.wrapper;\n const description = modal.shadowRoot.getElementById(\"description\").elements.wrapper;\n\n taskName.innerText = taskName.placeholder;\n taskName.userTyped = undefined;\n taskName.setAttribute(\"class\", \"pomo-input placeholder\");\n\n pomosRequired.innerText = pomosRequired.placeholder;\n pomosRequired.userTyped = undefined;\n pomosRequired.setAttribute(\"class\", \"pomo-input placeholder\");\n\n description.innerText = description.placeholder;\n description.userTyped = undefined;\n description.setAttribute(\"class\", \"pomo-input placeholder\");\n\n modal.elements.values = undefined;\n }", "title": "" }, { "docid": "1d94f05da8ac8eea68ba23d75c708c7b", "score": "0.726113", "text": "function resetForm() {\n partNumber.value = '';\n partName.value = '';\n materialType.value = '';\n partSize.value = '';\n partLength.value = '';\n partInfo.value = '---';\n }", "title": "" }, { "docid": "08600245fbf597d5bb8604a2ba5a154f", "score": "0.72559065", "text": "function reset() {\n document.form.textview.value = \"\";\n}", "title": "" }, { "docid": "ba4274234a677d1802f9d50c10279393", "score": "0.722943", "text": "function resetFields() {\n $('#oldPin').val('');\n $('#modalOldPin').val('');\n $('#modalNewPin').val('');\n }", "title": "" }, { "docid": "653999a2cd24f2ca62e8b24c95f52962", "score": "0.71964985", "text": "function resetFields() {\n document.getElementById(\"name\").value = \"\";\n document.getElementById(\"PPG\").value = \"\";\n document.getElementById(\"RPG\").value = \"\";\n document.getElementById(\"APG\").value = \"\";\n document.getElementById(\"BPG\").value = \"\";\n document.getElementById(\"SPG\").value = \"\";\n document.getElementById(\"FG\").value = \"\";\n document.getElementById(\"PER\").value = \"\";\n document.getElementById(\"position\").value = \"PG\";\n document.getElementById(\"imgFile\").value = \"\";\n }", "title": "" }, { "docid": "16a2e7576d5770bb30d790d9b8055ba8", "score": "0.7195418", "text": "function reset() {\n document.getElementById(\"output\").innerHTML = \"\";\n document.getElementById(\"input-text\").value = \"\"; \n }", "title": "" }, { "docid": "86cfadd65921bb3791e8714d7ff01266", "score": "0.7193907", "text": "function resetUserInputBox() {\r\n document.getElementById(\"userAnswerTextBox\").focus();\r\n document.getElementById(\"userAnswerTextBox\").value = \"\";\r\n}", "title": "" }, { "docid": "f3bf9c86a16a61ac88e23b76baec5c9d", "score": "0.7193369", "text": "function clearInputs() {\n $divForms.find('input').val('');\n }", "title": "" }, { "docid": "25d19cac3c6e6d05da5e66ff7e44932f", "score": "0.7176611", "text": "function resetInputs() {\n\t\tvar title = document.getElementById('title');\n\t\tvar description = document.getElementById('description');\n\t\tvar allInput = document.querySelectorAll(\"input[type='checkbox']\");\n\n\t\ttitle.value = ''; //reset input value\n\t\tdescription.value = ''; //reset input value\n\n\t\t// reset checkboxes\n\t\tfor (var i = 0; i < allInput.length; i++) {\n\t\t\tallInput[i].checked = false;\n\t\t}\n\t}", "title": "" }, { "docid": "ec4d4d1b41fe05c975dbc7dd8a0777bb", "score": "0.7166669", "text": "function clearInputFields() {\n $(\"#artist-input\").val('');\n $(\"#start-date-input\").val('');\n $(\"#end-date-input\").val('');\n }", "title": "" }, { "docid": "b48d82befe565cdd3fd732c11b95b921", "score": "0.71664166", "text": "function reset() {\n\t\tclearInterval(timerId);\n\t\ttimeId = null;\n\t\tindex = 0;\n\t\tid(\"output\").textContent = \"\";\n\t\tid(\"input-text\").value = \"\";\n\t\tid(\"input-text\").disabled = false;\n\t}", "title": "" }, { "docid": "bb7e4377faeda3287c6a3827519bc146", "score": "0.71535504", "text": "function resetmyforms(forminputs) {\n $(forminputs).val(\"\");\n }", "title": "" }, { "docid": "c4ae7bdb42d9960c6102f351d2ef9395", "score": "0.7147341", "text": "function clearInputs() {\n toDoText.value = '';\n toDoDate.value = '';\n toDoTime.value = '';\n }", "title": "" }, { "docid": "31fb9367d01915e94bcd1350285e5dd0", "score": "0.7133661", "text": "function resetElements() {\n document.getElementById('myForm').innerHTML = '';\n name = 0;\n workexp = 0;\n skills = 0;\n education = 0;\n profile = 0;\n email = 0;\n}", "title": "" }, { "docid": "34adc7bc32580f41b8baf0c12f47ed9e", "score": "0.7132087", "text": "resetInputBox() {\n this.DOM_ELEMENTS.inputBox.style.display = 'none';\n this.DOM_ELEMENTS.newTaskNotes.style.display = 'none';\n this.DOM_ELEMENTS.addNotesButton.value = 'Add Notes';\n this.DOM_ELEMENTS.newTaskNotes.value = '';\n this.DOM_ELEMENTS.newTaskName.value = '';\n this.DOM_ELEMENTS.newTaskPomos.value = '1';\n this.DOM_ELEMENTS.addTaskButton.style.display = 'block';\n }", "title": "" }, { "docid": "ec29c77297ed3856ba58f389828f006c", "score": "0.711954", "text": "function resetInputText (newElemCloned) {\n let initialInputs = newElemCloned.querySelectorAll(\"input[type=text]\");\n for (let i = 0; i < initialInputs.length; i++){\n initialInputs[i].value = \"\";\n }\n}", "title": "" }, { "docid": "8d0d6b2037b9da908ddd37d712eca7fe", "score": "0.70982534", "text": "function clearInputs() {\r\n $('#s-pid-input').val('');\r\n $('#s-name-input').val('');\r\n $('#s-dob-input').val('');\r\n $('#s-vaccine-input').val('');\r\n $('#s-phone-input').val('');\r\n $('#s-email-input').val('');\r\n }", "title": "" }, { "docid": "1d1b27067e9158c3f56b7233a7f04036", "score": "0.7096219", "text": "function resetInput() {\n input.value = \"\";\n}", "title": "" }, { "docid": "9e5c09509b6de6d47e5c2128b48dcfd1", "score": "0.7079941", "text": "function clearInputs() {\n\t$('.js-uname-entry').val() = '';\n\t$('.js-pword-entry').val() = '';\n}", "title": "" }, { "docid": "10f18c4fad7a131e7ba91876e6d39052", "score": "0.70671505", "text": "function emptyInputBoxes(){\n $(\"#inputTrainName\").val(\"\");\n $(\"#inputDestination\").val(\"\");\n $(\"#inputFirstTrainTime\").val(\"\");\n $(\"#inputFrequency\").val(\"\");\n }", "title": "" }, { "docid": "8e2b76fc1f1f2c95560d6d419998bb99", "score": "0.7059441", "text": "function clearInputs() {\n medicineInput.value = \"\";\n bloodTestInput.value = \"\";\n}", "title": "" }, { "docid": "9af06fbd68bf8c4199967574e57a5e07", "score": "0.70568764", "text": "function resetControls() {\r\n runSketch(blankSketch);\r\n document.getElementById('velocity').value = '';\r\n document.getElementById('angle').value = '';\r\n clearFields();\r\n}", "title": "" }, { "docid": "e6bb7f9347ba8b339fc3a00a6e8680a8", "score": "0.704677", "text": "function clearInputs() {\n\t$('.babyfirstname').val('');\n\t$('.babymiddlename').val('');\n\t$('.babylastname').val('');\n\t$('.dateofbirth').val('');\n\t$('.birthCity').val('');\n\t$('.birthweight').val('');\n\t$('.birthlength').val('');\n}", "title": "" }, { "docid": "e0ff45550f8fea4484b1a9e557abd6f3", "score": "0.70423776", "text": "function resetForm() {\n $leaveComment\n .attr('rows', '1')\n .val('');\n $cancelComment\n .closest('.create-comment')\n .removeClass('focused');\n }", "title": "" }, { "docid": "51c34dfeeff2175ea0385c0f8120fd67", "score": "0.703801", "text": "function EmptyInputs(){\n $(\"#inputTitle\").val(\"\");\n $(\"#selectGenre\").val(\"\");\n $(\"#selectAuthors\").val(\"\");\n $(\"#selectPublisher\").val(\"\");\n $(\"#inputPrice\").val(\"\");\n $(\"#inputEdition\").val(\"\");\n $(\"#inputCopies\").val(\"\");\n }", "title": "" }, { "docid": "106476adcfbab29cfe27aa7dfa8102b6", "score": "0.7036786", "text": "function resetCourseForm(){\r\n NameField.reset();\r\n AddressField.reset();\r\n PhoneField.reset();\r\n MobileField.reset();\r\n }", "title": "" }, { "docid": "a878d69a00a7b730369dd38d51d9a1e5", "score": "0.7036727", "text": "function resetForm() {\n document.getElementById(\"item\").value = \"\";\n document.getElementById(\"price\").value = \"\";\n document.getElementById(\"category\").value = \"\";\n document.getElementById(\"image\").value = \"\";\n document.getElementById(\"comment\").value = \"\";\n}", "title": "" }, { "docid": "e34d0f0706096a8c86d514f558fe79db", "score": "0.70350355", "text": "function resetInput() {\n for (i=0; i<countryInputs.length; i++) {\n document.getElementsByClassName(\"countryInput\")[i].value = \"\";\n }\n }", "title": "" }, { "docid": "6f13f088ebc3de2878fa16640cae6264", "score": "0.70298517", "text": "function clearInputs(){\n $(\"#make\").val('');\n $(\"#model\").val('');\n $(\"#colour\").val('');\n $(\"#amount\").val('');\n //:)\n}", "title": "" }, { "docid": "8a5188a5cad1615c242a7d8a6a562910", "score": "0.70199734", "text": "clearFields() {\n document.getElementById('title').value = '';\n document.getElementById('author').value = '';\n document.getElementById('isbn').value = '';\n }", "title": "" }, { "docid": "8a5188a5cad1615c242a7d8a6a562910", "score": "0.70199734", "text": "clearFields() {\n document.getElementById('title').value = '';\n document.getElementById('author').value = '';\n document.getElementById('isbn').value = '';\n }", "title": "" }, { "docid": "6625aef552dc41e0bdb05693dd221319", "score": "0.7019369", "text": "function resetField() {\n document.getElementById(\"name\").value = \"\";\n document.getElementById(\"derpartment\").value = \"\";\n document.getElementById(\"designation\").value = \"\";\n document.getElementById(\"salary\").value = \"\";\n}", "title": "" }, { "docid": "77a96e0c5d7bea2307ab883b9e442fe4", "score": "0.70074224", "text": "function resetInputs(){\n\t\tvar title = document.getElementById('title');\n\t\tvar description = document.getElementById('description');\n\t\tvar allInput = document.querySelectorAll(\"input[type='checkbox']\");\n\n\t\ttitle.value = '';\t\t\t\t\t\t\t\t//reset input value\n\t\tdescription.value = '';\t\t\t\t\t//reset input value\n\n\t\t// reset checkboxes\n\t\tfor (let i = 0; i < allInput.length; i++) {\n\t\t\tallInput[i].checked = false;\n\t\t}\t\n\t}", "title": "" }, { "docid": "0ee604348961e3dd968315f0c672a312", "score": "0.69931215", "text": "function resetOnInput() {\r\n\r\n var sO = CurStepObj;\r\n sO.numberExpr = null;\r\n clearTip();\r\n sO.keyboardEnabled = true;\r\n}", "title": "" }, { "docid": "0e83e1ff8262a1c004e9dbda3006c842", "score": "0.69906443", "text": "function reset() {\n\n document.getElementById('id').value = null;\n document.getElementById('name').value = null;\n document.getElementById('age').value = null;\n document.getElementById('address').value = null;\n}", "title": "" }, { "docid": "e0e6e670c8599eabf96dc6e6a9265427", "score": "0.6986415", "text": "function resetEditCourseForm(){\r\n ENameField.reset();\r\n EAddressField.reset();\r\n EPhoneField.reset();\r\n EMobileField.reset();\r\n }", "title": "" }, { "docid": "2452748bcc22379bec1daafb71120e34", "score": "0.69839096", "text": "resetMaterialTextfield(element) {\n\t element.value = '';\n\t element.parentNode.MaterialTextfield.boundUpdateClassesHandler();\n\t}", "title": "" }, { "docid": "c566680d324b8104ebc0ac722cd6c71f", "score": "0.6981494", "text": "function clearInputs() {\n document.querySelectorAll('.form-control').forEach(function(item) {\n item.value = '';\n });\n }", "title": "" }, { "docid": "dbe94dc8c52264facc92de966eab7064", "score": "0.69813734", "text": "function clearInputs() {\n var i;\n controlElem.value = '';\n for (i = 0; i < dilutions.length; i += 1) {\n dilElems[i].value = '';\n }\n updateResults();\n }", "title": "" }, { "docid": "52a1c0d4085a62a35dbca1df18a2c7ff", "score": "0.6978978", "text": "function resetTextBranch() {\n $('#name').val(\"\");\n $('#phone').val(\"\");\n $('#mail').val(\"\");\n $('#address').val(\"\");\n $('#introduct').val(\"\");\n $('#link').val(\"\");\n}", "title": "" }, { "docid": "c630ce67cc6650617866d11233c5ac80", "score": "0.6977301", "text": "function clearInputs(){\n\t$('#phrase').val(\"\");\n\t$('#translate').val(\"\");\n}", "title": "" }, { "docid": "24a9e850067b6955066ad01cbce703b4", "score": "0.6977005", "text": "function resetInput(){\n // document.getElementById(\"fileImg\").value = \"\";\n document.getElementById(\"directory\").value = \"\";\n document.getElementById(\"dim\").selectedIndex = \"1\";\n document.getElementById(\"text\").value = \"\";\n}", "title": "" }, { "docid": "78f2ddc95196914661799dcba25c64c7", "score": "0.69718796", "text": "function reset(){\n\n $(\"#train-name\").val(\"\");\n $(\"#destination\").val(\"\");\n $(\"#train-time\").val(\"\");\n $(\"#frequency\").val(\"\");\n }", "title": "" }, { "docid": "9c42000d39de1c3eb1535857cd1151d4", "score": "0.6958152", "text": "function resetForm() {\n titleInput.value = \"\";\n authorInput.value = \"\";\n pagesInput.value = \"\";\n finishedInput.checked = false;\n popUpTitle.textContent = \"New Book\";\n editMode = false;\n}", "title": "" }, { "docid": "0d121af9b5e145a147aaeb7515b3d8c9", "score": "0.6951584", "text": "resetInputValue() {\n this.view.textInput.reset()\n }", "title": "" }, { "docid": "ab21841d386e19e823a5d7c3769c4c6f", "score": "0.6944532", "text": "function clearInputs() {\n input.value=\"\";\n input2.value=\"\";\n input3.value=\"\";\n input3.value=\"\";\n input4.value=\"\";\n input5.value=\"\";\n}", "title": "" }, { "docid": "558ee066d4b27413e685421c25027e73", "score": "0.6941277", "text": "function performReset() {\n date_field.node().value = '';\n city_field.node().value = '';\n state_field.node().value = '';\n country_field.node().value = '';\n shape_field.node().value = '';\n handleClick();\n}", "title": "" }, { "docid": "6d63bf033dd4a039dcadec37e0658437", "score": "0.69384146", "text": "function resetFormInput() {\n $('#bookname').val(\"The Java Programming Language\");\n $('#studentid').val(\"0\");\n $('#issuedate').val(\"\");\n $('#issuestatus').val(\"Issued\");\n $(\"#issueid\").val(\"\");\n}", "title": "" }, { "docid": "9fab5ceb186795393941d49c30746c1c", "score": "0.6936621", "text": "function resetForm() {\n totalRoomCostField.innerHTML = \" \";\n discountField.innerHTML = \" \";\n taxField.innerHTML = \" \";\n totalCostField.innerHTML = \" \";\n inclusiveDateField.innerHTML = \" \";\n errorMsgIdField.innerHTML = \" \";\n }", "title": "" }, { "docid": "7407494e5a40e20aea917d38c3d5b762", "score": "0.69295764", "text": "function resetFormFields() {\n $(\"#username\").val(\"\");\n $(\"#emailId\").val(\"\");\n $(\"#phoneno\").val(\"\");\n $(\"#website\").val(\"\");\n }", "title": "" }, { "docid": "0528fbdb07f14880dd4d36f79482f1b1", "score": "0.6929218", "text": "function reset()\n{\n\tdocument.getElementById(\"enteredText\").value=\"\";\n\tdocument.getElementById(\"ans\").innerHTML=\"\";\n}", "title": "" }, { "docid": "d36def3600e002179d74195c4d886c2a", "score": "0.69177836", "text": "function reset(){\r\n document.getElementById('result').innerText = \"\";\r\n document.getElementById('textValue').value = \"\";\r\n\r\n}", "title": "" }, { "docid": "0046e698a6802377d2c4d65e71ae1f43", "score": "0.69064045", "text": "function resetInput () {\n userName = \"Bob\";\n botOption = \"\";\n userOption = \"\";\n result = \"\";\n resultText = \"\";\n endResultText = \"\";\n userScore = 0;\n botScore = 0;\n round = 0;\n // displayElement.innerHTML = \"\";\n // displayElement.remove(movesElement);\n // displayElement.remove(resultElement);\n // titleElement.innerHTML = \"\";\n // startElement.innerHTML = \"\";\n // drawElement = document.getElementById(\"draw\");\n // drawElement.innerHTML = \"\";\n // drawElement.remove(drawNameBox());\n // drawElement.remove(drawSelection());\n // drawElement.remove(drawDisplay());\n // drawElement.remove(drawReset());\n}", "title": "" }, { "docid": "3b184b0a3534ffaed28cc069d97f04cd", "score": "0.690394", "text": "function resetFields(){\n \t$(\".form-control\").val(\"\");\n }", "title": "" }, { "docid": "87302ad02b84df1c38dcd046b15226fa", "score": "0.68977183", "text": "function formReset() {\r\n document.getElementById(\"dataForm\").reset();\r\n let sources = document.getElementById(\"inputSources\");\r\n sources.className = \"form-control form-control-sm\";\r\n\r\n // remove any extrafields created\r\n let allmodels = Array.from(document.querySelectorAll('[id^=inputModel]'));\r\n let allserials = Array.from(document.querySelectorAll('[id^=inputSerial]'));\r\n let allfirmwares = Array.from(document.querySelectorAll('[id^=inputFirmware]'));\r\n\r\n for (let i = 1; i < allmodels.length; i++) {\r\n allmodels[i].parentNode.removeChild(allmodels[i]);\r\n allserials[i].parentNode.removeChild(allserials[i]);\r\n allfirmwares[i].parentNode.removeChild(allfirmwares[i]);\r\n }\r\n\r\n mainFields = 1;\r\n updateTextarea(\"reset\");\r\n}", "title": "" }, { "docid": "7c212ffadb4effb5602fc8284869132e", "score": "0.6896334", "text": "function resetPresidentForm(){\n equipoField.setValue('');\n descripcionField.setValue('');\n tagField.setValue('');\n }", "title": "" }, { "docid": "425f1a5807fbc1b49401cfb9a73371d3", "score": "0.68955976", "text": "function resetInputValue(){\n\n input.value = \"\";\n}", "title": "" }, { "docid": "d16deea0746f191f11b32fecaa36d32b", "score": "0.68932223", "text": "function resetNew() {\n $(\"#newName\").val(\"\");\n $(\"#aliasName\").val(\"\");\n $(\"#newId\").val(\"\");\n}", "title": "" }, { "docid": "e76e18b18d27b6dd13b8bde2cb73df45", "score": "0.6893214", "text": "function resetForm() {\n $('#numberStudentId').val('');\n $('#txtfirstname').val('');\n $('#txtlastname').val('');\n $('#txtemail').val('');\n $('#numberSupervisorId').val('');\n }", "title": "" }, { "docid": "c42e690dac08021c761662589676436d", "score": "0.6886574", "text": "function reset() {\n userInput = \"\";\n }", "title": "" }, { "docid": "6c2f1976736eb2724426be0ec09176ed", "score": "0.6882303", "text": "function clearInputField() {\n ctrl.data = '';\n updateInputValue();\n }", "title": "" }, { "docid": "99a705c6a334ddd10ee8aa85223c879b", "score": "0.6879926", "text": "function reset() {\n\tresultsContainer.html('');\n\twordSource.val('');\n\ttotalWords.text('');\n}", "title": "" }, { "docid": "26caf553b61f7daa77f02bcb26e4014f", "score": "0.6878958", "text": "function resetAdd()\r\n{\r\n document.getElementById(\"addFirstName\").value = \"\";\r\n document.getElementById(\"addLastName\").value = \"\";\r\n document.getElementById(\"addPhoneNumber\").value = \"\";\r\n document.getElementById(\"addEmail\").value = \"\";\r\n document.getElementById(\"addAddress\").value = \"\";\r\n}", "title": "" }, { "docid": "afcc9cb482638d0231cd52a91f7f2849", "score": "0.68744147", "text": "function resetField() {\n // reset input fields\n input_l1.value = 5;\n input_l2.value = 5;\n input_l3.value = 5;\n input_t1.value = 0;\n input_t2.value = 0;\n input_t3.value = 0;\n changeFieldBG(null, null);\n\n // change slider position\n matchSlider();\n\n // perform forward kinematic and render default posture\n forwardKinematic();\n}", "title": "" }, { "docid": "e3aa24cb1b9f7f350efa052f23475f26", "score": "0.6871661", "text": "function clearInputs() {\n $('#firstNameInput').val('');\n $('#lastNameInput').val('');\n $('#idNumberInput').val('');\n $('#jobTitleInput').val('');\n $('#annualSalaryInput').val('');\n}", "title": "" }, { "docid": "12e34af00b39e5995b0a01fedab39f8b", "score": "0.68677175", "text": "function clearForm() {\n const blankState = Object.fromEntries(\n Object.entries(inputs).map(([key, value]) => [key, ''])\n );\n\n setInputs(blankState);\n }", "title": "" }, { "docid": "12e34af00b39e5995b0a01fedab39f8b", "score": "0.68677175", "text": "function clearForm() {\n const blankState = Object.fromEntries(\n Object.entries(inputs).map(([key, value]) => [key, ''])\n );\n\n setInputs(blankState);\n }", "title": "" }, { "docid": "c7f3f59147fedefba61cb5a244c3ddad", "score": "0.6866899", "text": "function resetFields() {\r\n document.getElementById(\"tool-js-escape-form\").reset();\r\n}", "title": "" }, { "docid": "b81c89c0d38a838587018c2375bb0d80", "score": "0.68656874", "text": "function LimpiarinputsVehiculos()\n {\n $('#tipo_vehiculo').val(\"\");\n $('#año').val(\"\");\n $('#valor_vehiculo').val(\"\");\n }", "title": "" }, { "docid": "b0ada2faa1da4400d2a1287612e10664", "score": "0.6860628", "text": "function resetAll(){\n\tvar len = document.forms[0].length;\n\tvar controlType = null;\n\n\tfor(i = 0; i < len; i++){\n\t\tcontrolType = document.forms[0].elements[i].type;\n\t\tif(controlType == \"text\"){\n\t\t\tdocument.forms[0].elements[i].value=\"\";\n\t\t}else if(controlType == \"textarea\"){\n\t\t\tdocument.forms[0].elements[i].value=\"\";\n\t\t}else if(controlType == \"password\"){\n\t\t\tdocument.forms[0].elements[i].value=\"\";\n\t\t}else if(controlType == \"radio\"){\n\t\t\tdocument.forms[0].elements[i].checked=false;\n\t\t}else if(controlType == \"checkbox\") {\n\t\t\tdocument.forms[0].elements[i].checked=false;\n\t\t}else if((controlType == \"select-one\")&& (document.forms[0].elements[i].disabled != true)){\n\t\t\tdocument.forms[0].elements[i].selectedIndex=0;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a124ab314f541feccf2f2b2bb9ef4db1", "score": "0.68521816", "text": "function resetForm() {\n\n $(\"#planetName\").val(\"\");\n\n $(\"#planetOrdinality\").val(\"\");\n\n $(\"#planetDistance\").val(\"\");\n\n $(\"#planetSize\").val(\"\");\n\n $(\"#planetDescription\").val(\"\");\n\n $(\"#id\").val(\"\");\n\n}", "title": "" }, { "docid": "4276f394c7546dddb07d1cb1ae032b47", "score": "0.6844208", "text": "function reset()\n{\n document.getElementById(\"search\").value=\"\";\n document.getElementById(\"product_id\").value=\"\";\n document.getElementById(\"consultant_id\").value=\"\";\n document.getElementById(\"customization\").value=\"\";\n}", "title": "" }, { "docid": "023c43d2be2bd43ec8501b5bae679d28", "score": "0.68341714", "text": "function resetInputField(field) {\n field.value=\"\";\n}", "title": "" }, { "docid": "3ce880d71e30ec42ee68e2a8a2558d5a", "score": "0.6833777", "text": "function resetData() {\r\n\t\t$(\"#quantite\").val(\"\");\r\n\t\t$(\"#remise\").val(\"\");\r\n\t\t$(\"#libelArticle\").val(\"\");\r\n\t\t$(\"#prix\").val(\"\");\r\n\t\t$(\"#tva\").val(\"\");\r\n\t}", "title": "" }, { "docid": "1485cc0e03fd8e11703ccfbe92ca2560", "score": "0.6825565", "text": "function init() {\n input.value = \"\";\n}", "title": "" } ]
b3bff0409a93d8e3527790e9c3bd590b
Create socket, bind callbacks, connect to server
[ { "docid": "cd0f6e88ebd1c82234ed87fce05c9290", "score": "0.0", "text": "connect() {\n let agent = this;\n let uri = 'http://' + agent.conf.master.host + ':' + agent.conf.master.port;\n console.log('connecting:', uri);\n agent.socket = io.connect(uri, { forceNew: true, multiplex: false });\n agent.socket.on('error', function (reason) {\n console.error('err:', reason);\n agent.reconnect();\n });\n // Register announcement callback\n agent.socket.on('connect', function () {\n agent.log.info('Connected to server, sending announcement...');\n // console.log(agent.socket.socket.sessionid);\n // console.log(require('util').inspect(agent.socket.address,true,10,10));\n agent.announce(agent.socket);\n agent.connected = true;\n agent.reconnecting = false;\n agent.last_heartbeat = new Date().getTime();\n });\n agent.socket.on('disconnect', function () {\n agent.socket.disconnect();\n agent.log.error('Disconnect...');\n });\n // Server heartbeat\n agent.socket.on('heartbeat', function () {\n // agent.log.info(\"Received server heartbeat\");\n agent.last_heartbeat = new Date().getTime();\n return;\n });\n // Node with same label already exists on server, kill process\n agent.socket.on('node_already_exists', function () {\n agent.log.error('ERROR: A node of the same name is already registered');\n agent.log.error('with the log server. Change this agent\\'s instance_name.');\n agent.log.error('Exiting.');\n process.exit(1);\n });\n // begin to run\n agent.socket.on('run', function (message) {\n agent.run(message);\n });\n // Exit for BTN_ReReady\n agent.socket.on('exit4reready', function () {\n agent.log.info('Exit for BTN_ReReady.');\n process.exit(0);\n });\n }", "title": "" } ]
[ { "docid": "695763faddc23761a6e1a7d23afe3238", "score": "0.7283668", "text": "connect() {\n var self = this\n if (this.host === undefined || this.port === undefined) {\n log.error('No host or port specified: %s:%d', this.host. this.port)\n return\n }\n\n if (!this.connected) {\n self.clearState()\n this.server = net.connect(this.port, this.host, () => {\n self.connected = true\n log.info('Connected to server @%s:%d', self.host, self.port)\n log.debug('Running callbacks for connect @%s:%d', self.host, self.port)\n for (var i in self.callbacks.connected) {\n self.callbacks.connected[i](self)\n }\n })\n self.server.on('data', self.processData.bind(self))\n self.server.on('end', self.onDisconnect.bind(self))\n }\n }", "title": "" }, { "docid": "5bbf84da7310f1a1d24bbf811cb03150", "score": "0.7206141", "text": "setupSocket() { }", "title": "" }, { "docid": "405914d2cec8f3c658926e8f6bb6e019", "score": "0.70987177", "text": "function bindSocket(pairid){\n \n socket = io.connect(SOCKET, {'force new connection': true, 'reconnect': false,'sync disconnect on unload': true,});\n socket.on(\"connecting\", connecting);\n socket.on(\"connect\", bindRemoteActions);\n socket.on(\"error\", connectError);\n socket.on(\"connect_failed\", connectFail);\n\n }", "title": "" }, { "docid": "a490af24f03724c21960be8582952232", "score": "0.69718325", "text": "_initializeServerConnection() {\n this._socket = new Socket(this._options.secure, this._options.host, this._options.port, this._options.path, this._options.key);\n this.socket.on(SocketEventType.Message, data => {\n this._handleMessage(data);\n });\n this.socket.on(SocketEventType.Error, error => {\n this._abort(PeerErrorType.SocketError, error);\n });\n this.socket.on(SocketEventType.Disconnected, () => {\n // If we haven't explicitly disconnected, emit error and disconnect.\n if (!this.disconnected) {\n this.emitError(PeerErrorType.Network, \"Lost connection to server.\");\n this.disconnect();\n }\n });\n this.socket.on(SocketEventType.Close, () => {\n // If we haven't explicitly disconnected, emit error.\n if (!this.disconnected) {\n this._abort(PeerErrorType.SocketClosed, \"Underlying socket is already closed.\");\n }\n });\n }", "title": "" }, { "docid": "1150679cb6495e274549821b6f89416f", "score": "0.6835632", "text": "connect() {\n this.client.on('message', this._onMessage.bind(this));\n this.client.on('error', this._onError.bind(this));\n this.client.on('congestion', this._onCongestion.bind(this));\n this.client.once('connect', this._onConnect.bind(this));\n this.client.once('listening', this._onListening.bind(this));\n this.client.connect(this.socketPath);\n }", "title": "" }, { "docid": "e741ca2e8ac5f4a1d6fd1922629c8fc4", "score": "0.6828661", "text": "start(callback) {\n\t\tif (this.options.socket) {\n\t\t\t// just for internal debugging\n\t\t\tthis.server = net.createServer(() => this.socketListen());\n\t\t} else {\n\t\t\tthis.server = http.createServer((request, response) => this.listen(request, response));\n\n\t\t\tthis.wsServer = new WebSocketServer({\n\t\t\t\thttpServer: this.server,\n\t\t\t\t// OK only because this is for testing only\n\t\t\t\tautoAcceptConnections: false,\n\t\t\t});\n\t\t}\n\t\tthis.server.on('error', error => {\n\t\t\tif (error.code == 'EADDRINUSE') {\n\t\t\t\treturn this.createError('Port ' + this.port + ' in use, please free it and retry again', callback);\n\t\t\t}\n\t\t\treturn this.createError('Could not start server on port ' + this.port + ': ' + error, callback);\n\t\t});\n\t\tthis.server.listen(this.port, () => {\n\t\t\tif (!this.options.quiet) console.info(`Listening on http://localhost:${this.port}/`)\n\t\t\tcallback(null, this.server)\n\t\t});\n\t\tthis.wsServer.on('request', request => {\n\t\t\t// explicity omitting origin check here.\n\t\t\tconst connection = request.accept(null, request.origin);\n\t\t\tconnection.on('message', message => {\n\t\t\t\tif (message.type === 'utf8') {\n\t\t\t\t\tconnection.sendUTF(message.utf8Data);\n\t\t\t\t} else if (message.type === 'binary') {\n\t\t\t\t\tconnection.sendBytes(message.binaryData);\n\t\t\t\t}\n\t\t\t});\n\t\t\tconnection.on('close', () => {\n\t\t\t\tif (!this.options.quiet) console.info('Peer %s disconnected', connection.remoteAddress);\n\t\t\t});\n\t\t});\n\t\treturn this.server\n\t}", "title": "" }, { "docid": "db43485bc147a9126106c4db9e3d8c35", "score": "0.68020976", "text": "function connect(){\n // show connecting message\n // $('.chat-shadow .content').html('Connecting...');\n\n // creating the connection and saving the socket\n socket = io.connect(serverAddress);\n\n // now that we have the socket we can bind events to it\n bindSocketEvents();\n }", "title": "" }, { "docid": "76c0979fdca915345cc76b8e91ecf7fc", "score": "0.6777499", "text": "listen() {\n\n if (this.server) return;\n\n this._connections = new Map();\n\n this.server = this.createTransport();\n\n this.server.on('error', this.onError.bind(this));\n this.server.on('connection', this.handshake.bind(this));\n\n const config = this.config;\n this.server.listen(config.port, config.host);\n }", "title": "" }, { "docid": "5558a2c81cf89b63b446b1d711466d01", "score": "0.67658454", "text": "start(cb) {\n this.server = net.createServer()\n if (!(this.server instanceof net.Server)) {\n return false\n }\n\n this.server.on('listening', () => {\n this.emit('listening')\n console.log(`tcp connector listen on: ${this.host}:${this.port}`)\n })\n\n // 新用户连接\n this.server.on('connection', (conn) => {\n const socket = new Socket(conn)\n const msgCenter = new MsgCenter()\n\n this.emit('connection', socket)\n\n // 接收用户数据\n socket.on('message', message => {\n msgCenter.putData(Buffer.from(message))\n })\n\n msgCenter.onMsgRecv(data => {\n this.emit('message', socket, data)\n })\n\n // 用户断开连接\n socket.on('close', () => {\n this.emit('close', socket)\n })\n })\n\n if (this.host !== undefined) {\n this.server.listen(this.port, this.host)\n } else {\n this.server.listen(this.port)\n }\n\n return true\n }", "title": "" }, { "docid": "60f4c3fb2cf70c9ba25f503341132f9a", "score": "0.6752205", "text": "start(localAddr, wsHostUrl, remoteAddr, optionalHeaders, cb) {\n let localHost, localPort;\n this.wsHostUrl = wsHostUrl;\n if (typeof optionalHeaders === 'function') {\n cb = optionalHeaders;\n optionalHeaders = {};\n }\n\n if (typeof localAddr === 'number') {\n localPort = localAddr;\n } else {\n [localHost, localPort] = Array.from(localAddr.split(':'));\n if (/^\\d+$/.test(localHost)) {\n localPort = localHost;\n localHost = null;\n }\n localPort = parseInt(localPort);\n }\n if (localHost == null) { localHost = '127.0.0.1'; }\n\n this.tcpServer.listen(localPort, localHost, cb);\n return this.tcpServer.on(\"connection\", tcpConn => {\n const bind = (s, tcp) => {\n require(\"./bindStream\")(s, tcp);\n return this.emit('tunnel', s, tcp);\n };\n\n if (this.httpOnly) {\n return this._httpConnect(this.wsHostUrl, remoteAddr, optionalHeaders, (err, httpConn) => {\n if (!err) {\n return bind(httpConn, tcpConn);\n } else { return tcpConn.end(); }\n });\n } else {\n return this._wsConnect(this.wsHostUrl, remoteAddr, optionalHeaders, (error, wsStream) => {\n if (!error) {\n return bind(wsStream, tcpConn);\n } else {\n this.emit('connectFailed', error);\n return this._httpConnect(this.wsHostUrl, remoteAddr, optionalHeaders, (err, httpConn) => {\n if (!err) {\n return bind(httpConn, tcpConn);\n } else { return tcpConn.end(); }\n });\n }\n });\n }\n });\n }", "title": "" }, { "docid": "f6733bcda020e0bd5fd3bbc4ef5030d9", "score": "0.6707324", "text": "_onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info({\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n }, '%s established to %s:%s', this.secure ? 'Secure connection' : 'Connection', this._socket.remoteAddress, this._socket.remotePort);\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeAllListeners('data');\n this._socket.removeAllListeners('timeout');\n this._socket.removeAllListeners('close');\n this._socket.removeAllListeners('end');\n\n this._socket.on('data', chunk => this._onData(chunk));\n this._socket.once('close', errored => this._onClose(errored));\n this._socket.once('end', () => this._onEnd());\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', () => this._onTimeout());\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }", "title": "" }, { "docid": "f193be2fa4ffa40dba6f07997e781239", "score": "0.66653043", "text": "function initConnection(){\n if( !window.io ) return;\n\n socket = io();\n\n var keyContainer = document.getElementById( 'socketkey' );\n \n socketKey = keyContainer && keyContainer.dataset.socketkey;\n \n // couples the socket connection with a bucket on the server, owned by a specific transformation process\n socket.emit('socketkey', socketKey);\n\n // bind socket handlers\n socketHandlers.forEach( socket.on.bind( socket ) );\n\n // declares sendCustomMessage for use by consumers\n window.sendCustomMessage = function( type, data ){\n var transportObject = { socketKey: socketKey, type: type };\n if( data !== undefined ) transportObject.data = data;\n socket.emit( 'custom', transportObject );\n };\n}", "title": "" }, { "docid": "ed48ce64221fcbed5817c6740824e030", "score": "0.66036457", "text": "function doSocket(self, args, callback)\n{\n if(!args || !args.hashname) return callback(\"no hashname\");\n if(!args.to || !args.listen) return callback(\"need to and listen\");\n self.doLine(args.hashname, function(err){\n if(err) return callback(\"line failed\");\n var server = net.createServer(function(client) {\n debug('server connected');\n var stream = addStream(self, seen(self, args.hashname), \"sock\");\n var tunnel = wrapStream(self, stream);\n client.pipe(tunnel).pipe(client);\n // send sock open now\n stream.send({sock:args.to});\n });\n server.listen(args.listen, callback);\n });\n}", "title": "" }, { "docid": "9e35573528cd70e050462b12268c5a67", "score": "0.65964085", "text": "connect(existingSocket) {\n this.onDataReceived = (data) => this.onDataReceivedHandler(data);\n this.onClose = () => this.onCloseHandler();\n this.onError = (err) => this.onErrorHandler(err);\n this.onConnect = () => this.onConnectHandler();\n // Start timeout timer (defaults to 30 seconds)\n const timer = setTimeout(() => this.onEstablishedTimeout(), this.options.timeout || constants_1.DEFAULT_TIMEOUT);\n // check whether unref is available as it differs from browser to NodeJS (#33)\n if (timer.unref && typeof timer.unref === 'function') {\n timer.unref();\n }\n // If an existing socket is provided, use it to negotiate SOCKS handshake. Otherwise create a new Socket.\n if (existingSocket) {\n this.socket = existingSocket;\n }\n else {\n this.socket = new net.Socket();\n }\n // Attach Socket error handlers.\n this.socket.once('close', this.onClose);\n this.socket.once('error', this.onError);\n this.socket.once('connect', this.onConnect);\n this.socket.on('data', this.onDataReceived);\n this.setState(constants_1.SocksClientState.Connecting);\n this.receiveBuffer = new receivebuffer_1.ReceiveBuffer();\n if (existingSocket) {\n this.socket.emit('connect');\n }\n else {\n this.socket.connect(this.getSocketOptions());\n if (this.options.set_tcp_nodelay !== undefined &&\n this.options.set_tcp_nodelay !== null) {\n this.socket.setNoDelay(!!this.options.set_tcp_nodelay);\n }\n }\n // Listen for established event so we can re-emit any excess data received during handshakes.\n this.prependOnceListener('established', (info) => {\n setImmediate(() => {\n if (this.receiveBuffer.length > 0) {\n const excessData = this.receiveBuffer.get(this.receiveBuffer.length);\n info.socket.emit('data', excessData);\n }\n info.socket.resume();\n });\n });\n }", "title": "" }, { "docid": "b470b83306127857c17efaacf70fd24d", "score": "0.6590498", "text": "function initRepSocket() {\n\trepSocket.on('message', cbRespondeSolicitud);\n\trepSocket.bind(`tcp://${brokerIp}:${BROKER_REP_PORT}`);\n}", "title": "" }, { "docid": "6e0e9d1747219860ee6e1be3125bce25", "score": "0.6574051", "text": "_onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }", "title": "" }, { "docid": "6e0e9d1747219860ee6e1be3125bce25", "score": "0.6574051", "text": "_onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }", "title": "" }, { "docid": "4a6bb105eb199d4e481b50d3dec7c4ed", "score": "0.6558743", "text": "start(cb) {\n var self = this;\n\n // init socket client\n self.io = socketIOClient(self.config.server.url, self.config.server);\n\n // add socket events\n self.addSocketEvents(cb);\n }", "title": "" }, { "docid": "c1fa6a323b03640bb06b930841d9eedc", "score": "0.6548283", "text": "initServer(){\n\t\tthis.server = this.createServer();\n\t\tthis.server.on('error', function (e) {\n\t\t // Handle your servererror here\n\t\t console.log(e);\n\t\t});\n\n\t\tthis.socketio = require('socket.io').listen(this.server);\n\t}", "title": "" }, { "docid": "3598bb9df4905b5f84b3717504b639b5", "score": "0.65460104", "text": "connect(existing_socket) {\n this._onDataReceived = (data) => this.onDataReceived(data);\n this._onClose = () => this.onClose();\n this._onError = (err) => this.onError(err);\n this._onConnect = () => this.onConnect();\n // Start timeout timer (defaults to 30 seconds)\n const timer = setTimeout(() => this.onEstablishedTimeout(), this._options.timeout || constants_1.DEFAULT_TIMEOUT);\n // check whether unref is available as it differs from browser to NodeJS (#33)\n if (timer.unref && typeof timer.unref === 'function') {\n timer.unref();\n }\n // If an existing socket is provided, use it to negotiate SOCKS handshake. Otherwise create a new Socket.\n if (existing_socket) {\n this._socket = existing_socket;\n }\n else {\n this._socket = new net.Socket();\n }\n // Attach Socket error handlers.\n this._socket.once('close', this._onClose);\n this._socket.once('error', this._onError);\n this._socket.once('connect', this._onConnect);\n this._socket.on('data', this._onDataReceived);\n this.state = constants_1.SocksClientState.Connecting;\n this._receiveBuffer = new receivebuffer_1.ReceiveBuffer();\n if (existing_socket) {\n this._socket.emit('connect');\n }\n else {\n this._socket.connect(this.getSocketOptions());\n if (this._options.set_tcp_nodelay !== undefined &&\n this._options.set_tcp_nodelay !== null) {\n this._socket.setNoDelay(!!this._options.set_tcp_nodelay);\n }\n }\n // Listen for established event so we can re-emit any excess data received during handshakes.\n this.prependOnceListener('established', info => {\n setImmediate(() => {\n if (this._receiveBuffer.length > 0) {\n const excessData = this._receiveBuffer.get(this._receiveBuffer.length);\n info.socket.emit('data', excessData);\n }\n info.socket.resume();\n });\n });\n }", "title": "" }, { "docid": "3598bb9df4905b5f84b3717504b639b5", "score": "0.65460104", "text": "connect(existing_socket) {\n this._onDataReceived = (data) => this.onDataReceived(data);\n this._onClose = () => this.onClose();\n this._onError = (err) => this.onError(err);\n this._onConnect = () => this.onConnect();\n // Start timeout timer (defaults to 30 seconds)\n const timer = setTimeout(() => this.onEstablishedTimeout(), this._options.timeout || constants_1.DEFAULT_TIMEOUT);\n // check whether unref is available as it differs from browser to NodeJS (#33)\n if (timer.unref && typeof timer.unref === 'function') {\n timer.unref();\n }\n // If an existing socket is provided, use it to negotiate SOCKS handshake. Otherwise create a new Socket.\n if (existing_socket) {\n this._socket = existing_socket;\n }\n else {\n this._socket = new net.Socket();\n }\n // Attach Socket error handlers.\n this._socket.once('close', this._onClose);\n this._socket.once('error', this._onError);\n this._socket.once('connect', this._onConnect);\n this._socket.on('data', this._onDataReceived);\n this.state = constants_1.SocksClientState.Connecting;\n this._receiveBuffer = new receivebuffer_1.ReceiveBuffer();\n if (existing_socket) {\n this._socket.emit('connect');\n }\n else {\n this._socket.connect(this.getSocketOptions());\n if (this._options.set_tcp_nodelay !== undefined &&\n this._options.set_tcp_nodelay !== null) {\n this._socket.setNoDelay(!!this._options.set_tcp_nodelay);\n }\n }\n // Listen for established event so we can re-emit any excess data received during handshakes.\n this.prependOnceListener('established', info => {\n setImmediate(() => {\n if (this._receiveBuffer.length > 0) {\n const excessData = this._receiveBuffer.get(this._receiveBuffer.length);\n info.socket.emit('data', excessData);\n }\n info.socket.resume();\n });\n });\n }", "title": "" }, { "docid": "20d2e6ab74966636ddcb25335957826c", "score": "0.65015423", "text": "connect() {\n return new Promise((resolve, reject) => {\n //--------------------------------------------------\n // Create a new socket\n //--------------------------------------------------\n this._socket = dgram.createSocket((this._isV6IpAddress ? 'udp6' : 'udp4'));\n \n //--------------------------------------------------\n // Bind us to socket events\n //--------------------------------------------------\n \n this._socket.on('listening', () => {\n this.emit('connect');\n resolve(this);\n });\n \n this._socket.on('error', e => {\n debug('Could not connect to the MOX LT Server using the given information. ABORTING.');\n debug('Error: ' + e);\n \n this._socket.close();\n reject(e);\n });\n //--------------------------------------------------\n // Track income messages\n //--------------------------------------------------\n \n this._socket.on('message', this._socketReceivedMessageEvent.bind(this));\n\n this._socket.bind(this._clientPort, this._clientIpAddress);\n });\n }", "title": "" }, { "docid": "377e7bfb9e0c68f83ce80a0a58978eb8", "score": "0.64922106", "text": "_serverSetup( callback ) {\n\t\t// Self reference \n\t\tlet self = this;\n\n\t\t// Initialize the nodejs TCP server\n\t\tlet server = net.createServer((inboundSocket) => {\n\t\t\tself._requestHandler(inboundSocket);\n\t\t});\n\n\t\t// Callback attachment handling\n\t\tif( callback ) {\n\t\t\tserver.on('listening', () => { callback(self) });\n\t\t}\n\n\t\t// Open up the server host and port\n\t\tif( this._host ) {\n\t\t\tserver.listen(this._port, this._host);\n\t\t} else {\n\t\t\tserver.listen(this._port);\n\t\t}\n\n\t\t// Store the server object\n\t\tself._server = server;\n\n\t\t// Lets log the setup\n\t\tif( self._log ) {\n\t\t\tconsole.log(`# Starting proxy server at - ${self._host?self._host:\"\"}:${self._port}`)\n\t\t}\n\t}", "title": "" }, { "docid": "27ac22d0b2e3c94cac9804e9f243ffbb", "score": "0.6484888", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n\n}", "title": "" }, { "docid": "ad7c2017f35922e3700d9a0ef3634efb", "score": "0.64624107", "text": "function initSocksConnection(on_accept) {\n // keep llog of connected clients\n clients.push(this)\n\n // remove from clients on disconnect\n this.on('end', function() {\n var idx = clients.indexOf(this)\n if (idx != -1) {\n clients.splice(idx, 1)\n }\n })\n this.on('error', function(e) {\n lerror('%j', e)\n })\n\n // do a handshake\n this.handshake = handshake.bind(this)\n this.on_accept = on_accept // No bind. We want 'this' to be the server, like it would be for net.createServer\n this.on('data', this.handshake)\n}", "title": "" }, { "docid": "39ae7c1803c4bfabb05cdbdb15b352fd", "score": "0.6446677", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n}", "title": "" }, { "docid": "388f145ab95bfb70f096f4ba3152679f", "score": "0.6434852", "text": "connect() {\n this.runningUri.SetUrlState(true, Cr.NS_OK);\n this.urlListener?.OnStartRunningUrl(this.runningUri);\n if (this._socket?.readyState == \"open\") {\n // Reuse the connection.\n this.onOpen();\n } else {\n // Start a new connection.\n let useSecureTransport = this._server.isSecure;\n this._logger.debug(\n `Connecting to ${useSecureTransport ? \"snews\" : \"news\"}://${\n this._server.realHostName\n }:${this._server.port}`\n );\n this._socket = new TCPSocket(\n this._server.realHostName,\n this._server.port,\n {\n binaryType: \"arraybuffer\",\n useSecureTransport,\n }\n );\n this._socket.onopen = this._onOpen;\n this._socket.onerror = this._onError;\n }\n }", "title": "" }, { "docid": "1fa1dd686e52f55fcbd1314498ad0e5e", "score": "0.6426461", "text": "createServer() {\n return new net.Server((socket) => { return this.handleConnection(socket); } );\n }", "title": "" }, { "docid": "38c287ae7db21b58b1528ddefbb6d6e4", "score": "0.6420454", "text": "function StartSockets() {\n /*\n global.HttpsServer = https.createServer({\n key: fs.readFileSync(Config.SSLKey),\n cert: fs.readFileSync(Config.SSLCert)\n }, express);\n */\n global.HttpsServer = http.createServer(express);\n HttpsServer.listen(Config.Port);\n io.listen(HttpsServer);\n console.log(\"Sockets Listening On Port:\", Config.Port);\n}", "title": "" }, { "docid": "7b0481ce9f3c2182aae16f07a6547f79", "score": "0.6379579", "text": "function initSocksConnection(on_accept) {\n // keep log of connected clients\n clients.push(this);\n\n // remove from clients on disconnect\n this.on('end', function() {\n var idx = clients.indexOf(this);\n if (idx != -1) {\n clients.splice(idx, 1);\n }\n });\n this.on('error', function(e) {\n errorLog('%j', e);\n });\n\n // do a handshake\n this.handshake = handshake.bind(this);\n this.on_accept = on_accept; // No bind. We want 'this' to be the server, like it would be for net.createServer\n this.on('data', this.handshake);\n}", "title": "" }, { "docid": "cf873dbcf9c26cef2f7b391ede48e88d", "score": "0.63788706", "text": "_connect() {\n let resolver;\n let rejecter;\n const connected = new Promise((resolve, reject) => {\n resolver = resolve;\n rejecter = reject;\n });\n\n const socket = new net.Socket();\n socket.once('error', e => {\n // TODO: Figure out how to annotate this error with this context.\n //this.context.log(\"socket connect error:\", e);\n socket.destroy();\n rejecter(e);\n });\n socket.once('connect', () => {\n this.context.log(\"socket connected\");\n resolver(socket);\n });\n\n // Do not be tempted to promisifyAll and use connectAsync() because\n // net.Socket.connect() does not have a promisifyAll-compatible API!\n socket.connect(this.nextHopAddress);\n return connected;\n }", "title": "" }, { "docid": "8e2490a926cded5c466739214c7625cf", "score": "0.6365528", "text": "start() {\n debug('start()');\n this.server = net.createServer((socket) => {\n debug('handle new connection');\n let buffer = '';\n socket.on('data', (data) => {\n debug('received data chunk');\n buffer += data.toString();\n });\n socket.on('end', () => {\n debug('connection closed. emitting data.');\n this.emit(ResponseCollector_1.Events.RESPONSE, buffer);\n });\n }).listen(this.port);\n }", "title": "" }, { "docid": "7570b3f741674399de1fa55323272969", "score": "0.63653004", "text": "function createConnection() {\n socket = net.connect(device.port, device.ip, () => {\n console.log('Sending command...');\n sendCommand(user_id, method, params);\n });\n\n socket.on('data', (chunk, info) => {\n const message = chunk.toString();\n socket.destroy();\n response.json(message);\n });\n\n socket.on('close', function() {\n console.log('Connection closed');\n });\n }", "title": "" }, { "docid": "955f26b38b44e26cc8c3984bc8c49b04", "score": "0.63619506", "text": "init(addr) {\n if(typeof addr === 'string') {\n let u = url.parse(\"tcp://\" + addr, false, false);\n this.socket = new net.Socket();\n this.socket.connect(u.port, u.hostname, function() {});\n } else {\n // take addr as options of net.createConnection()\n this.socket = net.createConnection(addr);\n }\n \n this.socket.on('error', function(err){\n // Raising an exception in case of any error in socket\n const messageBoxOptions = {\n type: \"error\",\n title: \"Error in Main process\",\n message: err\n };\n dialog.showMessageBox(messageBoxOptions);\n process.exit(1);\n });\n\n this.socket.on('close', function() {\n process.exit();\n })\n return this\n }", "title": "" }, { "docid": "f0eb018b43e3c315c8f4433463d967f5", "score": "0.635392", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n}", "title": "" }, { "docid": "76c8af11b716920034fa5dc75fd7e562", "score": "0.6350608", "text": "function connect() {\n if (state) return;\n socket = new WebSocket(`ws://${ip}:${port}`);\n registerCallbacks();\n\n setTimeout(connect, 2000);\n }", "title": "" }, { "docid": "ee42ddc8ef3c1a835a3fe197aeb1fdc3", "score": "0.6333477", "text": "handleConnect() {\n this.connectionResolver(this.socket);\n // TODO: Create base socket endpoints for easier registration of handlers.\n this.socket.on('error', (err) => {\n const message = 'Socket error:' + JSON.stringify(err);\n console.error(message);\n new ErrorEvent(message).fire();\n });\n }", "title": "" }, { "docid": "39036aaa158bb156afabf284d98c7184", "score": "0.63322175", "text": "start (cb) {\n const sio = socketIO(httpServer, Object.assign({\n path: '/socket.io',\n pingTimeout: this.heartbeatTimeout,\n pingInterval: this.heartbeatInterval,\n transports: !this.opts && [\n 'websocket',\n 'polling-xhr',\n 'polling-jsonp',\n 'polling'\n ]\n }, this.opts))\n\n const port = this.port\n httpServer.listen(port, () => {\n console.log(`sio Server listening at port ${port}`)\n })\n\n sio.on('connection', (socket) => {\n const siosocket = new SioSocket(curId++, socket)\n this.emit('connection', siosocket)\n siosocket.on('closing', (reason) => {\n siosocket.send({ route: 'onKick', reason })\n })\n })\n\n process.nextTick(cb)\n }", "title": "" }, { "docid": "065d5d84f66568bf7409163a221dfc8a", "score": "0.63295037", "text": "openSockets() {\n\n // Helper Listeners\n Game.socketListeners(this.socket);\n AudioHelper.socketListeners(this.socket);\n ClientSettings.socketListeners(this.socket);\n\n // Database Listeners\n Entity.activateSocketListeners(this.socket);\n Users.socketListeners(this.socket);\n Scenes.socketListeners(this.socket);\n Journal.socketListeners(this.socket);\n }", "title": "" }, { "docid": "0bea3a0c53f12f75b0b8bb77f5789fc7", "score": "0.63149434", "text": "connect() {\n let io = this.getSocketIO();\n this.socket = io(this.options.host, this.options);\n return this.socket;\n }", "title": "" }, { "docid": "5d396ed2301a9c8a148cfb5eafafe9bb", "score": "0.6314048", "text": "function onListening() {\n const addr = server.address();\n const bind = typeof addr === \"string\"\n ? \"pipe \" + addr\n : \"port \" + addr.port;\n}", "title": "" }, { "docid": "a74da5fe97f58ebb6d560921c8169570", "score": "0.6280368", "text": "__onListening() {\n const debug = require('debug')('mockapi:server')\n var addr = this.address()\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port\n debug('Listening on ' + bind)\n }", "title": "" }, { "docid": "807469c4989d34f1db03307e3856b920", "score": "0.62529457", "text": "function startConnection() {\n\tsocket.connect(port, host);\n}", "title": "" }, { "docid": "22bf0e2588d974f18430d6f51af148f1", "score": "0.62397754", "text": "async listen() {\n // ! Don't forget to generate a key pair using src/create-certs.sh or npm run create-certs\n const [key, cert] = await Promise.all([\n fs.readFile(path.join(this.options.cert, \"localhost-privkey.pem\")),\n fs.readFile(path.join(this.options.cert, \"localhost-cert.pem\")),\n ]).catch((reason) => {\n if (reason.code === \"ENOENT\") {\n throw \"Missing certificate file(s). Try running 'npm run create-certs' or specifying their location with the --cert argument.\";\n } else {\n throw reason;\n }\n });\n\n // Create an instance\n const server = http2.createSecureServer(\n { key, cert },\n this._onRequest.bind(this)\n );\n // Invoke the listener on the port\n console.log(`HTTP2 Server is listening on ${this.options.port} for requests for ${this.options.root}`);\n server.listen(this.options.port);\n }", "title": "" }, { "docid": "027cb99d77c3716e829c349561f57feb", "score": "0.6233393", "text": "function _connectWebSocket(i_sClientName, i_oSuccessCB, i_oErrorCB) {\n m_oSocket = io();\n\n m_oSocket.on(\"reconnect\", _registerClient.bind(m_oInterface, i_sClientName));\n m_oSocket.on(\"connect\", () => {\n m_oSocket.off(\"connect\");\n m_oSocket.off(\"error\");\n\n m_bRegistrationInProgress = true;\n m_oOnRegistrationComplete = i_oSuccessCB;\n _registerClient(i_sClientName);\n });\n\n m_oSocket.on(\"error\", (i_oError) => {\n m_oSocket.off(\"connect\");\n m_oSocket.off(\"error\");\n i_oErrorCB(i_oError);\n });\n\n m_oSocket.on(\"message\", _onServerMsg.bind(m_oSocket));\n\n return m_oSocket;\n }", "title": "" }, { "docid": "d310ace4093c60e7da2ca80783426c13", "score": "0.62102926", "text": "function setup(){\n var conn = this;\n var socket = this._req.socket;\n // Allow us to send data immediately:\n socket.setTimeout(0);\n socket.setNoDelay(true);\n // Not sure if this is really needed:\n socket.setKeepAlive(true, 0);\n // Handle incoming data:\n // - I need to use ondata here, as I need access to\n // the start, end and raw buffer.\n socket.ondata = function(data, start, end){\n ondata.call(conn, data, start, end);\n };\n\n this.addListener(\"readyStateChange\", function(state){\n if(state == 4){\n attachClient.call(conn);\n } else if( state == 5 ){\n detachClient.call(conn);\n conn.emit(\"close\");\n }\n });\n \n socket.addListener(\"end\", function(){\n conn.readyState = 5;\n });\n}", "title": "" }, { "docid": "f99b9047bcee55faabec247f0828d2c0", "score": "0.6209279", "text": "function initReqSocket(ip,puerto, funcSuscribirseABroker){\n reqSocket.on('message', function(replyJSON) { cbRespuestaCoordinador(replyJSON,funcSuscribirseABroker) });\n reqSocket.connect(`tcp://${ip}:${puerto}`);\n}", "title": "" }, { "docid": "6d36696c436ab66a6f9e50a969d61c2e", "score": "0.6206077", "text": "function createMockServer(cb) {\n var server = nssocket.createServer(function(_socket) {\n\n send_cmd.on('cmd', function(data) {\n if (process.env.DEBUG)\n console.log('Sending command %j', data);\n _socket.send(data._type, data);\n });\n\n _socket.data('*', function(data) {\n this.event.forEach(function(ev) {\n send_cmd.emit(ev, data);\n });\n });\n\n });\n\n server.on('error', function(e) {\n throw new Error(e);\n });\n\n server.on('listening', function() {\n cb(null, server);\n });\n\n server.listen(4322, '0.0.0.0');\n}", "title": "" }, { "docid": "eed454dc69b722d18ff3439363448a90", "score": "0.6201781", "text": "function _serverSocketStart(handler) {\n\n var\n self = this;\n\n self._s = net.createServer(function(con){ self._clientInit(con) });\n self._s.listen(self._opts.port,self._opts.address || \"127.0.0.1\", function(err){\n if ( err ) {\n _debug(\"ERROR:\\tError binding on port \"+self._opts.port+\": \",err);\n }\n _debug(\"INFO:\\tListening on port \"+self._opts.port+\"\\n\");\n\n // Watch ping times\n// self._pingCheckInterval = setInterval(function(){ self._pingCheck() },10000);\n\n return handler();\n });\n\n}", "title": "" }, { "docid": "4cba86f06a298f68a9e21c7d5c85758c", "score": "0.6201099", "text": "listen() {\n\n // Start listener\n this.server.listen(config.port, '0.0.0.0', () => {\n console.log(`⚡️[server]: GameSocket is running at ${config.port}`);\n })\n\n // Listen for socket close event and destroy on error\n this.server.on('close', (error) => {\n throw new Error('⚡️[server]: GameSocket closed', error);\n })\n\n }", "title": "" }, { "docid": "4b8dd5bae7a678cf1b9d0106a4dcc990", "score": "0.6193678", "text": "function AbstractSocket() {}", "title": "" }, { "docid": "5590a4276ad2a374e7bd776599710123", "score": "0.61671895", "text": "function init() {\r\n // cleanup old connection if any\r\n if (this.connection) {\r\n this.connection.dispose();\r\n }\r\n\r\n this.connection = new Connection(\r\n this.options,\r\n this.baseUrl,\r\n onStreamingFailed.bind(this),\r\n );\r\n\r\n this.connection.setStateChangedCallback(\r\n onConnectionStateChanged.bind(this),\r\n );\r\n this.connection.setUnauthorizedCallback(onUnauthorized.bind(this));\r\n this.connection.setReceivedCallback(onReceived.bind(this));\r\n this.connection.setConnectionSlowCallback(onConnectionSlow.bind(this));\r\n\r\n // start the connection process\r\n connect.call(this);\r\n}", "title": "" }, { "docid": "51f067b86683a9c5f051da1e92da3cd4", "score": "0.61611646", "text": "_bind(socket) {\n let address = this._context.listen;\n let i = 0;\n while (i++ < 1000) {\n try {\n socket.bind(address);\n return this._context.debug('Cluster is now listening for incoming nodes at', address);\n } catch (e) {\n if (e.message == 'Address already in use') {\n address = address.replace(/(\\d+)$/, (match, number) => parseInt(number) + 1)\n } else {\n throw e;\n }\n }\n }\n throw new Error('Cluster is unable to listen for incoming messages');\n }", "title": "" }, { "docid": "8c90f2bde4027299611caef7b4f3ac96", "score": "0.6158134", "text": "connect() {\n this.socket = new WebSocket(\"wss://localhost:19999\", \"niba-server\", cc.loader.loadRes(\"server.crt\"));\n this.socket.onopen = (evt) => {\n cc.log(\"socket opened\");\n }\n this.socket.onerror = (evt) => {\n cc.log(\"socket error\");\n }\n this.socket.onclose = (evt) => {\n cc.log(\"socket closed\");\n }\n }", "title": "" }, { "docid": "fec6ac39dfc1bb8684fa9f3528bdc212", "score": "0.61573124", "text": "function Server ()\n{\n EventEmitter.call(this);\n this.connections = [];\n this._server = net.createServer(this._handleConnection.bind(this));\n}", "title": "" }, { "docid": "e814ef4a0c75fc4bfd95b42e8f15fe70", "score": "0.61561733", "text": "constructor() {\n super();\n this.tcpServer = net.createServer();\n }", "title": "" }, { "docid": "a7a1f9cba591612231b843c289836a21", "score": "0.615563", "text": "async function createSocket(host, port) {\n return new Promise((resolve, reject) => {\n const socket = _net.default.createConnection({\n host,\n port\n });\n\n socket.on('connect', () => resolve(socket));\n socket.on('error', error => reject(error));\n });\n}", "title": "" }, { "docid": "a7a1f9cba591612231b843c289836a21", "score": "0.615563", "text": "async function createSocket(host, port) {\n return new Promise((resolve, reject) => {\n const socket = _net.default.createConnection({\n host,\n port\n });\n\n socket.on('connect', () => resolve(socket));\n socket.on('error', error => reject(error));\n });\n}", "title": "" }, { "docid": "8ba525073169e8f81fe5e9ffa5803563", "score": "0.6153746", "text": "createConnection() {\n switch (this.connectionType) {\n // case types.WEBSOCKETS:\n case types.WEBSOCKETS:\n const io = require(\"socket.io\");\n this.server = io.listen(this.connectionPort);\n break;\n case types.TCP:\n // TODO ...\n break;\n case types.UDP:\n // TODO ...\n break;\n case types.HTTP:\n // TODO ...\n break;\n }\n }", "title": "" }, { "docid": "0df7e9a14f31a493f050918e8de55a36", "score": "0.61461043", "text": "connect()\n {\n //this.connection.connect(callback)\n }", "title": "" }, { "docid": "acb4d57dbecefae12155c21e5d49ef18", "score": "0.6129889", "text": "start (callback) {\n\t\tlet server = this; // we'll use 'this' inside the callback below\n\n\t\tserver.connection = net.createServer((socket) => {\n\t\t\tlet client = new Client(socket);\n\t\t\tvar firstMessageReceived = false;\n\t\t\tsocket.write('Hi, welcome to my chat server\\n');\n\n\t\t\tlet clientName = `${socket.remoteAddress}:${socket.remotePort}`;\n\t\t\tconsole.log(`${client.name} connected.`);\n\t\t\t//used to determine what stage of the chat we are at\n\t\t\t//0 = join_chatroom, 1 = message\n\t\t\tvar messageMode = 0;\n\t\t\t// Storing client for later usage\n\t\t\tserver.clients.push(client);\n\n\t\t\t// Triggered on message received by this client\n\t\t\tsocket.on('data', (data) => {\n\t\t\t\t\tlet m = data.toString().replace(/[\\n\\r]*$/, '');\n\t\t\t\t\tif(m === \"KILL SERVICE\") process.exit(0);\n\n\t\t\t\t\t//HELO thing\n\t\t\t\t\tif(getMessageType(m) === \"HELO\"){\n\t\t\t\t\t\tclient.socket.write(m+ \"\\nIP:\"+client.address+\"\\nPORT:\"+client.port+\"\\nStudentID:14318931\\n\")\n\t\t\t\t\t}\n\t\t\t\t\t//JOIN_CHATROOM thing\n\t\t\t\t\telse if(getMessageType(m) === \"JOIN\"){\n\t\t\t\t\t\tmessageMode = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse if (getMessageType(m) === \"LEAVE\"){\n\t\t\t\t\t\tsocket.write(\"LEFT_CHATROOM: \"+ client.chatroom+\"\\nJOIN_ID:\"+client.joinID)\n\t\t\t\t\t\tclient.chatroom = -1;\n\t\t\t\t\t\tmessageMode = 1;\n\t\t\t\t\t\tclient.joinID = \"\";\n\n\t\t\t\t\t}\n\t\t\t\t\telse if (getMessageType(m) === \"DISCONNECT\"){\n\t\t\t\t\t\tsocket.write(\"Goodbye \" + client.name + \"\\n\")\n\t\t\t\t\t\tsocket.destroy();\n\t\t\t\t\t}\n\t\t\t\t\tif(messageMode == 0){\n\t\t\t\t\t\tvar chatroomRegex = /JOIN_CHATROOM: .*/\n\t\t\t\t\t\tvar ipRegex = /CLIENT_IP: .*/\n\t\t\t\t\t\tvar portRegex = /PORT: .*/\n\t\t\t\t\t\tvar clientNameRegex = /CLIENT_NAME: .*/\n\t\t\t\t\t\tif(m.match(chatroomRegex)!= null){\n\t\t\t\t\t\t\tclient.chatroom = m.match(chatroomRegex)[0].substring(15, m.length)\n\t\t\t\t\t\t\tconsole.log(\"it worked, chatroom name = \" + client.chatroom)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(m.match(clientNameRegex) != null){\n\t\t\t\t\t\t\tclient.name = m.match(clientNameRegex)[0].substring(13, m.length)\n\t\t\t\t\t\t\tconsole.log(`${socket.remoteAddress}:${socket.remotePort}` + \" changed their name to \" + client.name);\n\t\t\t\t\t\t\tfor(var i = 0; i < this.clients.length; i++){\n\t\t\t\t\t\t\t\tif(!(this.clients[i].name === client.name) && this.clients[i].chatroom === client.chatroom){\n\t\t\t\t\t\t\t\t\tthis.clients[i].socket.write(`${client.name} joined the chatroom.\\n`);\n\t }\n\t\t\t\t\t\t\t}\n\t //add chatroom to list of chatrooms, get chatroom ID and join ID\n\t var chatroomExists = false;\n\t\t\t\t\t\t\tvar chatroomID;\n\t for(var i = 0; i < this.chatrooms.length; i++){\n\t if(client.chatroom === this.chatrooms[i]){\n\t chatroomExists = true;\n\t\t\t\t\t\t\t\t\tchatroomID = i;\n\t }\n\t }\n\t if(!chatroomExists){\n\t this.chatrooms.push(client.chatroom);\n\t\t\t\t\t\t\t\tchatroomID = this.chatrooms.length-1;\n\t console.log(\"added chatroom \" + this.chatrooms[this.chatrooms.length-1]);\n\t socket.write(\"You have created a chatroom that has never existed, NICE\\n\")\n\t }\n\n\t\t\t\t\t\t\t//join ID = hash of client name appended to unix time of join appended to chatroom ID\n\t\t\t\t\t\t\tvar date = new Date();\n\t\t\t\t\t\t\tvar time = date.getTime();\n\t\t\t\t\t\t\tvar joinstring = client.name+time+chatroomID;\n\t\t\t\t\t\t\tclient.joinID = hash(joinstring);\n\n\t\t\t\t\t\t\tsocket.write(\"JOINED_CHATROOM:\"+client.chatroom+\"\\nSERVER_IP:\"+this.address+\n\t\t\t\t\t\t\t\t\t\t\"\\nPORT:\"+this.port+\"\\nROOM_REF:\"+chatroomID+\"\\nJOIN_ID:\"+client.joinID);\n\t\t\t\t\t\t\tmessageMode = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar messageRegex = /MESSAGE: .*/\n\t\t\t\t\t\tvar chatroomID;\n\t\t\t\t\t\tfor(var i = 0; i < this.chatrooms.length; i++){\n\t\t\t\t\t\t\tif(client.chatroom === this.chatrooms[i]){\n\t\t\t\t\t\t\t\tchatroomID = i;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(m.match(messageRegex) != null){\n\t\t\t\t\t\t\tfor(var i = 0; i < this.clients.length; i++){\n\t\t\t\t\t\t\t\tif(!(this.clients[i].name === client.name) && this.clients[i].chatroom === client.chatroom){\n\t\t\t\t\t\t\t\t\tthis.clients[i].socket.write(\"CHAT: \"+ chatroomID+\"\\nCLIENT_NAME: \"+client.name+\"\\nMESSAGE: \"+ m.substring(9, m.length)+\"\\n\\n\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*\n\t\t\t\t\t\tconsole.log(`${client.name} in ${client.chatroom} said: ${m}`);\n\t\t\t\t\t\tfor(var i = 0; i < this.clients.length; i++){\n\t\t\t\t\t\t\tif(!(this.clients[i].name === client.name) && this.clients[i].chatroom === client.chatroom){\n\t\t\t\t\t\t\t\tthis.clients[i].socket.write(`${client.name} said: ${m}\\n`);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}*/\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t// Triggered when this client disconnects\n\t\t\tsocket.on('end', () => {\n\t\t\t\t\t// Removing the client from the list\n\t\t\t\t\tserver.clients.splice(server.clients.indexOf(client), 1);\n\t\t\t\t\tconsole.log(`${client.name} disconnected.`);\n\t\t\t\t\tfor(var i = 0; i < this.clients.length; i++){\n\t\t\t\t\t\t\tserver.clients[i].socket.write(`${client.name} disconnected.\\n`);\n\t\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\t// starting the server\n\t\tthis.connection.listen(this.port, this.address);\n\t\t// setuping the callback of the start function\n\t\tthis.connection.on('listening', callback);\n\t}", "title": "" }, { "docid": "5fd6e7e2c2506792fc5af40c61966e3e", "score": "0.611607", "text": "function startSocketServer() {\n 'use strict';\n server = net.createServer(function (c) {\n c.on('data', function (d) {\n if (d.toString().indexOf('\\r\\n\\r\\n') > -1) {\n c.end();\n }\n });\n }).listen(port);\n serverDestroyer(server);\n\n secure_server = net.createServer(function (c) {\n c.on('data', function (d) {\n c.end();\n });\n }).listen(port + 1);\n serverDestroyer(secure_server);\n}", "title": "" }, { "docid": "c88ca40be636d6897896c6d0647d37e7", "score": "0.6102316", "text": "function Server() {\n EventEmitter.call(this);\n this.connections = [];\n this._server = net.createServer(this._handleConnection.bind(this));\n}", "title": "" }, { "docid": "539678a2a3ec90ad06d9002f9db56731", "score": "0.60925764", "text": "function ConnectToServer(ipAddress)\r\n{\r\n console.log('Connecting to server :' + ipAddress);\r\n //Create connections\r\n this.socket = net.connect({port:TCPPort,host:ipAddress},function(){\r\n console.log('Connected to server');\r\n //Stop broading for finding server\r\n BroadCastOut.serverFound();\r\n });\r\n //If connection has error\r\n this.socket.on(\"error\",function (err)\r\n {\r\n console.log(\"Unexpected server loss\");\r\n //Kill connection\r\n this.destroy();\r\n //Become a server\r\n server = becomeServer();\r\n //Start listening for new clients\r\n broadCastIn = new BroadCastInCon();\r\n });\r\n //when server closes connection\r\n this.socket.on(\"end\", function()\r\n {\r\n console.log(\"Server Closed connection\");\r\n });\r\n //When recived data form server TCP\r\n this.socket.on('data',function(data){\r\n try {\r\n //Parse message to data Object\r\n dataObj = JSON.parse(data.toString());\r\n //Check message type\r\n switch (dataObj.type) {\r\n case \"message\": //Message is a text message\r\n console.log(\"Recived Message : \" + dataObj.data.toString());\r\n break;\r\n case \"become server\":\r\n //Message Object\r\n // type: \"became server\"\r\n // data: localAddress: Send our ip to the server\r\n var message = {type:\"became server\", data: localAddress};\r\n //the message object in string form\r\n var messageStr = JSON.stringify(message);\r\n //Send message to server\r\n this.write(messageStr);\r\n //Become a server\r\n server = becomeServer();\r\n //Start listening for clients\r\n broadCastIn = new BroadCastInCon();\r\n break;\r\n case \"change server\": //Message is to change servers\r\n //Destory connection to current server\r\n this.destroy();\r\n //Connect to new server\r\n connectionToServer = new ConnectToServer(dataObj.data);\r\n break;\r\n default:\r\n }\r\n } catch (e) {\r\n\r\n } finally {\r\n\r\n }\r\n });\r\n //When Server closes connection\r\n this.socket.on('end',function(){\r\n console.log('Lost connection to server');\r\n });\r\n //name: sendMaessge\r\n //description: sends message over this socket\r\n //params:\r\n // data: The data to send over the socket\r\n //Returns: undefined\r\n this.sendMessage = function (data)\r\n {\r\n this.socket.write(data);\r\n };\r\n //name: closeConnection\r\n //description: Clost the connection and the program\r\n //params: none\r\n //Returns: undefined\r\n this.closeConnection = function()\r\n {\r\n //Destory the tcp connection\r\n this.socket.destroy();\r\n //Then close the program\r\n console.log(\"Program Closed\");\r\n process.exit();\r\n }\r\n}", "title": "" }, { "docid": "95d0cf0d19ff801e748c74d958557edb", "score": "0.6091176", "text": "listen() {\n const server = new Websocket.Server({ port: P2P_PORT });\n server.on('connection', socket => this.connectSocket(socket));\n\n // allow later instances of the app connect to the original one immediately\n this.connectToPeers();\n\n console.log(`Listening for peer-to-peer connections on: ${P2P_PORT}`);\n }", "title": "" }, { "docid": "82b46b9acaf9af74770ff99a037816df", "score": "0.6080237", "text": "init(server){\n io = require('socket.io').listen(server);\n }", "title": "" }, { "docid": "49213f2a038212ad5f2fbf2b1cf763a3", "score": "0.607981", "text": "function addSocketListeners() {\n started = true;\n //Listen for incoming Windows app detections\n sock.on('message', function (msg) {\n var err, obj;\n try {\n var jsonString = msg.toString('utf8');\n obj = JSON.parse(jsonString);\n } catch (error) {\n err = error;\n }\n\n if (!err) {\n self.emit('message', obj);\n //process.stdout.write('*>'); //Use to test\n }\n });\n\n sock.on('connect', function (fd, ep) {\n console.log('Connect, endpoint:', ep);\n });\n\n sock.on('disconnect', function (fd, ep) {\n console.log('Disconnect, endpoint:', ep);\n });\n\n}", "title": "" }, { "docid": "38c059b8cc429fe5e92c196c867d3b5c", "score": "0.6077327", "text": "function connect() {\n socket = new WebSocket(options.url);\n socket.onopen = onOpen;\n socket.onclose = onClose;\n socket.onmessage = onMessage;\n socket.onerror = onError;\n }", "title": "" }, { "docid": "698817cd52d54b696a48a9a07c60a05d", "score": "0.60729134", "text": "socketListen(socket) {\n\t\tsocket.on('error', error => {\n\t\t\tif (!this.options.quiet) console.error('socket error: %s', error);\n\t\t\tsocket.end();\n\t\t});\n\t\tsocket.on('data', data => this.readData(data));\n\t}", "title": "" }, { "docid": "397e4af33ee2fe8ff536e071578f0173", "score": "0.60698926", "text": "connect(){\n var s_h = config.server_host,\n c_p = config.channels_port;\n //Audio.speak(\"Mediator service trying to connect to server port 8081\");\n this.socket = io.connect(\"http://\" + s_h + \":\" + c_p);\n this.socket.on('actions', (action) => {\n this.queue.push(action);\n });\n }", "title": "" }, { "docid": "d31b90ef5c5e94966d96b44d3c546088", "score": "0.60590243", "text": "function initIo(){\n const config = {'forceNew': true};\n const url = `${location.protocol}//${location.host}`;\n\n socket = io.connect(url, config);\n tasks.push({name: \"connectionChecker\", id: connectionChecker()});\n\n socket.on('connect', () => console.log(\"Sockets initialized\"))\n}", "title": "" }, { "docid": "38add3c856ac73bb170c3051dff0071a", "score": "0.6055735", "text": "addSocketEvents(cb) {\n var self = this;\n\n function fireCallback(err) {\n if (cb) {\n cb(err);\n cb = null;\n }\n }\n\n self.io\n .on('connect', () => {\n debug.log('connect');\n fireCallback();\n })\n .on('event', () => {\n debug.log('event');\n })\n .on('disconnect', () => {\n debug.log('disconnect');\n })\n .on('error', (err) => {\n debug.warn('err:', err);\n fireCallback(err);\n })\n .on('connect_error', (err) => {\n debug.warn('connect_error:', err);\n fireCallback(err);\n })\n .on('systemMessage', (data) => {\n debug.log('systemMessage:', data);\n })\n .on('requestMessage', function (req) {\n debug.log('incoming requestMessage:', JSON.stringify(req, null, 4));\n self.parseRequestMessage(req);\n });\n }", "title": "" }, { "docid": "fdfc59762cfba457cc60a4305373fc1d", "score": "0.60434747", "text": "start (callback) {\n let server = this; // we'll use 'this' inside the callback below\n server.connection = net.createServer((socket) => { // old onClientConnected\n let client = new Client(socket);\n console.log(`${client.name} connected.`);\n\n // TODO: Broadcast to everyone connected the new connection\n\n // Storing client for later usage\n server.clients.push(client);\n \n // Triggered on message received by this client\n socket.on('data', (data) => { \n let m = data.toString().replace(/[\\n\\r]*$/, '');\n console.log(`${clientName} said: ${m}`);\n socket.write(`We got your message (${m}). Thanks!\\n`);\n // TODO: Broadcasting the message to the other clients\n });\n \n // Triggered when this client disconnects\n socket.on('end', () => {\n // Removing the client from the list\n server.clients.splice(server.clients.indexOf(client), 1);\n console.log(`${client.name} disconnected.`);\n // TODO: Broadcasting that this client left\n });\n });\n // starting the server\n this.connection.listen(this.port, this.address);\n // setuping the callback of the start function\n this.connection.on('listening', callback);\n }", "title": "" }, { "docid": "a543209cbc911f8145ad820423b8cd7b", "score": "0.60409606", "text": "function onListening() {\n var addr = server.address()\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port\n debug(\"Listening on \" + bind)\n}", "title": "" }, { "docid": "b40df73529cc3f03875a39c2e89602da", "score": "0.60331106", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n //debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "d7c5e1e0ae65d06241017ec4715fa0de", "score": "0.6027689", "text": "listen() {\n io.listen(this._port);\n this.packets();\n }", "title": "" }, { "docid": "a68415f5992148e4383728fa7f7fb297", "score": "0.602628", "text": "function MySocket(socket){\r\n\tthis.socket = socket;\r\n\tfor(var i = 0; i < this.events.length; i++)\r\n\t\tthis.listenOn(this.events[i]);\r\n}", "title": "" }, { "docid": "605b84e6a4353df50af408d9a1e31fb6", "score": "0.6023631", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port; debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "62a33cd2008c0ba3b15a3443b0b7af08", "score": "0.602066", "text": "function initializeSocket(){\n\tsocket = io.connect('http://www.zkysar.com:8001');\n\tsocket.on('data', function(data){\n\t\tconnected = true;\n\t\tinitializeUsers(data.passengers,data.drivers);\n\t\tsocket.removeListener(\"data\");\n\t});\n\tsocket.on(\"location\",updateLocation);\n\tsocket.on(\"newPassenger\",addPassenger);\n\tsocket.on(\"newDriver\",addDriver);\n\tsocket.on(\"removeDriver\",removeDriver);\n\tsocket.on(\"removePassenger\",removePassenger);\n}", "title": "" }, { "docid": "451fc1433d60c915cb9616f3857d30bc", "score": "0.6020546", "text": "function initConnection(host, port, user, pass, socket, terminal, dispatch) {\n\n // Convert to webssh2 creds terminology\n var username = user;\n var userpassword = pass;\n\n socket.current = io(sshServiceHost, {\n resource: 'ssh/host/socket.io',\n query: {host, port, username, userpassword},\n });\n\n socket.current.on(\"connect\", () => dispatch({type: 'open'}));\n socket.current.on(\"disconnect\", (reason) => {\n // todo: identify when a close isn't an error?\n dispatch({type: 'error', data: reason})\n });\n\n for (const eventName of socketEventNames) {\n socket.current.on(eventName, getSocketEventHandler(eventName, terminal, socket, dispatch));\n }\n\n dispatch({ type: 'initialize' });\n\n return () => {\n // todo: tear down connection when component is being re-rendered / unrendered\n }\n}", "title": "" }, { "docid": "05042fd33452324cdb1c41005a17c089", "score": "0.6013872", "text": "watch(): void {\n this.socket.on('error', () => this.emit('error'));\n\n this.socket.on('listening', () => this.emit('listening'));\n\n this.socket.on('message', msg => this.emit('message', msg));\n\n this.socket.bind(1982, () => this.socket.addMembership('239.255.255.250'));\n }", "title": "" }, { "docid": "5a9bf62c256ff7a9558a90ca1bf0153f", "score": "0.60134643", "text": "function connect() {\n ws = new WebSocket(SERVER_URL, []);\n ws.onmessage = handleMessageReceived;\n //ws.onopen = handleConnected;\n ws.onerror = handleError;\n }", "title": "" }, { "docid": "5124a6a3a1649876eb23ece45f8c3905", "score": "0.5996552", "text": "function onListening() {\n\n let addr = server.address(), bind = ((typeof addr === 'string') ? ('pipe ' + addr) : ('port ' + addr.port));\n debug('Listening on - ' + bind);\n\n}", "title": "" }, { "docid": "acdbf92a81388e2d7dd3999553c05937", "score": "0.59963566", "text": "async init(callback){\n\t \tcallback(await createConn());\n }", "title": "" }, { "docid": "048213f08facd129b7fb0e9b05dc143e", "score": "0.59945995", "text": "startListening() {\n this.io.on('connection', socket => {\n socket.on('disconnect', (reason) => this.disconnected(socket));\n socket.on(\"MESSAGE\", (message) => this.incoming(socket, message)); \n })\n }", "title": "" }, { "docid": "b3a0e6c58d6752b393dd6e0f8ed550d4", "score": "0.5990685", "text": "function onListening() \n{\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "549dc51510632c0ce5a504df883c5cc7", "score": "0.59886426", "text": "_bind() {\n /**\n * Bind to node events.\n * @private\n */\n\n this.client.on(\"error\", err => {\n this.emit(\"error\", err);\n });\n\n this.client.on(\"connect\", async () => {\n try {\n await this.syncNode();\n } catch (e) {\n this.emit(\"error\", e);\n }\n });\n\n this.client.bind(\"block connect\", async (entry, txs) => {\n try {\n await this.addBlock(entry, txs);\n } catch (e) {\n this.emit(\"error\", e);\n }\n });\n\n this.client.bind(\"block disconnect\", async (entry, block, view) => {\n try {\n await this.unindexBlock(entry, block, view);\n } catch (e) {\n this.emit(\"error\", e);\n }\n });\n\n this.client.bind(\"chain reset\", async tip => {\n try {\n await this.rollback(tip.height);\n } catch (e) {\n this.emit(\"error\", e);\n }\n });\n }", "title": "" }, { "docid": "230fd90a2c88db0a6638b556804ad395", "score": "0.5985549", "text": "function initConn()\n{\n console.log('creating new connnection...');\n var o = {}; //new object\n o.socket = new net.Socket();\n o.socket.connect( parseInt( REMOTE_PORT ), REMOTE_ADDR,\n function(){\n try\n { \n console.log(\"writing new socket\");\n o.socket.write(\"\");\n }catch(e)\n {\n console.log(\"While writing new socket: \" + e.Message);\n }\n });\n o.upload = [];\n o.download = [];\n \n o.socket.on(\"data\", function(data)\n {\n //split the data from the server.\n for( var i = 0; i < data.length; i += payloadsize )\n {\n var b2 = Buffer.from( data.slice( i, i+payloadsize ) );\n console.log(\"data\" + i + \":\" + b2.toString());\n o.download.push( b2 );\n }\n });//o.socket.on data\n var l = connections.length;\n connections[l] = o;\n console.log('id: ' + l);\n return l;\n}", "title": "" }, { "docid": "ed8e0fcc55cd86918217c2a78727bac7", "score": "0.59848666", "text": "connectSocket(socket){\n //aggiunge l'url passato come parametro alla lista dei socket attivi \n this.socketArray.push(socket);\n console.log('socket connected');\n\n //event handler of messages (SERVER PART)\n this.messageHandler(socket);\n \n this.sendChain(socket);\n }", "title": "" }, { "docid": "4db2f181732942db8ec5b9d16cb692e8", "score": "0.5983864", "text": "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "title": "" }, { "docid": "58085cdadfb7c8888f788aae104f99e0", "score": "0.5982649", "text": "_initSocketIo() {\n this._io.on(\"connection\", async (socket) => {\n // emit status on client connection\n socket.emit(\"status\", await this.getStatus());\n\n // listen for play/stop events\n socket.on(\"play\", this._cueShow.bind(this));\n socket.on(\"stop\", this._stopShow.bind(this));\n\n socket.on(\n \"toggleLight\",\n this.wemoAdapter.toggleState.bind(this.wemoAdapter)\n );\n });\n }", "title": "" }, { "docid": "998146f49e4da96df5d562c09601662a", "score": "0.59821755", "text": "function onListening()\n{\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "a443a6aa3cebf333b9a5513ac620dd74", "score": "0.59792936", "text": "createClientSocket()\n\t{\n\t\tconsole.log(\"start socket client for sending text information to Jarvis\");\n\t\t//chain on same ip,port of express server\n\t\t\n\t\tlet webBotSocketIP = properties.get('appServer.webBotSocketIP');\n\t\tlet webBotSocketPort = properties.get('appServer.webBotSocketPort');\n\t\t\n\t\tconsole.log('http://'+webBotSocketIP+':'+webBotSocketPort);\n\t\tlet socket = io.connect('http://'+webBotSocketIP+':'+webBotSocketPort);\n\t\treturn socket;\n\t\t\n\t}", "title": "" }, { "docid": "b6561669f2ad28853ffa570315522bcb", "score": "0.5979187", "text": "listen() {\n const server = new WebSocket.Server({\n port: P2P_PORT,\n perMessageDeflate: false\n });\n server.on('connection', socket => {\n this.connectSocket(socket);\n });\n this.connectToPeers();\n log(chalk.blue(`Listening for peer to peer connection on port : ${P2P_PORT}`));\n\n this.proposeBlock();\n }", "title": "" }, { "docid": "fece7a3d6f910db8143f5ef709864118", "score": "0.59786516", "text": "static onListening() {\n const addr = ServerManager.myServer.address();\n const bind = typeof addr === 'string'\n ? `pipe ${addr}`\n : `port ${addr.port}`;\n //debug(`Listening on ${bind}`);\n }", "title": "" }, { "docid": "8077a0dfe94d051de05ec92634d5a520", "score": "0.59783614", "text": "function SocketClient() {\n this.iosocket = null\n this.disconnect_reason = null\n this.pass_messages_to = null\n this.afterConnect = function() {}\n this.afterMessage = function() {}\n this.afterDisconnect = function() {}\n this.promptChoice = function() {}\n this.afterChoice = function() {}\n this.afterLog = function() {}\n this.afterDraw = function() {}\n}", "title": "" }, { "docid": "0ecf823ae5278f00afba222520eec9aa", "score": "0.59751624", "text": "function Server(callback) {\n var self = this;\n net.Server.call(self, function(stream) {\n // emit an event with a new client object, whenever someone connects\n self.emit('client', new Client(self, stream));\n });\n if (callback) {\n self.addListener('client', callback);\n }\n}", "title": "" }, { "docid": "4ee8089723df49feadf68ee57045f72b", "score": "0.5972449", "text": "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n //debug('Listening on ' + bind);\n}", "title": "" }, { "docid": "657110d4061bcc3c4e8bc06830a088d1", "score": "0.5970499", "text": "function makeConnect(host) {\n return function(cb) {\n return net.connect(host, cb)\n }\n}", "title": "" }, { "docid": "657110d4061bcc3c4e8bc06830a088d1", "score": "0.5970499", "text": "function makeConnect(host) {\n return function(cb) {\n return net.connect(host, cb)\n }\n}", "title": "" }, { "docid": "3a2bf29d60a7cacd1a46f6be53f9bcfa", "score": "0.59704936", "text": "function onListening() {\n //var addr = server.address();\n const addr = host;\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "title": "" } ]
4174eaa115360d774005fcbf4dc04427
general map function checks horizontally,vertically and diagonally returns xcoord, ycoord, direction
[ { "docid": "1e70b3d2c04448f69189fe9870d8a2ed", "score": "0.6360095", "text": "function mapArea(...args) {\n function compare(r, c, x, y) {\n var flag = true;\n for (let i = 0; i < args.length; i++) { // still cant figure out how to avoid nested loops\n if (r + (i * x) < 0 || r + (i * x) > 16 || c + (i * y) < 0 || c + (i * y) > 18 || // avoid undefined array values by hiding behind short circuit op\n args[i] != table[r + (i * x)][c + (i * y)]) { flag = false; break; } // avoid unnecessary iteration\n } // end of args iteration\n return flag ? true : false;\n } // end of compare helper\n for (let r = 0; r < 17; r++) {\n for (let c = 0; c < 19; c++) {\n if (!table[r][c] && args[0] != \"\") continue; // cut iteration when cell is empty\n switch (true) {\n case compare(r, c, 0, 1): return {x : r, y : c, direction : \"horizontal\"};\n case compare(r, c, 1, 0): return {x : r, y : c, direction : \"vertical\"};\n case compare(r, c, 1, 1): return {x : r, y : c, direction : \"diagonal_pos\"};\n case compare(r, c, -1, 1): return {x : r, y : c, direction : \"diagonal_neg\"};\n } // end of switch\n } // end of inner for\n } // end of outer for\nreturn false;\n} // end of mapArea", "title": "" } ]
[ { "docid": "9292d80b1963f52727b3dbaaf55b4375", "score": "0.6349994", "text": "function checkFromPosition(x, y) {\n if (checkRow(y) || checkColumn(x) || checkDiagonals(x, y)) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "bac68b272c65fd4d7f130053c6580727", "score": "0.61834675", "text": "function checkAdjacentTiles(x1, y1) {\n if((x1>=0)&&(y1>=0)&&(x1<columns)&&(y1<rows)) //Verify if coordinates do not fall outside of the gridMatrix.\n return gridMatrix[x1+y1*columns];\n}", "title": "" }, { "docid": "6c4605a45e92b88f5bbe5dd7f83baf52", "score": "0.6182048", "text": "isMapHorizontal(bc){\n\t\tfor (let i = 0; i < this.map_height; i++){\n\t\t\tfor (let j = 0; j < this.map_width; j++){\n\t\t\t\tlet opp = this.getOppositePoint(j, i, true);\n\t\t\t\t//Assume horizontal then check if that is true\n\t\t\t\tif (bc.map[opp[1]][opp[0]] != bc.map[i][j] ||\n\t\t\t\t\tbc.karbonite_map[opp[1]][opp[0]] != bc.karbonite_map[i][j] ||\n\t\t\t\t\tbc.fuel_map[opp[1]][opp[0]] != bc.fuel_map[i][j]){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "title": "" }, { "docid": "2aa91893ae39befc31f2f61ba39806e8", "score": "0.61388475", "text": "isInMap(posX, posY, mapXSize, mapYSize, dir, distance) {\n switch (dir) {\n // LEFT\n case 37:\n if (posX - distance < 0) return false\n return true\n // UP\n case 38:\n if (posY - distance < 0) return false\n return true\n\n // RIGHT\n case 39:\n if (posX >= mapXSize - distance) return false\n return true\n\n // DOWN\n case 40:\n if (posY >= mapYSize - distance) return false\n return true\n }\n return false\n }", "title": "" }, { "docid": "721b29c4570f712960c8e169d4cec156", "score": "0.61188793", "text": "function main4(x,y,x1,y1){\n return (xy(x+x1,y+y1)) ||\n (xy(x-x1,y+y1)) ||\n (xy(x+y1,y+x1)) ||\n (xy(x+y1,y-x1));\n}", "title": "" }, { "docid": "1342c23b490161d5721389f78782517e", "score": "0.6093822", "text": "static getDirection(x1, y1, x2, y2) {\n if (x1 <= x2) {\n if (y1 <= y2) {\n return 1; // Down Right\n }\n else {\n return 2; // UP Right.\n }\n }\n else {\n if (y1 <= y2) {\n return 3; // Down Left\n }\n else {\n return 4; // UP Left\n }\n }\n }", "title": "" }, { "docid": "d965839c071bf4e756ea338e7dd11bae", "score": "0.6004306", "text": "function getInputDir(x, y, x2, y2) {\n if(x == x2 && y < y2) return 0;\n if(y == y2 && x > x2) return 1;\n if(x == x2 && y > y2) return 2;\n if(y == y2 && x < x2) return 3;\n if(x > x2 && y < y2) return 4;\n if(x > x2 && y > y2) return 5;\n if(x < x2 && y > y2) return 6;\n if(x < x2 && y < y2) return 7;\n return -1; // invalid, same pos\n}", "title": "" }, { "docid": "677870fccfd583fc1a4775c7f66e1162", "score": "0.6003572", "text": "function checkDirt(map, x, y){\n\n var found = false;\n map.forEach(function (arrayItem) {\t\n\tif (arrayItem.x == x && arrayItem.y == y && arrayItem.dirt === true){ \n\t found = true;\n\t arrayItem.dirt = false;\n\t}\n });\n return [map, found];\n}", "title": "" }, { "docid": "e37a7f91206503d2df61df4d92b6f900", "score": "0.5996022", "text": "function permNTInDirection(map, x, y, direction) {\n switch (direction) {\n case 'UP': return (\n y === 0 || (\n !getTileProperty(map[x][y - 1], 'traversable') &&\n getTileProperty(map[x][y - 1], 'permanent')\n )\n );\n case 'DOWN': return (\n y === map[0].length - 1 || (\n !getTileProperty(map[x][y + 1], 'traversable') &&\n getTileProperty(map[x][y + 1], 'permanent')\n )\n );\n case 'LEFT': return (\n x === 0 || (\n !getTileProperty(map[x - 1][y], 'traversable') &&\n getTileProperty(map[x - 1][y], 'permanent')\n )\n );\n case 'RIGHT': return (\n x === map.length - 1 || (\n !getTileProperty(map[x + 1][y], 'traversable') &&\n getTileProperty(map[x + 1][y], 'permanent')\n )\n );\n default:\n assert(false, `${direction} not in UP, DOWN, LEFT, RIGHT`);\n return null;\n }\n}", "title": "" }, { "docid": "9b6bf717d1f55a4e51a331b023a92fe4", "score": "0.59732", "text": "function canGather(start, dest, map) {\n\tif (start.x == dest.x) {\n\t\tif (start.y == dest.y - 1) {\n\t\t\treturn \"W\";\n\t\t} else if (start.y == dest.y + 1 ) {\n\t\t\treturn \"E\";\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t} else if (start.y == dest.y) {\n\t\tif (start.x == dest.x - 1) {\n\t\t\treturn \"N\";\n\t\t} else if (start.x == dest.x + 1) {\n\t\t\treturn \"S\";\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "8a8e230bea1623b62dfd001dffffe190", "score": "0.595287", "text": "function bounds_check(x, y){\r\n\t\r\n\tconsole.log(\"next x: \" + x);\r\n\tconsole.log(\"next y: \" + y);\r\n\t\r\n\t//check if still inside the map\r\n\tif(y > 1600) return true; // bottom edge\r\n\tif(y < 548) return true; // top edge\r\n\tif(x > 1150) return true; // right edge\r\n\tif(x < 120) return true; // left edge\r\n\t\r\n\t\r\n\t// check sides of main path\r\n\tif(x < 550 && x > 385 && y > 1080) return true; // bot left side\r\n\tif(x > 705 && x < 890 && y > 1080) return true; // bot right side\r\n\t\r\n\tif(x < 550 && x > 385 && y < 980) return true; // top left\r\n\tif(x > 705 && x < 890 && y < 980) return true; // top right\r\n\r\n\t// check right room\r\n\tif(x > 870 && x < 1125 && y < 860) return true; // top left room\r\n\tif(x > 870 && x < 1125 && y > 1190) return true; // bot left room\r\n\r\n\t// check left room\r\n\tif(x > 120 && x < 390 && y < 870) return true; // top right room\r\n\tif(x > 120 && x < 390 && y > 1120) return true; // bot right room\r\n\t\r\n\t\r\n\t\r\n\tif(player.y < 600){ // player is in the \"end zone\" display text from guards telling player to go get the key\r\n\t\t\t\"Sorry, can't let you go with out the key\"\r\n\t}\r\n\t\r\n\t\r\n\treturn false; // im still inbounds\r\n}", "title": "" }, { "docid": "634c36d11c35486cbdfc212b957bf419", "score": "0.5935861", "text": "function all8(x,y,x1,y1){\n return (xy(x+x1,y-y1)) ||\n (xy(x-x1,y-y1)) ||\n (xy(x-y1,y+x1)) ||\n (xy(x-y1,y-x1)) || \n main4(x,y,x1,y1);\n}", "title": "" }, { "docid": "f3b509a5ae35142e9bf8a1b341820169", "score": "0.5932382", "text": "function recognize_map(character)\n{\n var temp_position={x:0,y:0}\n for(var row=0;row<map.length;row++)\n {\n for(var col=0;col<map[0].length;col++)\n {\n if(map[row][col]==character){temp_position.x=row;temp_position.y=col;}\n }\n }\n return temp_position;\n}", "title": "" }, { "docid": "35b46b1dfb356291d9ece1ff48da0946", "score": "0.5890072", "text": "function rectangleMania(coords) {\n //Store all possible coordinates in an object, where the first\n //level object is the x coordinate, and the 2nd level is for\n //the second object\n let xCoord = {};\n for (let i = 0; i < coords.length; i++) {\n let coordinate = coords[i];\n let x = coordinate[0];\n let y = coordinate[1];\n\n if (!xCoord[x]) xCoord[x] = {};\n xCoord[x][y] = true;\n }\n let count = 0;\n //Look for corners possible corners\n for (let i = 0; i < coords.length; i++) {\n let firstCorner = coords[i];\n for (let j = i + 1; j < coords.length; j++) {\n let secondCorner = coords[j];\n //If they are are on the same coordinate, they are not opposite corners\n if (\n firstCorner[0] === secondCorner[0] ||\n firstCorner[1] === secondCorner[1]\n )\n continue;\n //I want to ignore any diagonals that are going from top left to bottom\n //right.\n if (\n firstCorner[0] <= secondCorner[0] &&\n firstCorner[1] >= secondCorner[1]\n )\n continue;\n //I want to ignore any diagonals that are going from bottom right to top\n //left, which is the same as before but going the other direction.\n if (\n firstCorner[0] >= secondCorner[0] &&\n firstCorner[1] <= secondCorner[1]\n )\n continue;\n\n if (\n xCoord[firstCorner[0]][secondCorner[1]] &&\n xCoord[secondCorner[0]][firstCorner[1]]\n )\n count++;\n }\n }\n return count;\n}", "title": "" }, { "docid": "869f1375f4821864218828f4df9db0fd", "score": "0.5884938", "text": "getCellCoords(layerX, layerY) {\n let quarterHeights = Math.floor(4 * layerY / this.sizeY_);\n // handle diagonals\n if (quarterHeights % 3 === 0) {\n const halfWidths = Math.floor(2 * layerX / this.sizeX_);\n const unitX = 2 * layerX / this.sizeX_ - halfWidths;\n const unitY = 4 * layerY / this.sizeY_ - quarterHeights;\n const hwEven = halfWidths % 2 === 0;\n const qm6even = quarterHeights % 6 === 0;\n if (hwEven === qm6even) {\n // diagonal up\n if (unitX + unitY > 1) {\n quarterHeights++;\n } else {\n quarterHeights--;\n }\n } else {\n // diagonal down\n if (unitY > unitX) {\n quarterHeights++;\n } else {\n quarterHeights--;\n }\n }\n }\n // now we're not in diagonal territory\n const cellY = Math.floor((quarterHeights - 1) / 3);\n if (cellY < 0 || cellY >= this.height) {\n return [NaN, NaN];\n }\n const cellX = cellY & 1 ? Math.floor(layerX / this.sizeX_ - 0.5) :\n Math.floor(layerX / this.sizeX_);\n if (cellX < 0 || cellX >= this.width) {\n return [NaN, NaN];\n }\n return [cellX, cellY];\n }", "title": "" }, { "docid": "3386cc7c0a5c5f02eef83ce9cdc745bd", "score": "0.58786964", "text": "function cm_checkalign(a){\n switch(a){\n case \"right\": return 1; break; case \"left\": return 2; break;\n case \"bottom\": return 3; break; case \"top\": return 4; break;\n case \"righttop\": return 5; break; case \"lefttop\": return 6; break;\n case \"bottomleft\": return 7; break; case \"topleft\": return 8; break;\n }return null\n}", "title": "" }, { "docid": "d8905278c427a2a31561b3a0208e302a", "score": "0.58786184", "text": "getPosToCheck(row, col) {\n let oddOffset = 0;\n let eventOffset = 0;\n if (row % 2 !== 0) {\n oddOffset = 1;\n } else {\n eventOffset = -1;\n }\n return {\n up: { r: row - 1, c: col },\n bot: { r: row + 1, c: col },\n left: { r: row, c: col - 1 },\n right: { r: row, c: col + 1 },\n uLeft: { r: row - 1, c: col - 1 + oddOffset },\n uRight: { r: row - 1, c: col + oddOffset + eventOffset },\n bLeft: { r: row + 1, c: col - 1 + oddOffset },\n bRight: { r: row + 1, c: col + 1 + eventOffset }\n };\n }", "title": "" }, { "docid": "c5d9a0e752957372eda01c9b0e97ba85", "score": "0.58122385", "text": "function direction (d) {\n if (d == 'D') {\n return checkTileSeqFromS(xDownInd)\n }\n if (d == 'R') {\n return checkTileSeqFromS(xRightInd)\n }\n if (d == 'T') {\n return checkTileSeqFromS(xTopInd)\n }\n if (d == 'L') {\n return checkTileSeqFromS(xLeftInd)\n }\n }", "title": "" }, { "docid": "fb20b93b74f35a6f6569e8d289f28d1a", "score": "0.5805692", "text": "function lookForWhatToMove(key) {\n var coord = \"\";\n for(var r = 0; r < dim_max; r++) {\n for(var c = 0; c < dim_max; c++) {\n if(m[r][c] == 16) {\n //console.log(key);\n switch(key) {\n //a, left\n case 65:\n case 37: if(validate(r, c+1)) coord = r+\";\"+c +\"$\"+ r+\";\"+(c+1); break;\n //w, up\n case 87:\n case 38: if(validate(r+1, c)) coord = r+\";\"+c +\"$\"+ (r+1)+\";\"+c; break;\n //d, right\n case 68:\n case 39: if(validate(r, c-1)) coord = r+\";\"+c +\"$\"+ r+\";\"+(c-1); break;\n //s, down\n case 83:\n case 40: if(validate(r-1, c)) coord = r+\";\"+c +\"$\"+ (r-1)+\";\"+c; break;\n }\n }\n }\n }\n //what is coord?\n //coord = \"emptyCellRow;emptyCellCol$foundCellRow;foundCellCol\"\n return coord;\n}", "title": "" }, { "docid": "1fda1467d4dfa1c48f93dad42b5974ae", "score": "0.58037555", "text": "function check(coords,type){\n var x = coords[0];\n var y = coords[1];\n if(x!=width-1){\n if(countMap[x+1][y]===type)\n {toCheck.push([x+1,y]); countMap[x+1][y]=2;}\n }\n if(x!= 0){\n if(countMap[x-1][y]===type)\n {toCheck.push([x-1,y]); countMap[x-1][y]=2;}\n }\n if(y!=height-1){\n if(countMap[x][y+1]===type)\n {toCheck.push([x,y+1]); countMap[x][y+1]=2;}\n }\n if(y!=0){\n if(countMap[x][y-1]===type)\n {toCheck.push([x,y-1]); countMap[x][y-1]=2;}\n }\n }", "title": "" }, { "docid": "80c52a438ece2ca855e4b79294e0863c", "score": "0.57977664", "text": "function nextLocation(row, col) {\r\n switch(parameters.direction) {\r\n case 0:\r\n col++;\r\n break;\r\n case 1:\r\n row++;\r\n break;\r\n case 2:\r\n col++;\r\n row++;\r\n break;\r\n case 3:\r\n col++;\r\n row--;\r\n break;\r\n case 4:\r\n col--;\r\n break;\r\n case 5:\r\n row--;\r\n break;\r\n case 6:\r\n col--;\r\n row++;\r\n break;\r\n case 7:\r\n col--;\r\n row--;\r\n break;\r\n }\r\n return {row, col};\r\n }", "title": "" }, { "docid": "07a3863799165d0cd186fee1238efa73", "score": "0.5796594", "text": "isTileVisible(visibility, x0, y0, x1, y1, dungeon, collisionMap) {\n\n if (gameState.lightLevel > 6) {\n //show room anyhow\n let rooms = dungeon.roomGrid[y0][x0];\n if (rooms !== null) {\n for (let i = 0; i < rooms.length; i++) {\n let r = rooms[i];\n if (\n x1 >= r.pos.x &&\n x1 < r.pos.x + r.size.x &&\n y1 >= r.pos.y &&\n y1 < r.pos.y + r.size.y\n ) {\n return true;\n }\n }\n }\n }\n\n // if one or both points are outside of this map, we discount it from the checks\n if (\n x0 < 0 ||\n x0 >= dungeon.size.x ||\n x1 < 0 ||\n x1 >= dungeon.size.x ||\n y0 < 0 ||\n y0 >= dungeon.size.y ||\n y1 < 0 ||\n y1 >= dungeon.size.y\n ) {\n return true;\n }\n\n // get the deltas and steps for both axis\n let dx = Math.abs(x1 - x0);\n let dy = Math.abs(y1 - y0);\n let sx = x0 < x1 ? 1 : -1;\n let sy = y0 < y1 ? 1 : -1;\n\n // stores an error factor we use to change the axis coordinates\n let err = dx - dy;\n\n while (x0 !== x1 || y0 !== y1) {\n // check our collision map to see if this tile blocks visibility\n if (collisionMap[y0][x0] === 1 || collisionMap[y0][x0] === 8) {\n return false;\n }\n\n // check our error value against our deltas to see if\n // we need to move to a new point on either axis\n let e2 = 2 * err;\n if (e2 > -dy) {\n err -= dy;\n x0 += sx;\n }\n if (e2 < dx) {\n err += dx;\n y0 += sy;\n }\n }\n\n let dist = mapOperations.getRangeDistance(y0, x0, playerData.currentTile.y, playerData.currentTile.x)\n if (dist > gameState.lightLevel) {\n return false\n }\n\n // if we're here we hit no occluders and therefore can see this tile\n return true;\n }", "title": "" }, { "docid": "ff1241d61010109bac6340e1019ea0fb", "score": "0.57862395", "text": "function specificPosition(x, y, end,direction) {\r\n\tif (direction < 0 || direction > 3) return null;\r\n\tvar result = [];\r\n\tvar addOnX, addOnY;\r\n\taddOnX = (direction % 2 == 0) ? 0 : ((x < end) ? 1:-1);\r\n\taddOnY = (direction % 2 == 0) ? ((y < end) ? 1:-1) : 0;\r\n\twhile ((addOnX != 0 && x != end)|| (addOnY != 0 && y != end)) {\r\n\t\tx += addOnX;\r\n\t\ty += addOnY;\r\n\t\tresult.push(y * 4 + x);\r\n\t\tbreak;\r\n\t}\r\n\treturn result;\r\n}", "title": "" }, { "docid": "0780cea3977e4d31748a7277b2b9ffba", "score": "0.57511795", "text": "function adjacentToRoom(centerTile : TileInfo, x : int, y : int) : boolean {\n\t//create an array of the 8 adjacent tiles\n\tvar tiles : TileInfo[] = new TileInfo[8];\n\ttiles[0] = Tile.GetTile(new Int2(x-1, y-1));\n\ttiles[1] = Tile.GetTile(new Int2(x, y-1));\n\ttiles[2] = Tile.GetTile(new Int2(x+1, y-1));\n\ttiles[3] = Tile.GetTile(new Int2(x-1, y));\n\ttiles[4] = Tile.GetTile(new Int2(x+1, y));\n\ttiles[5] = Tile.GetTile(new Int2(x-1, y+1));\n\ttiles[6] = Tile.GetTile(new Int2(x, y+1));\n\ttiles[7] = Tile.GetTile(new Int2(x+1, y+1));\n\t\n\t//for each tile in the array\n\tfor(var i : int = 0; i < 8; i++){\n\t\t//if the tile is neither a tree nor collider tree then\n\t\t\tif(!(tiles[i].tile == 19\n\t\t\t\t\t&& (tiles[i].set == 0 || tiles[i].set == 2))) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\treturn false;\n}", "title": "" }, { "docid": "d350808c2852e524f11fe15cf9cc312d", "score": "0.57268465", "text": "function getGridPos(direction, size, x, y, i){\n\tswitch(direction){\n\t\t// up\n\t\tcase 0:\n\t\t\treturn size * (y - i) + x;\n\t\t// up-right\n\t\tcase 1:\n\t\t\treturn size * (y - i) + (x + i);\n\t\t// right\n\t\tcase 2:\n\t\t\treturn size * y + (x + i);\n\t\t// down-right\n\t\tcase 3:\n\t\t\treturn size * (y + i) + (x + i);\n\t\t// down\n\t\tcase 4:\n\t\t\treturn size * (y + i) + x;\n\t\t// down-left\n\t\tcase 5:\n\t\t\treturn size * (y + i) + (x - i);\n\t\t// left\n\t\tcase 6:\n\t\t\treturn size * y + (x - i);\n\t\t// up-left\n\t\tcase 7:\n\t\t\treturn size * (y - i) + (x - i);\n\t\tdefault:\n\t\t\treturn -1;\n\t}\n\n\n}", "title": "" }, { "docid": "7357d054a74e5087c6446314a070162d", "score": "0.57168114", "text": "checkDiagonallyLeft(row,column) {\n let upSimilar=0;\n let downSimilar=0;\n let tempColumn = column.valueOf();\n let tempRow = row.valueOf();\n //counting upSimilar right diagonally\n tempRow--;\n tempColumn--;\n while(this.rowColumnInRange(tempRow,tempColumn)) {\n if(this.gameBoard[tempRow][tempColumn] === this.turn) {\n upSimilar++;\n } else {\n break;\n }\n tempRow--;\n tempColumn--;\n }\n tempRow = row.valueOf();\n tempColumn = column.valueOf();\n tempRow++;\n tempColumn++;\n while(this.rowColumnInRange(tempRow,tempColumn)) {\n if(this.gameBoard[tempRow][tempColumn] === this.turn) {\n downSimilar++;\n } else {\n break;\n }\n tempRow++;\n tempColumn++;\n }\n if(upSimilar+downSimilar+1 >=4) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "93034acf05be8892b716990f598a0d55", "score": "0.5716606", "text": "function imgDir (row, col) {\n var num = 0\n if (this.get(row, col, DIRECTION) & NORTH) num += 1\n if (this.get(row, col, DIRECTION) & SOUTH) num += 1\n if (this.get(row, col, DIRECTION) & EAST) num += 1\n if (this.get(row, col, DIRECTION) & WEST) num += 1\n return num\n}", "title": "" }, { "docid": "a9fa9c55fc22f7e923dd4dd7ee78207a", "score": "0.5705212", "text": "function direction(x) {\n if (x < 22.5 || x > 337.5) {return \"North\"}\n else if (x > 22.5 && x < 67.5) {return \"NorthEast\"}\n else if (x > 67.5 && x < 112.5) {return \"East\"}\n else if (x > 112.5 && x < 157.5) {return \"SouthEast\"}\n else if (x > 157.5 && x < 202.5) {return \"South\"}\n else if (x > 202.5 && x < 247.5) {return \"SouthWest\"}\n else if (x > 247.5 && x < 292.5) {return \"West\"}\n else if (x > 292.5 && x < 337.5) {return \"NorthWest\"}\n}", "title": "" }, { "docid": "ad9d442128c9bd7f6709097733d09dde", "score": "0.56886744", "text": "function checkIslandAndSink(row, col) {\n // The base case will be when the current space is water\n if (grid[row][col] === '0') {\n return 0\n }\n // Sink the island\n grid[row][col] = '0'\n // We use variables to define the 4 directions\n // UP\n let up\n // DOWN\n let down\n // LEFT\n let left\n // RIGHT\n let right\n \n // For the recursive cases,\n // We'll use 4 if statements, one for each direction\n // if the space UP is land\n // This basically checks if the space we want to go to is VALID, and then changes to that space\n if (row - 1 >= 0) {\n up = checkIslandAndSink(row - 1, col)\n } \n // if the space DOWN is land\n // Go to that space (use the recursive function on that space)\n if (row + 1 < numRows) {\n down = checkIslandAndSink(row + 1, col)\n } \n // if the space LEFT is land\n // Go to that space (use the recursive function on that space)\n if (col - 1 >= 0) {\n left = checkIslandAndSink(row, col - 1)\n } \n // if the space RIGHT is land\n // Go to that space (use the recursive function on that space)\n if (col + 1 < numCols) {\n right = checkIslandAndSink(row, col + 1)\n } \n // Return the fact that there is ONE island here\n return 1\n }", "title": "" }, { "docid": "1c365f9f513331511ba6a76eddb103b2", "score": "0.56870025", "text": "function moveOn(thismap,x,y) {\n \n var stepx=0;\n var stepy=0;\n for (var i in thismap) {\n //alert ('GO');\n stepx=thismap[i][0];\n stepy=thismap[i][1];\n // dejamos el rastro\n var startpoint='#point_'+y+'-'+x;\n $(startpoint).text('0'); \n x=x+stepx;\n y=y+stepy;\n // nueva direccion\n var startpoint='#point_'+y+'-'+x;\n $(startpoint).text('A'); \n }\n \n \n return true;\n}", "title": "" }, { "docid": "3bd06cab5ffea2e1a028bf8462914408", "score": "0.56858605", "text": "coordsIn(x,y) {\r\n // remap x and y to be relative to the center of the card stack\r\n x -= this.x;\r\n y -= this.y;\r\n\r\n // adjust for the rotation of the card stack\r\n var newX = x * Math.cos(-this.angle) - y * Math.sin(-this.angle);\r\n var newY = x * Math.sin(-this.angle) + y * Math.cos(-this.angle);\r\n\r\n // check if the coordinates are within the boundaries of the card stack\r\n if (newX > - CARD_WIDTH / 2 - 15\r\n && newX < CARD_WIDTH / 2 + 35\r\n && newY > - CARD_HEIGHT / 2 - 45\r\n && newY < CARD_HEIGHT / 2 + 15)\r\n {\r\n return true;\r\n }\r\n return false;\r\n }", "title": "" }, { "docid": "b98d33e0cd6b9a4f0d2e672d9c14c4b5", "score": "0.5685102", "text": "_getDiggingDirection(cx, cy) {\n if (cx <= 0 || cy <= 0 || cx >= this._width - 1 || cy >= this._height - 1) {\n return null;\n }\n let result = null;\n let deltas = _constants_js__WEBPACK_IMPORTED_MODULE_3__[\"DIRS\"][4];\n for (let i = 0; i < deltas.length; i++) {\n let delta = deltas[i];\n let x = cx + delta[0];\n let y = cy + delta[1];\n if (!this._map[x][y]) { /* there already is another empty neighbor! */\n if (result) {\n return null;\n }\n result = delta;\n }\n }\n /* no empty neighbor */\n if (!result) {\n return null;\n }\n return [-result[0], -result[1]];\n }", "title": "" }, { "docid": "34f40c0278c8be7688d390c6d6ae9bb6", "score": "0.5679685", "text": "checkAlienPos(coords) {\n let coordVal = this.getCellAt(coords);\n if (coordVal === \"E\") return true;\n else if(coordVal === \"1\" || coordVal === \"S\" || coordVal === \"D\" || coordVal === \"D1\") {\n return;\n } else {\n this.setCellAt(coords, \"S\");\n }\n\n if (this.validMove([coords[0], coords[1] + 1])){\n if (this.checkAlienPos([coords[0], coords[1] + 1]) === true ) return true;\n }\n if (this.validMove([coords[0], coords[1] - 1])){\n if (this.checkAlienPos([coords[0], coords[1] - 1]) === true ) return true;\n }\n if (this.validMove([coords[0] + 1, coords[1]])){\n if (this.checkAlienPos([coords[0] + 1, coords[1]]) === true ) return true;\n }\n if (this.validMove([coords[0] - 1, coords[1]])){\n if (this.checkAlienPos([coords[0] - 1, coords[1]]) === true ) return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "dfbf1332fd30a302f97a4a466817aa01", "score": "0.567311", "text": "function wallDetect(x,y,length,x2,y2,ux,uy,dir)\n{\n\tif(dir==\"x-\")\n\t{\n\t\tif((ux<=x && ux>=x2) && (uy>=y && uy<=y+length))\n\t\t\t{\n\t\t\t\tmoveX=-(personX-x);\n\t\t\t}\n\n\t}\n\telse if(dir==\"x+\")\n\t{\n\t\tif((ux>=x && ux<=x2) && (uy>=y && uy<=y+length))\n\t\t\t{\n\t\t\t\tmoveX=-(personX-x);\n\t\t\t}\n\t}\n\telse if(dir==\"y+\")\n\t{\n\t\tif((uy>=y && uy<=y2) && (ux>=x && ux<=x+length))\n\t\t\t{\n\t\t\t\tmoveY=-(personY-y);\n\t\t\t}\n\t}\n\telse if(dir==\"y-\")\n\t{\n\t\tif((uy<=y && uy>=y2) && (ux>=x && ux<=x+length))\n\t\t\t{\n\t\t\t\tmoveY=-(personY-y);\n\t\t\t}\n\t}\n}", "title": "" }, { "docid": "839a2c3f0b8e65c946d32b2a99613b00", "score": "0.5648303", "text": "coordsAt(_pos, _side) { return null; }", "title": "" }, { "docid": "839a2c3f0b8e65c946d32b2a99613b00", "score": "0.5648303", "text": "coordsAt(_pos, _side) { return null; }", "title": "" }, { "docid": "b45a2e59dc42b7a7a82eac475e9a19fe", "score": "0.5638781", "text": "function checkForContradictions(currentLocation, maps, portals) {\n var n = 0;\n var mapDim = [$('img[src^=\"http://images.neopets.com/nq/t\"]').closest(\"tr\").length, $('img[src^=\"http://images.neopets.com/nq/t\"]').closest(\"tr\").eq(0).find(\"td\").length - 2];\n console.log(\"Map dim: \" + mapDim);\n var halfMapSize = [Math.floor(mapDim[0]/2), Math.floor(mapDim[1]/2)];\n console.log(\"halfMapSize: \" + halfMapSize);\n var topLeftCoord = [currentLocation[0], currentLocation[1] - halfMapSize[0], currentLocation[2] - halfMapSize[1]];\n var bottomRightCoord = [currentLocation[0], currentLocation[1] + halfMapSize[0], currentLocation[2] + halfMapSize[1]];\n console.log(\"topLeftCoord: \" + topLeftCoord);\n console.log(\"bottomRightCoord: \" + bottomRightCoord);\n \n console.log(\"Top left coord from current position: \" + topLeftCoord);\n $('img[src^=\"http://images.neopets.com/nq/t\"]').each(function(){\n var currentRow = topLeftCoord[Y] + Math.floor(n / mapDim[1]);\n var currentColumn = topLeftCoord[X] + (n % mapDim[1]);\n var newTile = $(this).attr('src').substring($(this).attr('src').lastIndexOf(\"/\") + 1, $(this).attr('src').lastIndexOf(\".\"));\n\n // If our current position isn't a contradiction nor the 'lupe' tile....\n if (newTile.indexOf(\"lupe\") < 0) {\n if (maps[topLeftCoord[Z]][currentRow][currentColumn] != \"\" && maps[topLeftCoord[Z]][currentRow][currentColumn] != undefined && maps[topLeftCoord[Z]][currentRow][currentColumn].indexOf(\"unique_\") < 0 && maps[topLeftCoord[Z]][currentRow][currentColumn] != newTile) {\n console.log(\"Found a contradiction in map entries, aborting\");\n return false;\n } else {\n // Fill in the tile with our new information\n maps[topLeftCoord[Z]][currentRow][currentColumn] = maps[topLeftCoord[Z]][currentRow][currentColumn] || newTile;\n }\n }\n n++;\n });\n\n // If a contradiction was found, we need to alert the user to reconfigure\n if (n < $('img[src^=\"http://images.neopets.com/nq/t\"]').length - 1) {\n // Create a new blank map and move current location to the new map (let the player/user reconfigure position or blend maps)\n console.log(\"Detected map contradiction, alerting user to reconfigure\");\n alert(\"Whoops! Looks like Map Extender got a little confused as to where you are. \" + RECONFIGURE_POSITION_MESSAGE);\n setMapExtenderEnable(false);\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "b62359e049142b9a44d60839c3c6bc02", "score": "0.5615547", "text": "function checkbounds(img,event) {\n\t// We are going to return an array(dX,dY)\n\tdX = 0; dY = 0;\n\t// Figure out where the cursor is in relation to the image\n\tx = event.layerX; // - parseInt(img.style.left);\n\ty = event.layerY; // - parseInt(img.style.top);\t\n\t// Looks like theres something in IE thats causing our x to shift\n\t// to the right, countered here by decreasing the perceived value of x\n\t//x--;\t\n\t// Find the relative height positions from our image name\n\t// We are expecting something of the form 0-0-0-0 in it\n\tarrId = img.src.match(/\\d\\-\\d\\-\\d\\-\\d/);\n\tarrH = arrId[0].match(/\\d/g);\n\tfor(i=0;i<arrH.length;i++) arrH[i] = parseInt(arrH[i]);\t\n\t\t\n\t// array index: 0=top, 1=right, 2=bottom, 3=left\n\t// Make them all ints, rather than strings\n\t\n\t// See if we are out of bounds\n\tif(x<=32) {\n\t\t// Left hand side of the tile\n\t\tdyt = 8 * (2 + arrH[0] - arrH[3]);\n\t\tdyb = 8 * (2 + arrH[3] - arrH[2]);\n\t\ttstt = dyt-(x*dyt/32);\n\t\ttstb = dyt+(x*dyb/32);\n\t\tif(y<tstt) {\n\t\t\t// Top Left\n\t\t\tdX = -1;\n\t\t}\n\t\tif(y>tstb) {\n\t\t\t// Bottom Left\n\t\t\tdY = 1;\n\t\t}\n\t} else {\n\t\t// Right hand side of the tile\n\t\tdyt = 8 * (2 + arrH[0] - arrH[1]);\n\t\tdyb = 8 * (2 + arrH[1] - arrH[2]);\n\t\ttstt = (x*dyt/32)-dyt;\n\t\ttstb = (2*dyb)+dyt-(x*dyb/32);\n\t\tif(y<tstt) {\n\t\t\t// Top Right\n\t\t\tdY = -1;\n\t\t}\n\t\tif(y>tstb) {\n\t\t\t// Bottom Right\n\t\t\tdX = 1;\n\t\t}\n\t}\n\tif(dX==0 && dY == 0) return false; // Not out of bounds\n\telse return new Array(dX,dY); // Out of bounds - return direction to move\n}", "title": "" }, { "docid": "7239df8f4ce51fb9ef84ee1eb2eb7e3e", "score": "0.5613072", "text": "isInBounds(x, y) {\n if(x <= 0 || x >= this.mapWidth || y <= 0 || y >= this.mapHeight) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "5a98f375cd7d80724c873489b8ffe0a0", "score": "0.5609468", "text": "function checkDiag(xy, wb) {\n\n var row = xy[0];\n var col = xy[1];\n var length = 1; // start at length 1 since player just put down a piece\n\n // check one\n while(row > 1 && col > 1) {\n row -= 1;\n col -= 1;\n if(checkTile([row, col], wb)) {\n length += 1;\n } else {\n break;\n }\n }\n\n if(length >= 5) return true;\n\n row = xy[0]; // reset\n col = xy[1]; // reset\n\n while(row < 15 && col < 15) {\n row += 1;\n col += 1;\n if(checkTile([row, col], wb)) {\n length += 1;\n } else {\n break;\n }\n }\n\n if(length >= 5) return true;\n\n row = xy[0]; // reset\n col = xy[1]; // reset\n length = 1; // reset\n\n // check two\n while(row > 1 && col < 15) {\n row -= 1;\n col += 1;\n if(checkTile([row, col], wb)) {\n length += 1;\n } else {\n break;\n }\n }\n\n if(length >= 5) return true;\n\n row = xy[0]; // reset\n col = xy[1]; // reset\n\n while(row < 15 && col > 1) {\n row += 1;\n col -= 1;\n if(checkTile([row, col], wb)) {\n length += 1;\n } else {\n break;\n }\n }\n\n if(length >= 5) return true;\n\n // no win yet\n return false;\n\n}", "title": "" }, { "docid": "a64fde0c172c66a6673683b339ba4e74", "score": "0.5599317", "text": "can_move(start, end) {\n\t\t\tvar start_row = 8 - Math.floor(start / 8);\n\t\t\tvar start_col = (start % 8) + 1;\n\t\t\tvar end_row = 8 - Math.floor(end / 8);\n\t\t\tvar end_col = (end % 8) + 1;\n\n\t\t\tvar row_diff = end_row - start_row;\n\t\t\tvar col_diff = end_col - start_col;\n\n\t\t\tif (row_diff == 1 && col_diff == -2) {\n\t\t\t\treturn true;\n\t\t\t} else if (row_diff == 1 && col_diff == 2) {\n\t\t\t\treturn true;\n\t\t\t} else if (row_diff == -1 && col_diff == -2) {\n\t\t\t\treturn true;\n\t\t\t} else if (row_diff == -1 && col_diff == 2) {\n\t\t\t\treturn true;\n\t\t\t} else if (row_diff == -2 && col_diff == -1) {\n\t\t\t\treturn true;\n\t\t\t} else if (row_diff == -2 && col_diff == 1) {\n\t\t\t\treturn true;\n\t\t\t} else if (row_diff == 2 && col_diff == -1) {\n\t\t\t\treturn true;\n\t\t\t} else if (row_diff == 2 && col_diff == 1) {\n\t\t\t\treturn true;\n\t\t\t} \n\t\t\treturn false;\n\t\t}", "title": "" }, { "docid": "e04b636052966b86354b7005087482bd", "score": "0.5567489", "text": "function getDirectionOffset(dir) {\n // Given a direction 0=N, 1=W, 2=S, 3=E, return row and col differential\n // eg. dir=0 -> N -> rowDiff = -1 (move up 1), colDiff = 0 (don't move sideways);\n return {\n col: (dir - 2) % 2,\n row: (dir - 1) % 2\n };\n}", "title": "" }, { "docid": "0dec568a278db4b4a43e0eef784be3fa", "score": "0.5566536", "text": "function GetPlacementCoordinates() {\n\tfor (i = 0; i < nBoardSizeVertical; i++) {\n\t\tfor (j = 1; j <= nBoardSizeHorizontal; j++) {\n\t\t\tif ($('#' + GetButtonIDString(j, i)).text() == '1') {\n\t\t\t\txStart = j;\n\t\t\t\tyStart = i;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b7116da58bd4a5c2b12d595c3dddc0b5", "score": "0.55622536", "text": "function castHorizontal(map, origin, angle, up, right) {\n // Calculate the coordinates of the first intersection with a grid boundary.\n const intersectionY = Math.floor(origin.y / map.height) * map.height + (up ? -0.01 : map.height);\n const intersectionX = origin.x + (origin.y - intersectionY) / Math.tan(angle);\n tmpPoint.x = intersectionX;\n tmpPoint.y = intersectionY;\n \n // Calculate the change in x and y coordinates needed to iterate across grid boundaries.\n const deltaY = up ? -map.height : map.height;\n const deltaX = Math.abs(map.height / Math.tan(angle)) * (right ? 1 : -1);\n \n // Find the nearest wall and return the dist to it.\n const wall = findWall(map, tmpPoint, deltaX, deltaY);\n return wall.dist(origin);\n }", "title": "" }, { "docid": "34012f3a4892859211cc63f1c16da7bc", "score": "0.55588406", "text": "function validPosition(x, y) {\n if (x < 0 || x > (map.bounds.x - 1) || y < 0 || y > (map.bounds.y - 1) || map.data[x][y].artifact != null) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "59f657893c37fbd78e0d1b53586e070e", "score": "0.5554958", "text": "function overlapCheck (direction) {\n //Create deep copy of currentCell object (before was creating reference only)\n var grid = jQuery.extend(true, {}, currentCell);\n var size = shipSize[statVar];\n for(var length = 0; length < size-1; length++)\n {\n if(direction == \"North\")\n { \n grid.row -= 1;\n if(gridCheck[grid.column][grid.row] == 1)\n return false;\n }\n if(direction == \"South\")\n {\n grid.row += 1; //moves up one cell\n if(gridCheck[grid.column][grid.row] == 1)\n return false;\n }\n if(direction == \"West\")\n {\n grid.column -= 1; //moves up one cell\n if(gridCheck[grid.column][grid.row] == 1)\n return false;\n }\n if(direction == \"East\")\n {\n grid.column += 1; //moves up one cell\n if(gridCheck[grid.column][grid.row] == 1)\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "0ef385f200e4294ceda1969d14e29537", "score": "0.55489874", "text": "function toIndex(x, y)\t{return((y * mapW) + x);}", "title": "" }, { "docid": "1f790c291b67f088472bffc858dc7b5f", "score": "0.55463815", "text": "function legalMove (dir){\r\n if (dir === 'up') {\r\n var y = player.yPos - 1;\r\n var x = player.xPos;\r\n } else if (dir === 'right') {\r\n var y = player.yPos;\r\n var x = player.xPos + 1;\r\n } else if (dir === 'left') {\r\n var y = player.yPos;\r\n var x = player.xPos - 1;\r\n } else if (dir === 'down') {\r\n var y = player.yPos + 1;\r\n var x = player.xPos;\r\n } else {\r\n console.log('game over');\r\n }\r\n \r\n return map[y][x].passable === true;\r\n}", "title": "" }, { "docid": "d118a6a085d8084ea542e1d1d3de56aa", "score": "0.5545109", "text": "function checkDiagonals(insertedCol, insertedRow) {\n if( ! calculate(insertedCol,insertedRow,\"LT2RB\") ) {\n if( ! calculate(insertedCol,insertedRow,\"LB2RT\") ) {\n return false;\n }\n } \n return true;\n}", "title": "" }, { "docid": "4f0343407111e1a164ddab9b1a8a889a", "score": "0.5544881", "text": "function getPortalLocations(map) {\n const portalLocations = {};\n const height = map.length;\n const width = map[0].length;\n for (const [y, row] of map.entries()) {\n for (const [x, cell] of row.entries()) {\n if (isLetter(cell)) {\n const up = map[y - 1] && map[y - 1][x];\n const down = map[y + 1] && map[y + 1][x];\n const left = map[y][x - 1];\n const right = map[y][x + 1];\n let name;\n let location;\n if (isLetter(up) && down === \".\") {\n name = `${up}${cell}`;\n location = { dir: \"up\", point: [x, y + 1], inside: y > 1 };\n } else if (isLetter(down) && up === \".\") {\n name = `${cell}${down}`;\n location = { dir: \"down\", point: [x, y - 1], inside: y < height - 2 };\n } else if (isLetter(left) && right === \".\") {\n name = `${left}${cell}`;\n location = { dir: \"left\", point: [x + 1, y], inside: x > 1 };\n } else if (isLetter(right) && left === \".\") {\n name = `${cell}${right}`;\n location = {\n dir: \"right\",\n point: [x - 1, y],\n inside: x < width - 2\n };\n } else {\n continue;\n }\n location.name = name;\n if (portalLocations[name]) {\n portalLocations[name].push(location);\n } else {\n portalLocations[name] = [location];\n }\n }\n }\n }\n const portalCount = Object.keys(portalLocations).length - 2;\n for (const [name, locations] of Object.entries(portalLocations)) {\n const [location1, location2] = locations;\n if (name === \"AA\" || name === \"ZZ\") {\n portalLocations[name] = location1.point;\n } else {\n portalLocations[\n move[location1.dir](location1.point).toString()\n ] = location2;\n portalLocations[\n move[location2.dir](location2.point).toString()\n ] = location1;\n }\n }\n portalLocations.count = portalCount - 2;\n return portalLocations;\n}", "title": "" }, { "docid": "d4b1280ab81d6d4c29aa95025e37df22", "score": "0.5542783", "text": "function travelIf(intCurLat, intCurLon, intDestLat, intDestLon){\n\tif (intCurLat <= intDestLat && intCurLon <= intDestLon){\n\t\tdocument.getElementById('dirIf').textContent = \"Head North East!\";\n\t}//end if\n\telse if ( intCurLat <= intDestLat && intCurLon >= intDestLon){\n\t\tdocument.getElementById('dirIf').textContent = \"Head North West!\";\n\t}//endif\n\telse if (intCurLat >= intDestLat && intCurLon >= intDestLon){\n\t\tdocument.getElementById('dirIf').textContent = \"Head South West\";\t\t\n\t}//end else if \n\telse if (intCurLat >= intDestLon && intCurLon <= intDestLon){ \n\t\tdocument.getElementById('dirIf').textContent = \"Head South East\";\n\t}//end else if\n\telse {\n\t\tdocument.getElementById('dirIf').textContent = \"Land Ho\";\n\t}//end else\n}", "title": "" }, { "docid": "e90a91f4f7d318f56b27dfbb46ee31d7", "score": "0.55300087", "text": "check(mX, mY){\n if(mX > this.x && mX < this.x + this.size && mY > this.y && mY < this.y + this.size){\n this.overlay = true;\n return true;\n }else {\n this.overlay = false;\n return false;\n }\n}", "title": "" }, { "docid": "35834c87267779a2d69b98746c08a3c1", "score": "0.55239105", "text": "function getTileCoords(){\n minRow = lat2tile(TOP_LAT, MAP_ZOOM);\n maxRow = lat2tile(BOTTOM_LAT, MAP_ZOOM)+1;\n minCol = long2tile(LEFT_LON, MAP_ZOOM);\n maxCol = long2tile(RIGHT_LON, MAP_ZOOM)+1;\n}", "title": "" }, { "docid": "21a6389e3b15b3a6ff2b4770eaca2a72", "score": "0.55224717", "text": "function getRowAndCol(x, y) {\n return {\n i: Math.floor(y / 50),\n j: Math.floor(x / 50)\n };\n}", "title": "" }, { "docid": "0d1af024a187a7654bf364f73daf4b61", "score": "0.55174035", "text": "function XYToRoom (xy) { return (xy.x < 0 ? 'W' : 'E') + Math.abs(xy.x) + (xy.y < 0 ? 'N' : 'S') + Math.abs(xy.y); }", "title": "" }, { "docid": "69f6e8022073ab4ebc77aa4ca25a540f", "score": "0.5514514", "text": "function setupMap()\r\n{\r\n map = [\r\n [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\r\n [1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1],\r\n [1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1],\r\n [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],\r\n [1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1],\r\n [1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1],\r\n [1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1],\r\n [1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1],\r\n [1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1],\r\n [0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0],\r\n [1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1],\r\n [1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1],\r\n [1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1],\r\n [1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1],\r\n [1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1],\r\n [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],\r\n [1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1],\r\n [1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1],\r\n [1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1],\r\n [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],\r\n [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]\r\n ]\r\n}", "title": "" }, { "docid": "2fdb9b8344972c552e30095bb29e3606", "score": "0.5514117", "text": "function move_in_grid(x, y, x_bound, y_bound, dir){\r\n\t//0,0 is bottom left\r\n\t//N is y+1\r\n\t//S is y-1\r\n\t//E is x+1\r\n\t//W is x-1\r\n\tswitch(dir) {\r\n\t\tcase \"N\":\r\n\t\t\tif(y+1 < y_bound){\r\n\t\t\t\treturn [x, y+1] //Move up\r\n\t\t\t} else {\r\n\t\t\t\treturn [x, y] //Can't move up, already at limit\r\n\t\t\t}\r\n\t\tcase \"S\":\r\n\t\t\tif(y-1 >= 0){\r\n\t\t\t\treturn [x, y-1]\r\n\t\t\t} else {\r\n\t\t\t\treturn [x, y]\r\n\t\t\t}\r\n\t\tcase \"E\":\r\n\t\t\tif(x+1 < x_bound) {\r\n\t\t\t\treturn [x+1, y]\r\n\t\t\t} else {\r\n\t\t\t\treturn [x, y]\r\n\t\t\t}\r\n\t\tcase \"W\":\r\n\t\t\tif(x-1 >= 0){\r\n\t\t\t\treturn [x-1, y]\r\n\t\t\t} else {\r\n\t\t\t\treturn [x, y]\r\n\t\t\t}\r\n\t\tdefault:\r\n\t\t\tconsole.log(\"Invalid character used\")\r\n\t}\r\n}", "title": "" }, { "docid": "f1965847ab9b04eab1e281fa5953f756", "score": "0.5504566", "text": "function checkDirection(direction, magnitude) {\n\n for (var j = 0; j < magnitude; j++) {\n switch (direction) {\n case 0:\n pos.y++;\n break;\n case 1:\n pos.x++;\n break;\n case 2:\n pos.y--;\n break;\n case 3:\n pos.x--;\n break;\n default:\n break;\n }\n //QUESTION 2\n // if(posArray.includes(pos.x+\",\"+pos.y)){\n // return Math.abs(pos.x) + Math.abs(pos.y);\n // }\n posArray.push(pos.x + \",\" + pos.y);\n }\n return false;\n}", "title": "" }, { "docid": "8d854c11f3fc110eb591300564fc2d62", "score": "0.5501352", "text": "function isDirection(dir, elemA, elemB) {\n var posElemA = $(elemA).offset();\n var posElemB = $(elemB).offset();\n posElemA[\"bottom\"] = posElemA.top + $(elemA).height();\n posElemA[\"right\"] = posElemA.left + $(elemA).width();\n posElemB[\"bottom\"] = posElemB.top + $(elemB).height();\n posElemB[\"right\"] = posElemB.left + $(elemB).width();\n \n var left = false;\n var right = false;\n var above = false;\n var below = false;\n \n var directions = {\"left\": false, \"right\": false, \"above\": false, \"below\": false};\n \n if(posElemA.right <= posElemB.left) {\n directions[\"left\"] = true;\n }\n if(posElemA.left >= posElemB.right) {\n directions[\"right\"] = true;\n }\n if(posElemA.bottom <= posElemB.top) {\n directions[\"above\"] = true;\n }\n if(posElemA.top >= posElemB.bottom) {\n directions[\"below\"] = true;\n }\n \n return directions[dir];\n}", "title": "" }, { "docid": "99ec7c58da47443c6f3caf1d5c036dab", "score": "0.5501339", "text": "function spaceForRoom(x1, y1, x2, y2) {\n\t\tif (x2 < x1) {\n\t\t\tvar tmp = x1;\n\t\t\tx1 = x2;\n\t\t\tx2 = tmp;\n\t\t}\n\t\tif (y2 < y1) {\n\t\t\tvar tmp = y1;\n\t\t\ty1 = y2;\n\t\t\ty2 = tmp;\n\t\t}\n\t\tfor (var y = y1; y <= y2; y++) {\n\t\t\tfor (var x = x1; x <= x2; x++) {\n\t\t\t\tif (x <= 0 || x >= d.width || y <= 0 || y >= d.height) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (d.tiles[y * d.width + x].id == \"floor\") {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "title": "" }, { "docid": "1c94fca3c9f1ec096a803d26148b1de9", "score": "0.5495584", "text": "function getCode(x, y) {\r\n var code;\r\n\r\n code = INSIDE;\r\n if (x < xMin) code |= LEFT; // | bitwise\r\n else if (x > xMax) code |= RIGHT;\r\n if (y < yMin) code |= BOTTOM;\r\n else if (y > yMax) code |= TOP;\r\n\r\n return code;\r\n}", "title": "" }, { "docid": "c731e848dd233df5f2d3a0133f621920", "score": "0.5491702", "text": "function possibleDirections(from) {\nvar mapSize = 20;\nfunction insideMap(point) {\nreturn point.x >= 0 && point.x < mapSize &&\npoint.y >= 0 && point.y < mapSize;\n}\nvar directions = [point(-1, 0), point(1, 0), point(0, -1),\npoint(0, 1), point(-1, -1), point(-1, 1),\npoint(1, 1), point(1, -1)];\nreturn filter(insideMap, map(partial(addPoints, from),\ndirections));\n}", "title": "" }, { "docid": "b15a3cceb5a88905ee5021e74cb636ac", "score": "0.5490542", "text": "checkBoundaries() {\r\n if ((this.pictInfo.x+this.pictInfo.w>=800)||(this.pictInfo.x<=0)) {\r\n this.changeX*=-1;\r\n }\r\n if ((this.pictInfo.y<=0)||(this.pictInfo.y+this.pictInfo.h>=600)) {\r\n this.changeY*=-1;\r\n }\r\n }", "title": "" }, { "docid": "4ff31c4094f25a7a21984ae2a457eb6f", "score": "0.5490295", "text": "function get_city_dxy_to_index(dx, dy) \n{\n city_tile_map = {};\n city_tile_map[\" 00\"] = 0;\n city_tile_map[\" 10\"] = 1;\n city_tile_map[\" 01\"] = 2;\n city_tile_map[\" 0-1\"] = 3;\n city_tile_map[\" -10\"] = 4;\n city_tile_map[\" 11\"] = 5;\n city_tile_map[\" 1-1\"] = 6;\n city_tile_map[\" -11\"] = 7;\n city_tile_map[\" -1-1\"] = 8;\n city_tile_map[\" 20\"] = 9;\n city_tile_map[\" 02\"] = 10;\n city_tile_map[\" 0-2\"] = 11;\n city_tile_map[\" -20\"] = 12;\n city_tile_map[\" 21\"] = 13;\n city_tile_map[\" 2-1\"] = 14;\n city_tile_map[\" 12\"] = 15;\n city_tile_map[\" 1-2\"] = 16;\n city_tile_map[\" -12\"] = 17;\n city_tile_map[\" -1-2\"] = 18;\n city_tile_map[\" -21\"] = 19;\n city_tile_map[\" -2-1\"] = 20;\n\n return city_tile_map[\" \"+dx+\"\"+dy];\n\n}", "title": "" }, { "docid": "0c964f1867cf2128738ceec4816d1a89", "score": "0.5490098", "text": "function reflect(input){\r\n\t//for x direction\r\n\tif (input==0){\r\n\t\tvar i = 0;\r\n\t\twhile (i<pointList.length){\r\n\t\t\tpointList[i][1] = -pointList[i][1]\r\n\t\t\tpointList[i][2] = -pointList[i][2]\r\n\t\t\ti++\r\n\t\t}\r\n\t\trotated[0] = !rotated[0];\r\n\t\tdraw();\t\r\n\t}\r\n\t//for y direction\r\n\telse if (input==1)\t{\r\n\t\tvar i = 0;\r\n\t\twhile (i<pointList.length){\r\n\t\t\tpointList[i][0] = -pointList[i][0]\r\n\t\t\tpointList[i][2] = -pointList[i][2]\r\n\t\t\ti++\r\n\t\t}\r\n\t\trotated[1] = !rotated[1];\r\n\t\tdraw();\t\r\n\t}\r\n\t//for z direction\r\n\telse if(input==2) {\r\n\t\tvar i =0;\r\n\t\twhile (i<pointList.length){\r\n\t\t\tpointList[i][1] = -pointList[i][1]\r\n\t\t\tpointList[i][0] = -pointList[i][0]\r\n\t\t\ti++\r\n\t\t}\r\n\t\trotated[2] = !rotated[2];\r\n\t\tdraw();\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "c131a9bb4673455d16e80f50dadf2f50", "score": "0.5488963", "text": "function drawLine(x,y,length,dir)\n{\n/*\nx,y=地圖上起點座標\nlength=邊長\ndir=\"x+\" for x方向向右\n\t\"x-\" for x方向向左\n\t\"y+\" for y方向向上\n\t\"y-\" for y方向向下\n\t\n回傳值coordx,coordy = 目的地圖座標\n\t\n\t螢幕座標與地圖座標轉換公式:\n\tXscreen = offsetX+(sc*Xmap*defaultScale)\n\tYscreen = offsetY-(sc*Ymap*defaultScale)\n*/\n\n\tvar coordx;\n\tvar coordy;\n\tcoordy=y;//(y+offsetY)/defaultScale;\n\tcoordx=x;\n\tvar c = document.getElementById(\"floor_8\");\n\tvar ctx = c.getContext(\"2d\");\n\n\tctx.lineWidth = 5;\n ctx.beginPath(); \n ctx.moveTo(offsetX+(sc*x*defaultScale),offsetY-(sc*y*defaultScale));\n\tif(dir==\"y+\"){ //y direct up\n\t\tctx.lineTo(offsetX+(sc*x*defaultScale),offsetY-(sc*(y+length)*defaultScale)); \n\t\tcoordy = y+length;\n\t}\n\telse if(dir==\"x+\"){ //x direct right\n\t\tctx.lineTo(offsetX+(sc*(x+length)*defaultScale),offsetY-(sc*y*defaultScale));\n\t\tcoordx = x+length;\n\t}\n\telse if(dir==\"y-\"){ //y direct down\n\t\tctx.lineTo(offsetX+(sc*x*defaultScale),offsetY-(sc*(y-length)*defaultScale)); \n\t\tcoordy = y-length;\n\t}\n\telse if(dir==\"x-\"){ //x direct left\n\t\tctx.lineTo(offsetX+(sc*(x-length)*defaultScale),offsetY-(sc*y*defaultScale));\n\t\tcoordx = x-length;\n\t}\n ctx.closePath(); \n ctx.stroke();\n\t\n\treturn [coordx,coordy];\n}", "title": "" }, { "docid": "2f0652546b33cef3777bf927417f82fd", "score": "0.5485953", "text": "function hitBoundary(sprite, boundary){\n\t//boundary in the form [x,y,w,h]\n\tif(boundary == null){\n\t\treturn false;\n\t}\n\t\n\t//get the positions\n\tvar rx;\n\tvar ry;\n\tif(sprite.dir === \"north\" || sprite.dir === \"west\"){\n\t\trx = Math.ceil(sprite.x / size);\n\t\try = Math.ceil(sprite.y / size);\n\t}else if(sprite.dir === \"south\" || sprite.dir === \"east\"){\n\t\trx = Math.floor(sprite.x / size);\n\t\try = Math.floor(sprite.y / size);\n\t}\n\t\n\n\t//edge of map = undecided\n\tif(rx-1 < 0 || rx+1 >= cols || ry-1 < 0 || ry+1 >= cols)\n\t\treturn;\n\n\t//get bounding box area\n\tvar xArea = [];\n\tfor(var z=0;z<boundary.w;z++){\n\t\txArea.push(boundary.x+z);\n\t}\n\tvar yArea = [];\n\tfor(var z=0;z<boundary.h;z++){\n\t\tyArea.push(boundary.y+z);\n\t}\n\n\t//console.log(xArea + \"\\t\" + yArea);\n\n\tif(sprite.dir == \"north\" && (!inArr(xArea, rx) || !inArr(yArea, ry-1)))\n\t\treturn true;\n\telse if(sprite.dir == \"south\" && (!inArr(xArea, rx) || !inArr(yArea, ry+1)))\n\t\treturn true;\n\telse if(sprite.dir == \"east\" && (!inArr(xArea, rx+1) || !inArr(yArea, ry)))\n\t\treturn true;\n\telse if(sprite.dir == \"west\" && (!inArr(xArea, rx-1) || !inArr(yArea, ry)))\n\t\treturn true;\n\t\n\treturn false;\n}", "title": "" }, { "docid": "b0d00fc5fceaabc7663460bcb1783e48", "score": "0.54808146", "text": "function mapCoord(e){\n\t//var e=new MouseEvent(e);\n\t\n\tmapX=(e.clientX)-(mySize.width-190);\n\tmapY=(e.clientY)-(mySize.height-190);\t\t\t\n\t\n\tif (mapX<0){mapX=0;};\n\tif (mapX>190){mapX=190;};\n\tif (mapY>190){mapY=190;};\n\t\t\n\t//goto variables to reflect changes in scale\n\tgotoX=mapX*24000;\n\tgotoY=mapY*24000;\n\t//go to this location\n\tgoToLoc(gotoX,gotoY);\n\treturn false;\n}", "title": "" }, { "docid": "4747f9887304f375f1616fbe225af0b3", "score": "0.54661566", "text": "function searchMatches() {\n let match = mapArea(\"X\",\"X\",\"X\",\"X\",\"X\") || mapArea(\"O\",\"O\",\"O\",\"O\",\"O\");\n return match && (() => {\n let x = match.x, y = match.y;\n switch (match.direction) {\n case \"horizontal\" : return [`#tblrow${x}cell${y}`,`#tblrow${x}cell${y + 1}`,`#tblrow${x}cell${y + 2}`,`#tblrow${x}cell${y + 3}`,`#tblrow${x}cell${y + 4}`];\n case \"vertical\" : return [`#tblrow${x}cell${y}`,`#tblrow${x + 1}cell${y}`,`#tblrow${x + 2}cell${y}`,`#tblrow${x + 3}cell${y}`,`#tblrow${x + 4}cell${y}`];\n case \"diagonal_pos\": return [`#tblrow${x}cell${y}`,`#tblrow${x + 1}cell${y + 1}`,`#tblrow${x + 2}cell${y + 2}`,`#tblrow${x + 3}cell${y + 3}`,`#tblrow${x + 4}cell${y + 4}`];\n case \"diagonal_neg\": return [`#tblrow${x}cell${y}`,`#tblrow${x - 1}cell${y + 1}`,`#tblrow${x - 2}cell${y + 2}`,`#tblrow${x - 3}cell${y + 3}`,`#tblrow${x - 4}cell${y + 4}`];\n } // end of switch\n })(); // end of return lambda\n} // end of searchMatches", "title": "" }, { "docid": "834310523c16703914f6fb1b0f47bbe9", "score": "0.5459726", "text": "function mazemap_render(x, y, facing) {\n\n if (facing == \"north\") {\n // back row\n mazemap_render_tile(x-2,y-2,0);\n mazemap_render_tile(x+2,y-2,1);\n mazemap_render_tile(x-1,y-2,2);\n mazemap_render_tile(x+1,y-2,3);\n mazemap_render_tile(x, y-2,4);\n // middle row\n mazemap_render_tile(x-2,y-1,5);\n mazemap_render_tile(x+2,y-1,6);\n mazemap_render_tile(x-1,y-1,7);\n mazemap_render_tile(x+1,y-1,8);\n mazemap_render_tile(x, y-1,9);\n // front row\n mazemap_render_tile(x-1,y, 10);\n mazemap_render_tile(x+1,y, 11);\n mazemap_render_tile(x, y, 12);\n }\n else if (facing == \"south\") {\n // back row\n mazemap_render_tile(x+2,y+2,0);\n mazemap_render_tile(x-2,y+2,1);\n mazemap_render_tile(x+1,y+2,2);\n mazemap_render_tile(x-1,y+2,3);\n mazemap_render_tile(x,y+2,4);\n // middle row\n mazemap_render_tile(x+2,y+1,5);\n mazemap_render_tile(x-2,y+1,6);\n mazemap_render_tile(x+1,y+1,7);\n mazemap_render_tile(x-1,y+1,8);\n mazemap_render_tile(x,y+1,9);\n // front row\n mazemap_render_tile(x+1,y,10);\n mazemap_render_tile(x-1,y,11);\n mazemap_render_tile(x,y,12); \n }\n else if (facing == \"west\") {\n // back row\n mazemap_render_tile(x-2,y+2,0);\n mazemap_render_tile(x-2,y-2,1);\n mazemap_render_tile(x-2,y+1,2);\n mazemap_render_tile(x-2,y-1,3);\n mazemap_render_tile(x-2,y,4);\n // middle row\n mazemap_render_tile(x-1,y+2,5);\n mazemap_render_tile(x-1,y-2,6);\n mazemap_render_tile(x-1,y+1,7);\n mazemap_render_tile(x-1,y-1,8);\n mazemap_render_tile(x-1,y,9);\n // front row\n mazemap_render_tile(x,y+1,10);\n mazemap_render_tile(x,y-1,11);\n mazemap_render_tile(x,y,12); \n }\n else if (facing == \"east\") {\n // back row\n mazemap_render_tile(x+2,y-2,0);\n mazemap_render_tile(x+2,y+2,1);\n mazemap_render_tile(x+2,y-1,2);\n mazemap_render_tile(x+2,y+1,3);\n mazemap_render_tile(x+2,y,4);\n // middle row\n mazemap_render_tile(x+1,y-2,5);\n mazemap_render_tile(x+1,y+2,6);\n mazemap_render_tile(x+1,y-1,7);\n mazemap_render_tile(x+1,y+1,8);\n mazemap_render_tile(x+1,y,9);\n // front row\n mazemap_render_tile(x,y-1,10);\n mazemap_render_tile(x,y+1,11);\n mazemap_render_tile(x,y,12); \n }\n \n}", "title": "" }, { "docid": "f46f925460a66159e94ca945fdde38b4", "score": "0.5457951", "text": "function ScreenToMap(x,y)\n{\n\tvar Xmap;\n\tvar Ymap;\n\t\n\tXmap=(x-offsetX)/(defaultScale*sc);\n\tYmap=-(y-offsetY)/(defaultScale*sc);\n\t\n\treturn [Xmap,Ymap];\n}", "title": "" }, { "docid": "7567a9f95d75b603ee07ded6cd0ceb19", "score": "0.54488343", "text": "function getMirrorDiagonal(_x, _y, posOrNeg) {\n \n // Difference between the central cell and input.\n var xDiff = centreCell.x - _x;\n var yDiff = centreCell.y - _y;\n \n // Add the other co-ordinate's value.\n var xValue = centreCell.x + (yDiff * posOrNeg);\n var yValue = centreCell.y + (xDiff * posOrNeg);\n \n // If it's not in a drawable region, then just return the original.\n if (xValue >= 0 && xValue < cellCount.x && yValue >= 0 && yValue < cellCount.y) {\n return [xValue, yValue];\n } else {\n return [_x, _y];\n }\n}", "title": "" }, { "docid": "4ebe440ce1e611e36881d959321ceed8", "score": "0.5434381", "text": "function colliEnnemi(x1,y1,w1,h1,en){\r\n \r\n\r\n\r\n return (x1 < en.X + en.width &&\r\n x1 + w1 > en.X &&\r\n y1 < en.Y + en.height &&\r\n h1 + y1 > en.Y);\r\n }", "title": "" }, { "docid": "c6f73438264a0543cbdb8a57e5483fc4", "score": "0.54333127", "text": "areDiagonallyAdjacent(tile1, tile2) {\r\n // Dos tiles son diagonalmente adyacentes si están separados por una distancia de una\r\n // unidad en ambos ejes. Si la distancia en cualquiera de los ejes fuera 0 ya no sería\r\n // una adyacencia diagonal, y si la distancia fuera más de 1 ya no sería una adyacencia.\r\n return Math.abs(tile1.x - tile2.x) == 1 && Math.abs(tile1.y - tile2.y) == 1;\r\n }", "title": "" }, { "docid": "aa616aecf10f3692c46e76c30316fbea", "score": "0.5429414", "text": "function getNeighbor(x, y, dir) {\n var x2 = x + ((dir == 1 || dir == 4 || dir == 5) ? 1 : ((dir == 3 || dir == 6 || dir == 7) ? -1 : 0));\n var y2 = y + ((dir == 0 || dir == 4 || dir == 7) ? -1 : ((dir == 2 || dir == 5 || dir == 6) ? 1 : 0));\n if(x2 < 0 || x2 >= w) return null;\n if(y2 < 0 || y2 >= h) return null;\n\n // antenna stuff\n var dx = x2 - x;\n var dy = y2 - y;\n var wca = world[y2][x2];\n if(dir < 4) {\n if(wca.circuitextra == 1 && wca.antennax != -1) {\n x2 = wca.antennax + dx;\n y2 += dy;\n if(x2 < 0 || x2 >= w) return null;\n if(y2 < 0 || y2 >= h) return null;\n }\n else if(wca.circuitextra == 1 && wca.antennay != -1) {\n x2 += dx;\n y2 = wca.antennay + dy;\n if(x2 < 0 || x2 >= w) return null;\n if(y2 < 0 || y2 >= h) return null;\n }\n } else {\n var wcb = world[y][x2];\n var wcc = world[y2][x];\n var antennaa = wca.circuitextra == 1 && (wca.antennax != -1 || wca.antennay != -1);\n var antennab = wcb.circuitextra == 1 && (wcb.antennax != -1 || wcb.antennay != -1);\n var antennac = wcc.circuitextra == 1 && (wcc.antennax != -1 || wcc.antennay != -1);\n // ca b/ ac \\b\n // /b ac b\\ ca\n if(antennaa || antennab || antennac) {\n // aimed at us or aimed away from us?\n var aimb = (x > x2 && wcb.antennax > x2) || (x < x2 && wcb.antennax < x2);\n var aimc = (y > y2 && wcc.antennay > y2) || (y < y2 && wcc.antennay < y2);\n if(antennaa && antennab && !antennac && wca.antennax != -1 && wca.antennax == wcb.antennax) {\n x2 = wca.antennax + dx;\n if(x2 < 0 || x2 >= w) return null;\n }\n else if(antennaa && antennac && !antennab && wca.antennay != -1 && wca.antennay == wcc.antennay) {\n y2 = wca.antennay + dy;\n if(y2 < 0 || y2 >= h) return null;\n }\n else if(antennab && antennac && aimb && aimc) {\n\n var ok = true;\n // c e\n // 0n n0\n // b( )b'\n //\n // d( )d'\n // 0u u0\n // c' e'\n\n var wcd = world[wcc.antennay + (wcc.antennay > y2 ? -1 : 1)][x2];\n var wce = world[y2][wcb.antennax + (wcb.antennax > x2 ? -1 : 1)];\n if(!wcd.circuitextra == 1 || wcd.antennax != wcb.antennax) ok = false;\n if(!wce.circuitextra == 1 || wce.antennay != wcc.antennay) ok = false;\n if(ok) {\n x2 = wcb.antennax + dx;\n y2 = wcc.antennay + dy;\n if(x2 < 0 || x2 >= w) return null;\n if(y2 < 0 || y2 >= h) return null;\n }\n } else if(antennaa && !antennab && !antennac) {\n // case for simple single antenna (or invalid combination of multiple)\n // we must check if it's symmetric, and also only a single antenna is on the\n // other side, otherwise different neighbor may be parsed on different sides!\n if(wca.antennax != -1) {\n var x3 = wca.antennax + dx;\n var y3 = y2 + dy;\n if(x3 < 0 || x3 >= w) return null;\n if(y3 < 0 || y3 >= h) return null;\n var wcd = world[y3][wca.antennax];\n var wce = world[wca.y][x3];\n if(wcd.antennax == -1 && wcd.antennay == -1 && wce.antennax == -1 && wce.antennay == -1) {\n x2 = x3;\n y2 = y3;\n }\n }\n else if(wca.antennay != -1) {\n var x3 = x2 + dx;\n var y3 = wca.antennay + dy;\n if(x3 < 0 || x3 >= w) return null;\n if(y3 < 0 || y3 >= h) return null;\n var wcd = world[y3][wca.x];\n var wce = world[wca.antennay][x3];\n if(wcd.antennax == -1 && wcd.antennay == -1 && wce.antennax == -1 && wce.antennay == -1) {\n x2 = x3;\n y2 = y3;\n }\n }\n }\n }\n }\n\n return world[y2][x2];\n}", "title": "" }, { "docid": "6997d0709746edf43060412679dccaf5", "score": "0.5428966", "text": "chooseTileDiagonally(figure, direction, distance){\n\t\tswitch(direction){\n\t\t\tcase 'ne':\n\t\t\t\treturn this.boardMatrix[figure.positionY - distance][figure.positionX + distance];\n\t\t\tcase 'es':\n\t\t\t\treturn this.boardMatrix[figure.positionY + distance][figure.positionX + distance];\n\t\t\tcase 'sw':\n\t\t\t\treturn this.boardMatrix[figure.positionY + distance][figure.positionX - distance];\n\t\t\tcase 'nw':\n\t\t\t\treturn this.boardMatrix[figure.positionY - distance][figure.positionX - distance];\n\t\t\tdefault:\n\t\t\t\tthrow new Error('Couldn\\'t locate the tile. ' + direction + 'Iteration: ' + distance);\n\t\t}\n\t}", "title": "" }, { "docid": "9500f0f5fbc7b97791baab6837bba655", "score": "0.5427414", "text": "function getNeighborNoAntennas(x, y, dir) {\n var x2 = x + ((dir == 1 || dir == 4 || dir == 5) ? 1 : ((dir == 3 || dir == 6 || dir == 7) ? -1 : 0));\n var y2 = y + ((dir == 0 || dir == 4 || dir == 7) ? -1 : ((dir == 2 || dir == 5 || dir == 6) ? 1 : 0));\n if(x2 < 0 || x2 >= w) return null;\n if(y2 < 0 || y2 >= h) return null;\n\n return world[y2][x2];\n}", "title": "" }, { "docid": "07438fe3a6772d3fc4cf3afb1f473a31", "score": "0.54261994", "text": "function clickToGridCoor(xcoord, ycoord){\n if (xcoord < .13 && xcoord > -.07 && ycoord > .33 && ycoord < .53){ //(0,0)\n return [0,0,-3,-3];\n } else \n if (xcoord < .35 && xcoord > .15 && ycoord > .25 && ycoord < .45){ //(1,0)\n return [1,0,-3,-2];\n } else \n if (xcoord < .65 && xcoord > .45 && ycoord > .15 && ycoord < .35){ //(2,0)\n return [2,0,-3,-1];\n } else \n if (xcoord < -.15 && xcoord > -.35 && ycoord > .25 && ycoord < .45){ //(0,1)\n return [0,1,-2,-3];\n } else \n if (xcoord < .1 && xcoord > -.1 && ycoord > .2 && ycoord < .35){ //(1,1)\n return [1,1,-2,-2];\n } else\n if (xcoord < .4 && xcoord > .2 && ycoord > .1 && ycoord < .2){ //(2,1)\n return [2,1,-2,-1];\n } else \n if (xcoord < -.4 && xcoord > -.6 && ycoord > .2 && ycoord < .4){ //(0,2)\n return [0,2,-1,-3];\n } else \n if (xcoord < -.21 && xcoord > -.44 && ycoord > 0 && ycoord < .2){ //(1,2)\n return [1,2,-1,-2];\n } else\n if (xcoord < 0.145 && xcoord > -.10 && ycoord > -.2 && ycoord < .1){ //(2,2)\n return [2,2,-1,-1];\n } else {\n return [99999,99999,99999,99999]; // click wasnt over any square\n }\n}", "title": "" }, { "docid": "7f6b6f595b1375026df382b8f0d7c3b9", "score": "0.5424985", "text": "function checkAround(x, y) {\n if (mainMap[x][y] === undefined) {\n return true;\n }\n let currentElement = mainMap[x][y];\n currentElement.checked = true;\n\n const coordinates = [\n {\n x: x - 1,\n y: y,\n },\n {\n x: x - 1,\n y: y - 1,\n },\n {\n x: x,\n y: y - 1,\n },\n {\n x: x + 1,\n y: y - 1,\n },\n {\n x: x + 1,\n y: y,\n },\n {\n x: x + 1,\n y: y + 1,\n },\n {\n x: x,\n y: y + 1,\n },\n {\n x: x - 1,\n y: y + 1,\n },\n ];\n\n coordinates.forEach(element=>{\n if (mainMap[element.x] !== undefined &&\n mainMap[element.x][element.y] !== undefined &&\n !mainMap[element.x][element.y].checked &&\n mainMap[element.x][element.y].type === currentElement.type) {\n checkAround(element.x, element.y);\n }\n });\n}", "title": "" }, { "docid": "83f5e0dcbdf3f5c917867fd9d78722ab", "score": "0.5419079", "text": "relativeCoords(absx, absy) { //server coords [10000x10000] --> client coords [100x100]\n var s = this.sectionCoords(absx,absy);\n // console.log(\"section coords:\"+s[0]+\",\"+s[1]);\n var m = this.mapcode(absx,absy);\n // console.log(\"mapcode: \"+m);\n var n = this.sectionForMapCode(m);\n if (n==-1) {\n\n }\n // console.log(\"section: \"+n);\n var L = this.CAMERA_BOX_SIZE;\n if (n%2==0)\n s[0]=s[0]+50;\n if (n>2)\n s[1]=s[1]+50;\n return s;\n }", "title": "" }, { "docid": "e3fd8db983dfab7d52a5011ca6d0e6ac", "score": "0.5418651", "text": "function start() {\n // take id and sides\n for (let i = 0; i < input.length; i++) {\n let id = input[i][0].substring(5, input[i][0].length-1)\n let top = input[i][1]\n let bottom = input[i][input[i].length-1]\n let left = \"\"\n let right = \"\"\n for (let j = 1; j < input[i].length; j++) {\n left += input[i][j].substring(0, 1)\n right += input[i][j].substring(input[i][j].length-1)\n }\n sides.push([id, top, bottom, left, right])\n }\n\n // search tiles where 2 sides don't match anything to get a starting corner\n for (let i = 0; i < sides.length; i++) {\n let matches = 0\n let match = []\n for (let j = 1; j < 5; j++) {\n for (let k = 0; k < sides.length; k++) {\n if (k !== i) { // skip self\n for (let l = 1; l < 5; l++) {\n if (sides[i][j] == sides[k][l] || sides[i][j] == reverseString(sides[k][l])) {\n matches++\n match.push(j)\n }\n }\n }\n }\n }\n if (matches < 3) { // 2 sides don't match so it is a corner\n let tile = getTile(sides[i][0])\n\n // rotate tile to be top left tile (matching sides to bottom right)\n // match // 1: top, 2: bottom, 3: left, 4: right\n let rotationsneeded \n if (match.includes(1) && match.includes(4)) { \n rotationsneeded = 3\n nextcolumn = reverseString(sides[i][4])\n next = sides[i][1]\n } else if (match.includes(1) && match.includes(3)) {\n rotationsneeded = 2\n nextcolumn = reverseString(sides[i][3])\n next = reverseString(sides[i][1])\n } else if (match.includes(2) && match.includes(3)) {\n rotationsneeded = 1\n nextcolumn = sides[i][3]\n next = reverseString(sides[i][2])\n } else {\n // match = 2 & 4, already rotated right\n nextcolumn = reverseString(sides[i][3])\n next = reverseString(sides[i][1])\n }\n\n // rotate\n for (let r = 0; r < rotationsneeded; r++) {\n tile = rotateLeft(tile) \n }\n\n pushandremove(tile, i, true, 0)\n\n break // only need one corner to start\n }\n }\n\n // // create image \n\n // // moet op een betere manier kunnen, maar ik ben al tevreden als het werkt\n // let first = true\n // let begin = 0\n // let firstcolumn = true\n // w: while(sides.length > 0) {\n // let revnext = reverseString(next)\n // // find next tile and add it to the image\n // for (let i = 0; i < sides.length; i++) {\n // let flag = false\n // for (let j = 1; j < 5; j++) {\n // if (firstcolumn) {\n // if (sides[i][j] == next && !flag) {\n // let tile = getTile(sides[i][0])\n // // align tile\n // if (j == 1 && matchnothing(sides[i][3], i)) {\n // next = sides[i][2]\n // } else if (j == 2 && matchnothing(sides[i][4], i)) {\n // tile = rotateLeft(tile)\n // tile = rotateLeft(tile)\n // tile = flip(tile)\n // next = reverseString(sides[i][1])\n // } else if (j == 3 && matchnothing(sides[i][2], i)) {\n // tile = rotateLeft(tile)\n // tile = rotateLeft(tile)\n // tile = rotateLeft(tile)\n // tile = flip(tile)\n // next = reverseString(sides[i][4])\n // } else if (j == 4 && matchnothing(sides[i][1], i)) {\n // tile = rotateLeft(tile)\n // next = sides[i][3]\n // } else {\n // flag = true\n // j--\n // continue\n // }\n // pushandremove(tile, i, first, begin)\n // begin += tile.length\n // continue w\n // } else if (sides[i][j] == revnext) {\n // let tile = getTile(sides[i][0])\n // // align tile\n // if (j == 1 && matchnothing(sides[i][4], i)) {\n // tile = flip(tile)\n // next = reverseString(sides[i][2])\n // } else if (j == 2 && matchnothing(sides[i][4], i)) {\n // tile = rotateLeft(tile)\n // tile = rotateLeft(tile)\n // next = sides[i][1]\n // } else if (j == 3 && matchnothing(sides[i][2], i)) {\n // tile = rotateLeft(tile)\n // tile = rotateLeft(tile)\n // tile = rotateLeft(tile)\n // next = sides[i][4]\n // } else if (j == 4 && matchnothing(sides[i][2], i)) {\n // tile = rotateLeft(tile)\n // tile = flip(tile)\n // next = reverseString(sides[i][3])\n // } else {\n // flag = false\n // continue\n // }\n // pushandremove(tile, i, first, begin)\n // begin += tile.length\n // continue w\n // }\n // } else {\n // if (sides[i][j] == next) {\n // let tile = getTile(sides[i][0])\n // // align tile\n // if (j == 1) {\n // next = sides[i][2]\n // } else if (j == 2) {\n // tile = rotateLeft(tile)\n // tile = rotateLeft(tile)\n // tile = flip(tile)\n // next = reverseString(sides[i][1])\n // } else if (j == 3) {\n // tile = rotateLeft(tile)\n // tile = rotateLeft(tile)\n // tile = rotateLeft(tile)\n // tile = flip(tile)\n // next = reverseString(sides[i][4])\n // } else if (j == 4) {\n // tile = rotateLeft(tile)\n // next = sides[i][3]\n // }\n // pushandremove(tile, i, first, begin)\n // begin += tile.length\n // continue w\n // } else if (sides[i][j] == revnext) {\n // let tile = getTile(sides[i][0])\n // // align tile\n // if (j == 1) {\n // tile = flip(tile)\n // next = reverseString(sides[i][2])\n // } else if (j == 2) {\n // tile = rotateLeft(tile)\n // tile = rotateLeft(tile)\n // next = sides[i][1]\n // } else if (j == 3) {\n // tile = rotateLeft(tile)\n // tile = rotateLeft(tile)\n // tile = rotateLeft(tile)\n // next = sides[i][4]\n // } else if (j == 4) {\n // tile = rotateLeft(tile)\n // tile = flip(tile)\n // next = reverseString(sides[i][3])\n // }\n // pushandremove(tile, i, first, begin)\n // begin += tile.length\n // continue w\n // }\n // }\n // }\n // }\n // // if next tile not found, its the bottom, so find next column\n // first = false\n // begin = 0\n // next = nextcolumn\n // revnext = reverseString(next)\n // firstcolumn = false\n // for (let i = 0; i < sides.length; i++) {\n // for (let j = 1; j < 5; j++) {\n // if (sides[i][j] == next) {\n // let tile = getTile(sides[i][0])\n // // align tile\n // if (j == 1 && matchnothing(sides[i][3], i)) {\n // tile = flip(tile)\n // tile = rotateLeft(tile)\n // nextcolumn = reverseString(sides[i][2])\n // next = sides[i][4]\n // } else if (j == 2 && matchnothing(sides[i][3], i)) {\n // tile = rotateLeft(tile)\n // tile = rotateLeft(tile)\n // tile = rotateLeft(tile)\n // nextcolumn = sides[i][1]\n // next = reverseString(sides[i][4])\n // } else if (j == 3 && matchnothing(sides[i][1], i)) {\n // nextcolumn = sides[i][4]\n // next = sides[i][2]\n // } else if (j == 4 && matchnothing(sides[i][1], i)) {\n // tile = flip(tile)\n // nextcolumn = sides[i][3]\n // next = reverseString(sides[i][2])\n // }\n // pushandremove(tile, i, first, begin)\n // begin += tile.length\n // continue w\n // } else if (sides[i][j] == revnext) {\n // let tile = getTile(sides[i][0])\n // // align tile\n // if (j == 1 && matchnothing(sides[i][3], i)) {\n // tile = rotateLeft(tile)\n // nextcolumn = sides[i][2]\n // next = reverseString(sides[i][4])\n // } else if (j == 2 && matchnothing(sides[i][3], i)) {\n // tile = rotateLeft(tile)\n // tile = flip(tile)\n // nextcolumn = reverseString(sides[i][1])\n // next = sides[i][4]\n // } else if (j == 3 && matchnothing(sides[i][2], i)) {\n // tile = rotateLeft(tile)\n // tile = flip(tile)\n // tile = rotateLeft(tile)\n // tile = rotateLeft(tile)\n // tile = rotateLeft(tile)\n // nextcolumn = reverseString(sides[i][4])\n // next = sides[i][1]\n // } else if (j == 4 && matchnothing(sides[i][2], i)) {\n // tile = rotateLeft(tile)\n // tile = rotateLeft(tile)\n // nextcolumn = reverseString(sides[i][3])\n // next = reverseString(sides[i][1])\n // }\n // pushandremove(tile, i, first, begin)\n // begin += tile.length\n // continue w\n // }\n // }\n // }\n // // if no next tile and no new column, image should be finished\n // if (sides.length > 0) {\n // console.log(\"Something went wrong while creating the image\")\n // break // no infinite loop while coding\n // }\n // }\n\n\n \n // example\n // image = [\".#.#..#.##...#.##..#####\", \"###....#.#....#..#......\", \"##.##.###.#.#..######...\", \"###.#####...#.#####.#..#\", \"##.#....#.##.####...#.##\", \"...########.#....#####.#\", \"....#..#...##..#.#.###..\", \".####...#..#.....#......\", \"#..#.##..#..###.#.##....\", \"#.####..#.####.#.#.###..\", \"###.#.#...#.######.#..##\", \"#.####....##..########.#\", \"##..##.#...#...#.#.#.#..\", \"...#..#..#.#.##..###.###\", \".#.#....#.##.#...###.##.\", \"###.#...#..#.##.######..\", \".#.#.###.##.##.#..#.##..\", \".####.###.#...###.#..#.#\", \"..#.#..#..#.#.#.####.###\", \"#..####...#.#.#.###.###.\", \"#####..#####...###....##\", \"#.##..#..#...#..####...#\", \".#.###..##..##..####.##.\", \"...###...##...#...#..###\"]\n // image = rotateLeft(image)\n \n // note: we only have to search for sea dragons oriented one way, this will not work correct for finding overlapping sea dragons or sea dragons that swim in different directions\n // for () { for every rotation and flip\n showseadragons()\n // }\n\n // count water roughness (#)\n let total = 0\n for (let i = 0; i < image.length; i++) {\n for (let j = 0; j < image[i].length; j++) {\n if (image[i].substring(j, j+1) == \"#\") {\n total++\n }\n }\n }\n console.log(total)\n}", "title": "" }, { "docid": "f3edb915f338b00e457e1b63bd572db5", "score": "0.54175735", "text": "function sight(pPos, mPos, py, px, map){\n let a = (mPos[1]-pPos[1])/(mPos[0]-pPos[0])\n for(x=pPos[0]; x<mPos[0]; x+=0.01){\n if(Math.floor(pPos[1]+(x-pPos[0])*a)==py && Math.floor(x)==px){\n return true\n }\n if(map[Math.floor(pPos[1]+(x-pPos[0])*a)][Math.floor(x)]!=0){\n return false\n }\n }\n for(x=pPos[0]; x>mPos[0]; x-=0.01){\n if(Math.floor(pPos[1]+(x-pPos[0])*a)==py && Math.floor(x)==px){\n return true\n }\n if(map[Math.floor(pPos[1]+(x-pPos[0])*a)][Math.floor(x)]!=0){\n return false\n }\n }\n return true\n}", "title": "" }, { "docid": "a2cb4b1c75af1794cd118feabf3a40db", "score": "0.5411786", "text": "function boundaries(y, x) {\n\treturn (x < 8 && y < 8 && x > -1 && y > -1);\n}", "title": "" }, { "docid": "39b122bbeec62806725b1a22a4a7e67f", "score": "0.54110456", "text": "static isInMap(top, left, step) {\n if (\n top >= 0 &&\n top <= 400 - step &&\n left >= 0 &&\n left <= 400 - step\n ) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "f9c80b94b5bddfec948ee41293701954", "score": "0.5410809", "text": "canMoveToCell(fromRow, fromColumn, toRow, toColumn) {\n // Since robots can not move diagonally, either the row\n // or the column needs to be equal.\n if (fromRow !== toRow && fromColumn !== toColumn) {\n return false;\n }\n\n if (fromRow === toRow) {\n // We're moving horizontally.\n if (fromColumn < toColumn) {\n // To the right.\n return this.cells[fromRow].every((cell, idx) => {\n if (idx > fromColumn && idx < toColumn) {\n return this.validPathCell(fromRow, idx, 'right');\n }\n if (idx === toColumn) {\n return this.validTargetCell(fromRow, idx, 'right');\n }\n if (idx === fromColumn) {\n // Start cell can't have a right wall.\n return (this.cells[fromRow][fromColumn] & 2) === 0;\n }\n\n return true;\n });\n }\n\n // To the left.\n return this.cells[fromRow].every((cell, idx) => {\n if (idx < fromColumn && idx > toColumn) {\n return this.validPathCell(fromRow, idx, 'left');\n }\n if (idx === toColumn) {\n return this.validTargetCell(fromRow, idx, 'left');\n }\n if (idx === fromColumn) {\n // Start cell can't have a left wall.\n return (this.cells[fromRow][fromColumn] & 8) === 0;\n }\n\n return true;\n });\n }\n\n // We're moving vertically.\n if (fromRow < toRow) {\n // Down.\n return this.columnCells[fromColumn].every((cell, idx) => {\n if (idx < fromRow && idx > toRow) {\n return this.validPathCell(idx, fromColumn, 'down');\n }\n if (idx === toRow) {\n return this.validTargetCell(idx, fromColumn, 'down');\n }\n if (idx === fromRow) {\n // Start cell can't have a bottom wall.\n return (this.cells[fromRow][fromColumn] & 4) === 0;\n }\n\n return true;\n });\n }\n // Up.\n return this.columnCells[fromColumn].every((cell, idx) => {\n if (idx > fromRow && idx < toRow) {\n return this.validPathCell(idx, fromColumn, 'up');\n }\n if (idx === toRow) {\n return this.validTargetCell(idx, fromColumn, 'up');\n }\n if (idx === fromRow) {\n // Start cell can't have a top wall.\n return (this.cells[fromRow][fromColumn] & 1) === 0;\n }\n\n return true;\n });\n }", "title": "" }, { "docid": "3471d1423d17e7aeecf06efe758b3985", "score": "0.5410599", "text": "_getNeighbors(cx, cy) {\n let result = 0;\n for (let i = 0; i < this._dirs.length; i++) {\n let dir = this._dirs[i];\n let x = cx + dir[0];\n let y = cy + dir[1];\n if (x < 0 || x >= this._width || y < 0 || y >= this._height) {\n continue;\n }\n result += (this._map[x][y] == 1 ? 1 : 0);\n }\n return result;\n }", "title": "" }, { "docid": "6febcf5e4f808830e359dc96f24a89a6", "score": "0.5401654", "text": "isValidLocation(row, col) {\n //Your code here \n if (row < 0 || col < 0 || row > this.row || col > this.col ||\n typeof(row) == string || typeof(col) == string) return false;\n else return true;\n }", "title": "" }, { "docid": "387c805bf95cececaa481b8eb55bd43e", "score": "0.53929895", "text": "function checkMove(board, r, c, player) { // board, row, column, player\n\tvar direction = [0,0,0,0,0,0,0,0]; // top bottom left right topLeft bottomRight BottomLeft TopRight\n\tfor (var i = 0; i < 8; i++) { // loops over the directions\n\t\tif (i < 2) { var x = dir[i], y = 0; } // first checks horizontal...\n\t\telse if (i < 4) { var x = 0, y = dir[i-2]; } // then vertical...\n\t\telse if (i < 6) { var x = dir[i-4], y = x; } // then diagonal...\n\t\telse { var x = dir[i-6], y = -x; } // ..then the other diagonal\n\t\ttry { // try because it may be referencing a coordinate that doesn't exist (off the board)\n\t\t\twhile (checkPlay[board[r - x][c - y]] == checkPlay[player]*-1) { // while there are consecutive enemy peices\n\t\t\t\tdirection[i] += 1; // increases the count of direction\n\t\t\t\tif (i < 2) { x += dir[i]; } // first incriments the horizontal...\n\t\t\t\telse if (i < 4) { y += dir[i-2]; } // then the vertical...\n\t\t\t\telse if (i < 6) { x += dir[i-4]; y = x; } // then diagonal...\n\t\t\t\telse { x += dir[i-6]; y = -x; } // then the other diagonal\n\t\t\t}\n\t\t\tif (board[r - x][c - y] != player) { // if consective enemy pieces aren't surrounded by a friendly piece\n\t\t\t\tdirection[i] = 0; // reset this direction to 0\n\t\t\t}\n\t\t} catch { // if the coordinate doesn't exist\n\t\t\tdirection[i] = 0; // reset this direction to 0\n\t\t}\n\t}\n\treturn direction // return the result\n}", "title": "" }, { "docid": "226a183462cdadf2a803c08cf15e447c", "score": "0.5388381", "text": "function i(n){return n&&\"upperLeft\"===n.originPosition}", "title": "" }, { "docid": "226a183462cdadf2a803c08cf15e447c", "score": "0.5388381", "text": "function i(n){return n&&\"upperLeft\"===n.originPosition}", "title": "" }, { "docid": "6ced897718f8f3b84bc6df8cbed64c89", "score": "0.5388251", "text": "canWalk(x, y) {\n if(!this.isInBounds(x, y)) {\n return false;\n }\n if(this.data[Math.floor(y/this.tileSize)][Math.floor(x/this.tileSize)] != 0) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "9c6d738e04b102769cc5c7e33dc6a4b2", "score": "0.5387361", "text": "function pos2index(x, y, w, h) {\n\treturn {left: p2i(x,w), top: p2i(y,h)};\n}", "title": "" }, { "docid": "b310b5b8089ccfa725c365fbccad6dce", "score": "0.5383763", "text": "function checkShipPlacement() {\n if (isHorizontal) {\n if (shipLength + col > 10) {\n return false;\n } else {\n return true;\n }\n } else {\n if (shipLength + row > 10) {\n return false;\n } else {\n return true;\n }\n }\n}", "title": "" }, { "docid": "6f62c859947c025bf15cc9f87dde597a", "score": "0.5382597", "text": "getTilePosition(w,h)\n {\n var pos=[(w+0.5)*this.cubeSize-this.planeSize/2, (h+0.5)*this.cubeSize-this.planeSize/2];\n return pos;\n }", "title": "" }, { "docid": "5bf2d29399c85e6170881ba548cc1dcd", "score": "0.53771585", "text": "static findMoveDirection(point1, point2) {\n return [\n point2.y > point1.y ? interface_4.Direction.TOP : interface_4.Direction.BOTTOM,\n point2.x > point1.x ? interface_4.Direction.RIGHT : interface_4.Direction.LEFT\n ];\n }", "title": "" }, { "docid": "284c1716ff93f59d1d604553bc23f86f", "score": "0.537023", "text": "function generateCoordinates () {\n direction = Math.floor(Math.random() * 10) % 2 === 1 ? 'vertical' : 'horizontal'\n locationX = Math.floor(Math.random() * (sizeX - 1))\n locationY = Math.floor(Math.random() * (sizeY - 1))\n if (direction === 'horizontal') {\n if ((locationX + shipSize) >= sizeX) {\n generateCoordinates()\n }\n } else {\n if ((locationY + shipSize) >= sizeY) {\n generateCoordinates()\n }\n }\n }", "title": "" }, { "docid": "57470397e65ae9a5301d1015d409b4c8", "score": "0.53678477", "text": "handleInput(direction) {\n const horizontal = 101,\n vertical = 83;\n\n if (direction === 'left' && this.x - horizontal >= -101) {\n this.x -= horizontal;\n } else if (direction === 'right' && this.x + horizontal < (ctx.canvas.width - 101)) {\n this.x += horizontal;\n } else if (direction === 'down' && this.y + vertical < (ctx.canvas.height - 166)) {\n this.y += vertical;\n } else if (direction === 'up' && this.y - vertical >= (-83)) {\n this.y -= vertical;\n }\n\n }", "title": "" }, { "docid": "da59daf1923d34d1bd576f23edafbfc1", "score": "0.5365431", "text": "function drawMap(){\n for(var i = 0; i < height; i++){\n for(var j = 0; j < width; j++){\n\n // Si j'ai un bloc à cet endroit precis\n if(map[i][j] == 1){\n ctx.fillRect(gameOffsetX + (j + 1) * unit, gameOffsetY + (i + 1) * unit, unit, unit);\n }\n }\n }\n}", "title": "" }, { "docid": "cb3615a698e9a0b76022f2b3cb07f0e9", "score": "0.53592974", "text": "getPositionTile(x,y)\n {\n var pos=[(x+0.5)*this.cubeSize-this.planeSize/2, (y+0.5)*this.cubeSize-this.planeSize/2];\n }", "title": "" }, { "docid": "f68824b2d49c108f83b08bb0b085e2ec", "score": "0.5358954", "text": "function castVertical(map, origin, angle, up, right) {\n // Calculate the coordinates of the first intersection with a grid boundary.\n const intersectionX = Math.floor(origin.x / map.height) * map.height + (right ? map.height : -0.01);\n const intersectionY = origin.y + (origin.x - intersectionX) * Math.tan(angle);\n tmpPoint.x = intersectionX;\n tmpPoint.y = intersectionY;\n \n // Calculate the change in x and y coordinates needed to iterate across grid boundaries.\n const deltaX = right ? map.height : -map.height;\n const deltaY = Math.abs(map.height * Math.tan(angle)) * (up ? -1 : 1);\n \n // Find the nearest wall and return the dist to it.\n const wall = findWall(map, tmpPoint, deltaX, deltaY);\n return wall.dist(origin);\n }", "title": "" } ]
601613c484c51de1d547eb000eac0918
DEVELOPMENT plz don't forget that I need to revisit that. make the goddamn automation of the Happening Now slideshow box go away!! It's okay to be clickable but autoslide is terrible.
[ { "docid": "02fc4ade25206d11624c111f5cbef0bf", "score": "0.5993963", "text": "function stop_happening() {\n\n var $el = $('div.fullwall div.slideshow');\n\n // validate environment.\n if ( $el.length ) {\n\n // first, stop the current automation.\n $el.timer('stop');\n\n // next, change class name in order to prevent the timer from being started again.\n $el.removeClass('slideshow').addClass('slideshow-disabled-automation');\n\n\n //--- copied from FL's master-script (and altered the class name) so that onclick\n // keeps working ---//\n $(document).on('click', 'div.slideshow-disabled-automation li', function(){\n\t\t\tvar newslide = $('div.slideshow-disabled-automation .slide[rel=\"slide'+$(this).attr('rel')+'\"]');\n\t\t\tif ( !newslide.is(':visible') ) {\n\t\t\t\t$('div.slideshow-disabled-automation .slide').slideUp('fast');\n\t\t\t\tnewslide.slideDown('fast');\n\n\t\t\t\t// Save slide\n\t\t\t\tslide = parseInt($(this).attr('rel'));\n\t\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t// TODO: can I do this 'altered copy' programmatically?\n\n }\n}", "title": "" } ]
[ { "docid": "8a210f9fb6b4e00349b465aab8192572", "score": "0.7335729", "text": "function autoSlide(argument) {\n\t\t\t\t\tvar x = document.getElementsByClassName(\"slideshow\");\n\t\t\t\tif (index > x.length) {index = 1};\n\t\t\t\t\tfor (var i = 0; i < x.length; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tx[i].style.display=\"none\";\n\t\t\t\t\t}\n\t\t\t\t\tx[index-1].style.display=\"block\";\n\t\t\t\t\t index++;\n\t\t\t\t\tsetTimeout(autoSlide,1000);\t//this sets the time delay for the slidshow to play or take effect at 1 seconds\n\t\t\t\t}", "title": "" }, { "docid": "cc2fa086d45257a068b784cbd4921f1e", "score": "0.70308155", "text": "function showSlides() {\n images[0] = 'https://iphonewalls.net/wp-content/uploads/2015/03/Forest%20Hills%20Snowy%20Mountains%20And%20Sunset%20Clouds%20iPhone%206%20Plus%20HD%20Wallpaper.jpg';\n images[1]=imagelinks;\n document.slide.src = images[i];\n if(i< images.length -1){\n i++;\n }else{\n i=0;\n }\n \n setTimeout('showSlides()', time);\n }", "title": "" }, { "docid": "988a1f9ca963cd736054ddc121da8fd7", "score": "0.67971766", "text": "function noautoslide(){\r\n\tif(noautoenabled === false){\r\n\t\tclearInterval(slideshowtop);\r\n\t\tvar x = setTimeout(function(){\r\n\t\t\tslideshowtop = setInterval(slider,5000);\r\n\t\t\tclearTimeout(x);\r\n\t\t\tnoautoenabled = false;\r\n\t\t},5000);\r\n\t\tnoautoenabled = true;\r\n\t}\r\n}", "title": "" }, { "docid": "33d9adcdfda8d24a92022e03083dca4a", "score": "0.6779416", "text": "function cueAutoSlide() {\n\n\t\tclearTimeout( autoSlideTimeout );\n\n\t\t// Cue the next auto-slide if enabled\n\t\tif( autoSlide && !isPaused() && !isOverview() ) {\n\t\t\tautoSlideTimeout = setTimeout( navigateNext, autoSlide );\n\t\t}\n\n\t}", "title": "" }, { "docid": "0abc5b2e0b05424ca53e8c598beab607", "score": "0.668711", "text": "function showSlidesMobile() {\nvar j;\nvar slidesMobile = document.getElementsByClassName(\"mySlides_mobile\");\n\nfor (j = 0; j < slidesMobile.length; j++) {\n slidesMobile[j].style.display = \"none\";\n}\nslideIndexMobile++;\nif (slideIndexMobile > slidesMobile.length) {slideIndexMobile = 1}\n\nslidesMobile[slideIndexMobile -1].style.display = \"block\";\n\n\nsetTimeout(showSlidesMobile, 12000); // Change image every x seconds\n}", "title": "" }, { "docid": "3c28f5991f36e383dca32112672a7726", "score": "0.6663199", "text": "function showSlides() {\nvar i;\nvar slides = document.getElementsByClassName(\"mySlides\");\n\nfor (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n}\nslideIndex++;\nif (slideIndex > slides.length) {slideIndex = 1}\n\nslides[slideIndex-1].style.display = \"block\";\n\n\nsetTimeout(showSlides, 12000); // Change image every x seconds\n}", "title": "" }, { "docid": "63c4669ad17534bbf69fe82348bfa0a6", "score": "0.6612713", "text": "async function AutoSlideShow() {\n await sleep(3000);\n\n //checks to see if the user manually changed slides\n //if they did, stop the auto slide show\n if (slideShowAutomatic) {\n showSlides(slideIndex += 1);\n AutoSlideShow();\n }\n}", "title": "" }, { "docid": "392ef8155d1a90217be858f3196308a6", "score": "0.65795803", "text": "function showSlides() {\n var i;\n var slides = document.getElementsByClassName(\"mySlides\");\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n slideIndex++;\n if (slideIndex > slides.length) {\n slideIndex = 1\n }\n slides[slideIndex - 1].style.display = \"block\";\n // Changes the image every 3 seconds.\n setTimeout(showSlides, 3000); \n}", "title": "" }, { "docid": "855edc5032c4b7e2dd3cc0300621151e", "score": "0.6541375", "text": "function autoSlides(){\r\n // B1: What do slide is show?\r\n var positionSlide = 0;\r\n var slideNow= document.querySelector('.slides ul li.actived');\r\n\r\n // lan theo ve truoc no de culculate the index of slide\r\n for(positionSlide= 0;slideNow = slideNow.previousElementSibling;positionSlide++){}\r\n if(positionSlide < slides.length -1)\r\n {\r\n console.log('position '+ positionSlide);\r\n for(var j =0 ; j<slides.length;j++)\r\n {\r\n slides[j].classList.remove('actived');\r\n btn[j].classList.remove('active');\r\n }\r\n // add class active for next index of slide and button moveSlides\r\n slides[positionSlide].nextElementSibling.classList.add('actived');\r\n btn[positionSlide].nextElementSibling.classList.add('active');\r\n }\r\n else\r\n {\r\n for(var k = 0;k<slides.length;k++)\r\n {\r\n slides[k].classList.remove('actived');\r\n btn[k].classList.remove('active');\r\n }\r\n //\r\n slides[0].classList.add('actived');\r\n btn[0].classList.add('active');\r\n }\r\n }", "title": "" }, { "docid": "51d9bc49e31ed0a689be26f984a14e2a", "score": "0.6532509", "text": "function slideShow()\n{\n\tvar slides = document.querySelectorAll('.slide');\n\t// Resets the slideshow to the beginning when use tries \n\t// to go forward at the end\n\tif (slideIndex >= slides.length) \n\t{\n\t\tslideIndex = 0;\n\t}\n\t// Sets slideshow to the end when user tries to back \n\t// from the beginning\n\telse if(slideIndex < 0)\n\t{\n\t\tslideIndex = slides.length - 1;\n\t} \n\t// Set all other slides to not display\n\tfor(i =0; i < slides.length; i++)\n\t{\n\t\tslides[i].style.display =\"none\";\n\t}\n\t// Display chosen slide\n\tslides[slideIndex].style.display = \"block\"; \n\t \n}", "title": "" }, { "docid": "6e0ff7c22cc0c9c36a277baa3d1a0de9", "score": "0.6531229", "text": "function showSlides() {\n var i;\n var slides = document.getElementsByClassName(\"mySlides\"); // Llama las imagenes que tiene la clase mySlides para mostrar en el carrusel\n // Funcion para recorrer todas las imagenes\n for (i = 0; i < slides.length; i++) { \n slides[i].style.display = \"none\"; // Pone la imagen sin ningun estilo \n }\n slideIndex++; //incremento el apuntador del vector slides\n // Se pregunta si ya llego al final\n if (slideIndex > slides.length) {\n slideIndex = 1 // Se reinicia el apuntador a la posicion inicial\n } \n slides[slideIndex-1].style.display = \"block\"; \n setTimeout(showSlides, 6000); // Cambia la imagen cada 5 segundos \n}", "title": "" }, { "docid": "070ae4df64f78e84e63c47947c653eae", "score": "0.65256923", "text": "function slideshow()\n{\n\tdocument.slideshow.src = imageArray[imgcounter];\n\n\tif(imgcounter<imageArray.length-1)\n\t{\n\t\timgcounter++;\n\t\t//console.log(imageArray);\n\t}\n\telse\n\t{\n\t\timgcounter=0;\n\t}\n\tsetTimeout(\"slideshow()\",slidetime);\n\n\t//initialiseEventListeners();\n}", "title": "" }, { "docid": "ac907925038bd6858347d82f01a3e111", "score": "0.65100974", "text": "function autoSlide(e) {\n if (e.settings.paused === false) {\n e.intervalSlideChange = setTimeout(function () {\n e.settings.prevIndex = e.settings.slideIndex\n e.settings.slideIndex++\n sliderChange(e)\n }, e.settings.slideDuration)\n }\n }", "title": "" }, { "docid": "c198a226eecd8a5c11ad166db7c05840", "score": "0.6509467", "text": "function startSlideShow(noPreload){\n if( noPreload != true) preloadNextImage();\n settings.navContainer.children('.play').attr('src','/img/pause.png')\n settings.slideShowLoop = setTimeout(function(){\n slideShowNext();\n }, settings.imageHoldTime)\n }", "title": "" }, { "docid": "26455d4cf493768e0640f4b00dafcb26", "score": "0.6451274", "text": "function slideshow() {\nvar myIndex = 0;\ncarousel();\n\n\tfunction carousel() {\n\t\tvar i;\n\t\tvar mySlides = document.getElementsByClassName(\"mySlides\");\n\t\tfor (i = 0; i < mySlides.length; i++) {\n\t\t mySlides[i].style.display = \"none\"; \n\t\t}\n\t\tmyIndex++;\n\t\tif (myIndex > mySlides.length) {myIndex = 1} \n\t\tmySlides[myIndex-1].style.display = \"block\"; \n\t\tsetTimeout(carousel, 2000); // Change image every 2 seconds\n\t}\n}", "title": "" }, { "docid": "5bbefa7d3015a1d247119f2b7c0b2d2d", "score": "0.64339364", "text": "getSlides() {}", "title": "" }, { "docid": "edad8b580e5699e89ba4f1cab68d0a81", "score": "0.64295495", "text": "function AutoSlide() {\n slides[currentSlide].className = 'slide';\n currentSlide = (currentSlide+1)%slides.length;\n slides[currentSlide].className = 'slide showing';\n}", "title": "" }, { "docid": "1aa98e193fd97450d78b66c595bf19ce", "score": "0.6429102", "text": "function doSlide(evt)\r\n{\r\n\t//create a cross browser reference to object clicked on\r\n\tvar myEvent = window.event || evt;\r\n\tvar myTarget = myEvent.srcElement ? myEvent.srcElement:myEvent.target;\r\n\tvar captionText = myTarget.getAttribute('title') ? myTarget.getAttribute('title') : \" \";\r\n\t\r\n\t/* Alternative to line above:\r\n\tbasically, the ? means if and the : means else\r\n\t\r\n\tif(myEvent.srcElement)\r\n\t{\r\n\t\tmyEvent.srcElement\r\n\t}\r\n\telse\r\n\t{\r\n\t\tmyEvent.target\r\n\t}\r\n}\r\n\t */\r\n\t \r\n\t //swap out image src value\r\n\t var pic = document.getElementById('placeholder');\r\n\t var source = myTarget.href;\r\n\t pic.src = source;\r\n\t \r\n\t \r\n\t //swap out paragraph text\r\n\t var para = document.getElementById('description');\r\n\t var text = myTarget.title;\r\n\t para.firstChild.nodeValue = text;\r\n\t \r\n\t setStatus(evt);\r\n\t \r\n\t return true;\r\n}", "title": "" }, { "docid": "14fb3e5cdd8e461af540ecf4e664187b", "score": "0.64111924", "text": "function showSlides1(q) {\n var x;\n var slides1 = document.getElementsByClassName(\"mySlides1Fade1\");\n var dots1 = document.getElementsByClassName(\"dot1\");\n if (q > slides1.length) {slideIndex1 = 1}\n if (q < 1) {slideIndex1 = slides1.length}\n for (x = 0; x < slides1.length; x++) {\n slides1[x].style.display = \"none\";\n }\n for (x = 0; x < dots1.length; x++) {\n dots1[x].className = dots1[x].className.replace(\" active\", \"\");\n }\n slides1[slideIndex1-1].style.display = \"block\";\n dots1[slideIndex1-1].className += \" active\";\n}", "title": "" }, { "docid": "14fb3e5cdd8e461af540ecf4e664187b", "score": "0.64111924", "text": "function showSlides1(q) {\n var x;\n var slides1 = document.getElementsByClassName(\"mySlides1Fade1\");\n var dots1 = document.getElementsByClassName(\"dot1\");\n if (q > slides1.length) {slideIndex1 = 1}\n if (q < 1) {slideIndex1 = slides1.length}\n for (x = 0; x < slides1.length; x++) {\n slides1[x].style.display = \"none\";\n }\n for (x = 0; x < dots1.length; x++) {\n dots1[x].className = dots1[x].className.replace(\" active\", \"\");\n }\n slides1[slideIndex1-1].style.display = \"block\";\n dots1[slideIndex1-1].className += \" active\";\n}", "title": "" }, { "docid": "95a9d72725a9f3b48fc24fcb1882ae3e", "score": "0.6401672", "text": "function changePicture (slide) {\n\tfor(var i=0; i<slides_total; i++){\n\tslides[i].style.display='none';\n\t}\n\tslides[slide].style.display='block';\n}", "title": "" }, { "docid": "6cd07a1f3f821bc3e02d3025ebb696fb", "score": "0.63944465", "text": "function SlideReel()\r\n{\r\n}", "title": "" }, { "docid": "1cb09d213f635af6131aeda95067c1fe", "score": "0.63903713", "text": "function showSlides4(c) {\n var a;\n var slides4 = document.getElementsByClassName(\"mySlides4Fade4\");\n var dots4 = document.getElementsByClassName(\"dot4\");\n if (c > slides4.length) {slideIndex4 = 1}\n if (c < 1) {slideIndex4 = slides4.length}\n for (a = 0; a < slides4.length; a++) {\n slides4[a].style.display = \"none\";\n }\n for (a = 0; a < dots4.length; a++) {\n dots4[a].className = dots4[a].className.replace(\" active\", \"\");\n }\n slides4[slideIndex4-1].style.display = \"block\";\n dots4[slideIndex4-1].className += \" active\";\n }", "title": "" }, { "docid": "94a619e15be5bb1026f9a13863e843cb", "score": "0.6389023", "text": "function showSlides2(a) {\n var z;\n var slides2 = document.getElementsByClassName(\"mySlides2Fade2\");\n var dots2 = document.getElementsByClassName(\"dot2\");\n if (a > slides2.length) {slideIndex2 = 1}\n if (a < 1) {slideIndex2 = slides2.length}\n for (z = 0; z < slides2.length; z++) {\n slides2[z].style.display = \"none\";\n }\n for (z = 0; z < dots2.length; z++) {\n dots2[z].className = dots2[z].className.replace(\" active\", \"\");\n }\n slides2[slideIndex2-1].style.display = \"block\";\n dots2[slideIndex2-1].className += \" active\";\n }", "title": "" }, { "docid": "5ab577e89fd880b1bcce47f13a9e4bb9", "score": "0.6383489", "text": "function plusSlides(n) //When the user clicks one of the buttons call plusSlides()\n { //The plusSlides() function subtracts one or adds one to the slideIndex\n showSlides(slideIndex += n);\n }", "title": "" }, { "docid": "5b47c258c5a9e53a2c67f73d04753bd6", "score": "0.6381354", "text": "function Slaveshow(id, options){\r\n\t/**\r\n\t---------------------------------------- User defined variables ---------------------------------------------\r\n\t\t\tid: jQuery id of the slideshow container\r\n\t slides: jQuery object that represents the elements that will serve as slides.\r\n\t duration: How long each slide will remain visible assuming no interruption.\r\n\ttransition: The time between the previous slide's exit and the next slide's entrance.\r\n\t cycles: How many times the slideshow will cycle through assuming no interruption. \r\n\t delay: How long to offset a slave slideshow from the main slideshow.\r\n\t slaves: An array of slave slideshows that will mimic the main slideshow.\r\n\t nav: jQuery object that represents the elements that will serve as the slide navigation.\r\n\t left: jQuery object that represents the element(s) that will cause the slideshow to carousel left.\r\n\t right: jQuery object that represents the element(s) that will cause the slideshow to carousel right.\r\n\t-------------------------------------------------------------------------------------------------------------\t\t \r\n\t**/\t\r\n\t\r\n\t//Initialize default values\r\n\tvar defaults = {\r\n\t container: jQuery(id),\r\n \t slides: jQuery(id).children(),\t\t\r\n\t duration: 3000, \t\t\t\r\n\ttransition: 500, \r\n\t slaves: [],\r\n\t delay: 0, \t\t\t\r\n\t cycles: 10 \t\t \r\n\t},\tdefaultSettings = jQuery.extend(defaults, options); \r\n\t\r\n\t/**\r\n\t---------------------------------Global variable object---------------------------------\r\n\t animating: Boolean flag that describes the animating state of the slideshow.\r\n\t navSelected: Boolean flag that describes if a navigational element has been selected.\r\n\t navAnimating: Counter that tracks the number of slideshows animating when a\r\n \t\t\t navigational element is clicked.\r\n \t relativeIndex: The relative index of a slide within the jQuery object\r\n\t activeIndex: The absolute index of the slide being displayed.\r\n\tslidesTemplate: Serves as a template for searching for slides\r\n\t numSlideShows: The number of slideshows: main + all slaves\r\n\t numSlides: The number of slides each slideshow contains. \r\n\t\ttotalDelay: The accumulated delay values between all slideshow instantiations\r\n defaultEntrance: The default entrance animation\r\n defaultExit: The default exit animation\r\n\t----------------------------------------------------------------------------------------\r\n\t**/\r\n\tvar global = {\r\n\tanimating: false,\r\n\tnavSelected: false,\r\n\tnumAnimating: 0,\r\n\trelativeIndex: 0,\r\n\tactiveIndex: 0,\r\n\tslidesTemplate: jQuery(defaultSettings.slides),\r\n\tnumSlideShows: 0,\r\n\tnumSlides: jQuery(defaultSettings.slides).length,\r\n\ttotalDelay: 0,\r\n\tdefaultEntrance: {animation: \"fadeIn\", speed:500},\r\n\tdefaultExit: {animation: \"fadeOut\", speed:500}\r\n\t};\r\n\t\r\n\t//-------------------------------Class slideshow-------------------------------//\r\n\t//Description: Establishes the structure of an individual slideshow.\r\n\t//PARAMETERS: \r\n\t//container: A jQuery object that holds the selector for the slideshow container.\r\n\t//-----------------------------------------------------------------------------//s\r\n\tfunction slideshow(properties)\r\n\t{ \t\t\r\n\t\t//Get most default settings\r\n\t\tfor(var i in defaultSettings)\r\n\t\t{\r\n\t\t\tthis[i] = (isset(properties[i])) ? properties[i] : defaultSettings[i];\r\n\t\t}\t\r\n\t\t\r\n\t\t//Override default settings that are specific to context\r\n\t\tthis.container = jQuery(properties.container);\r\n\t\tthis.slides = jQuery(properties.container).children();\r\n\t\t\r\n\t\r\n\t\t//--------------------------------------------------------------------------------\r\n\t\t//----------------------------Animation initialization----------------------------\r\n\t\t//--------------------------------------------------------------------------------\r\n\t\t\t//If this is the main slideshow, which is instantiated first\r\n\t\t\tif(global.numSlideShows == 0)\r\n\t\t\t{\r\n\t\t\t\t//Entrance and exit default objects must be declared in this scope since\r\n\t\t\t\t//an object in the defaultSettings objectwill be completely overwritten \r\n\t\t\t\t//when the plugin is called.\r\n\t\t\t\tthis.entrance = global.defaultEntrance;\r\n\t\t\t\tthis.exit = global.defaultExit;\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//If not the main slideshow, copy the default values from the main slideshow, \r\n\t\t\t//previously instantiated.\r\n\t\t\telse\r\n\t\t\t{\t\r\n\t\t\t\t//Must create a clone of the objects instead of a direct assignment\r\n\t\t\t\t//since JavaScript would treat this.entrance/exit as a pointer to their\r\n\t\t\t\t//respective objects, thus altering the values of previous instantiations.\r\n\t\t\t\t//Ultimately, each instantiation would be equal to the last instantiation.\r\n\t\t\t\tthis.entrance = jQuery.extend(true, {}, slideshowArray.main.entrance);\r\n\t\t\t\tthis.exit = jQuery.extend(true, {}, slideshowArray.main.exit);\r\n\t\t\t}\t\t\r\n\r\n\t\t\t//Override default animation settings if specified\t\t\r\n\t\t\tif(isset(properties.entrance))\r\n\t\t\t{\r\n\t\t\t\tfor(var i in this.entrance)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.entrance[i] = properties.entrance[i] || this.entrance[i];\r\n\t\t\t\t}\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(isset(properties.exit))\r\n\t\t\t{\r\n\t\t\t\tfor(var i in this.exit)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.exit[i] = properties.exit[i] || this.exit[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t//--------------------------------------------------------------------------------\r\n\t\t\t\r\n\t\t//Keep certain values positive.\r\n\t\tthis.cycles = Math.abs(this.cycles);\r\n\t\tthis.delay = Math.abs(this.delay);\r\n\t\tthis.duration = Math.abs(this.duration);\r\n\t\t\r\n\t\t//Check for String in transition and assign respective values\r\n\t\tif(this.transition.constructor == String)\r\n\t\t{\r\n\t\t\tswitch(this.transition)\r\n\t\t\t{\r\n\t\t\t\tcase \"fade\": \r\n\t\t\t\t\tthis.transition = -1 * (this.entrance.speed + this.exit.speed);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"none\":\r\n\t\t\t\t\tthis.transition = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.transition = 250;\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//Increment the number of slideshows for each instantiation of the slideshow class.\r\n\t\tglobal.numSlideShows++;\t\t\r\n\t\t\r\n\t\t//Accumulate the total delay value\r\n\t\tglobal.totalDelay += this.delay;\r\n\t}\r\n\t\r\n\t//----------------------------Class slideshow prototype: displaySlide----------------------------//\r\n\t//Description: Exits one slide and enters another.\r\n\t//PARAMETERS:\r\n\t//newRelativeIndex: The index of the slide that will enter in relation to its position in the\r\n // jQuery object. (This index is dynamic due to how jQuery treats a jQuery\r\n\t// object that has been rearranged.)\r\n\t//newActiveIndex: The index of the slide that will enter in relation to its absolute position\r\n\t// in the sequence of slides.\r\n\t//Postcondition: Visually, a new slide appears if the proper conditions are met. \r\n\t//\t\t\t\t\tglobal.activeIndex variable is altered \r\n\t// global.animating alternates between true and false\r\n\t// The following classes are distributed to the nav elements (if defined):\r\n\t//\t\t\t\t\t\tslideNavUnclickable: slideshow is under animation, can't be interrupted\r\n\t//\t\t\t\t\t\tslideNavActive: applied to nav element that correlates with active slide\r\n\t//\t\t\t\t\t\tslideNavActiveUnclickable: Combination of the two above\t\r\n\t//-----------------------------------------------------------------------------------------------//\r\n\tslideshow.prototype.displaySlide = function(newRelativeIndex, newActiveIndex)\r\n\t{\t\r\n\t\t//Establish scope\r\n\t\tvar $this = this;\r\n\t\t\r\n\t\t//Set the new active index.\r\n\t\tglobal.activeIndex = newActiveIndex;\r\n\t\t\t\t\t\r\n\t\t//Index [0] belongs to the slide currently displayed. We don't want the animation to occur if the \r\n\t\t//selected slide is currently on display. If numAnimating is less than numSlideshows, then a\r\n\t\t//slideshow can animate.\r\n\t\tif(newRelativeIndex !=0 && (global.numAnimating < global.numSlideShows))\r\n\t\t{\t\t\t\t\r\n\t\t\t//The slideshow is animating. Prevent unnecessary reassignment, since global.animating will\r\n\t\t\t//remain true until the all slideshows have finished animating.\r\n\t\t\tif(global.numAnimating == 0)\r\n\t\t\t\tglobal.animating = true;\r\n\t\t\t\r\n\t\t\tsetTimeout(function()\r\n\t\t\t{\r\n\t\t\t\t//Select first slide and exit it\r\n\t\t\t\t$this.firstSlide = jQuery($this.slides[0]);\t\t\t\t\r\n\t\t\t\t$this.doTransition($this.firstSlide, $this.exit);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t//Array shift until the selected slide is at the front of the jQuery object (at index[0]).\r\n\t\t\t\tfor(var i=0; i<newRelativeIndex; i++)\r\n\t\t\t\t{ \r\n\t\t\t\t $this.slides = jQuery($this.slides).arrayShift(\"first\",\"last\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(isset(defaultSettings.nav))\r\n\t\t\t\t{\r\n\t\t\t\t\t//Remove active class from any nav elements and show nav elements as unclickable during animation\r\n\t\t\t\t\tjQuery(defaultSettings.nav).removeClass('slideNavActive').addClass('slideNavUnclickable');\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t//Determine which slide is active, and give the active class to the corresponding nav element\r\n\t\t\t\t\tjQuery(defaultSettings.nav).eq(newActiveIndex).addClass('slideNavActive slideNavActiveUnclickable');\r\n\t\t\t\t}\t\t\t\t\r\n // Add active class to active slide. Remove from inactive slides\r\n jQuery(defaultSettings.slides).removeClass('active').eq(newActiveIndex).addClass('active');\r\n\t\t\t}, $this.delay);\r\n\t\t\t\r\n\t\t\tsetTimeout(function()\r\n\t\t\t{\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t//Hide the NEW first slide. We do this so the slide will be able to execute\r\n\t\t\t\t//its entrance animation. Without the slide hidden, it would just\r\n\t\t\t\t//appear without animation\r\n\t\t\t\t$this.firstSlide = jQuery($this.slides[0]).hide();\r\n\t\t\t\t\t\r\n\t\t\t\t//Rearrange all the slides.\r\n\t\t\t\tjQuery($this.slides).fakeFloat();\r\n\t\t\t\t\t\r\n\t\t\t\t//Erase the display:none that may be on the previously animated slide\r\n\t\t\t\tjQuery($this.slides).slice(1).show(0);\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//Enter the new slide\r\n\t\t\t\t$this.doTransition($this.firstSlide, $this.entrance);\r\n\t\t\t\t\t\r\n\t\t\t\tsetTimeout(function()\r\n\t\t\t\t{\r\n\t\t\t\t\t//Increment the number of slideshows animating.\r\n\t\t\t\t\tglobal.numAnimating++;\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(global.numAnimating == global.numSlideShows)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t//If the number of slideshows animating equals the number of slideshows total,\r\n\t\t\t\t\t\t//then the animation for all slideshows has finished. Reset the counter back to 0.\r\n\t\t\t\t\t\tglobal.animating = false;\r\n\t\t\t\t\t\tglobal.numAnimating = 0;\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tjQuery(defaultSettings.nav).removeClass('slideNavUnclickable slideNavActiveUnclickable');\r\n\t\t\t\t\t}\r\n\t\t\t\t},$this.entrance.speed);\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//If displaySlide is used for navigational purposes, a transition pause is unnecessary. \r\n\t\t\t\t//However, a negative transition value implies an overlap effect, so that needs to be included during navigation animations.\r\n\t\t\t}, ($this.delay + $this.exit.speed + $this.entrance.speed + ((global.navSelected == false || (global.navSelected == true && $this.transition < 0)) ? $this.transition : 0)));\r\n\t\t\t \r\n\t\t}\r\n\t};\t\r\n\r\n\t//------------------------------Class slideshow prototype: animate------------------------------//\r\n\t//Description: Cycles through each slide, displaying one after the other\r\n\t//PARAMETERS:\r\n\t//newRelativeIndex: The index of the slide that will enter in relation to its position in the\r\n // jQuery object. (This index is dynamic due to how jQuery treats a jQuery\r\n\t// object that has been rearranged.)\r\n\t//newActiveIndex: The index of the slide that will enter in relation to its absolute position\r\n\t// in the sequence of slides.\r\n\t//Postcondition: The global.activeIndex variable is adjusted. Visually, a new slide appears if\r\n\t// the proper conditions are met. \r\n\t//----------------------------------------------------------------------------------------------//\t\r\n\tslideshow.prototype.animate = function()\r\n\t{\t\r\n\t\t//Establish scope\r\n\t\tvar $this = this;\r\n\t\t\t\t\r\n\t\t\t//For as many slides that exist, and for as many cycles specified\r\n\t\t\tfor(var i = 1; i < ($this.slides.length * $this.cycles); i++)\r\n\t\t\t{\t\t\t\t\r\n\t\t\t\t\tsetTimeout(function()\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t//If a navigational element hasn't been selected.\r\n\t\t\t\t\t\tif(global.navSelected == false)\r\n\t\t\t\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//Only apply changes to the active and nav indexes for one slide, and let the \r\n\t\t\t\t\t\t\t//other slides use the same indexes.\r\n\t\t\t\t\t\t\tif($this == slideshowArray.main)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t/*Example: 5 slides in slideshow array.\r\n\t\t\t\t\t\t\t\tSince arrays start at 0, max index of slideshow array = 4\r\n\t\t\t\t\t\t\t\t=> Can only increment when index < 4 (or we exceed the array bounds)\r\n\t\t\t\t\t\t\t\t=> Can only increment when index < (5 - 1)\r\n\t\t\t\t\t\t\t\t=> Can only increment when index < (number of slides - 1)\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tIf index is not less than (number of slides - 1), reset the index back to 0. \r\n\t\t\t\t\t\t\t\t*/\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t(global.activeIndex < global.numSlides - 1) ? global.activeIndex++ : global.activeIndex = 0; \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//Find the relative index of the slide in the jQuery object.\r\n\t\t\t\t\t\t\t\tglobal.relativeIndex = jQuery(global.slidesTemplate[global.activeIndex]).getIndexOf(slideshowArray[\"main\"].slides);\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$this.displaySlide(global.relativeIndex, global.activeIndex);\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}, (($this.duration + $this.entrance.speed + $this.exit.speed + $this.transition + global.totalDelay) * i));\t\t\t\t\r\n\t\t\t}\r\n\t};\r\n\r\n\t//-------------------------Class slideshow prototype: doTransition-------------------------//\r\n\t//Description: Exits the active slide\r\n\t//PARAMETERS:\r\n\t// slide: The slide that will be animating.\r\n\t//transition: An object that holds the following properties:\r\n\t//\t\tanimation: A string that determines the animation option.\r\n\t//\t\t speed: How fast the animation executes\r\n\t// easing: Easing option\r\n\t//-----------------------------------------------------------------------------------------//\t\t\r\n\tslideshow.prototype.doTransition = function(slide, transition)\r\n\t{\t\t\r\n\t\t//Copy to local variables for convenience. \r\n\t var animation = transition.animation.toLowerCase();\r\n\t var distance = jQuery(slide).width();\r\n\t\t var speed = transition.speed\r\n\t\t\r\n\t\tswitch(animation)\r\n\t\t{\r\n\t\t\t//Entrance animations\r\n\t\t\tcase \"fromright\":\t\t\t\r\n\t\t\t\tjQuery(slide).animate({'left': '+=' + distance + 'px', 'opacity': 'show'}, 0)\r\n\t\t\t\t\t\t\t .animate({'left':'-=' + distance + 'px'}, speed);\r\n\t\t\t\t\t\t\t break;\t\t\t\r\n\t\t\t\r\n\t\t\tcase \"fromleft\":\t\t\t\r\n\t\t\t\tjQuery(slide).animate({'left': '-=' + distance + 'px', 'opacity': 'show'}, 0)\r\n\t\t\t\t\t\t\t .animate({'left':'+=' + distance + 'px'}, speed);\r\n\t\t\t\t\t\t\t break;\t\t\t\r\n\t\t\t\r\n\t\t\tcase \"frombottom\":\t\t\t\r\n\t\t\t\tjQuery(slide).animate({'top': '+=' + distance + 'px', 'opacity': 'show'}, 0)\r\n\t\t\t\t\t\t\t .animate({'top':'-=' + distance + 'px'}, speed);\r\n\t\t\t\t\t\t\t break;\t\t\t\r\n\t\t\t\r\n\t\t\tcase \"fromtop\":\t\t\t\r\n\t\t\t\tjQuery(slide).animate({'top': '-=' + distance + 'px', 'opacity': 'show'}, 0)\r\n\t\t\t\t\t\t\t .animate({'top':'+=' + distance + 'px'}, speed);\r\n\t\t\t\t\t\t\t break;\r\n\t\t\t\r\n\t\t\tcase \"fadein\":\r\n\t\t\t\tjQuery(slide).fadeIn(speed);\r\n\t\t\t\t\t\t\t break;\r\n\t\t\r\n\t\t\t//Exit animations\r\n\t\t\tcase \"toleft\":\t\t\t\r\n\t\t\t\tjQuery(slide).animate({'left': '-=' + distance + 'px'}, speed)\r\n\t\t\t\t\t\t .animate({'opacity':'hide', 'left':'+=' + distance + 'px'}, 0);\r\n\t\t\t\t\t\t\t break;\t\t\t\r\n\t\t\t\r\n\t\t\tcase \"toright\":\t\t\t\r\n\t\t\t\tjQuery(slide).animate({'left': '+=' + distance + 'px'}, speed)\r\n\t\t\t\t\t\t\t .animate({'opacity':'hide', 'left':'-=' + distance + 'px'}, 0);\r\n\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t\r\n\t\t\tcase \"totop\":\t\t\t\r\n\t\t\t\tjQuery(slide).animate({'top': '-=' + distance + 'px'}, speed)\r\n\t\t\t\t\t\t\t .animate({'opacity':'hide', 'top':'+=' + distance + 'px'}, 0);\r\n\t\t\t\t\t\t\t break;\t\t\t\r\n\t\t\t\r\n\t\t\tcase \"tobottom\":\t\t\t\r\n\t\t\t\tjQuery(slide).animate({'top': '+=' + distance + 'px'}, speed)\r\n\t\t\t\t\t\t\t .animate({'opacity':'hide', 'top':'-=' + distance + 'px'}, 0);\r\n\t\t\t\t\t\t\t break;\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tjQuery(slide).fadeOut(speed);\t\t\r\n\t\t}\r\n\t};\t\t\r\n\r\n\t//Object that will hold the slideshows to be iterated over. Psuedo array.\r\n\t//Initialize the main slideshow.\r\n\tvar slideshowArray = {main: new slideshow(defaultSettings)};\t\t\r\n\t\t\r\n\t//---------------------------------------------------------------------------------//\r\n\t//---------------------------- Add Slave Slideshows ----------------------------//\r\n\t//---------------------------------------------------------------------------------//\t\t\r\n\t\r\n\tthis.addSlave = function(opts){\r\n\t\t\tslideshowArray[\"slave\" + global.numSlideShows] = new slideshow(opts);\r\n\t};\r\n\t\r\n\t//---------------------------------------------------------------------------------//\r\n\t//-----------------------------Begin Slide Navigations-----------------------------//\r\n\t//---------------------------------------------------------------------------------//\t\t\r\n\t\r\n\t//If slideshow navigation was specified.\r\n\tif(isset(defaultSettings.nav) || isset(defaultSettings.left))\r\n\t{\t\t\t\r\n\t\t\r\n\t\tjQuery(defaultSettings.nav).click(function()\r\n\t\t{\r\n\t\t\t//If the slideshow is not animating and current displaySlide is finished\r\n\t\t\tif(global.animating == false && global.numAnimating == 0)\r\n\t\t\t{\r\n\t\t\t\t//Indicates that a navigational element has beens selected.\r\n\t\t\t\t//The slideshow will stop its cycle.\r\n\t\t\t\tglobal.navSelected = true;\r\n\t\t\t\t\r\n\t\t\t\t//Find the relative index of the slide in the jQuery object.\r\n\t\t\t\tglobal.relativeIndex = jQuery(global.slidesTemplate[jQuery(this).index()]).getIndexOf(slideshowArray[\"main\"].slides);\r\n\r\n\t\t\t\t//For each slideshow in the slideshow array, display the slide\r\n\t\t\t\tfor (var i in slideshowArray)\r\n\t\t\t\t{\r\n\t\t\t\t\tslideshowArray[i].displaySlide(global.relativeIndex, jQuery(this).index());\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//---------------------------------------------------------------------------------//\r\n\t//----------------------------Left and Right Slide Shift---------------------------//\r\n\t//---------------------------------------------------------------------------------//\t\t\r\n\t\r\n\tif(isset(defaultSettings.left) && isset(defaultSettings.right))\r\n\t{\r\n\t\t//If left or right scroller is clicked\r\n\t\tdefaultSettings.right.add(defaultSettings.left).click(function()\r\n\t\t{\r\n\t\t\t//If the slideshow is not animating and current displaySlide is finished\r\n\t\t\tif(global.animating == false && global.numAnimating == 0)\r\n\t\t\t{\t\t\t\t\r\n\t\t\t\t//Indicates that a navigational element has beens selected.\r\n\t\t\t\t//The slideshow will stop its cycle.\r\n\t\t\t\tglobal.navSelected = true;\t\t\t\r\n\t\t\t\r\n\t\t\t\t//If left scroller clicked\r\n\t\t\t\tif(jQuery(this).equalTo(defaultSettings.left))\r\n\t\t\t\t{\t\t\t\t\t\r\n\t\t\t\t\t\t//If moving left, decrement the activeIndex unless the activeIndex is zero. At that point, reset\r\n\t\t\t\t\t\t//The active index to the index of the last slide (global.numSlides-1)\r\n\t\t\t\t\t\tglobal.activeIndex > 0? global.activeIndex--: global.activeIndex = global.numSlides-1;\r\n\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\t\t\t\r\n\t\t\t\t\t\t//If moving right, increment the activeIndex unless the activeIndex is the last index. At that point, reset\r\n\t\t\t\t\t\t//The active index to the index of the first slide (0).\r\n\t\t\t\t\t\tglobal.activeIndex < global.numSlides-1? global.activeIndex++: global.activeIndex = 0;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tglobal.relativeIndex = jQuery(global.slidesTemplate[global.activeIndex]).getIndexOf(slideshowArray[\"main\"].slides);\r\n\t\t\t\r\n\r\n\t\t\t\t//For each slideshow in the slideshow array, display the slide\r\n\t\t\t\tfor (var i in slideshowArray)\r\n\t\t\t\t{\r\n\t\t\t\t\tslideshowArray[i].displaySlide(global.relativeIndex, global.activeIndex);\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//---------------------------------------------------------------------------------//\r\n\t//---------------------------- Trigger Animation ---------------------------//\r\n\t//---------------------------------------------------------------------------------//\t\t\r\n\t\r\n\tthis.animate = function(){\r\n\t\t//For each slideshow in the slideshowArray, run the slideshow Animation\r\n\t\t//And count how many slideshows there are\r\n\t\tfor (var i in slideshowArray)\r\n\t\t{\r\n\t\t\tjQuery(slideshowArray[i].slides).fakeFloat();\r\n\t\t\tslideshowArray[i].animate();\r\n\t\t}\t\t\t\r\n\t}\r\n}", "title": "" }, { "docid": "f58a62ff5e9a60d4d931ca9ac21c1eb4", "score": "0.6379338", "text": "function slideshow()\n{\n var slides = document.getElementsByClassName(\"slides\");\n\n for( i = 0; i < slides.length; i++ )\n {\n slides[i].style.display = \"none\";\n }\n\n slides[slideIndex].style.display = \"block\";\n}", "title": "" }, { "docid": "a35ed408f5a3c3a1eb0df3c8a24fb7a9", "score": "0.63737303", "text": "function setupSlideshow() {\r\n $slides = $('#slideshow li');\r\n $firstSlide = $slides.first();\r\n $lastSlide = $slides.last();\r\n $currentSlide = $firstSlide;\r\n\r\n$slides.not( $currentSlide ).hide();\r\n\r\n// Call nextSlide after 3 seconds (interval is assigned to 3 seconds at the top)\r\ntimer = setTimeout( nextSlide, interval );\r\n\r\n// When the mouse enters the slideshow, clear the timer so it doesn't go to next slide\r\n$( '#slideshow' ).on( 'mouseenter', function(){\r\n clearTimeout( timer );\r\n} );\r\n\r\n// When the mouse leaves the slideshow, set the timer to call nextSlide function in 3 seconds (interval = 3 seconds).\r\n$( '#slideshow' ).on( 'mouseleave', function(){\r\n timer = setTimeout( nextSlide, interval );\r\n} );\r\n\r\n// When the slideshow is clicked, call nextSlide function and clear timeout\r\n$( '#slideshow' ).on( 'click', function(){\r\n nextSlide();\r\n clearTimeout( timer );\r\n} );\r\r\n}", "title": "" }, { "docid": "03e06ff8dbca14a8494051dc67d5538b", "score": "0.6330324", "text": "function forwardSlides() {\r\n\tclearTimeout(y);\r\n\t\r\n\tvar forwardSlideIndex;\r\n\tvar i;\r\n \r\n\t\r\n\t\r\n for (i = 0; i < x.length; i++) {\r\n x[i].style.display = \"none\"; \r\n\t //hides images\r\n }\r\n\t\r\n slideIndex++; \r\n\t\r\n\t\r\n if (slideIndex >= x.length) \r\n\t{slideIndex = 0;} \r\n\r\n\t\r\n\tforwardSlideIndex = slideIndex;\r\n\t\r\n\r\n x[forwardSlideIndex].style.display = \"block\"; \r\n\t\r\n}", "title": "" }, { "docid": "1ce9b1f883cfee46cf2a65901c4c7890", "score": "0.63274646", "text": "function autoCarousel() {\n\tslide__show(slide__index += 0);\n\tslide__index++;\n\tsetTimeout(autoCarousel, 5000);\n}", "title": "" }, { "docid": "d9952959589ffbf1c9a7185e125f2e85", "score": "0.63239646", "text": "function automatic_showSlides() {\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\"; \n slides[i].classList.remove('active'); \n }\n SlideIndex++;\n if (SlideIndex > slides.length) {SlideIndex = 1} \n for (i = 0; i < number_controls.length; i++) {\n number_controls[i].className = number_controls[i].className.replace(\" active\", \"\");\n }\n slides[SlideIndex-1].style.display = \"block\";\n slides[SlideIndex-1].classList.add('active'); \n number_controls[SlideIndex-1].className += \" active\";\n setTimeout(automatic_showSlides, 2000); // Change image every 2 seconds\n}", "title": "" }, { "docid": "5d19d654d662dec0d1ce104b8538b1d9", "score": "0.6319931", "text": "function GocSlideManager($) {\n\n /**\n * A single-dimensional array to hold our selected attachment ID integers.\n *\n * @param {array}\n */\n var selected = [];\n\n // Add initial selected IDs (that were previously saved)\n // to selected collection.\n var selectedIds = $('#manage-slides-selected').val();\n\n // Confirm that there are some selected slides (sometimes there won't be).\n if (selectedIds) {\n\n // Selected slides come in a string of comma-separated items,\n // so split them into pieces to make our job easier.\n var selectedIds = selectedIds.split(',');\n\n // Add each slide ID to our array of selected slide IDs.\n for (var selectedId in selectedIds) {\n var id = parseInt(selectedIds[selectedId]);\n selected.push(id);\n }\n }\n\n /**\n * Saves the selected slides to our hidden field.\n *\n * Slides are saved every time a slide is clicked.\n */\n var save = function save() {\n\n // JS will automatically translate our array\n // to a string of comma-separated items.\n $('#manage-slides-selected').val(selected);\n }\n\n /**\n * Selects or de-selects a slide whenever one is clicked,\n * and adds/removes CSS 'is-selected' class, which provides\n * the visual cue for individual, selected slides.\n */\n $('.goc-slide').click(function(){\n\n // Get full ID of element.\n var elementId = $(this).attr('id');\n\n // Get the number ID of the element.\n var selectedId = parseInt(elementId.replace('goc-slide-', ''));\n\n // Determine where, if anywhere, this ID is in the\n // selected collection.\n var foundIndex = $.inArray(selectedId, selected);\n\n // Check if the slide is in our array of selections.\n if (foundIndex === -1) {\n // Slide wasn't selected, select it.\n selected.push(selectedId);\n $(this).addClass('is-selected');\n } else {\n // Slide was selected, deselect it.\n selected.splice(foundIndex, 1);\n $(this).removeClass('is-selected');\n }\n\n // Save latest selected slides to our hidden field.\n save();\n\n });\n\n}", "title": "" }, { "docid": "57e5cfb7323f85ef8a26969e2b9c73ea", "score": "0.630514", "text": "function slideShow(e){ \n e.preventDefault();\n setInterval(nextImg, 1500);\n}", "title": "" }, { "docid": "323062d4d3c38fc8b082a7a5af45d1e6", "score": "0.6295359", "text": "function activateslide(){\t\nsetInterval(imageslides,5000);\n/*when the page loads. focus on the middle. CHALLENGE: it won't work for browsers that tha do not have javascript enabled*/\nvar bod= document.getElementById(\"mainproperty\");\nbod.focus();\n}", "title": "" }, { "docid": "cb70b173f7028fb5fc698e06f3906330", "score": "0.6294967", "text": "return() {\n // move to third slide\n this.glide.go(\"=3\");\n }", "title": "" }, { "docid": "84150431a95920574419cccc4f38497a", "score": "0.62869257", "text": "function showSlides(n){\n if(n>videos.length-1) slideIndex = 0;\n if(n<0) slideIndex=videos.length-1;\n //obj.src = videos[slideIndex];\n //videos.forEach((index)=>videos[index].style.display=\"none\");\n //videos[slideIndex-1].style.display=\"flex\";\n loadSlide();\n}", "title": "" }, { "docid": "cbf2b3522508f3fd28eda6efc8e1ae24", "score": "0.62613416", "text": "function plus_slide(e){\n e ? e.preventDefault() : \"\";\n if(cnt == slides.length-num_of_slides){\n cnt=0;\n for(let i=0; i<slides.length; ++i){\n slides[i].style.display = \"block\";\n }\n }else{\n slides[cnt].style.display = \"none\";\n cnt+=1;\n }\n }", "title": "" }, { "docid": "319de8da590625a3fd39cbc21a3abb53", "score": "0.6260788", "text": "function slideshow(item_id) {\n\t\t$('#content-' + item_id + ' .fadein :first-child').fadeOut().next('img').fadeIn().end().appendTo('#content-' + item_id + ' .fadein');\n\t}", "title": "" }, { "docid": "ecef4a3e8d05d5522486fab15208e1c7", "score": "0.62549454", "text": "function runSlides() {\n var $slides = $('.slides li'),\n count = $slides.length,\n i = 0,\n pause = 5000;\n\n var setClasses = function setClasses() {\n $slides\n .eq(i)\n .removeClass('visible-slide');\n $slides\n .eq(i)\n .addClass('hidden-slide');\n\n if (++i >= count) {\n i = 0;\n }\n\n $slides\n .eq(i)\n .removeClass('hidden-slide');\n $slides\n .eq(i)\n .addClass('visible-slide');\n\n setTimeout(setClasses, pause);\n };\n\n setTimeout(setClasses, pause);\n\n }", "title": "" }, { "docid": "4567acdb2d7de972411bd9e0958b25f7", "score": "0.62372684", "text": "function slideLoop(){\n\t\tremoveSlideshow();\n\t\t$('<div/>').attr({\n\t\t\t\t'id':'slideshow'\n\t\t\t}).appendTo('#pagecontent');\n\t\t$('<div/>').attr({\n\t\t\t'id': 'description',\n\t\t}).fadeIn(timeMilli).load('pages/home/slideshow'+incr+'.html').appendTo('#slideshow');\n\t\tif(incr == 5){\n\t\t\tincr = 1;\n\t\t}else{\n\t\t\tincr++;\n\t\t}\n\t\tif(!stopLoop){\n\t\t\tsetTimeout(slideLoop, timeMilli*2);\n\t\t}else{\n\t\t\tremoveSlideshow();\n\t\t}\n\t}", "title": "" }, { "docid": "a22b40c5eac7ce37943e22e31e3ec973", "score": "0.62357986", "text": "function slideshow () {\n var i = 0;\n var sliderAccess = new SliderClass();\n //var images = document.getElementsByClassName(\"slider-images\");\n //var selectors = document.getElementsByClassName(\"slider-selectors\");\n\n // Wrappers & Wrap arounds\n if (n > sliderAccess.images.length) { sliderIndex = 0; }\n else if (n < 0) { sliderIndex = sliderAccess.images.length; }\n\n // Make everything 'hidden' to set new image and selector active\n for (i = 0; i < sliderAccess.images.length; i++) {\n sliderAccess.images[i].style.display = \"none\";\n sliderAccess.selectors[i].className = sliderAccess.selectors[i].className.replace(\" active\", \"\");\n }\n\n if (!sliderPaused) { sliderIndex++; }\n\n sliderAccess.images[sliderIndex].style.display = \"block\";\n sliderAccess.selectors[sliderIndex].className += \" active\";\n\n setTimeout( slideshow, 3000);\n}", "title": "" }, { "docid": "04e7098c75b55edb7790fcb57d1e8e9e", "score": "0.6233407", "text": "function slideshow() { \r\n document.getElementById(\"content\").innerHTML=\"<div class=\\\"slideshow-container\\\"><div class=\\\"mySlides\\\"><img src=\\\"https://s3-us-west-1.amazonaws.com/carrie-studebaker.com/images/1.JPG\\\" style=\\\"width:100%\\\"></div><div class=\\\"mySlides\\\"><img src=\\\"https://s3-us-west-1.amazonaws.com/carrie-studebaker.com/images/2.JPG\\\" style=\\\"width:100%\\\"></div><div class=\\\"mySlides\\\"><img src=\\\"https://s3-us-west-1.amazonaws.com/carrie-studebaker.com/images/3.JPG\\\" style=\\\"width:100%\\\"></div><div class=\\\"mySlides\\\"><img src=\\\"https://s3-us-west-1.amazonaws.com/carrie-studebaker.com/images/4.JPG\\\" style=\\\"width:100%\\\"></div><div class=\\\"mySlides\\\"><img src=\\\"https://s3-us-west-1.amazonaws.com/carrie-studebaker.com/images/5.JPG\\\" style=\\\"width:100%\\\"></div><div class=\\\"mySlides\\\"><img src=\\\"https://s3-us-west-1.amazonaws.com/carrie-studebaker.com/images/6.JPG\\\" style=\\\"width:100%\\\"></div><div class=\\\"mySlides\\\"><img src=\\\"https://s3-us-west-1.amazonaws.com/carrie-studebaker.com/images/7.JPG\\\" style=\\\"width:100%\\\"></div>\"\r\n\t\r\n\t/*<a class=\\\"prev\\\" onclick=\\\"plusSlides(-1)\\\">&#10094;</a><a class=\\\"next\\\" onclick=\\\"plusSlides(1)\\\">&#10095;</a></div>\\\"\"\r\nwindow.onload = showSlides;*/\r\nvar slideIndex = 0;\r\nshowSlides();\r\n\r\nfunction showSlides() {\r\n var i;\r\n var slides = document.getElementsByClassName(\"mySlides\");\r\n for (i = 0; i < slides.length; i++) {\r\n slides[i].style.display = \"none\";\r\n }\r\n slideIndex++;\r\n if (slideIndex > slides.length) {slideIndex = 1}\r\n slides[slideIndex-1].style.display = \"block\";\r\n setTimeout(showSlides, 2500); // Change image every 2 seconds\r\n} \r\n\r\n}", "title": "" }, { "docid": "14eb4ca16cff5e93739251d47f61b9e0", "score": "0.6228941", "text": "function showSlides3(b) {\n var y;\n var slides3 = document.getElementsByClassName(\"mySlides3Fade3\");\n var dots3 = document.getElementsByClassName(\"dot3\");\n if (b > slides3.length) {slideIndex3 = 1}\n if (b < 1) {slideIndex3 = slides3.length}\n for (y = 0; y < slides3.length; y++) {\n slides3[y].style.display = \"none\";\n }\n for (y = 0; y < dots3.length; y++) {\n dots3[y].className = dots3[y].className.replace(\" active\", \"\");\n }\n slides3[slideIndex3-1].style.display = \"block\";\n dots3[slideIndex3-1].className += \" active\";\n }", "title": "" }, { "docid": "bd4a8b9cf62a7b68ef308bedffe2bd0e", "score": "0.6211758", "text": "function Slideshow(_id, _index, _wrap) {\n\tvar slideshow = document.getElementById(_id);\n\tvar index, wrap, preview, caption, link;\n\tvar images = new Array();\n\tvar context = this;\n\t\n\t// if no index was set assume we're starting at the beginning\n\t(_index)? index = _index : index = 0;\n\t\n\t// does the slideshow wrap around at the beginning and end?\n\t(_wrap)? wrap = _wrap : wrap = false;\n\t\n\t// if the slideshow id isn't found do nothing (false)...\n\t(slideshow)?init():false;\n\t\n\tfunction init() {\n\t\t// find all <img>'s along with the <a class=\"preview>\n\t\t// and <img /> elements within the slideshow\n\t\tvar _images = slideshow.getElementsByTagName(\"img\");\n\t\tfor (var i=0; i < _images.length; i++) {\n\t\t\tvar isPreview = _images[i].parentNode.className.search(/preview/)+1;\t\t\t\n\t\t\tif (isPreview) {\n\t\t\t\t// set the preview image reference\n\t\t\t\tpreview = _images[i];\n\t\t\t\tlink = _images[i].parentNode;\n\t\t\t} else {\n\t\t\t\t// push all other images into the images array\n\t\t\t\timages.push(_images[i]);\n\t\t\t}\n\t\t}\n\t\t// find the preview <p> element and reference it for caption\n\t\tvar _span = slideshow.getElementsByTagName(\"span\");\n\t\tfor (var i=0; i < _span.length; i++) {\n\t\t\tvar isPreview = _images[i].parentNode.className.search(/preview/)+1;\t\t\t\n\t\t\tif (isPreview) {\n\t\t\t\tcaption = _span[i];\n\t\t\t}\n\t\t}\n\t\t// find and enable the previous and next controls\n\t\tvar _ul = slideshow.getElementsByTagName(\"ul\");\n\t\tfor (var i=0; i < _ul.length; i++) {\n\t\t\tvar isControls = _ul[i].className.search(/controls/)+1;\t\n\t\t\tif (isControls) {\n\t\t\t\tvar _a = _ul[i].getElementsByTagName(\"a\");\n\t\t\t\tfor (var j=0; j < _a.length; j++) {\n\t\t\t\t\tvar isPrevious = _a[j].className.search(/previous/)+1;\n\t\t\t\t\tvar isNext = _a[j].className.search(/next/)+1;\n\t\t\t\t\t// wire up previous button\n\t\t\t\t\tif (isPrevious) {\n\t\t\t\t\t\t_a[j].onclick = function() {\n\t\t\t\t\t\t\tcontext.previous();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// wire up next button\n\t\t\t\t\tif (isNext) {\n\t\t\t\t\t\t_a[j].onclick = function() {\n\t\t\t\t\t\t\tcontext.next();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// kick things off with an initial update\n\t\tupdate();\n\t}\n\n\tfunction update() {\n\t\t// tweak index if at start or end based on wrap property\n\t\t(index<0)?((wrap)?index=images.length-1:index=0):false;\n\t\t(index>images.length-1)?((wrap)?index=0:index=images.length-1):false;\n\t\t// update the view\n\t\tpreview.setAttribute(\"src\", images[index].getAttribute(\"src\"));\n\t\tcaption.innerHTML = images[index].getAttribute(\"alt\");\n\t\tlink.setAttribute(\"href\", images[index].parentNode.getAttribute(\"href\"));\n\t}\n\t\n\tthis.previous = function () {\n\t\t// select the previous image by index and update the view\n\t index--;update();\n\t}\n\t\n\tthis.next = function () {\n\t\t// select the next image by index and update the view\n\t\tindex++;update();\n\t}\n}", "title": "" }, { "docid": "88109d7ed276bf059c6e2f294b223f29", "score": "0.6209589", "text": "function startSlides() \n{\n\tif(document.getElementById(\"current\") == null) \n {\n startImage(); \n }\n\tif(turnedOn) \n {\n\t\talert(\"Slideshow is on.\");\n\t\treturn;\n\t}\n\tturnedOn = true;\n\ttimelength = setInterval(\"nextSlide()\", 1025);\n}", "title": "" }, { "docid": "48a31c8948343c0f01c9cb434db479ed", "score": "0.61997634", "text": "function goSlide () {\n\n// Update the slide counter based upon the menu item selected\t\n\tslide_count = document.control.gomenu.selectedIndex;\n\t\t\n\tif (slide_count == 0) {\t\n// First menu item resets the show\t\n\t\tsetUp();\t\n\t} else {\t\n// Play the selected slide\t\n\t\tplaySlide(0,0);\n\t}\n}", "title": "" }, { "docid": "7fd3dd78231e3e2aea75170195e6d6c4", "score": "0.61975557", "text": "function advanceSlidePointer(slides) {\n\t\t\tvar nextSlide = (currentSlide + 1 < totalSlides)?currentSlide + 1:0;\n\t\t\t$(slides[currentSlide]).fadeOut('slow',function() { $(slides[nextSlide]).fadeIn('slow'); });\n\t\t\tcurrentSlide = (nextSlide < totalSlides)?nextSlide:0;\n\t\t\tupdateDOM();\n\t\t\tmoveSlide(slides);\n\t\t}", "title": "" }, { "docid": "b53cdf70a40f8824740f4d7fb59cc6b6", "score": "0.61914825", "text": "_showSlide(index){\n this._hideSlides();\n this._slides[index].style.display = \"block\";\n }", "title": "" }, { "docid": "1fc0140a0ce3c2514d37033aea22b953", "score": "0.6181763", "text": "function showSlides(n){\r\n var i;\r\n var slides=document.getElementsByClassName(\"mySlides\");\r\n var dots=document.getElementsByClassName(\"dot\");\r\n if(n>slides.length){slideIndex=1}\r\n if(n<1) {slideIndex=slides.length}\r\n for(i=0;i<slides.length;i++){\r\n slides[i].style.display=\"none\";\r\n }\r\n for(i=0;i<dots.length;i++){\r\n dots[i].className=dots[i].className.replace(\" active\", \"\");\r\n }\r\n slides[slideIndex-1].style.display=\"block\";\r\n dots[slideIndex-1].className+=\" active\";\r\n}", "title": "" }, { "docid": "3de1afcd862e4280f36f47957eb09d0c", "score": "0.6180993", "text": "function clickImage() {\n var buttonId = event.srcElement.id;\n updateSlide(buttonId);\n var foo = slideArr.indexOf(buttonId);\n clearTimeout(timeout);\n slideshow(foo, buttons.length);\n}", "title": "" }, { "docid": "9a3a26e1c50e797ecac99899d2b2d6b1", "score": "0.61745125", "text": "function startSlide() {\n let n;\n const slideAmount = document.getElementsByClassName(\"slideshow\");\n // Nearly same function for imageSlide, although this one uses a timer.\n for ( n = 0; n < slideAmount.length; n++ ) {\n slideAmount[n].style.display = \"none\";\n }\n slideStart++;\n if ( slideStart > slideAmount.length ) {\n slideStart = 1;\n }\n slideAmount[slideStart-1].style.display = \"block\";\n // Keeps adding more items to the array and returns the updated length.\n timeouts.push(setTimeout(startSlide, 2000));\n // Edit the attributes of the button for usability.\n buttonControl.setAttribute(\"onclick\", \"pauseSlide();\");\n buttonControl.textContent = \"pause\";\n console.log(\"Playing the slideshow\");\n}", "title": "" }, { "docid": "b51b62a472949ddc98fd9dc07dd33171", "score": "0.61699975", "text": "function currentSlide(n) {\nshowSlidesCurrent(slideIndexCurrent = n);\n\n}", "title": "" }, { "docid": "c482dd4df2c643c0e585872c32ad4862", "score": "0.61644065", "text": "function showSlides(n) {\n let i;\n\n //Listen er billederne, der er sat ind\n let slides = document.getElementsByClassName(\"mySlides\");\n\n //Loopet er at billederne går i et loop og kommer tilbage til start\n let dots = document.getElementsByClassName(\"dot\");\n if (n > slides.length) {\n slideIndex = 1\n }\n if (n < 1) {\n slideIndex = slides.length\n }\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n slides[slideIndex - 1].style.display = \"block\";\n dots[slideIndex - 1].className += \" active\";\n }", "title": "" }, { "docid": "27cce89551cd496e7abb094b80ff66a7", "score": "0.61544794", "text": "function showSlides2(n) {\n\tvar i;\n\tvar slidesJS2 = document.getElementsByClassName(\"my-slides2\"); //gets all elements with class my-slides\n\n\tif (n > slidesJS2.length) { //overflow & underflow\n\t\tslideIndexJS2 = 1;\n\t}\n\n\tif (n < 1) {\n\t\tslideIndexJS2 = slidesJS2.length;\n\t}\n\n\tfor (i = 0; i < slidesJS2.length; i++) {\n\t\tslidesJS2[i].style.display = \"none\"; //hide all slides at first\n\t}\n\n\tslidesJS2[slideIndexJS2 - 1].style.display = \"block\"; //show the one that is clicked. -1 because js counts from 0\n}", "title": "" }, { "docid": "fd2aa044ac74d523c8e3c6c6d3252013", "score": "0.6153482", "text": "function s_t(){\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(o.auto != 0){\n\t\t\t\t\t\t\t o.circular\t= true;\n\t\t\t\t\t\t\t if (slideshow) clearInterval(slideshow);\n\t\t\t\t\t\t\t slideshow\t= setInterval(function(){\n\t\t\t\t\t\t\t int_c = 1;\n\t\t\t\t\t\t\t\t $pxs_next.trigger('click');\n\t\t\t\t\t\t\t\t int_c = 0;\n\t\t\t\t\t\t\t },o.auto);\n\t\t\t\t\t\t };\n\t\t\t\t\t\t\n\t\t\t\t\t\t}", "title": "" }, { "docid": "5f8b3e4edc128fbec421346250633911", "score": "0.6148878", "text": "function slide(id, wrapper, items, prev, next) {\n\n // dots\n var slides = document.querySelector('#items_' + id).children;\n var totalSlides = slides.length;\n \n var dotsHolder = document.querySelector('.post-slider-dots_' + id);\n dotsHolder.innerHTML=\"\";\n\n for (let i = 0; i < totalSlides; i++) {\n var dotC = document.createElement('div');\n \n dotC.setAttribute(\"data-slide-id\", i);\n dotsHolder.appendChild(dotC);\n if(i){\n dotC.setAttribute(\"class\", \"ps-dot\");\n }else{\n dotC.setAttribute(\"class\", \"ps-dot active_dot\");\n }\n }\n\n // alll\n var posX1 = 0,\n posX2 = 0,\n posInitial,\n posFinal,\n threshold = 100,\n slides = items.getElementsByClassName('slide'),\n slidesLength = slides.length,\n slideSize = items.getElementsByClassName('slide')[0].offsetWidth,\n firstSlide = slides[0],\n lastSlide = slides[slidesLength - 1],\n cloneFirst = firstSlide.cloneNode(true),\n cloneLast = lastSlide.cloneNode(true),\n index = 0,\n allowShift = true;\n\n // Clone first and last slide\n items.appendChild(cloneFirst);\n items.insertBefore(cloneLast, firstSlide);\n wrapper.classList.add('loaded');\n\n // Mouse and Touch events\n items.onmousedown = dragStart;\n\n // Touch events\n items.addEventListener('touchstart', dragStart);\n items.addEventListener('touchend', dragEnd);\n items.addEventListener('touchmove', dragAction);\n\n // Click events\n prev.addEventListener('click', function () {\n shiftSlide(-1)\n });\n next.addEventListener('click', function () {\n shiftSlide(1)\n });\n\n // Transition events\n items.addEventListener('transitionend', checkIndex);\n\n function dragStart(e) {\n e = e || window.event;\n if (screen.width > 1024) {\n e.preventDefault();\n }\n posInitial = items.offsetLeft;\n\n if (e.type == 'touchstart') {\n posX1 = e.touches[0].clientX;\n } else {\n posX1 = e.clientX;\n document.onmouseup = dragEnd;\n document.onmousemove = dragAction;\n }\n }\n\n function dragAction(e) {\n e = e || window.event;\n\n if (e.type == 'touchmove') {\n posX2 = posX1 - e.touches[0].clientX;\n posX1 = e.touches[0].clientX;\n } else {\n posX2 = posX1 - e.clientX;\n posX1 = e.clientX;\n }\n items.style.left = (items.offsetLeft - posX2) + \"px\";\n\n }\n\n function dragEnd(e) {\n posFinal = items.offsetLeft;\n if (posFinal - posInitial < -threshold) {\n shiftSlide(1, 'drag');\n } else if (posFinal - posInitial > threshold) {\n shiftSlide(-1, 'drag');\n } else {\n items.style.left = (posInitial) + \"px\";\n }\n\n document.onmouseup = null;\n document.onmousemove = null;\n }\n\n function remove_active_dots() {\n for (var i = 0; i < totalSlides; i++) {\n document.querySelector('.post-slider-dots_' + id).querySelectorAll('.ps-dot')[i].classList.remove('active_dot');\n }\n }\n \n\n function shiftSlide(dir, action) {\n items.classList.add('shifting');\n\n if (allowShift) {\n if (!action) {\n posInitial = items.offsetLeft;\n }\n\n if (dir == 1) {\n items.style.left = (posInitial - slideSize) + \"px\";\n index++;\n console.log(\"next\" + index);\n remove_active_dots();if(index<totalSlides)\n document.querySelector('.post-slider-dots_' + id).querySelectorAll('.ps-dot')[index].classList.add('active_dot');else{document.querySelector('.post-slider-dots_' + id).querySelectorAll('.ps-dot')[0].classList.add('active_dot')}\n \n\n } else if (dir == -1) {\n \n items.style.left = (posInitial + slideSize) + \"px\";\n index--;\n console.log(\"pri\" + index);\n remove_active_dots();if(index>=0)\n document.querySelector('.post-slider-dots_' + id).querySelectorAll('.ps-dot')[index].classList.add('active_dot');else{\n document.querySelector('.post-slider-dots_' + id).querySelectorAll('.ps-dot')[totalSlides-1].classList.add('active_dot')\n }\n \n }\n };\n\n allowShift = false;\n }\n\n function checkIndex() {\n items.classList.remove('shifting');\n\n if (index == -1) {\n items.style.left = -(slidesLength * slideSize) + \"px\";\n index = slidesLength - 1;\n }\n\n if (index == slidesLength) {\n items.style.left = -(1 * slideSize) + \"px\";\n index = 0;\n }\n\n allowShift = true;\n }\n }", "title": "" }, { "docid": "ebca2a3356c8971ab283e89e5f8e0fd9", "score": "0.6147676", "text": "showSlides(n) {\n let slideIndex = this.state.slideIndex;\n var i;\n var slides = document.getElementsByClassName(\"mySlides\");\n var dots = document.getElementsByClassName(\"demo\");\n if (n > slides.length) {slideIndex = 1}\n if (n < 1) {slideIndex = slides.length}\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n if(slides[slideIndex -1]){\n slides[slideIndex -1].style.display = \"block\";\n }\n\n this.state.slideIndex =slideIndex;\n\n }", "title": "" }, { "docid": "b44b8ee7f1856a428618f3aef7c3b797", "score": "0.61438346", "text": "function slideshow(){\n\t\t\t\n\t\t\tvar slider = $(\"#slider\");\n\n\t\t\tvar prev = $(\"#prev\");\n\n\t\t\tvar next = $(\"#next\");\n\t\t\t\n\t\t\t$('#slider picture:last').insertBefore('#slider picture:first');\n\n\t\t\t\n\t\t\tslider.css('margin-left', '-'+100+'%');\n\n\n\t\t\t\t\t\t\n\t\t\tnext.on('click', function(){\n\n\t\t\t\tmoveRight()\n\n\t\t\t});\n\n\t\t\t\n\t\t\tfunction moveRight(){\n\n\t\t\t\tslider.animate({\n\t\t\t\t\tmarginLeft: '-'+200+'%'},700, function(){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$('#slider picture:first').insertAfter('#slider picture:last');\n\t\t\t\t\t\t\n\t\t\t\t\t\tslider.css('margin-left', '-'+100+'%');\n\n\t\t\t\t\t\t\n\t\t\t\t});\n\t\t\t}\n\n\n\t\t\t\n\t\t\tprev.on('click', function(){\n\n\t\t\t\tmoveLeft()\n\n\t\t\t});\n\n\t\t\t\n\t\t\tfunction moveLeft(){\n\n\t\t\t\tslider.animate({\n\t\t\t\t\tmarginLeft: 0+'%'},700, function(){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$('#slider picture:last').insertBefore('#slider picture:first');\n\t\t\t\t\t\t\n\t\t\t\t\t\tslider.css('margin-left', '-'+100+'%');\n\n\t\t\t\t\t\t\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t\n\t\t\tfunction autoplay(){\n\t\t\t\tinterval = setInterval(function(){\n\t\t\t\t\tmoveRight();\n\t\t\t\t}, 5000)\n\t\t\t}\n\t\t\t\n\t\t\tautoplay();\n\n\t\t\t\n\t\t\tsetTimeout(myFunction, 120000);\n\n\t\t\t\tfunction myFunction(){\n\n\t\t\t\t\tlocation.reload(true);\n\t\t\t\t \n\t\t\t\t}\n\n\n\t\t}", "title": "" }, { "docid": "37a589b1cee5cff1bcfba36d21c2dc2c", "score": "0.6142635", "text": "function prepareSlides(container,opt) {\n\n\t\t\tcontainer.find('.tp-caption').each(function() { $(this).addClass($(this).data('transition')); $(this).addClass('start') });\n\n\t\t\tcontainer.find('>ul:first >li').each(function(j) {\n\t\t\t\tvar li=$(this);\n\t\t\t\tif (li.data('link')!=undefined) {\n\t\t\t\t\tvar link = li.data('link');\n\t\t\t\t\tvar target=\"_self\";\n\t\t\t\t\tvar zindex=2;\n\t\t\t\t\tif (li.data('slideindex')==\"back\") zindex=0;\n\n\t\t\t\t\tvar linktoslide=li.data('linktoslide');\n\t\t\t\t\tif (li.data('target')!=undefined) target=li.data('target');\n\n\t\t\t\t\tif (link==\"slide\") {\n\t\t\t\t\t\tli.append('<div class=\"tp-caption sft slidelink\" style=\"z-index:'+zindex+';\" data-x=\"0\" data-y=\"0\" data-linktoslide=\"'+linktoslide+'\" data-start=\"0\"><a><div></div></a></div>');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlinktoslide=\"no\";\n\t\t\t\t\t\tli.append('<div class=\"tp-caption sft slidelink\" style=\"z-index:'+zindex+';\" data-x=\"0\" data-y=\"0\" data-linktoslide=\"'+linktoslide+'\" data-start=\"0\"><a target=\"'+target+'\" href=\"'+link+'\"><div></div></a></div>');\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tcontainer.find('>ul:first >li >img').each(function(j) {\n\n\t\t\t\tvar img=$(this);\n\t\t\t\timg.addClass('defaultimg');\n\t\t\t\tsetSize(img,opt);\n\t\t\t\tsetSize(img,opt);\n\t\t\t\timg.wrap('<div class=\"slotholder\"></div>');\n\t\t\t\timg.css({'opacity':0});\n\t\t\t\timg.data('li-id',j);\n\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "6b14ef2ecdff6d2fdcec4a706507fafb", "score": "0.6124086", "text": "function loadSlideshows() {\n renderImage(\"slideshow\");\n renderImage(\"london\");\n renderImage(\"paris\");\n renderImage(\"zoo\");\n renderImage(\"japan\");\n renderImage(\"purdue\");\n renderImage(\"chicago\");\n slideshowShowing = setInterval(renderImage, 8000, \"slideshow\");\n londonShowing = setInterval(renderImage, 8000, \"london\");\n parisShowing = setInterval(renderImage, 8000, \"paris\");\n zooShowing = setInterval(renderImage, 8000, \"zoo\");\n japanShowing = setInterval(renderImage, 8000, \"japan\");\n purdueShowing = setInterval(renderImage, 8000, \"purdue\");\n chicagoShowing = setInterval(renderImage, 8000, \"chicago\");\n}", "title": "" }, { "docid": "88bebd23d4cc094ec4321894a57fdbb1", "score": "0.6112622", "text": "function updateSlideshow() {\n \n if (slideIndex >= slides.length)\n slideIndex = 0;\n \n if (slideIndex < 0)\n slideIndex = slides.length - 1;\n \n for (var i = 0; i < slides.length; i++) {\n if(i === slideIndex) {\n slides[i].classList.remove(\"slideshow__img--hidden\");\n pages[i].classList.add(\"circlet--filled\");\n }\n else {\n slides[i].classList.add(\"slideshow__img--hidden\");\n pages[i].classList.remove(\"circlet--filled\");\n }\n }\n}", "title": "" }, { "docid": "1f822ecc8aeb8392354299873ab8fd90", "score": "0.61106443", "text": "function advanceSlides() {\n currentSlide < images.length - 1 ? currentSlide++ : (currentSlide = 0);\n let filename = images[currentSlide];\n img.src = filename.url;\n}", "title": "" }, { "docid": "5765e5ecbf2a0b84d3496a6985f0cb20", "score": "0.60990804", "text": "function showIndexSlides() {\n let z = 0;\n let slides = document.getElementsByClassName(\"indexSlideImg\");\n for (z = 0; z < slides.length; z++) {\n slides[z].style.display = \"none\";\n }\n slideIndex++;\n if (slideIndex > slides.length) {\n slideIndex = 1;\n }\n slides[slideIndex - 1].style.display = \"block\";\n setTimeout(showIndexSlides, 5000); // Change image every 5 seconds\n}", "title": "" }, { "docid": "2310cafc74883971ca6e476b425ed1b6", "score": "0.6088528", "text": "function carousel() { //this is when you put stuff into the room\n let i; //how come i is left undefined? It's undefined so we can use the same variable again multiple areas\n let x = document.getElementsByClassName(\"slides\");\n for (i = 0; i < x.length; i++) {\n x[i].style.display = \"none\";\n }\n slideIndex++;\n if (slideIndex > x.length) { slideIndex = 1 }\n x[slideIndex - 1].style.display = \"block\";\n setTimeout(carousel, 3000); // Changes image every 3 seconds\n}", "title": "" }, { "docid": "e0eb2ba9d7707c13812070985acd7319", "score": "0.6087228", "text": "function determineSlide() {\n\t// hide previously displayed slide and deselect nav button\n\tslides[previousSlideIndex].style.display = 'none';\n\t// display selected slide and select nav button\n\tslides[currentIndex].style.display = 'block';\n} // end determineSlide()", "title": "" }, { "docid": "f7b0956feabaa7a5e53446ffd2443e44", "score": "0.6087078", "text": "function ShowSlide (n) {\n //get the images for the slide by class name\n var slds = document.getElementsByClassName(\"slides\");\n //check to see if the next index is valid\n if(n > slds.length)\n {\n sldindex = 1;\n } else if(n < 1) {\n sldindex = slds.length;\n }\n //loop through the slides and turn them off\n for(var i = 0; i < slds.length; i++)\n {\n slds[i].style.display = \"none\";\n }\n //turn on the image to be shown\n slds[sldindex-1].style.display = \"block\";\n //update the text\n NewsText();\n}", "title": "" }, { "docid": "8e8bdfe1d0a5bb5311c6925c27e91115", "score": "0.607658", "text": "function slidesPlay () {\n $(slideContent + ':first')\n .fadeOut(1000)\n .removeClass('on')\n .next()\n .fadeIn(1000)\n .addClass(\"on\")\n .end()\n .appendTo('#slider');\n }", "title": "" }, { "docid": "8fdabc0a85143330c26e7023b40e7f80", "score": "0.6075365", "text": "function initClickEvent($slides){\n var numSlides = $slides.children().length;\n var $slide = $($slides.children()[numSlides-2]);\n\n $slide.click(function(e){\n $(this).off();\n $nextArrow.trigger(\"click\");\n });\n }", "title": "" }, { "docid": "e496ab8ffdee3ce2a61c306aab911951", "score": "0.60724014", "text": "function plusSlides() {\n showSlides(slideIndex += 1);\n}", "title": "" }, { "docid": "e7670e25d8480ffbbdaf7be99a28cd13", "score": "0.6070061", "text": "function autoSlide(){\n // tinh vi tri slide\n let slidePos = 0;\n let activePos = document.querySelector('.showSlide');\n for (slidePos = 0; activePos = activePos.previousElementSibling; slidePos++){};\n\n //cho slide tiep theo hien len\n if (slidePos < (slide.length-1)){\n //cho an het slide di\n for (let i = 0; i < slide.length; i++){\n slide[i].classList.remove('showSlide');\n nextSlide[i].classList.remove('active');\n };\n\n //cho slide tiep theo hien ra \n slide[slidePos].nextElementSibling.classList.add('showSlide');\n nextSlide[slidePos].nextElementSibling.classList.add('active');\n }\n else {\n //cho an het slide di\n for (let i = 0; i < slide.length; i++){\n slide[i].classList.remove('showSlide');\n nextSlide[i].classList.remove('active');\n };\n\n //cho slide dau tien hien ra \n slide[0].classList.add('showSlide');\n nextSlide[0].classList.add('active');\n }\n}", "title": "" }, { "docid": "406024d545deb4dfda928c95f6471c10", "score": "0.60675097", "text": "function fnStartSlideshow(){\r\n if(!flgStartSlideShow ){\r\n return;\r\n }\r\n amountOfPics = (arrPicture_L.length -1); //zaehlt von 0 an\r\n window.moveTo(0,0);\r\n objAudio.pause();\r\n\r\n if (!window.DeviceOrientationEvent) {\r\n alert(\"Sorry, aber Dein Handy ist leider nicht für diese Wiedergabe geegnet. Schade!\")\r\n return;\r\n }\r\n // beim Drehen von Portrait <=> Landscape: SOFORT neu zentrieren\r\n $('#body').css('background','black');\r\n\r\n //Beim ersten Durchlauf mit erstem Bild anfangen!\r\n winkel = 0;\r\n winkelAtAudioLoadingStarted = 0;\r\n winkelAtAudioLoadingEnded = 0;\r\n\r\n fnSelectPicSources();\r\n fnShiftPics();\r\n fnCenterSlideShow();\r\n\r\n if (flgStopAndGo){\r\n fnStopAndGo();\r\n }\r\n // window.addEventListener('deviceorientation', getDeviceOrientation);\r\n }", "title": "" }, { "docid": "d67e4eb8a653e3c3ddc2320db5da2b89", "score": "0.6064091", "text": "function ASlide(slideData, {plugins = [], slideContainer = document.body} = {}) {\n\n\tlet noEvents = 0;\n\n\tconst setupSlide = function setupSlide(slideId) {\n\n\t\tlocation.hash = slideId;\n\n\t\tslideContainer.fire('a-slides_slide-setup', {slideId});\n\n\t\tif (slideData[slideId]) {\n\t\t\tslideData[slideId].setup.bind(slideContainer.$(slideSelector(slideId)))();\n\t\t} else {\n\t\t\tslideData[slideId] = {\n\t\t\t\tsetup() {},\n\t\t\t\taction: function* (){yield},\n\t\t\t\tteardown() {}\n\t\t\t};\n\t\t}\n\n\t\tthis.currentEvents = slideData[slideId].action.bind(slideContainer.$(slideSelector(slideId)))();\n\t\tnoEvents = 0;\n\n\t\t// if a go to new slide is already triggered then cancel it so\n\t\t// we don't accidentially go to the wrong slide.\n\t\tclearTimeout(this.nextSlideTimeOut);\n\n\t\t// Do first action\n\t\tthis.currentEvents.next();\n\t}.bind(this);\n\n\tfunction teardownSlide(slideId) {\n\n\t\tslideContainer.fire('a-slides_slide-teardown', {slideId});\n\t\tif (slideData[slideId]) {\n\t\t\tslideData[slideId].teardown.bind(slideContainer.$(slideSelector(slideId)))();\n\t\t}\n\t}\n\n\t// Slide is a dom element or an integer\n\tfunction goToSlide({slide}) {\n\t\tconst newSlide = typeof slide === 'number' ? $$('.a-slides_slide')[slide] : slide;\n\t\tif (!newSlide) return;\n\t\tconst newSlideId = newSlide.dataset.slideId;\n\t\tconst oldSlide = $('.a-slides_slide.active');\n\t\tif (newSlide && newSlide !== oldSlide) {\n\t\t\tif (oldSlide) {\n\t\t\t\toldSlide.classList.remove('active');\n\t\t\t\toldSlide.once('transitionend', () => teardownSlide(oldSlide.dataset.slideId));\n\t\t\t}\n\t\t\tnewSlide.off('transitionend');\n\t\t\tnewSlide.classList.add('active');\n\t\t\tteardownSlide(newSlideId);\n\t\t\tsetupSlide(newSlideId);\n\t\t}\n\t}\n\n\tfunction goToNextSlide() {\n\t\tgoToSlide({slide: $('.a-slides_slide.active').prevAll().length + 1});\n\t}\n\n\tconst goToPrevSlide = () => {\n\n\t\tif (noEvents) {\n\t\t\tslideContainer.fire('a-slides_refresh-slide');\n\t\t\treturn;\n\t\t}\n\n\t\t// Wait a smidge before changing slides.\n\t\tslideContainer.nextSlideTimeOut = setTimeout(() => goToSlide({slide: $('.a-slides_slide.active').prevAll().length - 1}), 10);\n\t};\n\n\tthis.currentEvents = {\n\t\tnext() {\n\t\t\treturn {done: false};\n\t\t}\n\t};\n\n\t// e.g. click presses next etc etc\n\tslideContainer.on('a-slides_trigger-event', function () {\n\t\tnoEvents++;\n\t\tif (this.currentEvents.next().done) {\n\n\t\t\t// Wait a smidge before triggering the next slide.\n\t\t\tthis.nextSlideTimeOut = setTimeout(goToNextSlide, 10);\n\t\t}\n\t}.bind(this));\n\n\tfunction refreshSlide() {\n\t\tconst id = $('.a-slides_slide.active').dataset.slideId;\n\t\tteardownSlide(id);\n\t\tsetupSlide(id);\n\t}\n\n\tslideContainer.on('a-slides_refresh-slide', () => refreshSlide());\n\tslideContainer.on('a-slides_next-slide', () => goToNextSlide());\n\tslideContainer.on('a-slides_previous-slide', () => goToPrevSlide());\n\tslideContainer.on('a-slides_goto-slide', e => goToSlide(e.detail));\n\n\tslideContainer.on('scroll', () => slideContainer.scrollLeft = 0);\n\n\tplugins.forEach(plugin => {\n\t\tif (typeof plugin === 'function') {\n\t\t\tplugin({\n\t\t\t\tslideData,\n\t\t\t\tslideContainer\n\t\t\t});\n\t\t}\n\t});\n\n}", "title": "" }, { "docid": "5195748ec58b8c3c5ed360f49b45492a", "score": "0.60613906", "text": "function showSlides(n) {\n //getting an element\n var i;\n var slides = document.getElementsByClassName(\"mySlides\");\n var dots = document.getElementsByClassName(\"dot\");\n\n /* slides.length count the number of appearance of class \n mySlides. In this case slides.length = 3 \n also dot.length = 3\n try out this page to understand more: \n https://www.w3schools.com/jsref/prop_nodelist_length.asp\n */\n\n // if n > 3 then slideIndex goes back to 1\n if (n > slides.length) {slideIndex = 1} \n // if slideIndex < 3, default slideIndex to 3 \n if (n < 1) {slideIndex = slides.length}\n\n // remove display for all slides\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\"; \n }\n // styling for all dots\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n\n // show the responding display for image and dots\n slides[slideIndex-1].style.display = \"block\"; \n dots[slideIndex-1].className += \" active\";\n}", "title": "" }, { "docid": "d1a2a8bfcd2ce3964417a195ebe130fa", "score": "0.6061374", "text": "function minus_slide(e){\n e ? e.preventDefault() : \"\";\n if(cnt == 0){\n cnt=slides.length-(num_of_slides-1);\n for(let i=0; i<slides.length-num_of_slides; ++i){\n slides[i].style.display = \"none\";\n }\n }\n cnt=cnt-1;\n slides[cnt].style.display = \"block\";\n }", "title": "" }, { "docid": "44f96c2042a1b13e0087cc743f406a33", "score": "0.6054361", "text": "function carousel() {\n let i;\n let x = document.getElementsByClassName(\"mySlides\");\n for (i = 0; i < x.length; i++) {\n x[i].style.display = \"none\";\n }\n myIndex++;\n if (myIndex > x.length) {myIndex = 1}\n x[myIndex-1].style.display = \"block\";\n //this is what determines that duration that each image would be displayed\n setTimeout(carousel, 3000);\n }", "title": "" }, { "docid": "a38517c7dbe54c7651cca511990aadc6", "score": "0.60524404", "text": "function attractSlide(){\n $('.attract').click(function() {\n $(this).slideUp();\n $('.load').addClass('appear');\n });\n\n //set timer for slideshow\n setTimeout(function() {\n loadImgs()\n }, 2000);\n }", "title": "" }, { "docid": "d52ca61e5004f2292a21b6f9b9984051", "score": "0.60518706", "text": "function showPreview(slideName) {\n centerSlide(slideName);\n if (slideName.indexOf('selected') != -1) {\n return false;\n }\n droid(slideName); // do this function when slide is clicked\n}", "title": "" }, { "docid": "1e4cbbf638f77366db4028cd35d8647c", "score": "0.6050411", "text": "function initializeSlideshow(){\n $('#slides').slidesjs({\n width: 940,\n height: 528\n });\n}", "title": "" }, { "docid": "a2800e0a23e70e977eb3eec939858906", "score": "0.6039942", "text": "function slideshowClicked(e) {\n var $this = $(e.currentTarget);\n\n showNextImage($this);\n }", "title": "" }, { "docid": "4c1b072fa1900c8cfba7b82c56290f95", "score": "0.60344774", "text": "function changeSlides(n) {\n showCurrent(slideIndex += n);\n}", "title": "" }, { "docid": "99720e168bf00968cb2a6c13d4b8ed32", "score": "0.6033691", "text": "function onAfter() { \n \n \n if(deadSlides.length){\n \n // Stop previous slide show\n $('#slideshow').cycle('stop');\n \n for(i=0; i < deadSlides.length; i++){\n \n var elem = deadSlides[i];\n deadSlides.splice(i, 1);\n elem.remove();\n }\n \n deadSlides = [];\n \n $('#slideshow').cycle({\n fx: 'scrollLeft',\n speed: 2000, \n timeout: 5000,\n pause: 1,\n after: onAfter \n });\n }\n }", "title": "" }, { "docid": "a68d5d0d9271e672d138fdb2c235d422", "score": "0.60318905", "text": "function loaded(fct){ \r\n\tslideIndex.push(1);\r\nslideId.push(\"mySlides fade\"+fct);\r\nshowSlides(1,ind);\r\nind++;\r\n}", "title": "" }, { "docid": "38569839900543f864a8a4a2c3284bd4", "score": "0.6028204", "text": "function showSlides(n) {\r\n var i;\r\n var slides = document.getElementsByClassName(\"mySlides\");\r\n var dots = document.getElementsByClassName(\"dot\");\r\n if (n > slides.length) {slideIndex = 1}\r\n if (n < 1) {slideIndex = slides.length}\r\n for (i = 0; i < slides.length; i++) {\r\n slides[i].style.display = \"none\";\r\n }\r\n for (i = 0; i < dots.length; i++) {\r\n dots[i].className = dots[i].className.replace(\" active\", \"\");\r\n }\r\n slides[slideIndex-1].style.display = \"block\";\r\n dots[slideIndex-1].className += \" active\";\r\n}", "title": "" }, { "docid": "b0c05e326c148587d1d6f7fc00682148", "score": "0.6020423", "text": "function showSlides13(f) {\n var c;\n var slides5 = document.getElementsByClassName(\"mySlides13Fade13\");\n var dots5 = document.getElementsByClassName(\"dot13\");\n if (f > slides5.length) {slideIndex5 = 1}\n if (f < 1) {slideIndex5 = slides5.length}\n for (c = 0; c < slides5.length; c++) {\n slides5[c].style.display = \"none\";\n }\n for (c = 0; c < dots5.length; c++) {\n dots5[c].className = dots5[c].className.replace(\" active\", \"\");\n }\n slides5[slideIndex5-1].style.display = \"block\";\n dots5[slideIndex5-1].className += \" active\";\n }", "title": "" }, { "docid": "24f0a8b4abfed7a7a1b9cc723664ba75", "score": "0.6011867", "text": "function showSlides14(f) {\n var c;\n var slides5 = document.getElementsByClassName(\"mySlides14Fade14\");\n var dots5 = document.getElementsByClassName(\"dot14\");\n if (f > slides5.length) {slideIndex5 = 1}\n if (f < 1) {slideIndex5 = slides5.length}\n for (c = 0; c < slides5.length; c++) {\n slides5[c].style.display = \"none\";\n }\n for (c = 0; c < dots5.length; c++) {\n dots5[c].className = dots5[c].className.replace(\" active\", \"\");\n }\n slides5[slideIndex5-1].style.display = \"block\";\n dots5[slideIndex5-1].className += \" active\";\n }", "title": "" }, { "docid": "a750dd79a5d8cd27bd61c5a24dd39e2a", "score": "0.60062146", "text": "function showSlide() {\n hideAllSlides();\n slideshowImages[currentSlide].classList.remove(\"hideSlide\");\n}", "title": "" }, { "docid": "92bc22cdd405562b2dd85fc968e1004b", "score": "0.60032535", "text": "function neirongyingyongslideLeft(){\r\n neirongyingyongpos--;\r\n if(neirongyingyongpos==-1){ neirongyingyongpos = neirongyingyongtotalSlides-1; }\r\n $('#neirongyingyong-wrap ul#yingyongslider').css('left', -(neirongyingrongsliderWidth*neirongyingyongpos));\r\n\r\n //*> optional\r\n neirongyingyongcountSlides();\r\n neirongyingyongextra();\r\n}", "title": "" }, { "docid": "988c6664484c2b0353d48619995f09de", "score": "0.60005796", "text": "function showSlide(name) {\n\trefSlide(name).visibility = showName;\n\t}", "title": "" }, { "docid": "c42b7be720e0738979b08620c65a4565", "score": "0.5997311", "text": "function main(){\n startSlideShowAnimation();\n}", "title": "" }, { "docid": "031a0095a397bd07877bb0de16bf5050", "score": "0.5995057", "text": "function showSlides(n) {\n var i;\n var slides = document.getElementsByClassName(\"mySlides\");\n var dots = document.getElementsByClassName(\"dot\");\n if (n > slides.length) {slideIndex = 1} \n if (n < 1) {slideIndex = slides.length}\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\"; \n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n slides[slideIndex-1].style.display = \"block\"; \n dots[slideIndex-1].className += \" active\";\n}", "title": "" }, { "docid": "a43fb5457e3ae78bbe077bd1ce5eb662", "score": "0.5990578", "text": "function carousel() {\n var i;\n var x = document.getElementsByClassName(\"slide-show\");\n for (i = 0; i < x.length; i++) {\n x[i].style.display = \"none\";\n }\n img_index++;\n if (img_index > x.length) { img_index = 1 }\n x[img_index - 1].style.display = \"block\";\n setTimeout(carousel, 2500); // Change image every 4 seconds\n}", "title": "" }, { "docid": "79532bd8420e518961bed40b278156fe", "score": "0.5986901", "text": "function slideshow(startPosition)\n{\n\tstopSlideshow();\n\tstartPosition = typeof startPosition !== 'undefined' ? startPosition : 0;\n\tfor (i=0; i < numSlides; i++)\n\t{\n\t\tindex = ((i + startPosition) % numSlides) + 1;\n\t\tstart = i * (slideDuration * 2 + slideDelay);\n\t\tstop = start + slideDuration + slideDelay;\n\t\tslideTimeouts.push(setTimeout(\"$('#slide\"+index+\"').fadeIn(\"+slideDuration+\");\", start));\n\t\tslideTimeouts.push(setTimeout(\"$('#slide\"+index+\"').fadeOut(\"+slideDuration+\");\", stop));\n\t}\n\tslideTimeouts.push(setTimeout(\"slideshow(\"+startPosition+\");\", numSlides * (slideDuration * 2 + slideDelay)));\n}", "title": "" }, { "docid": "d9150c28fd771d95bd85b79d057a5ab9", "score": "0.5986179", "text": "function slideClick (wDirection) {\n\tslide_count = slide_count + wDirection;\n\tif (slide_count < 0 ) {\n\t\tslide_count = 0;\n\t} else {\n\t\tplaySlide(0,0);\n\t}\n}", "title": "" }, { "docid": "a25282de8e5f58b459f9f6860fd2a3ec", "score": "0.59841317", "text": "function showSlides8(f) {\n var c;\n var slides5 = document.getElementsByClassName(\"mySlides8Fade8\");\n var dots5 = document.getElementsByClassName(\"dot9\");\n if (f > slides5.length) {slideIndex5 = 1}\n if (f < 1) {slideIndex5 = slides5.length}\n for (c = 0; c < slides5.length; c++) {\n slides5[c].style.display = \"none\";\n }\n for (c = 0; c < dots5.length; c++) {\n dots5[c].className = dots5[c].className.replace(\" active\", \"\");\n }\n slides5[slideIndex5-1].style.display = \"block\";\n dots5[slideIndex5-1].className += \" active\";\n }", "title": "" }, { "docid": "c018d82679f3a39253f62fe4c5ac61e4", "score": "0.5982756", "text": "function newSlide()\n{\n\tvar slides = document.querySelectorAll('.slide');\n\tvar slideIndex = slides.length - 1;\n\tfor(i =0; i < slides.length; i++)\n\t{\n\t\tslides[i].style.display =\"none\";\n\t}\n\tslides[slideIndex].style.display = \"block\"; \n\t\n}", "title": "" }, { "docid": "433103179e0f7bca08c1e9fffa2ee58e", "score": "0.5982262", "text": "function showSlides(n) {\n var slides = document.getElementsByClassName(\"mySlides\");\n var dots = document.getElementsByClassName(\"dot\");\n if (n > slides.length) {\n slideIndex = 1\n }\n if (n < 1) {\n slideIndex = slides.length\n }\n for (var i = 0; i < slides.length; i++) {\n //hide and show elements without deleting and recreating them\n slides[i].style.display = \"none\";\n }\n for (var i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n slides[slideIndex - 1].style.display = \"block\";\n // log('current image label', imgLabel)\n dots[slideIndex - 1].className += \" active\";\n }", "title": "" }, { "docid": "7065e9bf304d35184cc591fd8a0ffecb", "score": "0.59788835", "text": "function showSlides(n) {\n var i;\n var slides = document.getElementsByClassName(\"mySlides\");\n var dots = document.getElementsByClassName(\"dot\");\n if (n > slides.length) {slideIndex = 1}\n if (n < 1) {slideIndex = slides.length}\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n slides[slideIndex-1].style.display = \"block\";\n dots[slideIndex-1].className += \" active\";\n}", "title": "" }, { "docid": "562995a60e6386a47828f83ae5ec3c27", "score": "0.5971427", "text": "displayShow() {\n for (var i = 0; i < this.slides.length; i++) {\n this.slides[i].style.display = \"none\";\n };\n this.slides[this.index].style.display = \"block\";\n }", "title": "" }, { "docid": "5e5a6aa53f18c5cfc913036839a6a142", "score": "0.59710264", "text": "function cancelAutoSlide() {\n\n\t\tclearTimeout( autoSlideTimeout );\n\n\t}", "title": "" }, { "docid": "4e5932e075c8aad35b1feaed3c5b4634", "score": "0.5966913", "text": "function showSlides(n) {\n var i;\n var slides = document.getElementsByClassName(\"mySlides\");\n var dots = document.getElementsByClassName(\"dot\");\n if (n > slides.length) {slideIndex = 1}\n if (n < 1) {slideIndex = slides.length}\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n\n slides[slideIndex-1].style.display = \"block\";\n dots[slide-1].className += \" active\";\n}", "title": "" } ]
309647559adc7e2fac30627bc4d920b1
Called upon transport error
[ { "docid": "a9901aff7d4eb6ed25988756fad16b76", "score": "0.6620743", "text": "onError(err) {\n\t debug$3(\"socket error %j\", err);\n\t Socket.priorWebsocketSuccess = false;\n\t this.emit(\"error\", err);\n\t this.onClose(\"transport error\", err);\n\t }", "title": "" } ]
[ { "docid": "611bf1c780af91782f0433b7ade87e14", "score": "0.83291566", "text": "function transportError(err) {\n self.emit('error', err, self.transport);\n }", "title": "" }, { "docid": "adbcdc075bd2fe2373d8089213e09651", "score": "0.81600857", "text": "function transportError(err) {\n this.emit('error', err, this.transport);\n }", "title": "" }, { "docid": "adbcdc075bd2fe2373d8089213e09651", "score": "0.81600857", "text": "function transportError(err) {\n this.emit('error', err, this.transport);\n }", "title": "" }, { "docid": "7fe2dc060fceee6a752d7e381c9eb75c", "score": "0.78072804", "text": "onTransportError() {\n if (this.status === UAStatus.STATUS_USER_CLOSED) {\n return;\n }\n if (!this.error || this.error !== UA.C.NETWORK_ERROR) {\n this.status = UAStatus.STATUS_NOT_READY;\n this.error = UA.C.NETWORK_ERROR;\n }\n }", "title": "" }, { "docid": "d371dc55b74951d9e800f7383bd0ff3e", "score": "0.7309913", "text": "onTransportError(error) {\n if (this.user.onTransportError) {\n this.user.onTransportError(error);\n }\n this.stateTransition(TransactionState.Terminated, true);\n }", "title": "" }, { "docid": "ce7c8c16e3fd1178fab741a1a25ab9be", "score": "0.6897514", "text": "function dataError(error) {\n e(error.status + ', ' + u + ' ' + error.statusText);\n }", "title": "" }, { "docid": "55ec599a3e579d91b11c4b1b67d74fd1", "score": "0.6867015", "text": "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\t\n\t freezeTransport();\n\t\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\t\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "55ec599a3e579d91b11c4b1b67d74fd1", "score": "0.6867015", "text": "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\t\n\t freezeTransport();\n\t\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\t\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "f95f33a8af42f4f163489e23c4778049", "score": "0.68166274", "text": "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "f95f33a8af42f4f163489e23c4778049", "score": "0.68166274", "text": "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "f95f33a8af42f4f163489e23c4778049", "score": "0.68166274", "text": "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "f95f33a8af42f4f163489e23c4778049", "score": "0.68166274", "text": "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "4426766b30908dc238526b3fda7d2dc3", "score": "0.68125826", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "42e7a05363a9a92562cf455293236c4b", "score": "0.68098766", "text": "function onerror (err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\t\n\t freezeTransport();\n\t\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\t\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "42e7a05363a9a92562cf455293236c4b", "score": "0.68098766", "text": "function onerror (err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\t\n\t freezeTransport();\n\t\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\t\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "42e7a05363a9a92562cf455293236c4b", "score": "0.68098766", "text": "function onerror (err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\t\n\t freezeTransport();\n\t\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\t\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "aa6729f6af3f57a1447a7e321bd3bd00", "score": "0.6764993", "text": "function onerror (err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "aa6729f6af3f57a1447a7e321bd3bd00", "score": "0.6764993", "text": "function onerror (err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "aa6729f6af3f57a1447a7e321bd3bd00", "score": "0.6764993", "text": "function onerror (err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "title": "" }, { "docid": "5e68963e5f4813d63612759d240e4049", "score": "0.67468596", "text": "onError(err) {\n debug(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emit(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "title": "" }, { "docid": "5e68963e5f4813d63612759d240e4049", "score": "0.67468596", "text": "onError(err) {\n debug(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emit(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "title": "" }, { "docid": "aa08217b5db2d51a3309241fe9d81560", "score": "0.67410475", "text": "function on_fail(msg) {\n Action.add(\"Transmission failed\", msg, 'fail')\n throw new Error(\"Transmission failed.\")\n}", "title": "" }, { "docid": "8d903245715af4c2c3d336c3aa647ade", "score": "0.6679868", "text": "function onerror(err) {\n\t const error = new Error(\"probe error: \" + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug$3('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit(\"upgradeError\", error);\n\t }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "9c3189c79bd1b7f0351f04746355d7dd", "score": "0.66546696", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "f0cee8ffddca376a0fbb13a3b88a1891", "score": "0.66494274", "text": "_receiveError (err) {\n this._log.error('ReceiveError: %s', err.message)\n }", "title": "" }, { "docid": "f0cee8ffddca376a0fbb13a3b88a1891", "score": "0.66494274", "text": "_receiveError (err) {\n this._log.error('ReceiveError: %s', err.message)\n }", "title": "" }, { "docid": "f0cee8ffddca376a0fbb13a3b88a1891", "score": "0.66494274", "text": "_receiveError (err) {\n this._log.error('ReceiveError: %s', err.message)\n }", "title": "" }, { "docid": "bce1485b63866d2c54d5efad2ea6d93a", "score": "0.6633754", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport$$1.name;\n\n freezeTransport();\n\n debug$7('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "bd90d435b9ac12fddcabf1fcfbddd90a", "score": "0.6630722", "text": "_sendError () {\n this.disconnect();\n this._runtime.emit(this._runtime.constructor.PERIPHERAL_ERROR);\n }", "title": "" }, { "docid": "2cf390a1f8804f172573456fa387d936", "score": "0.66201484", "text": "function onerror(err) {\n const error = new Error(\"probe error: \" + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit(\"upgradeError\", error);\n }", "title": "" }, { "docid": "2cf390a1f8804f172573456fa387d936", "score": "0.66201484", "text": "function onerror(err) {\n const error = new Error(\"probe error: \" + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit(\"upgradeError\", error);\n }", "title": "" }, { "docid": "77b43a516a6194a244aba30c4a0f0366", "score": "0.66161615", "text": "function handleError(errorDetail) {\r\n log.warn(LOG_AREA, 'Transport error', errorDetail);\r\n if (\r\n errorDetail &&\r\n errorDetail.source &&\r\n errorDetail.source.status === 401\r\n ) {\r\n this.unauthorizedCallback();\r\n }\r\n}", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "80fbed243206f3f156bd75daca85f3a1", "score": "0.6612209", "text": "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "09ad515d37d5c324e1388862211c1b23", "score": "0.6585014", "text": "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport$$1.name;\n\n freezeTransport();\n\n debug$4('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "title": "" }, { "docid": "30c9adba1566c7a54801c5617c7d9e9d", "score": "0.6580524", "text": "abort if ( !transport ) { done( -1, \"No Transport\" ); }", "title": "" }, { "docid": "172a2c4e3e5d2aae107601edebb4cf05", "score": "0.6560627", "text": "_receiveError (err) {\n log.error('ReceiveError: %s', err.message)\n }", "title": "" }, { "docid": "172a2c4e3e5d2aae107601edebb4cf05", "score": "0.6560627", "text": "_receiveError (err) {\n log.error('ReceiveError: %s', err.message)\n }", "title": "" }, { "docid": "0e1a52b4e34d28910f4af183ba4e2684", "score": "0.652253", "text": "_emitErrored() {\n /**\n * @event BSClientSocket#E_SOCKET_ERROR\n * @type {Object}\n */\n this.emit(this.constructor.E_SOCKET_ERROR, {});\n }", "title": "" }, { "docid": "d71ecc43d51c00b81e510d3869598872", "score": "0.6522428", "text": "socketError(err) {\n debug('socket error', err.message);\n this.emit('error', err);\n this.disconnect();\n }", "title": "" } ]
789d47df829a2f0e71570d115e58e4a4
Input arrays of corresponding tags, xyz coordinates as Array(3) objects, and DFT amplitudes (optional).
[ { "docid": "c1f4f6c48858af8c20e301932da8ff3a", "score": "0.4632642", "text": "newAtlas(tags=[\"Fp1\",\"Fp2\"], coords = [[-21.5, 70.2,-0.1],[28.4,69.1,-0.4]],times=undefined,amplitudes=undefined,slices=null, means=null){\n\t\tvar newLayout = {shared: {sps: this.sps, bandPassWindows:[]}, map:[]}\n\t\ttags.forEach((tag,i) => {\n\t\t\tif (amplitudes === undefined) {\n\t\t\t\tnewLayout.map.push({tag: tag, data: this.newAtlasData(coords[i][0],coords[i][1],coords[i][2],counts[i],undefined,undefined,undefined,undefined)});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLayout.map.push({tag: tag, data: this.newAtlasData(coords[i][0],coords[i][1],coords[i][2],counts[i],times[i],amplitudes[i],slices[i],means[i])});\n\t\t\t}\n\t\t});\n\t\treturn newLayout;\n\t}", "title": "" } ]
[ { "docid": "049eccc4c60adf2d95f5d0b6ffdf2cb6", "score": "0.49599707", "text": "function buildQueryTags(data) {\n var collageLength = 31;\n var qT = new Array();\n var depreciation = .5;\n var temp;\n\n for (var i=0; i<collageLength; i++) {\n qT = [data[0][0], data[1][0], data[2][0]];\n images[i].tags = qT;\n\n data[0][1] = data[0][1] * depreciation;\n data[1][1] = data[1][1] * depreciation;\n data[2][1] = data[2][1] * depreciation;\n\n for (var j=0; j<collageLength; j++) {\n for (var k=0; k<collageLength; k++) {\n if (data[j][1] > data[k][1]) {\n temp = data[j];\n data[j] = data[k];\n data[k] = temp;\n }//end if\n }//end k loop\n }//end j loop\n\n }//end i loop\n\n}", "title": "" }, { "docid": "81cd7d4775d40cb4e53523d7052fb353", "score": "0.49474782", "text": "function parseData(input){\n trackPoints = [];\n var numbers = input.split(/\\s+/);\n for(var i = 0; i < numbers.length; i+= 3){\n trackPoints.push(vec4(parseFloat(numbers[i]), parseFloat(numbers[i+1]), parseFloat(numbers[i+2]), 1));\n trackPoints.push(vec4(0,0,0,1));\n }\n trackBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, trackBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, flatten(trackPoints), gl.STATIC_DRAW);\n\n vPosition = gl.getAttribLocation(program, \"vPosition\");\n gl.vertexAttribPointer(vPosition, 4, gl.FLOAT, false, 32, 0);\n gl.enableVertexAttribArray(vPosition);\n\n vColor = gl.getAttribLocation(program, \"vColor\");\n gl.vertexAttribPointer(vColor, 4, gl.FLOAT, false, 32, 16);\n gl.enableVertexAttribArray(vColor);\n\n fileChosen = true;\n}", "title": "" }, { "docid": "8ede1e74246ca8f6173b041becef5c5d", "score": "0.47913024", "text": "function parse_PtgRef3d(blob, length, opts) {\n var type = (blob[blob.l] & 0x60) >> 5;\n blob.l += 1;\n var ixti = blob.read_shift(2); // XtiIndex\n\n if (opts && opts.biff == 5) blob.l += 12;\n var loc = parse_RgceLoc(blob, 0, opts); // TODO: or RgceLocRel\n\n return [type, ixti, loc];\n }", "title": "" }, { "docid": "8ede1e74246ca8f6173b041becef5c5d", "score": "0.47913024", "text": "function parse_PtgRef3d(blob, length, opts) {\n var type = (blob[blob.l] & 0x60) >> 5;\n blob.l += 1;\n var ixti = blob.read_shift(2); // XtiIndex\n\n if (opts && opts.biff == 5) blob.l += 12;\n var loc = parse_RgceLoc(blob, 0, opts); // TODO: or RgceLocRel\n\n return [type, ixti, loc];\n }", "title": "" }, { "docid": "33182bbd02133d957b058f5efd927685", "score": "0.47650024", "text": "function dataFromTIFFtoArray(_img, _pntsFromTIFF, _scale) {\n _img.loadPixels()\n let step = 2;\n console.log(_img.width , _img.height)\n for(let x = 0; x < _img.width; x+=step) {\n for(let y = 0; y < _img.height; y+=step) {\n let [r, g, b] = _img.get(x, y)\n // // let c = _img.pixels[i*4]\n \n let brghtnss = ( r + g + b ) / 3 \n // // let x = i % _img.width\n // // let y = (i-x)/_img.width\n\n // // mapping values from x y - longitude and latitude\n let lon = map(x,0, _img.width,-180,180);\n let lat = map(y,0, _img.height,90,-90);\n\n //console.log(`${lat}:${lon}`);\n\n // log data on the console\n // console.log(lon , lat , r , g , b, brghtnss)\n // creating datapoint object and pushing it to the arraylist in case\n _pntsFromTIFF.push(new DataPointGeoTIFF(lat, lon, brghtnss, _scale ))\n }\n }\n _img.updatePixels()\n\n}", "title": "" }, { "docid": "e90ded488be89e6847ddb482ad0962f7", "score": "0.4760688", "text": "function parse_PtgRef3d(blob, length, opts) {\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar ixti = blob.read_shift(2); // XtiIndex\n\tif(opts && opts.biff == 5) blob.l += 12;\n\tvar loc = parse_RgceLoc(blob, 0, opts); // TODO: or RgceLocRel\n\treturn [type, ixti, loc];\n}", "title": "" }, { "docid": "e90ded488be89e6847ddb482ad0962f7", "score": "0.4760688", "text": "function parse_PtgRef3d(blob, length, opts) {\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar ixti = blob.read_shift(2); // XtiIndex\n\tif(opts && opts.biff == 5) blob.l += 12;\n\tvar loc = parse_RgceLoc(blob, 0, opts); // TODO: or RgceLocRel\n\treturn [type, ixti, loc];\n}", "title": "" }, { "docid": "e90ded488be89e6847ddb482ad0962f7", "score": "0.4760688", "text": "function parse_PtgRef3d(blob, length, opts) {\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar ixti = blob.read_shift(2); // XtiIndex\n\tif(opts && opts.biff == 5) blob.l += 12;\n\tvar loc = parse_RgceLoc(blob, 0, opts); // TODO: or RgceLocRel\n\treturn [type, ixti, loc];\n}", "title": "" }, { "docid": "e90ded488be89e6847ddb482ad0962f7", "score": "0.4760688", "text": "function parse_PtgRef3d(blob, length, opts) {\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar ixti = blob.read_shift(2); // XtiIndex\n\tif(opts && opts.biff == 5) blob.l += 12;\n\tvar loc = parse_RgceLoc(blob, 0, opts); // TODO: or RgceLocRel\n\treturn [type, ixti, loc];\n}", "title": "" }, { "docid": "e90ded488be89e6847ddb482ad0962f7", "score": "0.4760688", "text": "function parse_PtgRef3d(blob, length, opts) {\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar ixti = blob.read_shift(2); // XtiIndex\n\tif(opts && opts.biff == 5) blob.l += 12;\n\tvar loc = parse_RgceLoc(blob, 0, opts); // TODO: or RgceLocRel\n\treturn [type, ixti, loc];\n}", "title": "" }, { "docid": "e90ded488be89e6847ddb482ad0962f7", "score": "0.4760688", "text": "function parse_PtgRef3d(blob, length, opts) {\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar ixti = blob.read_shift(2); // XtiIndex\n\tif(opts && opts.biff == 5) blob.l += 12;\n\tvar loc = parse_RgceLoc(blob, 0, opts); // TODO: or RgceLocRel\n\treturn [type, ixti, loc];\n}", "title": "" }, { "docid": "d10fc9a8cf9733dc21364be3bf628178", "score": "0.47399384", "text": "function parse_PtgRef3d(blob, length, opts) {\n var type = (blob[blob.l] & 0x60) >> 5;\n blob.l += 1;\n var ixti = blob.read_shift(2); // XtiIndex\n\n if (opts && opts.biff == 5) blob.l += 12;\n var loc = parse_RgceLoc(blob, 0, opts); // TODO: or RgceLocRel\n\n return [type, ixti, loc];\n }", "title": "" }, { "docid": "4b4555b8db8a369f15faaf08dc0c4808", "score": "0.47197104", "text": "function createGeometryData() {\n let data = {\n one: {},\n two: {}\n };\n\n inputs.forEach(input => {\n if (input.name.includes(\"1\")) {\n data.one[input.name.slice(0, -1)] = input.value;\n } else {\n data.two[input.name.slice(0, -1)] = input.value;\n }\n });\n\n return data;\n}", "title": "" }, { "docid": "969d8bb1f2af0764f3ec2ddfb9de02ab", "score": "0.47119638", "text": "function XYZcomponents(x, y, z){\n this.x = x;\n this.y = y;\n this.z = z;\n}", "title": "" }, { "docid": "4172ecc5bed3f843a2ffc6b46bb949e2", "score": "0.47015014", "text": "function edt(data, width, height, f, d, v, z) {\n for (var x = 0; x < width; x++) {\n for (var y = 0; y < height; y++) {\n f[y] = data[y * width + x]\n }\n edt1d(f, d, v, z, height)\n for (y = 0; y < height; y++) {\n data[y * width + x] = d[y]\n }\n }\n for (y = 0; y < height; y++) {\n for (x = 0; x < width; x++) {\n f[x] = data[y * width + x]\n }\n edt1d(f, d, v, z, width)\n for (x = 0; x < width; x++) {\n data[y * width + x] = Math.sqrt(d[x])\n }\n }\n}", "title": "" }, { "docid": "da1eab80c850afb60dfdcc3fcefb4cbc", "score": "0.4694387", "text": "function tuple3d(in_x, in_y, in_z){\r\n\tthis.x = in_x;\r\n\tthis.y = in_y;\r\n\tthis.z = in_z;\r\n\tthis.dot = tuple3d_dot;\r\n\tthis.unify = tuple3d_unify;\r\n\tthis.inSphere = tuple3d_inSphere;\r\n\tthis.setLength = tuple3d_setLength;\r\n\tthis.cross = tuple3d_cross;\r\n\tthis.mul = tuple3d_mul;\r\n\tthis.add = tuple3d_add;\r\n\tthis.sub = tuple3d_sub;\r\n\tthis.length = tuple3d_length;\r\n\tthis.length2 = tuple3d_length2;\r\n this.dis = tuple3d_dis;\r\n this.dis2 = tuple3d_dis2;\r\n\tthis.xy2sp = tuple3d_xy2sp;\r\n\tthis.sp2xy = tuple3d_sp2xy;\r\n\tthis.xy2spy = tuple3d_xy2spy;\r\n\tthis.spy2xy = tuple3d_spy2xy;\r\n\tthis.log = tuple3d_log;\r\n\tthis.logsp = tuple3d_logsp;\r\n\tthis.str = tuple3d_str;\r\n\tthis.strsp = tuple3d_strsp;\r\n\tthis.clone = tuple3d_clone;\r\n}", "title": "" }, { "docid": "261b4bc94f15eb90cfd10c897b59badd", "score": "0.4667058", "text": "function getDataArray(data, dataArrays, baseLayers) {\n var dataRows = data.replace(/\\s/g, '').split(\";\");\n// if (dataRows.length > (pltNum + 1)) {\n// startingIndex = dataRows.length - (pltNum + 1)\n// } else {\n var startingIndex = 0;\n// }\n for (var i = startingIndex, l = dataRows.length - 1; i < l; i++) {\n var dataComponents = dataRows[i].split(\",\");\n var dataDict = {\n \"timeStamp\": dataComponents[0], // call this the variable 'dataComponents'.\n \"latitude\": dataComponents[1], // We set a variable for each parameter in datasource.txt.\n \"longitude\": dataComponents[2],\n \"Temperature\": dataComponents[4],\n \"windDirection\": dataComponents[5],\n \"windSpeed\": dataComponents[6], //Speed in m/s\n \"Pressure\": dataComponents[7],\n \"avgTime\": dataComponents[14],\n \"Methane\": dataComponents[10],\n \"Water Vapour\": dataComponents[13],\n \"Carbon Dioxide\": dataComponents[11],\n \"CO\": dataComponents[12],\n };\n\n for (var key in baseLayers) {\n //Update contents of relevant data array\n if (isNaN(dataDict[key]) === false) {\n dataArrays[key].push(dataDict[key])\n }\n // Remove values from data array which won't be plotted\n// if (dataArrays[key].length === pltNum) {\n// dataArrays[key].shift()\n// }\n }\n }\nreturn dataArrays ;\n}", "title": "" }, { "docid": "3493acb053b2696716a9999ac56266b9", "score": "0.46526206", "text": "function edt(data, width, height, f, d, v, z) {\n for (var x = 0; x < width; x++) {\n for (var y = 0; y < height; y++) {\n f[y] = data[y * width + x];\n }\n edt1d(f, d, v, z, height);\n for (y = 0; y < height; y++) {\n data[y * width + x] = d[y];\n }\n }\n for (y = 0; y < height; y++) {\n for (x = 0; x < width; x++) {\n f[x] = data[y * width + x];\n }\n edt1d(f, d, v, z, width);\n for (x = 0; x < width; x++) {\n data[y * width + x] = Math.sqrt(d[x]);\n }\n }\n}", "title": "" }, { "docid": "3493acb053b2696716a9999ac56266b9", "score": "0.46526206", "text": "function edt(data, width, height, f, d, v, z) {\n for (var x = 0; x < width; x++) {\n for (var y = 0; y < height; y++) {\n f[y] = data[y * width + x];\n }\n edt1d(f, d, v, z, height);\n for (y = 0; y < height; y++) {\n data[y * width + x] = d[y];\n }\n }\n for (y = 0; y < height; y++) {\n for (x = 0; x < width; x++) {\n f[x] = data[y * width + x];\n }\n edt1d(f, d, v, z, width);\n for (x = 0; x < width; x++) {\n data[y * width + x] = Math.sqrt(d[x]);\n }\n }\n}", "title": "" }, { "docid": "3493acb053b2696716a9999ac56266b9", "score": "0.46526206", "text": "function edt(data, width, height, f, d, v, z) {\n for (var x = 0; x < width; x++) {\n for (var y = 0; y < height; y++) {\n f[y] = data[y * width + x];\n }\n edt1d(f, d, v, z, height);\n for (y = 0; y < height; y++) {\n data[y * width + x] = d[y];\n }\n }\n for (y = 0; y < height; y++) {\n for (x = 0; x < width; x++) {\n f[x] = data[y * width + x];\n }\n edt1d(f, d, v, z, width);\n for (x = 0; x < width; x++) {\n data[y * width + x] = Math.sqrt(d[x]);\n }\n }\n}", "title": "" }, { "docid": "3493acb053b2696716a9999ac56266b9", "score": "0.46526206", "text": "function edt(data, width, height, f, d, v, z) {\n for (var x = 0; x < width; x++) {\n for (var y = 0; y < height; y++) {\n f[y] = data[y * width + x];\n }\n edt1d(f, d, v, z, height);\n for (y = 0; y < height; y++) {\n data[y * width + x] = d[y];\n }\n }\n for (y = 0; y < height; y++) {\n for (x = 0; x < width; x++) {\n f[x] = data[y * width + x];\n }\n edt1d(f, d, v, z, width);\n for (x = 0; x < width; x++) {\n data[y * width + x] = Math.sqrt(d[x]);\n }\n }\n}", "title": "" }, { "docid": "87bc8cadd1fa45298bf224646f7d74d2", "score": "0.4640249", "text": "function esfera(xc,yc,zc,radius){\n var latitudeBands = 30;\n var longitudeBands = 30;\n\n for (var latNumber=0; latNumber <= latitudeBands; latNumber++) {\n var theta = latNumber * Math.PI / latitudeBands;\n var sinTheta = Math.sin(theta);\n var cosTheta = Math.cos(theta);\n\n for (var longNumber=0; longNumber <= longitudeBands; longNumber++) {\n var phi = longNumber * 2 * Math.PI / longitudeBands;\n var sinPhi = Math.sin(phi);\n var cosPhi = Math.cos(phi);\n\n var x = cosPhi * sinTheta + xc;\n var y = cosTheta + yc;\n var z = sinPhi * sinTheta + zc;\n\n solVertices.push(radius * x);\n solVertices.push(radius * y);\n solVertices.push(radius * z);\n }\n }\n\n\n for (var latNumber=0; latNumber < latitudeBands; latNumber++) {\n for (var longNumber=0; longNumber < longitudeBands; longNumber++) {\n var first = (latNumber * (longitudeBands + 1)) + longNumber;\n var second = first + longitudeBands + 1;\n indexData.push(first);\n indexData.push(second);\n indexData.push(first + 1);\n\n indexData.push(second);\n indexData.push(second + 1);\n indexData.push(first + 1);\n }\n }\n\n\n}", "title": "" }, { "docid": "fa9febd57e5fe6c38cd4c0b6a59c4429", "score": "0.46329865", "text": "function quad(arr, a, b, c, d, e) {\n // triangle 1\n pointsArray.push(arr[a]);\n colorsArray.push(vertexColors[e]);\n pointsArray.push(arr[b]);\n colorsArray.push(vertexColors[e]);\n pointsArray.push(arr[c]);\n colorsArray.push(vertexColors[e]);\n // triangle 2\n pointsArray.push(arr[a]);\n colorsArray.push(vertexColors[e]);\n pointsArray.push(arr[c]);\n colorsArray.push(vertexColors[e]);\n pointsArray.push(arr[d]);\n colorsArray.push(vertexColors[e]);\n}", "title": "" }, { "docid": "9aa4f7e6a25f078233b50d96c7e3c248", "score": "0.46252766", "text": "function tubify(args){\n var args = (args != undefined) ? args : {};\n var pts = (args.pts != undefined) ? args.pts : [];\n var wid = (args.wid != undefined) ? args.wid : (x)=>(10);\n vtxlist0 = []\n vtxlist1 = []\n vtxlist = []\n for (var i = 1; i < pts.length-1; i++){\n var w = wid(i/pts.length)\n var a1 = Math.atan2(pts[i][1]-pts[i-1][1],pts[i][0]-pts[i-1][0]);\n var a2 = Math.atan2(pts[i][1]-pts[i+1][1],pts[i][0]-pts[i+1][0]);\n var a = (a1+a2)/2;\n if (a < a2){a+=PI}\n vtxlist0.push([pts[i][0]+w*cos(a),(pts[i][1]+w*sin(a))]);\n vtxlist1.push([pts[i][0]-w*cos(a),(pts[i][1]-w*sin(a))]);\n }\n var l = pts.length-1\n var a0 = Math.atan2(pts[1][1]-pts[0][1],pts[1][0]-pts[0][0]) - Math.PI/2;\n var a1 = Math.atan2(pts[l][1]-pts[l-1][1],pts[l][0]-pts[l-1][0]) - Math.PI/2;\n var w0 = wid(0)\n var w1 = wid(1)\n vtxlist0.unshift([pts[0][0]+w0*Math.cos(a0),(pts[0][1]+w0*Math.sin(a0))])\n vtxlist1.unshift([pts[0][0]-w0*Math.cos(a0),(pts[0][1]-w0*Math.sin(a0))])\n vtxlist0.push([pts[l][0]+w1*Math.cos(a1),(pts[l][1]+w1*Math.sin(a1))])\n vtxlist1.push([pts[l][0]-w1*Math.cos(a1),(pts[l][1]-w1*Math.sin(a1))])\n return [vtxlist0,vtxlist1]\n}", "title": "" }, { "docid": "548dcbe1ea7af4bef8a951d0453549f8", "score": "0.46237773", "text": "function parseEventData(et, forGenerator) {\n\n let data = {};\n let location = {};\n let files = {};\n\n et.inputDescriptor.forEach(d => {\n switch (d.type) {\n case 'GeolocationInputField' :\n if (forGenerator) {\n location[d.key] = {\n type: \"Point\",\n coordinates: [$(`#${d.key}GenLon`).val(), $(`#${d.key}GenLat`).val()]\n };\n } else {\n location[d.key] = {\n type: \"Point\",\n coordinates: [parseFloat($(`#${d.key}lon`).val()), parseFloat($(`#${d.key}lat`).val())]\n };\n }\n break;\n case 'MultipleChoiceInputField' :\n const boxes = document.getElementsByName(d.key);\n const sel = [];\n boxes.forEach(b => {\n if (b.checked) sel.push(parseInt(b.value));\n });\n data[d.key] = sel;\n break;\n case 'NumericInputField' :\n if (forGenerator) {\n data[d.key] = $(`#${d.key}`).val();\n } else {\n data[d.key] = parseFloat($(`#${d.key}`).val());\n }\n break;\n case 'FileInputField' :\n if (_toUpload == null) {\n files[d.key] = $(`#label${d.key}`).html();\n return;\n }\n const name = `${moment.utc().format('x')}-${_toUpload.name}`;\n files[d.key] = name;\n controller.uploadFile(_toUpload, name);\n break;\n default:\n data[d.key] = $(`#${d.key}`).val();\n }\n });\n\n data['locations'] = location;\n data['files'] = files;\n\n return data;\n}", "title": "" }, { "docid": "24cdb7b6c98b177737b0a5eaeaeb4ec1", "score": "0.46237183", "text": "function simpleLTFit(ltStack,startYear,endYear,indexName,arrayMode,maxSegs){\r\n if(indexName === undefined || indexName === null){indexName = ''};\r\n if(arrayMode === undefined || arrayMode === null){arrayMode = false};\r\n if(maxSegs === undefined || maxSegs === null){maxSegs = 6};\r\n \r\n // Separate years and fitted values of vertices\r\n if(arrayMode){\r\n var zeros =ee.Image(ee.Array([0]).repeat(0,maxSegs+1));\r\n var yrBns = [];\r\n var fitBns = [];\r\n var emptyArray = []; \r\n var iString; \r\n for(var i=1;i<=maxSegs+1;i++){ \r\n iString = i.toString(); \r\n yrBns.push('yrs_'+iString); \r\n fitBns.push('fit_'+iString);\r\n \r\n }\r\n \r\n var yrs = ltStack.arraySlice(0,0,1).arrayProject([1]).arrayCat(zeros,0).arraySlice(0, 0, maxSegs+1).arrayFlatten([yrBns]).selfMask()\r\n var fit = ltStack.arraySlice(0,1,2).arrayProject([1]).arrayCat(zeros,0).arraySlice(0, 0, maxSegs+1).arrayFlatten([fitBns]).updateMask(yrs.mask())\r\n \r\n }else{\r\n //Separate years and fitted values of vertices\r\n var yrs = ltStack.select('yrs_.*').selfMask();\r\n var fit = ltStack.select('fit_.*').updateMask(yrs.mask());\r\n }\r\n //Find the first and last vertex years\r\n var isStartYear = yrs.reduce(ee.Reducer.firstNonNull());\r\n var isEndYear = yrs.reduce(ee.Reducer.lastNonNull());\r\n \r\n var blankMask = yrs.gte(100000);\r\n // Map.addLayer(isStartYear,{},'isStartYear');\r\n // Map.addLayer(isEndYear,{},'isEndYear')\r\n // Map.addLayer(yrs.reduce(ee.Reducer.firstNonNull()).eq(1986),{},'not start year');\r\n // Map.addLayer(yrs,{},'yrs');\r\n // Map.addLayer(fit,{},'fit')\r\n \r\n //Iterate across each year to find the values for that year\r\n var out = ee.ImageCollection(ee.List.sequence(startYear,endYear).map(function(yr){\r\n yr = ee.Number(yr);\r\n \r\n //Find the segment the year belongs to\r\n //Handle whether the year is the same as the first vertex year\r\n var startYrMask = blankMask;\r\n startYrMask = startYrMask.where(isStartYear.eq(yr),yrs.lte(yr));\r\n startYrMask = startYrMask.where(isStartYear.lt(yr),yrs.lt(yr));\r\n \r\n //Handle whether the year is the same as the last vertex year\r\n var endYrMask = blankMask;\r\n endYrMask = endYrMask.where(isStartYear.eq(yr),yrs.gt(yr));\r\n endYrMask = endYrMask.where(isStartYear.lt(yr),yrs.gte(yr));\r\n \r\n // var startYrMask =yrs.lt(yr);\r\n // var endYrMask = yrs.gte(yr)\r\n //Get fitted values for the vertices segment the year is within\r\n var fitStart = fit.updateMask(startYrMask).reduce(ee.Reducer.lastNonNull());\r\n var fitEnd = fit.updateMask(endYrMask).reduce(ee.Reducer.firstNonNull());\r\n \r\n //Get start and end year for the vertices segment the year is within\r\n var yearStart = yrs.updateMask(startYrMask).reduce(ee.Reducer.lastNonNull());\r\n var yearEnd = yrs.updateMask(endYrMask).reduce(ee.Reducer.firstNonNull());\r\n \r\n //Get the difference and duration of the segment\r\n var segDiff = fitEnd.subtract(fitStart);\r\n var segDur = yearEnd.subtract(yearStart);\r\n \r\n //Get the varius annual derivatives\r\n var tDiff = ee.Image(yr).subtract(yearStart);\r\n var segSlope = segDiff.divide(segDur);\r\n var fitDiff = segSlope.multiply(tDiff);\r\n var fitted = fitStart.add(fitDiff);\r\n // Map.addLayer(startYrMask,{},'start'+yr.getInfo().toString(),false)\r\n // Map.addLayer(endYrMask,{},'end'+yr.getInfo().toString(),false)\r\n // Map.addLayer(fitStart,{},'fitStart'+yr.getInfo().toString(),false)\r\n // Map.addLayer(fitEnd,{},'fitEnd'+yr.getInfo().toString(),false)\r\n // Map.addLayer(yearStart,{},'yearStart'+yr.getInfo().toString(),false)\r\n // Map.addLayer(yearEnd,{},'yearEnd'+yr.getInfo().toString(),false)\r\n // Map.addLayer(segDur,{},'segDur'+yr.getInfo().toString(),false)\r\n \r\n return segDur \r\n .addBands(fitted)\r\n .addBands(segDiff)\r\n .addBands(segSlope)\r\n .addBands(fitDiff)\r\n .rename([indexName +'_LT_dur',indexName +'_LT_fitted',indexName +'_LT_mag',indexName +'_LT_slope',indexName +'_LT_diff'])\r\n .set('system:time_start',ee.Date.fromYMD(yr,6,1).millis());\r\n }));\r\n return out;\r\n}", "title": "" }, { "docid": "f9edee2048bd51bb8c10a3a544275b90", "score": "0.46046197", "text": "function zip3D(x, y, z) {\n var out = [];\n const xlen = x.size;\n const ylen = y.size;\n for (var i = 0; i < xlen; ++i) {\n for (var j = 0; j < ylen; ++j) {\n out.push({\n x: x.get(i),\n y: y.get(j),\n i: i,\n j: j,\n z: z.get(j, i)\n });\n }\n }\n return out;\n}", "title": "" }, { "docid": "cbb3b3be3553756d827e36eaac86903d", "score": "0.4573382", "text": "function c$1(){const{faceDescriptions:t,faceVertexOffsets:e,uvScales:n}=d$1,r=4*t.length,o=new Float64Array(3*r),s=new Float32Array(3*r),a=new Float32Array(2*r),i=new Uint32Array(2*t.length*3);let c=0,l=0,f=0,u=0;for(let h=0;h<t.length;h++){const r=t[h],p=c/3;for(const t of e)i[u++]=p+t;const m=r.corners;for(let t=0;t<4;t++){const e=m[t];let i=0;a[f++]=.25*n[t][0]+r.uvOrigin[0],a[f++]=r.uvOrigin[1]-.25*n[t][1];for(let t=0;t<3;t++)0!==r.axis[t]?(o[c++]=.5*r.axis[t],s[l++]=r.axis[t]):(o[c++]=.5*e[i++],s[l++]=0);}}return {position:o,normal:s,uv:a,faces:i}}", "title": "" }, { "docid": "222d5b5fbbc7de4f035306279116aed4", "score": "0.45685792", "text": "constructor(x, y, a ) { // xPos, yPos, answer\n this.inputs = []; // initialize inputs as a float[] of size 3\n this.inputs[0] = x;\n this.inputs[1] = y;\n this.inputs[2] = 1; //built in bias\n this.answer = a;\n }", "title": "" }, { "docid": "c4ba30d1b62ca9bc3cf053c43a20139d", "score": "0.4562266", "text": "function tesselate(xyz) {\n\t\t\t\tlet v1 = new Math3D.Vector3(xyz[3] - xyz[0], xyz[4] - xyz[1], xyz[5] - xyz[2]);\n\t\t\t\tlet v2 = new Math3D.Vector3(xyz[6] - xyz[0], xyz[7] - xyz[1], xyz[8] - xyz[2]);\n\t\t\t\tlet v3 = v1.cross(v2);\n\t\t\t\t//\tconsole.log('Normal', v3.x, v3.y, v3.z);\n\t\t\t\tlet ang;\n\t\t\t\tlet vax;\n\t\t\t\tif (v3.z > 0.9999) {\n\t\t\t\t\tang = 0.0;\n\t\t\t\t\tvax = new Math3D.Vector3(1, 0, 0);\n\t\t\t\t} else {\n\t\t\t\t\tif (v3.z < -0.9999) {\n\t\t\t\t\t\tang = Math.PI;\n\t\t\t\t\t\tvax = new Math3D.Vector3(1, 0, 0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tang = Math.acos(v3.z);\n\t\t\t\t\t\tvup = new Math3D.Vector3(0.0, 0.0, 1.0);\n\t\t\t\t\t\tvax = v3.cross(vup); // forward is z in real coordinates\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlet deg = 180.0 * ang / Math.PI;\n\t\t\t\t//\tconsole.log('ang', deg, 'vax', vax.x, vax.y, vax.z);\n\t\t\t\tlet q = Math3D.Quaternion.AngleAxis(vax, deg);\n\t\t\t\tlet vxyz;\n\t\t\t\tlet xy = [];\n\t\t\t\tfor (let i = 0; i < xyz.length; i += 3) {\n\t\t\t\t\tvxyz = q.mulVector3(new Math3D.Vector3(xyz[i], xyz[i + 1], xyz[i + 2]));\n\t\t\t\t\t//\tconsole.log('vxyz', vxyz.x, vxyz.y, vxyz.z);\n\t\t\t\t\txy.push(vxyz.x, vxyz.y);\n\t\t\t\t}\n\t\t\t\tlet idx = earcut(xy, null, 2);\n\t\t\t\t//\tconsole.log('idx', idx);\n\t\t\t\treturn idx;\n\t\t\t}", "title": "" }, { "docid": "b4ff4306e6cfe38f785ad2bf621fc5ed", "score": "0.45366606", "text": "function takeAverageOfVariables(array) {\n\tvar featureItem = Object.create(Features.prototype);\n\tvar arr = [];\n\t// Constructing features from accelX\n\tfor (i = 0; i < array.length; i++) {\n\t\tif(array[i].accelX != null) {\n\t\t\tarr.push(array[i].accelX);\n\t\t}\n\t}\n\tfeatureItem.accelX = averageValues(arr);\n\t\n\t// Constructing features from accelY\n\tarr = [];\n\tfor (i = 0; i < array.length; i++) {\n\t\tif(array[i].accelY != null)\n\t\t\tarr.push(array[i].accelY);\n\t}\n\tfeatureItem.accelY = averageValues(arr);\n\t// Constructing features from accelZ\n\tarr = [];\n\tfor (i = 0; i < array.length; i++) {\n\t\tif(array[i].accelZ != null)\n\t\t\tarr.push(array[i].accelZ);\n\t}\n\tfeatureItem.accelZ = averageValues(arr);\n\t// Constructing features from Latitude\n\tarr = [];\n\tfor (i = 0; i < array.length; i++) {\n\t\tif(array[i].locLat != null)\n\t\t\tarr.push(array[i].locLat);\n\t}\n\tfeatureItem.locLat = averageValues(arr);\n\t// Constructing features from Longitude\n\tarr = [];\n\tfor (i = 0; i < array.length; i++) {\n\t\tif(array[i].locLon != null)\n\t\t\tarr.push(array[i].locLon);\n\t}\n\tfeatureItem.locLon = averageValues(arr);\n\t\n\tfeatureItem.timestamp = formatLocalDate(Date());\n\tfeatureItem.battery = 100;\n\tfor(i = array.length - 1; i >= 0; i--) {\n\t\tif(array[i].battery != null) {\n\t\t\tfeatureItem.battery = array[i].battery;\n\t\t\tbreak;\n\t\t}\n\t}\n\tfeatureItem.watchId = localStorage.getItem(KEY_WATCH_ID);\n\treturn featureItem;\n}", "title": "" }, { "docid": "318ca8eb84b447b4c4e78fb20fd62f25", "score": "0.45097727", "text": "function shapeTags(tags) {\n const shapedTags = [];\n tags.forEach((tag) => {\n const shapedTag = tag;\n shapedTag.confidence = String(Math.round(tag.confidence * 100)) + \"%\";\n shapedTags.push(shapedTag);\n });\n return tags;\n}", "title": "" }, { "docid": "58b3b9e45ae8a4c428ba5ddc41c6313d", "score": "0.4505626", "text": "function componentVectorFields () {\n\n \t/* Default Properties */\n \tvar dimensions = { x: 40, y: 40, z: 40 };\n \tvar colors = d3.schemeRdYlGn[8];\n \tvar classed = \"d3X3dVectorFields\";\n\n \t/* Scales */\n \tvar xScale = void 0;\n \tvar yScale = void 0;\n \tvar zScale = void 0;\n \tvar colorScale = void 0;\n \tvar sizeScale = void 0;\n \tvar sizeRange = [2.0, 5.0];\n\n \t/**\n * Vector Field Function\n *\n * @param {number} x\n * @param {number} y\n * @param {number} z\n * @param {number} value\n * @returns {{vx: number, vy: number, vz: number}}\n */\n \tvar vectorFunction = function vectorFunction(x, y, z) {\n\n \t\treturn {\n \t\t\tvx: x,\n \t\t\tvy: y,\n \t\t\tvz: z\n \t\t};\n \t};\n\n \t/**\n * Initialise Data and Scales\n *\n * @private\n * @param {Array} data - Chart data.\n */\n \tvar init = function init(data) {\n \t\tvar _dataTransform$summar = dataTransform(data).summary(),\n \t\t coordinatesMax = _dataTransform$summar.coordinatesMax,\n \t\t coordinatesMin = _dataTransform$summar.coordinatesMin;\n\n \t\tvar minX = coordinatesMin.x,\n \t\t minY = coordinatesMin.y,\n \t\t minZ = coordinatesMin.z;\n \t\tvar maxX = coordinatesMax.x,\n \t\t maxY = coordinatesMax.y,\n \t\t maxZ = coordinatesMax.z;\n \t\tvar _dimensions = dimensions,\n \t\t dimensionX = _dimensions.x,\n \t\t dimensionY = _dimensions.y,\n \t\t dimensionZ = _dimensions.z;\n\n\n \t\tvar extent = d3.extent(data.values.map(function (f) {\n \t\t\tvar vx = void 0,\n \t\t\t vy = void 0,\n \t\t\t vz = void 0;\n \t\t\tif (\"vx\" in f) {\n \t\t\t\tvx = f.vx;\n \t\t\t\tvy = f.vy;\n \t\t\t\tvz = f.vz;\n \t\t\t} else {\n \t\t\t\tvar _vectorFunction = vectorFunction(f.x, f.y, f.z, f.value);\n\n \t\t\t\tvx = _vectorFunction.vx;\n \t\t\t\tvy = _vectorFunction.vy;\n \t\t\t\tvz = _vectorFunction.vz;\n \t\t\t}\n\n \t\t\tvar vector = fromValues(vx, vy, vz);\n \t\t\treturn length(vector);\n \t\t}));\n\n \t\tif (typeof xScale === \"undefined\") {\n \t\t\txScale = d3.scaleLinear().domain([minX, maxX]).range([0, dimensionX]);\n \t\t}\n\n \t\tif (typeof yScale === \"undefined\") {\n \t\t\tyScale = d3.scaleLinear().domain([minY, maxY]).range([0, dimensionY]);\n \t\t}\n\n \t\tif (typeof zScale === \"undefined\") {\n \t\t\tzScale = d3.scaleLinear().domain([minZ, maxZ]).range([0, dimensionZ]);\n \t\t}\n\n \t\tif (typeof sizeScale === \"undefined\") {\n \t\t\tsizeScale = d3.scaleLinear().domain(extent).range(sizeRange);\n \t\t}\n\n \t\tif (typeof colorScale === \"undefined\") {\n \t\t\tcolorScale = d3.scaleQuantize().domain(extent).range(colors);\n \t\t}\n \t};\n\n \t/**\n * Constructor\n *\n * @constructor\n * @alias vectorFields\n * @param {d3.selection} selection - The chart holder D3 selection.\n */\n \tvar my = function my(selection) {\n \t\tselection.each(function (data) {\n \t\t\tinit(data);\n\n \t\t\tvar element = d3.select(this).classed(classed, true).attr(\"id\", function (d) {\n \t\t\t\treturn d.key;\n \t\t\t});\n\n \t\t\tvar vectorData = function vectorData(d) {\n \t\t\t\treturn d.values.map(function (f) {\n\n \t\t\t\t\tvar vx = void 0,\n \t\t\t\t\t vy = void 0,\n \t\t\t\t\t vz = void 0;\n \t\t\t\t\tif (\"vx\" in f) {\n \t\t\t\t\t\tvx = f.vx;\n \t\t\t\t\t\tvy = f.vy;\n \t\t\t\t\t\tvz = f.vz;\n \t\t\t\t\t} else {\n \t\t\t\t\t\tvar _vectorFunction2 = vectorFunction(f.x, f.y, f.z, f.value);\n\n \t\t\t\t\t\tvx = _vectorFunction2.vx;\n \t\t\t\t\t\tvy = _vectorFunction2.vy;\n \t\t\t\t\t\tvz = _vectorFunction2.vz;\n \t\t\t\t\t}\n\n \t\t\t\t\tvar vecStart = fromValues(0, 1, 0);\n \t\t\t\t\tvar vecEnd = fromValues(vx, vy, vz);\n \t\t\t\t\tvar vecLen = length(vecEnd);\n\n \t\t\t\t\t// rotationTo required unit vectors\n \t\t\t\t\tvar vecNormal = create$1();\n \t\t\t\t\tnormalize(vecNormal, vecEnd);\n\n \t\t\t\t\tvar quat = create$3();\n \t\t\t\t\trotationTo(quat, vecStart, vecNormal);\n \t\t\t\t\tvar vecRotate = create$1();\n \t\t\t\t\tvar angleRotate = getAxisAngle(vecRotate, quat);\n\n \t\t\t\t\tif (!vecLen) {\n \t\t\t\t\t\t// If there is no vector length return null (and filter them out after)\n \t\t\t\t\t\treturn null;\n \t\t\t\t\t}\n\n \t\t\t\t\t// Calculate transform-translation attr\n \t\t\t\t\tf.translation = xScale(f.x) + \" \" + yScale(f.y) + \" \" + zScale(f.z);\n\n \t\t\t\t\t// Calculate vector length\n \t\t\t\t\tf.value = vecLen;\n\n \t\t\t\t\t// Calculate transform-rotation attr\n \t\t\t\t\tf.rotation = [].concat(toConsumableArray(vecRotate), [angleRotate]).join(\" \");\n\n \t\t\t\t\treturn f;\n \t\t\t\t}).filter(function (f) {\n \t\t\t\t\treturn f !== null;\n \t\t\t\t});\n \t\t\t};\n\n \t\t\tvar arrows = element.selectAll(\".arrow\").data(vectorData);\n\n \t\t\tvar arrowsEnter = arrows.enter().append(\"Transform\").attr(\"translation\", function (d) {\n \t\t\t\treturn d.translation;\n \t\t\t}).attr(\"rotation\", function (d) {\n \t\t\t\treturn d.rotation;\n \t\t\t}).attr(\"class\", \"arrow\").append(\"Transform\").attr(\"translation\", function (d) {\n \t\t\t\tvar offset = sizeScale(d.value) / 2;\n \t\t\t\treturn \"0 \" + offset + \" 0\";\n \t\t\t}).append(\"Group\");\n\n \t\t\tvar arrowHead = arrowsEnter.append(\"Shape\");\n\n \t\t\tarrowHead.append(\"Appearance\").append(\"Material\").attr(\"diffuseColor\", function (d) {\n \t\t\t\treturn colorParse(colorScale(d.value));\n \t\t\t});\n\n \t\t\tarrowHead.append(\"Cylinder\").attr(\"height\", function (d) {\n \t\t\t\treturn sizeScale(d.value);\n \t\t\t}).attr(\"radius\", 0.1);\n\n \t\t\tvar arrowShaft = arrowsEnter.append(\"Transform\").attr(\"translation\", function (d) {\n \t\t\t\tvar offset = sizeScale(d.value) / 2;\n \t\t\t\treturn \"0 \" + offset + \" 0\";\n \t\t\t}).append(\"Shape\");\n\n \t\t\tarrowShaft.append(\"Appearance\").append(\"Material\").attr(\"diffuseColor\", function (d) {\n \t\t\t\treturn colorParse(colorScale(d.value));\n \t\t\t});\n\n \t\t\tarrowShaft.append(\"cone\").attr(\"height\", 1).attr(\"bottomRadius\", 0.4);\n\n \t\t\tarrowsEnter.merge(arrows);\n\n \t\t\tarrows.transition().attr(\"translation\", function (d) {\n \t\t\t\treturn d.translation;\n \t\t\t});\n\n \t\t\tarrows.exit().remove();\n \t\t});\n \t};\n\n \t/**\n * Dimensions Getter / Setter\n *\n * @param {{x: number, y: number, z: number}} _v - 3D object dimensions.\n * @returns {*}\n */\n \tmy.dimensions = function (_v) {\n \t\tif (!arguments.length) return dimensions;\n \t\tdimensions = _v;\n \t\treturn this;\n \t};\n\n \t/**\n * X Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n \tmy.xScale = function (_v) {\n \t\tif (!arguments.length) return xScale;\n \t\txScale = _v;\n \t\treturn my;\n \t};\n\n \t/**\n * Y Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n \tmy.yScale = function (_v) {\n \t\tif (!arguments.length) return yScale;\n \t\tyScale = _v;\n \t\treturn my;\n \t};\n\n \t/**\n * Z Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n \tmy.zScale = function (_v) {\n \t\tif (!arguments.length) return zScale;\n \t\tzScale = _v;\n \t\treturn my;\n \t};\n\n \t/**\n * Size Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 color scale.\n * @returns {*}\n */\n \tmy.sizeScale = function (_v) {\n \t\tif (!arguments.length) return sizeScale;\n \t\tsizeScale = _v;\n \t\treturn my;\n \t};\n\n \t/**\n * Size Range Getter / Setter\n *\n * @param {number[]} _v - Size min and max (e.g. [1, 9]).\n * @returns {*}\n */\n \tmy.sizeRange = function (_v) {\n \t\tif (!arguments.length) return sizeRange;\n \t\tsizeRange = _v;\n \t\treturn my;\n \t};\n\n \t/**\n * Color Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 color scale.\n * @returns {*}\n */\n \tmy.colorScale = function (_v) {\n \t\tif (!arguments.length) return colorScale;\n \t\tcolorScale = _v;\n \t\treturn my;\n \t};\n\n \t/**\n * Colors Getter / Setter\n *\n * @param {Array} _v - Array of colours used by color scale.\n * @returns {*}\n */\n \tmy.colors = function (_v) {\n \t\tif (!arguments.length) return colors;\n \t\tcolors = _v;\n \t\treturn my;\n \t};\n\n \t/**\n * Vector Function Getter / Setter\n *\n * @param {function} _f - Vector Function.\n * @returns {*}\n */\n \tmy.vectorFunction = function (_f) {\n \t\tif (!arguments.length) return vectorFunction;\n \t\tvectorFunction = _f;\n \t\treturn my;\n \t};\n\n \t/**\n * Dispatch On Getter\n *\n * @returns {*}\n */\n \tmy.on = function () {\n \t\tvar value = dispatch.on.apply(dispatch, arguments);\n \t\treturn value === dispatch ? my : value;\n \t};\n\n \treturn my;\n }", "title": "" }, { "docid": "28c98fdbe9ff6bbb4648ca4538d6081d", "score": "0.44845402", "text": "update(data, currentPose, distances) {\n let idx = 0;\n data.traverse((d) => {\n if (_.filter(this.targets, t => `robot_${t}` == d.name.toLowerCase()).length > 0) {\n if (this.tags[idx]) {\n if (this.tags[idx]) {\n const gPos = new THREE.Vector3().setFromMatrixPosition(d.matrixWorld);\n\n this.tags[idx].position.copy(gPos.clone());\n\n let tagString = '';\n if (this.options.showName) {\n tagString += d.name + '\\n';\n }\n if (this.options.showPosition) {\n tagString += 'X: ' + gPos.x.toFixed(3) + ', ' + 'Y: ' + gPos.y.toFixed(3) + ', ' + 'Z: ' + gPos.z.toFixed(3) + '\\n';\n }\n if (this.options.showRotation) {\n tagString += 'X: ' + d.rotation.x.toFixed(3) + ', ' + 'Y: ' + d.rotation.y.toFixed(3) + ', ' + 'Z: ' + d.rotation.z.toFixed(3) + '\\n';\n }\n this.tags[idx].children[0].geometry.update({\n text: tagString,\n });\n }\n }\n\n if (!this.tags[idx] && this.fontsReady) {\n this.tags[idx] = this.addTag(this.parent, d, this.options, this.font);\n }\n\n\n idx++;\n }\n });\n }", "title": "" }, { "docid": "b880568f91c3ff1bdcb041ae4569d3f9", "score": "0.44749448", "text": "function xy(){\n return [\n [-4,0.00013383],[-3.91919,0.000184295],[-3.83838,0.000252138],[-3.75758,0.00034271],[-3.67677,0.000462785],[-3.59596,0.000620862],\n [-3.51515,0.000827515],[-3.43434,0.00109577],[-3.35354,0.00144155],[-3.27273,0.00188409],[-3.19192,0.00244646],[-3.11111,0.00315602],\n [-3.0303,0.00404487],[-2.94949,0.00515031],[-2.86869,0.00651518],[-2.78788,0.00818811],[-2.70707,0.0102236],[-2.62626,0.0126821],\n [-2.54545,0.0156293],[-2.46465,0.0191361],[-2.38384,0.0232772],[-2.30303,0.0281302],[-2.22222,0.0337737],[-2.14141,0.0402854],\n [-2.06061,0.0477399],[-1.9798,0.0562056],[-1.89899,0.0657418],[-1.81818,0.0763955],[-1.73737,0.0881979],[-1.65657,0.101161],\n [-1.57576,0.115274],[-1.49495,0.130501],[-1.41414,0.146778],[-1.33333,0.16401],[-1.25253,0.182073],[-1.17172,0.200809],\n [-1.09091,0.220033],[-1.0101,0.239527],[-0.929293,0.259051],[-0.848485,0.278343],[-0.767677,0.297125],[-0.686869,0.31511],\n [-0.606061,0.332009],[-0.525253,0.347537],[-0.444444,0.361424],[-0.363636,0.373419],[-0.282828,0.383301],[-0.20202,0.390884],\n [-0.121212,0.396022],[-0.040404,0.398617],[0.040404,0.398617],[0.121212,0.396022],[0.20202,0.390884],[0.282828,0.383301],\n [0.363636,0.373419],[0.444444,0.361424],[0.525253,0.347537],[0.606061,0.332009],[0.686869,0.31511],[0.767677,0.297125],\n [0.848485,0.278343],[0.929293,0.259051],[1.0101,0.239527],[1.09091,0.220033],[1.17172,0.200809],[1.25253,0.182073],\n [1.33333,0.16401],[1.41414,0.146778],[1.49495,0.130501],[1.57576,0.115274],[1.65657,0.101161],[1.73737,0.0881979],\n [1.81818,0.0763955],[1.89899,0.0657418],[1.9798,0.0562056],[2.06061,0.0477399],[2.14141,0.0402854],[2.22222,0.0337737],\n [2.30303,0.0281302],[2.38384,0.0232772],[2.46465,0.0191361],[2.54545,0.0156293],[2.62626,0.0126821],[2.70707,0.0102236],\n [2.78788,0.00818811],[2.86869,0.00651518],[2.94949,0.00515031],[3.0303,0.00404487],[3.11111,0.00315602],[3.19192,0.00244646],\n [3.27273,0.00188409],[3.35354,0.00144155],[3.43434,0.00109577],[3.51515,0.000827515],[3.59596,0.000620862],[3.67677,0.000462785],\n [3.75758,0.00034271],[3.83838,0.000252138],[3.91919,0.000184295],[4,0.00013383]\n ];}", "title": "" }, { "docid": "c8c267a84b8a4e94325a6b3a24d12867", "score": "0.44694233", "text": "function quad( a, b, c, d )\n{\n var t1 = subtract(vertices[b], vertices[a]);\n var t2 = subtract(vertices[c], vertices[b]);\n var normal = cross(t1, t2);\n var normal = vec3(normal);\n\n\n points.push(vertices[a]);\n normalsArray.push(normal);\n texCoordsArray.push(texCoord[1]);\n\n points.push(vertices[b]);\n normalsArray.push(normal);\n texCoordsArray.push(texCoord[0]);\n\n points.push(vertices[c]);\n normalsArray.push(normal);\n texCoordsArray.push(texCoord[3]);\n\n points.push(vertices[a]);\n normalsArray.push(normal);\n texCoordsArray.push(texCoord[1]);\n\n points.push(vertices[c]);\n normalsArray.push(normal);\n texCoordsArray.push(texCoord[3]);\n\n points.push(vertices[d]);\n normalsArray.push(normal);\n texCoordsArray.push(texCoord[2]);\n\n}", "title": "" }, { "docid": "f8ddba780b8a15a5da9dad49fd9dcfed", "score": "0.4468869", "text": "interpret(data:Array, b:Array, offset:Number) {\n }", "title": "" }, { "docid": "6888be19eeb4801c1ec0fdaf7e5df875", "score": "0.44631812", "text": "function addValuesToEquationArrayPOS( arrayPassed )\n{\n var firstIndex;\n var lastIndex;\n \n if ( arrayPassed[0] != null )\n {\n // For sixteens\n if ( arrayPassed[0].length == 16 )\n {\n addToEquationArray( \"0\" );\n }\n \n // For eights\n else if ( arrayPassed[0].length == 8 )\n {\n for ( var index = 0; index < arrayPassed.length; index++ )\n {\n firstIndex = arrayPassed[index][0];\n lastIndex = arrayPassed[index][7];\n \n // For four variable\n if ( array.length == 16 )\n {\n // Horizontals\n if ( firstIndex == 0 && lastIndex == 7 )\n {\n addToEquationArray( \"(A)\" );\n }\n\n else if ( firstIndex == 4 && lastIndex == 11 )\n {\n addToEquationArray( \"(B')\" );\n }\n\n else if ( firstIndex == 8 && lastIndex == 15 )\n {\n addToEquationArray( \"(A')\" );\n }\n\n // Verticals\n else if ( firstIndex == 0 && lastIndex == 13 )\n {\n addToEquationArray( \"(C)\" );\n }\n\n else if ( firstIndex == 1 && lastIndex == 14 )\n {\n addToEquationArray( \"(D')\" );\n }\n\n else if ( firstIndex == 2 && lastIndex == 15 )\n {\n addToEquationArray( \"(C')\" );\n }\n\n // Horizontal wrap\n else if ( firstIndex == 0 && lastIndex == 15 && arrayPassed[index][1] != 1 )\n {\n addToEquationArray( \"(D)\" );\n }\n\n // Vertical wrap\n else if ( firstIndex == 0 && lastIndex == 15 )\n {\n addToEquationArray( \"(B)\" );\n }\n }\n \n else\n {\n addToEquationArray( \"0\" );\n }\n }\n }\n \n // For quads\n else if ( arrayPassed[0].length == 4 )\n {\n for ( var index = 0; index < arrayPassed.length; index++ )\n {\n firstIndex = arrayPassed[index][0];\n lastIndex = arrayPassed[index][3];\n \n if ( array.length == 16 )\n {\n // Horizontals\n if ( firstIndex == 0 && lastIndex == 3 )\n {\n addToEquationArray( \"(A+B)\" );\n }\n\n else if ( firstIndex == 4 && lastIndex == 7 )\n {\n addToEquationArray( \"(A+B')\" );\n }\n\n else if ( firstIndex == 8 && lastIndex == 11 )\n {\n addToEquationArray( \"(A'+B')\" );\n }\n\n else if ( firstIndex == 12 && lastIndex == 15 )\n {\n addToEquationArray( \"(A'+B)\" );\n }\n\n // Verticals\n else if ( firstIndex == 0 && lastIndex == 12 )\n {\n addToEquationArray( \"(C+D)\" );\n }\n\n else if ( firstIndex == 1 && lastIndex == 13 )\n {\n addToEquationArray( \"(C+D')\" );\n }\n\n else if ( firstIndex == 2 && lastIndex == 14 )\n {\n addToEquationArray( \"(C'+D')\" );\n }\n\n else if ( firstIndex == 3 && lastIndex == 15 )\n {\n addToEquationArray( \"(C'+D)\" );\n }\n\n // Horizontal wraps\n else if ( firstIndex == 0 && lastIndex == 7 )\n {\n addToEquationArray( \"(A+D)\" );\n }\n\n else if ( firstIndex == 4 && lastIndex == 11 )\n {\n addToEquationArray( \"(B'+D)\" );\n }\n\n else if ( firstIndex == 8 && lastIndex == 15 )\n {\n addToEquationArray( \"(A'+D)\" );\n }\n\n // Squares ( from top left to bottom right )\n else if ( firstIndex == 0 && lastIndex == 5 )\n {\n addToEquationArray( \"(A+C)\" );\n }\n\n else if ( firstIndex == 1 && lastIndex == 6 )\n {\n addToEquationArray( \"(A+D')\" );\n }\n\n else if ( firstIndex == 2 && lastIndex == 7 )\n {\n addToEquationArray( \"(A+C')\" );\n }\n\n else if ( firstIndex == 4 && lastIndex == 9 )\n {\n addToEquationArray( \"(B'+C)\" );\n }\n\n else if ( firstIndex == 5 && lastIndex == 10 )\n {\n addToEquationArray( \"(B'+D')\" );\n }\n\n else if ( firstIndex == 6 && lastIndex == 11 )\n {\n addToEquationArray( \"(B'+C')\" );\n }\n\n else if ( firstIndex == 8 && lastIndex == 13 )\n {\n addToEquationArray( \"(A'+C)\" );\n }\n\n else if ( firstIndex == 9 && lastIndex == 14 )\n {\n addToEquationArray( \"(A'+D')\" );\n }\n\n else if ( firstIndex == 10 && lastIndex == 15 )\n {\n addToEquationArray( \"(A'+C')\" );\n }\n\n // Vertical wraps\n else if ( firstIndex == 0 && lastIndex == 13 )\n {\n addToEquationArray( \"(B+C)\" );\n }\n\n else if ( firstIndex == 1 && lastIndex == 14 )\n {\n addToEquationArray( \"(B+D')\" );\n }\n\n else if ( firstIndex == 2 && lastIndex == 15 )\n {\n addToEquationArray( \"(B+C')\" );\n }\n\n // Four corner quad\n else if ( firstIndex == 0 && lastIndex == 15 )\n {\n addToEquationArray( \"(B+D)\" );\n }\n }\n \n else \n {\n // Horizontals \n if ( firstIndex == 0 && lastIndex == 3 )\n {\n addToEquationArray( \"(A)\" );\n }\n \n else if ( firstIndex == 4 && lastIndex == 7 )\n {\n addToEquationArray( \"(A')\" );\n }\n \n // Squares\n else if ( firstIndex == 0 && lastIndex == 5 )\n {\n addToEquationArray( \"(B)\" );\n }\n \n else if ( firstIndex == 1 && lastIndex == 6 )\n {\n addToEquationArray( \"(C')\" );\n }\n \n else if ( firstIndex == 2 && lastIndex == 7 )\n {\n addToEquationArray( \"(B')\" );\n }\n \n // Wrap\n else if ( firstIndex == 0 && lastIndex == 7 )\n {\n addToEquationArray( \"(C)\" );\n }\n }\n }\n }\n \n // For pairs\n else if ( arrayPassed[0].length == 2 )\n {\n for ( var index = 0; index < arrayPassed.length; index++ )\n {\n firstIndex = arrayPassed[index][0];\n lastIndex = arrayPassed[index][1];\n \n if ( array.length == 16 )\n {\n // Horizontals\n if ( firstIndex == 0 && lastIndex == 1 )\n {\n addToEquationArray( \"(A+B+C)\" );\n }\n\n else if ( firstIndex == 1 && lastIndex == 2 )\n {\n addToEquationArray( \"(A+B+D')\" );\n }\n\n else if ( firstIndex == 2 && lastIndex == 3 )\n {\n addToEquationArray( \"(A+B+C)\" );\n }\n\n else if ( firstIndex == 4 && lastIndex == 5 )\n {\n addToEquationArray( \"(A+B'+C)\" );\n }\n\n else if ( firstIndex == 5 && lastIndex == 6 )\n {\n addToEquationArray( \"(A+B'+D)\" );\n }\n\n else if ( firstIndex == 6 && lastIndex == 7 )\n {\n addToEquationArray( \"(A+B'+C')\" );\n }\n\n else if ( firstIndex == 8 && lastIndex == 9 )\n {\n addToEquationArray( \"(A'+B'+C)\" );\n }\n\n else if ( firstIndex == 9 && lastIndex == 10 )\n {\n addToEquationArray( \"(A'+B'+D')\" );\n }\n\n else if ( firstIndex == 10 && lastIndex == 11 )\n {\n addToEquationArray( \"(A'+B'+C')\" );\n }\n\n else if ( firstIndex == 12 && lastIndex == 13 )\n {\n addToEquationArray( \"(A'+B+C)\" );\n }\n\n else if ( firstIndex == 13 && lastIndex == 14 )\n {\n addToEquationArray( \"(A'+B+D')\" );\n }\n\n else if ( firstIndex == 14 && lastIndex == 15 )\n {\n addToEquationArray( \"(A'+B+C')\" );\n }\n\n // Verticals\n else if ( firstIndex == 0 && lastIndex == 4 )\n {\n addToEquationArray( \"(A+C+D)\" );\n }\n\n else if ( firstIndex == 1 && lastIndex == 5 )\n {\n addToEquationArray( \"(A+C+D')\" );\n }\n\n else if ( firstIndex == 2 && lastIndex == 6 )\n {\n addToEquationArray( \"(A+C'+D')\" );\n }\n\n else if ( firstIndex == 3 && lastIndex == 7 )\n {\n addToEquationArray( \"(A+C'+D)\" );\n }\n\n else if ( firstIndex == 4 && lastIndex == 8 )\n {\n addToEquationArray( \"(B'+C+D)\" );\n }\n\n else if ( firstIndex == 5 && lastIndex == 9 )\n {\n addToEquationArray( \"(B'+C+D')\" );\n }\n\n else if ( firstIndex == 6 && lastIndex == 10 )\n {\n addToEquationArray( \"(B'+C'+D')\" );\n }\n\n else if ( firstIndex == 7 && lastIndex == 11 )\n {\n addToEquationArray( \"(B'+C'+D)\" );\n }\n\n else if ( firstIndex == 8 && lastIndex == 12 )\n {\n addToEquationArray( \"(A'+C+D)\" );\n }\n\n else if ( firstIndex == 9 && lastIndex == 13 )\n {\n addToEquationArray( \"(A'+C+D')\" );\n }\n\n else if ( firstIndex == 10 && lastIndex == 14 )\n {\n addToEquationArray( \"(A'+C'+D')\" );\n }\n\n else if ( firstIndex == 11 && lastIndex == 15 )\n {\n addToEquationArray( \"(A'+C'+D)\" );\n }\n\n // Horizontal pair wraps\n else if ( firstIndex == 0 && lastIndex == 3 )\n {\n addToEquationArray( \"(A+B+D)\" );\n }\n\n else if ( firstIndex == 4 && lastIndex == 7 )\n {\n addToEquationArray( \"(A+B'+D)\" );\n }\n\n else if ( firstIndex == 8 && lastIndex == 11 )\n {\n addToEquationArray( \"(A'+B'+D)\" );\n }\n\n else if ( firstIndex == 12 && lastIndex == 15 )\n {\n addToEquationArray( \"(A'+B+D)\" );\n }\n\n // Vertical pair wraps\n else if ( firstIndex == 0 && lastIndex == 12 )\n {\n addToEquationArray( \"(B+C+D)\" );\n }\n\n else if ( firstIndex == 1 && lastIndex == 13 )\n {\n addToEquationArray( \"(B+C+D')\" );\n }\n\n else if ( firstIndex == 2 && lastIndex == 14 )\n {\n addToEquationArray( \"(B+C'+D')\" );\n }\n\n else if ( firstIndex == 3 && lastIndex == 15 )\n {\n addToEquationArray( \"(B+C'+D)\" );\n }\n }\n \n else \n {\n // Horizontal\n if ( firstIndex == 0 && lastIndex == 1 )\n {\n addToEquationArray( \"(A+B)\" );\n }\n \n else if ( firstIndex == 1 && lastIndex == 2 )\n {\n addToEquationArray( \"(A+C')\" );\n }\n \n else if ( firstIndex == 2 && lastIndex == 3 )\n {\n addToEquationArray( \"(A+B')\" );\n }\n \n else if ( firstIndex == 4 && lastIndex == 5 )\n {\n addToEquationArray( \"(A'+B)\" );\n }\n \n else if ( firstIndex == 5 && lastIndex == 6 )\n {\n addToEquationArray( \"(A'+C')\" );\n }\n \n else if ( firstIndex == 6 && lastIndex == 7 )\n {\n addToEquationArray( \"(A'+B')\" );\n }\n \n // Vertical \n else if ( firstIndex == 0 && lastIndex == 4 )\n {\n addToEquationArray( \"(B+C)\" );\n }\n \n else if ( firstIndex == 1 && lastIndex == 5 )\n {\n addToEquationArray( \"(B+C')\" );\n }\n \n else if ( firstIndex == 2 && lastIndex == 6 )\n {\n addToEquationArray( \"(B'+C')\" );\n }\n \n else if ( firstIndex == 3 && lastIndex == 7 )\n {\n addToEquationArray( \"(B'+C)\" );\n }\n \n // Wraps\n else if ( firstIndex == 0 && lastIndex == 3 )\n {\n addToEquationArray( \"(A+C)\" );\n }\n \n else if ( firstIndex == 4 && lastIndex == 7 )\n {\n addToEquationArray( \"(A'+C)\" );\n }\n }\n }\n } \n }\n}", "title": "" }, { "docid": "a425d1447300785188ef18fb3d8c5ebd", "score": "0.44576406", "text": "function plotDataForD3JS(tsnePoints, voxelData) {\n\t\t\tvar jsonTsnePlotData = [];\n\t\t\tfor (var i=0; i < tsnePoints.length; i++) {\n\t\t\t\tpoint = {};\n\t\t\t\tpoint.x = tsnePoints[i][0];\n\t\t\t\tpoint.y = tsnePoints[i][1];\n\t\t\t\tpoint.id = voxelData.annotation[i];\n\t\t\t\tpoint.acro = voxelData.acronym[i];\n\t\t\t\tpoint.color = d2h(voxelData.colors[i]);\n\t\t\t\tjsonTsnePlotData.push(point);\n\t\t\t\tif (activeAnnotations.indexOf(point.id) == -1) {\n\t\t\t\t\tactiveAnnotations.push(point.id);\n\t\t\t\t\tactiveAnnotationsColor.push(point.color);\n\t\t\t\t}\n\t\t\t}\t\n\t\t\treturn jsonTsnePlotData;\n\t\t}", "title": "" }, { "docid": "037dfd81c481623465ee823367806d43", "score": "0.44347233", "text": "function yx(a,c){this.e=[];this.V=a;this.n=c||null;this.d=this.b=!1;this.c=void 0;this.q=this.X=this.g=!1;this.f=0;this.a=null;this.i=0}", "title": "" }, { "docid": "4ba60677015cebef73b08871f9516bb3", "score": "0.4390616", "text": "function dewater(p,w,mapView){\nvar pCoords = p.toString();\nvar wCoords = w.toString();\n\nvar pXCoords = [];\nvar pYCoords = [];\nvar wXCoords = [];\nvar wYCoords = [];\nvar mapXCoords = [];\nvar mapYCoords = [];\n\n//Split the coordinate arrays into separate X and Y coordinate arrays\n\ni = 0;\nc = 0;\ncounter = 0;\n\npCoords = pCoords.split(\",\");\n//console.log(pCoords);\nwCoords = wCoords.split(\",\");\n//console.log(wCoords);\n\n\n\n// Perimeter coordinates by X and Y\ndo {\n if (isOdd(i) === false){\n pXCoords[c] = parseFloat(pCoords[i]);\n //console.log(pXCoords[i]);\n i = i+1;\n c = c+1;\n }\n\n else if (isOdd(i) === true){\n pYCoords[counter] = parseFloat(pCoords[i]);\n //console.log(pYCoords[i]);\n i = i+1;\n counter = counter+1;\n }\n}\nwhile (i<10);\n\n//reinitialize counters\ni = 0;\nc = 0;\ncounter = 0;\n\n// Well coordinates by X and Y\ndo{\n if (isOdd(i) === false){\n wXCoords[c] = parseFloat(wCoords[i]);\n //console.log(wXCoords[i]);\n i = i+1;\n c = c+1;\n }\n\n else if (isOdd(i) === true){\n wYCoords[counter] = parseFloat(wCoords[i]);\n //console.log(wYCoords[i]);\n i = i+1;\n counter = counter+1;\n }\n }\nwhile (i < wCoords.length);\n\n// Map View Extent coordinates\n\nmapXCoords[0] = mapView[0];\nmapYCoords[0] = mapView[1];\nmapXCoords[1] = mapView[2];\nmapYCoords[1] = mapView[3];\n\n//for debugging purposes\n//console.log(\"Well 'x' coordinates \" + wXCoords);\n//console.log(\"Well 'y' coordinates \" + wYCoords);\n\n//This section defines the cell size based on a percentage for the area selected\n//the shortest dimension is what determines the cellsize\nvar scale = 0.1;\nvar cellSide = 0.0;\n\n//console.log(\"Getting cellSide\");\n\nif (Math.abs(pXCoords[0]-pXCoords[1]) > Math.abs(pYCoords[0]-pYCoords[1])){\n cellSide = Math.abs(pXCoords[0]-pXCoords[1])*scale;}\nelse if (Math.abs(pXCoords[0]-pXCoords[1]) < Math.abs(pYCoords[0]-pYCoords[1])) {\n cellSide = Math.abs(pYCoords[0]-pYCoords[1])*scale;}\nelse {\n cellSide = cellSide + Math.abs(pXCoords[0]-pXCoords[1])*scale;}\n\n//console.log(cellSide);\n//This section constructs the featurecollection polygons defining the water table elevations\n//Cells are defined at the corners, water table elevation is defined at the center of the cell\n\nvar waterTable = [];\nvar waterTableRegional = [];\nvar sum = 0.0; //This is for summing q*ln(R/r)\n\n$.ajax({\n type: 'GET',\n url: 'generate-water-table',\n dataType: 'json',\n data: {\n 'pXCoords': pXCoords,\n 'pYCoords': pYCoords,\n 'wXCoords': pXCoords,\n 'wYCoords': pYCoords,\n 'cellSide': cellSide,\n },\n success: function (data){\n if(\"success\" in data)\n waterTable = JSON.parse(data.local_Water_Table);\n console.log(waterTable);\n }\n });\n\n//console.log(\"Getting water table\");\n\n// ################################# Build the grid with polygon cells ################################################\n\n// This code builds the grid with the bounding box being the perimeter drawn by the user\n//for (long = pXCoords[0]-cellSide; long < pXCoords[2]+cellSide; long += cellSide) {\n// for (lat = pYCoords[0]-cellSide; lat < pYCoords[2]+cellSide; lat += cellSide) {\n// waterTable.push({\n// 'type': 'Feature',\n// 'geometry': {\n// 'type': 'Polygon',\n// 'coordinates': [\n// [ [long,lat],\n// [long + cellSide, lat],\n// [long + cellSide, lat + cellSide],\n// [long, lat + cellSide],\n// [long,lat]\n// ]\n// ]\n// },\n// 'properties': {\n// 'elevation' : elevationCalc(long,lat,wXCoords,wYCoords,cellSide),\n// }\n// });\n// }\n// }\n\n// This code builds the grid using the bounding box as the zoomed in view of the user\nfor (long = mapXCoords[0]-cellSide; long < mapXCoords[1]; long += cellSide) {\n for (lat = mapYCoords[0]-cellSide; lat < mapYCoords[1]; lat += cellSide){\n waterTableRegional.push({\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Polygon',\n 'coordinates': [\n [ [long,lat],\n [long + cellSide, lat],\n [long + cellSide, lat + cellSide],\n [long, lat + cellSide],\n [long,lat]\n ]\n ]\n },\n 'properties': {\n 'elevation' : elevationCalc(long,lat,wXCoords,wYCoords,cellSide),\n 'text': Math.round(Number(elevationCalc(long,lat,wXCoords,wYCoords,cellSide))),\n }\n });\n }\n }\n\n//console.log(waterTable);\n//console.log(peripheryTable);\n\n//var raster_elev = {\n// 'type': 'FeatureCollection',\n// 'crs': {\n// 'type': 'name',\n// 'properties':{\n// 'name':'EPSG:4326'\n// }\n// },\n// 'features': waterTable\n//};\nvar local_mapView = {\n 'type': 'FeatureCollection',\n 'crs': {\n 'type': 'name',\n 'properties':{\n 'name':'EPSG:4326'\n }\n },\n 'features': waterTable\n};\n\nvar raster_elev_mapView = {\n 'type': 'FeatureCollection',\n 'crs': {\n 'type': 'name',\n 'properties':{\n 'name':'EPSG:4326'\n }\n },\n 'features': waterTableRegional\n};\n//addWaterTable(raster_elev,\"Water Table Elevations\");\naddWaterTable(raster_elev_mapView,\"Water Table\");\naddWaterTable(local_mapView,\"Excavation Site\");\n}", "title": "" }, { "docid": "2986dce2ea9bf2e2035f523274d61b61", "score": "0.43795356", "text": "function createFeatures2(FaultlineData) {\n\n}", "title": "" }, { "docid": "9f91ccab4d4b14d72e8c5095f4c478e5", "score": "0.43739414", "text": "constructor(x=[0.0], y=[0.0]){\r\n if (!Array.isArray(x) | !Array.isArray(y)){\r\n throw \"Input must be arrays!\";\r\n }\r\n if (x.length != y.length){\r\n throw \"Array lengths are not equal!\";\r\n }\r\n this.length = x.length;\r\n this.real = x;\r\n this.imag = y;\r\n }", "title": "" }, { "docid": "cb2ebce565bc29e6a1091d60090e7071", "score": "0.43724856", "text": "function coordinateArray(callback) {\n var rawFile = new XMLHttpRequest();\n rawFile.open(\"GET\", \"Temp/temp.dat\", false);\n rawFile.onreadystatechange = function () {\n if (rawFile.readyState === 4) {\n if (rawFile.status === 200) {\n var tdz = rawFile.responseText;\n if (callback && typeof(callback) === \"function\") {\n callback(tdz);\n }\n }\n }\n return null;\n };\n rawFile.send(null);\n }", "title": "" }, { "docid": "e71de6808604a25b4acd355af8a79f0c", "score": "0.43678138", "text": "projectPosition(xyz) {\n const [X, Y] = this.projectFlat(xyz);\n const Z = (xyz[2] || 0) * this.distanceScales.unitsPerMeter[2];\n return [X, Y, Z];\n }", "title": "" }, { "docid": "e2e849fd4f5b2128b4382ede59977a28", "score": "0.43445104", "text": "getLatestDataFromAtlas() {\n\t\tvar dat = [];\n\n\t\tthis.channelTags.forEach((r, i) => {\n\t\t\tvar row = this.getAtlasCoordByTag(r.tag);\n\t\t\tvar lastIndex = row.data.times.length - 1;\n\t\t\tdat.push({tag:row.tag, data:{\n\t\t\t\tcount:row.data.count,\n\t\t\t\ttime: row.data.times[lastIndex],\n\t\t\t\tamplitude: row.data.amplitudes[lastIndex],\n\t\t\t\tslice:{delta:row.data.slices.delta[lastIndex], theta:row.data.slices.theta[lastIndex], alpha1:row.data.slices.alpha1[lastIndex], alpha2:row.data.slices.alpha2[lastIndex], beta:row.data.slices.beta[lastIndex], gamma:row.data.slices.gamma[lastIndex]},\n\t\t\t\tmean:{delta:row.data.means.delta[lastIndex], theta:row.data.means.theta[lastIndex], alpha1: row.data.means.alpha1[lastIndex], alpha2: row.data.means.alpha2[lastIndex], beta: row.data.means.beta[lastIndex], gamma: row.data.means.gamma[lastIndex]}}});\n\t\t});\n\t\treturn dat;\n\t}", "title": "" }, { "docid": "f041b5edbcdbd7579be9a7f4dd506a59", "score": "0.4339808", "text": "function tagParse(inputTags) {\n inputTags = inputTags.replace(/ /g, \"\");\n inputTags = inputTags.split(\",\");\n return inputTags;\n}", "title": "" }, { "docid": "abbe3e88c373bda70a208e8c9584812c", "score": "0.43390483", "text": "function buildBulkAddTag(events, tag) {\n let bulkUpdates = [];\n\n events.forEach(event => {\n\n let tags = [];\n\n if (event.fields) {\n if (event.fields.tags) {\n tags = event.fields.tags;\n if (tags.indexOf(tag) > -1) {\n return;\n }\n }\n }\n\n tags.push(tag);\n\n bulkUpdates.push({\n \"update\": {\n \"_index\": event._index,\n \"_type\": event._type,\n \"_id\": event._id\n }\n });\n bulkUpdates.push({\n \"doc\": {\n tags: tags\n }\n });\n\n });\n\n return bulkUpdates;\n }", "title": "" }, { "docid": "a78058d26920698570af5b9dc75c4ba9", "score": "0.4334517", "text": "function transform(xs, options) {\n if (options.tilt || options.offset) {\n var points = xs.map(function (coords) { return Geometric3.vector(coords[0], coords[1], coords[2]); });\n if (options.tilt) {\n points.forEach(function (point) {\n point.rotate(options.tilt);\n });\n }\n if (options.offset) {\n points.forEach(function (point) {\n point.addVector(options.offset);\n });\n }\n return points.map(function (point) { return [point.x, point.y, point.z]; });\n }\n else {\n return xs;\n }\n}", "title": "" }, { "docid": "1a2d2c322bd26f7c049562f85c931366", "score": "0.43315294", "text": "function quad(a, b, c, d, e) {\n\n var t1 = subtract(vertices[b], vertices[a]);\n var t2 = subtract(vertices[c], vertices[b]);\n var normal = cross(t1, t2);\n normal = vec3(normal);\n\n pointsArray.push(vertices[a]);\n colorsArray.push(vertexColors[e]);\n normalsArray.push(normal);\n texCoordsArray.push(texCoord[0]);\n\n pointsArray.push(vertices[b]);\n colorsArray.push(vertexColors[e]);\n normalsArray.push(normal);\n texCoordsArray.push(texCoord[1]);\n\n pointsArray.push(vertices[c]);\n colorsArray.push(vertexColors[e]);\n normalsArray.push(normal);\n texCoordsArray.push(texCoord[2]);\n\n pointsArray.push(vertices[a]);\n colorsArray.push(vertexColors[e]);\n normalsArray.push(normal);\n texCoordsArray.push(texCoord[0]);\n\n pointsArray.push(vertices[c]);\n colorsArray.push(vertexColors[e]);\n normalsArray.push(normal);\n texCoordsArray.push(texCoord[2]);\n\n pointsArray.push(vertices[d]);\n colorsArray.push(vertexColors[e]);\n normalsArray.push(normal);\n texCoordsArray.push(texCoord[3]);\n}", "title": "" }, { "docid": "327f45c04a83185b68c05016873a854a", "score": "0.43255767", "text": "static dejon(origin, a, b, c, d, scale = 100, loops = 10) {\n let points = []\n let xt = 1, yt = 1\n for (let i = 0; i < loops; i++) {\n let nextx = (Math.sin(a * yt) - Math.cos(b * xt))\n let nexty = (Math.sin(c * xt) - Math.cos(d * yt))\n points.push(createVector(scale * xt + origin.x + scale, scale * yt + origin.y - scale))\n xt = nextx\n yt = nexty\n }\n return points\n }", "title": "" }, { "docid": "ed071033cb09df463874efab1f5c9509", "score": "0.43226346", "text": "function parseTransformArray(model) {\n var first = null;\n var node;\n var previous;\n var lookupCounter = 0;\n model.transforms.forEach(function (t) {\n if (transform_1.isCalculate(t)) {\n node = new CalculateNode(t);\n }\n else if (transform_1.isFilter(t)) {\n // Automatically add a parse node for filters with filter objects\n var parse = {};\n var filter = t.filter;\n var val = null;\n // For EqualFilter, just use the equal property.\n // For RangeFilter and OneOfFilter, all array members should have\n // the same type, so we only use the first one.\n if (filter_1.isEqualFilter(filter)) {\n val = filter.equal;\n }\n else if (filter_1.isRangeFilter(filter)) {\n val = filter.range[0];\n }\n else if (filter_1.isOneOfFilter(filter)) {\n val = (filter.oneOf || filter['in'])[0];\n } // else -- for filter expression, we can't infer anything\n if (val) {\n if (datetime_1.isDateTime(val)) {\n parse[filter['field']] = 'date';\n }\n else if (vega_util_1.isNumber(val)) {\n parse[filter['field']] = 'number';\n }\n else if (vega_util_1.isString(val)) {\n parse[filter['field']] = 'string';\n }\n }\n if (util_1.keys(parse).length > 0) {\n var parseNode = new formatparse_1.ParseNode(parse);\n if (!first) {\n first = parseNode;\n }\n else {\n parseNode.parent = previous;\n }\n previous = parseNode;\n }\n node = new FilterNode(model, t.filter);\n }\n else if (transform_1.isBin(t)) {\n node = bin_1.BinNode.makeBinFromTransform(model, t);\n }\n else if (transform_1.isTimeUnit(t)) {\n node = timeunit_1.TimeUnitNode.makeFromTransfrom(model, t);\n }\n else if (transform_1.isSummarize(t)) {\n node = aggregate_1.AggregateNode.makeFromTransform(model, t);\n }\n else if (transform_1.isLookup(t)) {\n node = LookupNode.make(model, t, lookupCounter++);\n }\n else {\n log.warn(log.message.invalidTransformIgnored(t));\n return;\n }\n if (!first) {\n first = node;\n }\n else {\n node.parent = previous;\n }\n previous = node;\n });\n var last = node;\n return { first: first, last: last };\n}", "title": "" }, { "docid": "4e2e61e4ec8e0e1a1ae8ce29ff1e96bd", "score": "0.4317444", "text": "function newDatapoint3(){\r\n\t\tarray[0].newdatapoint = new Array();\r\n\t\tfor(var i = 0; i < array[0].length; i++){\r\n\t\t\tarray[0].newdatapoint[i] = {};array[0].newdatapoint[i].name = array[0][i].name;array[0].newdatapoint[i].color = array[0][i].color;array[0].newdatapoint[i].x = array[0][i].x;array[0].newdatapoint[i].y = array[0][i].y;array[0].newdatapoint[i].x_guiyi = array[0][i].x_guiyi;array[0].newdatapoint[i].y_guiyi = array[0][i].y_guiyi;array[0].newdatapoint[i].dis = 0;\r\n\t\t}\r\n\t\tfor(var index=1; index<array.length; index++){\r\n\t\t\tvar xMax_rotate = 0, yMax_rotate = 0, xMin_rotate = Number.POSITIVE_INFINITY, yMin_rotate = Number.POSITIVE_INFINITY;\r\n\t\t\t//var sum_rotate = 0;\r\n\t\t\tvar rotate = new Array();\r\n\t\t\tvar xMax_symmetry = 0, yMax_symmetry = 0, xMin_symmetry = Number.POSITIVE_INFINITY, yMin_symmetry = Number.POSITIVE_INFINITY;\r\n\t\t\t//var sum_symmetry = 0;\r\n\t\t\tvar symmetry = new Array();\r\n\t\t\tvar xMax_fz = 0, yMax_fz = 0, xMin_fz = Number.POSITIVE_INFINITY, yMin_fz = Number.POSITIVE_INFINITY;\r\n\t\t\tvar sum_fz = 0;\r\n\t\t\tarray[index].newdatapoint = new Array();\r\n\t\t\t//init new position\r\n\t\t\tfor(var i = 0; i < array[index].length; i++){\r\n\t\t\t\tarray[index].newdatapoint[i] = {};\r\n\t\t\t\tarray[index].newdatapoint[i].name = array[index][i].name;\r\n\t\t\t\tarray[index].newdatapoint[i].color = array[index][i].color;\r\n\t\t\t\tarray[index].newdatapoint[i].x = array[index][i].x;\r\n\t\t\t\tarray[index].newdatapoint[i].y = array[index][i].y;\r\n\t\t\t\tarray[index].newdatapoint[i].dis = 0;\r\n\t\t\t\tif(array[index].newdatapoint[i].x > xMax_fz) xMax_fz = array[index].newdatapoint[i].x;\r\n\t\t\t\tif(array[index].newdatapoint[i].x < xMin_fz) xMin_fz = array[index].newdatapoint[i].x;\r\n\t\t\t\tif(array[index].newdatapoint[i].y > yMax_fz) yMax_fz = array[index].newdatapoint[i].y;\r\n\t\t\t\tif(array[index].newdatapoint[i].y < yMin_fz) yMin_fz = array[index].newdatapoint[i].y;\r\n\t\t\t}\r\n\t\t\t//normalization \r\n\t\t\tfor(var i = 0; i < array[index].length; i++){\r\n\t\t\t\tarray[index][i].x_guiyi = guiyi(xMax_fz, xMin_fz, array[index][i].x);\r\n\t\t\t\tarray[index][i].y_guiyi = guiyi(yMax_fz, yMin_fz, array[index][i].y);\r\n\t\t\t\tarray[index].newdatapoint[i].x_guiyi = guiyi(xMax_fz, xMin_fz, array[index][i].x);\r\n\t\t\t\tarray[index].newdatapoint[i].y_guiyi = guiyi(yMax_fz, yMin_fz, array[index][i].y);\r\n\t\t\t}\r\n\t\t //computer adajcent years distances and angle\r\n\t\t // updata cy_new to campare with the rotate and symmetry. \r\n\t\t\tsum_fz = 0;\r\n\t\t\tfor (var i = 0; i < array[index - 1].newdatapoint.length; i++) {\r\n\t\t\t for (var j = 0; j < array[index].newdatapoint.length; j++) {\r\n\t\t\t if (array[index - 1].newdatapoint[i].name == array[index].newdatapoint[j].name) {\r\n\t\t\t var dis = (array[index - 1].newdatapoint[i].x_guiyi - array[index].newdatapoint[j].x_guiyi) * (array[index - 1].newdatapoint[i].x_guiyi - array[index].newdatapoint[j].x_guiyi) +\r\n\t\t\t\t\t\t\t\t (array[index - 1].newdatapoint[i].y_guiyi - array[index].newdatapoint[j].y_guiyi) * (array[index - 1].newdatapoint[i].y_guiyi - array[index].newdatapoint[j].y_guiyi);\r\n\t\t\t var result = Math.sqrt(dis);\r\n\t\t\t sum_fz += result;\r\n\t\t\t break;\r\n\t\t\t }\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t\tarray[index].cy_new = sum_fz / array[index].length;\r\n\r\n\t\t\tvar avg_rotate_angle = 0;\r\n\t\t\tvar sum_rotate_angle = 0;\r\n\t\t\tfor(var i = 0; i < array[index -1].newdatapoint.length; i++){\r\n\t\t\t\tfor(var j = 0; j < array[index].newdatapoint.length; j++){\r\n\t\t\t\t\tif(array[index -1].newdatapoint[i].name == array[index].newdatapoint[j].name){\r\n\t\t\t\t\t\tsum_rotate_angle+= acos0(array[index -1].newdatapoint[i].x, array[index -1].newdatapoint[i].y, array[index].newdatapoint[j].x, array[index].newdatapoint[j].y);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar max_symmetry = new Array();\r\n\t\t\tfor(var i=0;i<3;i++){\r\n\t\t\t\tmax_symmetry[i] = {};\r\n\t\t\t\tmax_symmetry[i].dis = 0;\r\n\t\t\t\tmax_symmetry[i].index0 = 0;\r\n\t\t\t\tmax_symmetry[i].index1 = 0;\r\n\t\t\t}\r\n\t\t\tfor(var i = 0; i < array[index -1].newdatapoint.length; i++){\r\n\t\t\t\tfor(var j = 0; j < array[index].newdatapoint.length; j++){\r\n\t\t\t\t\tif(array[index -1].newdatapoint[i].name == array[index].newdatapoint[j].name){\r\n\t\t\t\t\t\tvar distances = Math.pow(array[index -1].newdatapoint[i].x - array[index].newdatapoint[j].x,2) +\r\n\t\t\t\t\t\t\t\t\t Math.pow(array[index -1].newdatapoint[i].y - array[index].newdatapoint[j].y,2);\r\n\t\t\t\t\t\tmax_symmetry[i] = {};\r\n\t\t\t\t\t\tmax_symmetry[i].dis = distances;\r\n\t\t\t\t\t\tmax_symmetry[i].index0 = j;\r\n\t\t\t\t\t\tmax_symmetry[i].index1 = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t max_symmetry.sort(compare('dis'));\r\n\t\t\t//rotate\r\n\t\t\tavg_rotate_angle = sum_rotate_angle/array[index].newdatapoint.length;\t\t\t\r\n\t\t\tfor(var i = 0; i < array[index - 1].length; i++){\r\n\t\t\t\tfor(var j = 0; j < array[index].length; j++){\r\n\t\t\t\t\tif(array[index - 1][i].name == array[index][j].name){\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar A = 180 / Math.PI * Math.atan(array[index][i].y/array[index][i].x);\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(A < 0 && array[index][i].x < 0 && array[index][i].y > 0) A = 180 + A;\r\n\t\t\t\t\t\tif(A < 0 && array[index][i].x > 0 && array[index][i].y < 0) A = 360 + A;\r\n\t\t\t\t\t\tif(A > 0 && array[index][i].x < 0 && array[index][i].y < 0) A = 180 + A; \r\n\t\t\t\t\t\tvar B2 = Math.PI / 180 * (A - avg_rotate_angle);\r\n\t\t\t\t\t\tvar dis = array[index][i].x * array[index][i].x + array[index][i].y * array[index][i].y;\r\n\t\t\t\t\t\tvar result = Math.sqrt(dis);\t\t\t\t\t\t\t\r\n\t\t\t\t\t\trotate[i] = {};\r\n\t\t\t\t\t\trotate[i].name = array[index][i].name;\r\n\t\t\t\t\t\trotate[i].color = array[index][i].color;\r\n\t\t\t\t\t\trotate[i].x = result * Math.cos(B2);\r\n\t\t\t\t\t\trotate[i].y = result * Math.sin(B2);\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(rotate[i].x > xMax_rotate) xMax_rotate = rotate[i].x;\r\n\t\t\t\t\t\tif(rotate[i].x < xMin_rotate) xMin_rotate = rotate[i].x;\r\n\t\t\t\t\t\tif(rotate[i].y > yMax_rotate) yMax_rotate = rotate[i].y;\r\n\t\t\t\t\t\tif(rotate[i].y < yMin_rotate) yMin_rotate = rotate[i].y;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar avg_symmetry_angle =0;\r\n\t\t\tvar avg_symmetry_k =0;\r\n\t\t\tfor(var i=0;i<3;i++){\r\n\t\t\t\tvar x0 = array[index].newdatapoint[max_symmetry[i].index0].x;\r\n\t\t\t\tvar y0 = array[index].newdatapoint[max_symmetry[i].index0].y;\r\n //console.log\r\n\t\t\t\tvar x1 = array[index - 1].newdatapoint[max_symmetry[i].index1].x;\r\n\t\t\t\tvar y1 = array[index - 1].newdatapoint[max_symmetry[i].index1].y;\r\n\t\t\t\tvar angle = Math.atan((y1 - y0)/(x1 - x0));\r\n\t\t\t\tvar k = -1/((y1 - y0)/(x1 - x0));\r\n\t\t\t\tif(i == 0){\r\n\t\t\t\t\tavg_symmetry_angle = Math.atan((y1 - y0)/(x1 - x0));\r\n\t\t\t\t\tavg_symmetry_k\t = -1/((y1 - y0)/(x1 - x0));\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tavg_symmetry_angle = (avg_symmetry_angle * 29 + angle)/30;\r\n\t\t\t\t avg_symmetry_k = (avg_symmetry_k *29 + k)/30;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//symmetry\t\t\r\n\t\t\tfor(var i = 0; i < array[index - 1].length; i++){\r\n\t\t\t\tfor(var j = 0; j < array[index].length; j++){\r\n\t\t\t\t\tif(array[index - 1][i].name == array[index][j].name){\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar x0 = array[index][i].x;\r\n\t\t\t\t\t\tvar y0 = array[index][i].y;\t\r\n\t\t\t\t\t\tvar k = avg_symmetry_k;\r\n\t\t\t\t\t\tsymmetry[i] = {};\r\n\t\t\t\t\t\tsymmetry[i].name = array[index].newdatapoint[i].name;\r\n\t\t\t\t\t\tsymmetry[i].color = array[index].newdatapoint[i].color;\r\n\t\t\t\t\t\tsymmetry[i].x = (2*k*y0-(k*k-1)*x0)/(1+k*k);\r\n\t\t\t\t\t\tsymmetry[i].y = (2*k*x0-(1-k*k)*y0)/(1+k*k);\r\n\t\t\t\t\t\tif(symmetry[i].x > xMax_symmetry) xMax_symmetry = symmetry[i].x;\r\n\t\t\t\t\t\tif(symmetry[i].x < xMin_symmetry) xMin_symmetry = symmetry[i].x;\r\n\t\t\t\t\t\tif(symmetry[i].y > yMax_symmetry) yMax_symmetry = symmetry[i].y;\r\n\t\t\t\t\t\tif(symmetry[i].y < yMin_symmetry) yMin_symmetry = symmetry[i].y;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(var i = 0; i < rotate.length; i++){\r\n\t\t\t\trotate[i].x_guiyi = guiyi(xMax_rotate, xMin_rotate, rotate[i].x);\r\n\t\t\t\trotate[i].y_guiyi = guiyi(yMax_rotate, yMin_rotate, rotate[i].y);\r\n\t\t\t}\r\n\t\t\tfor(var i = 0; i < symmetry.length; i++){\r\n\t\t\t\tsymmetry[i].x_guiyi = guiyi(xMax_symmetry, xMin_symmetry, symmetry[i].x);\r\n\t\t\t\tsymmetry[i].y_guiyi = guiyi(yMax_symmetry, yMin_symmetry, symmetry[i].y);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//compute distance\r\n\t\t\tvar sum_rotate = 0;\r\n\t\t\tfor(var i = 0; i < array[index - 1].newdatapoint.length; i++){\r\n\t\t\t\tfor(var j = 0; j < rotate.length; j++){\r\n\t\t\t\t\tif(array[index - 1].newdatapoint[i].name == rotate[j].name){\r\n\t\t\t\t\t\tvar dis = (array[index - 1].newdatapoint[i].x_guiyi - rotate[j].x_guiyi) * (array[index - 1].newdatapoint[i].x_guiyi - rotate[j].x_guiyi) + \r\n\t\t\t\t\t\t\t\t (array[index - 1].newdatapoint[i].y_guiyi - rotate[j].y_guiyi) * (array[index - 1].newdatapoint[i].y_guiyi - rotate[j].y_guiyi);\r\n\t\t\t\t\t\tvar result = Math.sqrt(dis);\r\n\t\t\t\t\t\tsum_rotate += result;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar sum_symmetry= 0;\r\n\t\t\tfor(var i = 0; i < array[index - 1].newdatapoint.length; i++){\r\n\t\t\t\tfor(var j = 0; j < symmetry.length; j++){\r\n\t\t\t\t\tif(array[index - 1].newdatapoint[i].name == symmetry[j].name){\r\n\t\t\t\t\t\tvar dis = (array[index - 1].newdatapoint[i].x_guiyi - symmetry[j].x_guiyi) * (array[index - 1].newdatapoint[i].x_guiyi - symmetry[j].x_guiyi) + \r\n\t\t\t\t\t\t\t\t (array[index - 1].newdatapoint[i].y_guiyi - symmetry[j].y_guiyi) * (array[index - 1].newdatapoint[i].y_guiyi - symmetry[j].y_guiyi);\r\n\t\t\t\t\t\tvar result = Math.sqrt(dis);\r\n\t\t\t\t\t\tsum_symmetry+=result;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (sum_rotate / rotate.length < array[index].cy_new && sum_rotate < sum_symmetry) {\r\n\t\t\t\tarray[index].cy_new = sum_rotate/rotate.length;\r\n\t\t\t\tarray[index].newdatapoint = rotate;\r\n\t\t\t} else if (sum_symmetry / symmetry.length < array[index].cy_new && sum_symmetry < sum_rotate) {\r\n\t\t\t\tarray[index].cy_new = sum_symmetry/symmetry.length;\r\n\t\t\t\tarray[index].newdatapoint = symmetry;\r\n\t\t\t}else{\r\n\t\t\t\tfor(var i = 0; i < array[index].length; i++){\r\n\t\t\t\t\tarray[index].newdatapoint[i] = {};\r\n\t\t\t\t\tarray[index].newdatapoint[i].name = array[index][i].name;\r\n\t\t\t\t\tarray[index].newdatapoint[i].color = array[index][i].color;\r\n\t\t\t\t\tarray[index].newdatapoint[i].x = array[index][i].x;\r\n\t\t\t\t\tarray[index].newdatapoint[i].x_guiyi = array[index][i].x_guiyi;\r\n\t\t\t\t\tarray[index].newdatapoint[i].y = array[index][i].y;\r\n\t\t\t\t\tarray[index].newdatapoint[i].y_guiyi = array[index][i].y_guiyi;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor(var i=0;i<array[index-1].newdatapoint.length;i++){\r\n\t\t\t\tfor(var j=0;j<array[index].newdatapoint.length;j++){\r\n\t\t\t\t\tif(array[index - 1].newdatapoint[i].name == array[index].newdatapoint[j].name){\r\n\t\t\t\t\t\t var dis= (array[index - 1].newdatapoint[i].x_guiyi - array[index].newdatapoint[j].x_guiyi) * (array[index - 1].newdatapoint[i].x_guiyi - array[index].newdatapoint[j].x_guiyi) + \r\n\t\t\t\t\t\t\t\t (array[index - 1].newdatapoint[i].y_guiyi - array[index].newdatapoint[j].y_guiyi) * (array[index - 1].newdatapoint[i].y_guiyi - array[index].newdatapoint[j].y_guiyi);\r\n\t\t\t\t\t\t array[index].newdatapoint[j].dis = Math.sqrt(dis);\r\n\t\t\t\t\t\t break;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "91ca9573a7b8e0b7e770f5f4128b414c", "score": "0.43171868", "text": "function batchSimpleLTFit(ltStacks,startYear,endYear,indexNames,bandPropertyName,arrayMode,maxSegs){\r\n if(bandPropertyName === null || bandPropertyName === undefined){\r\n bandPropertyName = 'band';\r\n }\r\n // Get band/index names if not provided\r\n if(indexNames === null || indexNames === undefined){\r\n indexNames = ltStacks.aggregate_histogram(bandPropertyName).keys().getInfo();\r\n }\r\n\r\n // Iterate across each band/index and get the fitted, mag, slope, etc\r\n var lt_fit;\r\n indexNames.map(function(bn){\r\n var ltt = ltStacks.filter(ee.Filter.eq('band',bn)).max();\r\n\r\n if(lt_fit === undefined){\r\n lt_fit = simpleLTFit(ltt,startYear,endYear, bn,arrayMode,maxSegs);\r\n }else{\r\n lt_fit = getImagesLib.joinCollections(lt_fit, simpleLTFit(ltt,startYear,endYear,bn,arrayMode,maxSegs), false);\r\n }\r\n });\r\n return lt_fit;\r\n}", "title": "" }, { "docid": "37d8ecd62e2a99415e35b4f15c265ed9", "score": "0.43167454", "text": "function parallelCoordinates(args, options) {\n var types = args.types,\n support = args.support,\n scores = args.scores,\n options = options || {};\n\n var fieldNames = _.keys(support[0]);\n\n var data = _.zip(support, scores).map(function (x) {\n return _.extend({ prob: Math.exp(x[1]) }, x[0]);\n });\n\n var overallScale = {\n name: \"ord\",\n type: \"ordinal\",\n points: true,\n range: \"width\",\n domain: fieldNames\n };\n\n var probWidthScale = {\n name: 'probWidth',\n type: \"linear\",\n range: [1, 3],\n domain: { data: 'values', field: 'prob' }\n };\n\n var probOpacityScale = {\n name: 'probOpacity',\n type: \"log\",\n range: [0.2, 1],\n domain: { data: 'values', field: 'prob' }\n };\n\n var individualScales = _.map(fieldNames, function (name) {\n var domain = options.bounds && options.bounds[name] ? options.bounds[name] : { data: 'values', field: name };\n\n return {\n name: name,\n type: \"linear\",\n range: \"height\",\n zero: false,\n nice: true,\n domain: domain\n };\n });\n\n var individualAxes = _.map(fieldNames, function (name) {\n return {\n type: 'y',\n scale: name,\n offset: { scale: 'ord', value: name }\n };\n });\n\n var vegaSpec = {\n data: [{ name: 'values', values: data }, { name: 'fields', values: fieldNames }],\n scales: [overallScale, probWidthScale, probOpacityScale].concat(individualScales),\n axes: individualAxes,\n marks: [{\n type: \"group\",\n from: { data: \"values\" },\n marks: [{\n type: \"line\",\n from: { data: \"fields\" },\n properties: {\n enter: {\n x: { scale: \"ord\", field: \"data\" },\n y: {\n scale: { datum: \"data\" },\n field: { parent: { datum: \"data\" } }\n },\n stroke: { value: \"steelblue\" },\n strokeWidth: {\n field: { \"parent\": \"prob\" },\n scale: \"probWidth\"\n },\n strokeOpacity: {\n field: { \"parent\": \"prob\" },\n scale: \"probOpacity\"\n }\n\n }\n }\n }]\n }, {\n \"type\": \"text\",\n \"from\": { \"data\": \"fields\" },\n \"properties\": {\n \"enter\": {\n \"x\": { \"scale\": \"ord\", \"field\": \"data\", \"offset\": -8 },\n \"y\": { \"field\": { \"group\": \"height\" }, \"offset\": 6 },\n \"fontWeight\": { \"value\": \"bold\" },\n \"fill\": { \"value\": \"black\" },\n \"text\": { \"field\": \"data\" },\n \"align\": { \"value\": \"right\" },\n \"baseline\": { \"value\": \"top\" }\n }\n }\n }]\n };\n renderSpec(vegaSpec, _.extend({ regularVega: true }, options));\n}", "title": "" }, { "docid": "25491d6ec07f89182f6be456988db421", "score": "0.43161106", "text": "constructor(bufferOffsets = [], samplerOffsets = [], flexibleSet = 0) {\n this.bufferOffsets = bufferOffsets;\n this.samplerOffsets = samplerOffsets;\n this.flexibleSet = flexibleSet;\n }", "title": "" }, { "docid": "dc453ac14637a61e30f7c922ad898107", "score": "0.4313586", "text": "function printCoordinates(pointsArray, pointsArrayNameAndComments){\n console.log(pointsArrayNameAndComments)\n for(let pnt of pointsArray){ //had to splice in one element at a time to avoid getting a multidimensional array\n console.log(\" \" + pnt.toString());\n }\n}", "title": "" }, { "docid": "b76d0723e0a08a9c421341b48db60272", "score": "0.43103766", "text": "function AGFace(x1, y1, z1, x2, y2, z2, x3, y3, z3) {\n\n\n this.poly = {\n p1:{x: x1, y: y1, z: z1},\n p2:{x: x2, y: y2, z: z2},\n p3:{x: x3, y: y3, z: z3},\n txz: [{x:x1, y:z1}, {x:x2, y:z2}, {x:x3, y:z3}],\n txy: [{x:x1, y:y1}, {x:x2, y:y2}, {x:x3, y:y3}],\n tyz: [{x:y1, y:z1}, {x:y2, y:z2}, {x:y3, y:z3}]\n };\n\n this.tex = [];\n this.normal = [];\n this.plane = \"\";\n\n //Set Face Plane\n if(x1.toFixed(2) == x2.toFixed(2) && x1.toFixed(2) == x3.toFixed(2)) {\n this.plane = \"YZ\";\n }\n else if(y1.toFixed(2) == y2.toFixed(2) && y1.toFixed(2) == y3.toFixed(2)) {\n this.plane = \"XZ\";\n }\n else if(z1.toFixed(2) == z2.toFixed(2) && z1.toFixed(2) == z3.toFixed(2)) {\n this.plane = \"XY\";\n }\n\n // Allows detection of a collision during lateral movement.\n // ray is a vector indicating the direction of the camera\n // in the standard XYZ space.\n}", "title": "" }, { "docid": "53a77d432e2e30bed018be9a406ce8b7", "score": "0.43024537", "text": "function explodeData(data) {\r\n const counter = [];\r\n let count = 0;\r\n\r\n const time_stamp = [];\r\n\r\n const hours = [];\r\n const minutes = [];\r\n\r\n const date = [];\r\n const time = [];\r\n\r\n const day = [];\r\n const month = [];\r\n const year = [];\r\n\r\n\r\n const indoorTemp = [];\r\n const outdoorTemp = [];\r\n\r\n const marge = [];\r\n\r\n\r\n // extracting time_stamp, indoor and outdoor temperature\r\n data.forEach(val => {\r\n indoorTemp.push(Number(val.room)); // extract the indoor temperature value from the dataset\r\n outdoorTemp.push(Number(val.outdoor)); // extract the outdoor temperature form the dataset\r\n time_stamp.push(val.date) // extract the timestamp\r\n counter.push(count ++);\r\n });\r\n\r\n // seperating the date from the time in the time stamp\r\n time_stamp.forEach(val => {\r\n const sData = val.split(' ');\r\n date.push(sData[0]); // extracting the hours from the time array\r\n time.push(sData[1]); // extracting the minutes from the time array\r\n });\r\n\r\n // seperate the date into day, month and year\r\n date.forEach(dt => {\r\n const ddate = dt.split('/');\r\n day.push(Number(ddate[0]));\r\n month.push(Number(ddate[1]));\r\n year.push(Number(ddate[2]));\r\n });\r\n\r\n // seperating the hours and minutes from the time array\r\n time.forEach(val => {\r\n const sData = val.split(':');\r\n hours.push(Number(sData[0])); // extracting the hours from the time array\r\n minutes.push(Number(sData[1])); // extracting the minutes from the time array\r\n });\r\n\r\n // combine all the extracted values into one json dataset\r\n for (let i = 0; i < data.length; i++) {\r\n const hr = hours[i];\r\n const mi = minutes[i];\r\n const d = day[i];\r\n const m = month[i];\r\n const y = year[i];\r\n const inT = indoorTemp[i];\r\n const outT = outdoorTemp[i];\r\n const c = counter[i];\r\n\r\n const mrg = {\r\n hours: hr,\r\n minutes: mi,\r\n day: d,\r\n month: m,\r\n year: y,\r\n indoorTemp: inT,\r\n outdoorTemp: outT,\r\n counter: c\r\n }\r\n\r\n marge.unshift(mrg);\r\n }\r\n\r\n return marge;\r\n}", "title": "" }, { "docid": "84465185e49cb2614c6d6420a637e871", "score": "0.43016207", "text": "function tag(z) {\n return attach_tag(\"complex\", z);\n }", "title": "" }, { "docid": "5c904657e9f6b35898256fa797bb2fa7", "score": "0.43009165", "text": "function t$a(t,d){1===d.attributeTextureCoordinates&&(t.attributes.add(\"uv0\",\"vec2\"),t.varyings.add(\"vuv0\",\"vec2\"),t.vertex.code.add(t$g`void forwardTextureCoordinates() {\nvuv0 = uv0;\n}`)),2===d.attributeTextureCoordinates&&(t.attributes.add(\"uv0\",\"vec2\"),t.varyings.add(\"vuv0\",\"vec2\"),t.attributes.add(\"uvRegion\",\"vec4\"),t.varyings.add(\"vuvRegion\",\"vec4\"),t.vertex.code.add(t$g`void forwardTextureCoordinates() {\nvuv0 = uv0;\nvuvRegion = uvRegion;\n}`)),0===d.attributeTextureCoordinates&&t.vertex.code.add(t$g`void forwardTextureCoordinates() {}`);}", "title": "" }, { "docid": "02b17f614cebe0c2c87422d34d5f24f8", "score": "0.42974484", "text": "function parse_PtgExtraArray(blob, length, opts) {\n\tvar rows = 0, cols = 0;\n\tif(opts.biff == 12) {\n\t\trows = blob.read_shift(4); // DRw\n\t\tcols = blob.read_shift(4); // DCol\n\t} else {\n\t\tcols = 1 + blob.read_shift(1); //DColByteU\n\t\trows = 1 + blob.read_shift(2); //DRw\n\t}\n\tif(opts.biff >= 2 && opts.biff < 8) { --rows; if(--cols == 0) cols = 0x100; }\n\t// $FlowIgnore\n\tfor(var i = 0, o = []; i != rows && (o[i] = []); ++i)\n\t\tfor(var j = 0; j != cols; ++j) o[i][j] = parse_SerAr(blob, opts.biff);\n\treturn o;\n}", "title": "" }, { "docid": "02b17f614cebe0c2c87422d34d5f24f8", "score": "0.42974484", "text": "function parse_PtgExtraArray(blob, length, opts) {\n\tvar rows = 0, cols = 0;\n\tif(opts.biff == 12) {\n\t\trows = blob.read_shift(4); // DRw\n\t\tcols = blob.read_shift(4); // DCol\n\t} else {\n\t\tcols = 1 + blob.read_shift(1); //DColByteU\n\t\trows = 1 + blob.read_shift(2); //DRw\n\t}\n\tif(opts.biff >= 2 && opts.biff < 8) { --rows; if(--cols == 0) cols = 0x100; }\n\t// $FlowIgnore\n\tfor(var i = 0, o = []; i != rows && (o[i] = []); ++i)\n\t\tfor(var j = 0; j != cols; ++j) o[i][j] = parse_SerAr(blob, opts.biff);\n\treturn o;\n}", "title": "" }, { "docid": "02b17f614cebe0c2c87422d34d5f24f8", "score": "0.42974484", "text": "function parse_PtgExtraArray(blob, length, opts) {\n\tvar rows = 0, cols = 0;\n\tif(opts.biff == 12) {\n\t\trows = blob.read_shift(4); // DRw\n\t\tcols = blob.read_shift(4); // DCol\n\t} else {\n\t\tcols = 1 + blob.read_shift(1); //DColByteU\n\t\trows = 1 + blob.read_shift(2); //DRw\n\t}\n\tif(opts.biff >= 2 && opts.biff < 8) { --rows; if(--cols == 0) cols = 0x100; }\n\t// $FlowIgnore\n\tfor(var i = 0, o = []; i != rows && (o[i] = []); ++i)\n\t\tfor(var j = 0; j != cols; ++j) o[i][j] = parse_SerAr(blob, opts.biff);\n\treturn o;\n}", "title": "" }, { "docid": "02b17f614cebe0c2c87422d34d5f24f8", "score": "0.42974484", "text": "function parse_PtgExtraArray(blob, length, opts) {\n\tvar rows = 0, cols = 0;\n\tif(opts.biff == 12) {\n\t\trows = blob.read_shift(4); // DRw\n\t\tcols = blob.read_shift(4); // DCol\n\t} else {\n\t\tcols = 1 + blob.read_shift(1); //DColByteU\n\t\trows = 1 + blob.read_shift(2); //DRw\n\t}\n\tif(opts.biff >= 2 && opts.biff < 8) { --rows; if(--cols == 0) cols = 0x100; }\n\t// $FlowIgnore\n\tfor(var i = 0, o = []; i != rows && (o[i] = []); ++i)\n\t\tfor(var j = 0; j != cols; ++j) o[i][j] = parse_SerAr(blob, opts.biff);\n\treturn o;\n}", "title": "" }, { "docid": "02b17f614cebe0c2c87422d34d5f24f8", "score": "0.42974484", "text": "function parse_PtgExtraArray(blob, length, opts) {\n\tvar rows = 0, cols = 0;\n\tif(opts.biff == 12) {\n\t\trows = blob.read_shift(4); // DRw\n\t\tcols = blob.read_shift(4); // DCol\n\t} else {\n\t\tcols = 1 + blob.read_shift(1); //DColByteU\n\t\trows = 1 + blob.read_shift(2); //DRw\n\t}\n\tif(opts.biff >= 2 && opts.biff < 8) { --rows; if(--cols == 0) cols = 0x100; }\n\t// $FlowIgnore\n\tfor(var i = 0, o = []; i != rows && (o[i] = []); ++i)\n\t\tfor(var j = 0; j != cols; ++j) o[i][j] = parse_SerAr(blob, opts.biff);\n\treturn o;\n}", "title": "" }, { "docid": "02b17f614cebe0c2c87422d34d5f24f8", "score": "0.42974484", "text": "function parse_PtgExtraArray(blob, length, opts) {\n\tvar rows = 0, cols = 0;\n\tif(opts.biff == 12) {\n\t\trows = blob.read_shift(4); // DRw\n\t\tcols = blob.read_shift(4); // DCol\n\t} else {\n\t\tcols = 1 + blob.read_shift(1); //DColByteU\n\t\trows = 1 + blob.read_shift(2); //DRw\n\t}\n\tif(opts.biff >= 2 && opts.biff < 8) { --rows; if(--cols == 0) cols = 0x100; }\n\t// $FlowIgnore\n\tfor(var i = 0, o = []; i != rows && (o[i] = []); ++i)\n\t\tfor(var j = 0; j != cols; ++j) o[i][j] = parse_SerAr(blob, opts.biff);\n\treturn o;\n}", "title": "" }, { "docid": "9ea4da0db385f07de6d93b3f725ced93", "score": "0.4296199", "text": "function getSVGDataArray(termValues, termOrder, colorScale, termLookup){\n\tvar dataArray = [];\n\tvar rowLength = Math.sqrt(termOrder.length);\n\tvar tileSize = frameSize / rowLength;\n\t\n\tvar x = 0;\n\tvar y = 0;\n\n\tfor(var i = 0; i < termOrder.length; i++){\n\t\tvar curTerm = termOrder[i];\n\t\tvar displayTerm = $.isEmptyObject(termLookup) ? curTerm : termLookup[curTerm];\n\n\t\tvar dataObj = {\n\t\t\t\t\"x\": x,\n\t\t\t\t\"y\": y,\n\t\t\t\t\"tileSize\": tileSize,\n\t\t\t\t\"term\": displayTerm\n\t\t\t};\n\n\t\t// get corresponding value of tile for coloring\n\t\tif (curTerm in termValues){\n\t\t\tdataObj.val = termValues[curTerm];\n\t\t\tdataObj.fill = colorScale(termValues[curTerm]);\n\t\t} else {\n\t\t\tdataObj.val = NaN;\n\t\t\tdataObj.fill = \"white\";\n\t\t}\n\t\t// add dataObj to overall dataArray\n\t\tdataArray.push(dataObj);\n\n\t\t// increment x and y values \n\t\tif (i != 0 && (i + 1) % rowLength == 0){\n\t\t\tx = 0;\n\t\t\ty += tileSize;\n\t\t} else{\n\t\t\tx += tileSize;\n\t\t}\n\t}\n\t\n\treturn dataArray;\n}", "title": "" }, { "docid": "6a49fb80ac7bd4b881f275f752d911ae", "score": "0.42944604", "text": "static extractArticleElements(arr){\n const tags = []\n\n arr.labels.forEach((element, index) => {\n tags.push(element.name)\n });\n\n return new Article(arr.title, arr.created_at, arr.user.login, arr.body, tags, arr.number)\n }", "title": "" }, { "docid": "233385fd47366f5bc29b124713923f2d", "score": "0.42939422", "text": "parseCube(elem, data, refs) {\n let obj = new CubeData();\n\n for (let attr of elem.attributes) {\n switch (attr.nodeName) {\n case \"alpha\" :\n obj.getAttributes().setAlpha(parseFloat(attr.nodeValue));\n break;\n case \"backgroundColor\" :\n obj.getAttributes().setBackgroundColor(parseRgbColor(attr.nodeValue));\n break;\n case \"beta\" :\n obj.getAttributes().setBeta(parseFloat(attr.nodeValue));\n break;\n case \"id\" :\n obj.setId(attr.nodeValue);\n break;\n case \"default\" :\n obj.setDefault(parseBoolean(attr.nodeValue));\n break;\n case \"explode\" :\n obj.getAttributes().setExplosionFactor(parseFloat(attr.nodeValue));\n break;\n case \"scale\" :\n obj.getAttributes().setScaleFactor(parseFloat(attr.nodeValue));\n break;\n case \"kind\" :\n let kind = CubeKindMap.get(attr.nodeValue);\n if (kind == null) {\n module.warning(\"unsupported type: \"+attr.nodeName+\"=\"+attr.nodeValue+\" in element: \"+elem.tagName);\n } else {\n obj.setKind(kind);\n }\n break;\n case \"twistDuration\" :\n obj.getAttributes().setTwistDuration(parseInt(attr.nodeValue));\n break;\n default:\n module.warning(\"unsupported attribute: \"+attr.nodeName+\"=\"+attr.nodeValue+\" in element: \"+elem.tagName);\n break;\n }\n }\n let colorMap = new Map(); // id=[r,g,b,a]\n for (let child of elem.children) {\n switch (child.tagName) {\n case \"Author\":\n obj.setAuthor(child.textContent);\n break;\n case \"Date\":\n obj.setDate(child.textContent);\n break;\n case \"Name\":\n obj.setName(child.textContent);\n break;\n case \"Description\":\n obj.setDescription(child.textContent);\n break;\n case \"Color\": {\n let id=child.getAttribute(\"id\");\n let argb=child.getAttribute(\"argb\");\n let name=child.textContent;\n colorMap.set(id,parseArgbColor(argb));\n break;\n }\n case \"Part\": {\n let index=parseInt(child.getAttribute(\"index\"));\n let visible=parseBoolean(child.getAttribute(\"visible\"));\n let fillColorRef=child.getAttribute(\"fillColorRef\");\n let outlineColorRef=child.getAttribute(\"outlineColorRef\");// currently not supported\n obj.getAttributes().setPartFillColor(index, colorMap.get(fillColorRef));\n obj.getAttributes().setPartVisible(index, visible);\n break;\n }\n case \"Sticker\": {\n let index=parseInt(child.getAttribute(\"index\"));\n let visible=parseBoolean(child.getAttribute(\"visible\"));\n let fillColorRef=child.getAttribute(\"fillColorRef\");\n obj.getAttributes().setStickerFillColor(index, colorMap.get(fillColorRef));\n obj.getAttributes().setStickerVisible(index, visible);\n break;\n }\n case \"StickersImage\": {\n let visible=parseBoolean(child.getAttribute(\"visible\"));\n let imageData=child.textContent;\n obj.getAttributes().setStickersImageVisible(visible);\n obj.getAttributes().setStickersImageUrl(\"data:image/jpeg;base64,\"+imageData);\n break;\n }\n default:\n module.warning(\"unsupported child element: \"+child.tagName+\" in element: \"+elem.tagName);\n break;\n }\n }\n\n refs.registerCube(obj.getId(), obj);\n data.addCube(obj);\n }", "title": "" }, { "docid": "2ad81312d77ecf40c2673b2d1f57c0fe", "score": "0.42887747", "text": "function getInputLayersAndData() {\n let result = {};\n let clientInputLayers = getClientInputLayers();\n let inputLayers = {};\n for (let layerID in clientInputLayers) {\n inputLayers[layerID] = clientInputLayers[layerID].tag;\n }\n let dataString = $templateContentValues.val();\n let dataFromExcel = excelTextToObject(dataString);\n let data = [];\n\n for (let i = 0; i < dataFromExcel.length; i++) {\n let item = dataFromExcel[i];\n let dataItem = {};\n\n for (let layerID in clientInputLayers) {\n let tag = clientInputLayers[layerID].tag;\n let defaultValue = clientInputLayers[layerID].defaultValue;\n if (tag in item) {\n dataItem[tag] = item[tag];\n } else {\n dataItem[tag] = defaultValue;\n }\n }\n data.push(dataItem);\n }\n\n result['input_layers'] = inputLayers;\n result['data'] = data;\n result['size'] = getPDFSize();\n return result;\n}", "title": "" }, { "docid": "433425a22515003849ba98dc2c7ea1ff", "score": "0.4288247", "text": "function setupTeapotBuffers(raw_file_text){\r\n var vertices = [];\r\n var face = [];\r\n\r\n verticess_counter = 0;\r\n face_counter = 0;\r\n \r\n // get vertex and face data line by line\r\n var lines = raw_file_text.split(\"\\n\");\r\n for (var line_num in lines){\r\n list_elements = lines[line_num].split(' ');\r\n \r\n // line corresponds to vertex data\r\n if (list_elements[0] == 'v'){\r\n //cast to float 0.0\r\n vertices.push(parseFloat(list_elements[1]));\r\n vertices.push(parseFloat(list_elements[2]));\r\n vertices.push(parseFloat(list_elements[3]));\r\n verticess_counter += 1;\r\n }\r\n // line corresponds to face data\r\n else if(list_elements[0] == 'f'){\r\n //cast to int\r\n face.push(parseInt(list_elements[2])-1);\r\n face.push(parseInt(list_elements[3])-1);\r\n face.push(parseInt(list_elements[4])-1);\r\n face_counter += 1;\r\n }\r\n }\r\n \r\n // bind vertex data\r\n TPvertexbuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, TPvertexbuffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\r\n TPvertexbuffer.numItems = verticess_counter;\r\n \r\n // bind face data\r\n TPindexbuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, TPindexbuffer);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(face), gl.STATIC_DRAW);\r\n TPindexbuffer.numItems = face_counter;\r\n\r\n // calculate per vertex normals\r\n var normals = [];\r\n\r\n for (var i=0; i < verticess_counter; i++){\r\n normals.push(0);\r\n normals.push(0);\r\n normals.push(0);\r\n }\r\n // Calculate vertex normals\r\n normal_getter(vertices, face, face_counter, verticess_counter, normals);\r\n\r\n // bind normal data\r\n TPvertexnormalbuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, TPvertexnormalbuffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(normals), gl.STATIC_DRAW);\r\n TPvertexnormalbuffer.itemSize = 3; //#of coordinas \r\n TPvertexnormalbuffer.numItems = face_counter;\r\n \r\n ready_to_draw = true;\r\n}", "title": "" }, { "docid": "b3f38608ee0d16c394e6e79bbaec89de", "score": "0.42779553", "text": "function interpret (code) {\n\n\tvar voxelObjs = []; // The array to put all voxels in.\n\t\n\tvar lines = code.split('\\n');\n\n\tvar linesSplit = lines.map(function(line){\n\t\treturn tempSplit = line.split('['); // This will give us the first word of each line as index 0 of tempSplit. So we will know what to do with lines that start with \"fill\" or what not.\n\t});\n\n\t// Loop through every line and check the header to see what function needs to be done.\n\t// Currently the \"linesSplit\" var is an array of strings.\n\tlinesSplit.forEach(function(line,index,array){\n\n\t\tif (line[0].indexOf('*') == -1) { // If the line does not contain the comment symbol... Remember if \".indexOf\" returns -1 then the character is not in the string.\n\n\n\t\t\tif(line[0].indexOf('fill') >= 0){ // If the \"fill\" header can be found. indexOf help: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf\n\n\t\t\t\t// Find out the fill limits, the beginning and end limits.\n\t\t\t\t// line[1] contains the fillParameters.\n\t\t\t\tvar fillParametersNumbers = [];\n\t\t\t\tline[1].split(',').forEach(function(str,index,array){ // Split each the string by the commas and convert each of those to a int, if the string segment cannot be made into an int, do some error check to check for something like \"50]\", but if that is not the case, disregard the part that is not a number.\n\n\t\t\t\t\t// Now convert the fill parameters from strings to numbers, throwing out the non-numbers like commas and } or )\n\t\t\t\t\tvar numb = parseFloat(str); // Number(str); the number function return spaces as zeros so I need something more strict, thus the parseFloat.\n\n\t\t\t\t\t// Error checking for the last number in array like \"100]\" NOTE: This check might actually not be necessary because parseFloat('0.5]') == 0.5, look at more later...\n\t\t\t\t\tif(numb == NaN && str.indexOf(']') >= 0 ){ // So if the string char can actually be converted to a number... Basically we want to say if(NaN) than don't add it to the array. And we have error checking for something like \"100]\".\n\t\t\t\t\t\t\n\t\t\t\t\t\tstrNumb = str.split(']')[0]; // This will cut the string in half at the point where \"]\" is found, we then take the first index of that split string, which is just the number.\n\t\t\t\t\t\tnumb = parseFloat(strNumb);\n\t\t\t\t\t}\n\n\n\t\t\t\t\tif(numb || numb == 0){ // if(0) is always false, so I need to check is the numb is equal to 0.\n\t\t\t\t\t\tfillParametersNumbers = fillParametersNumbers.concat(numb);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t\t// Actually find out what voxels we are supposed to fill in...\n\t\t\t\tvar fillElements = []; // This stores the voxels that will actually make up the fill.\n\t\t\t\tfor (var i = index + 1; array[i].indexOf('}') < 0; i++){ // Go through the next few lines until we find a line that contains the \"}\" meaning the close of the function. Could be written as: \"array[i].indexOf('}') == -1\".\n\n\t\t\t\t\ttempNumberHolder = []; // This is to hold all number data for the voxel object on this line. This is needed to add each voxel as an index in a nested array.\n\t\t\t\t\t\n\t\t\t\t\t// I need to account for negative numbers, so spliting lines by each charater is troublesome...\n\t\t\t\t\t// I also need to account for numbers with more charaters than one.\n\t\t\t\t\t// So I split each one by a comma then check each split for a number.\n\t\t\t\t\tarray[i][1].split(',').forEach(function(str,index,array){ // The \"array[i][1].split(',')\" means that we are checking each number in the second index because the first index is just a empty string because of how it was previously formatted.\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar numb = parseFloat(str);\n\n\t\t\t\t\t\t// Error checking for the last number in array like \"100]\"\n\t\t\t\t\t\tif(numb == NaN && str.indexOf(']') >= 0 ){\n\t\t\t\t\t\t\tstrNumb = str.split(']')[0]; // This will cut the string in half at the point where \"]\" is found, we then take the first index of that split string, which is just out number.\n\t\t\t\t\t\t\tnumb = parseFloat(strNumb);\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tif(numb || numb == 0){ // if(0) is always false, so I need to check is the numb is equal to 0.\n\t\t\t\t\t\t\ttempNumberHolder = tempNumberHolder.concat(numb);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tfillElements = fillElements.concat([tempNumberHolder]);\n\t\t\t\t\tarray[i][0] = '*'; // After the voxel parameters have been recorded, make that line commented out. This is a work around so that the voxels inside of the fill command are not called again after they have been used in the fill. Essentially, there was a bug where the interpreter would correctly do the fill command, but then would reread the voxels inside of that fill command and place them again as if they were regular voxel outside of the fill command. Commenting out the line once the fill command is done with it prevents the interpreter from rereading the line. Note: This just comments out the line from the array variable not the actual user input.\n\t\t\t\t}\n\n\t\t\t\t// Find the center of the group of voxel elements. I use it to transform the group as it is filled in over and over again.\n\t\t\t\tvar elementsCenter = groupCenter(fillElements);\n\n\t\t\t\t// Calculate 3D line points based on fill parameters. These are the fill end points.\n\t\t\t\tvar fillLinePoints = calculate3DLine(fillParametersNumbers[0], fillParametersNumbers[1], fillParametersNumbers[2], fillParametersNumbers[3], fillParametersNumbers[4], fillParametersNumbers[5]);\n\n\t\t\t\t// Next I need to find out the transform needed to make the center be the starting point for the fill.\n\t\t\t\tfillLinePoints.forEach(function(point){\n\t\t\t\t\t// The transform is just the difference between the center and the line point.\n\t\t\t\t\tvar transform = [ point[0] - elementsCenter[0], point[1] - elementsCenter[1], point[2] - elementsCenter[2] ];\n\n\t\t\t\t\tfillElements.forEach(function(element){\n\t\t\t\t\t\t// Move each fill element by the transform.\n\t\t\t\t\t\tvar transformedPosition = [ element[0] + transform[0], element[1] + transform[1], element[2] + transform[2] ];\n\n\t\t\t\t\t\t// Make a new voxel object for this transformed/moved fill element.\n\t\t\t\t\t\tvar fillVox = new voxel(transformedPosition[0], transformedPosition[1], transformedPosition[2], element[3], element[4], element[5]); // Retain the rgb color of the current element, it does not need to be changed.\n\t\t\t\t\t\tvoxelObjs = voxelObjs.concat(fillVox);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// If the \"voxel\" command can be found.\n\t\t\telse if(line[0].indexOf('voxel') >= 0){\n\n\t\t\t\tvar voxelParameters = [];\n\t\t\t\tline[1].split(',').forEach(function(str,index,array){ // Split each the string by the commas and convert each of those to a int, if the string segment cannot be made into an int, do some error check to check for something like \"50]\", but if that is not the case, disregard the part that is not a number.\n\n\t\t\t\t\tvar numb = parseFloat(str);\n\n\t\t\t\t\t// Error checking for the last number in array like \"100]\"\n\t\t\t\t\tif(numb == NaN && str.indexOf(']') >= 0 ){\n\t\t\t\t\t\t\n\t\t\t\t\t\tstrNumb = str.split(']')[0]; // This will cut the string in half at the point where \"]\" is found, we then take the first index of that split string, which is just the number.\n\t\t\t\t\t\tnumb = parseFloat(strNumb);\n\t\t\t\t\t}\n\n\n\t\t\t\t\tif(numb || numb == 0){ // if(0) is always false, so I need to check is the numb is equal to 0.\n\t\t\t\t\t\tvoxelParameters = voxelParameters.concat(numb);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tvar elseVoxel = new voxel(voxelParameters[0], voxelParameters[1], voxelParameters[2], voxelParameters[3], voxelParameters[4], voxelParameters[5]);\n\t\t\t\tvoxelObjs = voxelObjs.concat(elseVoxel); // Maybe use .push instead...\n\t\t\t}\n\n\t\t\t// If the \"grid:off\" header can be found.\n\t\t\telse if( line[0].indexOf('grid:off') >= 0 || line[0].indexOf('grid: off') >= 0 ){\n\t\t\t\tgrid = false;\n\t\t\t}\n\t\t\t// If the \"grid:on\" header can be found.\n\t\t\telse if( line[0].indexOf('grid:on') >= 0 || line[0].indexOf('grid: on') >= 0 ){\n\t\t\t\tgrid = true;\n\t\t\t}\n\n\t\t\t// If the \"filename:\" header can be found, set file name for the voxel model.\n\t\t\telse if( line[0].indexOf('filename:') >= 0){\n\t\t\t\tvar tempFileName = line[0].split(':'); // Split the line at the colon so the actual name will be tempFileName index 1.\n\t\t\t\tname = tempFileName[1];\n\t\t\t}\n\n\n\t\t\t// If the \"cube\" header can be found.\n\t\t\telse if(line[0].indexOf('cube') >= 0){\n\n\t\t\t\tvar cubeParametersNumbers = [];\n\t\t\t\tline[1].split(',').forEach(function(str,index,array){ // Split each the string by the commas and convert each of those to a int, if the string segment cannot be made into an int, do some error check to check for something like \"50]\", but if that is not the case, disregard the part that is not a number.\n\n\t\t\t\t\tvar numb = parseFloat(str);\n\n\t\t\t\t\t// Error checking for the last number in array like \"100]\"\n\t\t\t\t\tif(numb == NaN && str.indexOf(']') >= 0 ){\n\t\t\t\t\t\t\n\t\t\t\t\t\tstrNumb = str.split(']')[0]; // This will cut the string in half at the point where \"]\" is found, we then take the first index of that split string, which is just the number.\n\t\t\t\t\t\tnumb = parseFloat(strNumb);\n\t\t\t\t\t}\n\n\n\t\t\t\t\tif(numb || numb == 0){ // if(0) is always false, so I need to check is the numb is equal to 0.\n\t\t\t\t\t\tcubeParametersNumbers = cubeParametersNumbers.concat(numb);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// The startPoint needs to be less than the end point (A.K.A it needs to be the smallest point). Here I am checking which point is smallest and making that the startPoint and the other bigger point becomes the end point.\n\t\t\t\tif ( (cubeParametersNumbers[0] + cubeParametersNumbers[1] + cubeParametersNumbers[2]) <= (cubeParametersNumbers[3] + cubeParametersNumbers[4] + cubeParametersNumbers[5]) ){ // Using \"<=\" instead of \"<\" to catch both points being the same...\n\t\t\t\t\tvar startPoint = [ cubeParametersNumbers[0], cubeParametersNumbers[1], cubeParametersNumbers[2] ];\n\t\t\t\t\tvar endPoint = [ cubeParametersNumbers[3], cubeParametersNumbers[4], cubeParametersNumbers[5] ];\n\t\t\t\t} else { // If the last point given in the cube parameter is smaller then the first given, make last point the startPoint.\n\t\t\t\t\tvar startPoint = [ cubeParametersNumbers[3], cubeParametersNumbers[4], cubeParametersNumbers[5] ];\n\t\t\t\t\tvar endPoint = [ cubeParametersNumbers[0], cubeParametersNumbers[1], cubeParametersNumbers[2] ];\n\t\t\t\t}\n\n\t\t\t\t// Get the Width, Length, and Height of the cube, by x2 - x1 and so on.\n\t\t\t\t// These will be the distance to go from the startPoint in all directions.\n\t\t\t\tvar xDistance = endPoint[0] - startPoint[0];\n\t\t\t\tvar yDistance = endPoint[1] - startPoint[1];\n\t\t\t\tvar zDistance = endPoint[2] - startPoint[2];\n\n\t\t\t\t// Using the absolute value of the distance to avoid negative distances. Like what would occur with \"cube[-1,-100,5, 1,1,1]\". In this zDistance = -4, which would break the cube loop below.\n\t\t\t\tfor (var z = 0; z <= Math.abs(zDistance); z++){ // The cube needs to include end points, thus I used \"<=\" so that it includes the last point. If this were a cube in real life including the end point voxel would make it one unit bigger than it should be. This is sort of the case here too, but I keep it this way because it makes sense to include the endPoint in a voxel editing program.\n\t\t\t\t\tfor (var x = 0; x <= Math.abs(xDistance); x++) {\n\t\t\t\t\t\tfor (var y = 0; y <= Math.abs(yDistance); y++) {\n\n\t\t\t\t\t\t\t// Use a Conditional (ternary) Operator: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator\n\t\t\t\t\t\t\t// If the xDistance is a negative number, subtract the x-step instead of adding it to the startPoint by making it negative: -x == (x * -1)\n\t\t\t\t\t\t\t// If the distance is positive, just add the x-step to the startPoint.\n\t\t\t\t\t\t\tvar xOffset = (xDistance < 0) ? -x : x; // if xDistance less than 0 make it '-x' else make it 'x'.\n\t\t\t\t\t\t\tvar yOffset = (yDistance < 0) ? -y : y;\n\t\t\t\t\t\t\tvar zOffset = (zDistance < 0) ? -z : z;\n\n\t\t\t\t\t\t\t// Actually make a new voxel object for each point in the cube.\n\t\t\t\t\t\t\tvar currentVoxel = new voxel( startPoint[0]+xOffset, startPoint[1]+yOffset, startPoint[2]+zOffset, cubeParametersNumbers[6], cubeParametersNumbers[7], cubeParametersNumbers[8] ); // The StartPoint plus the offset of the step. The \"cubeParametersNumbers[6], cubeParametersNumbers[7], cubeParametersNumbers[8]\" is for RGB color parameters.\n\t\t\t\t\t\t\tvoxelObjs.push(currentVoxel); // Trying \".push\" instead of \".concat\".\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} // End of comment symbol check.\n\t});\n\n\treturn voxelObjs; // This is an array of objects.\n}", "title": "" }, { "docid": "c43a95bfc9b5ec8ed51e8cb099b417f1", "score": "0.4276755", "text": "function cleandata(xye) {\n if (xye == \"0,10;1,20;2,-30\") {\n return [[0, 10], [1, 20], [2, -30]];\n }\n\n return call_internal_fun(\"cleandata\", { xye });\n}", "title": "" }, { "docid": "6fd5e2b13111d572ca827fe30909ffae", "score": "0.42749855", "text": "function parseEventByTags(tags, events) {\n var rows = [];\n if(typeof(tags) == 'string') tags = [tags];\n if(typeof(events) == 'string') events = [events];\n for(var t in tags) {\n var objs = document.querySelectorAll(tags[t]);\n for(var i in objs) {\n for(var e in events) {\n if(objs[i][events[e]]) rows.push({'tag':tags[t], 'index':i, 'event':events[e]});\n }\n }\n }\n return rows;\n}", "title": "" }, { "docid": "dc51f8d4b338719562f53a89c210e142", "score": "0.4266509", "text": "function computeFrequenciesAndNoteAndTemperatureAndReverbFromDimensions() {\n L = W = H = differenceInDimensions;\n console.log(\" IN GenerateFrequences dimenstion =\" + differenceInDimensions);\n\n m1 = 1;\n m2 = 2;\n m3 = 3;\n m4 = 4;\n m5 = 5;\n m6 = 6;\n m7 = 7;\n m8 = 8;\n m9 = 9;\n\n ax1 = 565 * Math.sqrt((m1 / L) * (m1 / L));\n ax2 = 565 * Math.sqrt((m1 / W) * (m1 / W));\n ax3 = 565 * Math.sqrt((m1 / H) * (m1 / H));\n\n ax4 = 565 * Math.sqrt((m2 / L) * (m2 / L));\n ax5 = 565 * Math.sqrt((m2 / W) * (m2 / W));\n ax6 = 565 * Math.sqrt((m2 / H) * (m2 / H));\n\n ax7 = 565 * Math.sqrt((m3 / L) * (m3 / L));\n ax8 = 565 * Math.sqrt((m3 / W) * (m3 / W));\n ax9 = 565 * Math.sqrt((m3 / H) * (m3 / H));\n\n ax10 = 565 * Math.sqrt((m4 / L) * (m4 / L));\n ax11 = 565 * Math.sqrt((m4 / W) * (m4 / W));\n ax12 = 565 * Math.sqrt((m4 / H) * (m4 / H));\n\n ax13 = 565 * Math.sqrt((m5 / L) * (m5 / L));\n ax14 = 565 * Math.sqrt((m5 / W) * (m5 / W));\n ax15 = 565 * Math.sqrt((m5 / H) * (m5 / H));\n\n ax16 = 565 * Math.sqrt((m6 / L) * (m6 / L));\n ax17 = 565 * Math.sqrt((m6 / W) * (m6 / W));\n ax18 = 565 * Math.sqrt((m6 / H) * (m6 / H));\n\n ax19 = 565 * Math.sqrt((m7 / L) * (m7 / L));\n ax20 = 565 * Math.sqrt((m7 / W) * (m7 / W));\n ax21 = 565 * Math.sqrt((m7 / H) * (m7 / H));\n\n ax22 = 565 * Math.sqrt((m8 / L) * (m8 / L));\n ax23 = 565 * Math.sqrt((m8 / W) * (m8 / W));\n ax24 = 565 * Math.sqrt((m8 / H) * (m8 / H));\n\n ax25 = 565 * Math.sqrt((m9 / L) * (m9 / L));\n ax26 = 565 * Math.sqrt((m9 / W) * (m9 / W));\n ax27 = 565 * Math.sqrt((m9 / H) * (m9 / H));\n frequencyfromdimensions = ax1;\n \n computeNoteFromFrequency(frequencyfromdimensions);\n computeTemperature();\n computeReverb();\n}", "title": "" }, { "docid": "27ad93c68c227fdc986d6b56ae526264", "score": "0.42657536", "text": "parse(array = [0, 0]) {\n const points = []; // if it is an array, we flatten it and therefore clone it to 1 depths\n\n if (array instanceof Array) {\n array = Array.prototype.concat.apply([], array);\n } else {\n // Else, it is considered as a string\n // parse points\n array = array.trim().split(delimiter).map(parseFloat);\n } // validate points - https://svgwg.org/svg2-draft/shapes.html#DataTypePoints\n // Odd number of coordinates is an error. In such cases, drop the last odd coordinate.\n\n\n if (array.length % 2 !== 0) array.pop(); // wrap points in two-tuples\n\n for (let i = 0, len = array.length; i < len; i = i + 2) {\n points.push([array[i], array[i + 1]]);\n }\n\n return points;\n }", "title": "" }, { "docid": "9eff4575ec08435a72cdeb86534de674", "score": "0.42640093", "text": "gather(indices, elementDtype, elementShape) {\n if (elementDtype !== this.elementDtype) {\n throw new Error(`Invalid data types; op elements ${elementDtype}, but list elements ${this.elementDtype}`);\n }\n Object(_tensor_utils__WEBPACK_IMPORTED_MODULE_1__[\"assertShapesMatchAllowUndefinedSize\"])(this.elementShape, elementShape, 'TensorList shape mismatch: ');\n // When indices is greater than the size of the list, indices beyond the\n // size of the list are ignored.\n indices = indices.slice(0, this.size());\n if (indices.length === 0) {\n return Object(_tensorflow_tfjs_core__WEBPACK_IMPORTED_MODULE_0__[\"tensor\"])([], [0].concat(this.elementShape));\n }\n return Object(_tensorflow_tfjs_core__WEBPACK_IMPORTED_MODULE_0__[\"tidy\"])(() => {\n const tensors = indices.map(i => Object(_tensorflow_tfjs_core__WEBPACK_IMPORTED_MODULE_0__[\"reshape\"])(this.tensors[i], elementShape));\n return Object(_tensorflow_tfjs_core__WEBPACK_IMPORTED_MODULE_0__[\"stack\"])(tensors, 0);\n });\n }", "title": "" }, { "docid": "0d629bc03564b809c46706651056f939", "score": "0.42611787", "text": "constructor(xInput, yInput) {\n super(xInput, yInput, 50, 50);\n this.image = loadImage(\"images/bird.png\");\n\n this.trajectory = []; //empty array which will store position of bird as long as it flying\n this.smokeImage = loadImage(\"images/smoke.png\");\n\n /* //sample array\n var sample = [65, 324436, \"AVANI\", [555, 777], 34, 980, \"uttara\"];\n\n //push(): Add items to the end of an array\n sample.push(999);\n \n //pop(): Remove an item from the end of an array\n sample.pop()\n\n //unshift(): Add items to the beginning of an array\n sample.unshift(999);\n\n //shift(): Remove an item from the beginning of an array\n sample.shift();\n\n console.log(sample);\n console.log(\"1 index of array SAMPLE: sample[1] : \"+sample[1]);\n\n console.log(\"3 index of array SAMPLE: sample[3] : \"+sample[3]);\n\n console.log(\"1 index of 3 index of array SAMPLE: sample[3][1] : \"+sample[3][1]);\n console.log(\"0 index of 3 index of array SAMPLE: sample[3][0] : \"+sample[3][0]);\n\n */\n\n }", "title": "" }, { "docid": "35347a084aa6c96c45695646dff8d839", "score": "0.42582333", "text": "function processTags(elements) {\n \n var tagsData = [],\n data,\n element,\n attrHref,\n attrLayout,\n attrCount,\n keysValues,\n keyValue,\n parsedParams,\n params,\n param,\n hasRequiredParams,\n query,\n \n // loop variables\n lenOuter,\n lenInner,\n i,\n j;\n \n i = 0;\n for (lenOuter = elements.length; i < lenOuter; i += 1) {\n \n element = elements[i];\n \n // set up the data structure for this tag,\n // but mark it invalid until proven otherwise.\n // there is no presumption of innocence in JavaScript!\n data = {\n element: element,\n valid: false\n };\n tagsData.push(data);\n \n // retrieve the attributes we'll need from the tag\n attrHref = element.getAttribute(\"href\");\n attrLayout = element.getAttribute(config.attrs.layout) || \"horizontal\";\n attrCount = element.getAttribute(config.attrs.count) || false;\n \n // do some sanity checks before we waste more processing power\n if (attrHref &&\n config.buttonHrefRx.test(attrHref) &&\n config.layoutRx.test(attrLayout)\n ) {\n \n // build the key / value parameters map from the query string\n parsedParams = { };\n keysValues = attrHref.split(\"?\")[1].split(\"#\")[0].split(\"&\");\n j = 0;\n for (lenInner = keysValues.length; j < lenInner; j += 1) {\n \n keyValue = keysValues[j].split(\"=\");\n parsedParams[keyValue[0]] = keyValue[1];\n }\n \n // start building the query string\n // while checking for the required parameters\n query = [];\n hasRequiredParams = true;\n params = config.params.required;\n j = 0;\n for (lenInner = params.length; j < lenInner; j += 1) {\n \n param = params[j];\n if (param in parsedParams) {\n \n query.push(param + \"=\" + parsedParams[param]);\n \n } else {\n \n // bail out of the loop if we missed a required param\n hasRequiredParams = false;\n break;\n }\n }\n \n // do some more sanity checks on our params before proceeding\n // note that decodeURIComponenet will throw an exception for invalid character encodings\n try {\n \n if (hasRequiredParams &&\n config.urlRx.test(decodeURIComponent(parsedParams.url)) &&\n config.urlRx.test(decodeURIComponent(parsedParams.media))\n ) {\n \n // keep building the query string with optional parameters\n params = config.params.optional;\n j = 0;\n for (lenInner = params.length; j < lenInner; j += 1) {\n \n param = params[j];\n if (param in parsedParams) {\n \n query.push(param + \"=\" + parsedParams[param]);\n }\n }\n \n // add the count value to the query string?\n if (attrCount !== false) {\n \n query.push(\"count=1\");\n }\n \n // this tag is valid, so keep all this data\n // we worked so hard to parse!\n data.layout = attrLayout;\n data.query = query.join(\"&\");\n data.valid = true;\n }\n \n } catch (exception) {\n \n // don't bother processing this element anymore\n }\n }\n }\n \n // wooh, finally!\n return tagsData;\n }", "title": "" }, { "docid": "327c0354a93964f59d256fc592285295", "score": "0.42441434", "text": "function setupTeapotBuffers(file){\r\n \r\n vertexNum = 0;\r\n\tfaceNum = 0;\r\n var vertices = [];\r\n\tvar faces = [];\r\n\t\r\n\tvar lines = file.split(\"\\r\\n\");\r\n for (var i=0 ; i < lines.length; i++ ){\r\n\t\t\r\n line = lines[i].split(' ');\r\n\t\t\r\n\t\tif (line[0] == 'v'){\r\n\t\t\tvertices.push(parseFloat(line[1]));\r\n\t\t\tvertices.push(parseFloat(line[2]));\r\n\t\t\tvertices.push(parseFloat(line[3]));\r\n\t\t\tvertexNum += 1;\r\n\t\t}\r\n\t\telse if(line[0] == 'f'){\r\n\t\t\tfaces.push(parseInt(line[2])-1);\r\n\t\t\tfaces.push(parseInt(line[3])-1);\r\n\t\t\tfaces.push(parseInt(line[4])-1);\r\n\t\t\tfaceNum += 1;\r\n\t\t}\r\n\t}\r\n\t \r\n // Specify the positions of vertices \r\n\ttVertexPositionBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, tVertexPositionBuffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\r\n\ttVertexPositionBuffer.numItems = vertexNum;\r\n\t \r\n tVertexNormalBuffer = gl.createBuffer();\r\n\tgl.bindBuffer(gl.ARRAY_BUFFER, tVertexNormalBuffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(ComputeNormals(vertices, faces, faceNum, vertexNum )), gl.STATIC_DRAW);\r\n tVertexNormalBuffer.itemSize = 3;\r\n tVertexNormalBuffer.numItems = faceNum;\r\n\t\r\n tIndexTriBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, tIndexTriBuffer);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(faces), gl.STATIC_DRAW);\r\n\ttIndexTriBuffer.numItems = faceNum;\r\n\t\r\n}", "title": "" }, { "docid": "5cd787410d8365d1796922af2e27a9e0", "score": "0.42438367", "text": "function quad(a, b, c, d) {\n var t1 = subtract(vertices[b], vertices[a]);\n var t2 = subtract(vertices[c], vertices[b]);\n var normal = vec4(cross(t1, t2), 0);\n\n pointsArray.push(vertices[a]); \n normalsArray.push(normal); \n pointsArray.push(vertices[b]); \n normalsArray.push(normal); \n pointsArray.push(vertices[c]); \n normalsArray.push(normal); \n pointsArray.push(vertices[a]); \n normalsArray.push(normal); \n pointsArray.push(vertices[c]); \n normalsArray.push(normal); \n pointsArray.push(vertices[d]); \n normalsArray.push(normal); \n}", "title": "" }, { "docid": "efa43cf3d3958b4060dd3439fce2f997", "score": "0.42423862", "text": "function jsbmlToQArr(JSBML){\n let qArr = [];\n eventCounter = 0; // reset event counter\n\n let sbml = JSBML.elements // <file>\n .find((x) => x.name === 'sbml'); // <sbml>\n\n let model = sbml.elements\n .find((x) => x.name === 'model'); // <model>\n\n // unit definition\n let unitDict = _.chain(model.elements)\n .filter(['name', 'listOfUnitDefinitions'])\n .map('elements')\n .flatten()\n .filter(['name', 'unitDefinition'])\n .map((x) => {\n let units = unitDefinitionToUnits(x);\n\n return [x.attributes.id, units];\n })\n .fromPairs()\n .value();\n\n // algebraicRules\n \n let functionDefinitions = _.chain(model.elements)\n .filter(['name', 'listOfFunctionDefinitions'])\n .map('elements')\n .flatten()\n .filter(['name', 'functionDefinition'])\n .value();\n functionDefinitions.forEach((x) => {\n let q = functionDefinitionToQ(x);\n qArr.push(q);\n });\n\n // species types, for IRT\n let speciesTypes = _.chain(model.elements)\n .filter(['name', 'listOfSpeciesTypes'])\n .map('elements')\n .flatten()\n .filter(['name', 'speciesType'])\n .value();\n speciesTypes.forEach((x) => {\n let q = speciesTypeToQ(x);\n qArr.push(q);\n });\n\n // compartments\n let zeroSpatialDimensions = [];\n let compartments = _.chain(model.elements)\n .filter(['name', 'listOfCompartments'])\n .map('elements')\n .flatten()\n .filter(['name', 'compartment'])\n .value();\n compartments.forEach((x) => {\n // collect compartments with zero dimention\n let isZero = _.get(x, 'attributes.spatialDimensions') === '0';\n if (isZero) {\n zeroSpatialDimensions.push(_.get(x, 'attributes.id'));\n // set zero initial size\n _.set(x, 'attributes.size', '0'); \n }\n\n let q = compartmentToQ(x, unitDict);\n qArr.push(q);\n });\n\n // species\n let species = _.chain(model.elements)\n .filter(['name', 'listOfSpecies'])\n .map('elements')\n .flatten()\n .filter(['name', 'species'])\n .value();\n species.forEach((x) => {\n let q = speciesToQ(x, zeroSpatialDimensions, qArr, unitDict);\n qArr.push(q);\n });\n\n // reactions\n let reactions = _.chain(model.elements)\n .filter(['name', 'listOfReactions'])\n .map('elements')\n .flatten()\n .filter(['name', 'reaction'])\n .value();\n reactions.forEach((x) => {\n let qArr_add = reactionToQ(x);\n qArr = qArr.concat(qArr_add);\n });\n\n // parameters\n let parameters = _.chain(model.elements)\n .filter(['name', 'listOfParameters'])\n .map('elements')\n .flatten()\n .filter(['name', 'parameter'])\n .value();\n parameters.forEach((x) => {\n let q = parameterToQ(x, unitDict);\n qArr.push(q);\n });\n\n // initialAssignments\n let initialAssignments = _.chain(model.elements)\n .filter(['name', 'listOfInitialAssignments'])\n .map('elements')\n .flatten()\n .filter(['name', 'initialAssignment'])\n .value();\n initialAssignments.forEach((x) => {\n let q = initialAssignmentToQ(x);\n qArr.push(q);\n });\n\n // assignmentRules\n let assignmentRules = _.chain(model.elements)\n .filter(['name', 'listOfRules'])\n .map('elements')\n .flatten()\n .filter(['name', 'assignmentRule'])\n .value();\n assignmentRules.forEach((x) => {\n let q = assignmentRuleToQ(x);\n qArr.push(q);\n });\n\n // algebraicRules\n let algebraicRules = _.chain(model.elements)\n .filter(['name', 'listOfRules'])\n .map('elements')\n .flatten()\n .filter(['name', 'algebraicRule'])\n .value();\n if (algebraicRules.length !== 0) {\n throw new Error('\"algebraicRule\" from SBML module is not supported.');\n }\n\n // rateRules\n let rateRules = _.chain(model.elements)\n .filter(['name', 'listOfRules'])\n .map('elements')\n .flatten()\n .filter(['name', 'rateRule'])\n .value();\n rateRules.forEach((x) => {\n let qArr_add = rateRuleToQ(x);\n qArr = qArr.concat(qArr_add);\n });\n\n // events\n let events = _.chain(model.elements)\n .filter(['name', 'listOfEvents'])\n .map('elements')\n .flatten()\n .filter(['name', 'event'])\n .value();\n events.forEach((x) => {\n let qs = eventToQ(x);\n qArr = qArr.concat(qs);\n });\n\n return qArr;\n}", "title": "" }, { "docid": "489420a9711be074bb3116f68f73c036", "score": "0.42412516", "text": "getAtlasCoordByTag(tag=\"Fp1\"){\n\t\tvar found = undefined;\n\t\tlet atlasCoord = this.fftMap.map.find((o, i) => {\n\t\t\tif(o.tag === tag){\n\t\t\t\tfound = o;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t});\n\t\treturn found;\n\t}", "title": "" }, { "docid": "a0d734334b82a290e49019c6efe4ef4c", "score": "0.4234051", "text": "function calculateExtrusionValues(numpoints,numlayers,v_matdiameter,v_nozzlediameter,pointshape){\n var e = new Array;\n var d = new Array;\n \n /*Calculating nozzle_material_surfaces_ratio*/\n\tvar v_materialsurface=Math.PI*Math.pow((v_matdiameter/2.0),2);\n\tvar v_nozzlesurface=Math.PI*Math.pow((v_nozzlediameter/2.0),2);\n\tvar nozzle_material_surfaces_ratio=v_nozzlesurface/v_materialsurface;\n \n /*Calculating array of distances between points*/\n for (i = 1; i < numpoints; i = i+1) {\n d[i]=Math.sqrt(Math.pow((pointshape[i].x-pointshape[i-1].x),2)+Math.pow((pointshape[i].y-pointshape[i-1].y),2));\n }\n d[numpoints]=Math.sqrt(Math.pow((pointshape[numpoints-1].x-pointshape[0].x),2)+Math.pow(((pointshape[numpoints-1].y-pointshape[0].y)),2));\n \n /*Calculating array of extrusion values between points*/\n\tvar numpoints_3d=numpoints*numlayers; //calculating num points \n\te[0]=0; /*first extrusion value*/\n\tvar z=1;\n \tfor (i = 1; i < numpoints_3d; i = i+1) {\n e[i]=e[i-1]+d[z]*nozzle_material_surfaces_ratio; \t\n\t\tz=z+1;\t\n\t\tif (z>=numpoints){z=1;} \n\t} \t\n\te[numpoints_3d]=e[numpoints_3d-1]+d[numpoints]*nozzle_material_surfaces_ratio; /*last extrusion value*/\n\t\n\t/*document.write(e);*/\nreturn e;\n}", "title": "" }, { "docid": "c24ef23aba0c9e03276503cffb2b3407", "score": "0.42323405", "text": "function parse_PtgExtraArray(blob, length, opts) {\n var rows = 0,\n cols = 0;\n\n if (opts.biff == 12) {\n rows = blob.read_shift(4); // DRw\n\n cols = blob.read_shift(4); // DCol\n } else {\n cols = 1 + blob.read_shift(1); //DColByteU\n\n rows = 1 + blob.read_shift(2); //DRw\n }\n\n if (opts.biff >= 2 && opts.biff < 8) {\n --rows;\n if (--cols == 0) cols = 0x100;\n } // $FlowIgnore\n\n\n for (var i = 0, o = []; i != rows && (o[i] = []); ++i) {\n for (var j = 0; j != cols; ++j) {\n o[i][j] = parse_SerAr(blob, opts.biff);\n }\n }\n\n return o;\n }", "title": "" }, { "docid": "c24ef23aba0c9e03276503cffb2b3407", "score": "0.42323405", "text": "function parse_PtgExtraArray(blob, length, opts) {\n var rows = 0,\n cols = 0;\n\n if (opts.biff == 12) {\n rows = blob.read_shift(4); // DRw\n\n cols = blob.read_shift(4); // DCol\n } else {\n cols = 1 + blob.read_shift(1); //DColByteU\n\n rows = 1 + blob.read_shift(2); //DRw\n }\n\n if (opts.biff >= 2 && opts.biff < 8) {\n --rows;\n if (--cols == 0) cols = 0x100;\n } // $FlowIgnore\n\n\n for (var i = 0, o = []; i != rows && (o[i] = []); ++i) {\n for (var j = 0; j != cols; ++j) {\n o[i][j] = parse_SerAr(blob, opts.biff);\n }\n }\n\n return o;\n }", "title": "" }, { "docid": "1eb9293218a3422983980b0a921f1c1a", "score": "0.42285693", "text": "function buildFeatureInput(Pclass, Sex, Age, SibSp, Parch, Fare, Embarked){\n//console.log('===performRequest()===');\nvar data = {\n\"Inputs\": {\n\"input1\": {\n\"ColumnNames\": [\"Pclass\", \"Sex\", \"Age\", \"SibSp\", \"Parch\", \"Fare\", \"Embarked\"],\n\"Values\": [ [ Pclass, Sex, Age, SibSp, Parch, Fare, Embarked ], ]\n},\n},\n\"GlobalParameters\": {}\n}\nreturn data;\n}", "title": "" }, { "docid": "44efddfc1603a40dd25ae649e74ea2d4", "score": "0.42272878", "text": "constructor(spot, distance, id) {\n this.spot = spot //array of x and y\n this.distance = distance;\n this.id = id;\n }", "title": "" }, { "docid": "7fa9cfd2291ade3157d138facfd0f19d", "score": "0.42238855", "text": "function dataTransform (ref) {\n\n var coords = [];\n var xs = [];\n var ys = [];\n var alias = void 0;\n\n // access data\n var coordinates = ref.coordinatesData;\n\n for (alias in coordinates) {\n coords.push(coordinates[alias]);\n xs.push(coordinates[alias][0]);\n ys.push(coordinates[alias][1]);\n }\n\n // create values for x an y scales\n ref.minX = d3.min(xs);\n ref.maxX = d3.max(xs);\n ref.minY = d3.min(ys);\n ref.maxY = d3.max(ys);\n }", "title": "" }, { "docid": "46ff9222ac66e34b167d5d89bce4ade4", "score": "0.42224613", "text": "function features (){ // function that takes no input\n var feature=new Array(3);\n combs=permute(combs); // combs already has only 4 Aliens with unique feature combinations\nfor (i = 0; i < 3; i++) { // changed from 0:4 to 0:3\n feature[i]=combs[i];\n}\nreturn(feature)\n}", "title": "" }, { "docid": "5b1f2b2b3a06935187a82d0dd3eb11d4", "score": "0.42132872", "text": "constructor(array)\n {\n this.uri=rdf.long(array[0]);\n this.label=array[1];\n this.domain=array[2];\n this.range=array[3];\n this.interontology=array[4];\n this.restriction=array[5];\n }", "title": "" }, { "docid": "67283b8e6f4bfc64635f33c1d5c87f12", "score": "0.42132756", "text": "function xd(a,b){this.ea=[];this.Dc=a;this.Pb=b||l}", "title": "" }, { "docid": "e2c162fac6280ac7c5b6eb8a82a36132", "score": "0.4212743", "text": "function genotypeFromArray(arr){\n if(arr.length != 5){\n console.error(\"Bad array input in genotypeFromArray()\");\n return;\n }\n\n var params = {\n face_id : arr[0],\n eye_id : arr[1],\n eyebrow_id : arr[2],\n nose_id : arr[3],\n mouth_id : arr[4]\n };\n\n return params;\n}", "title": "" }, { "docid": "9b8b7079b0e0eb5812bfc0f8c8fa3aeb", "score": "0.42106274", "text": "function UVsDebug( geometry, size = 1024 ) {\n\n\t// handles wrapping of uv.x > 1 only\n\n\tconst abc = 'abc';\n\tconst a = new Vector2();\n\tconst b = new Vector2();\n\n\tconst uvs = [\n\t\tnew Vector2(),\n\t\tnew Vector2(),\n\t\tnew Vector2()\n\t];\n\n\tconst face = [];\n\n\tconst canvas = document.createElement( 'canvas' );\n\tconst width = size; // power of 2 required for wrapping\n\tconst height = size;\n\tcanvas.width = width;\n\tcanvas.height = height;\n\n\tconst ctx = canvas.getContext( '2d' );\n\tctx.lineWidth = 1;\n\tctx.strokeStyle = 'rgb( 63, 63, 63 )';\n\tctx.textAlign = 'center';\n\n\t// paint background white\n\n\tctx.fillStyle = 'rgb( 255, 255, 255 )';\n\tctx.fillRect( 0, 0, width, height );\n\n\tconst index = geometry.index;\n\tconst uvAttribute = geometry.attributes.uv;\n\n\tif ( index ) {\n\n\t\t// indexed geometry\n\n\t\tfor ( let i = 0, il = index.count; i < il; i += 3 ) {\n\n\t\t\tface[ 0 ] = index.getX( i );\n\t\t\tface[ 1 ] = index.getX( i + 1 );\n\t\t\tface[ 2 ] = index.getX( i + 2 );\n\n\t\t\tuvs[ 0 ].fromBufferAttribute( uvAttribute, face[ 0 ] );\n\t\t\tuvs[ 1 ].fromBufferAttribute( uvAttribute, face[ 1 ] );\n\t\t\tuvs[ 2 ].fromBufferAttribute( uvAttribute, face[ 2 ] );\n\n\t\t\tprocessFace( face, uvs, i / 3 );\n\n\t\t}\n\n\t} else {\n\n\t\t// non-indexed geometry\n\n\t\tfor ( let i = 0, il = uvAttribute.count; i < il; i += 3 ) {\n\n\t\t\tface[ 0 ] = i;\n\t\t\tface[ 1 ] = i + 1;\n\t\t\tface[ 2 ] = i + 2;\n\n\t\t\tuvs[ 0 ].fromBufferAttribute( uvAttribute, face[ 0 ] );\n\t\t\tuvs[ 1 ].fromBufferAttribute( uvAttribute, face[ 1 ] );\n\t\t\tuvs[ 2 ].fromBufferAttribute( uvAttribute, face[ 2 ] );\n\n\t\t\tprocessFace( face, uvs, i / 3 );\n\n\t\t}\n\n\t}\n\n\treturn canvas;\n\n\tfunction processFace( face, uvs, index ) {\n\n\t\t// draw contour of face\n\n\t\tctx.beginPath();\n\n\t\ta.set( 0, 0 );\n\n\t\tfor ( let j = 0, jl = uvs.length; j < jl; j ++ ) {\n\n\t\t\tconst uv = uvs[ j ];\n\n\t\t\ta.x += uv.x;\n\t\t\ta.y += uv.y;\n\n\t\t\tif ( j === 0 ) {\n\n\t\t\t\tctx.moveTo( uv.x * ( width - 2 ) + 0.5, ( 1 - uv.y ) * ( height - 2 ) + 0.5 );\n\n\t\t\t} else {\n\n\t\t\t\tctx.lineTo( uv.x * ( width - 2 ) + 0.5, ( 1 - uv.y ) * ( height - 2 ) + 0.5 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tctx.closePath();\n\t\tctx.stroke();\n\n\t\t// calculate center of face\n\n\t\ta.divideScalar( uvs.length );\n\n\t\t// label the face number\n\n\t\tctx.font = '18px Arial';\n\t\tctx.fillStyle = 'rgb( 63, 63, 63 )';\n\t\tctx.fillText( index, a.x * width, ( 1 - a.y ) * height );\n\n\t\tif ( a.x > 0.95 ) {\n\n\t\t\t// wrap x // 0.95 is arbitrary\n\n\t\t\tctx.fillText( index, ( a.x % 1 ) * width, ( 1 - a.y ) * height );\n\n\t\t}\n\n\t\t//\n\n\t\tctx.font = '12px Arial';\n\t\tctx.fillStyle = 'rgb( 191, 191, 191 )';\n\n\t\t// label uv edge orders\n\n\t\tfor ( let j = 0, jl = uvs.length; j < jl; j ++ ) {\n\n\t\t\tconst uv = uvs[ j ];\n\t\t\tb.addVectors( a, uv ).divideScalar( 2 );\n\n\t\t\tconst vnum = face[ j ];\n\t\t\tctx.fillText( abc[ j ] + vnum, b.x * width, ( 1 - b.y ) * height );\n\n\t\t\tif ( b.x > 0.95 ) {\n\n\t\t\t\t// wrap x\n\n\t\t\t\tctx.fillText( abc[ j ] + vnum, ( b.x % 1 ) * width, ( 1 - b.y ) * height );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}", "title": "" }, { "docid": "00f0cf1f46441f59cc700ccc16308623", "score": "0.42087394", "text": "function quad(a, b, c, d) \n{\n \tvar t1 = subtract(vertices[b], vertices[a]);\n \tvar t2 = subtract(vertices[c], vertices[b]);\n \tvar normal = cross(t1, t2);\n \tvar normal = vec3(normal);\n \tnormal = normalize(normal);\n\n \tpointsArray.push(vertices[a]);\n \tnormalsArray.push(normal);\n \ttexCoordsArray.push(texCoord[0]);\n\n \tpointsArray.push(vertices[b]);\n \tnormalsArray.push(normal);\n \ttexCoordsArray.push(texCoord[1]);\n\n \tpointsArray.push(vertices[c]);\n \tnormalsArray.push(normal);\n\ttexCoordsArray.push(texCoord[2]);\n\n \tpointsArray.push(vertices[a]);\n \tnormalsArray.push(normal);\n \ttexCoordsArray.push(texCoord[0]);\n\n \tpointsArray.push(vertices[c]);\n \tnormalsArray.push(normal);\n \ttexCoordsArray.push(texCoord[2]);\n\n \tpointsArray.push(vertices[d]);\n \tnormalsArray.push(normal);\n \ttexCoordsArray.push(texCoord[3]);\n}", "title": "" }, { "docid": "0040698e2640cb61e190d5c2cd8781ec", "score": "0.42046398", "text": "_createGeometry () {\n const quad = {\n a_position: {\n numComponents: 2,\n data: [\n -0.5, -0.5,\n 0.5, -0.5,\n -0.5, 0.5,\n -0.5, 0.5,\n 0.5, -0.5,\n 0.5, 0.5\n ]\n },\n a_texCoord: {\n numComponents: 2,\n data: [\n 1, 0,\n 0, 0,\n 1, 1,\n 1, 1,\n 0, 0,\n 0, 1\n ]\n }\n };\n this._bufferInfo = twgl.createBufferInfoFromArrays(this._gl, quad);\n }", "title": "" }, { "docid": "24bb8e61212c3604f0834120d4266d7f", "score": "0.42045188", "text": "function dataInArrays () {\n for (var i = 0; i < picArray.length; i++) {\n picNames.push(picArray[i].title);\n picViews.push(picArray[i].viewed);\n picClicks.push(picArray[i].clicked);\n }\n}", "title": "" }, { "docid": "23ac678d7d7fd4ccda7b9b6c69cfe5d7", "score": "0.42026672", "text": "static wrap(data, options) {\n const spec = [];\n let length = undefined;\n\n // Check for valid attributes and consistent length.\n for (const [attr, arr] of Object.entries(data)) {\n // Check all attributes are supported by bgfx.\n if (!(attr in enums.ATTRIB))\n throw new Error(`'${attr}' is not a valid bgfx attribute name`);\n\n // Check all attribute arrays are the same length.\n if (!arr.length) throw new Error(`'${attr}' cannot have empty array.`);\n else if (!length) length = arr.length;\n else if (length != arr.length)\n throw new Error(\n `'${attr}' array was length ${arr.length}, expected ${length}.`,\n );\n\n // Estimate the type of this array.\n const count = Array.isArray(arr[0]) ? arr[0].length : 1;\n const type = 'FLOAT';\n\n // Add this entry to the declaration.\n spec.push({ attr, type, count });\n }\n\n // Create a vertex declaration for this type.\n const decl = new VertexDeclaration(spec);\n const buffer = decl.allocate(length, options);\n\n // Fill in the buffer with array data.\n for (const [attr, arr] of Object.entries(data)) {\n for (let i = 0; i < buffer.length; ++i) {\n buffer.array.get(i)[attr].set(arr[i]);\n }\n }\n\n return buffer;\n }", "title": "" }, { "docid": "3d9a6b53dae8b404eb870556b8aefbf2", "score": "0.41992372", "text": "getBondCoordinates(){\n let magnitudes;\n switch(this.data.nbonds){\n case 1: \n magnitudes = [0]\n break;\n case 2:\n magnitudes =[3, -3]\n break;\n case 3:\n magnitudes = [3,0, -3]\n break;\n default:\n break;\n }\n return this.getBondsProjectedBy(magnitudes)\n }", "title": "" } ]
765b7fae7b8aa9b4fec5101af1639e2e
signals that the syntax highlighting mode has changed
[ { "docid": "fd1f35610b6322e06d37e15364bbb4fb", "score": "0.0", "text": "modeChange(mode) {\n this.emit(\"mode-change\", {mode});\n }", "title": "" } ]
[ { "docid": "675de4345cd356320c7acfdcac1bad5f", "score": "0.72885513", "text": "toggleSyntaxHighlighting() {\n // The parent process should have set the view_source.syntax_highlight\n // pref to the desired value. The reload brings that setting into\n // effect.\n this.reload();\n }", "title": "" }, { "docid": "93cb60dc921ef1df5bea1845a3e405c1", "score": "0.6527833", "text": "onHighlightStarted() {\n if (this.options.onHighlightStarted) {\n this.options.onHighlightStarted(this);\n }\n }", "title": "" }, { "docid": "a7a5ed5639085d7a14300bd678e344ba", "score": "0.6459435", "text": "syntaxHighlight() {\n if (this.refs.prePreview) {\n window.hljs.highlightBlock(this.refs.prePreview);\n }\n if (this.refs.preFull) {\n window.hljs.highlightBlock(this.refs.preFull);\n }\n }", "title": "" }, { "docid": "c3ac2fbbb1a8b731f84cadaa321f057d", "score": "0.63084275", "text": "function highlight() {\n}", "title": "" }, { "docid": "46136ef86d5adde9174165333a130d09", "score": "0.6296958", "text": "function highlight() {\n LIB.highlight(self);\n }", "title": "" }, { "docid": "ce5f50523e470f972b4daf3304b23f5b", "score": "0.61869174", "text": "highlight () {\n this.highlighted = true\n }", "title": "" }, { "docid": "ce5f50523e470f972b4daf3304b23f5b", "score": "0.61869174", "text": "highlight () {\n this.highlighted = true\n }", "title": "" }, { "docid": "3d794686f01f99d165be4cd2a7dd145c", "score": "0.6136777", "text": "function syntaxHighlighter() {\r\n dp.SyntaxHighlighter.HighlightAll('code');\r\n}", "title": "" }, { "docid": "ec89c9a4e7294f5129aba7ffd8ec8e63", "score": "0.59870964", "text": "function onEnter(assignment) {\n // TODO: GCLI doesn't support passing a context to notifications of cursor\n // position, so onEnter/onLeave/onChange are disabled below until we fix this\n assignment.highlighter = new Highlighter(context.environment.window.document);\n assignment.highlighter.nodelist = assignment.conversion.matches;\n}", "title": "" }, { "docid": "6ae8d1be91d53b9c7b43d7f8a72d5d0f", "score": "0.5972782", "text": "function setEditorSyntax(newSyntax) {\n\tif (newSyntax == \"-\") {\n\t\treturn;\n\t}\n\tif (newSyntax == \"text/html\" || newSyntax == \"xml\") {\n\t\tfoldFunc = CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder);\n\t} else {\n\t\tfoldFunc = CodeMirror.newFoldFunction(CodeMirror.braceRangeFinder);\n\t}\n\teditorCodeMirror.setOption(\"mode\", newSyntax);\n}", "title": "" }, { "docid": "1fae9d54b9c3af9755560aeab5976287", "score": "0.58943176", "text": "function SelectionChange() {}", "title": "" }, { "docid": "a374aadb8f0e1fbaaa447db233d90c15", "score": "0.58621734", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n \n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "5c583d0ad2f16e7baef1b584877c0aba", "score": "0.5852325", "text": "function monitor() {\n // S.log(\"fireSelectionChangeForStandard in selection/index\");\n editor.checkSelectionChange();\n }", "title": "" }, { "docid": "6baf133d4edc99325b67683d07ccf6f5", "score": "0.5842736", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "4c1b5a9b0980d734f107014759e99dbc", "score": "0.5841767", "text": "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\t\n\t var blocks = document.querySelectorAll('pre code');\n\t Array.prototype.forEach.call(blocks, highlightBlock);\n\t }", "title": "" }, { "docid": "df31fb42b56b7a8747418ea187c6d14c", "score": "0.58379376", "text": "function _highlight() {\n\n\tif (!State.highlight)\n\t\tState.highlight = {};\n\n var editor \t\t= ace.edit('editor');\n var Range \t\t= ace.require('ace/range').Range;\n\n\tvar curSnap \t= State.getCurrentSnapshot();\n\tvar prevSnap\t= State.highlight.prevSnap;\n\n\tvar nextLine \t= undefined;\n\tvar prevLine \t= undefined;\n\n\tvar curMark \t= State.highlight.currentMarker;\n\tvar prevMark \t= State.highlight.previousMarker;\n\n\tif (curSnap)\n\t\tnextLine \t= curSnap.meta.line;\n\n\tif (prevSnap)\n\t\tprevLine \t= prevSnap.meta.line;\n\n\teditor.getSession().removeMarker(curMark);\n\teditor.getSession().removeMarker(prevMark);\n\n\tState.highlight.currentMarker = addMarker(nextLine, \"highlightNextLineToExecute\");\n\tState.highlight.previousMarker = addMarker(prevLine, \"highlightPrevExecutedLine\");\n\n\tfunction addMarker(line,css) {\n\t\tif (!line || line < 0) return undefined;\n\n\t\tline = line - 1;\n\t\tvar range = new Range(line, 0, line, 1); // Range(rowStart, columnStart, rowEnd, columnEnd)\n\t\treturn editor.session.addMarker(range, css, \"fullLine\");\n\t}\n\n}//_highlight", "title": "" }, { "docid": "32efa5efc3cc4c76d6dcb1cd4fec1c38", "score": "0.5837728", "text": "function remarkSyntaxHiglight(options) {\n return (ast) => {\n const promises = [];\n\n visit(ast, \"code\", (node) => {\n if (node.lang) {\n function updateNode(html) {\n node.type = \"html\";\n node.value = `<pre><code>${html}</code></pre>`;\n }\n\n const result = options.highlight(node.value, node.lang);\n\n if (result && typeof result.then === \"function\") {\n const promise = Promise.resolve(result).then(updateNode);\n promises.push(promise);\n } else {\n updateNode(result);\n }\n }\n });\n\n return Promise.all(promises).then(() => null);\n };\n}", "title": "" }, { "docid": "c315876e862bd3e6e3561eae1e0e0369", "score": "0.5833996", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "c315876e862bd3e6e3561eae1e0e0369", "score": "0.5833996", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "c315876e862bd3e6e3561eae1e0e0369", "score": "0.5833996", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "c315876e862bd3e6e3561eae1e0e0369", "score": "0.5833996", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "c315876e862bd3e6e3561eae1e0e0369", "score": "0.5833996", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n Array.prototype.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "a2c95806c6a66634bbf5a1ac18625598", "score": "0.58306444", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "a2c95806c6a66634bbf5a1ac18625598", "score": "0.58306444", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "a2c95806c6a66634bbf5a1ac18625598", "score": "0.58306444", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "a2c95806c6a66634bbf5a1ac18625598", "score": "0.58306444", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "a2c95806c6a66634bbf5a1ac18625598", "score": "0.58306444", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "a2c95806c6a66634bbf5a1ac18625598", "score": "0.58306444", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "a2c95806c6a66634bbf5a1ac18625598", "score": "0.58306444", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "a2c95806c6a66634bbf5a1ac18625598", "score": "0.58306444", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "a2c95806c6a66634bbf5a1ac18625598", "score": "0.58306444", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "a2c95806c6a66634bbf5a1ac18625598", "score": "0.58306444", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "a2c95806c6a66634bbf5a1ac18625598", "score": "0.58306444", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "a2c95806c6a66634bbf5a1ac18625598", "score": "0.58306444", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "a2c95806c6a66634bbf5a1ac18625598", "score": "0.58306444", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "a2c95806c6a66634bbf5a1ac18625598", "score": "0.58306444", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "a2c95806c6a66634bbf5a1ac18625598", "score": "0.58306444", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "a2c95806c6a66634bbf5a1ac18625598", "score": "0.58306444", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "8466924a0fb8bb388546e39a0eeac0bb", "score": "0.58255273", "text": "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t ArrayProto.forEach.call(blocks, highlightBlock);\n\t }", "title": "" }, { "docid": "8466924a0fb8bb388546e39a0eeac0bb", "score": "0.58255273", "text": "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t ArrayProto.forEach.call(blocks, highlightBlock);\n\t }", "title": "" }, { "docid": "8466924a0fb8bb388546e39a0eeac0bb", "score": "0.58255273", "text": "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t ArrayProto.forEach.call(blocks, highlightBlock);\n\t }", "title": "" }, { "docid": "8466924a0fb8bb388546e39a0eeac0bb", "score": "0.58255273", "text": "function initHighlighting() {\n\t if (initHighlighting.called)\n\t return;\n\t initHighlighting.called = true;\n\n\t var blocks = document.querySelectorAll('pre code');\n\t ArrayProto.forEach.call(blocks, highlightBlock);\n\t }", "title": "" }, { "docid": "6bb393c0261d7a45825f8f6550d66772", "score": "0.5804687", "text": "function initHighlighting() {\n if (initHighlighting.called)\n return;\n initHighlighting.called = true;\n\n var blocks = document.querySelectorAll('pre code');\n ArrayProto.forEach.call(blocks, highlightBlock);\n }", "title": "" }, { "docid": "c376aaa663c9f86b45f32442247b22a3", "score": "0.5791532", "text": "highlight() {\n const workspace = store.workspace;\n if (workspace) {\n const { start, end } = selectionProvider.getSelection();\n workspace.highlight(start, end);\n }\n }", "title": "" }, { "docid": "b4e34c4741ad5f28cb7d6c0b2fb6f603", "score": "0.5764111", "text": "function SelectionChange() { }", "title": "" }, { "docid": "b4e34c4741ad5f28cb7d6c0b2fb6f603", "score": "0.5764111", "text": "function SelectionChange() { }", "title": "" }, { "docid": "f0a19e5995a81c9e132adc94dbcef999", "score": "0.5757709", "text": "clearHighlighting () {\n this.highlighted = false\n }", "title": "" }, { "docid": "f0a19e5995a81c9e132adc94dbcef999", "score": "0.5757709", "text": "clearHighlighting () {\n this.highlighted = false\n }", "title": "" }, { "docid": "ee64d90bdc2db39f67c73a8fe600eb12", "score": "0.56723005", "text": "function installSignalHandlers () { \n function connect (object, func) {\n signalHandlers.push({ disconnect : object.disconnect, slot : func });\n object.connect(func); \n } \n\n connect(editor.selectTabByOrdinal, selectTabByOrdinal);\n connect(editor.selectTabByName, selectTabByName);\n connect(editor.selectControlByName, selectControlByName);\n connect(editor.clearSelection, clearSelection); \n connect(editor.createTab, createTab);\n connect(editor.setTabName, setTabName);\n connect(editor.setPanelSize, setPanelSize);\n connect(editor.setBackgroundImage, setBackgroundImage);\n connect(editor.setDragControl, setDragControl);\n connect(editor.setControlProperty, setNamedControlProperty);\n connect(editor.setPanelText, setPanelSVG);\n connect(editor.showGrid, showGrid);\n connect(editor.applyStyle, applyStyle);\n \n connect(editor.alignLeft, function() { align('l'); });\n connect(editor.alignCentre, function() { align('c'); });\n connect(editor.alignRight, function() { align('r'); });\n connect(editor.alignTop, function() { align('t'); });\n connect(editor.alignMiddle, function() { align('m'); });\n connect(editor.alignBottom, function() { align('b'); });\n connect(editor.rotateCW, function() { transform(+90, false, false); });\n connect(editor.rotateCCW, function() { transform(-90, false, false); });\n connect(editor.rotate180, function() { transform(+180, false, false); });\n connect(editor.reflectHoz, function() { transform(0, true, false); });\n connect(editor.reflectVert, function() { transform(0, false, -true); });\n connect(editor.restoreAspect, restoreAspect);\n connect(editor.toBack, sendToBack);\n connect(editor.toFront, sendToFront);\n connect(editor.makeGroup, makeGroup);\n connect(editor.breakGroups, breakGroups);\n connect(editor.cut, cutSelection);\n connect(editor.copy, copySelection);\n connect(editor.paste, pasteSelection);\n connect(editor.duplicate, duplicateSelection);\n connect(editor.remove, deleteSelection);\n}", "title": "" }, { "docid": "2bb3bfb8d323926b677c831a7580b6d7", "score": "0.56522626", "text": "function work() {\n withOccurrences(occurType, cm, highlighter);\n }", "title": "" }, { "docid": "0846f427a1c8c602108f5f1318dd8f0f", "score": "0.5613996", "text": "function highlight(eles, option) {\n switch(option){\n case \"highlighted\":\n eles.removeClass(\"highlighted2\").removeClass(\"highlighted3\").removeClass(\"highlighted4\").addClass(\"highlighted\");\n eles.unselect();\n break;\n case \"highlighted2\":\n eles.removeClass(\"highlighted\").removeClass(\"highlighted3\").removeClass(\"highlighted4\").addClass(\"highlighted2\");\n eles.unselect();\n break;\n case \"highlighted3\":\n eles.removeClass(\"highlighted\").removeClass(\"highlighted2\").removeClass(\"highlighted4\").addClass(\"highlighted3\");\n eles.unselect();\n break;\n case \"highlighted4\":\n eles.removeClass(\"highlighted\").removeClass(\"highlighted2\").removeClass(\"highlighted3\").addClass(\"highlighted4\");\n eles.unselect();\n break;\n default:\n eles.removeClass(\"highlighted2\").removeClass(\"highlighted3\").removeClass(\"highlighted4\").addClass(\"highlighted\");\n eles.unselect();\n break;\n }\n }", "title": "" }, { "docid": "eaedf1bf68f1441ab333040d2f2be5c7", "score": "0.5590752", "text": "function __highlight( e ){\n var input = e.target;\n input.select();\n input.removeEventListener( \"focus\", __highlight, false );\n }", "title": "" }, { "docid": "bef75170d7d517c15a5e96e99802e039", "score": "0.5584827", "text": "function highlight(event) {\n\tevent = getEvent(event);\n\tvar source = getSource(event);\n\tsource.className = \"highlight\";\n}", "title": "" }, { "docid": "62c486dbf516108a4e207540f93bb593", "score": "0.5571707", "text": "function onStateChange () {\n let isRecording = gStore.getState().allocations.recording;\n if (isRecording === isHighlighted) {\n return;\n }\n\n if (isRecording) {\n gToolbox.highlightTool(\"memory\");\n } else {\n gToolbox.unhighlightTool(\"memory\");\n }\n\n isHighlighted = isRecording;\n}", "title": "" }, { "docid": "96f08d4310cde2c441e54c721f2fde92", "score": "0.5568754", "text": "clearHighlight() {\n\n //TODO - Your code goes here - \n }", "title": "" }, { "docid": "08a8a74f718016a9128f5092b088efb5", "score": "0.55570096", "text": "function highlight() {\n $(this).addClass(\"highlight\");\n }", "title": "" }, { "docid": "1c743097da255e30ae5613f0f4b370df", "score": "0.55450654", "text": "switchEditorMode(mode) {\n this.target.mode = mode;\n this.init();\n }", "title": "" }, { "docid": "50ebbdf53beb65a9e2c0e55889948dbb", "score": "0.55307", "text": "async handleSelectionChange(e) {\n if (vscode.window.activeTextEditor === undefined ||\n e.textEditor.document !== vscode.window.activeTextEditor.document) {\n // we don't care if there is no active editor\n // or user selection changed in a paneled window (e.g debug console/terminal)\n // This check is made before enqueuing this selection change, but sometimes\n // between the enqueueing and the actual calling of this function the editor\n // might close or change to other document\n return;\n }\n let selection = e.selections[0];\n ModeHandler.logger.debug(`Selections: Handling Selection Change! Selection: ${selection.anchor.toString()}, ${selection.active}, SelectionsLength: ${e.selections.length}`);\n // If our previous cursors are not included on any of the current selections, then a snippet\n // must have been inserted.\n const isSnippetSelectionChange = () => {\n return e.selections.every((s) => {\n return this.vimState.cursors.every((c) => !s.contains(new vscode.Range(c.start, c.stop)));\n });\n };\n if ((e.selections.length !== this.vimState.cursors.length || this.vimState.isMultiCursor) &&\n this.vimState.currentMode !== mode_1.Mode.VisualBlock) {\n let allowedModes = [mode_1.Mode.Normal];\n if (!isSnippetSelectionChange()) {\n allowedModes.push(...[mode_1.Mode.Insert, mode_1.Mode.Replace]);\n }\n // Number of selections changed, make sure we know about all of them still\n this.vimState.cursors = e.textEditor.selections.map((sel) => new range_1.Range(\n // Adjust the cursor positions because cursors & selections don't match exactly\n sel.anchor.isAfter(sel.active) ? sel.anchor.getLeft() : sel.anchor, sel.active));\n if (e.selections.some((s) => !s.anchor.isEqual(s.active)) &&\n allowedModes.includes(this.vimState.currentMode)) {\n // If we got a visual selection and we are on normal, insert or replace mode, enter visual mode.\n // We shouldn't go to visual mode on any other mode, because the other visual modes are handled\n // very differently than vscode so only our extension will create them. And the other modes\n // like the plugin modes shouldn't be changed or else it might mess up the plugins actions.\n await this.setCurrentMode(mode_1.Mode.Visual);\n }\n return this.updateView({ drawSelection: false, revealRange: false });\n }\n /**\n * We only trigger our view updating process if it's a mouse selection.\n * Otherwise we only update our internal cursor positions accordingly.\n */\n if (e.kind !== vscode.TextEditorSelectionChangeKind.Mouse) {\n if (selection) {\n if (e.kind === vscode.TextEditorSelectionChangeKind.Command) {\n // This 'Command' kind is triggered when using a command like 'editor.action.smartSelect.grow'\n // but it is also triggered when we set the 'editor.selections' on 'updateView'.\n let allowedModes = [mode_1.Mode.Normal, mode_1.Mode.Visual];\n if (!isSnippetSelectionChange()) {\n // if we just inserted a snippet then don't allow insert modes to go to visual mode\n allowedModes.push(...[mode_1.Mode.Insert, mode_1.Mode.Replace]);\n }\n if (allowedModes.includes(this.vimState.currentMode)) {\n // Since the selections weren't ignored then probably we got change of selection from\n // a command, so we need to update our start and stop positions. This is where commands\n // like 'editor.action.smartSelect.grow' are handled.\n if (this.vimState.currentMode === mode_1.Mode.Visual) {\n ModeHandler.logger.debug('Selections: Updating Visual Selection!');\n this.vimState.cursorStopPosition = selection.active;\n this.vimState.cursorStartPosition = selection.anchor;\n await this.updateView({ drawSelection: false, revealRange: false });\n return;\n }\n else if (!selection.active.isEqual(selection.anchor)) {\n ModeHandler.logger.debug('Selections: Creating Visual Selection from command!');\n this.vimState.cursorStopPosition = selection.active;\n this.vimState.cursorStartPosition = selection.anchor;\n await this.setCurrentMode(mode_1.Mode.Visual);\n await this.updateView({ drawSelection: false, revealRange: false });\n return;\n }\n }\n }\n // Here we are on the selection changed of kind 'Keyboard' or 'undefined' which is triggered\n // when pressing movement keys that are not caught on the 'type' override but also when using\n // commands like 'cursorMove'.\n if (mode_1.isVisualMode(this.vimState.currentMode)) {\n /**\n * In Visual Mode, our `cursorPosition` and `cursorStartPosition` can not reflect `active`,\n * `start`, `end` and `anchor` information in a selection.\n * See `Fake block cursor with text decoration` section of `updateView` method.\n * Besides this, sometimes on visual modes our start position is not the same has vscode\n * anchor because we need to move vscode anchor one to the right of our start when our start\n * is after our stop in order to include the start character on vscodes selection.\n */\n return;\n }\n const cursorEnd = position_1.laterOf(this.vimState.cursorStartPosition, this.vimState.cursorStopPosition);\n if (e.textEditor.document.validatePosition(cursorEnd).isBefore(cursorEnd)) {\n // The document changed such that our cursor position is now out of bounds, possibly by\n // another program. Let's just use VSCode's selection.\n // TODO: if this is the case, but we're in visual mode, we never get here (because of branch above)\n }\n else if (this.vimState.cursorStopPosition.isEqual(this.vimState.cursorStartPosition) &&\n this.vimState.cursorStopPosition.getRight().isLineEnd() &&\n this.vimState.cursorStopPosition.getLineEnd().isEqual(selection.active)) {\n // We get here when we use a 'cursorMove' command (that is considered a selection changed\n // kind of 'Keyboard') that ends past the line break. But our cursors are already on last\n // character which is what we want. Even though our cursors will be corrected again when\n // checking if they are in bounds on 'runAction' there is no need to be changing them back\n // and forth so we check for this situation here.\n return;\n }\n // Here we allow other 'cursorMove' commands to update our cursors in case there is another\n // extension making cursor changes that we need to catch.\n //\n // We still need to be careful with this because this here might be changing our cursors\n // in ways we don't want to. So with future selection issues this is a good place to start\n // looking.\n ModeHandler.logger.debug(`Selections: Changing Cursors from selection handler... ${selection.anchor.toString()}, ${selection.active}`);\n this.vimState.cursorStopPosition = selection.active;\n this.vimState.cursorStartPosition = selection.anchor;\n await this.updateView({ drawSelection: false, revealRange: false });\n }\n return;\n }\n if (e.selections.length === 1) {\n this.vimState.isMultiCursor = false;\n }\n if (mode_1.isStatusBarMode(this.vimState.currentMode)) {\n return;\n }\n let toDraw = false;\n if (selection) {\n let newPosition = selection.active;\n // Only check on a click, not a full selection (to prevent clicking past EOL)\n if (newPosition.character >= newPosition.getLineEnd().character && selection.isEmpty) {\n if (this.vimState.currentMode !== mode_1.Mode.Insert) {\n this.vimState.lastClickWasPastEol = true;\n // This prevents you from mouse clicking past the EOL\n newPosition = newPosition.withColumn(Math.max(newPosition.getLineEnd().character - 1, 0));\n // Switch back to normal mode since it was a click not a selection\n await this.setCurrentMode(mode_1.Mode.Normal);\n toDraw = true;\n }\n }\n else if (selection.isEmpty) {\n this.vimState.lastClickWasPastEol = false;\n }\n this.vimState.cursorStopPosition = newPosition;\n this.vimState.cursorStartPosition = newPosition;\n this.vimState.desiredColumn = newPosition.character;\n // start visual mode?\n if (selection.anchor.line === selection.active.line &&\n selection.anchor.character >= newPosition.getLineEnd().character - 1 &&\n selection.active.character >= newPosition.getLineEnd().character - 1) {\n // This prevents you from selecting EOL\n }\n else if (!selection.anchor.isEqual(selection.active)) {\n let selectionStart = new vscode_1.Position(selection.anchor.line, selection.anchor.character);\n if (selectionStart.character > selectionStart.getLineEnd().character) {\n selectionStart = new vscode_1.Position(selectionStart.line, selectionStart.getLineEnd().character);\n }\n this.vimState.cursorStartPosition = selectionStart;\n if (selectionStart.isAfter(newPosition)) {\n this.vimState.cursorStartPosition = this.vimState.cursorStartPosition.getLeft();\n }\n // If we prevented from clicking past eol but it is part of this selection, include the last char\n if (this.vimState.lastClickWasPastEol) {\n const newStart = new vscode_1.Position(selection.anchor.line, selection.anchor.character + 1);\n this.vimState.editor.selection = new vscode.Selection(newStart, selection.end);\n this.vimState.cursorStartPosition = selectionStart;\n this.vimState.lastClickWasPastEol = false;\n }\n if (configuration_1.configuration.mouseSelectionGoesIntoVisualMode &&\n !mode_1.isVisualMode(this.vimState.currentMode) &&\n this.currentMode !== mode_1.Mode.Insert) {\n await this.setCurrentMode(mode_1.Mode.Visual);\n // double click mouse selection causes an extra character to be selected so take one less character\n }\n }\n else if (this.vimState.currentMode !== mode_1.Mode.Insert) {\n await this.setCurrentMode(mode_1.Mode.Normal);\n }\n this.updateView({ drawSelection: toDraw, revealRange: false });\n }\n }", "title": "" }, { "docid": "13028068ac321e9554f262c43bcc39ab", "score": "0.5513623", "text": "function updateMode() {\n if (updatedPaused) { return; }\n\n /* don't do anything if the data content is the same */\n var text = codemirror.getValue();\n if (text === oldValue) {\n return;\n }\n oldValue = text;\n\n if (text === \"\") {\n clearOtherView();\n return;\n }\n\n /* update code mirror's highlighting mode */\n codemirror.setOption(\"mode\", looksLikeJson(text) ? \"javascript\" : \"xml\");\n /* convert data to other format and send to opposite codemirror */\n convertData();\n }", "title": "" }, { "docid": "920d2fbff603819f8a6c8f479d696ec5", "score": "0.55021745", "text": "function highlightActiveLine() {\n return activeLineHighlighter;\n}", "title": "" }, { "docid": "9628de32c1fc321109c01c9ff964f6cf", "score": "0.5490278", "text": "function unhighlightActiveFcn() {\n highlightActiveFcn(false);\n}", "title": "" }, { "docid": "c92017833d5c9dc3565a3289df264a2a", "score": "0.54820305", "text": "function onSettingChanged() {\n updateContextualCommands(true);\n }", "title": "" }, { "docid": "8adebd47a8a57f39d4a887a815d78e33", "score": "0.54607445", "text": "onSelectionEnd() {}", "title": "" }, { "docid": "e1e9d554791a928d88f31004bd881eb8", "score": "0.5453376", "text": "function initHighlightingOnLoad() {\n deprecated(\"10.6.0\", \"initHighlightingOnLoad() is deprecated. Use highlightAll() instead.\");\n wantsHighlight = true;\n }", "title": "" }, { "docid": "e1e9d554791a928d88f31004bd881eb8", "score": "0.5453376", "text": "function initHighlightingOnLoad() {\n deprecated(\"10.6.0\", \"initHighlightingOnLoad() is deprecated. Use highlightAll() instead.\");\n wantsHighlight = true;\n }", "title": "" }, { "docid": "e1e9d554791a928d88f31004bd881eb8", "score": "0.5453376", "text": "function initHighlightingOnLoad() {\n deprecated(\"10.6.0\", \"initHighlightingOnLoad() is deprecated. Use highlightAll() instead.\");\n wantsHighlight = true;\n }", "title": "" }, { "docid": "e1e9d554791a928d88f31004bd881eb8", "score": "0.5453376", "text": "function initHighlightingOnLoad() {\n deprecated(\"10.6.0\", \"initHighlightingOnLoad() is deprecated. Use highlightAll() instead.\");\n wantsHighlight = true;\n }", "title": "" }, { "docid": "5e653dae5003e2d95f3a98fac181482a", "score": "0.5442213", "text": "haxeditModeChanged(value) {\n this._haxState = value;\n }", "title": "" }, { "docid": "42bd8be904baf20c24f6d38c78646729", "score": "0.54340667", "text": "function handleSelection() {\n}", "title": "" }, { "docid": "54068d32810d1ca7c46e340d21141e7a", "score": "0.5397262", "text": "function updateCode() {\n CODE_ELEMENT.innerHTML = LANGUAGE\n ? hljs.highlight(LANGUAGE, CODE).value\n : hljs.highlightAuto(CODE).value;\n updateLineNumbers(CODE);\n}", "title": "" }, { "docid": "ddf59af3e6bea69bc2b1d1b6519a9ff2", "score": "0.53942436", "text": "function changeToActiveHighlightColor(markupObject)\n{\n\tmarkupObject.setFillColor(defaultActiveHighlightColor);\n}", "title": "" }, { "docid": "c3955d85fff664e565ce51ffdff2b3c2", "score": "0.53672624", "text": "function changeColor(selection) {\n selection.style.backgroundColor = \"red\"\n}", "title": "" }, { "docid": "b907088374ce8faa8e4cd3faca3221d6", "score": "0.5367184", "text": "function highlightCode() {\n\t\t$('pre.code').highlight({source:1, zebra:1, indent:'space', list:'ol',attribute: 'data-language'});\n\t}", "title": "" }, { "docid": "96388a65d8c1aa0641608fc07985f4f7", "score": "0.535956", "text": "clearHighlighting () {\n if (this.highlighted) {\n this.highlighted = false\n if (this.parent) {\n this.parent.clearHighlighting()\n }\n }\n }", "title": "" }, { "docid": "324383e2f546ea1cbf8b1c4cc06fa9e0", "score": "0.5357719", "text": "_onFocus() {\n if (this.enabled === false) {\n return;\n }\n\n this._highlighting = true;\n this._updateState();\n }", "title": "" }, { "docid": "4e6245ceffcf58128e60027cb973433d", "score": "0.53475124", "text": "function highlightChange(mouseStatePayload) {\n const {drawLayer,plotId,screenPt}= mouseStatePayload;\n makeHighlightDeferred(drawLayer,plotId,screenPt);\n}", "title": "" }, { "docid": "e9cbd08b2db88a57b9cbd448ff38b6e0", "score": "0.53395826", "text": "_inlineStyleObserver(oldValue, newValue) {\n this.log(`Style observer activated on ${this.tag}`);\n let newContext = \"\";\n // Grep for context/theme\n const regex = /--(?:context|theme):\\s*(?:\\\"*(light|dark|saturated)\\\"*)/gi;\n let found = regex.exec(newValue);\n if (found) {\n newContext = found[1];\n // If the new context value differs from the on value, update\n if (newContext !== this.on && !this.context) this.on = newContext;\n }\n }", "title": "" }, { "docid": "88cebb0e4fc5e0f3ab5bf710b8ee033d", "score": "0.5335872", "text": "_modeChanged(newValue){this.language=this.mode}", "title": "" }, { "docid": "bc7d4a84f5062d643f623d9813a2ed3d", "score": "0.533054", "text": "function highlightActiveLineGutter() {\n return activeLineGutterHighlighter;\n}", "title": "" }, { "docid": "1e792ac92f1e0e5d0d2848f9c2219fb2", "score": "0.53123116", "text": "function Highlighter () {\n this.locked = false;\n}", "title": "" }, { "docid": "1e792ac92f1e0e5d0d2848f9c2219fb2", "score": "0.53123116", "text": "function Highlighter () {\n this.locked = false;\n}", "title": "" }, { "docid": "a2cca75377d65e9f1190e8e6a625361e", "score": "0.5299928", "text": "function update_selection() {\n setTimeout(function() {\n var selected_chars = getSelectedChars();\n\n $('.selection').removeClass('selection');\n $(selected_chars).addClass('selection');\n\n if (selected_chars.length) {\n window.$cursor.removeClass('cursor blink-1s');\n } else {\n window.$cursor.addClass('cursor blink-1s');\n }\n }, 0);\n}", "title": "" }, { "docid": "718e791b789aec01c5910c8f334bfef3", "score": "0.5294611", "text": "function restoreSelection() {\n\trangy.init();\n\tvar currPage = window.location.pathname;\n\tvar data = {page: currPage ,course:eBookConfig.course};\n\tjQuery.ajax({url: eBookConfig.ajaxURL+'gethighlights',data: data, async: false}).done(function(data) {\n\t\thighlightResponseText = $.parseJSON(data);\n\t\tvar parentClassName, uniqueId;\n\t\t$.each(highlightResponseText, function(index, value) {\n\t\t\tparentClassName = \".\"+value.parentClass;\n\t\t\thighlightClassName = \"hl\"+value.uniqueId;\n\t\t\trangy.getSelection().restoreCharacterRanges($(parentClassName)[0], $.parseJSON(value.range));\n\t\t\tmyHighlightApplier = rangy.createCssClassApplier(\"my-highlighted-text \"+highlightClassName, {normalize: true});\n\t\t\tmyHighlightApplier.toggleSelection();\n\t\t\t$(\".\"+highlightClassName).first().attr(\"id\",highlightClassName);\n\t\t\twindow.getSelection().removeAllRanges();\n\t\t}); \n\t});\n}", "title": "" }, { "docid": "9794e361296c97f83ff6e5443e90e77c", "score": "0.5292013", "text": "function Highlighter () {\n\t this.locked = false;\n\t}", "title": "" }, { "docid": "0f8b675c54bdb0cc45963cc07e192d4e", "score": "0.5281721", "text": "styleUpdated() {\r\n this.i.jn();\r\n }", "title": "" }, { "docid": "961e76b196d8d91a37f2fdbbf1317dcf", "score": "0.52808636", "text": "function patternEditorTextChanged() {\n clearTimeout(reRegexTextUpdateTimeoutId);\n targetEditor.removeHighlight();\n reRegexTextUpdateTimeoutId = setTimeout(ReTextInputUpdate, 500);\n }", "title": "" }, { "docid": "1b2bfbf7fd395c53c0610ba6f4f08320", "score": "0.527537", "text": "function changeToHighlightColor(markupObject)\n{\n\tmarkupObject.setFillColor(defaultHighlightColor);\n}", "title": "" }, { "docid": "11a3079dd1c4cb124fd84bebf1f0a3de", "score": "0.52718276", "text": "function highlight(event) {\n preventDefaults(event)\n dropArea.classList.add('highlight')\n }", "title": "" }, { "docid": "5c9724d295b3683c7391b9cc65e11790", "score": "0.52691567", "text": "highlight () {\n\t\tthis.rootElement.classList.add('highlighted');\n\t}", "title": "" }, { "docid": "76df1eabd19505c9ad48b970bbca1e14", "score": "0.5265241", "text": "markedChange() {\n this.bChanged = true;\n }", "title": "" }, { "docid": "76df1eabd19505c9ad48b970bbca1e14", "score": "0.5265241", "text": "markedChange() {\n this.bChanged = true;\n }", "title": "" }, { "docid": "606fee6d527bef5626eb30d316be31b5", "score": "0.52628577", "text": "function updateCmSelection(cm, sel, mode) {\n\t var vim = cm.state.vim;\n\t sel = sel || vim.sel;\n\t var mode = mode ||\n\t vim.visualLine ? 'line' : vim.visualBlock ? 'block' : 'char';\n\t var cmSel = makeCmSelection(cm, sel, mode);\n\t cm.setSelections(cmSel.ranges, cmSel.primary);\n\t updateFakeCursor(cm);\n\t }", "title": "" }, { "docid": "c31ed79f1adabff398e454486863c78f", "score": "0.5247221", "text": "highlight () {\n if (!this.highlighted) {\n this.highlighted = true\n if (this.parent) {\n this.parent.highlight()\n }\n }\n }", "title": "" }, { "docid": "2449ff91bfc539a144ac11353b317a97", "score": "0.52451235", "text": "function highlightActiveLineGutter() {\n return activeLineGutterHighlighter;\n}", "title": "" }, { "docid": "0858ac3c9e9dde910c38a26ff3d37c1c", "score": "0.5242169", "text": "['@color-selected'](event) {\n this.red = event.detail.r;\n this.green = event.detail.g;\n this.blue = event.detail.b;\n this.updateColorsInOtherModes('rgb')\n }", "title": "" }, { "docid": "7f4e59eaa3342d0fcffedb25292bd1b5", "score": "0.52401644", "text": "static highlightjs() {\n // Init Highlight.js\n if (!hljs.isHighlighted) {\n hljs.initHighlighting();\n }\n }", "title": "" }, { "docid": "51d1197e03709a6f5c22b0123516e3de", "score": "0.52360165", "text": "function updateCmSelection(cm, sel, mode) {\n var vim = cm.state.vim;\n sel = sel || vim.sel;\n var mode = mode ||\n vim.visualLine ? 'line' : vim.visualBlock ? 'block' : 'char';\n var cmSel = makeCmSelection(cm, sel, mode);\n cm.setSelections(cmSel.ranges, cmSel.primary);\n updateFakeCursor(cm);\n }", "title": "" }, { "docid": "51d1197e03709a6f5c22b0123516e3de", "score": "0.52360165", "text": "function updateCmSelection(cm, sel, mode) {\n var vim = cm.state.vim;\n sel = sel || vim.sel;\n var mode = mode ||\n vim.visualLine ? 'line' : vim.visualBlock ? 'block' : 'char';\n var cmSel = makeCmSelection(cm, sel, mode);\n cm.setSelections(cmSel.ranges, cmSel.primary);\n updateFakeCursor(cm);\n }", "title": "" }, { "docid": "835c17107d6b6a7341b3327b38103df9", "score": "0.5213125", "text": "function EditorState() {\n }", "title": "" }, { "docid": "67efcf8f0f46cba97c9681b043c93846", "score": "0.5210385", "text": "_outlineChanged(newValue,oldValue){}", "title": "" }, { "docid": "a5dcc21b09794eaab7eb28296640acae", "score": "0.5210293", "text": "function handleEditorChange (data) {\n\tconsole.log('editorChange event received!');\n\tconsole.log('%c ' + data, 'color: blue; font-weight: bold;');\n\n\tupdateEditorView(data);\n}", "title": "" } ]
6723dad31d29382368640a6fe131084c
Updates a single range in the selection.
[ { "docid": "1e3eff04a918f240d77de153cc77117a", "score": "0.6267025", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n}", "title": "" } ]
[ { "docid": "21b5276e61ffa079bbddd856476d04d6", "score": "0.65945363", "text": "function replaceOneSelection(doc, i, range, options) { // 1218\n var ranges = doc.sel.ranges.slice(0); // 1219\n ranges[i] = range; // 1220\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options); // 1221\n } // 1222", "title": "" }, { "docid": "69f72366beb6c26949d859bb34ad2da6", "score": "0.6398143", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0)\n ranges[i] = range\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options)\n }", "title": "" }, { "docid": "3fe0c09660c330a90488d34115408f07", "score": "0.6361162", "text": "function replaceOneSelection(doc, i, range, options) {\n\t var ranges = doc.sel.ranges.slice(0);\n\t ranges[i] = range;\n\t setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n\t }", "title": "" }, { "docid": "3fe0c09660c330a90488d34115408f07", "score": "0.6361162", "text": "function replaceOneSelection(doc, i, range, options) {\n\t var ranges = doc.sel.ranges.slice(0);\n\t ranges[i] = range;\n\t setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n\t }", "title": "" }, { "docid": "3fe0c09660c330a90488d34115408f07", "score": "0.6361162", "text": "function replaceOneSelection(doc, i, range, options) {\n\t var ranges = doc.sel.ranges.slice(0);\n\t ranges[i] = range;\n\t setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n\t }", "title": "" }, { "docid": "b614704cea0fd1d7823159aa7b472979", "score": "0.63519984", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f2247a99f5e4e4ff30556051df58cafe", "score": "0.63484067", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f2247a99f5e4e4ff30556051df58cafe", "score": "0.63484067", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f2247a99f5e4e4ff30556051df58cafe", "score": "0.63484067", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f2247a99f5e4e4ff30556051df58cafe", "score": "0.63484067", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f2247a99f5e4e4ff30556051df58cafe", "score": "0.63484067", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f2247a99f5e4e4ff30556051df58cafe", "score": "0.63484067", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f2247a99f5e4e4ff30556051df58cafe", "score": "0.63484067", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f2247a99f5e4e4ff30556051df58cafe", "score": "0.63484067", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f2247a99f5e4e4ff30556051df58cafe", "score": "0.63484067", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f2247a99f5e4e4ff30556051df58cafe", "score": "0.63484067", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f2247a99f5e4e4ff30556051df58cafe", "score": "0.63484067", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f2247a99f5e4e4ff30556051df58cafe", "score": "0.63484067", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f2247a99f5e4e4ff30556051df58cafe", "score": "0.63484067", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f2247a99f5e4e4ff30556051df58cafe", "score": "0.63484067", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f2247a99f5e4e4ff30556051df58cafe", "score": "0.63484067", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f2247a99f5e4e4ff30556051df58cafe", "score": "0.63484067", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f2247a99f5e4e4ff30556051df58cafe", "score": "0.63484067", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f2247a99f5e4e4ff30556051df58cafe", "score": "0.63484067", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f2247a99f5e4e4ff30556051df58cafe", "score": "0.63484067", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "3d9ff517bfb3b1c9216da36a84a5aa10", "score": "0.63304824", "text": "function replaceOneSelection(doc, i, range, options) {\n\t\t var ranges = doc.sel.ranges.slice(0)\n\t\t ranges[i] = range\n\t\t setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options)\n\t\t}", "title": "" }, { "docid": "dbdab1620e46e98e0fcee3625c9492b6", "score": "0.63292325", "text": "function updateRange(range) {\n let value = range.value\n let name = range.id\n document.getElementById(name + 'Output').innerHTML = value;\n}", "title": "" }, { "docid": "1231b23a5334d6b1d220ff5b3c44ef1e", "score": "0.63275975", "text": "function replaceOneSelection(doc, i, range, options) {\n\t var ranges = doc.sel.ranges.slice(0)\n\t ranges[i] = range\n\t setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options)\n\t}", "title": "" }, { "docid": "1231b23a5334d6b1d220ff5b3c44ef1e", "score": "0.63275975", "text": "function replaceOneSelection(doc, i, range, options) {\n\t var ranges = doc.sel.ranges.slice(0)\n\t ranges[i] = range\n\t setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options)\n\t}", "title": "" }, { "docid": "e536b54d13e3d6204685fd5adc32cd44", "score": "0.63136816", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0)\n ranges[i] = range\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options)\n}", "title": "" }, { "docid": "e536b54d13e3d6204685fd5adc32cd44", "score": "0.63136816", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0)\n ranges[i] = range\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options)\n}", "title": "" }, { "docid": "e536b54d13e3d6204685fd5adc32cd44", "score": "0.63136816", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0)\n ranges[i] = range\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options)\n}", "title": "" }, { "docid": "d125d211bf6f837129e258b546e99c55", "score": "0.62980735", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "d125d211bf6f837129e258b546e99c55", "score": "0.62980735", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "d125d211bf6f837129e258b546e99c55", "score": "0.62980735", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "d125d211bf6f837129e258b546e99c55", "score": "0.62980735", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "d125d211bf6f837129e258b546e99c55", "score": "0.62980735", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "d125d211bf6f837129e258b546e99c55", "score": "0.62980735", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "d125d211bf6f837129e258b546e99c55", "score": "0.62980735", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "d125d211bf6f837129e258b546e99c55", "score": "0.62980735", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "d125d211bf6f837129e258b546e99c55", "score": "0.62980735", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "d125d211bf6f837129e258b546e99c55", "score": "0.62980735", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "d125d211bf6f837129e258b546e99c55", "score": "0.62980735", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "d125d211bf6f837129e258b546e99c55", "score": "0.62980735", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "d125d211bf6f837129e258b546e99c55", "score": "0.62980735", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "d125d211bf6f837129e258b546e99c55", "score": "0.62980735", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "d125d211bf6f837129e258b546e99c55", "score": "0.62980735", "text": "function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }", "title": "" }, { "docid": "f8a0b7610d88f287b5648f2b8e464d03", "score": "0.62750316", "text": "selectRange(range) {\n this.#startSelection()\n this.#selection.startLine = range.startLine\n this.#selection.startColumn = range.startColumn\n this.#selection.endLine = range.endLine\n this.#selection.endColumn = range.endColumn\n this.setSelection(this.#selection)\n //this.#changed.selection = true\n //this.#scheduleRefresh()\n }", "title": "" }, { "docid": "f2bf45d5b7f444f51afef8fb38726cf6", "score": "0.62014925", "text": "_onRangeUpdate(x) {\n\t\t// console.log(`_onRangeUpdate ${x}`);\n\t\tthis.emit(RangeMaster.EVENT_UPDATE, x);\n\t}", "title": "" }, { "docid": "9abd5aca32bae5ea7bb43b2dde61e86f", "score": "0.61530465", "text": "updateSelection(value, source) {\n const oldValue = this.selection;\n this.selection = value;\n this._selectionChanged.next({ selection: value, source, oldValue });\n }", "title": "" }, { "docid": "7a79dc831b51b925512918c04dce92c1", "score": "0.61092126", "text": "updateSelection(row, column) {\n if (!this._selectionStarted) {\n return;\n }\n this._endRow = row;\n this._endColumn = column;\n }", "title": "" }, { "docid": "cfe7e815fc2f18ba9d0fb12fbff2daf3", "score": "0.6089735", "text": "updateSelection(value, source) {\n this.selection = value;\n this._selectionChanged.next({ selection: value, source });\n }", "title": "" }, { "docid": "cfe7e815fc2f18ba9d0fb12fbff2daf3", "score": "0.6089735", "text": "updateSelection(value, source) {\n this.selection = value;\n this._selectionChanged.next({ selection: value, source });\n }", "title": "" }, { "docid": "de3dd60b8d58b7747108fad65921ab0e", "score": "0.6076978", "text": "function toggleRange() {\r\n\trange.toggleDisplayed();\r\n\t\r\n\tif(range.isDisplayed)\r\n\t\thelper.setElementHeight('line', \"80%\");\r\n\telse\r\n\t\thelper.setElementHeight('line', \"98%\");\r\n\r\n\tdraw();\r\n\tclearEnergyStatistics();\r\n}", "title": "" }, { "docid": "084447a26986c67bab0d943e2158de8f", "score": "0.6068239", "text": "updateSelection() {\n const {dates, rangepicker} = this.picker.datepicker;\n this.selected = dates;\n if (rangepicker) {\n this.range = rangepicker.dates;\n }\n }", "title": "" }, { "docid": "0cdc1ca863aa7d2328ab8d099bcaba1d", "score": "0.6014924", "text": "_updateValueOnRangeDrag(event) {\n\t\t// Calculate the new 'start' and 'end' values from the offset between the original press point and the current position of the mouse\n\t\tconst currentPageXPos = this.constructor.getPageXValueFromEvent(event);\n\t\tconst newValues = this._calculateRangeOffset(currentPageXPos, this._initialStartHandlePageX);\n\n\t\t// No matter the which value is set as the one to be modified (this._valueAffected) we want to modify both of them\n\t\tthis._valueAffected = null;\n\n\t\t// Update the UI and the state acccording to the calculated new values\n\t\tthis.updateValue(\"startValue\", newValues[0]);\n\t\tthis.updateValue(\"endValue\", newValues[1]);\n\t\tthis._updateHandlesAndRange(null);\n\t\tthis.storePropertyState(\"startValue\", \"endValue\");\n\t}", "title": "" }, { "docid": "7e73724f3ae74f96088441020ab214e9", "score": "0.60092956", "text": "function update(el) {\n if (!el) return;\n el = el.nodeType ? el : domify(el);\n range.deleteContents();\n range.insertNode(el);\n }", "title": "" }, { "docid": "50ac0138d38dfd36f8ed35db6828a1e8", "score": "0.5995603", "text": "function updateRange(range) {\n bkg.console.log(\"Entered updateRange() with new range: \" + range);\n $('#fmob_chart').attr('src', buildURL(range));\n bkg.console.log(\"Range update complete\");\n}", "title": "" }, { "docid": "cea00e28d29eeee96b47e314bf6e2701", "score": "0.5974101", "text": "function updateRangeValues() {\n if (paginationService.isRegistered(paginationId)) {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }\n }", "title": "" }, { "docid": "cea00e28d29eeee96b47e314bf6e2701", "score": "0.5974101", "text": "function updateRangeValues() {\n if (paginationService.isRegistered(paginationId)) {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }\n }", "title": "" }, { "docid": "cea00e28d29eeee96b47e314bf6e2701", "score": "0.5974101", "text": "function updateRangeValues() {\n if (paginationService.isRegistered(paginationId)) {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }\n }", "title": "" }, { "docid": "cea00e28d29eeee96b47e314bf6e2701", "score": "0.5974101", "text": "function updateRangeValues() {\n if (paginationService.isRegistered(paginationId)) {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }\n }", "title": "" }, { "docid": "b5f57265f2df30a69ce9f7a42c262410", "score": "0.5916683", "text": "updateSelection() {\n const {dates, rangepicker} = this.picker.datepicker;\n this.selected = dates;\n if (rangepicker) {\n this.range = rangepicker.dates;\n }\n }", "title": "" }, { "docid": "b5f57265f2df30a69ce9f7a42c262410", "score": "0.5916683", "text": "updateSelection() {\n const {dates, rangepicker} = this.picker.datepicker;\n this.selected = dates;\n if (rangepicker) {\n this.range = rangepicker.dates;\n }\n }", "title": "" }, { "docid": "79914497cbf0de27143f222163f1ec7a", "score": "0.58617216", "text": "setRange(range = EMPTY_SELECTIONRANGE) {\n this.range$.next(range);\n }", "title": "" }, { "docid": "f582a740fb0745126c196db976d12222", "score": "0.5829378", "text": "function updateRange() {\n var range = wwd.navigator.range;\n var linkText = $(\"#linkGoTo\").text();\n\n //console.log(linkText);\n\n var tmp = \"\";\n // If user has not clicked on map and scroll\n if (linkText.indexOf(\"range\") < 0) {\n tmp = ps2EndPoint + \"index.html?range=\" + range;\n } else {\n // update the new range\n var startIndex = linkText.lastIndexOf(\"=\");\n\n tmp = linkText.substr(0, startIndex + 1);\n tmp = tmp + range;\n }\n\n // Set the new range to link\n $(\"#linkGoTo\").text(tmp);\n $(\"#linkGoTo\").attr(\"href\", tmp);\n }", "title": "" }, { "docid": "71b47e08f324acdf36bb88090b57dffb", "score": "0.5783274", "text": "function handleRangeUpdate(){\n\t//console.log(\"range update!\" + parseFloat(this.dataset));\n\tconsole.log(this.name + \" range update! \" + parseFloat(ranges.value));\n}", "title": "" }, { "docid": "ede57d3dbbc4a6cae25f4b5fb5f3cc43", "score": "0.5774611", "text": "function updateRangeValues() {\r\n if (pageService.isRegistered(pageId)) {\r\n var currentPage = pageService.getCurrentPage(pageId),\r\n itemsPerPage = pageService.getItemsPerPage(pageId),\r\n totalItems = pageService.getCollectionLength(pageId);\r\n\r\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\r\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\r\n scope.range.total = totalItems;\r\n }\r\n }", "title": "" }, { "docid": "393da3c9886f384f957fc0a4222199f3", "score": "0.57704175", "text": "updateRangeDisplay(selectedTower) {\n if (this.rangeDisplay) {\n this.rangeDisplay.radius = selectedTower.range;\n } else {\n this.rangeDisplay = selectedTower.scene.add.circle(\n selectedTower.x, selectedTower.y, selectedTower.range)\n this.rangeDisplay.setStrokeStyle(2, 0xfc0303)\n this.rangeDisplay.depth = UI_DEPTH;\n }\n }", "title": "" }, { "docid": "0a9ef7eeef50c5a4302f00c184038f91", "score": "0.57649356", "text": "function update(selection){\n // Filter data according to selection\n let dataFiltered = selection === 'all'\n ? dataOriginal\n : dataOriginal.filter(d => d.award_id === selection);\n\n // Format data\n dataFormatted = getBreakdown(dataFiltered);\n\n // Update scale and yAxis according to new nominees count range\n yScale.domain([0, d3.max(dataFormatted.map(d => d.nominees_total))]);\n yAxis.transition().duration(600).call(yAxisGenerator)\n\n // Stack data\n series = stack(dataFormatted);\n\n // Update streamgraph paths\n nomineesPath\n .data(series)\n .transition()\n .duration(600)\n .attr('d', d => areaGenerator(d))\n }", "title": "" }, { "docid": "c185960d7eefc2c0b10adf6b90bb320e", "score": "0.5764406", "text": "function update(value) {\n document.getElementById(\"range\").innerHTML = value;\n inputValue = value;\n d3.selectAll(\".eviction\")\n .attr(\"fill\", dateMatch);\n }", "title": "" }, { "docid": "367c370c5e0fdd83aaf9c01ed1baa2a8", "score": "0.5727802", "text": "updateRangeFill(target) {\n // Get range from event if event passed\n const range = is.event(target) ? target.target : target; // Needs to be a valid <input type='range'>\n\n if (!is.element(range) || range.getAttribute('type') !== 'range') {\n return;\n } // Set aria values for https://github.com/sampotts/plyr/issues/905\n\n\n if (matches(range, this.config.selectors.inputs.seek)) {\n range.setAttribute('aria-valuenow', this.currentTime);\n const currentTime = controls.formatTime.call(this, this.currentTime);\n const duration = controls.formatTime.call(this, this.duration);\n const format = i18n.get('seekLabel', this.config);\n range.setAttribute('aria-valuetext', format.replace('{currentTime}', currentTime).replace('{duration}', duration));\n } else if (matches(range, this.config.selectors.inputs.volume)) {\n const percent = range.value * 100;\n range.setAttribute('aria-valuenow', percent);\n range.setAttribute('aria-valuetext', `${percent.toFixed(1)}%`);\n } else {\n range.setAttribute('aria-valuenow', range.value);\n } // WebKit only\n\n\n if (!browser.isWebkit) {\n return;\n } // Set CSS custom property\n\n\n range.style.setProperty('--value', `${(range.value - range.min) / (range.max - range.min) * 100}%`);\n }", "title": "" }, { "docid": "83eb7bcdd8898e8ccb401e6bb072991d", "score": "0.5726467", "text": "set range(value) {}", "title": "" }, { "docid": "db15b3fe34d3df00cff18017c700c523", "score": "0.5719821", "text": "function updateSelection()\n {\n var slider = $(\"#js-range-slider\").data(\"ionRangeSlider\"); // our slider data\n var from = slider.result.from; // beginning selected date\n var to = slider.result.to; // end selected date\n\n var select_element = document.getElementById(\"optionsDiv\"); // get our select object \n // get the value of the select object\n var select_value = select_element.options[select_element.selectedIndex].value; \n \n // expression to retrieve only the buildings in the right range of date and with the right type in Rotterdam\n BAG_3D_WGS_layer.definitionExpression = \"Bouwjaar >= \" + from + \" AND Bouwjaar <= \" + to +\" AND \" \n + select_value + \" AND Gemeentecode = 599\"; \n\n }", "title": "" }, { "docid": "7589bbfee9a2ed983b9fe9a4f9dcf10f", "score": "0.5681201", "text": "function updateTextInput(val) {\n document.getElementById('js-range-text-input').value=val;\n}", "title": "" }, { "docid": "8e99a969ea782701083245348e3100ac", "score": "0.5675267", "text": "function setSelection(input, start, end) {\n input.setSelectionRange(start, end);\n}", "title": "" }, { "docid": "6943b0b5a19952b7de35cdc0277f6207", "score": "0.5648247", "text": "function updateMarkdownFromRange() {\n convertRange_();\n}", "title": "" }, { "docid": "b97bbbca5d070cdda1cca0bbbe99fb10", "score": "0.56385165", "text": "function updateRange(vm, lastRange, localRange, forwardCursors, indexShift) {\n\tforwardCursors.map(cursor => {\n\t\tif (isSurrounded(lastRange, cursor.range)) {\n\t\t\tvm.cursorModule.moveCursor(cursor.id, {\n\t\t\t\tlength: 0,\n\t\t\t\tindex: localRange.index\n\t\t\t});\n\t\t} else if (isInInterval(lastRange.index, cursor.range) && cursor.range.length !== 0) {\n\t\t\tvm.cursorModule.moveCursor(cursor.id, {\n\t\t\t\t...cursor.range,\n\t\t\t\tlength: cursor.range.length + indexShift\n\t\t\t});\n\t\t} else {\n\t\t\tvm.cursorModule.moveCursor(cursor.id, {\n\t\t\t\t...cursor.range,\n\t\t\t\tindex: cursor.range.index + indexShift\n\t\t\t});\n\t\t}\n\t});\n\tvm.cursorModule.update();\n}", "title": "" }, { "docid": "76d9ec0a74edf7a256c79fc57bbc6307", "score": "0.56305575", "text": "updateSelection() {\n const {dates, rangepicker} = this.picker.datepicker;\n this.selected = dates.reduce((years, timeValue) => {\n return (0,_lib_utils_js__WEBPACK_IMPORTED_MODULE_0__.pushUnique)(years, (0,_lib_date_js__WEBPACK_IMPORTED_MODULE_1__.startOfYearPeriod)(timeValue, this.step));\n }, []);\n if (rangepicker && rangepicker.dates) {\n this.range = rangepicker.dates.map(timeValue => {\n if (timeValue !== undefined) {\n return (0,_lib_date_js__WEBPACK_IMPORTED_MODULE_1__.startOfYearPeriod)(timeValue, this.step);\n }\n });\n }\n }", "title": "" }, { "docid": "28c7e840bce7a4edcbcd56ccccfbbf23", "score": "0.5624226", "text": "setRange(target, value = 0) {\n if (!is.element(target)) {\n return;\n } // eslint-disable-next-line\n\n\n target.value = value; // Webkit range fill\n\n controls.updateRangeFill.call(this, target);\n }", "title": "" }, { "docid": "05ca42f13e82130b7f32431dd10f4054", "score": "0.561028", "text": "updateSelection() {\n const {dates, rangepicker} = this.picker.datepicker;\n this.selected = dates.reduce((years, timeValue) => {\n return pushUnique(years, startOfYearPeriod(timeValue, this.step));\n }, []);\n if (rangepicker && rangepicker.dates) {\n this.range = rangepicker.dates.map(timeValue => {\n if (timeValue !== undefined) {\n return startOfYearPeriod(timeValue, this.step);\n }\n });\n }\n }", "title": "" }, { "docid": "5cdf4656155d7b6f14fffd3ccbf9a352", "score": "0.5606941", "text": "function updateRangeFromUI () {\n var uirangeL = parseFloat(slider.style(\"left\"));\n var uirangeW = parseFloat(slider.style(\"width\"));\n var conW = sliderBox.node().clientWidth; //parseFloat(container.style(\"width\"));\n var slope = (conW - minWidth) / (rangeMax - rangeMin);\n var rangeW = (uirangeW - minWidth) / slope;\n if (conW == uirangeW) {\n var uislope = 0;\n } else {\n var uislope = (rangeMax - rangeMin - rangeW) / (conW - uirangeW);\n }\n var rangeL = rangeMin + uislope * uirangeL;\n sliderRange.begin = Math.round(rangeL);\n sliderRange.end = Math.round(rangeL + rangeW);\n\n //Fire change listeners\n changeListeners.forEach(function (callback) {\n callback({begin: sliderRange.begin, end: sliderRange.end});\n });\n }", "title": "" }, { "docid": "561bc86d975221dd3667c313e2e58f38", "score": "0.5606365", "text": "function syncRangeSlider(e) {\n const value = e.target.value;\n numberOfCharactersRange.value = value;\n numberOfCharacters.value = value;\n}", "title": "" }, { "docid": "d9daee18d0cbeb218368f020690512c0", "score": "0.5594603", "text": "function updateSelectedYear() {\n\t\tvar year = model.fields.dateRange.selectedYear;\n\t\tmodel.fields.dateRange.beginDate.value = new Date(year, 0, 1);\n\t\tmodel.fields.dateRange.endDate.value = new Date(year, 11, 31);\n\t}", "title": "" }, { "docid": "0cefda5d405cd5fbe3eeba9346fa3db9", "score": "0.5581447", "text": "function updateSlotsSelected(event) {\n/*All slots are available (due to checkSlotsAvailable() !! Just need to check current selection (orange). */\n// 0) Niets ervoor aangeduid => PRINT\n// 1) Ergens anders => VERWIJDER => PRINT\n// 2) Overlapt => VERWIJDER => PRINT\n// 3) identiek hetzelfde => NIETS\n\n //No previously selected slotrange\n if(IdSelectedSlot == -1) {\n IdSelectedSlot = event.currentTarget.id;\n printNewRange();\n }\n\n //(Exact) SAME RANGE CLICKED => REMOVE selection\n else if(IdSelectedSlot == event.currentTarget.id) {\n removeOldRange();\n IdSelectedSlot = -1;\n }\n\n //There is a current selected slotrange\n else {\n removeOldRange();\n IdSelectedSlot = event.currentTarget.id;\n printNewRange();\n }\n}", "title": "" }, { "docid": "8e4c4edffb51c8660443bc6c3201e82b", "score": "0.5575951", "text": "updateSelection() {\n const {dates, rangepicker} = this.picker.datepicker;\n this.selected = dates.reduce((years, timeValue) => {\n return pushUnique(years, startOfYearPeriod(timeValue, this.step));\n }, []);\n if (rangepicker && rangepicker.dates) {\n this.range = rangepicker.dates.map(timeValue => {\n if (timeValue !== undefined) {\n return startOfYearPeriod(timeValue, this.step);\n }\n });\n }\n }", "title": "" }, { "docid": "b2d2aca761867ea41acf55c1e756b549", "score": "0.55634034", "text": "updateRangeFill(target) {\n // Get range from event if event passed\n const range = is.event(target) ? target.target : target;\n\n // Needs to be a valid <input type='range'>\n if (!is.element(range) || range.getAttribute('type') !== 'range') {\n return;\n }\n\n // Set aria values for https://github.com/sampotts/plyr/issues/905\n if (matches(range, this.config.selectors.inputs.seek)) {\n range.setAttribute('aria-valuenow', this.currentTime);\n const currentTime = controls.formatTime(this.currentTime);\n const duration = controls.formatTime(this.duration);\n const format = i18n.get('seekLabel', this.config);\n range.setAttribute(\n 'aria-valuetext',\n format.replace('{currentTime}', currentTime).replace('{duration}', duration),\n );\n } else if (matches(range, this.config.selectors.inputs.volume)) {\n const percent = range.value * 100;\n range.setAttribute('aria-valuenow', percent);\n range.setAttribute('aria-valuetext', `${percent.toFixed(1)}%`);\n } else {\n range.setAttribute('aria-valuenow', range.value);\n }\n\n // WebKit only\n if (!browser.isWebkit) {\n return;\n }\n\n // Set CSS custom property\n range.style.setProperty('--value', `${range.value / range.max * 100}%`);\n }", "title": "" }, { "docid": "9170528698cb5b7defdbac699b1119b4", "score": "0.55187225", "text": "function updateProductAvailabilitiesRangeEvent()\n {\n var $availabilityBlock = $(this).closest('.js-availability-range-block');\n var availabilityRangeId = $availabilityBlock.find('.js-availability-range-id').val();\n\n var updatedValues = {\n day: $availabilityBlock.find('.js-day-select').val(),\n from: $availabilityBlock.find('.js-product-availability-from-input').val(),\n to: $availabilityBlock.find('.js-product-availability-to-input').val()\n };\n\n productAvailabilityData.updateProductAvailabilityRange(availabilityRangeId, updatedValues);\n }", "title": "" } ]
5a44a7ced34616ebb970757555553f2f
converts a unit string to px
[ { "docid": "5d27ece6db206c3800a2a59762bd02ed", "score": "0.65157396", "text": "function parseUnit( vVal, $node, sValFn ){\n\t\tvar aVal = /(-?\\d+)(.*)/.exec( vVal )\n\t\t , fUnit = parseFloat( aVal[ 1 ] )\n\t\t , sUnit = aVal[ 2 ]\n\t\t ;\n\n\t\tswitch( sUnit ){\n\t\t\tcase '':\n\t\t\tcase 'px':\n\t\t\t\treturn fUnit;\n\n\t\t\tcase '%':\n\t\t\t\treturn $node[ sValFn ]() * fUnit / 100;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'Unexpected unit type: ' + sUnit );\n\t\t\t\treturn;\n\t\t}\n\t}", "title": "" } ]
[ { "docid": "079e5a869e92202765cc1b5dabb094b2", "score": "0.7922596", "text": "function unitToPX(element, strUnit) {\r\n // if we need to convert em to px\r\n if (strUnit.toLowerCase().indexOf('em') > -1) {\r\n return GS.emToPx(element, strUnit);\r\n }\r\n\r\n return parseInt(strUnit, 10);\r\n }", "title": "" }, { "docid": "debadbf7344827b782475b73a2702b92", "score": "0.75415885", "text": "parsePx(value) {\n return value + \"px\"\n }", "title": "" }, { "docid": "bc371b1d4db61dc076745d1db12095e0", "score": "0.75270355", "text": "function normalizeUnits(value){return value.match(/px|em|rem/)?value:value+'px';}", "title": "" }, { "docid": "070bef77f3ebc2ebd872ed0211a22c72", "score": "0.74857855", "text": "function parsePxString(s) {\n return parseFloat(s.replace('px', ''))\n }", "title": "" }, { "docid": "3d682548e8646b0158cfc7d8be572eea", "score": "0.74142945", "text": "function normalizeUnits(value) {\n return value.match(/([A-Za-z%]+)$/) ? value : `${value}px`;\n}", "title": "" }, { "docid": "77b549048f9379340d570a42ee866363", "score": "0.7314998", "text": "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "title": "" }, { "docid": "77b549048f9379340d570a42ee866363", "score": "0.7314998", "text": "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "title": "" }, { "docid": "77b549048f9379340d570a42ee866363", "score": "0.7314998", "text": "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "title": "" }, { "docid": "77b549048f9379340d570a42ee866363", "score": "0.7314998", "text": "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "title": "" }, { "docid": "77b549048f9379340d570a42ee866363", "score": "0.7314998", "text": "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "title": "" }, { "docid": "f27fbf57166605dc1a98eaea4de1e4a8", "score": "0.72874486", "text": "function to_px(x) { return (x.toString() + \"px\"); }", "title": "" }, { "docid": "35a0f8d5b8d873e519c149591707a800", "score": "0.71155447", "text": "function getInt(str) {\n return parseInt(str.replace('px', ''), 10);\n}", "title": "" }, { "docid": "f4a976538ee6874faae4dc89883efa57", "score": "0.71140206", "text": "function normalizeUnits(value) {\n return (value.match(/px|em|rem/)) ? value : value + 'px';\n}", "title": "" }, { "docid": "d87ae185cfa32c6574e698337dfe4848", "score": "0.70737696", "text": "function convertUnit (xUnit, mUnit, mVal) {\n\t\t\t\tif (xUnit !== mUnit) {\n\t\t\t\t\tif (mUnit === 'em')\n\t\t\t\t\t\tmVal = options.px_em_ratio * mVal;\n\t\t\t\t\tif (xUnit === 'em')\n\t\t\t\t\t\tmVal = mVal/options.px_em_ratio;\n\t\t\t\t}\n\n\t\t\t\treturn mVal;\n\t\t\t}", "title": "" }, { "docid": "fee405f172b9b52a1cc3d8d7fa5f5d97", "score": "0.702861", "text": "function normalizeUnits(value) {\n\t return (value.match(/px|em|rem/)) ? value : value + 'px';\n\t}", "title": "" }, { "docid": "f415e5d66ee12a61b996aca6e7d4f9d1", "score": "0.6990926", "text": "function toPx (value, decl, result) {\n value = (typeof value === 'string' && value.indexOf('calc(') !== -1) ? _reduceCssCalc_1_3_0_reduceCssCalc(value) : value;\n var parts = /^(\\d*\\.?\\d+)([a-zA-Z%]*)$/.exec(value);\n if (parts !== null) {\n var number = parts[1];\n var unit = parts[2];\n\n if (unit === 'px' || unit === '') {\n return parseFloat(number);\n }\n else if (unit === 'em' || unit === 'rem') {\n return parseFloat(number) * BASE_FONT_SIZE;\n }\n else if (unit === '%') {\n return (parseFloat(number) / 100) * BASE_FONT_SIZE;\n } else {\n // other units: vw, ex, ch, etc...\n result.warn('Unit cannot be used for conversion, so 16px is used.');\n return BASE_FONT_SIZE;\n }\n } else {\n throw decl.error('Root font-size is invalid', {plugin: 'pixrem'});\n }\n}", "title": "" }, { "docid": "ee0b01cf845f784faf0eb92078fcf552", "score": "0.69769937", "text": "function intPx(i)\n{\n\ti = i.toString();\t\t\t// cast into string\n\t\t\n\tif ( i.match( /\\d$/ ) )\t\t// if ends with digit\n\t\ti = i + \"px\";\t\t\t// auto append px\n\t\t\n\treturn i;\n}", "title": "" }, { "docid": "cb190eddfc7c3f46cf5549c8498f292a", "score": "0.6927954", "text": "checkValuePx(str) {\n if (!isNaN(str)) {\n return str + 'px'\n }\n return str\n }", "title": "" }, { "docid": "ee01a5833cb8579cd5131b36d8962dad", "score": "0.6910132", "text": "function px(x) {\n if (typeof (x) == \"string\")\n return x\n return Math.round(x) + 'px'\n}", "title": "" }, { "docid": "c93d583f0cccecfb34fe3288060e61f5", "score": "0.6896156", "text": "function getpx(x) {\n if (typeof (x) == \"string\") {\n x = x.replace('px', '').trim()\n return Number(x)\n }\n return x\n}", "title": "" }, { "docid": "04bfa231206619d90ab469852d806038", "score": "0.68862295", "text": "function clearPx(str){\n return Number(str.replace(/px$/, ''));\n }", "title": "" }, { "docid": "f10ec9b8879c11c128df44d6ff3698bf", "score": "0.6853007", "text": "function __get_pixel_value(str)\n{\n var is_percentage = (str.indexOf('%') !== -1),\n is_rem = (str.indexOf('rem') !== -1);\n\n var float_value = parseFloat( str.replace(/[^0-9.]/g, '') );\n\n if( (!is_percentage) && (!is_rem) )\n return Math.round(float_value);\n\n if(is_percentage)\n return Math.round( Math.floor((float_value / 100) * __core.viewport_width) );\n\n return Math.round( Math.floor(__core.dom_default_font_size_px * float_value) );\n}", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.68431234", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.68431234", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.68431234", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.68431234", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.68431234", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.68431234", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.68431234", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.68431234", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.68431234", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.68431234", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.68431234", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.68431234", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "b59a0e0e916f93c90ad34aaa32567414", "score": "0.6839475", "text": "function convertUnitsToPixels(num) {\n var units = myDiagram.model.modelData.units;\n if (units === 'meters') return (num * 100) / 2;\n if (units === 'feet') return (num * 30.48) / 2;\n if (units === 'inches') return (num * 2.54) / 2;\n return num / 2;\n}", "title": "" }, { "docid": "3e09efbc43be6ac6075ce1dfe142c948", "score": "0.6747932", "text": "function getUnit(input){\nreturn String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1]||'';\n}// Emulate the sass function \"unitless\"", "title": "" }, { "docid": "bbc71cf10af6e25e81b6f045b885006f", "score": "0.6739509", "text": "function ensureUnit(val) {\n return val + (Object(__WEBPACK_IMPORTED_MODULE_0_min_dash__[\"l\" /* isNumber */])(val) ? 'px' : '');\n}", "title": "" }, { "docid": "081642293e19aea3be0fd9d69ebbab64", "score": "0.67296624", "text": "function toPx (value) {\n value = (typeof value === 'string' && value.indexOf('calc(') !== -1) ? calc(value) : value;\n var parts = /^(\\d*\\.?\\d+)([a-zA-Z%]*)$/.exec(value);\n if (parts !== null) {\n var number = parts[1];\n var unit = parts[2];\n\n if (unit === 'px' || unit === '') {\n return parseFloat(number);\n }\n else if (unit === 'em' || unit === 'rem') {\n return parseFloat(number) * BASE_FONT_SIZE;\n }\n else if (unit === '%') {\n return (parseFloat(number) / 100) * BASE_FONT_SIZE;\n } else {\n // other units: vw, ex, ch, etc...\n return BASE_FONT_SIZE;\n }\n } else {\n throw new Error('Root font-size is invalid');\n }\n}", "title": "" }, { "docid": "1f6850206c0be4c2e832955d7ad637c0", "score": "0.67231494", "text": "function fromPx(pxValue) {\n return parseInt(pxValue.replace('px', ''), 10);\n}", "title": "" }, { "docid": "c1ecfbd1b0bf791d97e58269fa4c89b4", "score": "0.66742253", "text": "function px(num) {\n return num + 'px';\n }", "title": "" }, { "docid": "ad4813237d778c69a3e7f031b3e23248", "score": "0.66700655", "text": "function toCm(n, unit) {\n // as defined in http://www.w3.org/TR/css3-values/#absolute-lengths\n if (unit === 'cm') return n;else if (unit === 'mm') return n * 0.1;else if (unit === 'in') return n * 2.54;else if (unit === 'px') return n * toCm(1 / 96, 'in');else if (unit === 'pt') return n * toCm(1 / 72, 'in');else if (unit === 'pc') return n * toCm(12, 'pt');\n }", "title": "" }, { "docid": "ab0cd690bacaebe2d5b25496c4e80acd", "score": "0.6618619", "text": "function toCm(n, unit) {\n // as defined in http://www.w3.org/TR/css3-values/#absolute-lengths\n if (unit === 'cm') return n;\n else if (unit === 'mm') return n*0.1;\n else if (unit === 'in') return n*2.54;\n else if (unit === 'px') return n*toCm(1/96, 'in');\n else if (unit === 'pt') return n*toCm(1/72, 'in');\n else if (unit === 'pc') return n*toCm(12, 'pt');\n }", "title": "" }, { "docid": "f3b2120afa980e300acc16f90cebce16", "score": "0.6556706", "text": "function measureToNumber(str){\n\tvar parts = str.split(\"p\");\n\tvar val = parts[0];\n\tval = Number(val);\n\treturn val;\n}", "title": "" }, { "docid": "e30b6319d719da68e02f4b2847f2a8ac", "score": "0.6554663", "text": "static px(value) {\n return new css_unit_value_1.CSSUnitValue(value, CSSUnit.px);\n }", "title": "" }, { "docid": "698867100fe549bef0cf796105a1dee1", "score": "0.64925873", "text": "function getUnits() {\n if (!documents.length) return '';\n var key = activeDocument.rulerUnits.toString().replace('RulerUnits.', '');\n switch (key) {\n case 'Pixels': return 'px';\n case 'Points': return 'pt';\n case 'Picas': return 'pc';\n case 'Inches': return 'in';\n case 'Millimeters': return 'mm';\n case 'Centimeters': return 'cm';\n // Added in CC 2023 v27.1.1\n case 'Meters': return 'm';\n case 'Feet': return 'ft';\n case 'FeetInches': return 'ft';\n case 'Yards': return 'yd';\n // Parse new units in CC 2020-2023 if a document is saved\n case 'Unknown':\n var xmp = activeDocument.XMPString;\n if (/stDim:unit/i.test(xmp)) {\n var units = /<stDim:unit>(.*?)<\\/stDim:unit>/g.exec(xmp)[1];\n if (units == 'Meters') return 'm';\n if (units == 'Feet') return 'ft';\n if (units == 'FeetInches') return 'ft';\n if (units == 'Yards') return 'yd';\n return 'px';\n }\n break;\n default: return 'px';\n }\n}", "title": "" }, { "docid": "79dbad2882f12c805b5ccb4d3995b32d", "score": "0.6472747", "text": "function removePxParseInt(variable){\n variable = variable.replace(\"px\", \"\");\n variable = parseInt(variable);\n return variable;\n}", "title": "" }, { "docid": "d5c35cf55201d1e4999566609e4960c4", "score": "0.6439717", "text": "function convertPixelsToUnits(num) {\n var units = myDiagram.model.modelData.units;\n if (units === 'meters') return (num / 100) * 2;\n if (units === 'feet') return (num / 30.48) * 2;\n if (units === 'inches') return (num / 2.54) * 2;\n return num * 2;\n}", "title": "" }, { "docid": "965e20f5398baa23ed5c840b7d7b7795", "score": "0.63978696", "text": "function offsetStrToPixelValue(str, size)\n\t{\n\t if (typeof str === \"string\")\n\t {\n\t var offset = parseFloat(str);\n\t\n\t if (Number.isNaN(offset) || !Number.isFinite(offset))\n\t return 0;\n\t\n\t if (str.endsWith(\"%\"))\n\t return offset * size / 100;\n\t else\n\t return offset;\n\t }\n\t\n\t return 0;\n\t}", "title": "" }, { "docid": "6bf33929f6875905af652bfff0cab6d7", "score": "0.63732374", "text": "normalizeUnit(str, full) {\n let num = parseFloat(str);\n let deg = (num / full) * 360;\n return `${deg}deg`\n }", "title": "" }, { "docid": "b0c631ccf7bbdb8aa5eda8429ef2d369", "score": "0.6336337", "text": "function px2dp(px) {\n return px * deviceW / basePx\n}", "title": "" }, { "docid": "11a57ddfff0af99a0324037c5dac9105", "score": "0.6307327", "text": "function toPx(elem, value, prop, force) {\n // use width as the default property, or specify your own\n prop = prop || 'width';\n\n var style,\n inlineValue,\n ret,\n unit = (value.match(runit)||[])[2],\n conversion = unit === 'px' ? 1 : convert[unit + 'toPx'],\n rem = /r?em/i;\n\n if (conversion || rem.test(unit) && !force) {\n // calculate known conversions immediately\n // find the correct element for absolute units or rem or fontSize + em or em\n elem = conversion ? elem : unit === 'rem' ? docElement : prop === 'fontSize' ? elem.parentNode || elem : elem;\n\n // use the pre-calculated conversion or fontSize of the element for rem and em\n conversion = conversion || parseFloat(curCSS(elem, 'fontSize'));\n\n // multiply the value by the conversion\n ret = parseFloat(value) * conversion;\n } else {\n // begin \"the awesome hack by Dean Edwards\"\n // @see http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291\n\n // remember the current style\n style = elem.style;\n inlineValue = style[prop];\n\n // set the style on the target element\n try {\n style[prop] = value;\n } catch(e) {\n // IE 8 and below throw an exception when setting unsupported units\n return 0;\n }\n\n // read the computed value\n // if style is nothing we probably set an unsupported unit\n ret = !style[prop] ? 0 : parseFloat(curCSS(elem, prop));\n\n // reset the style back to what it was or blank it out\n style[prop] = inlineValue !== undefined ? inlineValue : null;\n }\n\n // return a number\n return ret;\n}", "title": "" }, { "docid": "8ddc09c3a3273b8d029a611d26d495fa", "score": "0.6302532", "text": "function toPx(elem, value, prop, force) {\n // use width as the default property, or specify your own\n prop = prop || 'width';\n\n var style,\n inlineValue,\n ret,\n unit = (value.match(runit) || [])[2],\n conversion = unit === 'px' ? 1 : convert[unit + 'toPx'],\n rem = /r?em/i;\n\n if (conversion || rem.test(unit) && !force) {\n // calculate known conversions immediately\n // find the correct element for absolute units or rem or fontSize + em or em\n elem = conversion ? elem : unit === 'rem' ? docElement : prop === 'fontSize' ? elem.parentNode || elem : elem;\n\n // use the pre-calculated conversion or fontSize of the element for rem and em\n conversion = conversion || parseFloat(curCSS(elem, 'fontSize'));\n\n // multiply the value by the conversion\n ret = parseFloat(value) // conversion;\n } else {\n // begin \"the awesome hack by Dean Edwards\"\n // @see http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291\n\n // remember the current style\n style = elem.style;\n inlineValue = style[prop];\n\n // set the style on the target element\n try {\n style[prop] = value;\n } catch (e) {\n // IE 8 and below throw an exception when setting unsupported units\n return 0;\n }\n\n // read the computed value\n // if style is nothing we probably set an unsupported unit\n ret = !style[prop] ? 0 : parseFloat(curCSS(elem, prop));\n\n // reset the style back to what it was or blank it out\n style[prop] = inlineValue !== undefined ? inlineValue : null;\n }\n\n // return a number\n return ret;\n }", "title": "" }, { "docid": "57d6bd464c577c0aac08c3e0a548d069", "score": "0.6286936", "text": "function getValueOf(stringVal)\n {\n var textNodeValue = String(stringVal);\n var pos = textNodeValue.lastIndexOf(\"px\");\n if ( pos > 0 ) textNodeValue = textNodeValue.substring(0,pos);\n return textNodeValue;\n }", "title": "" }, { "docid": "58f23ab13aba8c731aecd67718c85dc2", "score": "0.6279966", "text": "function getUnitsInPx(doc, value) {\n var isRem = typeof value === 'string' && includes(value, 'rem');\n var html = doc.documentElement;\n var rootFontSize = 16;\n\n if (html && isRem) {\n return parseFloat(getComputedStyle(html).fontSize || String(rootFontSize)) * getNumber(value);\n }\n\n return getNumber(value);\n}", "title": "" }, { "docid": "58f23ab13aba8c731aecd67718c85dc2", "score": "0.6279966", "text": "function getUnitsInPx(doc, value) {\n var isRem = typeof value === 'string' && includes(value, 'rem');\n var html = doc.documentElement;\n var rootFontSize = 16;\n\n if (html && isRem) {\n return parseFloat(getComputedStyle(html).fontSize || String(rootFontSize)) * getNumber(value);\n }\n\n return getNumber(value);\n}", "title": "" }, { "docid": "00bd1f06b014b6f4a67fa6629977039e", "score": "0.6274508", "text": "_normalizeTagAttrUnit(attr, ratio) {\n let stringValue = attr.nodeValue.toLowerCase()\n let floatValue = parseFloat(stringValue)\n\n if (isNaN(floatValue)) {\n return this.parser._skipTagAttr(this.tag, attr, 'only numeric value allowed')\n }\n\n if (stringValue.indexOf('mm') !== -1) {\n return floatValue * 3.5433070869\n }\n\n if (stringValue.indexOf('cm') !== -1) {\n return floatValue * 35.433070869\n }\n\n if (stringValue.indexOf('in') !== -1) {\n return floatValue * 90.0\n }\n\n if (stringValue.indexOf('pt') !== -1) {\n return floatValue * 1.25\n }\n\n if (stringValue.indexOf('pc') !== -1) {\n return floatValue * 15.0\n }\n\n if (stringValue.indexOf('%') !== -1) {\n let viewBox = this.tag.getAttr('viewBox', this.tag.parent && this.tag.parent.getAttr('viewBox'))\n\n switch (attr.nodeName) {\n case 'x':\n case 'width':\n floatValue *= viewBox[2] / 100\n break\n case 'y':\n case 'height':\n floatValue *= viewBox[3] / 100\n break\n }\n }\n\n if (stringValue.indexOf('em') !== -1) {\n let fontSize = this.tag.getAttr('font-size', 16)\n\n switch (attr.nodeName) {\n case 'x':\n case 'y':\n case 'width':\n case 'height':\n floatValue *= fontSize\n break\n }\n }\n\n return floatValue\n }", "title": "" }, { "docid": "34041d8451b9dd2466a0863143763df8", "score": "0.6252093", "text": "function uucssunit(node, // @param Node: context\n value, // @param Number/CSSUnitString: 123, \"123\", \"123px\",\n // \"123em\", \"123pt\", \"auto\"\n quick, // @param Boolean(= false): true is quick mode\n prop) { // @param String(= \"left\"): property\n prop = prop || \"left\";\n\n var fontSize, ratio, _float = parseFloat;\n\n if (typeof value === _number) {\n return value;\n }\n\n // \"123px\" -> 123\n if (uucssunit.px.test(value)) {\n return parseInt(value) || 0;\n }\n if (value === \"auto\") {\n if (!prop[_indexOf](\"bor\") || !prop[_indexOf](\"pad\")) { // /^border|^padding/g\n return 0;\n }\n }\n if (!quick) {\n return uucssunit.calc(node, prop, value);\n }\n if (uucssunit.pt.test(value)) {\n return (_float(value) * 4 / 3) | 0; // 12pt * 1.333 = 16px\n } else if (uucssunit.em.test(value)) {\n fontSize = uucss(node).fontSize;\n ratio = uucssunit.pt.test(fontSize) ? 4 / 3 : 1;\n return (_float(value) * _float(fontSize) * ratio) | 0;\n }\n return parseInt(value) || 0;\n}", "title": "" }, { "docid": "ff2d35072690d9ca6aa944db23d9a81e", "score": "0.6213388", "text": "function getSize(size, units){\n if(units){\n return size + '%';\n }else{\n return size + 'px';\n }\n}", "title": "" }, { "docid": "3edaa08717e505aa4027afab8ba1a2f1", "score": "0.62120867", "text": "function getDigitFromDigitPX(input){\n var re = new RegExp(/(\\d*)px/);\n var m = re.exec(input);\n if (m == null) {\n return 0;\n } else {\n return parseInt(m[1]);\n }\n }", "title": "" }, { "docid": "2a9712a631fa6da6365c40036593909c", "score": "0.6199441", "text": "function cm2px(cm) {\n// 1 cm = 37.795276 px;\n// var d = $(\"<div/>\").css({\n// position: 'absolute', \n// top : '-1000cm', \n// left : '-1000cm', \n// height : '1000cm', \n// width : '1000cm'\n// }).appendTo('body');\n// var px_per_cm = d.height() / 1000;\n// d.remove();\n// return cm * px_per_cm;\n return parseFloat((cm * 37.80).toFixed(1));\n}", "title": "" }, { "docid": "69718ee41ac22322e95e7538defc89ea", "score": "0.6190882", "text": "static get unitsPerInch() {\n var rv = {};\n\n rv['pt'] = 72.0;\n rv['px'] = 96.0;\n rv['em'] = 6.0;\n return rv;\n }", "title": "" }, { "docid": "f732d3c6aca834d9ad7401a8329bd8c0", "score": "0.61852944", "text": "function pixelsToInt( pixelString ) {\n return parseInt( pixelString.replace('px', '') );\n }", "title": "" }, { "docid": "03c75fdf13d8c5ab24f59f9e4e9a4be3", "score": "0.6185219", "text": "function dimToInches(dimension)\r\n{\r\n\tif(trim(dimension) == \"\")\r\n\t{\r\n\t\treturn 0;\r\n\t}\r\n\t\t\r\n\tvar work = dimension+\"\";\r\n\t\r\n\tif(work.indexOf(\"\\\"\") != -1)\r\n\t{\r\n\t\twork = dimension.replace(\"'\",\"*12 + \");\r\n\t\twork = work.replace(\"-\",\" + \");\r\n\t\twork = work.replace(\"\\\"\", \"\");\r\n\t}\r\n\telse\r\n\t{\r\n\t\twork = dimension.replace(\"'\",\"*12\");\r\n\t}\r\n\ttry\r\n\t{\r\n\t\tvar val = eval(work);\r\n\t\tif(val === undefined || isNaN(val))\r\n\t\t{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn val;\r\n\t}\r\n\tcatch(x)\r\n\t{\r\n\t\treturn 0;\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "bcbfe57cc3e9dda0ea9443f03e77cf7d", "score": "0.61544454", "text": "function convertUnits(element) {\n // Iterate through important styles, and convert to px if they are specified.\n for (var i = 0; i < STYLES.length; i++) {\n var styleName = STYLES[i];\n var style = element.style[styleName]\n if (style) {\n var newStyle = converter.toPixels(style);\n element.style[styleName] = newStyle;\n }\n }\n}", "title": "" }, { "docid": "2cb06df1346daed8159a7759c609f03c", "score": "0.6154072", "text": "function slider_intToPx (num) {\r\n num = Number(num);\r\n num = num.toString();\r\n return num + 'px';\r\n}", "title": "" }, { "docid": "e792d43d6b994e06dde5fd355dfe3916", "score": "0.6117739", "text": "function parseUnit(str, out) {\n if (!out) out = [ 0, '' ];\n str = String(str)\n var num = parseFloat(str, 10)\n out[0] = num\n out[1] = str.match(/[\\d.\\-\\+]*\\s*(.*)/)[1] || ''\n return out\n}", "title": "" }, { "docid": "3c93556ad39519a5c280a60c3fd4f953", "score": "0.6104623", "text": "function getDim(units)\r\n{\r\n\t\r\n\tif(um === \"mm\" && umDisplay === \"mm\")\r\n\t{\r\n\t\treturn round(units)+\"mm\";\r\n\t}\r\n\t\r\n\tif(um === \"in\" && umDisplay === \"indec\")\r\n\t{\r\n\t\treturn round(units)+\"\\\"\";\r\n\t}\r\n\t\r\n\tif(um === \"mm\" && umDisplay === \"indec\")\r\n\t{\r\n\t\treturn round(units*0.0393700787)+\"\\\"\";\r\n\t}\r\n\t\r\n\tif(um === \"in\" && umDisplay === \"mm\")\r\n\t{\r\n\t\treturn round(units*(1/0.0393700787))+\"mm\";\r\n\t}\r\n\t// umDisplay must be \"in16\"\r\n\tvar inches = um === \"mm\" ? units*0.0393700787:units;\r\n\tif(inches > 60)\r\n\t{\r\n\t\treturn inchesToDim(inches); // show feet'\r\n\t}\r\n\tvar fracRemaining = inches%1;\r\n\tvar inchInteger = inches - fracRemaining;\r\n\t\r\n\tvar frac = decToFraction(fracRemaining);\r\n\t\r\n\tvar inch = \"\";\r\n\t\r\n\tif(inchInteger > 0 && frac != \"\")\r\n\t{\r\n\t\tinch = inchInteger + \"-\" + frac + \"\\\"\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif(inchInteger > 0)\r\n\t\t{\r\n\t\t\tinch = inchInteger + \"\\\"\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\tif(frac != \"\")\r\n\t\t{\r\n\t\t\tinch = frac + \"\\\"\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tinch = \"\";\r\n\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn trim(inch);\r\n}", "title": "" }, { "docid": "bdf9a5892e5a3e8a95d7164aa0c659ca", "score": "0.60881776", "text": "function getPixelSize(size, unit, originalSize) {\n let result = size;\n switch (unit) {\n case TextStyle_1.FontUnit.Em:\n result *= TypesettingUtils.EM_TO_PX;\n break;\n case TextStyle_1.FontUnit.Point:\n result *= TypesettingUtils.PT_TO_PX;\n break;\n case TextStyle_1.FontUnit.Percent:\n result *= (1.0 / 100) * originalSize;\n break;\n }\n return result;\n }", "title": "" }, { "docid": "76383dba2ab41c910b880f29c8184259", "score": "0.6077269", "text": "function unit(u) {\n if (height >= width) {\n let unit = (height / width) * u;\n return unit;\n } else if (width >= height) {\n let unit = (width / height) * u;\n return unit;\n }\n}", "title": "" }, { "docid": "ed62b3165925990a32f2f1caa2b876b0", "score": "0.6074957", "text": "function getPixelsNumber(pixelsString) {\n return pixelsString.replace(\"px\", \"\");\n}", "title": "" }, { "docid": "e876d0fc827a8b91cab8d0edc1e575d5", "score": "0.6062105", "text": "static resolveUnit(unit) {\n let unitData = CSS.getUnitData(unit.trim());\n if (!unitData) {\n throw new TypeError(`Invalid unit ${unit}`);\n }\n return unitData;\n }", "title": "" }, { "docid": "a965b32d056a6bb610a833b14a520a41", "score": "0.60414386", "text": "function getPixelValue(input) {\n if (typeof input !== 'number' && input != null) {\n const [value, units] = input.split(cssUnitPattern);\n return (!units || units === 'px') ? parseFloat(value) : null;\n }\n return input || null;\n}", "title": "" }, { "docid": "a965b32d056a6bb610a833b14a520a41", "score": "0.60414386", "text": "function getPixelValue(input) {\n if (typeof input !== 'number' && input != null) {\n const [value, units] = input.split(cssUnitPattern);\n return (!units || units === 'px') ? parseFloat(value) : null;\n }\n return input || null;\n}", "title": "" }, { "docid": "d5ff52099f747f3e358dbf8655868c23", "score": "0.5985894", "text": "function convertUnitsToPxForIE8(value) {\n\t\t\tvar PIXEL = /^\\d+(px)?$/i;\n\n\t\t\tif (PIXEL.test(value)) {\n\t\t\t\treturn parseInt(value,base);\n\t\t\t}\n\n\t\t\tvar\n\t\t\t\tstyle = el.style.left,\n\t\t\t\truntimeStyle = el.runtimeStyle.left;\n\n\t\t\tel.runtimeStyle.left = el.currentStyle.left;\n\t\t\tel.style.left = value || 0;\n\t\t\tvalue = el.style.pixelLeft;\n\t\t\tel.style.left = style;\n\t\t\tel.runtimeStyle.left = runtimeStyle;\n\n\t\t\treturn value;\n\t\t}", "title": "" }, { "docid": "f5414f13742e3ba15ecf135718220c8b", "score": "0.59701324", "text": "function sanitizeWidth(s) {\n return isNumber(s) ? s + \"px\" : s;\n }", "title": "" }, { "docid": "b6f119e67f2be1106ee3c2f436f3bcfb", "score": "0.5950205", "text": "function fixedUnit(str) {\n var unit = type.Unit.parse(str);\n unit.fixPrefix = true;\n return unit;\n } // Source: https://en.wikipedia.org/wiki/Physical_constant", "title": "" }, { "docid": "db93b5b9e0ff1d720d450f74a45fdc70", "score": "0.5946839", "text": "function unit(i, units) {\r\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\r\n return i;\r\n } else {\r\n return \"\" + i + units;\r\n }\r\n }", "title": "" }, { "docid": "db93b5b9e0ff1d720d450f74a45fdc70", "score": "0.5946839", "text": "function unit(i, units) {\r\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\r\n return i;\r\n } else {\r\n return \"\" + i + units;\r\n }\r\n }", "title": "" }, { "docid": "db93b5b9e0ff1d720d450f74a45fdc70", "score": "0.5946839", "text": "function unit(i, units) {\r\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\r\n return i;\r\n } else {\r\n return \"\" + i + units;\r\n }\r\n }", "title": "" }, { "docid": "b87cb9807f3f9a194e0654237d105bea", "score": "0.5939393", "text": "function processUnits(unitsStr) {\n return unitsStr;\n }", "title": "" }, { "docid": "6cfa76276e5b7a6ff3847c22d0aee15f", "score": "0.5925847", "text": "function pixelsToAppUnits(v) {\n if (app.preferences.rulerUnits == Units.PIXELS)\n return UnitValue(v, \"px\");\n else {\n // Divide by doc's DPI, convert to inch, then convert to ruler units.\n var appUnits = DOMunitToCSS[app.preferences.rulerUnits];\n return UnitValue((UnitValue(v / app.activeDocument.resolution, \"in\")).as(appUnits), appUnits);\n }\n}", "title": "" }, { "docid": "ce4d502b175452936d101031a3ad59f5", "score": "0.59172404", "text": "static dppx(value) {\n return new css_unit_value_1.CSSUnitValue(value, CSSUnit.dppx);\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.5913583", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.5913583", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.5913583", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.5913583", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.5913583", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.5913583", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.5913583", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.5913583", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.5913583", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.5913583", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "eaa1098337facd3705676939cf390824", "score": "0.5913583", "text": "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "title": "" }, { "docid": "7c8fada7e71e6ad89fd37f39b071dea5", "score": "0.5910543", "text": "function getSizeInPixels(el, value) {\n\t\tif (!isNaN(value) || /px$/i.test(value)) return parseFloat(value);\n\t\tvar style = el.style.left, runtimeStyle = el.runtimeStyle.left;\n\t\tel.runtimeStyle.left = el.currentStyle.left;\n\t\tel.style.left = value.replace('%', 'em');\n\t\tvar result = el.style.pixelLeft;\n\t\tel.style.left = style;\n\t\tel.runtimeStyle.left = runtimeStyle;\n\t\treturn result;\n\t}", "title": "" }, { "docid": "fa1dbf0e129d60f1a933d4a5e4d26276", "score": "0.59045845", "text": "function pixelsToAppUnits(v) {\n if (app.preferences.rulerUnits == Units.PIXELS)\n return UnitValue(v, 'px');\n else {\n // Divide by doc's DPI, convert to inch, then convert to ruler units.\n var appUnits = DOMunitToCSS[app.preferences.rulerUnits];\n return UnitValue((UnitValue(v / app.activeDocument.resolution, 'in')).as(appUnits), appUnits);\n }\n}", "title": "" }, { "docid": "869d727a57e4ec6d2121f354cd993fbf", "score": "0.5898011", "text": "function getConverted(val, base) {\n\tlet ret = val;\n\tconst num = val.match(/((-|\\+)*[0-9]+)%/);\n\n\tif (num && num.length >= 1) {\n\t\tret = `${base * (parseFloat(num[1]) / 100)}px`;\n\t} else if (val.indexOf(\"px\") === -1) {\n\t\tret = `${val}px`;\n\t}\n\n\treturn ret;\n}", "title": "" }, { "docid": "e15bb600121b41844b7b1cae131aa3f5", "score": "0.5867874", "text": "function cmToMeasure(cm) {\n switch (Configuration.getStringValue(configDimUnit)) {\n case dimInch:\n var realFeet = cm * 0.3937 / 12;\n var feet = Math.floor(realFeet);\n var inches = Math.round((realFeet - feet) * 12);\n return feet + \"'\" + inches + '\"';\n case dimMilliMeter:\n return \"\" + Math.round(10 * cm) + \" mm\";\n case dimCentiMeter:\n return \"\" + Math.round(10 * cm) / 10 + \" cm\";\n case dimMeter:\n default:\n return \"\" + Math.round(10 * cm) / 1000 + \" m\";\n }\n }", "title": "" }, { "docid": "74eb530affad2c0241088b78f5d4a828", "score": "0.58479923", "text": "function conEmToPx () {\n var emInput = document.getElementById(\"emInput\").value;\n var emPxResult = emInput * 16;\n\n return emPxResult;\n}", "title": "" }, { "docid": "9f9bb8439d02ebf29772593fc5cce1ba", "score": "0.58393234", "text": "function measure(string) {\n return context.measureText(string).width;\n }", "title": "" }, { "docid": "fa7f44dc73fef5c93bacfa44754b5024", "score": "0.58183056", "text": "function getPSUnitValue(desc, ID) {\n var srcUnitsID = desc.getUnitDoubleType(ID);\n\n if (srcUnitsID == unitNone)\t// Um, unitless unitvalues are just...numbers.\n return round1k(desc.getUnitDoubleValue(ID));\n\n // Angles and percentages are typically things like gradient parameters,\n // and should be left as-is.\n if ((srcUnitsID == unitAngle) || (srcUnitsID == unitPercent))\n return round1k(desc.getUnitDoubleValue(ID)) + unitIDToCSS[srcUnitsID];\n\n // Skip conversion if coming and going in pixels\n if (((srcUnitsID == unitPixels) || (srcUnitsID == enumRulerPixels))\n && (app.preferences.rulerUnits == Units.PIXELS))\n return round1k(desc.getUnitDoubleValue(ID)) + 'px';\n\n // Other units to pixels must first convert to points,\n // then expanded by the actual doc resolution (measured in DPI)\n if (app.preferences.rulerUnits == Units.PIXELS)\n return round1k(desc.getUnitDoubleValue(ID) * unitIDToPt[srcUnitsID]\n * app.activeDocument.resolution / 72) + 'px';\n\n var DOMunitStr = DOMunitToCSS[app.preferences.rulerUnits];\n\n // Pixels must be explictly converted to other units\n if ((srcUnitsID == unitPixels) || (srcUnitsID == enumRulerPixels))\n return pixelsToAppUnits(desc.getUnitDoubleValue(ID)).as(DOMunitStr) + DOMunitStr;\n\n // Otherwise, let Photoshop do generic conversion.\n return round1k(UnitValue(desc.getUnitDoubleValue(ID), unitIDToCSS[srcUnitsID]).as(DOMunitStr)) + DOMunitStr;\n}", "title": "" } ]
e0e33f173ed363a426c78f921d0bbddd
Collect dispatches (must be entirely collected before dispatching see unit tests). Lazily allocate the array to conserve memory. We must loop through each event and perform the traversal for each one. We cannot perform a single traversal for the entire collection of events because each event may have a different target.
[ { "docid": "83a3048f06cceedc278401091ba9a7de", "score": "0.0", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" } ]
[ { "docid": "97ef213baab86fd218c79c32b5eb51ca", "score": "0.6037618", "text": "function executeDispatchesInOrder(event){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "97ef213baab86fd218c79c32b5eb51ca", "score": "0.6037618", "text": "function executeDispatchesInOrder(event){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "97ef213baab86fd218c79c32b5eb51ca", "score": "0.6037618", "text": "function executeDispatchesInOrder(event){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "b3be74fe47e4e5c4748d76fc84020a54", "score": "0.58940333", "text": "function executeDispatchesInOrder(event,simulated){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,simulated,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,simulated,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "b3be74fe47e4e5c4748d76fc84020a54", "score": "0.58940333", "text": "function executeDispatchesInOrder(event,simulated){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,simulated,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,simulated,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "b3be74fe47e4e5c4748d76fc84020a54", "score": "0.58940333", "text": "function executeDispatchesInOrder(event,simulated){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,simulated,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,simulated,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "b3be74fe47e4e5c4748d76fc84020a54", "score": "0.58940333", "text": "function executeDispatchesInOrder(event,simulated){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,simulated,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,simulated,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "b3be74fe47e4e5c4748d76fc84020a54", "score": "0.58940333", "text": "function executeDispatchesInOrder(event,simulated){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,simulated,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,simulated,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "b3be74fe47e4e5c4748d76fc84020a54", "score": "0.58940333", "text": "function executeDispatchesInOrder(event,simulated){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,simulated,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,simulated,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "b3be74fe47e4e5c4748d76fc84020a54", "score": "0.58940333", "text": "function executeDispatchesInOrder(event,simulated){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,simulated,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,simulated,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "b3be74fe47e4e5c4748d76fc84020a54", "score": "0.58940333", "text": "function executeDispatchesInOrder(event,simulated){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,simulated,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,simulated,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "b3be74fe47e4e5c4748d76fc84020a54", "score": "0.58940333", "text": "function executeDispatchesInOrder(event,simulated){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,simulated,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,simulated,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "b3be74fe47e4e5c4748d76fc84020a54", "score": "0.58940333", "text": "function executeDispatchesInOrder(event,simulated){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,simulated,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,simulated,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "cdcd6c66bf710b24b0cb90697fb2b176", "score": "0.5869173", "text": "function executeDispatchesInOrder(event,simulated){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;if(true){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,simulated,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,simulated,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "5dc19c343ddced033413b89ed2027054", "score": "0.58568627", "text": "function executeDispatchesInOrder(event,cb){forEachEventDispatch(event,cb),event._dispatchListeners=null,event._dispatchIDs=null}", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.58335006", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.58335006", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.58335006", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.58335006", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.58335006", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.58335006", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.58335006", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.58335006", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.58335006", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.58335006", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.58335006", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.58335006", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.58335006", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.58335006", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.58335006", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.58335006", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.58335006", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.58335006", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "cfb6a32dbb5cd18461cbcaadd138ae76", "score": "0.5829435", "text": "function executeDispatchesInOrder(event) {\r\n var dispatchListeners = event._dispatchListeners;\r\n var dispatchInstances = event._dispatchInstances;\r\n\r\n {\r\n validateEventDispatches(event);\r\n }\r\n\r\n if (Array.isArray(dispatchListeners)) {\r\n for (var i = 0; i < dispatchListeners.length; i++) {\r\n if (event.isPropagationStopped()) {\r\n break;\r\n } // Listeners and Instances are two parallel arrays that are always in sync.\r\n\r\n\r\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\r\n }\r\n } else if (dispatchListeners) {\r\n executeDispatch(event, dispatchListeners, dispatchInstances);\r\n }\r\n\r\n event._dispatchListeners = null;\r\n event._dispatchInstances = null;\r\n}", "title": "" }, { "docid": "9eddddbb6b7c292afa1df844e0319db6", "score": "0.57899225", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (inst && event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9eddddbb6b7c292afa1df844e0319db6", "score": "0.57899225", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (inst && event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "60e4979122242b28aaf307c5fb077ecf", "score": "0.5773701", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst);\n }\n }\n }", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57731134", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "b5d6d6efffc8695567634d203a15e750", "score": "0.57721627", "text": "function accumulateDispatches(inst,ignoredDirection,event){if(inst&&event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners=accumulateInto_1(event._dispatchListeners,listener);event._dispatchInstances=accumulateInto_1(event._dispatchInstances,inst);}}}", "title": "" }, { "docid": "d53b538701aab66c01f362dd68b1f119", "score": "0.5767818", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n}", "title": "" }, { "docid": "d53b538701aab66c01f362dd68b1f119", "score": "0.5767818", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n}", "title": "" }, { "docid": "d53b538701aab66c01f362dd68b1f119", "score": "0.5767818", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n}", "title": "" }, { "docid": "d53b538701aab66c01f362dd68b1f119", "score": "0.5767818", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n}", "title": "" }, { "docid": "d53b538701aab66c01f362dd68b1f119", "score": "0.5767818", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n}", "title": "" } ]
1e1377c41bc68ab8ffb25a255bfb8bf4
Process files and walk their composition/value dependency tree to find new files we need to process
[ { "docid": "aaaa68d70a6895f66a5b991018b173db", "score": "0.61464876", "text": "async _walk(name, src) {\n const { _graph : graph, _files : files } = this;\n\n // No need to re-process files unless they've been marked invalid\n if(files[name] && files[name].valid) {\n // Do want to wait until they're done being processed though\n await files[name].walked;\n\n return;\n }\n\n const fKey = this._addFile(name);\n\n this._log(\"_before()\", name);\n\n let walked;\n\n const file = files[name] = {\n name,\n text : typeof src === \"string\" ? src : src.source.input.css,\n valid : true,\n\n classes : Object.create(null),\n values : Object.create(null),\n exported : Object.create(null),\n\n walked : new Promise((done) => (walked = done)),\n\n before : null,\n };\n\n file.before = this._before.process(\n src,\n params(this, {\n from : name,\n })\n );\n\n await file.before;\n\n // Surface any warnings from that run\n file.before.warnings().forEach((msg) => this._warnings.push(msg));\n\n // Walk this node's dependencies, reading new files from disk as necessary\n await Promise.all(\n filterByPrefix(FILE_PREFIX, graph.dependenciesOf(fKey)).map((dependency) => {\n const { valid, walked : complete } = files[dependency] || false;\n\n // If the file hasn't been invalidated wait for it to be done processing\n if(valid) {\n return complete;\n }\n\n // Otherwise add it to the queue\n return this.file(dependency);\n })\n );\n\n // Mark the walk of this file & its dependencies complete\n walked();\n }", "title": "" } ]
[ { "docid": "a922a16d031ef6a1b3f1760fa101d1ec", "score": "0.66979814", "text": "function processFiles() {\n console.log(\"Processing files in \", source, \".\");\n fq.readdir(source, function (err, files) {\n if (err) throw err;\n for (var i = 0, l = files.length; i < l; i++) {\n processFile(source + files[ i ]);\n }\n });\n}", "title": "" }, { "docid": "2e5fe5c023141de9fd21c1e0584bd243", "score": "0.6078349", "text": "function processRawFiles() {\n let files = walk('./raw/matches');\n files.forEach(function(file) {\n processMatchFile(file);\n });\n}", "title": "" }, { "docid": "93b19809ec4d82bab44eda225b706262", "score": "0.58645505", "text": "watch(callback) {\n var update_watchers, watchers;\n // Remember which files we are watching\n watchers = {};\n // Updates the watchers list based on the filenames discovered with the last\n // `@squash` operation\n update_watchers = () => {\n var file, fn, j, len, new_watchers, ref, watcher;\n new_watchers = {};\n ref = this.ordered;\n // Otherwise create a watcher for the file\n fn = (file) => { // We use `do` to create a `skip` flag for each file\n var skip;\n skip = false;\n return new_watchers[file] = fs.watch(file, (event, filename = file) => {\n if (skip) {\n return;\n }\n skip = true;\n // Update after a short delay to ensure the file is available for\n // reading, and to ignore duplicate events\n return setTimeout(() => {\n var error, result;\n skip = false;\n this.modules = {};\n this.ordered = [];\n try {\n result = this.squash();\n update_watchers();\n return callback(null, result);\n } catch (error1) {\n error = error1;\n return callback(error);\n }\n }, 25);\n });\n };\n for (j = 0, len = ref.length; j < len; j++) {\n file = ref[j];\n if (file in watchers) {\n // If the file is already being watched just copy the watcher\n new_watchers[file] = watchers[file];\n continue;\n }\n fn(file);\n }\n // Clear the watchers for any file no longer in the dependency tree\n for (file in watchers) {\n watcher = watchers[file];\n if (!(file in new_watchers)) {\n watcher.close();\n }\n }\n return watchers = new_watchers;\n };\n // Start the first round of watchers\n callback(null, this.squash());\n return update_watchers();\n }", "title": "" }, { "docid": "8613c3a19b60a98a09094b441fa21eb4", "score": "0.58504015", "text": "parseFileAndSubs(file, baseFile, onChange = false) {\r\n if (this.isExcluded(file)) {\r\n this.extension.logger.addLogMessage(`Ignoring: ${file}`);\r\n return;\r\n }\r\n if (baseFile === undefined) {\r\n baseFile = file;\r\n }\r\n this.extension.logger.addLogMessage(`Parsing a file and its subfiles: ${file}`);\r\n if (this.fileWatcher && !this.filesWatched.includes(file)) {\r\n // The file is first time considered by the extension.\r\n this.fileWatcher.add(file);\r\n this.filesWatched.push(file);\r\n }\r\n const content = this.getDirtyContent(file, onChange);\r\n this.cachedContent[file].children = [];\r\n this.cachedContent[file].bibs = [];\r\n this.cachedFullContent = undefined;\r\n this.parseInputFiles(content, file, baseFile);\r\n this.parseBibFiles(content, file);\r\n // We need to parse the fls to discover file dependencies when defined by TeX macro\r\n // It happens a lot with subfiles, https://tex.stackexchange.com/questions/289450/path-of-figures-in-different-directories-with-subfile-latex\r\n this.parseFlsFile(file);\r\n }", "title": "" }, { "docid": "8d7fffaaf1e961dca106fdd9d514c261", "score": "0.5843479", "text": "processFiles(files) {\n\t\tfiles.forEach(async file => {\n\t\t\tthis.processDay(file[0], file[1]);\n\t\t});\n\t}", "title": "" }, { "docid": "eee05dab41a34efc06f32153dde1adbb", "score": "0.5825541", "text": "populateDependencies(files, testsFiles) {\n files.forEach(file => {\n const fileType = {\n isTestFile: testsFiles.includes(file)\n };\n this.throwForNonExistFile(file);\n\n if (this.overridesDependencies.shouldIgnoreFile(file, fileType)) {\n return;\n }\n\n this.processCoreAspects(file);\n this.processMissing(file, fileType);\n this.processErrors(file);\n this.processPackages(file, fileType);\n this.processComponents(file, fileType);\n this.processDepFiles(file, fileType);\n this.processUnidentifiedPackages(file, fileType);\n });\n this.removeIgnoredPackagesByOverrides();\n this.removeDevAndEnvDepsIfTheyAlsoRegulars();\n this.addCustomResolvedIssues();\n this.populatePeerPackageDependencies();\n\n if (!this.consumer.isLegacy) {\n this.applyWorkspacePolicy();\n }\n\n this.manuallyAddDependencies();\n this.applyOverridesOnEnvPackages();\n this.coreAspects = (0, _uniq2().default)(this.coreAspects);\n }", "title": "" }, { "docid": "84947dec9aee8779350d1f113c719ea8", "score": "0.5806183", "text": "function processFiles(stats, cb) {\n var found = [], results = {};\n // process all files\n async.forEach(stats, function (file, cb) {\n var isJs = /package\\.json$/;\n if (file.stats.isFile()) {\n if (isJs.test(file.filename)) {\n found.push({\n filename: path.join(rootfolder, file.filename),\n stats: file.stats\n });\n cb(null);\n } else {\n cb(null);\n }\n } else if (file.stats.isDirectory()) {\n findPackagesFromSingleFolder(\n path.join(rootfolder, file.filename),\n function (err, res) {\n if (!err) {\n concatObject(results, res);\n }\n cb(err);\n }\n );\n }\n }, function (err) {\n if (err) {\n return cb(err);\n }\n return cb(null, found, results);\n });\n }", "title": "" }, { "docid": "47286a9c47e1a8272ddbe939beec27e5", "score": "0.5801859", "text": "function processFiles(inputFiles = [], outputFiles = [], inputDir = '.', outputDir = './out') {\n return new Promise((resolve, reject) => {\n if (inputFiles.length) {\n const proms = inputFiles.map(file => {\n return new Promise((res, rej) => {\n log(`${outputFiles.indexOf(file) > -1 ? 'Merging' : 'Copying'} ${file}`);\n const inputFilePath = path.join(inputDir, file);\n const outputFilePath = path.join(outputDir, file);\n Promise.all([getXMLasObj(inputFilePath), getXMLasObj(outputFilePath)])\n .then(results => {\n const [\n inputObj,\n outputObj,\n ] = results;\n const mergedObj = merge({}, outputObj, inputObj, (dest, src, key) => {\n return key === '_comment' ? `${src}\\n${dest || ''}` : undefined;\n });\n const xmlString = convert.json2xml(JSON.stringify(mergedObj), { compact: true, spaces: 2 });\n // if (outputFilePath.indexOf('values/dimens.xml') > -1) {\n // // console.log(JSON.stringify(mergedObj, null, 2));\n // log(xmlString);\n //\n // // console.log(JSON.stringify(inputObj, null, 2));\n // }\n // res();\n fs.outputFile(outputFilePath, xmlString, err => {\n if (err) {\n rej(err);\n }\n else {\n res();\n }\n });\n }, rej);\n });\n });\n Promise.all(proms).then(resolve, reject);\n }\n else {\n reject('No input files to process.');\n }\n });\n}", "title": "" }, { "docid": "e044cc32aaf576dc90d4bab0e42948f2", "score": "0.5783184", "text": "function grepDepList(entryFilePath, sourceRoot, recursion, ignoreDependedIds) {\n\n var depMap = {};\n var depList = [];\n var fileCache = {};\n\n function walk(path, isMain, recursion) {\n var fileStr = fileCache[path];\n if (!fileStr) {\n fileStr = Util.readFileSync(path, 'utf8');\n // fileStr = fixModule(path, fileStr);\n fileStr = decomment(fileStr);\n // console.log(fileStr);\n fileCache[path] = fileStr;\n }\n var regExp;\n if (isMain) {\n regExp = /(?:^|[^\\w\\.])require\\s*\\(\\s*(?:\\[([^\\]]*)\\]|'([^']*)'|\"([^\"]*)\")/g;\n } else {\n regExp = /(?:^|[^\\w\\.])define\\s*\\(\\s*['\"].*?['\"]\\s*,\\s*(?:\\[([^\\]]*)\\]|'([^']*)'|\"([^\"]*)\")/g;\n }\n\n var match;\n\n while ((match = regExp.exec(fileStr))) {\n var depIds = [];\n\n if (match[1]) {\n if (match[1].indexOf(\".html\") != -1) { //ignore html file\n continue;\n }\n var depStr = removeComments(match[1]);\n depIds = depStr.split(',').map(function (val) {\n val = val.trim();\n return val.substr(1, val.length - 2);\n });\n } else {\n if ((match[3] && match[3].indexOf(\".html\") != -1) || (match[2] && match[2].indexOf(\".html\") != -1)) {\n continue;\n }\n\n depIds = [match[3] || match[2]];\n }\n\n depIds.reverse().forEach(function (dependedModuleId) {\n var dependedModuleFilePath,\n fullDependedModuleFilePath;\n if (dependedModuleId) {\n if (/\\.js$/.test(dependedModuleId)) {\n Util.warn('The module Id end with .js, it usually ignore the suffix \".js\" --> ' + dependedModuleId);\n dependedModuleId = dependedModuleId.replace(/\\.js$/, '');\n }\n for (var i = 0; i < ignoreDependedIds.length; i++) {\n var check = ignoreDependedIds[i];\n if (_.isString(check) && check === dependedModuleId) {\n return;\n } else if (_.isRegExp(check) && check.test(dependedModuleId)) {\n Util.warn('ignore dependedModule -> ', dependedModuleId);\n return;\n }\n }\n dependedModuleFilePath = dependedModuleId + '.js';\n dependedModuleFilePath = dependedModuleFilePath.replace(/^plugins\\//, 'plugin/');\n fullDependedModuleFilePath = Path.resolve(sourceRoot, dependedModuleFilePath);\n try {\n fs.statSync(fullDependedModuleFilePath);\n if (typeof depMap[dependedModuleId] == 'undefined') {\n depMap[dependedModuleId] = true;\n if (recursion) {\n // lazy module\n walk(fullDependedModuleFilePath, true, false);\n // normal module\n walk(fullDependedModuleFilePath, false, true);\n }\n depList.push(dependedModuleId);\n }\n } catch (e) {\n Util.error(path + \" ===> \" + \"Can't find the fullDependedModuleFilePath: \" + fullDependedModuleFilePath)\n }\n }\n });\n }\n\n return fileStr;\n }\n\n walk(entryFilePath, true, recursion);\n walk(entryFilePath, false, recursion);\n\n return depList;\n}", "title": "" }, { "docid": "c739a8f609fd5edfcaa3a61a0ffe0f17", "score": "0.57640696", "text": "if (graph.dependencies.get(path)) {\n delta.modified.add(path);\n\n await traverseDependenciesForSingleFile(path, graph, delta, options);\n }", "title": "" }, { "docid": "bf2c3dd4dc153dd5fe54d2ab62c2cf1e", "score": "0.57279104", "text": "function traverse(file) {\n file = master.resolve(file);\n fs.stat(file, function(err, stat){\n if (!err) {\n if (stat.isDirectory()) {\n fs.readdir(file, function(err, files){\n files.map(function(f){\n return file + '/' + f;\n }).forEach(traverse);\n });\n } else {\n watch(file);\n }\n }\n });\n }", "title": "" }, { "docid": "b26195fd1acaa93bed7b85b9159424e3", "score": "0.5725671", "text": "processFiles() {\n fs.readdirSync(this.copyPath).forEach(file => {\n let copiedFileName = `${this.copyPath}\\\\${file.replace(\n this.blueprint.type,\n this.getName(this.passedName)\n )}`;\n fs.renameSync(`${this.copyPath}\\\\${file}`, `${copiedFileName}`);\n this.processFile(copiedFileName);\n console.log(\n `${chalk.green('CREATED')} ${chalk.white(copiedFileName)}`\n );\n });\n }", "title": "" }, { "docid": "ddf74e31449476a2e3a7bd2fc6d7b5be", "score": "0.57026", "text": "filesAndFoldersDo(closure) {\n const thisFolderPath = this.getPath()\n\n const folderContents = fs.readdirSync( thisFolderPath, { withFileTypes: true } )\n\n folderContents.forEach( (eachFileStat) => {\n const fullPath = pathLib.join( thisFolderPath, eachFileStat.name )\n\n const path = eachFileStat.isDirectory() ?\n this.thisClassification().new({ path: fullPath })\n :\n FilePath.new({ path: fullPath })\n\n closure( path )\n }) \n }", "title": "" }, { "docid": "93bf693b116b160dcd18113a7f7a6a65", "score": "0.5678457", "text": "async output(args = false) {\n const { to } = args;\n let { files } = args;\n\n if(!Array.isArray(files)) {\n files = filterByPrefix(FILE_PREFIX, tiered(this._graph));\n }\n\n // Throw normalized values into a Set to remove dupes\n files = new Set(files.map(this._normalize));\n\n // Then turn it back into array because the iteration story is better\n files = [ ...files.values() ];\n\n // Verify that all requested files have been fully processed & succeeded\n // See\n // - https://github.com/tivac/modular-css/issues/248\n // - https://github.com/tivac/modular-css/issues/324\n await Promise.all(files.map((file) => {\n if(!this._files[file]) {\n throw new Error(`Unknown file requested: ${file}`);\n }\n\n return this._files[file].result;\n }));\n\n // Rewrite relative URLs before adding\n // Have to do this every time because target file might be different!\n const results = [];\n\n for(const dep of files) {\n this._log(\"_after()\", dep);\n\n // eslint-disable-next-line no-await-in-loop -- we're ok\n await this._files[dep].walked;\n\n // eslint-disable-next-line no-await-in-loop -- we got this\n const result = await this._after.process(\n // NOTE: the call to .clone() is really important here, otherwise this call\n // modifies the .result root itself and you process URLs multiple times\n // See https://github.com/tivac/modular-css/issues/35\n this._files[dep].result.root.clone(),\n\n params(this, {\n from : dep,\n to,\n })\n );\n\n results.push(result);\n }\n\n // Clone the first result if available to get valid source information\n const root = results.length ? results[0].root.clone() : postcss.root();\n\n // Then destroy all its children before adding new ones\n root.removeAll();\n\n results.forEach((result) => {\n result.warnings().forEach((warning) => this._warnings.push(warning));\n\n // Add file path comment\n const comment = postcss.comment({\n text : relative(this._options.cwd, result.opts.from),\n\n // Add a bogus-ish source property so postcss won't make weird-looking\n // source-maps that break the visualizer\n //\n // https://github.com/postcss/postcss/releases/tag/5.1.0\n // https://github.com/postcss/postcss/pull/761\n // https://github.com/tivac/modular-css/pull/157\n //\n source : {\n __proto__ : null,\n\n ...result.root.source,\n end : result.root.source.start,\n },\n });\n\n root.append([ comment, ...result.root.nodes ]);\n\n const idx = root.index(comment);\n\n // Need to manually insert a newline after the comment, but can only\n // do that via whatever comes after it for some reason?\n // I'm not clear why comment nodes lack a `.raws.after` property\n //\n // https://github.com/postcss/postcss/issues/44\n if(root.nodes[idx + 1]) {\n root.nodes[idx + 1].raws.before = \"\\n\";\n }\n });\n\n const result = await this._done.process(\n root,\n params(this, args)\n );\n\n result.warnings().forEach((warning) => this._warnings.push(warning));\n\n // Lazily-compute compositions if they're asked for\n Object.defineProperty(result, \"compositions\", {\n get : () => compositions(this),\n });\n\n return result;\n }", "title": "" }, { "docid": "f4c7b29b8c0cc17dbcc0221b905db06b", "score": "0.5668929", "text": "function getFiles() {\n\t\tfilewalker(config.path.templates)\n\t\t\t.on('dir', function (p) {\n\t\t\t\tvar valid = helpers.valid(config.include, config.exclude, p);\n\t\t\t\tif (valid) {\n\t\t\t\t\tlogger.directory('%s', p);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (config.verbose) {\n\t\t\t\t\t\tlogger.ignored('%s', p);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('stream', function (rs, p, s, fullPath) {\n\t\t\t\tvar valid = helpers.valid(config.include, config.exclude, p);\n\t\t\t\tif (valid) {\n\t\t\t\t\tvar input = fs.createReadStream(fullPath);\n\t\t\t\t}\n\t\t\t\trs.on('data', function(data) {\n\t\t\t\t\tif (valid) {\n\t\t\t\t\t\thelpers.fileToArray(input, config.componentStart, config.placeholderText, config.componentEnd);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\trs.on('end', function (data) {\n\t\t\t\t\tif (valid) {\n\t\t\t\t\t\tlogger.file('%s, %d bytes', p, s.size);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (config.verbose) {\n\t\t\t\t\t\t\tlogger.ignored('%s', p);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t})\n\t\t\t.on('error', function (err) {\n\t\t\t\tlogger.error(err);\n\t\t\t})\n\t\t\t.on('done', function () {\n\t\t\t\tlogger.info('Finished parsing templates. %d dirs, %d files, %d bytes', this.dirs, this.files, this.bytes);\n\t\t\t\tcreateData(helpers.getComponents());\n\t\t\t})\n\t\t.walk();\n\t}", "title": "" }, { "docid": "fe57afb02efcdc1ad72bfea9aade0735", "score": "0.5656687", "text": "processComponents(originFile, fileType) {\n const components = this.tree[originFile].components;\n if (!components || (0, _isEmpty2().default)(components)) return;\n components.forEach(compDep => {\n let componentId = this.getComponentIdByResolvedPackageData(compDep);\n const depDebug = {\n id: componentId,\n dependencyPackageJsonPath: compDep.packageJsonPath,\n dependentPackageJsonPath: compDep.dependentPackageJsonPath,\n componentIdResolvedFrom: this.consumer.isLegacy ? 'LegacyUnknown' : 'DependencyPkgJson',\n packageName: compDep.name\n };\n\n const getVersionFromPkgJson = () => {\n const versionFromDependencyPkgJson = this.getValidVersion(compDep.concreteVersion);\n\n if (versionFromDependencyPkgJson) {\n depDebug.versionResolvedFrom = 'DependencyPkgJson';\n return versionFromDependencyPkgJson;\n }\n\n const versionFromDependentPkgJson = this.getValidVersion(compDep.versionUsedByDependent);\n\n if (versionFromDependentPkgJson) {\n depDebug.versionResolvedFrom = 'DependentPkgJson';\n return versionFromDependentPkgJson;\n }\n\n return null;\n };\n\n const version = getVersionFromPkgJson();\n\n if (version) {\n componentId = componentId.changeVersion(version);\n }\n\n if (this.overridesDependencies.shouldIgnoreComponent(componentId, fileType)) {\n return;\n }\n\n const getExistingId = () => {\n const existingIds = this.consumer.bitmapIdsFromCurrentLane.filterWithoutVersion(componentId);\n\n if (existingIds.length === 1) {\n depDebug.versionResolvedFrom = 'BitMap';\n return existingIds[0];\n }\n\n if (this.componentFromModel) {\n const modelDep = this.componentFromModel.getAllDependenciesIds().searchWithoutVersion(componentId);\n\n if (modelDep) {\n depDebug.versionResolvedFrom = 'Model';\n return modelDep;\n }\n }\n\n return undefined;\n };\n\n const existingId = version ? componentId : getExistingId();\n\n if (existingId) {\n if (existingId.isEqual(this.componentId)) {\n // happens when one of the component files requires another using module path\n // no need to enter anything to the dependencies\n return;\n }\n\n this.addImportNonMainIssueIfNeeded(originFile, compDep);\n const currentComponentsDeps = {\n id: existingId,\n relativePaths: [],\n packageName: compDep.name\n };\n\n this._pushToDependenciesIfNotExist(currentComponentsDeps, fileType, depDebug);\n } else {\n this._pushToMissingComponentsIssues(originFile, componentId);\n }\n });\n }", "title": "" }, { "docid": "e4727203abd5a4b43b5e90706e189f6f", "score": "0.5653479", "text": "function traverseFileSystem(sourceDirectory, regex, results) {\n var files = fs.readdirSync(sourceDirectory);\n for (var i in files) {\n var currentFile = path.join(sourceDirectory, files[i]);\n const match = RegExp(regex).test(currentFile);\n var stats = fs.statSync(currentFile);\n if (stats.isFile() && match) {\n //let tempArr = currentFile.split(/(\\\\|\\/)tests/);\n //currentFile = tempArr[tempArr.length-1]\n results.push(currentFile);\n }\n else if (stats.isDirectory()) {\n traverseFileSystem(currentFile, regex, results);\n }\n }\n}", "title": "" }, { "docid": "34dfda2ed5219f7986aaeed966b162cc", "score": "0.5646459", "text": "getDependencies(data, filepath, callback) {\r\n const verbosity = this.verbosity;\r\n if(this.disableDepCheck) {\r\n callback(null, []);\r\n }\r\n else if(this.compileAllAtOnce) {\r\n const inFile = this.getFilepathWithoutBscCwd(fullInFile);\r\n const bscCwd = this.bscCwd;\r\n const globIgnore = this.globIgnore;\r\n var glob_opts = {};\r\n glob_opts.nosort = true;\r\n glob_opts.ignore = globIgnore;\r\n if(bscCwd) glob_opts.cwd = bscCwd;\r\n glob(\"**/*.{ml,mli}\", glob_opts, function (err, files) {\r\n if(err) callback(err, []);\r\n else {\r\n var idx = files.indexOf(inFile);\r\n if(idx >= 0) files = files.splice(idx, 1);\r\n callback(null, files.map(p => path.posix.join(bscCwd, p)));\r\n }\r\n });\r\n }\r\n else {\r\n const bscCwd = this.bscCwd;\r\n //this.getDependentsOf(filepath, function (err, files) {\r\n this.getDependsOf(filepath, function (err, files) {\r\n if(err) callback(err, []);\r\n else {\r\n callback(null, files.map(p => path.posix.join(bscCwd, p)));\r\n }\r\n });\r\n }\r\n }", "title": "" }, { "docid": "47e218be1c0916eb69fcb0cb11de11d8", "score": "0.5625871", "text": "function traverseConverter(startFolder, format){\nlet codecCopyArr = [];\nlet convertArr = [];\nlet allFiles = [];\n let traverseResults = traverse(startFolder, allFiles)\n\n allFiles.forEach(file => {\n let filePath = file;\n let output = checkExt(filePath, codecCopyArr, convertArr, format, allFiles);\n return output;\n })\n process(codecCopyArr, convertArr, format);\n}", "title": "" }, { "docid": "68cbde50f9cbfe9921d188c6f6cd3e6f", "score": "0.5614253", "text": "fileDependencies(file) {\n if(!file) {\n return filterByPrefix(FILE_PREFIX, this._graph.overallOrder());\n }\n\n const normalized = this._normalize(file);\n const key = fileKey(normalized);\n\n if(!this._graph.hasNode(key)) {\n throw new Error(`Unknown file: ${normalized}`);\n }\n\n const dependencies = this._graph.dependenciesOf(key);\n\n return filterByPrefix(FILE_PREFIX, dependencies);\n }", "title": "" }, { "docid": "ad7a2621c4e23ac6a68f8ac9c343a0ea", "score": "0.5599383", "text": "function traverseFiles() {\n\t//var files = fs.readdirSync('.');\n\tfs.readdir(filePath, function(err, items) {\n\t\tif (err)\n\t\t\tthrow err;\n\t\tfor (var i = 0; i < items.length; i++) {\n\t\t\t//size in mb\n\t\t\tvar size = getFileSize(filePath+items[i]);\n\t\t\t\n\t\t\t//Size in mb calculated\n\t\t\tfor (var k in fileSizes) {\n\n\t\t\t\t//console.log(size, fileSizes[k], items[i]);\n\t\t\t\tif (size < fileSizes[k]/6) {\n\t\t\t\t\tif(fs.lstatSync(filePath+items[i]).isDirectory()){\n\t\t\t\t\t\titems[i] = items[i]+\"/**\";\n\t\t\t\t\t\t//continue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (filesCategorized[fileSizes[k]]){\n\t\t\t\t\t\tfilesCategorized[fileSizes[k]].push(filePath+items[i]);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfilesCategorized[fileSizes[k]] = [filePath+items[i]];\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//large size files are managed here\n\t\t\t\n\t\t\tif(size > fileSizes[fileSizes.length-1]){\n\t\t\t\tconsole.log(\"reached at the end of array \",filePath+items[i],size,fileSizes[fileSizes.length-1])\n\t\t\t\t\tif(largeSize < size)\n\t\t\t\t\tlargeSize = size*6;\n\t\t\t\t\t\n\t\t\t\t\tif(fs.lstatSync(filePath+items[i]).isDirectory()){\n\t\t\t\t\t\titems[i] = items[i]+\"/**\";\n\t\t\t\t\t\t//continue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (filesCategorized[largeSize]){\n\t\t\t\t\t\tfilesCategorized[largeSize].push(filePath+items[i]);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfilesCategorized[largeSize] = [filePath+items[i]];\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tconsole.log(filesCategorized);\n\t\t//traverse through each file category size\n\t\tfor(var t in filesCategorized){\n\t\t\tconsole.log(\"generating archive for \"+t+\"mb sized files \");\n\t\t\tgenerateArchiveFile(parseInt(t)*1000000,filesCategorized[t]);\t\n\t\t}\n\n\t});\n}", "title": "" }, { "docid": "011968dd63c5185db263e3847ecff8cc", "score": "0.55493724", "text": "function processFiles(list) {\r\n\r\n var i, file, filename, main, hist;\r\n var files = {\r\n 'hist' : {},\r\n 'main' : {},\r\n 'list' : [],\r\n 'ordList' : ordList\r\n };\r\n\r\n for (i = 0; i < list.length; i++) {\r\n file = list[i];\r\n filename = file.filename;\r\n main = files.main[filename];\r\n if (main === undefined) {\r\n files.main[filename] = file;\r\n files.list.push(file);\r\n } else {\r\n hist = files.hist[filename];\r\n hist = hist ? hist : [];\r\n hist.push(file);\r\n files.hist[filename] = hist;\r\n }\r\n }\r\n return files;\r\n\r\n function move(index, movement) {\r\n moveElementInArray(files.list, index, movement);\r\n }\r\n\r\n function ordList() {\r\n var i, res = [];\r\n // [{'fileTid':'1234'},{'fileTid':'334'}]\r\n for (i = 0; i < files.list.length; i++) {\r\n res.push(files.list[i].fileTid);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "7bfa92bc9a5dcdb1120e0da59e500567", "score": "0.55473745", "text": "function info_about_files(){\n \n files.forEach(function(file){\n fs.stat(base+path+file, function(err, stats){\n children[file] = {};\n if(err != null) { console.log(err); res.send('Ups'); return;}\n if(stats.isFile()){\n children[file].isFile = true;\n children[file].size = stats.size;\n children[file].name = file;\n children[file].lastModified = date_format(stats.mtime);\n children.push(file);\n } else {\n children[file].name = file;\n children[file].lastModified = date_format(stats.mtime);\n children.push(file);\n }\n filesEE.emit('files_stats_ready',file);\n },file );\n });\n\n }", "title": "" }, { "docid": "dfd92203bb0d2f7dff7e2e6ec17b6d7f", "score": "0.5537664", "text": "function collectFiles(targetDirectory, filename, currentVersion, currentRelease, _, content) {\n\t// one or more patch files\n\tvar patchfiles;\n\tif (!content) {\n\t\tif (fs.stat(filename, _).isDirectory()) {\n\t\t\tvar files = fs.readdir(filename, _);\n\t\t\tpatchfiles = [];\n\t\t\tfiles.forEach(function(file) {\n\t\t\t\tif (file.lastIndexOf('.dat') === file.length - 4) {\n\t\t\t\t\tpatchfiles.push(filename + \"/\" + file);\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tpatchfiles = [filename];\n\t\t}\n\t}\n\t// copy interesting parts together\n\tvar patchContents = {};\n\tvar currentVersionFits = false;\n\tvar currentReleaseFits = false;\n\tvar currentVersionFitsEnd = false;\n\tvar contentAvailable = false;\n\tvar j = content ? 1 : patchfiles.length;\n\twhile (--j >= 0) {\n\t\tvar startIndex = 0;\n\t\tvar metadata = [];\n\t\tvar lines;\n\t\tif (content) {\n\t\t\tlines = content.split(/[\\n\\r]+/);\n\t\t} else {\n\t\t\tvar file = patchfiles[j];\n\t\t\t// console.log(\"Patch file \" + file);\n\t\t\tvar lines = fs.readFile(file, 'utf8', _).split(/[\\n\\r]+/);\n\t\t}\n\t\tvar startContent = 2;\n\t\tfor (var i = 0; i < lines.length; i++) {\n\t\t\tvar line = lines[i];\n\t\t\tif (line.substr(0, 8) === '2,\"ASR\",') {\n\t\t\t\tif (metadata.length > 7) {\n\t\t\t\t\tmetadata[9] = lines.slice(startIndex + startContent, i).join(\"\\n\");\n\t\t\t\t\tpatchContents[metadata[5]] = metadata;\n\t\t\t\t\tmetadata = [];\n\t\t\t\t}\n\t\t\t\tstartIndex = i + 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (line.substr(0, 15) === 'syracuse patch ') {\n\t\t\t\tcontentAvailable = true;\n\t\t\t\tif (metadata.length > 7) {\n\t\t\t\t\tmetadata[9] = lines.slice(startIndex + startContent, i).join(\"\\n\");\n\t\t\t\t\tpatchContents[metadata[5]] = metadata;\n\t\t\t\t\tmetadata = [];\n\t\t\t\t}\n\t\t\t\tstartIndex = i;\n\t\t\t\tstartContent = 2;\n\n\t\t\t\t// metadata parts: 0 start release, 1 start patch number, 2 date, 3 end release, 4 end patch number, 5 start hash, 6 end hash, 7 end source hash, 8 comment, 9 patch content, 10 streamline configuration\n\t\t\t\tmetadata = line.substr(15).split(\" \");\n\t\t\t\ttracer && tracer && tracer(\"Syracuse patch \" + line.substr(15) + \" metadata \" + util.format(metadata) + \" current \" + currentVersion + \" \" + currentRelease);\n\t\t\t\tif (metadata[5] === currentVersion) currentVersionFits = true;\n\t\t\t\tif (metadata[5] === currentRelease) currentReleaseFits = true;\n\t\t\t\tif (metadata[6] === currentVersion) currentVersionFitsEnd = true;\n\t\t\t\tcontinue;\n\t\t\t};\n\t\t\tif (i === startIndex + 1 && line.substr(0, 22) === 'syracuse patchcomment ') metadata[8] = line;\n\t\t\tif (i === startIndex + 2 && line.substr(0, 20) === 'syracuse streamline ') {\n\t\t\t\tstartContent = 3;\n\t\t\t\tmetadata[10] = line;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (line.substr(0, 8) === '7,\"ASR\",') {\n\t\t\t\t// end of Syracuse patch section\n\t\t\t\tif (metadata.length > 7) {\n\t\t\t\t\tmetadata[9] = lines.slice(startIndex + startContent, i).join(\"\\n\");\n\t\t\t\t\tpatchContents[metadata[5]] = metadata;\n\t\t\t\t\tmetadata = [];\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\t/*\t\tif (metadata.length > 7) {\n\t\t\tmetadata[9] = lines.slice(startIndex + startContent, i).join(\"\\n\");\n\t\t\tpatchContents[metadata[5]] = metadata;\n\t\t\tmetadata = [];\n\t\t}\n\t\t*/\n\t\tif (metadata.length > 7) { // no surrounding elements but Syracuse data\n\t\t\tvar endIndex = lines.length;\n\t\t\tif (lines[endIndex - 1] === '') endIndex--;\n\t\t\tmetadata[9] = lines.slice(startIndex + startContent, endIndex).join(\"\\n\");\n\t\t\tpatchContents[metadata[5]] = metadata;\n\t\t}\n\t};\n\ttracer && tracer && tracer(\"cont\" + contentAvailable + \"curr vers fits \" + currentVersionFits + \" curr release fits \" + currentReleaseFits + \" curr vers fits end \" + currentVersionFitsEnd);\n\tif (!contentAvailable) throw new Error(locale.format(module, \"noContent\"));\n\tvar startVersion = (currentVersionFits ? currentVersion : (currentReleaseFits ? currentRelease : null));\n\ttracer && tracer && tracer(\"start version \" + startVersion);\n\tif (!startVersion) {\n\t\tif (currentVersionFitsEnd) return \"\"; // no patch integration necessary\n\t\t// patch does not fit to current version\n\t\tthrow new Error(locale.format(module, \"baseVersionMismatch\"));\n\t}\n\t// console.log(\"PATCHCONT \"+util.format(patchContents))\n\tvar versions = [startVersion];\n\tvar lastStartVersion = startVersion;\n\tvar lastVersion = startVersion;\n\tvar lastReleaseMetadata;\n\tvar lastMetadata = patchContents[startVersion];\n\tmetadata = lastMetadata;\n\tif (lastStartVersion in patchContents) {\n\t\twhile ((lastVersion = lastMetadata[6]) in patchContents) {\n\t\t\tlastStartVersion = lastVersion;\n\t\t\tif (lastMetadata[4] === \"0\") { // patch is for new release\n\t\t\t\tlastReleaseMetadata = lastMetadata;\n\t\t\t}\n\t\t\tlastMetadata = patchContents[lastVersion];\n\t\t}\n\t}\n\tif (lastVersion === currentVersion) return \"\"; // patch already integrated\n\t// write final file\n\t// var metadata = patchContents[startVersion];\n\t// find out whether there is a release change\n\t// here metadata contains the metadata of the first patch content, currentContent the metadata of the latest patch content\n\tif (metadata[0] !== lastMetadata[3] && lastMetadata[4] > 0) { // patch from one release to patchlevel > 0 of another release\n\t\tif (!lastReleaseMetadata || lastReleaseMetadata[3] !== lastMetadata[3]) throw new Error(\"No patch ending in current release\");\n\t\tlastMetadata = lastReleaseMetadata;\n\t} else lastReleaseMetadata = null;\n\tvar finalResult = \"\";\n\twhile (lastMetadata) {\n\t\tvar header = \"syracuse patch \" + metadata[0] + \" \" + metadata[1] + \" \";\n\t\theader += lastMetadata[2] + \" \" + lastMetadata[3] + \" \" + lastMetadata[4] + \" \" + metadata[5] + \" \" + lastMetadata[6] + \" \" + lastMetadata[7];\n\t\theader += \"\\n\" + lastMetadata[8] + \"\\n\";\n\t\tvar streamlineConfig = lastMetadata[10];\n\t\tvar tempVersion = metadata[5];\n\t\tvar result = \"\";\n\t\twhile (tempVersion !== lastMetadata[6]) { // compare with end hash of latest version\n\t\t\tvar currMetadata = patchContents[tempVersion];\n\t\t\tpatchContents[tempVersion] = undefined; // these data are not longer necessary \n\t\t\tif (currMetadata[10]) streamlineConfig = currMetadata[10];\n\t\t\tresult += currMetadata[9] + \"\\n\";\n\t\t\ttempVersion = currMetadata[6];\n\t\t}\n\t\tif (streamlineConfig) {\n\t\t\theader += streamlineConfig + \"\\n\";\n\t\t}\n\t\tfinalResult += (header + result);\n\t\tif (lastReleaseMetadata) {\n\t\t\tmetadata = patchContents[lastMetadata[6]]; // metadata of patch starting at last release\n\t\t\tlastMetadata = patchContents[lastStartVersion];\n\t\t\tlastReleaseMetadata = null;\n\t\t} else lastMetadata = null;\n\t}\n\t// fs.writeFile(targetDirectory+\"/\"+patchtools.TEMP_DIRECTORY+\"/lastpatch.bbb\", result, _);\n\t// console.log(\"FINAL \"+finalResult)\n\treturn finalResult;\n}", "title": "" }, { "docid": "cfcf4268e85ba9fbca6f18f46de25492", "score": "0.5515285", "text": "function forEachReferencingModulesOfExportOfAffectedFile(state,affectedFile,fn){// If there was change in signature (dts output) for the changed file,\n// then only we need to handle pending file emit\nif(!state.exportedModulesMap||!state.changedFilesSet.has(affectedFile.resolvedPath)){return;}if(!isChangedSignagure(state,affectedFile.resolvedPath))return;// Since isolated modules dont change js files, files affected by change in signature is itself\n// But we need to cleanup semantic diagnostics and queue dts emit for affected files\nif(state.compilerOptions.isolatedModules){var seenFileNamesMap=ts.createMap();seenFileNamesMap.set(affectedFile.resolvedPath,true);var queue=ts.BuilderState.getReferencedByPaths(state,affectedFile.resolvedPath);while(queue.length>0){var currentPath=queue.pop();if(!seenFileNamesMap.has(currentPath)){seenFileNamesMap.set(currentPath,true);var result=fn(state,currentPath);if(result&&isChangedSignagure(state,currentPath)){var currentSourceFile=ts.Debug.checkDefined(state.program).getSourceFileByPath(currentPath);queue.push.apply(queue,ts.BuilderState.getReferencedByPaths(state,currentSourceFile.resolvedPath));}}}}ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);var seenFileAndExportsOfFile=ts.createMap();// Go through exported modules from cache first\n// If exported modules has path, all files referencing file exported from are affected\nif(ts.forEachEntry(state.currentAffectedFilesExportedModulesMap,function(exportedModules,exportedFromPath){return exportedModules&&exportedModules.has(affectedFile.resolvedPath)&&forEachFilesReferencingPath(state,exportedFromPath,seenFileAndExportsOfFile,fn);})){return;}// If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected\nts.forEachEntry(state.exportedModulesMap,function(exportedModules,exportedFromPath){return!state.currentAffectedFilesExportedModulesMap.has(exportedFromPath)&&// If we already iterated this through cache, ignore it\nexportedModules.has(affectedFile.resolvedPath)&&forEachFilesReferencingPath(state,exportedFromPath,seenFileAndExportsOfFile,fn);});}", "title": "" }, { "docid": "b0ac8a9fdc4febf2c8727c8418b695bd", "score": "0.549821", "text": "processDir(callback) {\n fs.readdir(this.dataDir, (err, files) => {\n if (err) throw err;\n this.filesToProcess = files.length; \n for (let f of files) {\n this.processFile(f, callback);\n }\n });\n }", "title": "" }, { "docid": "4c86bc082d05ecf11255504c35c68b92", "score": "0.54840773", "text": "function processSourceXMLFiles(srcfolderPath, rplfolderPath, errfolderPath, bc_array, eso_array, regexp_array, nArrayElem)\n{\n\tvar fso, f, fc, fileName;\n\t\n\tEchoAndLog(logFile, \"Searching for XML Files\");\n\tEchoAndLog(logFile, \"------------------------------------------------\");\n\tEchoAndLog(logFile, \"\");\n\t\n\tfso = new ActiveXObject(\"Scripting.FileSystemObject\");\n\tf = fso.GetFolder(srcfolderPath);\n\tfc = new Enumerator(f.files);\n\t\n\tif (fc.atEnd())\n\t{\n\t\tEchoAndLog(logFile, \" No files found in Source folder\");\n\t}\n\telse\n\t{\n\n\t\tEchoAndLog(logFile, \" Files found in Source folder\");\n\t}\t\n\t\n\tEchoAndLog(logFile, \"\");\n\t\n\tfor (; !fc.atEnd(); fc.moveNext())\n\t{\n\t\tfileName = \"\";\n\t\tfileName += fc.item();\n\t\t//fileName = fileName.substring(fileName.indexOf(\"\\SourceXML\") + 10,999);\n \n\t \n\t\tif ((fileName.slice(-4) == \".xml\") && (fileName.indexOf(\"Device\") == -1)) // Ignore the Site Device File\n\t\t{\n\t\t\tEchoAndLog(logFile, \" Processing File: \" + fileName);\n\t\t\tEchoAndLog(logFile, \"\");\n\t\t\t\n\t\t\treplaceIDs(srcfolderPath, rplfolderPath, errfolderPath, fileName, bc_array, eso_array, regexp_array, nArrayElem);\n\t\t\t\n\t\t\tEchoAndLog(logFile, \" Finished File: \" + fileName);\n\t\t\tEchoAndLog(logFile, \"\");\n\t\t}\n\t} \n \n\tfso = null;\n}", "title": "" }, { "docid": "5f82c0268bcf823b81a55ff47465d70a", "score": "0.546926", "text": "async filesChanged(fileUpdates) {\n if (!fileUpdates.length) return null\n\n // Group files by folder\n var folderGroups = {}\n fileUpdates.forEach((file) => {\n if (folderGroups[file.folderId]) {\n folderGroups[file.folderId].fileUpdates.push(file)\n } else {\n folderGroups[file.folderId] = {\n libraryId: file.libraryId,\n folderId: file.folderId,\n fileUpdates: [file]\n }\n }\n })\n\n const libraryScanResults = {}\n\n // Group files by book\n for (const folderId in folderGroups) {\n var libraryId = folderGroups[folderId].libraryId\n var library = this.db.libraries.find(lib => lib.id === libraryId)\n if (!library) {\n Logger.error(`[Scanner] Library not found in files changed ${libraryId}`)\n continue;\n }\n var folder = library.getFolderById(folderId)\n if (!folder) {\n Logger.error(`[Scanner] Folder is not in library in files changed \"${folderId}\", Library \"${library.name}\"`)\n\n Logger.debug(`Looking at folders in library \"${library.name}\" for folderid ${folderId}`)\n library.folders.forEach((fold) => {\n Logger.debug(`Folder \"${fold.id}\" \"${fold.fullPath}\"`)\n })\n continue;\n }\n\n var relFilePaths = folderGroups[folderId].fileUpdates.map(fileUpdate => fileUpdate.relPath)\n var fileUpdateBookGroup = groupFilesIntoAudiobookPaths(relFilePaths, true)\n var folderScanResults = await this.scanFolderUpdates(libraryId, folderId, fileUpdateBookGroup)\n libraryScanResults[libraryId] = folderScanResults\n }\n\n Logger.debug(`[Scanner] Finished scanning file changes, results:`, libraryScanResults)\n return libraryScanResults\n }", "title": "" }, { "docid": "836fb0941299fcc19e44bdae90ade695", "score": "0.54590786", "text": "function forEachFilesReferencingPath(state,referencedPath,seenFileAndExportsOfFile,fn){return ts.forEachEntry(state.referencedMap,function(referencesInFile,filePath){return referencesInFile.has(referencedPath)&&forEachFileAndExportsOfFile(state,filePath,seenFileAndExportsOfFile,fn);});}", "title": "" }, { "docid": "f2e9508e7745794c16479165d115b34b", "score": "0.5432842", "text": "async function processFiles(root, lang, originalRoot) {\n root = root.replace(/\\\\/g, '/');\n if (!lang) {\n return Promise.all(consts.LANGUAGES.map(lang =>\n processFiles(path.join(root, lang).replace(/\\\\/g, '/'), lang, root)));\n } else {\n const promises = fs.readdirSync(root).filter(name => !name.startsWith('_') && name !== 'adapterref').map(name => {\n const fileName = path.join(root, name).replace(/\\\\/g, '/');\n const stat = fs.statSync(fileName);\n if (stat.isDirectory()) {\n if (IGNORE.indexOf(fileName.replace(root, '')) === -1) {\n return processFiles(fileName, lang, originalRoot);\n } else {\n return Promise.resolve();\n }\n } else {\n return processFile(fileName, lang, originalRoot);\n }\n });\n return Promise.all(promises);\n }\n}", "title": "" }, { "docid": "bfa31b5a883807e2444a845d9e48512d", "score": "0.54326147", "text": "walkAndMake() {\n // Walker options\n let walker = walk.walk(this.srcFolder, {\n followLinks: false,\n filters: this.ignoreFolders\n });\n\n walker.on('file', (root, stat, next) => {\n\n if(path.extname(stat.name) === extName) {\n let nameWithoutExt = stat.name.substr(0, stat.name.length - extName.length);\n let inIgnore = this.ignoreFiles.indexOf(nameWithoutExt) >= 0;\n\n if(!inIgnore) {\n // Add this file to the list of files\n this.files.push({\n name: nameWithoutExt,\n path: root + `/${nameWithoutExt}`\n });\n }\n }\n\n next();\n });\n\n walker.on('end', () => {\n this.output.container = `\\nexport let ${this.siteName}: any = {};\\n`;\n\n this.files.forEach(file => {\n this.output.imports.push(`import { ${file.name} } from \"${this.createImportPath(file.path)}\";\\n`);\n this.output.associations.push(`\\n${this.siteName}.${file.name} = ${file.name};`);\n });\n\n fs.writeFileSync(this.siteMetaFullPath, this.output.combined(), encoding);\n });\n }", "title": "" }, { "docid": "f91fb6d59bc83bf9d61db3fcf73e7512", "score": "0.5397761", "text": "function resolveModules(filePath) {\n const entryModule = createModule(filePath)\n const modules = [entryModule]\n for (const module of modules) {\n module.dependencies.forEach(dependency => {\n // TODO: Rescursively add child dependencies\n // 1. Find the filePath from the dependency e.g. ./alertBtn\n const dependencyPath = resolveDependencyPath(module, dependency)\n // 2. Create the module from filePath\n const childModule = createModule(dependencyPath)\n // 3. Add the mapping of { dependency: moduleId }\n module.dependencyMap[dependency] = childModule.id\n // 4. push the module into modules array\n modules.push(childModule)\n\n })\n }\n return modules\n}", "title": "" }, { "docid": "ace118c6dfce1e2b2a8e67deab1b46e5", "score": "0.53959185", "text": "function getReferencedFiles(program,sourceFile,getCanonicalFileName){var referencedFiles;// We need to use a set here since the code can contain the same import twice,\n// but that will only be one dependency.\n// To avoid invernal conversion, the key of the referencedFiles map must be of type Path\nif(sourceFile.imports&&sourceFile.imports.length>0){var checker=program.getTypeChecker();for(var _i=0,_a=sourceFile.imports;_i<_a.length;_i++){var importName=_a[_i];var declarationSourceFilePath=getReferencedFileFromImportLiteral(checker,importName);if(declarationSourceFilePath){addReferencedFile(declarationSourceFilePath);}}}var sourceFileDirectory=ts.getDirectoryPath(sourceFile.resolvedPath);// Handle triple slash references\nif(sourceFile.referencedFiles&&sourceFile.referencedFiles.length>0){for(var _b=0,_c=sourceFile.referencedFiles;_b<_c.length;_b++){var referencedFile=_c[_b];var referencedPath=getReferencedFileFromFileName(program,referencedFile.fileName,sourceFileDirectory,getCanonicalFileName);addReferencedFile(referencedPath);}}// Handle type reference directives\nif(sourceFile.resolvedTypeReferenceDirectiveNames){sourceFile.resolvedTypeReferenceDirectiveNames.forEach(function(resolvedTypeReferenceDirective){if(!resolvedTypeReferenceDirective){return;}var fileName=resolvedTypeReferenceDirective.resolvedFileName;// TODO: GH#18217\nvar typeFilePath=getReferencedFileFromFileName(program,fileName,sourceFileDirectory,getCanonicalFileName);addReferencedFile(typeFilePath);});}// Add module augmentation as references\nif(sourceFile.moduleAugmentations.length){var checker=program.getTypeChecker();for(var _d=0,_e=sourceFile.moduleAugmentations;_d<_e.length;_d++){var moduleName=_e[_d];if(!ts.isStringLiteral(moduleName)){continue;}var symbol=checker.getSymbolAtLocation(moduleName);if(!symbol){continue;}// Add any file other than our own as reference\naddReferenceFromAmbientModule(symbol);}}// From ambient modules\nfor(var _f=0,_g=program.getTypeChecker().getAmbientModules();_f<_g.length;_f++){var ambientModule=_g[_f];if(ambientModule.declarations.length>1){addReferenceFromAmbientModule(ambientModule);}}return referencedFiles;function addReferenceFromAmbientModule(symbol){// Add any file other than our own as reference\nfor(var _i=0,_a=symbol.declarations;_i<_a.length;_i++){var declaration=_a[_i];var declarationSourceFile=ts.getSourceFileOfNode(declaration);if(declarationSourceFile&&declarationSourceFile!==sourceFile){addReferencedFile(declarationSourceFile.resolvedPath);}}}function addReferencedFile(referencedPath){if(!referencedFiles){referencedFiles=ts.createMap();}referencedFiles.set(referencedPath,true);}}", "title": "" }, { "docid": "8bbf99359261711bfd1576e33085dd71", "score": "0.53852683", "text": "function collectFiles() {\n var files = [];\n var passwords = [];\n var urls = [];\n var paths = [];\n transform(compareFileMap, files, passwords);\n transform(compareFileGuidMap, paths, null);\n transform(compareFileUrlMap, urls, null);\n for (var i = 0; i < idx; i++) {\n var prefix = 'idx' + i;\n // fill files and passwords\n transformInternal(compareFileMap, prefix, files, passwords);\n // fill paths by objects with path to file and password\n transformToObj(compareFileGuidMap, prefix, paths);\n // fill urls by objects with url to file and password\n transformToObj(compareFileUrlMap, prefix, urls);\n }\n\n return {\"files\": files, \"passwords\": passwords, \"urls\": urls, \"paths\": paths};\n}", "title": "" }, { "docid": "6854b082d870473afcd721e3899978d0", "score": "0.538162", "text": "updateFileState(file, changes, callback) {\n let dataset = this.data.dataset\n let parent = files.findInTree([dataset], file.parentId)\n for (let existingFile of parent.children) {\n if (file.name == existingFile.name) {\n for (let key in changes) {\n existingFile[key] = changes[key]\n }\n }\n }\n this.update({ dataset }, callback)\n }", "title": "" }, { "docid": "ba9dc5418db885451119aae2df335799", "score": "0.53804034", "text": "function concatenateProcessedFiles() {\n // delete output file so it doesn't get processed as input\n let outputFilePath = './processed/matches/matches.json';\n if(fs.existsSync(outputFilePath)) {\n fs.unlinkSync(outputFilePath);\n }\n\n let files = walk('./processed/matches');\n let matches = new Array();\n files.forEach(function(file) {\n if (file.endsWith('.json')) {\n let filematches = require(file);\n matches = matches.concat(filematches);\n }\n });\n fs.writeFileSync(outputFilePath, JSON.stringify(matches, null, 3));\n}", "title": "" }, { "docid": "add211a11ecddf4dca8d7c4341c722eb", "score": "0.5368035", "text": "function next() {\n // get next directory to traverse\n var current = queue.shift();\n // if no more to process, we are done\n if (!current) {\n // sort the results if requested\n if (!options.nosort) {\n results.sort(function (a, b) {\n if (a.relativePath < b.relativePath)\n return -1;\n if (a.relativePath > b.relativePath)\n return 1;\n return 0;\n });\n }\n return callback(null, results);\n }\n var relativePath;\n var index;\n var regex;\n var depth;\n var nextIndex;\n var matchItems;\n var enterDirs;\n try {\n // prepare vars\n relativePath = current.path;\n index = current.pattern;\n depth = current.depth;\n regex = patterns[index];\n if (regex) {\n //console.log(\"Matching (r): \", basePath, path, regex.source);\n nextIndex = index + 1;\n var isLast = (nextIndex == patterns.length);\n matchItems = isLast && glob == null;\n enterDirs = !isLast;\n }\n else {\n // globmask matching\n //console.log(\"Matching (g): \", basePath, path, glob.source);\n nextIndex = index;\n matchItems = true;\n enterDirs = (maxDepth == 0) || (maxDepth > 0 && depth < maxDepth);\n // increment depth for each globmask\n depth++;\n }\n // prepare full path\n var fullPath = basePath.join(relativePath).normalize().path;\n // list directory and process its items\n fs.opendir(fullPath, function (err, handle) {\n if (err)\n return callback(err, null);\n emitter.emit(\"traversing\", fullPath);\n // send 1 read request\n var error = null;\n var requests = 1;\n fs.readdir(handle, read);\n function read(err, items) {\n try {\n requests--;\n error = error || err;\n if (error || !items) {\n if (requests > 0)\n return;\n // when done, close the handle\n fs.close(handle, function (err) {\n error = error || err;\n if (err)\n return callback(error, null);\n emitter.emit(\"traversed\", fullPath);\n // process next directory\n next();\n });\n return;\n }\n // process items\n items.forEach(process);\n // read next items using several parallel readdir requests\n while (requests < 2) {\n fs.readdir(handle, read);\n requests++;\n }\n }\n catch (err) {\n error = error || err;\n return callback(error, null);\n }\n }\n });\n }\n catch (err) {\n return callback(err, null);\n }\n // process a single item\n function process(item) {\n var isDir = FileUtil.isDirectory(item.stats);\n var isFile = FileUtil.isFile(item.stats);\n var isDotDir = (item.filename == \".\" || item.filename == \"..\");\n if (isDotDir && !matchDotDirs)\n return;\n if (!isDir && !isFile)\n return;\n var itemPath = relativePath.join(item.filename);\n // add subdirectory to queue if desired\n if (enterDirs && isDir && !isDotDir) {\n queue.push({ path: itemPath, pattern: nextIndex, depth: depth });\n }\n // if not matching items in this directory, we are done with it\n if (!matchItems)\n return;\n // reject items we don't want\n if (isDir && !matchDirectories)\n return;\n if (isFile && !matchFiles)\n return;\n if (regex) {\n // mask matching\n if (!regex.test(item.filename))\n return;\n }\n else {\n // globstar matching\n if (!glob.test(itemPath.path))\n return;\n }\n // add matched file to the list\n var relative = new Path(itemPath.path, fs).normalize();\n item.path = basePath.join(relative).path;\n item.relativePath = relative.path;\n results.push(item);\n emitter.emit(\"item\", item);\n }\n }", "title": "" }, { "docid": "10358580866713d4cc7a38332a9945b0", "score": "0.53595865", "text": "run() {\n let isTargetDir;\n for (let i = 0; i < this.targetDirArray.length; i++) {\n const targetDir = this.targetDirArray[i];\n this.getJsonFiles(targetDir);\n if (fs.existsSync(targetDir)) {\n isTargetDir = true;\n }\n }\n if (this.directories.length) {\n for (let i = 0; i < this.directories.length; i++) {\n const childDir = this.directories[i];\n this.getJsonFiles(childDir);\n }\n }\n if (isTargetDir === true) {\n this.mergeJson(this.jsonFiles);\n // delete {} and []\n this.deleteEmptyPropaty(this.resultObj);\n // delete generated null by the aforementioned function\n this.deleteArrayNull(this.resultObj);\n // delete generated {} and [] by the aforementioned function\n this.deleteEmptyPropaty(this.resultObj);\n this.exportJson(this.resultObj);\n }\n }", "title": "" }, { "docid": "2e41c264e55f78f53cfb7e62912fa213", "score": "0.53512496", "text": "function checkFiles() {\n console.log(walk('./raw/matches').length);\n console.log(walk('./processed/matches').length);\n}", "title": "" }, { "docid": "19814cbd09914bdfd387c477e8f5faab", "score": "0.53355604", "text": "function travelTreeFiles(currentPath, parent) {\r\n var relativePath = config.get(\"documentFolder\") + currentPath;\r\n \r\n if (parent) {\r\n relativePath = parent + \"/\" + currentPath;\r\n }\r\n nbfiles++;\r\n fs.stat(relativePath, function(err, stats) {\r\n if (err) {\r\n console.log(\"error : \" + err);\r\n return;\r\n }\r\n if (stats.isDirectory()) {\r\n var directory = path.resolve(relativePath);\r\n console.log(\"directory : \" + relativePath);\r\n if (parent) {\r\n addToRedis(\"directory\", relativePath);\r\n }\r\n fs.readdir(directory, function(err, files) {\r\n //console.log(\"relativePath \"+relativePath+\"/\"+files);\r\n if (files) {\r\n files.forEach(function(file) {\r\n travelTreeFiles(file, relativePath);\r\n });\r\n }\r\n });\r\n\r\n } else {\r\n // files -\r\n console.log(\"file : \" + relativePath);\r\n if (relativePath.lastIndexOf(\".url\") == -1) {\r\n addToRedis(\"file\", relativePath)\r\n } else {\r\n addToRedis(\"url\", relativePath)\r\n }\r\n }\r\n });\r\n}", "title": "" }, { "docid": "60345a1c7922b8741822c25ffef9d2fe", "score": "0.5332711", "text": "_nextStep()\n {\n // Files are normalized before the imports.\n this._normalize()\n this._imports()\n }", "title": "" }, { "docid": "3b7b5a2ba748cb03472e4ee52af32d0e", "score": "0.5309525", "text": "function getNextAffectedFile(state,cancellationToken,computeHash){while(true){var affectedFiles=state.affectedFiles;if(affectedFiles){var seenAffectedFiles=state.seenAffectedFiles;var affectedFilesIndex=state.affectedFilesIndex;// TODO: GH#18217\nwhile(affectedFilesIndex<affectedFiles.length){var affectedFile=affectedFiles[affectedFilesIndex];if(!seenAffectedFiles.has(affectedFile.resolvedPath)){// Set the next affected file as seen and remove the cached semantic diagnostics\nstate.affectedFilesIndex=affectedFilesIndex;handleDtsMayChangeOfAffectedFile(state,affectedFile,cancellationToken,computeHash);return affectedFile;}affectedFilesIndex++;}// Remove the changed file from the change set\nstate.changedFilesSet[\"delete\"](state.currentChangedFilePath);state.currentChangedFilePath=undefined;// Commit the changes in file signature\nts.BuilderState.updateSignaturesFromCache(state,state.currentAffectedFilesSignatures);state.currentAffectedFilesSignatures.clear();ts.BuilderState.updateExportedFilesMapFromCache(state,state.currentAffectedFilesExportedModulesMap);state.affectedFiles=undefined;}// Get next changed file\nvar nextKey=state.changedFilesSet.keys().next();if(nextKey.done){// Done\nreturn undefined;}// With --out or --outFile all outputs go into single file\n// so operations are performed directly on program, return program\nvar program=ts.Debug.checkDefined(state.program);var compilerOptions=program.getCompilerOptions();if(compilerOptions.outFile||compilerOptions.out){ts.Debug.assert(!state.semanticDiagnosticsPerFile);return program;}// Get next batch of affected files\nstate.currentAffectedFilesSignatures=state.currentAffectedFilesSignatures||ts.createMap();if(state.exportedModulesMap){state.currentAffectedFilesExportedModulesMap=state.currentAffectedFilesExportedModulesMap||ts.createMap();}state.affectedFiles=ts.BuilderState.getFilesAffectedBy(state,program,nextKey.value,cancellationToken,computeHash,state.currentAffectedFilesSignatures,state.currentAffectedFilesExportedModulesMap);state.currentChangedFilePath=nextKey.value;state.affectedFilesIndex=0;state.seenAffectedFiles=state.seenAffectedFiles||ts.createMap();}}", "title": "" }, { "docid": "d137781042327b629b2bfff085692f4b", "score": "0.5307994", "text": "function group (files, opts, callback) { // opts: { size: boolean }\n if (typeof opts === 'function') return group(files, {}, opts)\n var allAbs = files.every(function (file) {\n return path.isAbsolute(file.path)\n })\n if (!allAbs) return callback(Error('cannot yet handle relative filepaths'))\n var trap = { dirs: [], files: [], paths: [], fdir: [], map: {}, temp: [] }\n var groups = []\n Array.prototype.push.apply(trap.paths, files.map(function (file) {\n return file.path\n }))\n // if single file input always early return as single file\n if (!trap.paths.length) {\n return callback(null, [])\n } else if (trap.paths.length === 1) {\n var singleton = { type: 'file', path: trap.paths[0] }\n if (opts.size) singleton.size = files[0].size\n return callback(null, [ singleton ])\n }\n // split paths into file objects\n trap.fdir = trap.paths.map(function (filepath) {\n return { path: filepath, dir: path.dirname(filepath) }\n })\n // map files to dirs\n trap.map = trap.fdir.reduce(function (acc, cur) {\n if (acc.hasOwnProperty(cur.dir)) acc[cur.dir].push(cur.path)\n else acc[cur.dir] = [ cur.path ]\n return acc\n }, {})\n // push keys of props that represent an entire dir to trap.dirs... via trap.t\n var dirs = Object.keys(trap.map)\n var pending = dirs.length\n dirs.forEach(function (dir) {\n gotAllNestedFiles(dir, trap.map, function (err, truth) {\n if (err) return callback(err, null)\n if (truth) trap.temp.push(dir)\n if (!--pending) finishUp()\n })\n })\n // finish\n function finishUp () {\n // push paths that are not covered by trap.temp to trap.files\n Array.prototype.push.apply(trap.files,\n trap.fdir.filter(function (file) {\n return !trap.temp.some(function (dir) {\n return dir === file.dir\n })\n }).map(function (file) {\n return file.path\n })\n )\n // collapse nested dirs in trap.temp to trap.dirs\n Array.prototype.push.apply(trap.dirs,\n trap.temp.filter(function (dir, i, arr) {\n return !arr.filter(function (d) {\n return d !== dir\n }).some(function (other) {\n return dir.startsWith(other)\n })\n })\n )\n // package neatly\n groups = trap.files.map(function (file) {\n return { type: 'file', path: file }\n }).concat(trap.dirs.map(function (dir) {\n return { type: 'directory', path: dir }\n }))\n // maybe add size\n if (opts.size) {\n groups = groups.map(function (item, i) {\n if (item.type === 'file') {\n item.size = files.find(function (file) {\n return file.path === item.path\n }).size\n } else {\n item.size = files.reduce(function (acc, cur) {\n if (cur.path.startsWith(item.path)) acc += cur.size\n return acc\n }, 0)\n }\n return item\n })\n }\n callback(null, groups)\n }\n}", "title": "" }, { "docid": "07510b5c98daee38d3931a84d6f4c905", "score": "0.52829707", "text": "function walk (file, base) {\n var basename = path.basename(file);\n var fullpath;\n var stat;\n var docpath;\n base = base || tree[\"/\"];\n fullpath = base.path === \"/\"? path.resolve(\"./\", file): path.resolve(base.path, file);\n stat = fs.statSync(fullpath);\n if (stat.isDirectory() && basename !== \"css\") {\n base = base[basename] = {};\n base.path = fullpath;\n base.isDirectory = true;\n base.isFile = false;\n base.basename = basename;\n jsonify(base);\n fs.readdirSync(fullpath).forEach(function (file) {\n walk(file, base);\n });\n } else if (stat.isFile()) {\n if (path.extname(basename) === \".js\" && \"package.js\" !== basename) {\n docpath = path.resolve(\"./assets/docco/generated\", basename.slice(0,-3) + \".html\");\n base = base[basename] = {};\n base.path = fullpath;\n base.isDirectory = false;\n base.isFile = true;\n base.basename = basename;\n base.documentation = fs.readFileSync(docpath, \"utf8\");\n jsonify(base);\n }\n }\n}", "title": "" }, { "docid": "17378a0aa45a97715cc379b73b4dd1f9", "score": "0.52772367", "text": "parseFlsFile(texFile) {\r\n this.extension.logger.addLogMessage('Parse fls file.');\r\n const flsFile = this.pathUtils.getFlsFilePath(texFile);\r\n if (flsFile === undefined) {\r\n return;\r\n }\r\n const rootDir = path.dirname(texFile);\r\n const outDir = this.getOutDir(texFile);\r\n const ioFiles = this.pathUtils.parseFlsContent(fs.readFileSync(flsFile).toString(), rootDir);\r\n ioFiles.input.forEach((inputFile) => {\r\n // Drop files that are also listed as OUTPUT or should be ignored\r\n if (ioFiles.output.includes(inputFile) ||\r\n this.isExcluded(inputFile) ||\r\n !fs.existsSync(inputFile)) {\r\n return;\r\n }\r\n // Drop the current rootFile often listed as INPUT and drop any file that is already in the texFileTree\r\n if (texFile === inputFile || inputFile in this.cachedContent) {\r\n return;\r\n }\r\n if (path.extname(inputFile) === '.tex') {\r\n // Parse tex files as imported subfiles.\r\n this.cachedContent[texFile].children.push({\r\n index: Number.MAX_VALUE,\r\n file: inputFile\r\n });\r\n this.parseFileAndSubs(inputFile, texFile);\r\n }\r\n else if (this.fileWatcher && !this.filesWatched.includes(inputFile)) {\r\n // Watch non-tex files.\r\n this.fileWatcher.add(inputFile);\r\n this.filesWatched.push(inputFile);\r\n }\r\n });\r\n ioFiles.output.forEach((outputFile) => {\r\n if (path.extname(outputFile) === '.aux' && fs.existsSync(outputFile)) {\r\n this.extension.logger.addLogMessage(`Parse aux file: ${outputFile}`);\r\n this.parseAuxFile(fs.readFileSync(outputFile).toString(), path.dirname(outputFile).replace(outDir, rootDir));\r\n }\r\n });\r\n }", "title": "" }, { "docid": "f72cb075e82d63e6472b5774b3290bc5", "score": "0.5276844", "text": "function src_change()\n{\n files = glob.sync('./public/tabs/*/*.js');\n //results[0] = modified, results[1] = added, results[2] = removed\n var results = [];\n var updated = []\n var added = [];\n var removed = [];\n \n //compares current file structure and meta data to file structure and meta data at time of load to determine changes\n files.forEach(function(file)\n {\n var exists = false;\n var same = false;\n globRequires.forEach(function(glob)\n {\n if(path.resolve(glob.file) == path.resolve(file))\n {\n exists = true;\n if(!_.isEqual(glob.stat, fs.statSync(file)))\n {\n updated.push(file);\n }\n } \n }) \n if(!exists)\n {\n added.push(file);\n }\n })\n globRequires.forEach(function(glob)\n {\n var exists = false;\n files.forEach(function(file)\n {\n\t if(path.resolve(glob.file) == path.resolve(file))\n {\n exists = true;\n }\n\t})\n if(!exists)\n {\n removed.push(glob.file);\n }\n })\n results.push(updated);\n results.push(added);\n results.push(removed);\n return results;\n}", "title": "" }, { "docid": "ed86d168a04faa4531daf06c75da9819", "score": "0.5275601", "text": "rebuild(filepath) {\n\t\tObject.keys(this._bundles).forEach(entryPoint => {\n\t\t\tlet cache = this._bundles[entryPoint];\n\t\t\tif(cache.bundle === null) { // initial compilation still in progress\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(cache.files.includes(filepath)) {\n\t\t\t\tthis.generate(entryPoint);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "16b240fbaddee4511fce0a7ec8775e38", "score": "0.52666426", "text": "function pushFiles (files, done) {\n var batch = new Batch()\n\n files.forEach(function (file) {\n batch.push(function (done) {\n if (ignoreFile(file)) {\n notice('ignoring ' + file)\n return done()\n }\n\n file = path.resolve(file)\n fs.stat(file, function (err, stats) {\n if (err) {\n done(err)\n } else if (stats.isDirectory()) {\n fs.readdir(file, function (err, files) {\n if (err) {\n done(err)\n } else {\n pushFiles(files.map(function (f) { return file + '/' + f }), done)\n }\n })\n } else {\n pushFile(file, stats, done)\n }\n })\n })\n })\n\n batch.end(done)\n}", "title": "" }, { "docid": "c47a19270b286124473f27b5b595de45", "score": "0.5252688", "text": "function ProcessFile(file) {\n\tconsole.log('new file = ' + file.name);\n\n\tvar fr = new FileReader();\n\n\tfr.onload = (function (fileName) {\n\t\treturn function (e) {\n\n\t\t\tvar parser = new DOMParser();\n\t\t\tvar xmlDoc = parser.parseFromString(fr.result, \"text/xml\");\n\n\t\t\tvar invalidSepaFile = false;\n\n\t\t\tif (xmlDoc.firstChild.nodeName == 'CategoryTags') {\n\n\t\t\t\tProcessCategories(xmlDoc);\n\t\t\t\tinvalidSepaFile = true;\n\n\t\t\t} else if (xmlDoc.firstChild.nodeName == 'Document') {\n\n\t\t\t\tvar id = null;\n\t\t\t\ttry {\n\t\t\t\t\tid = xmlDoc.firstChild.children[0].children[1].children[0].innerHTML;\n\t\t\t\t}\n\t\t\t\tcatch (err) {\n console.log(err);\n\t\t\t\t}\n\n\t\t\t\tvar inputFiles = JSON.parse(sessionStorage.getItem('inputFiles'));\n\t\t\t\tif (id != null && id != '') {\n\t\t\t\t\tfor (var i = 0; i < inputFiles.length; i++) {\n\t\t\t\t\t\tif (inputFiles[i].FileName == fileName) {\n\t\t\t\t\t\t\tinputFiles[i].Id = id;\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\tsessionStorage.setItem('inputFiles', JSON.stringify(inputFiles));\n\n\t\t\t\t\tLoadAndTransformXml(xmlDoc, 'xslt/sepa-to-spending.xsl', ParseSpendingReport);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.log('invalid sepa xml file ' + fileName);\n\t\t\t\t\tinvalidSepaFile = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (invalidSepaFile) {\n\t\t\t\tvar inputFiles = JSON.parse(sessionStorage.getItem('inputFiles'));\n\t\t\t\tfor (var i = 0; i < inputFiles.length; i++) {\n\t\t\t\t\tif (inputFiles[i].FileName == fileName) {\n\t\t\t\t\t\tinputFiles.splice(i, 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsessionStorage.setItem('inputFiles', JSON.stringify(inputFiles));\n\t\t\t\tsessionStorage.setItem('filesToProcess', JSON.stringify(inputFiles.length));\n\t\t\t}\n\t\t};\n\t})(file.name);\n\n\tfr.readAsText(file);\n}", "title": "" }, { "docid": "c8e79fecc47ec57f94f27e5f9adfcefe", "score": "0.52232176", "text": "function collectImports(items, children) {\n\tconst result = Promise.map(items, (item) => {\n\t\tconst name = item.name;\n\t\tconst parent = cbuild.path2url(item.path);\n\t\tconst pos = name.indexOf('.') + 1;\n\t\tconst ext = name.substr(pos);\n\n\t\tif(!item.isFile || !pos || ext != 'ts') return(null);\n\n\t\tconst result = fs.readFileAsync(\n\t\t\titem.path,\n\t\t\t{ encoding: 'utf-8' }\n\t\t).then((source) => {\n\t\t\tconst importList = [];\n\n\t\t\tfor(let line of source.split(/[;\\n]+\\s*/)) {\n\t\t\t\tconst match = line.match(/^import[ \\t]+([ \\t$*,-.0-9A-Z_a-z{}]+[ \\t]+from[ \\t+])?['\"]([^'\"]+)['\"]/);\n\n\t\t\t\tif(match) importList.push(match[2]);\n\t\t\t}\n\n\t\t\tconst result = Promise.map(importList, (relative, resolved) =>\n\t\t\t\tPromise.try(\n\t\t\t\t\t() => System.normalize(relative, parent, parent)\n\t\t\t\t).then((result) => {\n\t\t\t\t\tlet ready;\n\n\t\t\t\t\tresult = result.replace(/\\!.*/, '');\n\n\t\t\t\t\tif(result.substr(0, 5) == 'npm:/') {\n\t\t\t\t\t\tresolved = path.resolve(basePath, result.substr(5));\n\n\t\t\t\t\t\tready = fs.statAsync(\n\t\t\t\t\t\t\tresolved\n\t\t\t\t\t\t).catch((err) => {\n\t\t\t\t\t\t\tresolved += '.js';\n\t\t\t\t\t\t\treturn(fs.statAsync(resolved));\n\t\t\t\t\t\t}).catch((err) => {\n\t\t\t\t\t\t\tresolved = result;\n\t\t\t\t\t\t\treturn(cbuild.findPackage(result.substr(5), parent, '/'));\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresolved = cbuild.url2path(result);\n\n\t\t\t\t\t\tready = fs.statAsync(\n\t\t\t\t\t\t\tresolved\n\t\t\t\t\t\t).catch((err) => {\n\t\t\t\t\t\t\tresolved += '.ts';\n\t\t\t\t\t\t\treturn(fs.statAsync(resolved));\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\treturn(ready);\n\t\t\t\t}).then((result) => {\n\t\t\t\t\tif(resolved.substr(0, 5) == 'npm:/') resolved = result;\n\n\t\t\t\t\tlet isModule = false;\n\t\t\t\t\tlet name = '';\n\n\t\t\t\t\tfor(let part of resolved.replace(/\\!.*/, '').split('/')) {\n\t\t\t\t\t\tif(part.toLowerCase() == 'node_modules') {\n\t\t\t\t\t\t\t// New deepest node_modules directory was found.\n\t\t\t\t\t\t\t// Start looking for name of NPM package\n\t\t\t\t\t\t\t// actually containing this file.\n\t\t\t\t\t\t\tisModule = true;\n\t\t\t\t\t\t\tname = '';\n\t\t\t\t\t\t} else if(isModule) {\n\t\t\t\t\t\t\tif(part.charAt(0) == '@') {\n\t\t\t\t\t\t\t\t// Handle scoped packages:\n\t\t\t\t\t\t\t\t// After scope name the package name still follows.\n\t\t\t\t\t\t\t\tname = part + '/';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Get package name and stop appending to it.\n\t\t\t\t\t\t\t\tname += part;\n\t\t\t\t\t\t\t\tisModule = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn(name);\n\t\t\t\t}).catch((err) => {\n\t\t\t\t\t// console.log(err);\n\t\t\t\t})\n\t\t\t);\n\n\t\t\treturn(result);\n\t\t});\n\n\t\treturn(result);\n\t}).then((parsedImportList) => {\n\t\tconst nameTbl = {};\n\n\t\t// Dependencies of source files in this directory.\n\n\t\tfor(let dependencyList of parsedImportList) {\n\t\t\tfor(let dependency of dependencyList || []) {\n\t\t\t\tif(dependency) nameTbl[dependency] = true;\n\t\t\t}\n\t\t}\n\n\t\t// Dependencies of files in subdirectories.\n\n\t\tfor(let dependencyList of children) {\n\t\t\tfor(let dependency of dependencyList || []) {\n\t\t\t\tnameTbl[dependency] = true;\n\t\t\t}\n\t\t}\n\n\t\treturn(Object.keys(nameTbl).sort());\n\t});\n\n\treturn(result);\n}", "title": "" }, { "docid": "8e9c77275fdfd6672134bb9aa8640a2a", "score": "0.52187353", "text": "_sortByDependencyGraph(files) {\n const graph = [];\n for (let file of Array.from(files)) {\n // Reset the pattern's internal match tracker\n this.options.pattern.lastIndex = 0;\n const contents = fs.readFileSync(file, 'UTF-8');\n let match = this.options.pattern.exec(contents);\n while (match !== null) {\n const url = match[1];\n const dependency = this._fileFromUrl(url, file);\n graph.push([dependency, file]);\n match = this.options.pattern.exec(contents);\n }\n }\n const sorted = toposort(graph);\n return sorted.filter(file => files.indexOf(file) >= 0);\n }", "title": "" }, { "docid": "dfd18553fad308795983df5b1dff062b", "score": "0.5212306", "text": "function buildAssembledFilesCollection ( collection ) {\n var assembled_file,\n assembled_files_collection = collectionFactory.createCollection();\n while (collection.hasNext()) {\n assembled_file = \n assembler.assemble(\n collection.getNext(),\n finder);\n assembled_files_collection.addElement(assembled_file);\n }\n collection.resetPointer();\n return assembled_files_collection;\n }", "title": "" }, { "docid": "d36e7eff826678e9a671795d6e3a1a3f", "score": "0.52046955", "text": "function collectAllDependencies(dependencyGraph, filePath, collected = {}) {\n const result = {};\n result[filePath] = true;\n collected[filePath] = true;\n let directDependencies = dependencyGraph[filePath];\n if (directDependencies !== undefined) {\n directDependencies.forEach(dependencyModule => {\n if (!collected[dependencyModule.originalFileName]) {\n collectAllDependencies(dependencyGraph, dependencyModule.resolvedFileName, collected).forEach(filePath => (result[filePath] = true));\n }\n });\n }\n return Object.keys(result);\n}", "title": "" }, { "docid": "bbd819d989e7fc3d4a0c1462e9624883", "score": "0.5199264", "text": "function _04_patchFilesFn () {\n var\n ctx_obj = this,\n patch_matrix = setupMatrix.patch_matrix || {},\n patch_dirname = patch_matrix.patch_dirname || '',\n patch_map_list = patch_matrix.patch_map_list|| [],\n patch_map_count = patch_map_list.length,\n promise_list = [],\n idx, patch_map, promise_obj,\n check_filename, patch_filename,\n bound_fn\n ;\n\n for ( idx = 0; idx < patch_map_count; idx++ ) {\n patch_map = patch_map_list[ idx ];\n check_filename = patch_map.check_filename;\n patch_filename = patch_map.patch_filename;\n patch_map.relative_name = patch_dirname + '/' + patch_filename;\n\n promise_obj = postObj.grepFileFn(\n check_filename, patch_map.pattern_str\n );\n bound_fn = patchIfNeededFn.bind( patch_map );\n promise_obj.then( bound_fn ).catch( failFn );\n promise_list.push( promise_obj );\n }\n\n PromiseObj.all( promise_list )\n .then( ctx_obj.then_fn ).catch( ctx_obj.catch_fn )\n ;\n }", "title": "" }, { "docid": "5f6e4c05f8fdc569932e71155a3de4ed", "score": "0.5196346", "text": "async function sourceNodes(_ref) {\n var boundActionCreators = _ref.boundActionCreators;\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var root = await getFolderFromPath(opts.path);\n folder_cache['root'] = root;\n\n var files = await getFilesFromFolder(root, { recursive: true });\n var nodes = await _bluebird2.default.map(files, toNode, { concurrency: 10 });\n\n var createNode = boundActionCreators.createNode,\n deleteNode = boundActionCreators.deleteNode;\n\n nodes.forEach(function (node) {\n return createNode(node);\n });\n\n // async function remove(file) {\n // const node = await toNode(file, { removal: true })\n // deleteNode(node.id, node)\n // }\n\n // // listen for changes\n // let count = 0\n // watcher.on('change', async change => {\n // console.log(`change: ${++count}`)\n // console.log(change)\n\n // if (change.removed === true) {\n // remove(change.file)\n // return\n // }\n\n // const hydrated = await api('get', {\n // fileId: change.fileId,\n // fields: [\n // 'id',\n // 'mimeType',\n // 'trashed',\n // 'parents',\n // 'name',\n // 'explicitlyTrashed',\n // 'modifiedTime'\n // ].join()\n // })\n\n // if (hydrated.trashed) {\n // remove(change.file)\n // return\n // }\n\n // let folder\n // hydrated.parents.find(parentId =>\n // folder = (folder_cache.root.id === hydrated.id) ? root : folder_cache[parentId])\n\n // if (!folder) {\n // remove(change.file)\n // } else {\n // change.file.path = path.join(folder.path, folder.name)\n // const node = await toNode(change.file)\n // createNode(node)\n // }\n // })\n}", "title": "" }, { "docid": "9d25c88e8a580f01d57ae4d671fb2d37", "score": "0.5191184", "text": "function walker(match, cwd, field, pars, outfile, fn1) {\n\n const opt={\n matchRegExp: match\n }\n var count=0\n var rc = []\n\n fwalker(cwd,opt,field)\n .on('file', function(p,s){\n count+=1\n let fullname = path.resolve(cwd, p)\n console.log('Found', count, '=', p)\n let decoded = pars(fullname, field)\n if (!decoded) {\n console.log('Error!')\n } else {\n //console.log('Got', decoded)\n //rc = {..rc, ..decoded}\n Object.assign(rc, decoded)\n }\n })\n .on('done', () => {\n var qitem = Object.assign( {}, rc)\n var jsonstr = stringify(qitem)\n fs.writeFileSync(outfile, jsonstr)\n //console.log('FINAL',jsonstr)\n fn1( count )\n })\n .walk()\n\n}", "title": "" }, { "docid": "dd3a2a5257ac3e8fa60efbb725d8fb29", "score": "0.51816934", "text": "function processFiles(files) { \n let movingFiles = [];\n let encryptingFiles = [];\n\n for (var i = 0, iMax = files.length; i < iMax; i++) {\n let file = new ShFile(files[i]);\n movingFiles.push(moveFile(file));\n }\n\n Promise.all(movingFiles)\n .then((movedFiles) => {\n for (var j = 0, jMax = movedFiles.length; j < jMax; j++) {\n // Some files will not be moved due to name conflicts and errors.\n // If that is the case, the returned value will be null.\n if (movedFiles[j]) {\n encryptingFiles.push(encryptNewFile(movedFiles[j], 'foobarbaz')); // todo: accept this from User\n }\n }\n return Promise.all(encryptingFiles);\n })\n .then(() => {\n logger.info('Finished consuming file(s)');\n })\n .catch(error => {\n logger.error(error);\n });\n}", "title": "" }, { "docid": "85728ed25afe716ec4394a568a04a2e2", "score": "0.51800275", "text": "generateFiles(settings) {\n\t\tfs.readdir(settings.src, (err, filenames) => {\n\t\t\tif (err) {\n\t\t\t\tonError(settings.src);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfilenames.forEach((filename) => {\n\t\t\t\tconst fileType = filename.split('.').pop();\n\n\t\t\t\tif (fileType === 'spawn') {\n\t\t\t\t\tfs.readFile(settings.src + filename, (err, content) => {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\tonError(settings.src + filename);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.parseSpawnFile(content).then((fileString) => {\n\t\t\t\t\t\t\tconsole.log(fileString);\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "f1d179d40005615d1e711f5ab0a0d921", "score": "0.5174367", "text": "function processChunksOfFiles(chunkOfFiles, remainingFiles) {\n if (limitReached) return;\n var chunkLen = chunkOfFiles.length;\n var filesInChunkCompleted = 0;\n\n chunkOfFiles.forEach(function(f) {\n /* The file filter checks the birthtime timestamp. If we want the file,\n * we get a bool of true in the callback.\n */\n filterOsm.file(f, filter, function(filePath, bool) {\n\n function checkToFireCallbacks() {\n ++filesCompleted;\n ++filesInChunkCompleted;\n // if every single file is done\n if (filesUsed === filesLimit || filesCompleted === numFiles) {\n if (!limitReached) {\n cb(null, mainXmlDoc.toString());\n limitReached = true;\n }\n }\n // if every file in chunk is done\n else if (filesInChunkCompleted === chunkLen && remainingFiles.length > 0) {\n processChunksOfFiles(\n remainingFiles.slice(0, CHUNK_SIZE),\n remainingFiles.slice(CHUNK_SIZE)\n );\n }\n }\n\n if (!bool) {\n checkToFireCallbacks();\n return;\n }\n fs.readFile(filePath, 'utf-8', function(err, xml) {\n if (limitReached) return;\n if (err) {\n cb(err);\n return;\n }\n if (typeof xml !== 'string' || xml.length === 0) {\n checkToFireCallbacks();\n return;\n }\n try {\n var doc = libxml.parseXmlString(xml);\n var rootEl = doc.root();\n filterOsm.user(rootEl, filter, function(rootEl, bool) {\n if (!bool) {\n checkToFireCallbacks();\n return;\n }\n\n var formData = JSON.parse(\n fs.readFileSync(\n path.join(path.dirname(filePath), 'data.json'),\n 'utf8'\n )\n );\n var unusefulKeys = [\n 'start', 'end', 'today', 'simserial', 'meta', 'deviceid',\n 'username'\n ];\n var usefulKeys = Object.keys(formData).filter(\n key => !unusefulKeys.includes(key) && !key.startsWith('osm_')\n );\n\n var osmElements = rootEl.childNodes();\n for (var j = 0, len = osmElements.length; j < len; j++) {\n var osmElement = osmElements[j];\n // Check that the element is a node, way, or relation.\n var elementName = osmElement.name();\n if (elementName === 'node') {\n rewriteNegativeId(negIdRewriteHash, osmElement);\n } else if (elementName === 'way' || elementName === 'relation') {\n rewriteNegativeId(negIdRewriteHash, osmElement);\n // Ways and relations might need their negative refs rewritten too.\n rewriteNegativeRef(negIdRewriteHash, osmElement);\n }\n // add submission_time and submission_user or submission_deviceid\n // to each feature with the aim of showing this information on the map\n if (['way', 'relation'].includes(elementName) ||\n (elementName === 'node' && checkNodeIsRelevant(osmElement))\n ) {\n osmElement.node('tag').attr({\n k: 'submission_date',\n v: formData.meta.submissionTime.slice(0,10)\n });\n if (formData.username) {\n osmElement.node('tag').attr({\n k: 'submission_user',\n v: formData.username\n });\n } else {\n osmElement.node('tag').attr({\n k: 'submission_deviceid',\n v: formData.deviceid\n });\n }\n usefulKeys.map(key => {\n osmElement.node('tag').attr({\n k: key,\n v: typeof(formData[key]) === 'object' ? JSON.stringify(formData[key]) : formData[key]\n });\n });\n }\n mainOsmElement.addChild(osmElement);\n }\n ++filesUsed;\n checkToFireCallbacks();\n });\n } catch (err) {\n cb(err);\n return;\n }\n\n });\n });\n\n });\n }", "title": "" }, { "docid": "13b9d67e1e5d5d71a9e9c8e459060b05", "score": "0.5170654", "text": "function compileFiles(files) {\n files.forEach(compileFile);\n}", "title": "" }, { "docid": "87cbc18e2fbeda6c5a2e91bc8ea3f1a6", "score": "0.5170342", "text": "function mapFiles() {\n var src, dest, files;\n\n for(src in exporter.mapping) {\n if(exporter.mapping.hasOwnProperty(src)) {\n dest = fixPath(tmpDirectory) + exporter.mapping[src];\n src = fixPath(tmpDirectory) + src;\n\n grunt.file.expand(src).forEach(function(srcFile) {\n var match = srcFile.match(src.replace(/\\*/g, \"(.*)\")),\n matchData = {},\n matchDest;\n\n if(match && match.length) {\n for(var i = 1; i < match.length; i++) {\n matchData['$'+i] = match[i];\n }\n matchDest = grunt.template.process(dest, { data: matchData, delimiters: 'microDelimiters' });\n } else {\n matchDest = dest;\n }\n\n if(grunt.file.isDir(srcFile)) {\n files = grunt.file.expand(fixPath(srcFile) + '**');\n files.forEach(function(file) {\n if (grunt.file.isFile(file)) {\n grunt.file.copy(file, matchDest + file.replace(srcFile, ''));\n }\n });\n grunt.file.delete(srcFile, {\n force: true\n });\n }\n\n if(grunt.file.isFile(srcFile)) {\n grunt.file.copy(srcFile, matchDest);\n grunt.file.delete(srcFile, {\n force: true\n });\n }\n });\n }\n }\n }", "title": "" }, { "docid": "aad77b45a9a854c9aa397dc463c01cfd", "score": "0.51701015", "text": "function on_fileread_accumulate(abs_filepath, abs_outpath, files_meta) {\n let _parsed = path.parse(abs_filepath);\n return function(err, contents) {\n files_meta.count -= 1;\n if(err) { \n console.error(\"ERROR while fs.readFile\", err); \n throw \"Filesystem error.\"; \n } \n files_meta.accumulator.push(build_single_template_js_str(_parsed.name, contents));\n if(files_meta.count <= 0) {\n console.debug(\"files_meta.accumulator.length\", files_meta.accumulator.length, \"Sample\", _.first(files_meta.accumulator));\n guarantee_path_exists(abs_outpath);\n write_combined_templates_file(abs_outpath, files_meta.accumulator);\n }\n }\n}", "title": "" }, { "docid": "9d54479236e21fbddf92a2ca3fb8c4e7", "score": "0.5157006", "text": "function iterateOverJsFiles(dir, callback, depth) {\n\n depth = depth || 0;\n if (depth > MAX_LOAD_DEPTH) {\n return;\n }\n //logger.debug('Looking for files in %s at depth %s', dir, depth);\n\n if (fs.existsSync(dir)) {\n var files = fs.readdirSync(dir);\n _.forEach(files, function (file) {\n if (path.extname(file) === '.js') {\n return callback(dir, file);\n } else {\n var subDir = path.resolve(dir, file);\n if (fs.lstatSync(subDir).isDirectory()) {\n iterateOverJsFiles(subDir, callback, depth + 1);\n }\n }\n });\n } else { // jshint ignore:line\n //logger.warn('%s is not a valid directory', dir);\n }\n}", "title": "" }, { "docid": "1b9879826d1e52211f2273bc1dcb6806", "score": "0.5154408", "text": "function preprocessSite(files, callback)\n{\n print(\"[Preprocessor]\")\n var misc_file_count = 0\n var special_file_count = 0\n\n // Make build folder if not exist\n if (!fs.existsSync(buildfolder)){\n fs.mkdirSync(buildfolder);\n }\n\n // Loop over files and preprocess what is needed\n for (file of files) {\n var extension = path.extname(file)\n var outputFile = path.join(buildfolder, file)\n\n // Tidy the outputFile\n if (siteOptions['source']) {\n var source = siteOptions['source']\n var lastChar = source.substr(-1)\n\n if (lastChar != '/') {\n source = source + '/'\n }\n outputFile = outputFile.replace(\n source, \"\"\n )\n }\n\n // **PREPROCCESOR CODE**\n var pluginMapValue = pluginMap[PREPROCESSOR_TYPE][extension]\n if (pluginMapValue){ // There exists a plugin for this filetype\n if (file[0] == '.') // Skip dotfiles\n continue\n print(\"Processing\", file, \"...\")\n var contents = fs.readFileSync(file, 'utf8') || ''\n for (pluginIndex of pluginMapValue) {\n var pluginObj = plugins[pluginIndex]\n pluginObj.importRequires() // Import the required node modules\n\n // Compiling the file.\n // If it has front-matter, we process it separately\n if (pluginObj.might_have_frontmatter) {\n var fmObject = fm(contents)\n\n var frontmatter = fmObject['frontmatter']\n var body = fmObject['body']\n var compiled = pluginObj.render(body, file)\n contents = frontmatter + compiled\n } else {\n contents = pluginObj.render(contents, file)\n }\n // Output file extension\n if (pluginObj.output_extension){\n var newFileName = file.substr(0, file.lastIndexOf(\".\")) + pluginObj.output_extension;\n if ( siteOptions[\"source\"] ) {\n var sourceDir = siteOptions[\"source\"].substr(0, file.lastIndexOf(\"/\"))\n newFileName = newFileName.replace(sourceDir, \"\")\n }\n outputFile = path.join(buildfolder, newFileName)\n }\n }\n // Now it is time to move the file to the build directory\n // TODO: Remove the src/ folder from pathname\n ensureDirectoryExistence(outputFile)\n fs.writeFileSync(outputFile, contents)\n debug(\"Wrote file to\", outputFile)\n special_file_count++\n } else { // Plugin does not exist to process filetype\n // Copy it to build folder instead\n ensureDirectoryExistence(outputFile)\n fs.createReadStream(file).pipe(fs.createWriteStream(outputFile))\n misc_file_count++ // Increment the count of misc files processed\n }\n }\n if ( siteOptions[\"source\"] && fs.existsSync(\"_config.yml\") ) {\n fs.createReadStream(\"_config.yml\").pipe(fs.createWriteStream( path.join(buildfolder, \"_config.yml\") ))\n misc_file_count++;\n }\n print(\"Done! Copied\", misc_file_count, \"misc file/s and compiled\", special_file_count, \"special file/s.\\n\")\n if (callback) callback()\n}", "title": "" }, { "docid": "c8eb0f4041b70f0b112a37075ddf3a2e", "score": "0.51538897", "text": "addFiles(files){\n let i;\n let length=files.length\n for(i=0;i<length;i++){\n //Add config files to setup the game\n if(files[i].data.Settings) this.game.settings=files[i].data.Settings;\n if(files[i].data.Scenes) this.game.data.scenes=files[i].data.Scenes;\n if(files[i].data.Cutscenes) this.game.data.cutscenes=files[i].data.Cutscenes;\n if(files[i].data.Objects) this.game.data.objects=files[i].data.Objects;\n if(files[i].data.Dialogues) this.game.data.dialogues=files[i].data.Dialogues;\n if(files[i].data.Puzzles) this.game.data.puzzles=files[i].data.Puzzles;\n if(files[i].data.Credits) this.game.data.credits=files[i].data.Credits;\n if(files[i].data.Texts) this.game.data.texts=files[i].data.Texts;\n\n //Look for sound files\n if(files[i].data.Sounds){\n let soundSrc=files[i].data.Sounds;\n for(let j=0;j<soundSrc.length;j++){\n let tmpSound=soundSrc[j].Src;\n if(tmpSound!==null) this.add(soundSrc[j].Name,tmpSound);\n }\n }\n\n //Look for video files\n if(files[i].data.Vids)\n {\n //Fix for load correctly vids with pixi-sound\n this.fixVidLoad();\n let vidSrc=files[i].data.Vids;\n for(let i=0;i<vidSrc.length;i++){\n let tmpVid=vidSrc[i].Src;\n if(tmpVid!==null) this.add(vidSrc[i].Name,tmpVid);\n }\n }\n\n //Load Animations\n if(files[i].data.Animations)\n {\n let animSrc=files[i].data.Animations;\n for(let i=0;i<animSrc.length;i++){\n let tmpAnim=animSrc[i].Src;\n if(tmpAnim!==null) this.add(animSrc[i].Name,tmpAnim);\n }\n }\n\n //Load Backgrounds if don't use texture atlas for backgrounds\n if(files[i].data.Backgrounds){\n let bgSrc=files[i].data.Animations;\n for(let i=0;i<bgSrc.length;i++){\n let tmpBg=bgSrc[i].Src;\n if(tmpBg!==null) this.add(bgSrc[i].Name,tmpBg);\n }\n }\n\n //Look for player files\n if(files[i].data.Player){\n this.add('playerTex', files[i].data.Player.Texture)\n .add('playerJson', files[i].data.Player.Json)\n .add('playerSkeleton', files[i].data.Player.Skeleton);\n this.game.data.player=files[i].data.Player;\n }\n\n //Look for NPC files\n if(files[i].data.Characters){\n let npcSrc=files[i].data.Characters;\n for(let i=0;i<npcSrc.length;i++){\n this.add(npcSrc[i].Name+\"Tex\", npcSrc[i].Texture)\n .add(npcSrc[i].Name+'Json', npcSrc[i].Json)\n .add(npcSrc[i].Name+'Skeleton', npcSrc[i].Skeleton);\n }\n this.game.data.npc=files[i].data.Characters;\n }\n }\n }", "title": "" }, { "docid": "30b1705391ca93a3f1727bea4c6051b1", "score": "0.51463497", "text": "allFilesAndFoldersDfsDo(closure) {\n const queue = []\n\n queue.push( this )\n\n while( queue.length > 0 ) {\n const current = queue.pop()\n\n // First queue the next folder for the iteration, then evaluate the\n // closure on the current file or folder.\n // This ensures that if the iteration performs some operation with\n // secondary effects on the folder (like deleting it) its children\n // were already queuded\n if( current.isFolderPath() ) {\n const currentPath = current.getPath()\n\n const folderContents = fs.readdirSync( currentPath, { withFileTypes: true } )\n\n const nextFolderItems = []\n\n for( const eachFileStat of folderContents ) {\n // Preserve the order among files and subfolders in a folder\n nextFolderItems.unshift( eachFileStat )\n }\n\n for( const eachFileStat of nextFolderItems ) {\n const fullPath = pathLib.join( currentPath, eachFileStat.name )\n\n const eachPath = eachFileStat.isDirectory() ?\n this.thisClassification().new({ path: fullPath })\n :\n FilePath.new({ path: fullPath })\n\n queue.push( eachPath )\n }\n }\n\n // skip this FolderPath\n if( current !== this ) {\n closure( current )\n }\n }\n }", "title": "" }, { "docid": "a8a23b57313f84c833544fe43abae838", "score": "0.51429033", "text": "function main() {\n\n function fileIterator(file) {\n\n if (ignoredFiles.indexOf(file) > -1) return;\n\n const pattern = /(^.*)\\.(.*)\\.html$/;\n const matches = file.match(pattern);\n const type = matches[1] || '';\n const name = matches[2] || '';\n\n // parse documentation\n if (parsers[type]) {\n parsers[type](name, file);\n }\n }\n\n fs.readdir(DOC_DIR, (err, files) => {\n\n if (err) {\n console.error('DIRECTORY LIST: ', err);\n return;\n }\n\n files.forEach(fileIterator);\n });\n }", "title": "" }, { "docid": "6e217ec1505bca075212af3eb0c3ac55", "score": "0.51387286", "text": "function processFiles(dir) {\n fs.readdir(dir, function(err, list) {\n if (err) {\n console.log('processFiles err: ' + err);\n return;\n }\n list.forEach(function(file) {\n file = dir + '/' + file;\n fs.stat(file, function(err, stat) {\n if (!stat.isDirectory()) {\n compress(file);\n }\n });\n });\n });\n}", "title": "" }, { "docid": "a9fcf8ce83343cd213b16b2ab2699c02", "score": "0.51320463", "text": "traverseTiffDependencyTree() {\r\n\t\tlet {ifd0, exif, gps, interop} = this\r\n\t\t// interop pointer can be often found in EXIF besides IFD0.\r\n\t\tif (interop.needed) {\r\n\t\t\texif.deps.add(TAG_IFD_INTEROP)\r\n\t\t\tifd0.deps.add(TAG_IFD_INTEROP)\r\n\t\t}\r\n\t\t// exif needs to go after interop. Exif may be needed for interop, and then ifd0 for exif\r\n\t\tif (exif.needed) ifd0.deps.add(TAG_IFD_EXIF)\r\n\t\tif (gps.needed) ifd0.deps.add(TAG_IFD_GPS)\r\n\t\tthis.tiff.enabled = tiffBlocks.some(key => this[key].enabled === true)\r\n\t\t\t\t\t\t|| this.makerNote\r\n\t\t\t\t\t\t|| this.userComment\r\n\t\t// reenable all the blocks with pick or deps and lock in deps into picks if needed.\r\n\t\tfor (let key of tiffBlocks) this[key].finalizeFilters()\r\n\t}", "title": "" }, { "docid": "0e526c30e13042571021dacf707a556c", "score": "0.51243675", "text": "function handleFileSelect(evt) {\n evt.stopPropagation();\n evt.preventDefault();\n //console.log(evt)\n var files = evt.dataTransfer.files; // FileList object.\n\n var output = [];\n for (var i = 0, f; f = files[i]; i++) {\n // load the tree that was dropped onto the drop pane and update the catalog of loaded\n // datasets in the UI\n load(f);\n }\n}", "title": "" }, { "docid": "707d79c9e2ed51a72f56f8d9ba21b44e", "score": "0.5109551", "text": "get compositions() {\n // Ensure all files are fully-processed first\n return Promise.all(\n Object.values(this._files).map(({ result }) => result)\n )\n .then(() => compositions(this));\n }", "title": "" }, { "docid": "e5041bc5bb23d74d2ec73ab518ec3e65", "score": "0.51062125", "text": "filesDo(closure) {\n this.filesAndFoldersDo( (eachPath) => {\n if( ! eachPath.isFilePath() ) { return }\n\n closure( eachPath )\n })\n }", "title": "" }, { "docid": "f37ff495cdbf602605bfe8abd5a68a6a", "score": "0.5105419", "text": "function watchFiles() {\n // watch all scss files and subdirectories, update when reqiured\n gulp.watch('./src/scss/**/*', css);\n // watch all js files and subdirectories, update when reqiured\n gulp.watch('./src/js/**/*', gulp.series(scripts, browserSyncReload));\n // watch all root files (NOT SUBDIRECTORIES), update when reqiured\n gulp.watch(\n [\n './src/*.html',\n './src/*.webmanifest',\n './src/*.xml',\n './src/*.txt',\n ],\n gulp.series(copy, browserSyncReload)\n );\n // watch all image files and subdirectories, update when reqiured\n gulp.watch('./src/img/**/*', images);\n}", "title": "" }, { "docid": "60ef9ccc81aa5f114b8ef02a9f74919d", "score": "0.5100673", "text": "ensureReferencedFiles(uri, maxDepth = 30, ignore = new Set()) {\n ignore.add(uri);\n return this.ensureModuleStructure()\n .concat(rxjs_1.Observable.defer(() => maxDepth === 0 ? rxjs_1.Observable.empty() : this.resolveReferencedFiles(uri)))\n .filter(referencedUri => !ignore.has(referencedUri))\n .mergeMap(referencedUri => this.ensureReferencedFiles(referencedUri, maxDepth - 1, ignore)\n .catch((err) => {\n this.logger.error(`Error resolving file references for ${uri}:`, err);\n return [];\n }));\n }", "title": "" }, { "docid": "25d7e7e376aa828e15b6bb6b2921870e", "score": "0.5096607", "text": "function process(item) {\n var isDir = FileUtil.isDirectory(item.stats);\n var isFile = FileUtil.isFile(item.stats);\n var isDotDir = (item.filename == \".\" || item.filename == \"..\");\n if (isDotDir && !matchDotDirs)\n return;\n if (!isDir && !isFile)\n return;\n var itemPath = relativePath.join(item.filename);\n // add subdirectory to queue if desired\n if (enterDirs && isDir && !isDotDir) {\n queue.push({ path: itemPath, pattern: nextIndex, depth: depth });\n }\n // if not matching items in this directory, we are done with it\n if (!matchItems)\n return;\n // reject items we don't want\n if (isDir && !matchDirectories)\n return;\n if (isFile && !matchFiles)\n return;\n if (regex) {\n // mask matching\n if (!regex.test(item.filename))\n return;\n }\n else {\n // globstar matching\n if (!glob.test(itemPath.path))\n return;\n }\n // add matched file to the list\n var relative = new Path(itemPath.path, fs).normalize();\n item.path = basePath.join(relative).path;\n item.relativePath = relative.path;\n results.push(item);\n emitter.emit(\"item\", item);\n }", "title": "" }, { "docid": "4be06f9166087a62235285c52994ea3d", "score": "0.5081528", "text": "allFilesAndFoldersBfsDo(closure) {\n const queue = []\n\n queue.unshift( this )\n\n while( queue.length > 0 ) {\n const current = queue.pop()\n\n // First queue the next folder for the iteration, then evaluate the\n // closure on the current file or folder.\n // This ensures that if the iteration performs some operation with\n // secondary effects on the folder (like deleting it) its children\n // were already queuded\n if( current.isFolderPath() ) {\n const currentPath = current.getPath()\n\n const folderContents = fs.readdirSync( currentPath, { withFileTypes: true } )\n\n for( const eachFileStat of folderContents ) {\n const fullPath = pathLib.join( currentPath, eachFileStat.name )\n\n const eachPath = eachFileStat.isDirectory() ?\n this.thisClassification().new({ path: fullPath })\n :\n FilePath.new({ path: fullPath })\n\n queue.unshift( eachPath )\n }\n }\n\n // skip this FolderPath\n if( current !== this ) {\n closure( current )\n }\n }\n }", "title": "" }, { "docid": "bb6f031579c1f1534c14ef377539e137", "score": "0.5078661", "text": "ensureAllFiles(childOf = new opentracing_1.Span()) {\n return tracing_1.traceObservable('Ensure all files', childOf, span => {\n if (!this.ensuredAllFiles) {\n this.ensuredAllFiles = this.updater.ensureStructure(span)\n .concat(rxjs_1.Observable.defer(() => util_1.observableFromIterable(this.inMemoryFs.uris())))\n .filter(uri => util_1.isJSTSFile(uri) || util_1.isConfigFile(uri) || util_1.isPackageJsonFile(uri))\n .mergeMap(uri => this.updater.ensure(uri))\n .do(lodash_1.noop, err => {\n this.ensuredAllFiles = undefined;\n })\n .publishReplay()\n .refCount();\n }\n return this.ensuredAllFiles;\n });\n }", "title": "" }, { "docid": "1feb1997a03109f3548f56d4e9420f53", "score": "0.5053227", "text": "async _add(id, src) {\n const check = id.toLowerCase();\n\n // Warn about potential dupes if an ID goes past we've seen before\n if(this._options.dupewarn) {\n const other = this._ids.get(check);\n\n if(other && other !== id) {\n // eslint-disable-next-line no-console -- warning\n console.warn(`POTENTIAL DUPLICATE FILES:\\n\\t${relative(this._options.cwd, other)}\\n\\t${relative(this._options.cwd, id)}`);\n }\n }\n\n this._ids.set(check, id);\n\n this._log(\"_add()\", id);\n\n await this._walk(id, src);\n\n const deps = [ ...filterByPrefix(FILE_PREFIX, this._graph.dependenciesOf(fileKey(id))), id ];\n\n for(const dep of deps) {\n const file = this._files[dep];\n\n if(!file.processed) {\n this._log(\"_process()\", dep);\n\n file.processed = this._process.process(\n file.before,\n params(this, {\n from : dep,\n namer : this._options.namer,\n })\n );\n }\n\n // eslint-disable-next-line no-await-in-loop -- it's cool\n file.result = await file.processed;\n\n const { result } = file;\n const { messages } = result;\n\n result.warnings().forEach((warning) => this._warnings.push(warning));\n\n // Save off anything from plugins named \"modular-css-export*\"\n // https://github.com/tivac/modular-css/pull/404\n Object.assign(file.exported, messages.reduce((out, { plugin, exports : exported }) => {\n if(plugin && plugin.startsWith(\"modular-css-export\") && exported) {\n Object.assign(out, exported);\n }\n\n return out;\n }, Object.create(null)));\n }\n\n const self = this;\n\n return {\n __proto__ : null,\n\n id,\n details : this._files[id],\n\n // Lazily-compute compositions if they're asked for\n get exports() {\n return fileCompositions(this.details, self);\n },\n };\n }", "title": "" }, { "docid": "98b1793c16a2cba0a9eb7378d8703023", "score": "0.5048204", "text": "function collectFiles2Zip(doALL, doPDF, doTEX, doTMP, doMED, doEXTRA) {\n\tlet dirlist = [];\n\tlet filelist = [];\n\tlet promises = [];\n\tlet extradocs = [];\n\tlet records = getCurrentRecords();\n\n\t//callback to be run when PHP returns a list of contents for a given directory (when its promise is resolved)\n\tfunction fileCallback(promise) {\n\t\treturn function(d) {\n\t\t\tfilelist = filelist.concat(d.split(\",\"));\n\t\t\tpromise.resolve();\n\t\t}\n\t}\n\n\t//Compile directory lists to be sniffed. Concurrently compile a list of extra documents from the corresponding lab record.\n\t//First checks for a user sub selection of records. If no sub selection then it collects all rendered records.\n\tif ($(\"#zip-icon\").hasClass(\"active\")) {\n\t\tfor (let i = records.length - 1; i >= 0; i--) {\n\t\t\tif (records[i].children(\".lab-record-simple-flex\").children(\".fa-circle\").hasClass(\"selected\")) {\n\t\t\t\tdirlist.push(records[i].find(\".version-directory\").text());\n\t\t\t\textradocs.concat(getExtraDocsFromRecord(records[i]));\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor (let i = records.length - 1; i >= 0; i--) {\n\t\t\tdirlist.push(records[i].find(\".version-directory\").text());\n\t\t\textradocs.concat(getExtraDocsFromRecord(records[i]));\n\t\t}\n\t}\n\n\n\t//Create a promise for each directory to be resolved when PHP successfully returns a file list representing the contents of the directory\n\tfor (let i = dirlist.length - 1; i >= 0; i--) {\n\t\tlet promise = $.Deferred();\n\t\tpromises.push(promise);\n\t\t$.post(siteroot + \"/php/getFileListRecursive.php\", \"dirpath=\" + dirlist[i], fileCallback(promise));\n\t}\n\n\t//create a new promise to be resolved when all other promises are resolved\n\tlet deferredFileList = $.when.apply($, promises);\n\n\t//when PHP has finished sniffing all the files inside the directories and returned the file lists 'deferredFileList' is resolved\n\tdeferredFileList.done(function() {\n\t\tfilteredlist = filterFileList(doALL, doPDF, doTEX, doTMP, doMED, filelist);\n\t\tif(doEXTRA || doALL) {\n\t\t\tfilteredlist.concat(extradocs);\n\t\t}\n\t\tmakePromisesBeginZip(filteredlist);\n\t\tconsole.log(\"An elegant syntax for ease of use,\\neasy reading. Not abstruse.\\n\\nHaving this would sure be swell.\\nPHP can rot in hell.\")\n\t});\n\n\t//There is no graceful way to bail from this from a website functionality perspective.\n\t//If this promise fails the website should be considered broken so a simple console log is printed.\n\tdeferredFileList.fail(function() {console.log(\"File collection failed: Unable to locate files for selection.\")});\n\tconsole.log(\"Exiting CollectFiles2Zip\");\n}", "title": "" }, { "docid": "6109df0acc1b0f040bb25391dbde93ea", "score": "0.50416213", "text": "resolveRecursively(moduleResolveInfo) {\n this.fileStack.push(moduleResolveInfo.containingFile);\n this.resolveModuleScope(moduleResolveInfo);\n this.fileStack.pop();\n // resolve bodies of functions after the enclosing module has been resolved\n while (this.deferredFunctionsToResolve.length > 0) {\n let cb = this.deferredFunctionsToResolve.shift();\n cb();\n }\n }", "title": "" }, { "docid": "6e56a598e59d0d5f1b1056966e77db5b", "score": "0.5031323", "text": "function processFiles (files, minlen, logger, cb) {\n if (files.length === 0) { \n logger.info('Processing FASTA file: stdin with minlen %i', minlen)\n processFile(process.stdin, \"stdin\", minlen, logger, cb);\n return\n }\n\n for (idx in files) {\n file = files[idx]\n\n logger.info('Processing FASTA file: %s with minlen %i', file, minlen)\n\n // Read the file, pipe through the fasta parser, then through our filter, then output as appropriate\n processFile(fs.createReadStream(file), file, minlen, logger, cb);\n }\n}", "title": "" }, { "docid": "04035163ebbf071a5aa7cc8a09c3bca9", "score": "0.50220734", "text": "handleFiles(files) {\n const valids = this.getValidFiles(files);\n if (files.length != valids.length) {\n this.lastInvalids = this.getInvalidFiles(files);\n }\n else {\n delete this.lastInvalids;\n }\n this.lastInvalidsChange.emit(this.lastInvalids);\n if (valids.length) {\n if (this.ngfFixOrientation) {\n this.applyExifRotations(valids)\n .then(fixedFiles => this.que(fixedFiles));\n }\n else {\n this.que(valids);\n }\n }\n if (this.isEmptyAfterSelection()) {\n this.element.nativeElement.value = '';\n }\n }", "title": "" }, { "docid": "da5dbc1070a4892bc5a3d57ba8ae25d0", "score": "0.5020086", "text": "function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }", "title": "" }, { "docid": "60e774559dcbeb7fd9fe4f2c2d4e1f5d", "score": "0.50197834", "text": "function runThroughFiles(dir){\n\tglob(dir + \"/*.mp4\", function (err, files) {\n\t // files is an array of filenames.\n\t // If the `nonull` option is set, and nothing\n\t // was found, then files is [\"**/*.js\"]\n\t // er is an error object or null.\n\n\t if(err)\n\t \tconsole.log('-- ERROR GETTING FILES WITH GLOB --');\n\n\t console.log(files);\n\n\t // loop through filenames \t \n\t for(var i = 0; i < files.length; i++){\n\t \tvar filepath = files[i];\n\t \tvar index = filepath.lastIndexOf('/');\n\t \tvar ourId = filepath.substring(index + 1);\n\t \tconsole.log(ourId);\n\t\tvar testURL = 'http://' + process.env.IP_ADDR + process.env.PATH_TO_TAGGING_CLIPS + ourId;\n\n\t\t// make call to clarafai to get the tags for that certain video\n\t\tClarifai.tagURL(testURL , ourId, commonResultHandler);\n\t } \n\t});\n}", "title": "" }, { "docid": "6428a6fc612f189ca5373f438ae30316", "score": "0.5019753", "text": "function updateReferenceFile(files, generatedFiles, referenceFile, referencePath) {\n var referenceIntro = '/// <reference path=\"';\n var referenceEnd = '\" />';\n var referenceMatch = /\\/\\/\\/ <reference path=\\\"(.*?)\\\"/;\n var ourSignatureStart = '//grunt-start';\n var ourSignatureEnd = '//grunt-end';\n\n // remove the generated files from files:\n files = _.difference(files, generatedFiles);\n\n var lines = [];\n var origFileLines = [];\n var origFileReferences = [];\n\n // Location of our generated references\n // By default at start of file\n var signatureSectionPosition = 0;\n var i;\n\n // Put in the generated files\n generatedFiles = _.map(generatedFiles, function (file) {\n return referenceIntro + utils.makeRelativePath(referencePath, file) + referenceEnd;\n });\n var contents = utils.insertArrayAt([ourSignatureStart], 1, generatedFiles);\n\n // Iterate through files for constant file referencing/build order.\n // In TFS, local files are readonly in so TFS can handle them, when working in TEAMS it is not possible to include a dynamic, automatically created file in TFS as it is read only.\n // grunt will fail becuase of a file access error. Also, note that file ordering is a team wide resource and so it should be stored in a regenerated file.\n // The solution is using external files, the idea is the same as //grunt-start - //grunt-end but using files as prefix/suffix.\n // The implementation co-exists with the original solution, the files are added inside the dynamic file area to make everyone happy.\n // No settings needed, create 2 file with the same name as your master reference file and add \".prefix\" / \".suffix\" to thier name.\n // e.g: for master.ts create 2 files: master.prefix.ts & master.suffix.ts (You can also add one of them...)\n /* PRFIX FILE */\n if (fs.existsSync(i = referenceFile.replace(/\\.ts$/, '.prefix.ts'))) {\n // get list of its childs to register existing nested references.\n fs.readFileSync(i).toString().split('\\n').filter(function (f) {\n return _str.include(f, referenceIntro);\n }).map(function (f) {\n return f.match(referenceMatch)[1];\n }).forEach(function (f) {\n contents.push(referenceIntro + f + referenceEnd); // file should be already relative\n origFileReferences.push(f);\n });\n\n // mark this file so we wont include it\n origFileReferences.push(utils.makeRelativePath(referencePath, i));\n }\n origFileReferences = _.unique(origFileReferences);\n\n /* SUFFIX FILE */\n var suffixRef;\n if (fs.existsSync(i = referenceFile.replace(/\\.ts$/, '.suffix.ts'))) {\n suffixRef = [];\n\n // get list of its childs to register existing nested references.\n fs.readFileSync(i).toString().split('\\n').filter(function (f) {\n return _str.include(f, referenceIntro);\n }).map(function (f) {\n return f.match(referenceMatch)[1];\n }).forEach(function (f) {\n suffixRef.push(referenceIntro + f + referenceEnd); // file should be already relative\n origFileReferences.push(f);\n });\n\n // mark this file so we wont include it\n origFileReferences.push(utils.makeRelativePath(referencePath, i));\n }\n\n // Read the original file if it exists\n if (fs.existsSync(referenceFile)) {\n lines = fs.readFileSync(referenceFile).toString().split('\\n');\n\n var inSignatureSection = false;\n\n // By default our signature goes at end of file\n signatureSectionPosition = lines.length;\n\n for (i = 0; i < lines.length; i++) {\n var line = _str.trim(lines[i]);\n\n // Skip logic for our generated section\n if (_str.include(line, ourSignatureStart)) {\n // Wait for the end signature:\n signatureSectionPosition = i;\n inSignatureSection = true;\n continue;\n }\n if (_str.include(line, ourSignatureEnd)) {\n inSignatureSection = false;\n continue;\n }\n if (inSignatureSection) {\n continue;\n }\n\n // store the line\n origFileLines.push(line);\n\n // Fetch the existing reference's filename if any:\n if (_str.include(line, referenceIntro)) {\n var match = line.match(referenceMatch);\n var filename = match[1];\n origFileReferences.push(filename);\n }\n }\n }\n\n // Put in the new / observed missing files:\n files.forEach(function (filename) {\n // The file we are about to add\n var filepath = utils.makeRelativePath(referencePath, filename);\n\n // If there are orig references\n if (origFileReferences.length) {\n if (_.contains(origFileReferences, filepath)) {\n return;\n }\n }\n\n // Finally add the filepath\n contents.push(referenceIntro + filepath + referenceEnd);\n });\n\n if (suffixRef)\n contents = _.union(contents, suffixRef);\n\n contents.push(ourSignatureEnd);\n\n // Modify the orig contents to put in our contents\n var updatedFileLines = utils.insertArrayAt(origFileLines, signatureSectionPosition, contents);\n grunt.file.write(referenceFile, updatedFileLines.join('\\n'));\n\n // Return whether the file was changed\n if (lines.length === updatedFileLines.length) {\n var updated = false;\n for (i = 0; i < lines.length; i++) {\n if (lines[i] !== updatedFileLines[i]) {\n updated = true;\n }\n }\n return updated;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "649415b93d2a7ec78cb0b5c1040d8752", "score": "0.50169456", "text": "function findEnderPackageFiles(folder, details, cb) {\n var mainf = details.json.main.slice(2), // skip ./\n fn = path.join(folder, mainf);\n // make sure we have what we need\n if (!details.js) {\n details.js = [];\n }\n if (!details.other) {\n details.other = [];\n }\n if (!details.stats) {\n details.stats = {};\n }\n fs.stat(fn, function (err, stats) {\n if (err) {\n return cb(err);\n }\n var ffn = unWindowsifyPath(fn);\n details.stats[ffn] = stats;\n details.js.push(ffn);\n stats.details = details;\n cb(null, details);\n });\n}", "title": "" }, { "docid": "36fe1a09ded13819f5304c6fbf77c5ac", "score": "0.50152224", "text": "function addSelectedFiles() {\n let selectedStructure = [findStructure(project.value, structureObject)];\n if (!project.value) {\n alert(\"Enter path to project\");\n project.focus();\n return;\n }\n if (!extention.value) {\n alert(\"Enter extention\");\n extention.focus();\n return;\n }\n let links = getPathsbyExtention(extention.value, selectedStructure);\n links.forEach(appendFileToList);\n }", "title": "" }, { "docid": "31d6d583faa773c8d9a46550596afbf3", "score": "0.5013827", "text": "function computeFileInfos(srcDir) {\n\tvar walkSync = function (dir, filelist) {\n\t\tvar fs = fs || require('fs'),\n\t\t\tfiles = fs.readdirSync(dir);\n\t\tfilelist = filelist || {};\n\t\tfiles.forEach(function (file) {\n\t\t\tvar filename = path.join(dir, file);\n\n\t\t\tif (fs.statSync(filename).isDirectory()) {\n\t\t\t\tfilelist = walkSync(path.join(dir, file), filelist);\n\t\t\t} else {\n\t\t\t\tvar stats = fs.statSync(filename);\n\t\t\t\tvar fileSizeInBytes = stats[\"size\"];\n\n\t\t\t\t// remove dest dir from filename\n\t\t\t\tfilename = filename.substr(path.join(srcDir).length);\n\n\t\t\t\t// file type\n\t\t\t\tvar ext = path.extname(filename);\n\t\t\t\tvar type = '';\n\t\t\t\tif(['.jpeg', '.jpg', '.png', '.gif'].indexOf(ext) >= 0) {\n\t\t\t\t\ttype = 'image';\n\t\t\t\t} else if(['.json'].indexOf(ext) >= 0) {\n\t\t\t\t\ttype = 'json';\n\t\t\t\t} else if(['.html', '.txt'].indexOf(ext) >= 0) {\n\t\t\t\t\ttype = 'text';\n\t\t\t\t} else if(['.xml'].indexOf(ext) >= 0) {\n\t\t\t\t\ttype = 'xml';\n\t\t\t\t} else if(['.pack'].indexOf(ext) >= 0) {\n\t\t\t\t\ttype = 'arraybuffer';\n\t\t\t\t} else {\n\t\t\t\t\ttype = ext.substr(1);\n\t\t\t\t}\n\n\t\t\t\tfilelist[filename] = {\n\t\t\t\t\ttype: type,\n\t\t\t\t\tsize: fileSizeInBytes\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t\treturn filelist;\n\t};\n\n\treturn walkSync(srcDir, {});\n}", "title": "" }, { "docid": "20ec385c01243853562e05fc7ce8302c", "score": "0.501342", "text": "function traverse(basedir, dir, prefix, callback) {\n\tfs.readdir(path.join(basedir, dir), function(err, files) {\n\t\tif(err) { callback(null, []); return; } // ignore\n\t\tif(files.indexOf('HEAD') != -1 && files.indexOf('config') != -1) {\n\t\t\tvar base = dir.replace(/\\/?\\.git$/, '');\n\t\t\tvar repoName = path.join(prefix, base);\n\t\t\tconsole.log('Found repo: ' + repoName);\n\t\t\trepos[repoName] = new GitWatch(path.join(basedir, dir));\n\t\t\tnumRepos++;\n\t\t\trepos[repoName].addListener('open', function() {\n\t\t\t\tnumOpened++;\n\t\t\t\tif(finished && numRepos == numOpened) {\n\t\t\t\t\treadInitialCommits();\n\t\t\t\t}\n\t\t\t});\n\t\t\trepos[repoName].addListener('error', function(err) {\n\t\t\t\trepos[repoName].error = true;\n\t\t\t\tconsole.log(repoName + \": \" + err.toString());\n\t\t\t\tnumOpened++;\n\t\t\t\tif(finished && numRepos == numOpened) {\n\t\t\t\t\treadInitialCommits();\n\t\t\t\t}\n\t\t\t});\n\t\t\tcallback(null, []);\n\t\t} else {\n\t\t\tasync.map(files, function(file, callback) {\n\t\t\t\tif(file == '.git' || file[0] != '.' && exclude.indexOf(file) == -1)\n\t\t\t\t\ttraverse(basedir, path.join(dir, file), prefix, callback);\n\t\t\t\telse\n\t\t\t\t\tcallback(null, []);\n\t\t\t}, function(err, results) {\n\t\t\t\tif(err) throw err;\n\t\t\t\tcallback(null, Array.prototype.concat.apply([], results));\n\t\t\t});\n\t\t}\n\t});\n}", "title": "" }, { "docid": "700f8c9b803bc36ed52a82e3d8af7647", "score": "0.5012875", "text": "function getFiles(fileChange) {\n\t// get data from all paths in 'files' if no particular path has been received\n\tif (fileChange) {\n\t\treadFile(fileChange);\n\t} else {\n\t\tfor (let obj in files) {\n\t\t\t//skip if path has already been read\n\t\t\tif (files[obj].data) continue;\n\t\t\tconst path = files[obj].path;\n\t\t\treadFile(path);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "98cf5248ac0f6a8799f69a326a324c89", "score": "0.501193", "text": "function Watcher(root, files, ignore, cb){\n EventEmitter.call(this);\n \n if(_.isFunction(files)){\n cb = files;\n files = {};\n }\n \n if(_.isArray(files)){\n cb = ignore;\n ignore = files;\n files = {};\n }\n \n if(_.isFunction(ignore)){\n cb = ignore;\n ignore = undefined;\n }\n\n if(cb){\n this.on('changed', cb);\n }\n\n ignore = ignore || [];\n \n this.globs = [];\n for(var i=0;i<ignore.length;i++){\n this.globs.push(minimatch.filter(ignore[i], {}));\n }\n \n // maps filenames and etags {filename: {etag:etag, stats: stats, watcher:FSWatcher}}\n this.filesMeta = {};\n \n // Watch files specified by hand\n for(var key in files){\n setFileObserver(this, files[key], this.filesMeta);\n }\n \n // Traverse the directory structure and add directory (and file) watchers all along\n var _this = this;\n \n root = path.normalize(root);\n fs.stat(root, function(err, stats){\n if(stats){\n setObservers(_this, root, _this.filesMeta, stats, function(err){\n if(!err){\n for(var filepath in _this.filesMeta){\n updateEtag(filepath, _this.filesMeta);\n }\n _this.emit('initialized');\n }else{\n console.log(\"Setting observers:\"+err);\n }\n });\n }else{\n throw err;\n }\n })\n}", "title": "" }, { "docid": "4e2d727b7b5674817c9973e58ac86492", "score": "0.500972", "text": "function withJSFiles(p, cb) {\n if(hitErr()) return\n fs.readdir(p, (err, files) => {\n if(err) cb(err)\n else {\n for(let i = 0;i < files.length;i++) {\n let file = path.join(p, files[i])\n fs.stat(file, (err, stats) => {\n if(err) cb(err)\n else {\n if(stats.isDirectory()) {\n withJSFiles(file, cb)\n } else if(stats.isFile()) {\n if(file.endsWith(\".js\") || file.endsWith(\".json\")) cb(null, file)\n }\n }\n })\n }\n }\n })\n}", "title": "" }, { "docid": "9de1f4d11e86b1753ab23e8f9d19d3bb", "score": "0.50064653", "text": "function processFiles({ inputDirectory, outputFile }) {\n const postsDirectory = path.join(process.cwd(), inputDirectory)\n const filenames = fs.readdirSync(postsDirectory)\n \n Promise.all(filenames.map(async (filename) => {\n // only allow .json files\n if (!filename.endsWith('.json')) {\n return false\n }\n \n const filePath = path.join(postsDirectory, filename)\n const fileContents = fs.readFileSync(filePath, 'utf8')\n const jsonData = JSON.parse(fileContents)\n \n // parse / transform any contents\n if (jsonData.body) {\n jsonData.bodyHtml = (await remark().use(html).process(jsonData.body)).toString()\n }\n if (jsonData.date) {\n jsonData.dateFormatted = (new Date(jsonData.date)).toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' })\n }\n\n // write transformations back to original file\n fs.writeFileSync(filePath, JSON.stringify(jsonData, null, 2))\n \n return jsonData\n })).then(results => {\n const posts = results.filter(Boolean)\n\n // plump it up for performance testing\n // do {\n // [...posts].map(post => posts.push(post))\n // } while (posts.length < 5000)\n\n // sort\n posts.sort((a, b) => new Date(b.date) - new Date(a.date))\n \n const outputPath = path.join(process.cwd(), outputFile)\n fs.writeFileSync(outputPath, JSON.stringify(posts, null, 2))\n \n console.log([inputDirectory, outputFile].join(' -> '), posts.length)\n })\n}", "title": "" }, { "docid": "1ae696905018b131d7b621c46fc6228b", "score": "0.50037456", "text": "function mapper(){\n\tvar dirMap= {},\n\t depths= []\n\tfunction acceptFile(file){\n\t\tvar rel= path.relative(file.base, file.path),\n\t\t dir= path.dirname(rel),\n\t\t named= file.named|| path.basename(file.path),\n\t\t len= _len(dir)\n\n\t\tif(named == \"index.js\"){\n\t\t\t// add into parent's depth\n\t\t\tnamed= path.basename(dir)+path.sep+\"index.js\"\n\t\t\tdir= path.dirname(dir)\n\t\t}\n\n\t\t// add into dir\n\t\tvar files= dirMap[dir]|| (dirMap[dir]= [])\n\t\tif(files.indexOf(named) == -1){\n\t\t\tfiles.push(named)\n\t\t}\n\n\t\t// add into depths\n\t\tvar depth= depths[len]|| (depths[len]= [])\n\t\tif(depth.indexOf(dir) == -1){\n\t\t\tdepth.push(dir)\n\t\t}\n\t}\n\tacceptFile.dirMap= dirMap\n\tacceptFile.depths= depths\n\treturn acceptFile\n}", "title": "" }, { "docid": "70c5d4d327bf4ae11b88119acead719f", "score": "0.50007355", "text": "function process(filename, source) {\r\n try {\r\n if (util.isString(source) && source.charAt(0) === \"{\")\r\n source = JSON.parse(source);\r\n if (!util.isString(source))\r\n self.setOptions(source.options).addJSON(source.nested);\r\n else {\r\n parse.filename = filename;\r\n var parsed = parse(source, self, options),\r\n resolved,\r\n i = 0;\r\n if (parsed.imports)\r\n for (; i < parsed.imports.length; ++i)\r\n if (resolved = self.resolvePath(filename, parsed.imports[i]))\r\n fetch(resolved);\r\n if (parsed.weakImports)\r\n for (i = 0; i < parsed.weakImports.length; ++i)\r\n if (resolved = self.resolvePath(filename, parsed.weakImports[i]))\r\n fetch(resolved, true);\r\n }\r\n } catch (err) {\r\n finish(err);\r\n }\r\n if (!sync && !queued)\r\n finish(null, self); // only once anyway\r\n }", "title": "" }, { "docid": "2aae0cbc8d9dd1e8a11ab977acc0428f", "score": "0.49993336", "text": "function pathNodesForFile() {\n var tests = {\n '': [],\n 'index.js': [],\n 'some.path.js': ['some', 'path'],\n '1.3.spaces between.1.some_text': ['1', '3', 'spacesBetween', '1', 'someText'],\n 'some.really.long.path.here.that.might.cause.problem': \n ['some','really','long','path','here','that','might','cause','problem'],\n }\n\n // Test each case\n for (var input in tests) {\n var expectedOutput = tests[input]\n\n var pathNodes = RequireSmart.utils.pathNodesForFile(input)\n\n assert.deepEqual(expectedOutput, pathNodes)\n }\n}", "title": "" }, { "docid": "80bba06b4c55116a70cd10ab27154f4d", "score": "0.49991703", "text": "function processValuesFolder(path, callback) {\n\tdir.readFiles(path, {\n\t \tmatch: /\\.xml$/\n\t},\n\t\tfunction(err, content, filename, next) {\n\t \tif (err) throw err;\n\n\t\t\tif (getLastPathComponent(filename) == \"public.xml\") {\n\t\t\t\tnext();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\txml2js.parseString(content, { explicitArray: true }, function(err, result) {\n\t\t\t\tif (err) throw err;\n\n\t\t\t\tif (!result) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar resources = result.resources;\n\n\t\t\t\tif (!resources) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tprocessResourceXmlObj(resources);\n\t\t\t});\n\t\t\tnext();\n\t },\n\t function(err, files){\n\t if (err) throw err;\n\t\t\tcallback();\n\t });\n}", "title": "" }, { "docid": "92126fa6fdbbf40282d731ba731c84c5", "score": "0.49982962", "text": "resolveReferencedFiles(uri) {\n let observable = this.referencedFiles.get(uri);\n if (observable) {\n return observable;\n }\n observable = this.updater.ensure(uri)\n .concat(rxjs_1.Observable.defer(() => {\n const referencingFilePath = utilities_1.uri2path(uri);\n const config = this.getConfiguration(referencingFilePath);\n config.ensureConfigFile();\n const contents = this.inMemoryFs.getContent(uri);\n const info = preProcess_1.preProcessFile(contents);\n const compilerOpt = config.getHost().getCompilationSettings();\n // Iterate imported files\n return rxjs_1.Observable.from(info.importedFiles)\n .map(importedFile => moduleNameResolver_1.resolveModuleName(importedFile.fileName, utilities_1.toUnixPath(referencingFilePath), compilerOpt, this.inMemoryFs))\n .filter(resolved => !!(resolved && resolved.resolvedModule))\n .map(resolved => resolved.resolvedModule.resolvedFileName);\n }))\n .map(filePath => utilities_1.path2uri(filePath))\n .do(core_1.noop, (_err) => {\n this.referencedFiles.delete(uri);\n })\n .publishReplay()\n .refCount();\n this.referencedFiles.set(uri, observable);\n return observable;\n }", "title": "" }, { "docid": "993ab52fdf18e458e1050ce69f440a6f", "score": "0.4992135", "text": "ensureAllFiles() {\n if (this.ensuredAllFiles) {\n return;\n }\n this.init();\n if (this.getHost().complete) {\n return;\n }\n for (const fileName of this.expectedFilePaths) {\n this.getHost().addFile(fileName);\n }\n this.getHost().complete = true;\n this.ensuredAllFiles = true;\n }", "title": "" }, { "docid": "767960cece62b94404e4865301ca8f08", "score": "0.4988997", "text": "function WalkDirs(dirPath){\n fs.readdir(dirPath, function(err, files){\n var temp = 'I just got smarter!!!';\n var count = 1;\n for (var idx in files){\n if(files[idx].includes('.json')){\n var fullPath = Path.join(dirPath, files[idx]);\n count++;\n (function(fullPath){\n fs.readFile(fullPath, options, function(err, data){\n\t if(err) {\n\t\t console.log(\"\\nCould not open File this time\" + err);\n console.log(err);\n\t }\n\t else {\n var stuff = JSON.parse(data);\n for(var i=0; i< stuff.dictionary.length;i++){\n checkForNew(JSON.stringify(stuff.dictionary[i]));\n \n } \n\t } \n });\n })(fullPath);\n }\n }\n if(count > count1){\n count1=count;\n eventEmitter.emit('fileAdded');\n } \n });\n}", "title": "" } ]
e65d841989158dfc89c3e3d14c2c6ff8
When Signal is Ready
[ { "docid": "0b11fb489dedefa5695c1f73d319ec17", "score": "0.65245724", "text": "function signalReady(signal){\n\t\t\t\tnew RouteIterator(app.routes.header, signal, headersReady, 'header')\n\t\t\t}", "title": "" } ]
[ { "docid": "c45ade04910290a2369b6ef391ffad40", "score": "0.65308005", "text": "function signalReady() {\n Y.log( 'Received signal from server.js that express is ready.' );\n expressIsReady = true;\n boot();\n }", "title": "" }, { "docid": "967ef69875e9e9c0aebb2e8df5bf771d", "score": "0.65284497", "text": "[setReady$]() {\n if (!this[ready$]) {\n this[ready$] = true;\n this.emit('ready', this);\n }\n }", "title": "" }, { "docid": "7d657dc36d066a81279b5177163c3d12", "score": "0.6302247", "text": "ready() {}", "title": "" }, { "docid": "7d657dc36d066a81279b5177163c3d12", "score": "0.6302247", "text": "ready() {}", "title": "" }, { "docid": "7d657dc36d066a81279b5177163c3d12", "score": "0.6302247", "text": "ready() {}", "title": "" }, { "docid": "7d657dc36d066a81279b5177163c3d12", "score": "0.6302247", "text": "ready() {}", "title": "" }, { "docid": "7d657dc36d066a81279b5177163c3d12", "score": "0.6302247", "text": "ready() {}", "title": "" }, { "docid": "2699c729f900f9b75d19ffcc298e32d4", "score": "0.6296263", "text": "setReady() {\n this.ready = true\n TestClientReadyEmitter.emit('ready')\n }", "title": "" }, { "docid": "0a2a85e29ed6ccc639eb743fd8b382cc", "score": "0.6200058", "text": "connectedCallback() {\n this.__ready = true;\n }", "title": "" }, { "docid": "e9378c96bd0e3c470d745a33a05bd4e8", "score": "0.6187298", "text": "ready () {}", "title": "" }, { "docid": "a0d9b3dbdb6e46ba8a164fc9e9c03b65", "score": "0.6183187", "text": "function ready(){this._isAttached=true;this._isReady=true;this._callHook('ready');}", "title": "" }, { "docid": "cf43bb128e25f972b3583bb6b6d97721", "score": "0.6128444", "text": "_onOpen() {\n this.connected = true;\n this.emit(\"ready\");\n }", "title": "" }, { "docid": "62b913aeb9f2c76ded0c1495f11263c9", "score": "0.60982066", "text": "dataChannelStateChanged() {\n if (dataChannel.readyState === 'open') {\n this.displaySignalMessage(\"Data Channel open\")\n dataChannel.onmessage = receiveDataChannelMessage\n }\n }", "title": "" }, { "docid": "a396d973d4195d1394cd3ee405504fc6", "score": "0.6051816", "text": "ready() {\n super.ready();\n this.subscriptionService = new PushNotificationService();\n this.isSubscribed = this.subscriptionService.isSubscribed;\n }", "title": "" }, { "docid": "9d36e04fd5709968aadc7323fab683b8", "score": "0.60420436", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.60339046", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.60339046", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.60339046", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.60339046", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.60339046", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "55991e48b9dd40c235db31be79b42d0a", "score": "0.60339046", "text": "function ready() {\n\t this._isAttached = true;\n\t this._isReady = true;\n\t this._callHook('ready');\n\t }", "title": "" }, { "docid": "c8b37cb8d247acdc0353a32b8a719e60", "score": "0.60000783", "text": "function ready () {\n\t this._isAttached = true\n\t this._isReady = true\n\t this._callHook('ready')\n\t}", "title": "" }, { "docid": "6dcda872db46b386f8db6a4d82db804d", "score": "0.5995202", "text": "onSignal(event) {\n switch (event.type) {\n case \"call\": this.onCall(event.data); break;\n case \"call_response\": this.onCallResponse(event.data); break;\n case \"video_offer\": this.onVideoOffer(event.data); break;\n case \"video_answer\": this.onVideoAnswer(event.data); break;\n case \"new_ice_candidate\": this.onNewIceCandidate(event.data); break;\n case \"connection_status\": this.onConnectionStatus(event.data);\n }\n }", "title": "" }, { "docid": "be5eda320123f8796e45b24bfac3fe27", "score": "0.5992239", "text": "isReady () {\n this.ready = true\n }", "title": "" }, { "docid": "3bca7cdc391fb3d79aa122eb9612d670", "score": "0.5973571", "text": "function onready(subscribed) {\n if (subscribed) myconnection = true;\n if (!((mystream || oneway) && myconnection)) return;\n\n connectcb();\n readycb();\n }", "title": "" }, { "docid": "57a231b5efeced1e74764f9e62cfb1ae", "score": "0.5972395", "text": "markAsReady() {\n\t\tthis.unlock();\n\t}", "title": "" }, { "docid": "dcc4fba1ed947df06466039ec8073203", "score": "0.59667957", "text": "ready() {\n return this.channel.ready()\n }", "title": "" }, { "docid": "cac83b286f4b10276847b38e4e1b252a", "score": "0.596189", "text": "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "title": "" }, { "docid": "cac83b286f4b10276847b38e4e1b252a", "score": "0.596189", "text": "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "title": "" }, { "docid": "2e3270c7ede603ff217568cdc7d6ce92", "score": "0.5958103", "text": "function ready()\n{\n console.log(\"I'm ready\");\n socket.emit('readyRPS', socket.id);\n}", "title": "" }, { "docid": "f25b6eefb13258bcd324cb10a18c4977", "score": "0.59422725", "text": "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "title": "" }, { "docid": "f25b6eefb13258bcd324cb10a18c4977", "score": "0.59422725", "text": "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "title": "" }, { "docid": "f25b6eefb13258bcd324cb10a18c4977", "score": "0.59422725", "text": "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "title": "" }, { "docid": "f25b6eefb13258bcd324cb10a18c4977", "score": "0.59422725", "text": "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "title": "" }, { "docid": "f25b6eefb13258bcd324cb10a18c4977", "score": "0.59422725", "text": "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "title": "" }, { "docid": "f25b6eefb13258bcd324cb10a18c4977", "score": "0.59422725", "text": "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "title": "" }, { "docid": "8325e2ae41aa76958f0fd29bf085f7d1", "score": "0.59339154", "text": "setReady() {\n this.ready = true;\n this.readyQueue.forEach(cb => cb());\n this.resetReady();\n }", "title": "" }, { "docid": "02f5d8a7650184e282dfe56d7457cbaf", "score": "0.59335566", "text": "function ready() {\n this._isAttached = true;\n this._isReady = true;\n this._callHook('ready');\n }", "title": "" }, { "docid": "0ec40cb5976531663627eacfc1c222f0", "score": "0.59298193", "text": "_ready() {\n this.utils.dispatchEvent('ready', {\n bubbles: true,\n detail: this.data,\n });\n }", "title": "" }, { "docid": "c090745dcbe52457d155ea1aaa120137", "score": "0.5909577", "text": "listenSignals() {\n IDECore.listensSignals(\n Object.keys(this.signals),\n this.name\n );\n }", "title": "" }, { "docid": "54e03d6b5a8ab27ac7b5b9258668b5ac", "score": "0.5908419", "text": "function ready () {\n this._isAttached = true\n this._isReady = true\n this._callHook('ready')\n}", "title": "" }, { "docid": "d3071cc95fa0b023e6737786a5699853", "score": "0.5891853", "text": "async ready(){\n\n }", "title": "" }, { "docid": "a5ab93a4194f060df3f17a1127e5c2cd", "score": "0.5838797", "text": "notifyOn() {\n this.notify = true;\n }", "title": "" }, { "docid": "d07fb82bd40ee84b4b6fb47ce0ee7130", "score": "0.5810327", "text": "onReady() {\n logger.debug('onReady setup');\n this.rtm.on('ready', (event) => {\n logger.debug('Ready!');\n this.ready = true;\n });\n }", "title": "" }, { "docid": "eecaa90cbdd4f06ec75e81743f8a6de4", "score": "0.5804649", "text": "function handle(signal) {\n console.log(`${getMsg(\"RecievedSignal\")} ${signal}`);\n}", "title": "" }, { "docid": "82f7c088649d9a050882f82cc2c7ce5d", "score": "0.5783058", "text": "ready(handler) {\n this.onReady = handler;\n }", "title": "" }, { "docid": "fa1f0ffc71d5ac9c853d4fc939d9c1d9", "score": "0.57811636", "text": "_ready() {\n return new Promise((resolve) => {\n if (this.initted)\n resolve();\n else\n this.readySubs.push(resolve);\n });\n }", "title": "" }, { "docid": "0fef18abed02b8f564ccbe00db7aea3d", "score": "0.57639813", "text": "function onReady(func) {\n readyCallbacks.push(func);\n }", "title": "" }, { "docid": "8870b361e522fdbd967fef7c7eecbb26", "score": "0.5763768", "text": "get_signal()\n {\n return this.liveFunc._signal;\n }", "title": "" }, { "docid": "7d1bee2e8fec0385e0704b7a28977775", "score": "0.5750989", "text": "function signalSend(command)\n{\n\n}", "title": "" }, { "docid": "26150fca289893f602df4e64265e7552", "score": "0.57464004", "text": "ready() {\n }", "title": "" }, { "docid": "f3044de684be562efa4a2ce8ee840f20", "score": "0.5744645", "text": "get signal() {\n return this._signal;\n }", "title": "" }, { "docid": "9baac0dcea68cbc5224302616f7c5bf8", "score": "0.57405585", "text": "function initSignalConnection() {\n signalService.createConnection('Task', 'StatusChanged', connectionErrorCallback).then(function (signalConnection) {\n if (signalConnection.signalManager.isOpen) {\n vm.signalConnections['StatusChanged'] = signalConnection;\n loggerService.log('Connection has been established successfully. Connection State: ' + signalConnection.state());\n subscribeToStatusChanged();\n }\n else {\n loggerService.log('Wrong signal');\n }\n }, function (error) {\n //uiLogger.log('Error in opening a connection \\n' + angular.toJson(error, true));\n });\n signalService.createConnection('Task', 'MessageOnTaskReceived', connectionErrorCallback).then(function (signalConnection) {\n if (signalConnection.signalManager.isOpen) {\n vm.signalConnections['MessageOnTaskReceived'] = signalConnection;\n loggerService.log('Connection has been established successfully. Connection State: ' + signalConnection.state());\n subscribeToMessageOnTaskReceived();\n }\n else {\n loggerService.log('Wrong signal');\n }\n }, function (error) {\n //uiLogger.log('Error in opening a connection \\n' + angular.toJson(error, true));\n });\n signalService.createConnection('Task', 'ErrorCountChanged', connectionErrorCallback).then(function (signalConnection) {\n if (signalConnection.signalManager.isOpen) {\n vm.signalConnections['ErrorCountChanged'] = signalConnection;\n loggerService.log('Connection has been established successfully. Connection State: ' + signalConnection.state());\n subscribeToErrorCountChanged();\n }\n else {\n loggerService.log('Wrong signal');\n }\n }, function (error) {\n loggerService.log('Error in opening a connection \\n' + angular.toJson(error, true));\n });\n }", "title": "" }, { "docid": "02025422dc76a81362519ca2b33fc46f", "score": "0.5715919", "text": "subscribeForOneSignalNotifications() {\n \n this.getSubscriptionAndNotificationState()\n .then(this.subscribeOnNotification)\n }", "title": "" }, { "docid": "108912ca70358235e30b3d4e057a7456", "score": "0.570122", "text": "function Signal() {\n this._fns = [];\n}", "title": "" }, { "docid": "daf2a1c6b3e99c7767ec78aafa8720a5", "score": "0.56938857", "text": "registerEvents() {\n this.NewConnection()\n }", "title": "" }, { "docid": "f230d2356261956a0d4e2a328cb8d15b", "score": "0.5690379", "text": "_ready() {\n this.client.on(\"ready\", () => {\n console.log(\"Just saying im ready\");\n });\n }", "title": "" }, { "docid": "34ed5eb2d0b408e9ac2b87a15b16218c", "score": "0.56890434", "text": "init() {\n this.initialized = true;\n this.resubscribe();\n }", "title": "" }, { "docid": "642d3a81884431642bf37434727a6234", "score": "0.5683042", "text": "function OnSignalingClosed()\n {\n //Closed during init process? connection to the signaling probably failed\n if(mInitializing)\n {\n if(mInitTimeoutId != null)\n {\n clearTimeout(mInitTimeoutId);\n mInitTimeoutId = null;\n }\n mInitializing = false;\n //send out server closed event\n if(self.OnServerStartFailed != null)\n {\n self.OnServerStartFailed(self);\n }\n }\n \n //server was fully running -> send server stopped event\n if(mRunning)\n {\n mRunning = false;\n //send out server closed event\n if(self.OnServerStopped != null)\n self.OnServerStopped(self);\n }\n }", "title": "" }, { "docid": "d06904d2ea7fa447c62d15cf7f7e8564", "score": "0.5682856", "text": "function doSignal(){\n console.log('doSignal()');\n sig = new $xirsys.signal( '/webrtc', userName, {channel:channelPath} );\n sig.on('message', msg => {\n var pkt = JSON.parse(msg.data);\n console.log('signal message! ',pkt);\n var payload = pkt.p;//the actual message data sent \n var meta = pkt.m;//meta object\n var msgEvent = meta.o;//event label of message\n var toPeer = meta.t;//msg to user (if private msg)\n var fromPeer = meta.f;//msg from user\n if(!!fromPeer) {//remove the peer path to display just the name not path.\n var p = fromPeer.split(\"/\");\n fromPeer = p[p.length - 1];\n }\n\n switch (msgEvent) {\n //first connect, list of all peers connected.\n case \"peers\":\n //this is first call when you connect, \n // so we can check for channelPath here dynamically.\n var sysNum = meta.f.lastIndexOf('__sys__');\n if(sysNum > -1 && !channelPath){\n channelPath = meta.f.substring(0,sysNum);//save message path for sending.\n }\n setUsers(payload.users);\n initUI();\n break;\n //new peer connected\n case \"peer_connected\":\n addUser(fromPeer);\n break;\n //peer left.\n case \"peer_removed\":\n removeUser(fromPeer);\n break;\n //message received. Call to display.\n case 'message':\n onUserMsg(payload, fromPeer, toPeer);\n break;\n }\n });\n}", "title": "" }, { "docid": "89041c4775264c90777defe121d723f1", "score": "0.5673182", "text": "if (Signal.hasError(signal)) {\n try {\n this.onError(signal);\n this.next();\n } catch (err) {\n // you have an error when calling error handler :/\n console.error(err.message);\n this.next();\n }\n }", "title": "" }, { "docid": "6e4afcb79312a02f964bb4638b292297", "score": "0.56703895", "text": "async ready() {\r\n this.isReady = true;\r\n await this.emit(new events_1.PlayerReadyEvent(this.room, this));\r\n if (this.isme && !this.ishost) {\r\n await this.room.broadcast([new protocol_1.ReadyMessage(this.id)]);\r\n }\r\n }", "title": "" }, { "docid": "77c8a2ae2e5e971058ea55414a9df3df", "score": "0.56681055", "text": "onReady() {}", "title": "" }, { "docid": "7a8e0f28de6bb5a432577269596c7214", "score": "0.5665221", "text": "function emitSignalReceived(io, message) {\n io.sockets.emit('signal:received', {\n date: new Date().getTime(),\n value: message || 'Signal received.'\n })\n}", "title": "" }, { "docid": "7ecd7200cc9965cb756ae8413c65bda1", "score": "0.5664404", "text": "init() {\n\t\tthis.readyCount = 0;\n\t}", "title": "" }, { "docid": "91f719729a06486277aada1b30a90d3a", "score": "0.5662313", "text": "function markAsReady(err) {\r\n if (ready)\r\n return;\r\n ready = true;\r\n setupListeners();\r\n readyHandlers\r\n .list()\r\n .forEach(([resolve, reject]) => (err ? reject(err) : resolve()));\r\n readyHandlers.reset();\r\n }", "title": "" }, { "docid": "215e9100391a46947ab7762e53c84a3f", "score": "0.5617211", "text": "function markAsReady(err) {\n if (ready)\n return;\n ready = true;\n setupListeners();\n readyHandlers\n .list()\n .forEach(([resolve, reject]) => (err ? reject(err) : resolve()));\n readyHandlers.reset();\n }", "title": "" }, { "docid": "e5c7885a60a76e062f7146d604effaae", "score": "0.5605233", "text": "queue_ready_next(){\n mediator.queue.ready = true;\n mediator.next();\n }", "title": "" }, { "docid": "ae5c1919d639fd9a063cad5b0c2598c4", "score": "0.55713195", "text": "ready () {\n\n\t}", "title": "" }, { "docid": "cff9a7ceff067a2610c06a23b6e5c06a", "score": "0.5563265", "text": "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"onConnect\");\r\n client.subscribe(\"WorkState\", { qos: Number(2) });\r\n client.subscribe(\"Content\", { qos: Number(2) });\r\n client.subscribe(\"Sleep\", { qos: Number(2) });\r\n client.subscribe(\"outTopic\", { qos: Number(2) });\r\n }", "title": "" }, { "docid": "a80cb05daae6cc06a13ad1fe50adb8d7", "score": "0.55621266", "text": "async onReady() {\n // Reset adapter connection\n this.setState('info.connection', false, true);\n\n // Log configuration\n this.log.debug('WLANThermo IP: ' + this.config.wlanthermoIp);\n this.log.debug('Update interval: ' + this.config.updateInterval);\n\n // Adapter is up and running\n this.log.debug('Adapter is up and running');\n\n this.updateData();\n }", "title": "" }, { "docid": "2ee475ed16b72d23c8ec17225327846d", "score": "0.5560691", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"bus-api\"); //назва топіка\n client.subscribe(\"temp\");\n client.subscribe(\"humid\");\n client.subscribe(\"preasure\");\n client.subscribe(\"speed\");\n }", "title": "" }, { "docid": "414d474a88840667f7d5444c32f6cf37", "score": "0.55578226", "text": "onReady() {/* For override */}", "title": "" }, { "docid": "b842745e2069408bd72b87ac3a710500", "score": "0.5557463", "text": "get isReady() { return this._readyCallbacks.isReady; }", "title": "" }, { "docid": "fce50e2f6c75c8cf8b42a8ec0f6e60e9", "score": "0.5551415", "text": "function handleSignalingStateChangeEvent(event) {\n var sigState=myPeerConnection.signalingState;\n cb.log(\"*** WebRTC signaling state changed to: \" + sigState);\n cb.showAlert(\"ICE:\"+sigState);\n \n switch(sigState) {\n case \"closed\":\n closeCall();\n break;\n }\n }", "title": "" }, { "docid": "da041d4009b06fc58be28c6de1e46647", "score": "0.55437344", "text": "function onReady( func )\n\t{\n\t\treadyCallbacks.push( func );\n\t}", "title": "" }, { "docid": "9186ce26dab35999d24360dbf37f4cd4", "score": "0.55427176", "text": "_onSignalFired(sender, args) {\n clearTimeout(this._timer);\n this._sender = sender;\n this._args = args;\n this._timer = setTimeout(() => {\n this._activityStopped.emit({\n sender: this._sender,\n args: this._args\n });\n }, this._timeout);\n }", "title": "" }, { "docid": "156e95fced2ab0922b6ef71824cfc656", "score": "0.5541114", "text": "signal(signal, detail) {\n this.dispatchEvent(new CustomEvent(signal, {detail}));\n }", "title": "" }, { "docid": "b80f3cc51fd8de0effda390037d9282f", "score": "0.5536928", "text": "function handle(signal) {\r\n // console.log(`Received ${signal}`);\r\n}", "title": "" }, { "docid": "15b1c4adb6bd306774a6b80fdeaedfa8", "score": "0.55365366", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "15b1c4adb6bd306774a6b80fdeaedfa8", "score": "0.55365366", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "15b1c4adb6bd306774a6b80fdeaedfa8", "score": "0.55365366", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "15b1c4adb6bd306774a6b80fdeaedfa8", "score": "0.55365366", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "15b1c4adb6bd306774a6b80fdeaedfa8", "score": "0.55365366", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "15b1c4adb6bd306774a6b80fdeaedfa8", "score": "0.55365366", "text": "ready() {\n super.ready();\n }", "title": "" }, { "docid": "ede17828746a51a6157a739835582bf9", "score": "0.552105", "text": "addReadyEventListener() {\n\t\t//console.log('@sw_helper listening to ready event');\n\t\tnavigator.serviceWorker.ready.then((registration) => {\n\t\t\tthis.Worker = registration.active;\n\t\t\tthis.addMessageChannelEventListener();\n\t\t\t// send port to service worker\n\t\t\t//console.log('@sw_helper sending port to ServiceWorker');\n\t\t\tthis.Worker.postMessage(location.origin, [this.messageChannel.port2]);\n\t\t\tthis.version = this.version;\n\t\t}).catch((e) => {\n\t\t\tconsole.error(e);\n\t\t\tthis.version = 'n/a';\n\t\t});\n\t}", "title": "" }, { "docid": "05693ef8823b429907808fd39e5db995", "score": "0.5507465", "text": "function sendSignal() {\n var img = document.createElement(\"img\");\n var signalUri = \"/signal?json=\" + serializeStats(stats) + \"&nocache=\" + Math.floor(Math.random() * 1000000);\n img.setAttribute('style', 'display:none;');\n img.setAttribute('src', signalUri);\n document.getElementsByTagName(\"body\")[0].appendChild(img);\n\n global.PROBE_SIGNAL && global.PROBE_SIGNAL(stats);\n }", "title": "" }, { "docid": "04f8b6aeac91c39cc82a8680a832df7c", "score": "0.55053055", "text": "async onReady() {\n await this.setStateAsync('info.connection', { val: true, ack: true });\n this.log.info('Starting : ' + this.namespace);\n // delete not used / missing object in configuration\n this.deleteObjects();\n // add object from configuration.\n this.createObjects();\n // start socket server\n this.serverStart();\n // in this contactid all states changes inside the adapters namespace are subscribed\n // adapter.subscribeStates('*');\n }", "title": "" }, { "docid": "115844e4428a02e6493d3408c98f29c7", "score": "0.5502854", "text": "onReady() {\n this.wait();\n }", "title": "" }, { "docid": "e98a6c1aab9fd551c87705c7bfebd3a9", "score": "0.55002254", "text": "ready() {\n this.__dataReady = true;\n // Run normal flush\n this._flushProperties();\n }", "title": "" }, { "docid": "f452f7e8290593e10af72cd133bbba04", "score": "0.5498425", "text": "onReady(label, callback) {\n this.on(label, callback, true);\n }", "title": "" }, { "docid": "2a36dbd88c26d4ab61b0b8eaffeba2b4", "score": "0.54777664", "text": "function isReady() { janrain.ready = true; }", "title": "" }, { "docid": "d74733d986ae10531361f0c6768f6ca6", "score": "0.5476433", "text": "ready(){\n throw new Error('ready must be implemented');\n }", "title": "" }, { "docid": "21cb44a9891f8f302aabb04c59669857", "score": "0.5474757", "text": "_onConnected(){}", "title": "" }, { "docid": "53fc6791ae7b9aab44e3f75380a323ae", "score": "0.5472582", "text": "function rdm_analytics_add_this_ready(evt) {\n\t\tconsole.log(\"Add this ready\");\n\t\t\n\t\n\t}", "title": "" }, { "docid": "2c80e850109c07b483a746093d3b1926", "score": "0.54699236", "text": "notify(method, data) {\n // Sends a message to the connection server, no sensitive information should be passed through this method.\n this.signalingHandler.signal(method, data);\n }", "title": "" }, { "docid": "9fbd3a19db7f88e618d39f59a29f2a54", "score": "0.54685414", "text": "function ready() { timeout( function() {\n\t if (READY) return;\n\t READY = 1;\n\t each( READY_BUFFER, function(connect) { connect() } );\n\t}, SECOND ); }", "title": "" }, { "docid": "7cc8ceab05475fa6658e1e23ae4f2b95", "score": "0.54654247", "text": "OnReady()\n {\n }", "title": "" }, { "docid": "3a494a11690cf11a459e08d2f658ccf5", "score": "0.54654", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"/kpi\");\n}", "title": "" }, { "docid": "0acb3860bdcc5d8ad7b95c04809e2024", "score": "0.54513615", "text": "onConnectionReady() {\n // Flush pending messages\n const messages = this._pendingMessages;\n messages.forEach((options) => this.sendMessage(options));\n messages.clear();\n this._isReady = true;\n }", "title": "" } ]
2852c3d93986992c8dfa285059b5dbdb
flag is for the understanding of the selected time slot
[ { "docid": "33b2428209c34826efb06eded2512cf8", "score": "0.0", "text": "async graphDataGen(result: Array, flag){\n \n try {\n var trackerList = result.trackedData\n var serializedReferences = result.serializedReferences\n var selected_refs = {}\n var selected_type = false\n var categoryTrackers = []\n var graphdata = []\n var graphPopulation = []\n var timeMap = {}\n var yearMap = {}\n var formatter = ''\n var formatter_1 = ''\n var iterations = 0\n var iter = 0\n var dataSets = []\n var xArray = []\n var timeArray = []\n var blankArray = []\n var isMultiValue = 0\n var minVal = ''\n var maxVal = ''\n var isSingleVal = false\n\n trackerList.sort((a, b) =>{\n return new Date(a._source.reportDate) - new Date(b._source.reportDate)\n }).reverse()\n\n if(flag === 4){\n iter = 12\n formatter = 'MMM YYYY'\n formatter_1 = 'MMM'\n timeArray = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\n } else if(flag === 3){\n formatter = 'MMM YYYY'\n formatter_1 = 'D MMM YYYY'\n } else if (flag === 2 || flag === 1){\n formatter = 'ddd D MMM YYYY'\n formatter_1 = 'ddd D MMM YYYY'\n }\n\n trackerList.forEach((valInData) => {\n if(Number(valInData._source.dictionaryId) === Number(this.state.dictionaryId)){\n categoryTrackers.push(valInData)\n\n if(!(moment(valInData._source.reportDate).format(formatter) in timeMap)){\n if(valInData._source.value){\n if (!isNaN(valInData._source.value)){\n graphdata.push({\n y: Number(valInData._source.value),\n reportDate : moment(valInData._source.reportDate).format(formatter_1)\n })\n } else if(valInData._source.value.indexOf('/') !== -1){\n var value = valInData._source.value\n graphdata.push({\n y: valInData._source.value,\n unit : valInData._source.unit,\n reportDate : moment(valInData._source.reportDate)\n })\n isMultiValue = 1\n }\n\n if(flag === 4){\n if(!(moment(valInData._source.reportDate).format('YYYY') in yearMap)){\n iterations += iter;\n yearMap[moment(valInData._source.reportDate).format('YYYY')] = valInData\n }\n }\n timeMap[moment(valInData._source.reportDate).format(formatter)] = valInData\n }\n } else {\n if(flag !== 4){\n if(valInData._source.value){\n if (!isNaN(valInData._source.value)){\n graphdata.push({\n y: Number(valInData._source.value),\n reportDate : moment(valInData._source.reportDate).format(formatter_1)\n })\n } else if(valInData._source.value.indexOf('/') !== -1){\n var value = valInData._source.value\n graphdata.push({\n y: valInData._source.value,\n unit : valInData._source.unit,\n reportDate : moment(valInData._source.reportDate)\n })\n }\n }\n }\n }\n }\n })\n\n serializedReferences.forEach((val) => {\n if(val.dictionaryId === this.state.dictionaryId){\n selected_refs = val\n if(this.state.gender === 'Male'){\n minVal = val.maleLowerBound\n maxVal = val.maleUpperBound\n } else {\n minVal = val.femaleLowerBound\n maxVal = val.femaleUpperBound\n }\n\n if(!isNaN(minVal) && !isNaN(maxVal)){\n selected_type = true\n }\n }\n })\n\n if(isMultiValue === 1){\n var co_val;\n var iter = 0;\n var count_iter = 0\n var count = 0\n var multidata = {}\n var colors = [Color.tracker_secondary_vals, Color.tracker_vals]\n\n for (iter = 0; iter < graphdata.length; iter++){\n var val = graphdata[iter]\n var value = val.y.split('/')\n var unit = val.unit.split('/')\n while(count_iter < 2){\n if (!(moment(val.reportDate).format('YYYY-MM-DD') + '@' + unit[count_iter] in multidata)){\n if (value[count_iter] !== '' & value[count_iter] !== '-'){\n var multi_graphdata = []\n multi_graphdata.push({ x: count, y: Number(value[count_iter]), reportDate: moment(val.reportDate).toISOString() })\n multidata[moment(val.reportDate).format('YYYY-MM-DD') + '@' + unit[count_iter]] = {\n values: multi_graphdata,\n count: count,\n label: 'Company Dashed',\n config: {\n color: processColor(colors[count_iter]),\n drawFilled: true,\n reportDate: moment(val.reportDate).format('YYYY-MM-DD'),\n fillColor: processColor(colors[count_iter]),\n fillAlpha: 50,\n lineWidth: 2.5,\n drawCubicIntensity: 0.2,\n circleRadius: 5,\n drawCircles: true,\n circleColor: processColor(colors[count_iter]),\n drawCircleHole: true\n }\n }\n }\n } else {\n if (value[count_iter] !== '' & value[count_iter] !== '-'){\n var date_key = moment(val.reportDate).format('YYYY-MM-DD')\n var _key = date_key + '@' + unit[count_iter]\n multidata[_key].values.push({ x: multidata[_key].count, y: Number(value[count_iter]) , reportDate: moment(val.reportDate).toISOString() })\n }\n }\n count_iter++;\n }\n count += 1;\n count_iter = 0\n }\n\n var blankValueArray = [{y: 0}]\n // for (iter = 10; iter > 0; iter--){\n // blankValueArray.push(null)\n // }\n\n blankValueArray.push({y: 0})\n\n if (Object.keys(multidata).length === 0){\n if (flag !== 4){\n isEmptyDataFlag = true\n } else {\n this.setState({\n isStateRepFlag: true\n })\n this.checkCondition(0)\n return\n }\n }\n\n dataSets.push({\n values: blankValueArray,\n label: 'Company X',\n config: {\n lineWidth: 0,\n drawCircles: false,\n drawValues : false,\n highlightColor: processColor(Color.graphBackground),\n color: processColor(Color.graphBackground),\n drawFilled: false,\n fillAlpha: 50,\n drawHighlightIndicators: false,\n valueFormatter: ''\n }\n })\n\n var count = 0\n\n for (keys in multidata){\n if (multidata[keys].values.length > 2){\n var valueArray = []\n multidata[keys].values.sort((a, b) =>{\n return a.y - b.y\n })\n valueArray.push(multidata[keys].values[0])\n valueArray.push(multidata[keys].values[multidata[keys].values.length - 1])\n multidata[keys].values = valueArray\n }\n dataSets.push(multidata[keys])\n if(count === 0){\n if(flag === 2){\n xArray.push(moment(multidata[keys].config.reportDate).format('ddd'))\n } else if (flag === 1){\n xArray.push(moment(multidata[keys].config.reportDate).format('DD MMM'))\n } else if(flag === 3){\n xArray.push(moment(multidata[keys].config.reportDate).format(formatter_1))\n } else {\n xArray.push(multidata[keys].config.reportDate)\n }\n count++\n } else {\n count = 0\n }\n }\n\n} else {\n if(flag !== 4){\n timeArray = [];\n iterations = 0\n if(categoryTrackers.length > 1){\n//something new trial\n timeArray = []\n var year = moment(categoryTrackers[categoryTrackers.length - 1]._source.reportDate).format('YYYY')\n var month = moment(categoryTrackers[categoryTrackers.length - 1]._source.reportDate).format('M')\n\n var end_year = moment(categoryTrackers[0]._source.reportDate).format('YYYY')\n var end_month = moment(categoryTrackers[0]._source.reportDate).format('M')\n\n startDate = moment([year, month - 1]);\n var end_startDate = moment([end_year, end_month - 1]);\n endDate = moment(end_startDate).endOf('month');\n\n timeArray.push(moment(startDate).format(formatter_1))\n while(startDate.add(1, 'days').diff(endDate) < 0) {\n timeArray.push(moment(startDate.clone().toDate()).format(formatter_1));\n }\n } else if(categoryTrackers.length === 1){\n isSingleVal = true\n // var year = moment(categoryTrackers[0]._source.reportDate).format('YYYY')\n // var month = moment(categoryTrackers[0]._source.reportDate).format('M')\n // var startDate = ''\n // var endDate = ''\n // if(flag === 3){\n // startDate = moment([year, month - 1]);\n // endDate = moment(startDate).endOf('month');\n // } else if(flag === 2){\n // startDate = moment(categoryTrackers[0]._source.reportDate).isoWeekday(1)\n // endDate = moment(categoryTrackers[0]._source.reportDate).isoWeekday(8)\n // } else if(flag === 1){\n // startDate = moment(categoryTrackers[0]._source.reportDate).subtract(4,'d')\n // endDate = moment(categoryTrackers[0]._source.reportDate).add(3,'d')\n // }\n //\n // timeArray.push(moment(startDate.clone().toDate()).format(formatter_1));\n // while(startDate.add(1, 'days').diff(endDate) < 0) {\n // timeArray.push(moment(startDate.clone().toDate()).format(formatter_1));\n // }\n }\n\n console.log('DATE FOR THE MONTH', timeArray);\n\n timeArray.reverse()\n iterations = timeArray.length\n\n }\n\n if(categoryTrackers.length === 1){\n isSingleVal = true\n }\n\n var count = 0\n var timeCount = -1\n var xpoints = 0\n var xArray = []\n for(var i = 0 ; i < iterations ; i++){\n if(flag === 4){\n if(timeCount < iter - 1){\n timeCount++\n } else {\n timeCount = 0\n }\n } else {\n timeCount ++;\n }\n if(graphdata[count]){\n if(graphdata[count].reportDate === timeArray[timeCount]){\n graphPopulation.push({\n x: xpoints,\n y: graphdata[count].y\n })\n count++\n } else {\n graphPopulation.push(null)\n }\n } else {\n graphPopulation.push(null)\n }\n\n xpoints++\n blankArray.push({y:0})\n if(flag === 2){\n xArray.push(moment(timeArray[timeCount]).format('ddd'))\n } else if (flag === 1){\n xArray.push(moment(timeArray[timeCount]).format('DD MMM'))\n } else if(flag === 3){\n xArray.push(moment(timeArray[timeCount]).format(formatter_1))\n } else {\n xArray.push(timeArray[timeCount])\n }\n }\n\n dataSets.push({\n values: blankArray,\n label: 'Company X',\n config: {\n lineWidth: 0,\n drawCircles: false,\n drawValues : false,\n highlightColor: processColor(Color.graphBackground),\n color: processColor(Color.graphBackground),\n drawFilled: false,\n fillAlpha: 50,\n drawHighlightIndicators: false,\n valueFormatter: ''\n }\n })\n\n dataSets.push({\n values: graphPopulation,\n // values: [, , , , , , , , , , , , ,{x: 251, y: 100}, {y: 110}, {y: 105}, {y: 115}],\n label: 'Company Dashed',\n config: {\n color: processColor(this.state.accentColor),\n drawFilled: true,\n fillColor: processColor(this.state.accentColor),\n fillAlpha: 50,\n lineWidth: 2.5,\n drawCubicIntensity: 0.2,\n circleRadius: 5,\n drawCircles: true,\n drawHighlightIndicators: false,\n circleColor: processColor(this.state.accentColor),\n drawCircleHole: true\n }\n })\n }\n\n var lastTracker = ''\n var highlightedValue = ''\n var highlightedUnit = ''\n var highlightedDate = ''\n var currentParameter = ''\n var accentColor = ''\n var icon = ''\n var currentDescription = ''\n var categoryName = ''\n\n if(categoryTrackers.length > 0){\n lastTracker = categoryTrackers[0]._source\n highlightedValue = lastTracker.value;\n highlightedUnit = lastTracker.unit;\n highlightedDate = lastTracker.reportDate;\n currentParameter = lastTracker.dictionaryName;\n accentColor = lastTracker.accentColor;\n icon = lastTracker.categoryIcon;\n currentDescription = lastTracker.dictionaryDescription;\n categoryName = lastTracker.dictionaryCategoryName\n }\n\n var category = {\n graphDataSection: [''],\n tracker_multivalArray: categoryTrackers\n }\n\n var dictionaryId = this.state.dictionaryId\n\n this.setState(\n // reactAddonsUpdate(this.state,\n {\n trackervalArray: result,\n data: (isMultiValue !== 1) ? (categoryTrackers.length > 1) ? {dataSets: dataSets} : {} : {dataSets: dataSets},\n isEmpty: (categoryTrackers.length > 0) ? false : true,\n isSingleVal: isSingleVal,\n selected_refs: selected_refs,\n selected_type: selected_type,\n xAxis: {\n startAtZero: true,\n valueFormatter: (this.state.filter_date_flag && xArray),\n position: 'BOTTOM',\n textSize: 7,\n drawGridLines: false\n },\n yAxis: {\n startAtZero: true,\n drawGridLines: false\n },\n rightAxis: {\n drawAxisLine: false,\n enabled: false,\n drawGridLines: false,\n drawLabels: false,\n position: 'LEFT'\n },\n isGraphReady: true,\n graphdata: graphdata,\n // tickvalues: tickArray,\n isStateRepFlag: (categoryTrackers.length > 0) ? false : true,\n isLoading: false,\n highlightedValue: highlightedValue,\n highlightedUnit: highlightedUnit,\n highlightedDate: highlightedDate,\n currentParameter: currentParameter,\n currentDescription: currentDescription,\n categoryName: categoryName,\n accentColor: (accentColor) ? '#' + accentColor : Color.tracker_vals,\n categoryTrackers: categoryTrackers,\n isMultiValue: isMultiValue,\n minVal: minVal,\n maxVal: maxVal,\n dataSource: ds.cloneWithRowsAndSections(category)\n }\n // )\n )\n } catch (error) {\n console.error(error);\n }\n }", "title": "" } ]
[ { "docid": "fe7e198953317478fc768e4486a19fc9", "score": "0.64933", "text": "timeslotClicked(day, slot) {\n this.setState((state) => {\n const updatedSelected = { ...state.selected };\n updatedSelected[`${day},${slot}`] = !state.selected[`${day},${slot}`];\n return { selected: updatedSelected };\n });\n }", "title": "" }, { "docid": "16b45cef74b5cc3976bd521fcbf277f9", "score": "0.63053024", "text": "timeslotSelected(day, slot) {\n this.setState((state) => {\n const updatedSelected = { ...state.currentSelected };\n updatedSelected[`${day},${slot}`] = true;\n return { currentSelected: updatedSelected };\n });\n }", "title": "" }, { "docid": "11acaacdfb93e39f0493e980a15fdf0f", "score": "0.6188213", "text": "function setTaskTime(currentNumber){\n\t//get current time\n\tlet theDate = new Date();\n\tlet theDay= theDate.getDate();\n\tlet theHour = theDate.getHours();\n \n\tvar startTime=currentNumber.toString().padStart(2, \"0\");\n\tvar endTime;\n var startTimeDigital=Number(startTime.substring(0,2));\n\n\t//set the options range of start time\n\tfor (let i=theHour; i <24;i++){\n\t\tlet hrStr = i.toString().padStart(2, \"0\") + \":\";\n\t\tlet val=hrStr+\"00\";\n\t\t $('#starthour').append('<option val=\"' + val + '\">' + val + '</option>');\n\n\t} \n //set the options range of end time\n for (let i=startTimeDigital+1; i <24;i++){\n let hrStr = i.toString().padStart(2, \"0\") + \":\";\n let val=hrStr+\"00\";\n $('#endhour').append('<option val=\"' + val + '\">' + val + '</option>');\n } \n \n //set default value\n let clickedNumber= currentNumber.toString().padStart(2, \"0\") + \":00\";\n console.log(\"clickedNumber: \"+clickedNumber);\n // $(\"#starthour\").find(\"option[text=clickedNumber]\").attr(\"selected\",\"selected\");\n // $(\"#starthour option[value='09:00']\").attr(\"selected\",true)\n\tfor(let i=0; i <$('#starthour').children('option').length;i++){\n\t\t// console.log($('#starthour').children('option')[i].value);\n\t\tif($('#starthour').children('option')[i].value==clickedNumber){\n\t\tconsole.log(\"bingo\");\n\t\t$('#starthour').children('option')[i].selected=true;\n\n $('#endhour').empty();//must clear fist\n \tfor (let i=currentNumber+1; i <=24;i++){\n\t\tlet hrStr = i.toString().padStart(2, \"0\") + \":\";\n\t\tlet val=hrStr+\"00\";\n\t\t$('#endhour').append('<option val=\"' + val + '\">' + val + '</option>');}\n \n\t\t}\n\t}\n\t selectStartTime=currentNumber;\n selectEndTime=currentNumber+1;\n console.log(\"selectStartTime: \"+selectStartTime+\", selectEndTime: \"+selectEndTime);\t\n\n //add option change event to start time selection box\n //if start time changed, the end time will start from startTime+1\n //so it will never happen that end time is bigger than start time ^_^\n $('#starthour').on('change',function(e){\n \tvar ev = e||window.event;\n var target = ev.target||ev.srcElement;\n startTime=target.value;\n console.log(\"target startTime: \"+startTime);\n \n //change the endhour according to the start time\n $('#endhour').val((Number(startTime.substring(0,2))+1).toString().padStart(2, \"0\") + \":\"+\"00\");\n\n //adjust the range of the end time\n var startTimeDigital=Number(startTime.substring(0,2));\n console.log(\"startTimeDigital1: \"+startTimeDigital)\n $('#endhour').empty();//must clear first\n \tfor (let i=startTimeDigital+1; i <=24;i++){\n\t\tlet hrStr = i.toString().padStart(2, \"0\") + \":\";\n\t\tlet val=hrStr+\"00\";\n\n\t\t $('#endhour').append('<option val=\"' + val + '\">' + val + '</option>');\n\t} \n \n //update the two global variables\n selectStartTime=Number(startTime.substring(0,2));\n selectEndTime=Number(startTime.substring(0,2))+1;\n console.log(\"selectStartTime: \"+selectStartTime+\", selectEndTime: \"+selectEndTime);\n }); \n \n}", "title": "" }, { "docid": "9c7c8cb5be7c5ea404b3f2748c780842", "score": "0.6049182", "text": "isSegmentSelection() {\n return this.timeSelection.start !== this.timeSelection.end;\n }", "title": "" }, { "docid": "f4ebbeba349c0c3556c9e32ca1fbdf05", "score": "0.60091066", "text": "selectTime(time) {\n if (this.state.isSelecting === 'startDate') { // select first time\n this.setState({\n startDate: time,\n endDate: time,\n isSelecting: 'endDate',\n hoverTime: time,\n }, this.dateCallback);\n } else if (this.state.isSelecting === 'endDate') { // select second time\n let { startDate, endDate } = this.state;\n if (startDate > time) {\n endDate = startDate;\n startDate = time;\n } else {\n endDate = time;\n }\n this.setState({\n startDate,\n endDate,\n isSelecting: '',\n showCalendar: false,\n }, this.dateCallback);\n }\n }", "title": "" }, { "docid": "e7185bdafa88090fd051c944b76543ca", "score": "0.59533346", "text": "function is_logically_valid_time_slot(ts){\n\tlet duration = ts.end - ts.start;\n\tif(duration<=0){\n\t\treturn false;\n\t}\n\n\tif(ts.start<0){\n\t\treturn false;\n\t}\n\n\tif(ts.end>24){\n\t\treturn false;\n\t}\n\n\treturn true;\n\n}", "title": "" }, { "docid": "bf9c7bff81ff1606876fb01ac1e4b52d", "score": "0.59325343", "text": "function bedTime9() {\r\n\t\t\tif(_.find(ProfileView)) {\r\n\r\n\t\t\t\tvar bedTime = User_questions.BedTime;\r\n\t\t\t\t\tif(bedTime == \"9-10pm\"){\r\n\t\t\t\t\treturn \"active\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t }\r\n\t\t}", "title": "" }, { "docid": "f6a4f67bfbbe84cffbda28209a5742a9", "score": "0.5864455", "text": "getSelectedTime(event) {\n let totalminutes = event.value;\n console.log(\"getSelectedtime\" + totalminutes);\n let hours = Math.floor(parseInt(totalminutes) / 60);\n let minutes = parseInt(totalminutes) % 60;\n let minutesSTR = String(minutes).padStart(2, \"0\");\n let hoursSTR = String(hours).padStart(2, \"0\");\n this.timeFromSlider = hoursSTR + \":\" + minutesSTR;\n this.configForEES.time = this.timeFromSlider;\n this.currentJob.filterFireLayers(totalminutes);\n this.currentJob.filterPopulationLayers(totalminutes);\n let date = new Date();\n if (parseInt(minutesSTR) > 0 && parseInt(minutesSTR) < 15) {\n minutesSTR = \"00\";\n }\n if (parseInt(minutesSTR) > 15 && parseInt(minutesSTR) < 30) {\n minutesSTR = \"15\";\n }\n if (parseInt(minutesSTR) > 30 && parseInt(minutesSTR) < 45) {\n minutesSTR = \"30\";\n }\n if (parseInt(minutesSTR) > 45 && parseInt(minutesSTR) < 60) {\n minutesSTR = \"45\";\n }\n date.setHours(parseInt(hoursSTR));\n date.setMinutes(parseInt(minutesSTR));\n date.setSeconds(0);\n this.selectedMessageSendTime = date;\n }", "title": "" }, { "docid": "9d37ca7be87e1a5b8b4e0e1203cc2765", "score": "0.5859258", "text": "function findSlot(start, end){\n if(start == '09:30:00' && end == '10:30:00')\n return 'one';\n if(start == '10:30:00' && end == '11:30:00')\n return 'two';\n if(start == '11:30:00' && end == '12:30:00')\n return 'three';\n if(start == '01:15:00' && end == '02:15:00')\n return 'four';\n if(start == '02:15:00' && end == '03:15:00')\n return 'five';\n if(start == '03:15:00' && end == '04:15:00')\n return 'six';\n if(start == '04:15:00' && end == '05:15:00')\n return 'seven';\n else if(start == '09:30:00' && end == '11:30:00')\n return 'one-two';\n else if(start == '10:30:00' && end == '12:30:00')\n return 'two-three';\n else if(start == '01:15:00' && end =='03:15:00')\n return 'four-five';\n else if(start=='02:15:00' && end == '04:15:00')\n return 'five-six';\n else if(start=='03:15:00' && end == '05:15:00')\n return 'six-seven';\n else\n return '';\n}", "title": "" }, { "docid": "eb0d694c8fd8e6cc502447a8aaa398dc", "score": "0.5840726", "text": "function setReserveTimes() {\n if (ROOM_NAME.value == '' && first_checked != null) {\n START_INPUT.value = first_checked.value;\n\n let today = new Date();\n let time = START_INPUT.value.split(':');\n today.setHours(time[0])\n let min = parseInt(time[1]) + MAX_INCREMENT_MINS;\n today.setMinutes(min);\n let hh = today.getHours()\n let mm = today.getMinutes();\n if (mm < 10) { mm = '0' + mm; }\n\n let endtime = hh + ':' + mm;\n END_INPUT.value = endtime;\n incremented_endTime = endtime;\n\n START_INPUT.style.visibility = 'visible';\n END_INPUT.style.visibility = 'visible';\n } else {\n let endtime = second_checked.value;\n END_INPUT.value = endtime;\n checkboxVal_endTime = endtime;\n }\n}", "title": "" }, { "docid": "9b6390047a3edafd5b5ef1f0f155f21c", "score": "0.5833968", "text": "enableTimeModify() {\n const { time } = this.state;\n if (time) {\n this.setState({ modify: true });\n }\n }", "title": "" }, { "docid": "9972b314e50dea537881e60b9103a225", "score": "0.58321166", "text": "function modeControl () {\n var mode = document.getElementById('TimeMode').value\n if (mode == 12) {\n militaryTime = false\n drawEvents(false)\n } else {\n militaryTime = true\n drawEvents(false)\n }\n}", "title": "" }, { "docid": "f7d0c54c5e729438521c58567ea0365b", "score": "0.57965", "text": "function setupStartAndEndTimeFields($startTimeField, $endTimeField, calEvent, timeslotTimes) {\n\n var freeTimeSlots = [];\n\n var terminiDan = [];\n $.each(allTerms, function (index, term) {\n if (term.start.getDate() == calEvent.start.getDate()) {\n terminiDan.push(term);\n }\n });\n\n var zauzet;\n\n // New event\n if (calEvent.id == null) {\n for (var i = 0; i < timeslotTimes.length; i++) {\n zauzet = false;\n for (var j = 0; j < terminiDan.length; j++) {\n var diffStart = terminiDan[j].start.getTime() - timeslotTimes[i].start.getTime();\n var diffEnd = terminiDan[j].end.getTime() - timeslotTimes[i].start.getTime();\n\n if (diffStart == 0 || (diffStart < 0 && diffEnd > 0)) {\n zauzet = true;\n }\n }\n if (!zauzet) {\n freeTimeSlots.push(timeslotTimes[i]);\n }\n }\n freeTimeSlots = $.grep(freeTimeSlots, function (el) {\n\n for (var i = 0; i < terminiDan.length; i++) {\n if (el.end.getTime() == terminiDan[i].start.getTime()) {\n return false;\n }\n }\n\n // do your normal code on el\n\n return true; // keep the element in the array\n });\n }\n\n else {\n // Edit event\n for (var i = 0; i < timeslotTimes.length; i++) {\n if (calEvent.start.getTime() == timeslotTimes[i].start.getTime() ||\n (calEvent.start.getTime() < timeslotTimes[i].start.getTime() && timeslotTimes[i].start.getTime() < calEvent.end.getTime() )) {\n freeTimeSlots.push(timeslotTimes[i]);\n }\n else {\n zauzet = false;\n for (var j = 0; j < terminiDan.length; j++) {\n var diffStart = terminiDan[j].start.getTime() - timeslotTimes[i].start.getTime();\n var diffEnd = terminiDan[j].end.getTime() - timeslotTimes[i].start.getTime();\n\n if (diffStart == 0 || (diffStart < 0 && diffEnd > 0)) {\n zauzet = true;\n }\n }\n if (!zauzet) {\n freeTimeSlots.push(timeslotTimes[i]);\n }\n\n }\n\n }\n\n freeTimeSlots = $.grep(freeTimeSlots, function (el) {\n\n if (el.end.getTime() != calEvent.start.getTime()) {\n for (var i = 0; i < terminiDan.length; i++) {\n if (el.end.getTime() == terminiDan[i].start.getTime()) {\n return false;\n }\n }\n }\n // do your normal code on el\n\n return true; // keep the element in the array\n });\n }\n\n\n // StartField\n for (var i = 0; i < freeTimeSlots.length; i++) {\n var startTime = freeTimeSlots[i].start;\n var startSelected = \"\";\n if (startTime.getTime() === calEvent.start.getTime()) {\n startSelected = \"selected=\\\"selected\\\"\";\n }\n if (!(startTime.getHours() == 21 && startTime.getMinutes() == 45)) {\n $startTimeField.append(\"<option value=\\\"\" + startTime + \"\\\" \" + startSelected + \">\" + freeTimeSlots[i].startFormatted + \"</option>\");\n }\n\n }\n\n // Endfield\n for (var i = 0; i < timeslotTimes.length; i++) {\n var endTime = timeslotTimes[i].end;\n var endSelected = \"\";\n if (endTime.getTime() === calEvent.end.getTime()) {\n endSelected = \"selected=\\\"selected\\\"\";\n }\n $endTimeField.append(\"<option value=\\\"\" + endTime + \"\\\" \" + endSelected + \">\" + timeslotTimes[i].endFormatted + \"</option>\");\n\n }\n $endTimeOptions = $endTimeField.find(\"option\");\n $startTimeField.trigger(\"change\");\n }", "title": "" }, { "docid": "be84d642b832b4b83abb72c7448e2c15", "score": "0.57947296", "text": "isSelected(date) {\n const { startDate, endDate, hoverTime } = this.state;\n const timeArr = [startDate, endDate];\n if (hoverTime) timeArr.push(hoverTime);\n if (date > min(timeArr) && date < max(timeArr)) {\n return 'selected';\n } else if (date === min(timeArr) || date === max(timeArr)) {\n return 'start-or-end-selected';\n }\n return '';\n }", "title": "" }, { "docid": "98deda09b8ca7f7b9ec04b66b38b01af", "score": "0.5789104", "text": "onTimeSelected(ev) {\n const selected = new Date(ev.selectedTime);\n this.event.startTime = selected.toISOString();\n selected.setHours(selected.getHours() + 1);\n this.event.endTime = (selected.toISOString());\n }", "title": "" }, { "docid": "98deda09b8ca7f7b9ec04b66b38b01af", "score": "0.5789104", "text": "onTimeSelected(ev) {\n const selected = new Date(ev.selectedTime);\n this.event.startTime = selected.toISOString();\n selected.setHours(selected.getHours() + 1);\n this.event.endTime = (selected.toISOString());\n }", "title": "" }, { "docid": "8c2d9cd6a77c6fd6c0687c7c2ece17b5", "score": "0.5771245", "text": "checkChangedTime() {\n\n if(this.futureTime > 0) {\n fill(255);\n textSize(50);\n text(parseInt(this.futureTime / 100), width - 100,50);\n this.futureTime--;\n if(this.futureTime == 1){ this.changeTimelinesSound.play(); }\n }\n else {\n this.inPresent = true;\n }\n }", "title": "" }, { "docid": "21f69e490f5a80614636f543562c22a2", "score": "0.5742528", "text": "function pickAM(thing) {\n app.isAMactive = true;\n app.isPMactive = false;\n app.isAllDayactive = false;\n chosenTimeofDay = 'am'\n getSWITRSinfo();\n if (selectedIntersection){\n\tcreateChart();\n } else {\n\tshowYearlyChart();\n }\n}", "title": "" }, { "docid": "d10a6fa17f1626f09409cd5daf6dc4c7", "score": "0.5719885", "text": "function findSlot (start, end) {\n if (start == '09:30:00' && end == '10:30:00') return 'one';\n if (start == '10:30:00' && end == '11:30:00') return 'two';\n if (start == '11:30:00' && end == '12:30:00') return 'three';\n if (start == '01:15:00' && end == '02:15:00') return 'four';\n if (start == '02:15:00' && end == '03:15:00') return 'five';\n if (start == '03:15:00' && end == '04:15:00') return 'six';\n if (start == '04:15:00' && end == '05:15:00') return 'seven';\n else if (start == '09:30:00' && end == '11:30:00') return 'one-two';\n else if (start == '10:30:00' && end == '12:30:00') return 'two-three';\n else if (start == '01:15:00' && end == '03:15:00') return 'four-five';\n else if (start == '02:15:00' && end == '04:15:00') return 'five-six';\n else if (start == '03:15:00' && end == '05:15:00') return 'six-seven';\n else return '';\n}", "title": "" }, { "docid": "fb38eaaf01804ac1af2e4a72fb26ef80", "score": "0.57178265", "text": "function currentSchedule() {\n var currentTime = moment().hours();\n\n $(\".time-block\").each(function () {\n var scheduleHour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n\n console.log(scheduleHour);\n\n if (currentTime > scheduleHour) {\n $(this).removeClass(\"future present\"); \n $(this).addClass(\"past\");\n }\n\n else if (currentTime === scheduleHour) {\n $(this).removeClass(\"past future\");\n $(this).addClass(\"present\");\n }\n else if (currentTime < scheduleHour) {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n }\n\n });\n }", "title": "" }, { "docid": "b6274a95dd1a3c55e8a9d578889aac9c", "score": "0.57098", "text": "function C17271_Different_times_in_a_single_reservation(){\ntry\n {\n Log.AppendFolder(\"C17271_Different_times_in_a_single_reservation\");\n var groupNm=defaultGroupName; \n var keyWordNm =\"Reservations\";\n var packageNm =\"Minimum Payment Required Reservation 2\"; \n var subPakNm =\"Individual\";\n var dateD =CommonCalender.getTodaysDate(); \n var time1 ; \n var time2 ; \n var dateFormat =aqConvert.DateTimeToFormatStr(CommonCalender.getTodaysDate(), \"%#m/%#d/%Y\"); \n InitializationEnviornment.initiliaze();\n AppLoginLogout.login();\n \n selectGroupFromMainMenu(groupNm);\n clickBuyTicketsButton();\n aqUtils.Delay(2000);\n WrapperFunction.selectKeywordName(keyWordNm);\n //Select first time zone for package.\n selectPackage(packageNm,subPakNm);\n aqUtils.Delay(2000);\n if(datetimeformSubWindow.Exists){ \n selectDateFromSubWindow(dateD); //mm-dd-yyyy\n // selectAvailableTimeFromSubWindow(time1); \n availableTimedatagroup.Child(0).Click();\n time1 = availableTimedatagroup.Child(0).HGroup(0).Label(\"timeLabel\").Caption; \n selectNextButtonFromSubWindow(); \n } else{\n merlinLogError(\"Date package is not selected. Calender window is not displayed.\")\n }\n //Select second time zone for same package. \n selectPackage(packageNm,subPakNm);\n aqUtils.Delay(2000);\n if(datetimeformSubWindow.Exists){ \n selectDateFromSubWindow(dateD); //mm-dd-yyyy\n try { \n aqUtils.Delay(3000);\n availableTimedatagroup.Child(1).Click(); \n time2 = availableTimedatagroup.Child(1).HGroup(0).Label(\"timeLabel\").Caption; \n aqUtils.Delay(1000);\n } catch (e) {\n \t\tmerlinLogError(\"Oops! There's some glitch in the script: Unable to select differnt time \" + e.message);\n \t} \n selectNextButtonFromSubWindow(); \n } else{\n merlinLogError(\"Date package is not selected. Calender window is not displayed.\")\n }\n \n selectFinalizeOrderbutton();\n //Verify time is displayed on settlement page or not. \n var flag = false;\n var cCount = settlement_scroller.ChildCount;\n var toDate1 =dateFormat +\" \"+ time1;\n var toDate2 =dateFormat +\" \"+ time2;\n var packageArray = new Array();\n for(let i=0;i<cCount;i++){\n var timeZonecap = settlement_scroller.Child(i).Caption;\n \n if(timeZonecap.startsWith(dateFormat)){\n packageArray.push(timeZonecap); \n }\n }\n \n for(let i=0;i<packageArray.length;i++){\n if(toDate1.startsWith(packageArray[i]) || toDate2.startsWith(packageArray[i])){\n flag = true; \n }else\n {\n flag = false;\n break;\n }\n }\n if(flag){\n Log.Message(\"The date/time displayed in the order details corresponds to the date/time selected\");\n clickConvertToReservation();\n aqUtils.Delay(3000); \n var expectedSettlemtnttotal = orderDetailsTotal.Caption; \n var orderTotal= (expectedSettlemtnttotal.split('$')[1]).trim(); \n var paymentTypeBal=WrapperFunction.getTextValue(orderDetailsMinimumPayment);\n paymentTypeBal= aqString.Replace(paymentTypeBal,\"$\",\"\"); \n Button.clickOnButton(CashButton); \n paymentTypeBal = parseInt(paymentTypeBal);\n WrapperFunction.setTextValue(PayamountTextBox,paymentTypeBal);\n Button.clickOnButton(applyButton);\n if(applycashrespopupCashPaymentOKButton.Exists){\n Button.clickOnButton(applycashrespopupCashPaymentOKButton);\n } \n Log.Message(\"Complete the order\");\n WrapperFunction.settlementCompleteOrder();\n aqUtils.Delay(5000); \n //aqObject.CheckProperty(orderDetailsTotal,\"Caption\", cmpEqual, expectedSettlemtnttotal); \n\t\t verifyTotalOnConfirmationPageReservation(expectedSettlemtnttotal);\n var orderId = cnf_orderID.Caption;\n if (orderId == null){\n merlinLogError(\"Order id is not present\");\n } \n }else{\n merlinLogError(\"Date time is not displayed correctly on settlement page.\");\n }\n }\n catch(e)\n {\n merlinLogError(\"Exception in Test script\");\n } finally { \n\t Log.PopLogFolder();\n } \n AppLoginLogout.logout();\n}", "title": "" }, { "docid": "889adb139f21af94e2869106d0ec95b1", "score": "0.56978554", "text": "function scheduler(start_hr, start_mn, end_hr, end_mn, mode, redni=99)\r\n{\r\n var today = new Date();\r\n var hr = today.getHours();\r\n var mn = today.getMinutes();\r\n var sc = today.getSeconds();\r\n\r\n nowTime = hr * 3600 + mn * 60 + sc\r\n startTime = start_hr * 3600 + start_mn * 60\r\n endTime = end_hr * 3600 + end_mn * 60\r\n var leftTime;\r\n var leftMn;\r\n var leftSc;\r\n if(startTime <= nowTime && nowTime <= endTime)//PAY ATTENTION\r\n {\r\n leftTime = endTime - nowTime // -1\r\n leftMn = Math.floor(leftTime / 60)\r\n leftSc = leftTime - leftMn * 60\r\n document.getElementById(\"TIMELEFT\").innerHTML = checkTime(leftMn) + \":\"+ checkTime(leftSc)\r\n SWITCHMODE(mode, redni)\r\n }\r\n else\r\n {\r\n //document.getElementById(\"TIMELEFT\").innerHTML = \"?\"\r\n //document.getElementById(\"TIMEEVENT\").innerHTML = \"\"\r\n }\r\n\r\n}", "title": "" }, { "docid": "2270518ad2feba7891dea365f49e6c84", "score": "0.56882924", "text": "timePickedStart(time){\n this.setState((previousState) => {\n var newState = previousState;\n newState.editingEvent.start = time;\n return {newState};\n });\n this.hideDateTimePicker();\n }", "title": "" }, { "docid": "a9e0807728e64fc7c6f8071f4435c700", "score": "0.568796", "text": "scheduleAt(time) {\n // let back = this.scheduleTable.find((x) => { x.endTime > requestedSchedule.statTime });\n // let front = this.scheduleTable.find((x) => { x.startTime <= requestedSchedule.endTime });\n if (this.couldScheduleAt(time)) {\n let requestedSchedule = new Schedule(time);\n this.scheduleTable.push(requestedSchedule);\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "d4b3060ffe46c21f53c1f5d7713ac5d4", "score": "0.56847614", "text": "checkShow(hour) {\n console.log(\"Check show \", hour, this.in9amshow, this.in7pmShow);\n if(hour==19 && !this.in7pmShow && !this.ended7pmShow){\n // So we do this after the other characters load\n this.square.fountain.startShow(hour);\n this.music7pm.play();\n this.in7pmShow = true;\n setTimeout(() => {\n this.characterController.addCharacter(\"Agam7PM\");\n },500);\n }\n\n /*\n if(hour!=12 && this.in12pmShow){\n this.square.fountain.resetShow();\n this.in12pmShow = false;\n }*/\n\n if(hour!=19 && this.in7pmShow){\n this.square.fountain.resetShow();\n this.in7pmShow = false;\n } \n\n if (hour != 9 && this.in9amshow) {\n this.square.fountain.resetShow();\n this.in9amshow = false;\n }\n\n }", "title": "" }, { "docid": "4e905239a2b95927cda7208a662eb9e0", "score": "0.5678298", "text": "function timeAlongRouteSelect() {\n if (document.getElementById(\"linkTime\").checked) map.addObject (elapsedTimeGroup);\n else try { map.removeObject(elapsedTimeGroup); } catch (exc) {console.log(\"Failed to remove elapsed time group: \" + exc)}\n }", "title": "" }, { "docid": "5512764eea2ed5c8d80ecf7321893608", "score": "0.56689817", "text": "renderTimeSlot(hourOfTheDay) {\n\t\t//get time to show\n\t\tvar timeToShow = hourOfTheDay +\":00\"\n\t\t//get the time instant of this day at this hour (We need to cast it to \"time\" so it is a UTC time)\n\t\tvar timeInstant = new Date(this.props.date + \" \" + timeToShow).getTime(); \n\t\t//check if this time instant is available, plus it has to be bigger than now\n\t\tif (this.props.slots[hourOfTheDay] || this.props.availableTimeSlots.has(timeInstant) && timeInstant > new Date().getTime()) {\n\t\t\treturn (\n\t\t\t\t<TimeSlot ref={\"timeSlot\"+hourOfTheDay} time={timeToShow} date={this.props.date} available={true} onChoose={(datetime) => this.props.onChoosingATimeSlot(hourOfTheDay, datetime)} \n\t\t\t\tonUnChoose={(datetime) =>this.props.onUnChoosingATimeSlot(hourOfTheDay, datetime)} chosen={this.props.slots[hourOfTheDay]}\n\t\t\t\t/>\n\t\t\t);\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t<TimeSlot time={timeToShow} available={false} \n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "ed56bf2c3ca0f4f76effb19cfe40e9af", "score": "0.5660695", "text": "constructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state={\n\t\t\t//if not time slot is avaiable at all for this date, hide it\n\t\t\tanyTimeAvailableOnThisDay: true,\n\t\t}\n\n\t}", "title": "" }, { "docid": "ac7c2d1a57de78e35ac9bd5d2452c259", "score": "0.56552035", "text": "function checkTimes() {\n var currentTime = moment().format(\"ha\"); // time and am/pm\n\n ids.forEach((id) => {\n if (id == currentTime) {\n $(`#${id}ta`).addClass(\"present\");\n } else if (moment().isAfter(moment(id, \"ha\"), \"hour\")) {\n $(`#${id}ta`).addClass(\"past\");\n } else {\n $(`#${id}ta`).addClass(\"future\");\n }\n });\n}", "title": "" }, { "docid": "fdd0efa22bac2edc96711aa3e75de8f7", "score": "0.56412977", "text": "function setTimeblockFormatting() {\n setTaskValues()\n $(\"#timeSlotContainer\").children().each(function() {\n var thisData = parseInt($(this).data('timeSlot').split(\":\")[0]);\n var thisMoment = moment().hours()\n if ( thisData < thisMoment ) {\n $(this).children(\".input-field\").addClass(\"past\")\n } else if ( thisData === thisMoment ) {\n $(this).children(\".input-field\").addClass(\"present\")\n } else {\n $(this).children(\".input-field\").addClass(\"future\")\n }\n });\n}", "title": "" }, { "docid": "596f854ffa1421e43be48ba3ceb79d3a", "score": "0.5619371", "text": "function selectTime(id){\n\tvar block = document.getElementById(id);\n\tconsole.log(block);\n\tif(block.style.backgroundColor != \"green\"){\n\t\tblock.style.backgroundColor = \"green\";\n\t\ttimeSlots++;\n\t\tconsole.log(timeSlots);\n\t}\n\telse{\n\t\tblock.style.backgroundColor = \"blue\";\n\t\ttimeSlots--;\n\t}\n}", "title": "" }, { "docid": "7d611cbd4a84290213acd5f7d981cecc", "score": "0.560303", "text": "function isSelectionPossible(){\r\n\t\ttestSlots.sort(compareCourseTime);\r\n\t\tfor(var i = 0; i < testSlots.length-1; i++){\r\n\t\t\tif( doesOverlap(testSlots[i], testSlots[i+1]) ){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "title": "" }, { "docid": "6dff0421c296025692e611cce6bbeb86", "score": "0.56027436", "text": "onTimeSelect(time) {\n\t\tthis.props.setTimeFn(time);\n\t\tthis.toggleDropdown();\t\n\t}", "title": "" }, { "docid": "4bb0f489208ec6c5c5e6d5409bd7701f", "score": "0.5598769", "text": "function onTimeSet(newdate, olddate) {\n $ctrl.timerange = [];\n var currentDate = moment().toISOString();\n var currentDay = moment(currentDate).startOf('day').format('YYYY-MM-DD');\n var interviewDate = (_.isUndefined(newdate)) ? olddate : newdate;\n var interviewDay = moment(interviewDate).startOf('day').format('YYYY-MM-DD');\n interviewDate = moment(interviewDate).toISOString();\n var dayname = moment(interviewDate).weekday();\n var timeAvailability = [];\n\n _.forEach($ctrl.backgroundEvents, function (value) {\n if (dayname === value.dow[0]) {\n timeAvailability.push(value); // In case multiple availabilities in a day\n }\n });\n\n // sort business hours on the basis of start time\n timeAvailability = _.sortBy(timeAvailability, [function (o) { return o.start; }]);\n\n if (!_.isEmpty(timeAvailability)) {\n\n var time = [];\n _.forEach(timeAvailability, function (value) {\n var start = _.split(value.start, ':');\n var end = _.split(value.end, ':');\n var hours, mins;\n var startHour = start[0];\n var startMin = start[1];\n var endHour = end[0];\n var endMin = end[1];\n var currentHour = moment(currentDate).startOf('hour').format('HH');\n var currentMin = moment(currentDate).startOf('min').format('mm');\n\n hours = _.range(startHour, endHour);\n mins = [0, 15, 30, 45];\n\n // To get max and min time of avaiability\n var maxTime = moment(interviewDate).set({ 'hour': endHour, 'minute': endMin }).valueOf();\n var minTime = moment(interviewDate).set({ 'hour': currentHour, 'minute': currentMin }).valueOf();\n\n _.forEach(hours, function (value) {\n _.forEach(mins, function (v) {\n var hour = value + \":\" + (_.padStart(v, 2, '0'));\n var starttime = moment(interviewDate).set({ 'hour': value, 'minute': v });\n var endtime = moment(starttime).add(1, 'hour');\n\n // push to array till max end time only\n if (currentDay === interviewDay) {\n if (moment(starttime).valueOf() >= minTime && moment(endtime).valueOf() <= maxTime) {\n time.push({\n name: moment(starttime).format('hh:mm a') + ' - ' + moment(endtime).format('hh:mm a'),\n value: hour\n });\n }\n } else {\n if (moment(endtime).valueOf() <= maxTime) {\n time.push({\n name: moment(starttime).format('hh:mm a') + ' - ' + moment(endtime).format('hh:mm a'),\n value: hour\n });\n }\n }\n\n });\n });\n if (_.size(time) > 0) {\n $ctrl.timerange = angular.copy(time);\n } else {\n toastr.warning('No Availability of Tutor on the selected day.');\n return false;\n }\n });\n } else {\n toastr.warning('No Availability of Tutor on the selected day.');\n }\n }", "title": "" }, { "docid": "4bb0f489208ec6c5c5e6d5409bd7701f", "score": "0.5598769", "text": "function onTimeSet(newdate, olddate) {\n $ctrl.timerange = [];\n var currentDate = moment().toISOString();\n var currentDay = moment(currentDate).startOf('day').format('YYYY-MM-DD');\n var interviewDate = (_.isUndefined(newdate)) ? olddate : newdate;\n var interviewDay = moment(interviewDate).startOf('day').format('YYYY-MM-DD');\n interviewDate = moment(interviewDate).toISOString();\n var dayname = moment(interviewDate).weekday();\n var timeAvailability = [];\n\n _.forEach($ctrl.backgroundEvents, function (value) {\n if (dayname === value.dow[0]) {\n timeAvailability.push(value); // In case multiple availabilities in a day\n }\n });\n\n // sort business hours on the basis of start time\n timeAvailability = _.sortBy(timeAvailability, [function (o) { return o.start; }]);\n\n if (!_.isEmpty(timeAvailability)) {\n\n var time = [];\n _.forEach(timeAvailability, function (value) {\n var start = _.split(value.start, ':');\n var end = _.split(value.end, ':');\n var hours, mins;\n var startHour = start[0];\n var startMin = start[1];\n var endHour = end[0];\n var endMin = end[1];\n var currentHour = moment(currentDate).startOf('hour').format('HH');\n var currentMin = moment(currentDate).startOf('min').format('mm');\n\n hours = _.range(startHour, endHour);\n mins = [0, 15, 30, 45];\n\n // To get max and min time of avaiability\n var maxTime = moment(interviewDate).set({ 'hour': endHour, 'minute': endMin }).valueOf();\n var minTime = moment(interviewDate).set({ 'hour': currentHour, 'minute': currentMin }).valueOf();\n\n _.forEach(hours, function (value) {\n _.forEach(mins, function (v) {\n var hour = value + \":\" + (_.padStart(v, 2, '0'));\n var starttime = moment(interviewDate).set({ 'hour': value, 'minute': v });\n var endtime = moment(starttime).add(1, 'hour');\n\n // push to array till max end time only\n if (currentDay === interviewDay) {\n if (moment(starttime).valueOf() >= minTime && moment(endtime).valueOf() <= maxTime) {\n time.push({\n name: moment(starttime).format('hh:mm a') + ' - ' + moment(endtime).format('hh:mm a'),\n value: hour\n });\n }\n } else {\n if (moment(endtime).valueOf() <= maxTime) {\n time.push({\n name: moment(starttime).format('hh:mm a') + ' - ' + moment(endtime).format('hh:mm a'),\n value: hour\n });\n }\n }\n\n });\n });\n if (_.size(time) > 0) {\n $ctrl.timerange = angular.copy(time);\n } else {\n toastr.warning('No Availability of Tutor on the selected day.');\n return false;\n }\n });\n } else {\n toastr.warning('No Availability of Tutor on the selected day.');\n }\n }", "title": "" }, { "docid": "c815b6af46488eee1390d76213f659e3", "score": "0.55987495", "text": "chooseTime(event) {\n const { target } = event;\n const value = target.value.split(',');\n this.writeFormValue('date', value[0]);\n this.writeFormValue('slot', value[1]);\n }", "title": "" }, { "docid": "947e556f2ac9405e389d2f37af143c17", "score": "0.5587956", "text": "function showTime() {\nvar time = new Date();\nvar hr = time.getHours();\nvar min = time.getMinutes();\nvar sec = time.getSeconds();\nvar am_pm = \"AM\";\n\nif(hr > 12)\n{\n\n hr == 12;\n am_pm = \"PM\";\n}\nif (hr == 0)\n{\n hr = 12;\n}\n\nhr = (hr<10) ? \"0\"+hr : hr;\nmin = (min<10) ? \"0\"+ min: min;\nsec = (sec<10) ? \"0\"+ sec : sec;\n\n\n\ncurrentTime = hr + \":\" + min + \":\" + sec + \" \" + am_pm;\nsetTimeout(showTime , 1000);\n}", "title": "" }, { "docid": "693f078c0ad39317493cbae3fc8d24f6", "score": "0.5581254", "text": "function getTimeSlot(apt_settings_id){\n params.apt_settings_id = apt_settings_id;\n splitedTimeSlot.get(params).$promise.then(function (response) {\n if(angular.isDefined(response)){\n $scope.timeSlot = response.data;\n $scope.timeSlotLength = (response.data.length > 0) ? true : false; \n } \n }); \n }", "title": "" }, { "docid": "81819665413c15ce13431637af131919", "score": "0.5569625", "text": "_timeOfDay() {\n const hour = new Date().getHours();\n if(hour >= 5 && hour <= 11 ) {\n this.setState({\n time: \"morning\"\n });\n }\n if(hour >=12 && hour <= 18) {\n this.setState({\n time: \"afternoon\"\n });\n }\n if(hour >= 19 || hour <= 5) {\n this.setState({\n time: \"evening\"\n });\n }\n }", "title": "" }, { "docid": "e83902d71ae67a43d590cc2afce28518", "score": "0.55695397", "text": "function time (thisShowDoEvents){\n client.getSpace('w82bwcfhqvdz')\n .then((space) => {\n space.getEntry(dateId,{\n resolveLinks: true,\n locale: 'en-US'\n })\n .then((entry) => {\n var allInDate = entry.fields.link['en-US'];\n var eventIdArry = [];\n\n for(var i = 0; i < allInDate.length; i++){\n var eventForDate = allInDate[i].sys.id;\n eventIdArry.push(eventForDate);\n\n }\n\n space.getEntries('events')\n .then((entries) =>{\n\n var eventDateId = entries.items\n\n for(var i = 0; i < eventDateId.length; i++){\n var allEventForDate = eventDateId[i].sys.id;\n }\n\n var n = 5\n var matrix = new Array(3);\n for (var i = 0; i < matrix.length; i++) {\n matrix[i] = new Array(n);\n }\n\n for(id of eventIdArry){\n for(event of entries.items){\n if(id === event.sys.id){\n var size = event.fields.size['en-US']\n var time = event.fields.time['en-US'].split(\"T\")[1]\n\n var row = -1\n if(time === \"13:00\") row = 0;\n if(time === \"14:00\") row = 1;\n if(time === \"15:00\") row = 2;\n\n if(size === \"Small\"){\n for(var i=0; i < n; i++){\n if(matrix[row][i] == null){\n matrix[row][i] = true\n break\n }\n }\n\n } else if(size === \"Medium\"){\n for(var i=0; i < n; i++){\n if(matrix[row][i] == null && matrix[row+1][i] == null){\n matrix[row][i] = true\n matrix[row+1][i] = true\n break\n }\n }\n } else if(size === \"Large\"){\n for(var i=0; i < n; i++){\n if(matrix[row][i] == null && matrix[row+1][i] == null && matrix[row+2][i] == null){\n matrix[row][i] = true\n matrix[row+1][i] = true\n matrix[row+2][i] = true\n break\n }\n }\n }\n }\n }\n }\n\n //matrix is filled now\n\n if(! hasElement(matrix)){\n\n JSaddStartOne.style.display = 'none'\n JSaddStartTwo.style.display = 'none'\n JSaddStartThree.style.display = 'none'\n JSaddHourOne.style.display = 'none'\n JSaddHourTwo.style.display = 'none'\n JSaddHourThree.style.display = 'none'\n\n\n } else {\n\n JSaddHourOne.style.display = 'inline-block'\n\n JSaddStartOne.addEventListener('click', function(){\n timeOne(matrix);\n });\n JSaddStartTwo.addEventListener('click', function(){\n timeTwo(matrix);\n });\n JSaddStartThree.addEventListener('click', function(){\n timeThree(matrix);\n });\n\n\n if (hasElementOnRow(matrix, 0) )\n JSaddStartOne.style.display = 'inline-block'\n else\n JSaddStartOne.style.display = 'none'\n\n if (hasElementOnRow(matrix, 1) )\n JSaddStartTwo.style.display = 'inline-block'\n else\n JSaddStartTwo.style.display = 'none'\n\n if (hasElementOnRow(matrix, 2) )\n JSaddStartThree.style.display = 'inline-block'\n else\n JSaddStartThree.style.display = 'none'\n\n }\n })\n })\n })\n }// end Time", "title": "" }, { "docid": "61c67157dcfa724122b55679b12f288e", "score": "0.5567232", "text": "function WhenBattleTimeOnMe(info,occ,time) {\n\tinfo.a = info.subject;\n\tWhenBattleTime(info,occ,\"\",time);\n}", "title": "" }, { "docid": "01ab6c50af45acb046ed8ab080cf75e9", "score": "0.5565116", "text": "function selectEvent(start, end, jsEvent, view) {\n var calendar = 'availableCalendar';\n var duration = end.diff(start, 'minutes') / 60;\n var validity = isValidEvent(start, end, calendar);\n var current = uiCalendarConfig.calendars[calendar].fullCalendar('getDate');\n var slotBuffer = $ctrl.timebuffer; // start buffer in minutes\n var startDuration = start.diff(current, 'minutes');\n\n if (validity.length === 0) {\n toastr.info('Lessons cannot be booked on UnAvailable Slots');\n uiCalendarConfig.calendars[calendar].fullCalendar(\"unselect\");\n } else {\n\n if (startDuration < slotBuffer) {\n toastr.info('Please select slot not before ' + slotBuffer / 60 + ' hours from current time.');\n uiCalendarConfig.calendars[calendar].fullCalendar(\"unselect\");\n return false;\n }\n\n else if (duration > $ctrl.duration) {\n toastr.info('Duration of this event cannot be greater than ' + $ctrl.duration + ' hour');\n uiCalendarConfig.calendars[calendar].fullCalendar(\"unselect\");\n return false;\n }\n else if (duration < $ctrl.minDuration) {\n toastr.info('Duration of this event cannot be less than ' + $ctrl.minDuration + ' hour');\n uiCalendarConfig.calendars[calendar].fullCalendar(\"unselect\");\n return false;\n }\n else {\n var totalLesson = $ctrl.totalLesson;\n var lessonLength = $ctrl.lessonLength;\n if (moment().diff(start, 'hour') > 0) {\n toastr.error('Lessons cannot be booked for past date!');\n uiCalendarConfig.calendars[calendar].fullCalendar(\"unselect\");\n } else {\n\n //check if event is of all day or specified time;\n var allDayEvent = false;\n if (start.format().indexOf('T') === -1) {\n allDayEvent = true;\n }\n\n var lessonprice = duration * $ctrl.wizarddetail.level.rate;\n var eventData = {\n title: 'Lesson',\n start: start.format(),\n end: end.format(),\n allDay: allDayEvent,\n overlap: false,\n stick: true,\n editable: false,\n type: 'lesson',\n lessonprice: lessonprice,\n lessonduration: duration\n };\n\n if (lessonLength < totalLesson) {\n var start = moment(eventData.start);\n var end = moment(eventData.end);\n var lessontime = end.diff(start, 'minutes') / 60;\n\n // Check to see if event is not added before the previous lesson\n var checkPastEvent = [];\n\n _.forEach($ctrl.lessoninfo, function (v) {\n if (end.isBefore(v.end) || end.isSame(v.end, 'minute')) {\n checkPastEvent.push(true);\n }\n });\n\n if (checkPastEvent.length === 0) {\n uiCalendarConfig.calendars[calendar].fullCalendar('renderEvent', eventData, true);\n $ctrl.lessoninfo.push(eventData);\n $ctrl.lessondesc = $ctrl.lessoninfo;\n $ctrl.lessontime.push(lessontime);\n $ctrl.totaltime = _.sum($ctrl.lessontime);\n toastr.success('Lesson booked successfully.');\n $ctrl.lessonLength = $ctrl.lessoninfo.length;\n calculateStripeFees();\n if ($ctrl.lessonLength >= $ctrl.initialPackage.number_lesson) {\n return;\n }\n $timeout(function () {\n var modalInstance = $uibModal.open({\n animation: true,\n ariaLabelledBy: 'modal-title',\n ariaDescribedBy: 'modal-body',\n templateUrl: '/app/layout/dialogs/autofill-popup.html',\n size: 'md',\n controller: 'AutofillSlotController',\n controllerAs: '$ctrl',\n windowClass: 'write-rvwmodal',\n backdrop: 'static',\n resolve: {\n lessonData: {\n initialPackage: $ctrl.initialPackage,\n lessondesc: $ctrl.lessondesc,\n currentEvent: eventData,\n backgroundEvents: $ctrl.backgroundEvents,\n scheduleEvents: $ctrl.scheduleEvents,\n tutorId : $ctrl.wizarddetail.tutorId\n }\n }\n });\n modalInstance.opened.then(function () { });\n modalInstance.result.then(function (events) {\n console.log(events);\n if (events) {\n events.forEach(function (evt) {\n \n let obj = Object.assign(evt, { id: 'lesson_' + ($ctrl.lessoninfo.length) });\n $ctrl.lessoninfo.push(obj);\n $ctrl.lessondesc = $ctrl.lessoninfo;\n $ctrl.lessontime.push(lessontime);\n $ctrl.totaltime = _.sum($ctrl.lessontime);\n calculateStripeFees();\n toastr.success('Lesson booked successfully.');\n $ctrl.lessonLength = $ctrl.lessoninfo.length;\n uiCalendarConfig.calendars[calendar].fullCalendar('renderEvent', obj, true);\n \n });\n }\n\n }, function () {\n\n });\n }, 100);\n } else {\n toastr.warning('You are trying to book a lesson before the schedule of previous lesson.');\n uiCalendarConfig.calendars[calendar].fullCalendar(\"unselect\");\n }\n\n } else {\n toastr.info('All lessons already booked!.');\n uiCalendarConfig.calendars[calendar].fullCalendar(\"unselect\");\n }\n }\n }\n\n\n }\n }", "title": "" }, { "docid": "59dc5eef294e8d7544d2e89775a9f682", "score": "0.5545359", "text": "_timeOfDay() {\n\t\tconst hour = new Date().getHours();\n\t\tif(hour >= 5 && hour <= 11 ) {\n\t\t\tthis.setState({\n\t\t\t\ttime: \"morning\"\n\t\t\t});\n\t\t}\n\t\tif(hour >=12 && hour <= 18) {\n\t\t\tthis.setState({\n\t\t\t\ttime: \"afternoon\"\n\t\t\t});\n\t\t}\n\t\tif(hour >= 19 || hour <= 5) {\n\t\t\tthis.setState({\n\t\t\t\ttime: \"evening\"\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "84089e40f568efeceb6e809562ceb026", "score": "0.553236", "text": "function divideTimeIntoTwelveSlots(isDay, secsInHour, tempMoment) {\n\t\t\t\tvar timeholder$;\t\t\t\t\t\t\t// selector for html elt\n\t\t\t\tvar rangeEnd = moment();\n\t\t\t\tvar slotInfo;\n\t\t\t\tvar offset = (isDay === true ) ? 1 : 13;\n\n\t\t\t\tfor ( var i = 0 ; i < 12 ; i +=1 ) {\n\t\t\t\t\ttimeholder$ = my.data.uiElt$['time'].find('#geoTime_timeHolder' + (i + offset));\n\n\t\t\t\t\ttempMoment.add( 'seconds', ( i * secsInHour ) );\t// starts at sunrise/sunset; gets set to beginning time of current slot\n\t\t\t\t\trangeEnd = tempMoment.clone();\t\t\t\t\t\t// set initially to beginning time of current slot,\n\t\t\t\t\trangeEnd.add( 'seconds', secsInHour - 60);\t\t\t// add to mark end of this time slot minus one minute\n\n\t\t\t\t\tslotInfo = {\n\t\t\t\t\t\telt : timeholder$,\n\t\t\t\t\t\tstartTime : tempMoment.clone(),\n\t\t\t\t\t\tendTime: rangeEnd.clone()\n\t\t\t\t\t\t};\n\n\t\t\t\t\tif ( isDay === true ) {\n\t\t\t\t\t\tdayHours[i] = slotInfo;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnightHours[i] = slotInfo;\n\t\t\t\t\t}\n\n\t\t\t\t\ttimeholder$.html( tempMoment.format(\"h:mm a\") + ' - ' + rangeEnd.format(\"h:mm a\") );\n\t\t\t\t\trangeEnd.add( 'seconds', 59);\t\t\t\t\t// add that minute back so next check is accurate\n\n\t\t\t\t\t// If current time happens to be within the time range we are prcoessing\n\t\t\t\t\tif ( areWeWithin(rangeEnd, tempMoment) ) {\n\t\t\t\t\t\tcurrentTimeIndex = ( isDay === true ) ? i : i + 12;\n\t\t\t\t\t\tcurrentTimeSlot$ = timeholder$.closest('tr');\n\t\t\t\t\t\tcurrentTimeSlot$.addClass('gradient3');\n\t\t\t\t\t}\n\n\t\t\t\t\ttempMoment.subtract( 'seconds', ( i * secsInHour ) );\t// reset to beginning of sunrise/sunset time\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "845fb67e48d28784739748dcdeff4f6b", "score": "0.55309063", "text": "function startTime() {\n 'use strict';\n if (cardClick > 0 && matched < 8) {\n if (time.secondes === 59) {\n time.minutes = time.minutes + 1;\n time.secondes = 0;\n } else {\n time.secondes = time.secondes + 1;\n }\n } else if (cardClick > 0 && matchCard === 8) {\n time.minutes = time.minutes;\n time.secondes = time.secondes;\n }\n /* making sure that the time formate appear correctly*/\n var correctFormate = \"0\";\n if (time.secondes < 10) {\n correctFormate += String(time.secondes);\n } else {\n correctFormate = String(time.secondes);\n }\n $('.timer').text(String(time.minutes) + \":\" + correctFormate);\n\n}", "title": "" }, { "docid": "0d2a3b6f14b30aface3ce471ad5fec25", "score": "0.5529076", "text": "checkTime() {\n\n if(this.timeLimit > 0) {\n this.timeIsStopped = true;\n fill(255);\n textSize(50);\n text(parseInt(this.timeLimit / 100), width - 50,50);\n this.timeLimit--;\n }\n else {\n this.timeIsStopped = false;\n }\n }", "title": "" }, { "docid": "f2720833e263a22305f08d63e0949b2c", "score": "0.55222636", "text": "function setTimeInterval(date,view){\n\t//get current calendar view\n\tvar current_view=getCurrentView(view.name);\n\t//if the view is the day or week view we load in the time pickers the start and end hour where the user clicked\n\t//otherwise we select the current hour\n\tvar startHour;\n\tvar minutes;\n\tvar endHour;\n\tif(current_view==\"day\"||current_view==\"week\"){\n\t\tstartHour=date.hours();\n\t\tminutes=date.minutes();\n\t\tif(minutes==\"0\")\n\t\t\tminutes=\"00\";\n\t\tendHour=date.add(1,\"hour\").hours();\n\t\t}\n\telse{\n\t\tvar currentTime=new Date();\n\t\tcurrentTime=moment(currentTime);\n\t\tstartHour=currentTime.hours();\n\t\tendHour=currentTime.add(1,\"hour\").hours();\n\t\tminutes=\"00\";\n\t\t}\n\t$(\"#private_event_startHour\").val(startHour+\":\"+minutes);\n\t$(\"#private_event_endHour\").val(endHour+\":\"+minutes)\n\t}", "title": "" }, { "docid": "2ea4f39becc12d594c4373c08f3e13a3", "score": "0.5514562", "text": "function showTime() {\n if (parseInt(timeNow) === timeElement9.value) {\n timeminsecElement9.innerHTML = moment().format('LT');\n }\n if (parseInt(timeNow) === timeElement10.value) {\n timeminsecElement10.innerHTML = moment().format('LT');\n }\n if (parseInt(timeNow) === timeElement11.value) {\n timeminsecElement11.innerHTML = moment().format('LT');\n }\n if (parseInt(timeNow) === timeElement12.value) {\n timeminsecElement12.innerHTML = moment().format('LT');\n }\n if (parseInt(timeNow) === timeElement13.value) {\n timeminsecElement13.innerHTML = moment().format('LT');\n }\n if (parseInt(timeNow) === timeElement14.value) {\n timeminsecElement14.innerHTML = moment().format('LT');\n }\n if (parseInt(timeNow) === timeElement15.value) {\n timeminsecElement15.innerHTML = moment().format('LT');\n }\n if (parseInt(timeNow) === timeElement16.value) {\n timeminsecElement16.innerHTML = moment().format('LT');\n }\n if (parseInt(timeNow) === timeElement17.value) {\n timeminsecElement17.innerHTML = moment().format('LT');\n }\n}", "title": "" }, { "docid": "ef1cbc9e0480ae5557a86232c68cba24", "score": "0.55098844", "text": "function selectEvent(start, end, jsEvent, view) {\n // Check for End date being equal to Start date of next day\n if (moment(end).isSame(moment(end).startOf('day')) === true) {\n end = end.subtract(1, 'seconds');\n }\n var calendar = 'availableCalendar';\n var duration = end.diff(start, 'minutes') / 60;\n console.log(duration);\n var validity = isValidEvent(start, end, calendar);\n var current = uiCalendarConfig.calendars[calendar].fullCalendar('getDate');\n var slotBuffer = $ctrl.timebuffer; // start buffer in minutes\n var startDuration = start.diff(current, 'minutes');\n\n var checkInterview = isInterviewBeforeLessons(start, end, calendar);\n\n if (checkInterview.length > 0) {\n toastr.info('Lessons cannot be booked before an interview. Please reset your interview or bookings.');\n uiCalendarConfig.calendars[calendar].fullCalendar(\"unselect\");\n return false;\n }\n\n if (validity.length === 0) {\n toastr.info('Lessons cannot be booked on UnAvailable Slots');\n uiCalendarConfig.calendars[calendar].fullCalendar(\"unselect\");\n } else {\n\n if (startDuration < slotBuffer) {\n toastr.info('Please select slot not before ' + slotBuffer / 60 + ' hours from current time.');\n uiCalendarConfig.calendars[calendar].fullCalendar(\"unselect\");\n return false;\n }\n\n else if (duration > $ctrl.duration) {\n toastr.info('Duration of this event cannot be greater than ' + $ctrl.duration + ' hour');\n uiCalendarConfig.calendars[calendar].fullCalendar(\"unselect\");\n return false;\n }\n else if (duration < $ctrl.minDuration) {\n toastr.info('Duration of this event cannot be less than ' + $ctrl.minDuration + ' hour');\n uiCalendarConfig.calendars[calendar].fullCalendar(\"unselect\");\n return false;\n }\n else {\n var totalLesson = $ctrl.totalLesson;\n var lessonLength = $ctrl.lessonLength;\n if (moment().diff(start, 'hour') > 0) {\n toastr.error('Lessons cannot be booked for past date!');\n uiCalendarConfig.calendars[calendar].fullCalendar(\"unselect\");\n } else {\n //check if event is of all day or specified time;\n var allDayEvent = false;\n if (start.format().indexOf('T') === -1) {\n allDayEvent = true;\n }\n\n var lessonprice = duration * $ctrl.wizarddetail.level.rate;\n var eventData = {\n id: 'lesson_' + $ctrl.lessonLength,\n title: 'Lesson',\n start: start.format(),\n end: end.format(),\n allDay: allDayEvent,\n overlap: false,\n stick: true,\n editable: false,\n type: 'lesson',\n lessonprice: lessonprice,\n lessonduration: duration\n };\n if (lessonLength < totalLesson) {\n var start = moment(eventData.start);\n var end = moment(eventData.end);\n var lessontime = end.diff(start, 'minutes') / 60;\n\n // Check to see if event is not added before the previous lesson\n var checkPastEvent = [];\n\n _.forEach($ctrl.lessoninfo, function (v) {\n if (end.isBefore(v.end) || end.isSame(v.end, 'minute')) {\n checkPastEvent.push(true);\n }\n });\n\n if (checkPastEvent.length === 0) {\n uiCalendarConfig.calendars[calendar].fullCalendar('renderEvent', eventData, true);\n $ctrl.lessoninfo.push(eventData);\n $ctrl.lessondesc = $ctrl.lessoninfo;\n $ctrl.lessontime.push(lessontime);\n $ctrl.totaltime = _.sum($ctrl.lessontime);\n toastr.success('Lesson booked successfully.');\n $ctrl.lessonLength = $ctrl.lessoninfo.length;\n calculateStripeFees();\n if ($ctrl.lessonLength >= $ctrl.initialPackage.number_lesson) {\n return;\n }\n $timeout(function () {\n var modalInstance = $uibModal.open({\n animation: true,\n ariaLabelledBy: 'modal-title',\n ariaDescribedBy: 'modal-body',\n templateUrl: '/app/layout/dialogs/autofill-popup.html',\n size: 'md',\n controller: 'AutofillSlotController',\n controllerAs: '$ctrl',\n windowClass: 'write-rvwmodal',\n backdrop: 'static',\n resolve: {\n lessonData: {\n initialPackage: $ctrl.initialPackage,\n lessondesc: $ctrl.lessondesc,\n currentEvent: eventData,\n backgroundEvents: $ctrl.backgroundEvents,\n scheduleEvents: $ctrl.scheduleEvents,\n tutorId : $ctrl.wizarddetail.tutorId\n }\n }\n });\n modalInstance.opened.then(function () { });\n modalInstance.result.then(function (events) {\n\n if (events) {\n events.forEach(function (evt) {\n \n let obj = Object.assign(evt, { id: 'lesson_' + ($ctrl.lessoninfo.length) });\n $ctrl.lessoninfo.push(obj);\n $ctrl.lessondesc = $ctrl.lessoninfo;\n $ctrl.lessontime.push(lessontime);\n $ctrl.totaltime = _.sum($ctrl.lessontime);\n calculateStripeFees();\n toastr.success('Lesson booked successfully.');\n $ctrl.lessonLength = $ctrl.lessoninfo.length;\n uiCalendarConfig.calendars[calendar].fullCalendar('renderEvent', obj, true);\n \n });\n }\n\n }, function () {\n\n });\n }, 100);\n } else {\n toastr.warning('You are trying to book a lesson before the schedule of previous lesson.');\n uiCalendarConfig.calendars[calendar].fullCalendar(\"unselect\");\n }\n\n } else {\n toastr.info('All lessons already booked!.');\n uiCalendarConfig.calendars[calendar].fullCalendar(\"unselect\");\n }\n }\n }\n }\n }", "title": "" }, { "docid": "31fe57083b10c11195dcdcb41d548463", "score": "0.55085397", "text": "function setTimeIncrement() {\n\n\t// If this is the first time we're making a selection,\n\t// Show the Calculate Button\n\tvar $start = $('#start_datepicker');\n\tvar $end = $('#end_datepicker');\n\tif ($start.val() !== \"\" && $end.val() !== \"\") {\n\t\t$('#step_one_button').show();\n\t}\n}", "title": "" }, { "docid": "1cdbe60f89d490ef6ea9120a0cffd6b8", "score": "0.5503577", "text": "function getLocalTime() {\n const mealTime = $(\"#meal-time\"); \n let currentTime = parseInt(moment().format('HH'));\n console.log(currentTime); \n if (currentTime < 12) {\n mealTime.html(\" Breakfast \"); \n } else if (currentTime >= 12 && currentTime <= 16) {\n mealTime.html(\" Lunch \"); \n } else {\n mealTime.html(\" Dinner \");\n }\n }", "title": "" }, { "docid": "c4acddf4e8c30f843437d96f0dc12328", "score": "0.5499604", "text": "function check(){\n\t\t\tif(start>=15 && start<30){\n\t\t\t\tstart=15;\n\t\t\t}else if(start>=30 && start<60){\n\t\t\t\tstart=30;\n\t\t\t}else if(start>=60 && start<125){\n\t\t\t\tstart=60;\n\t\t\t}else if(start>=125 && start<250){\n\t\t\t\tstart=125;\n\t\t\t}\n\t\n\t}", "title": "" }, { "docid": "b901cf941867514b021418205c6a610f", "score": "0.5498307", "text": "function checkRestaurant(){\n \n if(incrementedTimestamp <= startTimestamp){\n \n DAN = true;\n text = 'Zaprto';\n updateCountdown(incrementedTimestamp, startTimestamp);\n \n }else if (incrementedTimestamp >= endTimestamp){\n \n DAN = false;\n text = 'Zaprto';\n \n // Changing Date to tomorrow\n dayBeginningTimestamp = dayBeginningTimestamp+1000*60*60*24;\n \n // Updating start and end timestamps to tomorrow's\n calculateStartTimestamp();\n calculateEndTimestamp()\n \n updateCountdown(incrementedTimestamp, startTimestamp);\n \n }else{\n \n DAN = true;\n text = 'Odprto';\n updateCountdown(incrementedTimestamp, endTimestamp);\n\n }\n \n }", "title": "" }, { "docid": "a4f703ba58e3ef4c570cefe0735c0703", "score": "0.549115", "text": "updateTime(id, time) {\n if (id === 'start') {\n this.setState({ start_time: time });\n } else {\n this.setState({ end_time: time });\n }\n }", "title": "" }, { "docid": "a0e916703850ec9b23fbee7f0b61d564", "score": "0.5488947", "text": "isTime() {\n\t\t// i'm going to add a cooldown here\n\t\t// like\n\t\t// depending on the time since the start of the game it will pick a random number of game ticks to loop thru until it spawns another veggie\n\t\t// then when cooldown = 0 it spawns a veg and pick a new number\n\t\tif (this.cooldown <= 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.cooldown --;\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "75e2f9ed79f6790d472e3027764196df", "score": "0.54787993", "text": "function testTime() {\n // Add time1 9AM\n time1 = moment().startOf('day').add(9, \"hours\");\n // Adjusts current time to the hour\n currentTime = currentTime.startOf(\"hour\");\n // Add time1 if/els1\n if (currentTime.isAfter(time1)) {\n $(\".form1\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time1)) {\n $(\".form1\").addClass(\"future\");\n }\n else if (currentTime.isSame(time1)) {\n $(\".form1\").addClass(\"present\");\n };\n // Add time2 10AM\n time2 = moment().startOf('day').add(10, \"hours\");\n // Add time2 if/else\n if (currentTime.isAfter(time2)) {\n $(\".form2\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time2)) {\n $(\".form2\").addClass(\"future\");\n }\n else if (currentTime.isSame(time2)) {\n $(\".form2\").addClass(\"present\");\n };\n // time3 11AM\n time3 = moment().startOf('day').add(11, \"hours\");\n // Add time3 if/else\n if (currentTime.isAfter(time3)) {\n $(\".form3\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time3)) {\n $(\".form3\").addClass(\"future\");\n }\n else if (currentTime.isSame(time3)) {\n $(\".form3\").addClass(\"present\");\n };\n // time4 12PM\n time4 = moment().startOf('day').add(12, \"h6urs\");\n // Add time4 if/else\n if (currentTime.isAfter(time4)) {\n $(\".form4\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time4)) {\n $(\".form4\").addClass(\"future\");\n }\n else if (currentTime.isSame(time4)) {\n $(\".form4\").addClass(\"present\");\n };\n // time5 1PM\n time5 = moment().startOf('day').add(13, \"hours\");\n // Add time5 if/else\n if (currentTime.isAfter(time5)) {\n $(\".form5\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time5)) {\n $(\".form5\").addClass(\"future\");\n }\n else if (currentTime.isSame(time5)) {\n $(\".form5\").addClass(\"present\");\n };\n // time6 2PM\n time6 = moment().startOf('day').add(14, \"hours\");\n // Add time6 if/else\n if (currentTime.isAfter(time6)) {\n $(\".form6\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time6)) {\n $(\".form6\").addClass(\"future\");\n }\n else if (currentTime.isSame(time6)) {\n $(\".form6\").addClass(\"present\");\n };\n // time7 3M\n time7 = moment().startOf('day').add(15, \"hours\");\n // Add time7 if/else\n if (currentTime.isAfter(time7)) {\n $(\".form7\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time7)) {\n $(\".form7\").addClass(\"future\");\n }\n else if (currentTime.isSame(time7)) {\n $(\".form7\").addClass(\"present\");\n };\n // time8 4pm\n time8 = moment().startOf('day').add(16, \"hours\");\n // Add time8 if/else\n if (currentTime.isAfter(time8)) {\n $(\".form8\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time8)) {\n $(\".form8\").addClass(\"future\");\n }\n else if (currentTime.isSame(time8)) {\n $(\".form8\").addClass(\"present\");\n };\n // time9 5pm\n time9 = moment().startOf('day').add(17, \"hours\");\n // Add time9 if/else\n if (currentTime.isAfter(time9)) {\n $(\".form9\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time9)) {\n $(\".form9\").addClass(\"future\");\n }\n else if (currentTime.isSame(time9)) {\n $(\".form9\").addClass(\"present\");\n };\n}", "title": "" }, { "docid": "da834e07bd1c761906bed36a96a526dd", "score": "0.54731876", "text": "function compareTime() {\n var currentHour = moment().hours();\n $(\".time-block\").each(function() {\n var blockHourId = parseInt($(this).attr(\"id\"));\n if (blockHourId < currentHour) {\n $(this).addClass(\"past\")\n \n }\n else if (blockHourId === currentHour) {\n $(this).removeClass(\"past\")\n $(this).addClass(\"present\")\n }\n else {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n }\n });\n }", "title": "" }, { "docid": "6f74e09f1250c51fc412dacf3849635c", "score": "0.5470787", "text": "function checkTime() {\n //get current hour\n var hour = moment().hours();\n console.log(hour);\n //loop through the block hours\n $(\".time-block\").each(function () {\n //block is the id of the current hour\n var block = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n //compare current hour to block hour and assign it a styling class\n if (block < hour) {\n $(this).addClass(\"past\");\n } else if (block === hour) {\n $(this).addClass(\"present\");\n } else {\n $(this).addClass(\"future\");\n }\n });\n }", "title": "" }, { "docid": "8b03f38c4ce1a25ee53959ab8113d762", "score": "0.54680884", "text": "function biteZaDusto() {\r\n timeStatus = 0;\r\n time = 0;\r\n document.querySelector(\".startButton\").disabled = false;\r\n document.querySelector(\".default-time\").innerHTML = \"00:00:00\";\r\n// killer queen daisan no bakudan bites za dusto\r\n}", "title": "" }, { "docid": "8464c935db7cf41bf1d3a0db0faf2604", "score": "0.5463484", "text": "function hourSelector() {\n var currentTime = moment().hours();\n\n $(\".time-block\").each(function() {\n var timeElement = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n\n if (timeElement < currentTime) {\n $(this).addClass(\"past\");\n } else if (timeElement === currentTime) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n } else {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n }\n });\n }", "title": "" }, { "docid": "36b246ae11a7beb63fda8d7060467af7", "score": "0.5449631", "text": "updateTimePeriod(selectedRange) {\n\n }", "title": "" }, { "docid": "f0c6fea08a8a3ea1f1d544670831d1ea", "score": "0.54409957", "text": "function timeCheck(Z, Y){ \n if (Z > Y){\n arrivalBeforePresentTime = true;\n } else if (Z <= Y){\n arrivalBeforePresentTime = false;\n };\n}", "title": "" }, { "docid": "f73ccd447f24b578c4f5401eb7b3485b", "score": "0.543881", "text": "function updateStartTimeSpan() {\n\t\t\tvar startTime = getStartTime(slot);\n\t\t\tstartTimeSpan.text(normalize(getHour(startTime)) + ':' + normalize(getMinute(startTime)));\n\t\t}", "title": "" }, { "docid": "84267af720157d59b6100dc040adfec2", "score": "0.54378325", "text": "function trackTime()\n {\n //get current time in hours\n var currentHour = moment().hour();\n console.log(currentHour);\n\n //loop over time blocks\n $(\".time-block\").each(function()\n {\n var timeBlock = parseInt($(this).attr(\"id\").split(\"hour-\")[1]);\n\n //check time and add the bg classes\n if(timeBlock < currentHour)\n {\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"past\");\n }\n else if(timeBlock === currentHour)\n {\n $(this).removeClass(\"future\");\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n }\n else\n {\n $(this).removeClass(\"present\");\n $(this).removeClass(\"past\");\n $(this).addClass(\"future\");\n }\n })\n }", "title": "" }, { "docid": "2202267814642d2d58fb74f82c7e6d93", "score": "0.5436929", "text": "function isActive(timeOfSober, currentTime, Test){\n console.log(\"here\");\n console.log(timeOfSober);\n console.log(typeof(timeOfSober));\n console.log(typeof(currentTime));\n var timeLeft=timeOfSober-currentTime;\n console.log(timeOfSober+\"-\"+currentTime);\n console.log(timeLeft);\n if(timeLeft+15*60000<0){\n console.log(Test);\n changeToInactive(Test);\n console.log(\"inactive\");\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "0052845daf2b3fc6636c3b29037f374b", "score": "0.542855", "text": "function updateColor() {\n var currentTime = today.getHours();\n $(\".timeslot\").each(function () {\n var blockTime = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n if (blockTime < currentTime) {\n $(this).addClass(\"past\");\n } else if (blockTime === currentTime) {\n $(this).removeClass(\"past\").addClass(\"present\");\n } else {\n $(this).removeClass(\"past\", \"present\").addClass(\"future\");\n }\n })\n }", "title": "" }, { "docid": "5c06a414d322b5df3af76485550f5326", "score": "0.5426358", "text": "isTimeValid(address, currentTime) {\n if(currentTime - mempool[address] < ReqWaitTime/1000) { return false;}\n else {return true;}\n }", "title": "" }, { "docid": "26bec64dac3998f9502f7d5f3cc2b1c7", "score": "0.54261494", "text": "function fillInTimes() {\n\tif (opts.twelvehour) {\n\t\t$(\"#rise\").html('<span class=\"label\">Rise</span>' + d.times[findDay(bar.position)].risef);\n\t\t$(\"#set\").html('<span class=\"label\">Set</span>' + d.times[findDay(bar.position)].setf);\n\t} else {\n\t\t$(\"#rise\").html('<span class=\"label\">Rise</span>' + d.times[findDay(bar.position)].risef24);\n\t\t$(\"#set\").html('<span class=\"label\">Set</span>' + d.times[findDay(bar.position)].setf24);\n\t}\n\t$(\"#rise, #set\").show();\n}", "title": "" }, { "docid": "99c3b5f39905e004bc48387a3ff3c12b", "score": "0.5425133", "text": "function watch(){\n\n var now = new Date();\n var TwentyFourHour = now.getHours();\n var hour = now.getHours();\n var min = now.getMinutes();\n var sec = now.getSeconds();\n var mid = 'pm';\n if (min < 10) {\n min = \"0\" + min;\n }\n if (hour > 12) {\n hour = hour - 12;\n }\n if(hour==0){\n hour=12;\n }\n if(TwentyFourHour < 12) {\n mid = 'am';\n }\n document.getElementById('watch').innerHTML = hour+':'+min+':'+sec +' '+mid ;\n setTimeout(clock, 1000);\n\n}", "title": "" }, { "docid": "d4e392bae26205a46897ca84a0d9ccb0", "score": "0.54234827", "text": "function highlightSlot(day, hourNum, minute) {\n\t// Finds the element with the specified hour.\n\tvar dayCols = $(\"#calendar-wrapper\").children(\".calendar-col\");\n\tvar hour = $(dayCols[day]).find(\".hour\" + hourNum);\n\tvar slotNum = Math.floor(minute/slotLength);\n\thour.find(\".calDiv\" + slotNum).addClass(\"occupied\");\n}", "title": "" }, { "docid": "9df0e882a60dc983a768987969f47f69", "score": "0.5420632", "text": "function findTimes() {\n let allSlots = document.getElementsByClassName(\"card-availability\");\n let i, slots = [];\n for (i=0; i < allSlots.length; i++) {\n if (allSlots[i].innerText.includes(\"1/1\")) {\n slots.push( allSlots[i] );\n } else {\n // hide taken lanes\n allSlots[i].parentElement.parentElement.parentElement.parentElement.style.display=\"none\";\n }\n }\n\n if (slots.length) {\n display(\"Found \" + slots.length + \" free lanes for \" + lastDate);\n for (i=0; i< Math.min( slots.length, 15); i++) {\n display(\"* \" + slots[i].parentNode.parentNode.children[0].innerText );\n }\n if (slots.length > 15) {\n display(\"* more...\");\n }\n } else {\n display(\"Just a sec...\");\n }\n }", "title": "" }, { "docid": "33747d2811ef16e4432553f465b3d44c", "score": "0.5419132", "text": "function currentTime() {\n for (let i = 8; i < 19; i++) {\n\n var currentHour = \"#\" + i;\n var scheduleHour = parseInt($(currentHour).attr(\"id\"));\n $(currentHour).removeClass();\n\n if (\n scheduleHour > hour) {\n $(currentHour).attr(\"class\", \"row future\");\n }\n\n else if (\n scheduleHour === hour) {\n $(currentHour).attr(\"class\", \"row present\");\n }\n\n else if (\n scheduleHour < hour) {\n $(currentHour).attr(\"class\", \"row past\");\n };\n };\n }", "title": "" }, { "docid": "61b16fe07cf99b49e48c11b8b6de21a3", "score": "0.5416935", "text": "function onResume(){\n if (timeMinOffset===0){\n updateTimes();\n }\n }", "title": "" }, { "docid": "7e4cbd075924c133e878403875523ee9", "score": "0.5415303", "text": "handleTimeSlotUpdateEvent(dateWiseSlotArray) {\n this.formattedTimeSlotArrayTemp = this.formatTimeSlots(dateWiseSlotArray);\n this.formattedTimeSlotArray = this.sortTimeSlotAccordingToWeekSelected(\n this.formattedTimeSlotArrayTemp\n );\n this.formattedRecommendedSlotsArray = this.filterRecommededSlots(\n this.formattedTimeSlotArray\n );\n if (this.formattedTimeSlotArray && this.formattedTimeSlotArray.length > 0) {\n this.displayNoSlotsMsg = false;\n } else {\n this.displayNoSlotsMsg = true;\n }\n this.allowScrolling();\n this.callCustomEvent(\"updateNonAvailableDates\", this.nonAvailableDateArray);\n }", "title": "" }, { "docid": "54d4755377974f7dbc93e8f05dd719a7", "score": "0.541282", "text": "function assignValidStart(){\r\n\t\tndfd_grid2.removeAllFeatures();\r\n\t\tif(newScanHere){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tcloneSet = true;\r\n\t\tkeys = getKeys(data);\r\n\t\tif(document.getElementById(\"threatTime\") && parseInt(scans[scans.length - 1][0].split('_')[1]) != modifyFeature.feature.attributes.data['valid_start']){\r\n\t\t\tassigningStart = true;\r\n\t\t\t//decoupleVector(); // comment to retain past object positions while editing\r\n\t\t\t//updateThreat = false; // un-comment to retain past object positions while editing\r\n\t\t\tif(timeCanvasVal.getAttr('time') != parseInt(scans[scans.length - 1][0].split('_')[1])){\r\n\t\t\t\t// this is a problem - if a forecaster tries to edit the object on a scan that is not the latest (after switching to new product),\r\n\t\t\t\t// the code gets angry. Temp solution is to advance to latest scan for them.\r\n\t\t\t\tgoToEnd();\r\n\t\t\t\tchangeTilt(0,0,'td_tilt_0',parseInt(scans[scans.length - 1][0].split('_')[1]));\r\n\t\t\t\tif(document.getElementById('autoObject') && document.getElementById('autoObject').checked){\r\n\t\t\t\t\tmodifyAutoObject();\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tdecoupleVector();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(document.getElementById('autoObject') && document.getElementById('autoObject').checked){\r\n\t\t\t\tmodifyAutoObject();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tdecoupleVector(); // comment to retain past object positions while editing\r\n\t\t\t}\r\n\t\t\tmodifyFeature.feature.attributes.data['valid_start'] = parseInt(scans[scans.length - 1][0].split('_')[1]);\r\n\t\t\tvdate = new Date(modifyFeature.feature.attributes.data['valid_start'] * 1000);\r\n vtime = pad(vdate.getUTCHours()) + ':' + pad(vdate.getUTCMinutes()) + ':' + pad(vdate.getUTCSeconds()) + ' UTC';\r\n\t\t\tdocument.getElementById(\"threatTime\").innerHTML = vtime;\r\n\t\t\tdeletePendingRecords();\r\n\t\t\tinsertRecord(modifyFeature.feature.clone(),'Pending','insert');\r\n\t\t\tstartPoint = null;\r\n\t\t\tassigningStart = false;\r\n\t\t}\r\n\t\telse if(timeCanvasVal.getAttr('time') > parseInt(scans[scans.length - 1][0].split('_')[1]) && keys.indexOf(String(timeCanvasVal.getAttr('time'))) == -1){\r\n\t\t\tassigningStart = true;\r\n\t\t\tchangeTilt(0,0,'td_tilt_0',parseInt(scans[scans.length - 1][0].split('_')[1]));\r\n\t\t\tassigningStart = false;\r\n\t\t}\r\n\t\telse if(timeCanvasVal.getAttr('time') < parseInt(scans[scans.length - 1][0].split('_')[1]) && keys.indexOf(String(timeCanvasVal.getAttr('time'))) == -1){\r\n\t\t\tassigningStart = true;\r\n\t\t\tfor(var k3=0;k3<scans.length;k3++){\r\n\t\t\t\tif(parseInt(scans[k3][0].split('_')[1]) > timeCanvasVal.getAttr('time')){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tscanNum = k3;\r\n\t\t\t}\r\n \tchangeTilt(0,0,'td_tilt_0',parseInt(scans[scanNum][0].split('_')[1]));\r\n assigningStart = false;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "615dbeeff6287326770f89fad9ba6b22", "score": "0.5400765", "text": "function testTime() {\n time9am = moment().startOf('day').add(9, \"hours\");\n currentTime = currentTime.startOf(\"hour\");\n if (currentTime.isAfter(time9am)) {\n $(\".form9\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time9am)) {\n $(\".form9\").addClass(\"future\");\n }\n else if (currentTime.isSame(time9am)) {\n $(\".form9\").addClass(\"present\");\n };\n time10am = moment().startOf('day').add(10, \"hours\");\n if (currentTime.isAfter(time10am)) {\n $(\".form10\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time10am)) {\n $(\".form10\").addClass(\"future\");\n }\n else if (currentTime.isSame(time10am)) {\n $(\".form10\").addClass(\"present\");\n };\n time11am = moment().startOf('day').add(11, \"hours\");\n if (currentTime.isAfter(time11am)) {\n $(\".form11\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time11am)) {\n $(\".form11\").addClass(\"future\");\n }\n else if (currentTime.isSame(time11am)) {\n $(\".form11\").addClass(\"present\");\n };\n time12pm = moment().startOf('day').add(12, \"hours\");\n if (currentTime.isAfter(time12pm)) {\n $(\".form12\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time12pm)) {\n $(\".form12\").addClass(\"future\");\n }\n else if (currentTime.isSame(time12pm)) {\n $(\".form12\").addClass(\"present\");\n };\n time1pm = moment().startOf('day').add(13, \"hours\");\n if (currentTime.isAfter(time1pm)) {\n $(\".form1\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time1pm)) {\n $(\".form1\").addClass(\"future\");\n }\n else if (currentTime.isSame(time1pm)) {\n $(\".form1\").addClass(\"present\");\n };\n time2pm = moment().startOf('day').add(14, \"hours\");\n if (currentTime.isAfter(time2pm)) {\n $(\".form2\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time2pm)) {\n $(\".form2\").addClass(\"future\");\n }\n else if (currentTime.isSame(time2pm)) {\n $(\".form2\").addClass(\"present\");\n };\n time3pm = moment().startOf('day').add(15, \"hours\");\n if (currentTime.isAfter(time3pm)) {\n $(\".form3\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time3pm)) {\n $(\".form3\").addClass(\"future\");\n }\n else if (currentTime.isSame(time3pm)) {\n $(\".form3\").addClass(\"present\");\n };\n time4pm = moment().startOf('day').add(16, \"hours\");\n if (currentTime.isAfter(time4pm)) {\n $(\".form4\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time4pm)) {\n $(\".form4\").addClass(\"future\");\n }\n else if (currentTime.isSame(time4pm)) {\n $(\".form4\").addClass(\"present\");\n };\n time5pm = moment().startOf('day').add(17, \"hours\");\n if (currentTime.isAfter(time5pm)) {\n $(\".form5\").addClass(\"past\");\n }\n else if (currentTime.isBefore(time5pm)) {\n $(\".form5\").addClass(\"future\");\n }\n else if (currentTime.isSame(time5pm)) {\n $(\".form5\").addClass(\"present\");\n };\n}", "title": "" }, { "docid": "823d8157a90cef277e55767f2f30e73a", "score": "0.53963333", "text": "function f_setTimeSelection(layer, index, value) {\n if (timeSelection[layer.id].selection[index].selected === value)\n return;\n timeSelection[layer.id].selection[index].selected = value;\n timeSelection[layer.id].filteredValues = f_filterTimeValues(layer);\n //change WMS timestamp, if time selection is complete\n if (timeSelection[layer.id].isComplete() === true)\n imageOverlays[layer.id].getSource().updateParams({'TIME': timeSelection[layer.id].filteredValues[0].toISOString()});\n}", "title": "" }, { "docid": "a43769e8b6fea5a4e301289fa808de77", "score": "0.5393675", "text": "function divideTimeIntoTwelveSlots(secsInHour, offset, tempMoment) {\n\t\t\tvar timeholder$;\t\t\t\t\t\t\t// selector for html elt\n\t\t\tvar rangeEnd = moment();\n\t\t\tvar now = moment();\n\n\t\t\tfor ( var i = 0 ; i < 12 ; i +=1 ) {\n\t\t\t\ttimeholder$ = my.data.uiElt$['time'].find('#geoTime_timeHolder' + (i + offset));\n\n\t\t\t\ttempMoment.add( 'seconds', ( i * secsInHour ) );\t// starts at sunrise/sunset; gets set to beginning time of current slot\n\t\t\t\trangeEnd = tempMoment.clone();\t\t\t\t\t\t// set initially to beginning time of current slot,\n\t\t\t\trangeEnd.add( 'seconds', secsInHour - 60);\t\t\t// add to mark end of this time slot minus one minute\n\n\t\t\t\ttimeholder$.html( tempMoment.format(\"h:mm a\") + ' - ' + rangeEnd.format(\"h:mm a\") );\n\t\t\t\trangeEnd.add( 'seconds', 59);\t\t\t\t\t// add that minute back so next check is accurate\n\n\t\t\t\t// If current time happens to be within the time range we are prcoessing, add class to html\n\t\t\t\tif ( now.isBefore(rangeEnd) && now.isAfter(tempMoment) ) {\n\t\t\t\t\tcurrentTimeSlot$ = timeholder$.closest('tr');\n\t\t\t\t\tcurrentTimeSlot$.addClass('gradient3');\n\t\t\t\t}\n\n\t\t\t\ttempMoment.subtract( 'seconds', ( i * secsInHour ) );\t// reset to beginning of sunrise/sunset time\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "756bc0e39dcccfbd53e0f408eb08b4ce", "score": "0.5391208", "text": "handleTime(time) {\n\t\tif(this.state.timeList.includes(moment(time).format('h:mm a'))){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "637542211a025caf5ba71f50ebff0492", "score": "0.53829604", "text": "function datedisplay()\n{\n\tif(document.getElementById('mytimeframe').value = 1)\n\t{\n\t\tdocument.getElementById('frmdt').style.display = \"block\";\n\t\tdocument.getElementById('todt').style.display = \"none\";\n\t}\n}", "title": "" }, { "docid": "7822a66033a68d90113d9b74938694da", "score": "0.5381857", "text": "function updateHour(){\n var currentHour = dayjs().format(\"HH\");\n $('.timeSlot').each(function(){\n var block = $(this).children().attr(\"id\");\n\n//Creating the input variable to set the color attributes\n//based on whether a block is in the past, present or future. \n//Had to reference multiplpe layers of children to get down to the input div. \nvar input = $(this).children().children().children(\"input\")\n if (block === currentHour) {\n input.removeClass(\"past\")\n input.removeClass(\"future\")\n input.addClass(\"present\");\n \n }\n if (block < currentHour) {\n input.removeClass(\"present\")\n input.removeClass(\"future\")\n input.addClass(\"past\");\n }\n if (block > currentHour) {\n input.removeClass(\"past\")\n input.removeClass(\"present\")\n input.addClass(\"future\");\n }\n\n })\n}", "title": "" }, { "docid": "4761ef47ea76fd1cbd3cc1b9784a9c49", "score": "0.53810644", "text": "function setTime(time)/* step 0 */\n{\n $('input[name=appointment_time]').val(time);\n ftime = formatTime(time);\n ftime = time<=1200 ? ftime += ' du matin' : ftime += ' de l\\'après midi' ;\n $('#appt-time span').text(ftime);\n $('#appt-time').show();\n $('#weekday-wrapper').hide(); \n $('#container-appt').slideDown();\n console.log(time); \n console.log(ftime); \n}", "title": "" }, { "docid": "845a40ba732d9979a71d9a03e1e16dcf", "score": "0.537884", "text": "function start() {\n\tdayMode()\n}", "title": "" }, { "docid": "a984335acb3aca0cfba88f39de51ecf7", "score": "0.5377324", "text": "function highlightPastTime() {\n let today = moment();\n\n // Get day of the week, Monday = 1; Sunday = 7\n let day = today.isoWeekday();\n let hours = today.hours();\n let currentTimeRange;\n\n // Sunday and after 10 p.m.\n if (day === SUN && hours === 22) {\n day = 0;\n hours = 1;\n }\n // Convert the current time to the time range index we used in the table\n currentTimeRange = hours - 8;\n\n for (let col = MON; col < day; col++) {\n for (let row = 0; row <= 14; row++) {\n // Before 8 a.m.\n if (col === day - 1 && currentTimeRange < 0) {\n break;\n }\n // Generate the element selector\n let selectedSession = '#slot-' + col + '-' + row;\n $(selectedSession).addClass('bg-danger');\n // Reach current hour\n if (col === day - 1 && row === currentTimeRange) {\n break;\n }\n }\n }\n}", "title": "" }, { "docid": "86b7274e2d2230c445357b6d9cb43796", "score": "0.5370986", "text": "function chooseCustomTime() {\n const timeInput = document.getElementById('time-input').value;\n setSessionTime(parseInt(timeInput)/60); setChoiceLevel(2);\n }", "title": "" }, { "docid": "216808216a06089ebf7a6659065e8c1f", "score": "0.5366593", "text": "timePickedEnd(time){\n this.setState((previousState) => {\n var newState = previousState;\n newState.editingEvent.end = time;\n return {newState};\n });\n this.hideDateTimePicker();\n }", "title": "" }, { "docid": "6492e84b9bffe4e35fc6febc4bf5f537", "score": "0.5361875", "text": "function time() {\n for (var j = 0; j < tasksLocation.length; j++) {\n var format = \"hh:mm:ss\";\n (beforeTime = moment(j + 9 + \":00:00\", format)), // starts at 9am and adds new hour each time it runs for loop\n (afterTime = moment(j + 10 + \":00:00\", format)); // ends at 6pm\n\n if (moment().isAfter(afterTime)) {\n tasksLocation[j].addClass(\"past\");\n tasksLocation[j].removeClass(\"present\");\n tasksLocation[j].removeClass(\"future\");\n }\n if (moment().isBefore(beforeTime)) {\n tasksLocation[j].addClass(\"future\");\n tasksLocation[j].removeClass(\"present\");\n tasksLocation[j].removeClass(\"past\");\n }\n if (moment().isBetween(beforeTime, afterTime)) {\n tasksLocation[j].addClass(\"present\");\n tasksLocation[j].removeClass(\"future\");\n tasksLocation[j].removeClass(\"past\");\n }\n }\n }", "title": "" }, { "docid": "4a3ad44e5720376953e992184b34e164", "score": "0.53507054", "text": "function shouldBeActive() {\n return now().getDay() % 6 !== 0 && now() <= new Date(now().getFullYear(), now().getMonth(), now().getDate(), displayTime.hour, displayTime.minute, 0, 0);\n}", "title": "" }, { "docid": "24adc26a9340cf7eb7848eef71dfc744", "score": "0.5342429", "text": "function updateTimeRange( val ) {\n var raidStartTime = moment();\n var raidEndTime = moment();\n if( val >= 0 ) {\n var timeLeft = siteConfig.activeRaidDuration - val;\n raidStartTime.subtract(val, 'minutes').minutes();\n raidEndTime.add(timeLeft, 'minutes').minutes();\n $('.step__timer' ).attr( 'data-starttime', raidStartTime.format('YYYY-MM-DD HH:mm:ss') );\n $('.step__timer--delai').html('Le raid est en cours. Il reste <strong>' + timeLeft + ' min</strong> '); \n $('.step__timer--horaires').html( 'De <strong>' + raidStartTime.format('HH[h]mm') + '</strong> à <strong>' + raidEndTime.format('HH[h]mm') + '</strong> ' );\n $('.modal__screen [data-step-name=\"boss\"]').show();\n $('.modal__screen [data-step-name=\"level\"]').attr('data-validate', 'non');\n } else {\n var timeLeft = Math.abs(val);\n raidStartTime.add(timeLeft, 'minutes').minutes();\n raidEndTime.add(timeLeft + siteConfig.activeRaidDuration, 'minutes').minutes();\n $('.step__timer').attr( 'data-starttime', raidStartTime.format('YYYY-MM-DD HH:mm:ss') );\n $('.step__timer--delai').html('Le raid débute dans <strong>' + timeLeft + ' min</strong> ');\n $('.step__timer--horaires').html( 'De <strong>' + raidStartTime.format('HH[h]mm') + '</strong> à <strong>' + raidEndTime.format('HH[h]mm') + '</strong> ' );\n $('.modal__screen [data-step-name=\"boss\"]').hide();\n $('.modal__screen [data-step-name=\"level\"]').attr('data-validate', 'oui');\n }\n}", "title": "" }, { "docid": "274e21b06374d2322969a13f9d1f9ee3", "score": "0.5342415", "text": "function selectDate(sights) \n{\n return sights.datetime == catchInput;\n}", "title": "" }, { "docid": "0a9347a0c114962a62b01f8eb5399c69", "score": "0.53397584", "text": "function refreshTimePicker(mode, tm) {\r\n // was a selected time provided?\r\n\tif (tm===undefined) { // is ===undefined an error, or is this correct javascript syntax?\r\n if (mode==0)\r\n { \r\n suffix=\"AM\"; \r\n }\r\n else\r\n { \r\n suffix=\"PM\"; \r\n }\r\n } else {\r\n tm = nearestTime(tm); // get time to nearest 15 min. interval.\r\n suffix=tm.split(\" \")[1];\r\n if (suffix==\"AM\") \r\n mode = 0; \r\n else \r\n mode = 1;\r\n }\r\n\r\n\t// sHTML = \"<table><tr><td><table cellpadding=3 cellspacing=0 bgcolor='#f0f0f0'>\";\r\n sHTML = \"<table><tr><td><table cellpadding=3 cellspacing=0 bgcolor='#FFFFFF'>\";\r\n for (i=8;i<18;i++) {\r\n\r\n sHTML+=\"<tr align=right style='font-family:verdana;font-size:11px;color:#000000;'>\";\r\n\r\n if (i>12) {\r\n hr = i-12;\r\n\t\tsuffix = \"PM\";\r\n }\r\n else {\r\n hr=i;\r\n\t\tsuffix = \"AM\"\r\n\t\tif (i==12)\r\n\t\tsuffix = \"PM\";\r\n } \r\n\r\n for (j=0;j<2;j++) {\r\n var thisTime=hr+\":\"+padZero(j*30)+\" \" + suffix;\r\n var bgcolor = \"\";\r\n if (thisTime==tm) {bgcolor=\"bgcolor='#F7C8E3'\";}\r\n \r\n\t\t\r\n sHTML+=\"<td \" + bgcolor + \"width=57 style='cursor:hand;font-family:verdana;font-size:11px;' onmouseover='this.style.backgroundColor=\\\"#66CCFF\\\"' onmouseout='this.style.backgroundColor=\\\"\\\"' onclick='setTimePicker(\\\"\"+ hr + \":\" + padZero(j*30) + \"&nbsp;\" + suffix \r\n + \"\\\")'><a style='text-decoration:none;color:#000000' href='javascript:setTimePicker(\\\"\"+ hr + \":\" + padZero(j*30) + \" \" + suffix + \"\\\")'>\" + hr + \":\"+padZero(j*30) +\"&nbsp;\"+ suffix + \"&nbsp;</a></td>\";\r\n\r\n }\r\n\r\n sHTML+=\"</tr>\";\r\n }\r\n sHTML += \"</table></td></tr></table>\";\r\n document.getElementById(\"timePickerContent\").innerHTML = sHTML;\r\n }", "title": "" }, { "docid": "1c4ba46af7f4f444bdc41b01bef59d02", "score": "0.5331128", "text": "function clock() { \n if (queryObj.queryWait) {\n setQueryWait({queryWait : true, waitTimer : queryObj.waitTimer + 1});\n };\n let tStr = timeSvcs.getTimeStr();\n let flagsObj = timeSvcs.getTimeFlags(tStr);\n setTimeAndDate({\n timeStr : tStr,\n isWeekday : flagsObj.isWeekday,\n isOvernight : flagsObj.isOvernight,\n isMorning : flagsObj.isMorning,\n isAfternoon : flagsObj.isAfternoon,\n isEvening : flagsObj.isEvening\n });\n }", "title": "" }, { "docid": "3a1611cec6d53d4dc4e2f20465bc2557", "score": "0.5326885", "text": "onTimeSelectCallback(time){\n this.setState({time:time});\n }", "title": "" }, { "docid": "37203499e8059dc96fe6358b228fb251", "score": "0.5324592", "text": "function setTimeSession(){\nif(!moreTime)\n}", "title": "" }, { "docid": "55f711f69812c59b81e98a1c00291cb5", "score": "0.5324342", "text": "buildSlotsList() {\n const interval = parseInt(this.state.interval, 10);\n const slots = ['00:00'];\n let time = 1440;\n let hour = 0;\n let min = 0;\n while (time !== 0) {\n min += interval;\n if (min === 60) {\n if (hour !== 23) {\n hour += 1;\n } else {\n hour = 0;\n }\n min = 0;\n }\n let thisH = hour;\n let thisM = min;\n if (thisH < 10) {\n thisH = `0${hour}`;\n }\n if (thisM < 10) {\n thisM = `0${min}`;\n }\n slots.push(`${thisH}:${thisM}`);\n time -= interval;\n }\n\n return slots;\n }", "title": "" }, { "docid": "c523d4caf83a5fda9aa321aafca05539", "score": "0.532287", "text": "function findTime(){\n basicTime = \"\"; \n var timeNow = '';\n time = new Date;\n time = time.toTimeString();\n for (var i = 0; i < 8; i++){\n timeNow = timeNow + time[i];\n }\n //find basic time used for setting day/night value\n for (var i = 0; i < 2; i++){\n basicTime = basicTime + timeNow[i];\n } \n currentTime.twentyFourHour = ridNumbersAfterDecimal(timeNow);\n // setTimeout(() => {\n currentTime.twelveHour = moment(currentTime.twentyFourHour, [\"HH.mm\"]).format(\"hh:mm A\");\n if (currentTime.twelveHour[0] === \"0\"){\n currentTime.twelveHour = ridFirstZero(currentTime.twelveHour); \n } \n // }, 300);\n\n //12 hour time is handled by packages.js\n }", "title": "" }, { "docid": "0263a19d0d931b6e35e08ae8548e247c", "score": "0.53179955", "text": "function snooze_Alarm(time){\n console.log(\"the alarm for \" + time+\":00am\" + \" has been changed to \" + (time+1)+\":00am\");\n}", "title": "" }, { "docid": "2430eef6d70ad7b58f341a4fcc2d0d36", "score": "0.53142935", "text": "function execution()\n{\n if(hr>=4 && hr<12){\n morning();\n }\n else if(hr>=12 && hr<18){\n afternoon();\n\n }\n else if(hr>=18 && hr<24){\n night();\n }\n else{\n remaining();\n }\n}", "title": "" }, { "docid": "1bd3cbecefdb9b4938ecaea90320c610", "score": "0.5311786", "text": "function timer(){\n\tif (!curSide.isPaused()) {\n\t\tcurSide.setTime();\n\t}\n}", "title": "" }, { "docid": "f610d6f0329e6cc36f3b759d3ca6cbb7", "score": "0.5311152", "text": "function colorchange(){\n if(time > 12){\n time - 12; \n }\n if(time > moment().hour(9)){\n $(\"#timeC\").addClass(\"Past\");\n }\n}", "title": "" }, { "docid": "7147c514b0f193e5659e661c5a16c653", "score": "0.529999", "text": "function switchWorkTime() {\r\n if (working) {\r\n return;\r\n }\r\n \r\n working = true;\r\n console.log(working);\r\n toggleButtons();\r\n currentTime = workTime;\r\n displayTime();\r\n }", "title": "" } ]
57e670a779f84ed5a101277160127cff
Function for second counter
[ { "docid": "7f156c89292d0c11191f9ecaec7d01d4", "score": "0.0", "text": "function secondsTimer() {\n session_seconds = session_seconds - 1;\n document.getElementById(\"seconds\").innerHTML = session_seconds;\n\n // Check if the seconds and minutes counter has reached 0\n // If reached 0 then end the session\n if (session_seconds <= 0) {\n if (session_minutes <= 0) {\n // Clears the interval i.e. stops the counter\n clearInterval(minutes_interval);\n clearInterval(seconds_interval);\n\n // Add the message to the html\n document.getElementById(\"done\").innerHTML =\n \"Break completed! Have fun studying!\";\n\n // Make the html message div visible\n document.getElementById(\"done\").classList.add(\"show_message\");\n\n // PLay the bell sound to tell the end of session\n bell.play();\n }\n\n // Reset the session seconds to 60\n session_seconds = 60;\n }\n }", "title": "" } ]
[ { "docid": "5a1360aa098219acc9038fa253141f62", "score": "0.7038501", "text": "function countSecond() {\n seconds++;\n if(seconds <= 50) {\n timer.textContent = \"0:\" + (60-seconds);\n } else if(seconds < 60) {\n timer.textContent = \"0:0\" + (60-seconds);\n } else {\n restart = true;\n timer.textContent = \"Restart\"\n }\n}", "title": "" }, { "docid": "8f4f9a8dfa527ec80fb1b60cc572f598", "score": "0.7011434", "text": "function myFunction() {\n let count = 0;\n setInterval(function(){\n let spn = document.querySelector(\"#seconds\");\n spn.innerHTML = (++count);\n }, 1000);\n\n }", "title": "" }, { "docid": "0941eb351bad88ae1b8a214da1d5284c", "score": "0.68637586", "text": "function counter(){\n\t\t\t//...\n\t\t}", "title": "" }, { "docid": "3395edb3b447cfdce741dd0843355c93", "score": "0.680706", "text": "function countDown2() {\n\tcounter2 = setInterval(tempPage, 1000);\n}", "title": "" }, { "docid": "a77df18522e9f25e78356b0ccff2c1c9", "score": "0.67630965", "text": "function counter() {\r\n $(\"[data-name='counter']\").each( function (n) {\r\n i = $(this);\r\n var counter=1*i.attr(\"data-sec\");\r\n var inc=1*i.attr(\"data-inc\");\r\n if ((inc<0 && counter>0) || inc>0) {\r\n counter=counter+inc;\r\n\r\n i.attr(\"data-sec\",counter);\r\n var s=counter;\r\n var h=Math.round(Math.floor(s/(60.0*60.0)));\r\n s%=(60*60);\r\n var m=Math.round(Math.floor(s/60.0));\r\n s%=(60);\r\n if (s<10) {\r\n s=\"0\"+s;\r\n }\r\n if (h>0 && m<10) {\r\n m=\"0\"+m;\r\n }\r\n try {\r\n if (h>0) {\r\n i.text(h+\":\"+m+\":\"+s);\r\n }else{\r\n i.text(m+\":\"+s);\r\n }\r\n }catch(err){} // ignore error\r\n }\r\n });\r\n}", "title": "" }, { "docid": "cf401fe9ee309cf1e752f4af95cb9f69", "score": "0.67491066", "text": "function timer() {\n\t\tclock = setInterval(twentySeconds, 1000);\n\t\tfunction twentySeconds() {\n\t\t\tif (counter === 0) {\n\t\t\t\tclearInterval(clock);\n\t\t\t\tgenerateLossAtTimeOut();\n\t\t\t} else if (counter > 0) {\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t\t$(\"#timer\").html(counter);\n\t\t}\n\t}", "title": "" }, { "docid": "311be11692a59d71f5791e88ac307443", "score": "0.67464286", "text": "function incrementsecond(){\n\t//Increment the timer counter\n\ttimer++;\n\t//Do some math to work out the minutes and seconds\n\tvar seconds = timer%60;\n\t//Need to floor it so the minutes doesn't appear as a giant decimal\n\tvar minutes = Math.floor(timer/60);\n\t//if minutes or seconds is under 10 (aka 1 digit vs 2) we add a 0 on the front to keep the formatting looking right\n\tif(seconds < 10)\n\t{\n\t\tif (minutes < 10)\n\t\t{\n\t\t\tdocument.getElementById('clock').innerHTML = \"0\" + minutes + \":\" + \"0\" + seconds;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdocument.getElementById('clock').innerHTML = minutes + \":\" + \"0\" + seconds;\n\t\t}\n\t}\n\telse\n\t{\n\t\tif(minutes < 10)\n\t\t{\n\t\t\tdocument.getElementById('clock').innerHTML = \"0\" + minutes + \":\" + seconds;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdocument.getElementById('clock').innerHTML = minutes + \":\" + seconds;\n\t\t}\n\t}\n\t//Run the section logic\n\tsectioncalc();\n}", "title": "" }, { "docid": "c00428ff771a52fc80e12be2abe16ecb", "score": "0.67079604", "text": "function counter(){\n\t\tmilliseconds + 100;\n\t\tif (milliseconds == 1000) {\n\t\t\tmilliseconds = 0;\n\t\t\tseconds + 1;\n\t\t}else if(seconds == 60) {\n\t\t\tseconds = 0;\n\t\t\tminutes + 1;\n\t\t}else if(minutes == 60){\n\t\t\tminutes = 0;\n\t\t\thours + 1;\n\t\t}else {\n\t\t\tconsole.log(milliseconds);\n\t\t}\n\t}", "title": "" }, { "docid": "1af8754283dbee1b71d803a0bc2d2b44", "score": "0.6634119", "text": "function timerCount() {\n timer = setInterval(thirtySec, 1000);\n function thirtySec() {\n if (counter === 0) {\n clearInterval(timer);\n timeOutScreen();\n }\n if (counter > 0) {\n counter--;\n }\n $(\".timer\").html(counter);\n }\n}", "title": "" }, { "docid": "4b42c17702c0b262a8d8356402ea7150", "score": "0.6618966", "text": "function timer(){\n interval= setInterval(function(){\n msecond++;\n \n if(msecond==100){\n second++\n msecond=0;\n }\n \n all=second +':'+msecond;\n document.getElementById(\"timer\").textContent = all;\n },10); \n}", "title": "" }, { "docid": "0ca7b09a3e213f4043a242aef7b5955a", "score": "0.6574262", "text": "function counter(){\n\t//\tcounting time in seconds;\n\t\t'use strict';\n\t\tif(Math.floor(timer/3600) > 0){\n\t\t\tdocument.getElementById(\"timer\").innerHTML = Math.floor(timer/3600)+\"hr\"+Math.floor((timer%3600)/60)+\"m\"+(timer%3600)%60+\"s\";\n\t\t}\n\t\telse if(Math.floor(timer/60) > 0){//over a minute;\n\t\t\tdocument.getElementById(\"timer\").innerHTML = Math.floor(timer/60)+\"m\"+timer%60+\"s\";\n\t\t}\n\t\telse{\n\t\t\tdocument.getElementById(\"timer\").innerHTML = timer+\"s\";\n\t\t}\n\t\ttimer++;\n\t}", "title": "" }, { "docid": "01624a6322e6ac58282e638c7ca4fa1d", "score": "0.6573945", "text": "function updateCounter() { }", "title": "" }, { "docid": "0ceb0ac09e73da12ac49905212e027ea", "score": "0.6548391", "text": "function TimeCounter():Number\n{\n timeCounter++;\n \n if(timeCounter == 60)\n {\n\t timeCounter = 0;\n\t actualTime++;\n\t}\n\n\n}", "title": "" }, { "docid": "4dd32fe62357ecf4525350a52fa9d440", "score": "0.65379685", "text": "function timer(){\n var time=new Date();\n this.second=function(){\n var sec=time.getSeconds();\n document.write(sec);\n \n }\n}", "title": "" }, { "docid": "cfc58db5a211d7988b4487a2f348c3ed", "score": "0.653713", "text": "function startCountTime() {\n var seconds = 0;\n countingID = setInterval(() => {\n seconds += 1;\n $('.seconds').attr('value', seconds).text(seconds);\n if (seconds > 60) {\n removeSecondStar();\n return;\n }\n if (seconds > 40) {\n removeThirdStar();\n }\n }, 1000);\n }", "title": "" }, { "docid": "9b74fd35a05907b604c21c0d493d7922", "score": "0.65211785", "text": "function updateCounter()\n {\n elapsedTime += 1;\n }", "title": "" }, { "docid": "20768b2faac9ec6a6f761116739262f8", "score": "0.65129346", "text": "function count() {\r\n counter = counter - 1;\r\n // console.log(counter);\r\n $(\"#timer\").html(counter);\r\n checkForZero();\r\n}", "title": "" }, { "docid": "22af4e3c5b9c4bca38c0dcd8b41f710d", "score": "0.65038306", "text": "function timer(){\n\t\tcount = count-1;\n\t\tif (count <= 0){\n\t\t\tclearInterval(counter);\n\t\t\tquitGameTwo();\n\t\t} //end if\n\t\t\n\t\tif(count < 10){\n\t\t\t$(\"#time\").html(\"0:\" + count + \"0\");\n\t\t} else {\n\t\t\t$(\"#time\").html(\"0:\" + count);\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "7ac56a3488aa9d717628896340351400", "score": "0.6472186", "text": "function start_counting(){\r\n\tvar counter = hours + \":\" + minutes + \":\" + seconds;\r\n\tseconds += 1;\r\n\tif (seconds == 60) {\r\n\t\tminutes += 1;\r\n\t\tseconds = 0;\r\n\t\tif (minutes == 60){\r\n\t\t\thours += 1;\r\n\t\t\tminutes = 0;\r\n\t\t}\r\n\t}\r\n\tdocument.getElementById(\"counter\").innerHTML = counter;\r\n}", "title": "" }, { "docid": "d3fb48ee15ec3a934901ebd6ad110bf5", "score": "0.6445958", "text": "function startTimer() {\n\t\tvar counter = 10;\n\t\tsetInterval(function () {\n\t\t\tcounter--;\n\t\t\tif (counter >= 0) {\n\t\t\t\tspan = document.getElementById(\"count\");\n\t\t\t\tspan.innerHTML = counter;\n\t\t\t}\n\t\t\t//when counter === 0 play sound\n\t\t\tif (counter === 2) {\n\t\t\t\ttimerSound.play();\n\t\t\t\tclearInterval(counter);\n\t\t\t}\n\t\t}, 1000);\n\t}", "title": "" }, { "docid": "5e172f941c290683749bcc08f16d2439", "score": "0.64448655", "text": "function timer(){\n totalsec++\n seconds++\n if(seconds==60){\n minutes++\n seconds=0;\n }\n document.querySelector('#time').innerHTML = `Elapsed ${(\"0\" + minutes).slice(-2)}:${(\"0\" + seconds).slice(-2)}`;\n }", "title": "" }, { "docid": "c955e2e60f5c0e8fa2859c406d5ee910", "score": "0.6437921", "text": "function onesSeconds(){\n onesSec === 0 ? onesSec = 9 : onesSec -= 1 ;\n}", "title": "" }, { "docid": "edf3c336ee73dad7758713833509ea8e", "score": "0.6431504", "text": "function countDownSecond(remainingSecond, callback) {\n\n overTime = 1000 * remainingSecond;\n nowTime = new Date();\n endTime = new Date(nowTime.getTime() + overTime);\n\n callback();\n //getRemainingSecond();\n}", "title": "" }, { "docid": "3b020cf6362a45891a9b6c3cd4e99181", "score": "0.6426369", "text": "function timer() { \n let sec = 0;\n let min = 0;\n let hour = 0;\n countdown = setInterval(function () {\n counter[0].innerHTML = `${hour}:${min}:${sec}`;\n counter[1].innerHTML = `${hour}:${min}:${sec}`;\n sec++;\n if (sec == 60) {\n sec = 0;\n min++;\n if (min == 60) {\n min = 0;\n hour++;\n }\n }\n }, 1000);\n}", "title": "" }, { "docid": "851fe6567aaf0e545993f8ed5afd6b85", "score": "0.64210737", "text": "function counter(n) {\n\n}", "title": "" }, { "docid": "a47b01f4578eb4865ffbee08999ac2c6", "score": "0.6403469", "text": "function timerWrapper() {\n timer = setInterval(twentySec, 1000);\n function twentySec() {\n if (counter === 0) {\n clearInterval(timer);\n generateLossDueToTimeOut();\n }\n if (counter > 0) {\n counter--;\n }\n $(\".timer\").html(counter);\n }\n }", "title": "" }, { "docid": "7e453534d670b4077ca3159c5e42a5d4", "score": "0.6398766", "text": "function timedCount() {\r\n document.getElementById(\"timer\").innerHTML = c;\r\n c = c + 1;\r\n t = setTimeout(timedCount, 1000);\r\n}", "title": "" }, { "docid": "d5cb8152e20f04ab5f6c9f8495878fc0", "score": "0.63541204", "text": "function timer() {\n intervalId = setInterval(function() {\n $(\"#timer\").text(count+\" Seconds\");\n count--; \n if(count<0) {\n timeOver();\n } \n },1000) ;\n }", "title": "" }, { "docid": "c3e9c1a0a9413d2abd01e74fab36553f", "score": "0.63166004", "text": "function setCounter() {\n\t\t\n\t\tfunction display(element) { // display n<10 as 0n ( 1 as 01, ...)\n\t\t\t\n\t\t\tvar s, m;\n\t\t\t\n\t\t\ts = (secs < 10)? \"0\" + secs : secs;\n\t\t\tm = (mins < 10)? \"0\" + mins : mins;\n\t\t\t\n\t\t\telement.innerHTML = m + \":\" + s;\n\t\t\t\n\t\t}\t\n\t\t\n\t\tfunction countup() {\n\t\t\t\n\t\t\tsecs++;\n\t\t\t\n\t\t\tif(secs==60){\n\t\t\t\tmins++;\n\t\t\t\tsecs = 0;\n\t\t\t\t\n\t\t\t}\t\t\t\t\t\n\t\t\t\n\t\t\tdisplay(document.getElementById(\"countup\"));\t\t\t\n\t\t\t\n\t\t}\t\n\t\t\t\t\t\n\t\tvar secs = 0;\n\t\tvar mins\t= 0;\n\t\t\n\t\tint = setInterval(countup,1000); // countup each second\n\t\t\t\t\t\n\t}", "title": "" }, { "docid": "ee2115f7411b8e2b0c6ce8bae97ad8fe", "score": "0.631132", "text": "counter() {\n return this.clicks * 2;\n }", "title": "" }, { "docid": "0caf6fbd0dc6e3364e28038d48f8c6f6", "score": "0.62954617", "text": "function startTimer() {\n goTime = setInterval(timeOn, 1000);\n function timeOn() {\n timer.text(second);\n second = second + 1;\n }\n}", "title": "" }, { "docid": "fe89fb283918efb5dfb85fe830be5e6e", "score": "0.6294777", "text": "function timerOnTenSecond() {\n var data1 = new Date();\n var data2;\n var secondCounter = 1;\n\n do{\n data2 = new Date();\n\n if (((data2 - data1) / 1000) > secondCounter){\n console.log(secondCounter + ' sec');\n secondCounter++;\n }\n }while(((data2 - data1) / 1000) < 10);\n console.log('10 sec');\n}", "title": "" }, { "docid": "4f96786108395667abf717ebfeb20a3d", "score": "0.6288975", "text": "function timerWrapper() {\ntheClock = setInterval(thirtySeconds, 1000);\nfunction thirtySeconds() {\nif (counter === 0) {\nclearInterval(theClock);\ngenerateLossDueToTimeOut();\n}\nif (counter > 0) {\ncounter--;\n}\n$(\".timer\").html(counter);\n}\n}", "title": "" }, { "docid": "de3b42bd111cd0aa6b81defc7c834a68", "score": "0.62884957", "text": "function timer() {\n\t// Update the count every 1 second\n\ttime = setInterval(function() {\n\t\tseconds++;\n\t\t\tif (seconds === 60) {\n\t\t\t\tminutes++;\n\t\t\t\tseconds = 0;\n\t\t\t}\n\t\ttimeCounter.innerHTML = \"<i class='fa fa-hourglass-start'></i>\" + \" Timer: \" + minutes + \" Mins \" + seconds + \" Secs\" ;\n\t}, 1000);\n}", "title": "" }, { "docid": "014d7f2ce0fc5168be449547fff054ac", "score": "0.6247815", "text": "function count() {\n\tcounter--;\n\tcurrentTime = timeConverter(counter);\n\t$(\"#timer\").text(currentTime);\n\tconsole.log(counter);\n\tif(counter === 0){\n\t\tresetClock();\n\t\tcurrent_question++;\n\t\tupdateQuestion(current_question);\n\t}\n}", "title": "" }, { "docid": "fa4d4c5bb99f0356256646a04db6ad72", "score": "0.6244219", "text": "function score_tail(){\n\t$('#counter_tail')[0].innerHTML++\n}", "title": "" }, { "docid": "5ffb2f7722c513112ad5c26da0e81f72", "score": "0.6238863", "text": "function counter() {\n if (openCards.length % 2 === 0){\n count++;\n moves.textContent = count;\n checkScore();\n }\n}", "title": "" }, { "docid": "f11704acfb6bee4c30e88a5a526dc6a3", "score": "0.62358767", "text": "function fiveSecondsRegress(){\n var secondRegress = $('.regresive-counter')[0].innerHTML;\n secondRegress = parseInt(secondRegress);\n secondRegress = secondRegress - 1;\n $('.regresive-counter')[0].innerHTML = secondRegress;\n if(secondRegress == 0){\n clearInterval(secondsRegressInterval);\n $('.preloader').css('display','none');\n $('.regresive-counter').css('display','none');\n $('.nextVideoPoster').css('display','none');\n $('.regresive-counter')[0].innerHTML = '5';\n }\n }", "title": "" }, { "docid": "86434dd9e9df6d78f8f8355a9c8271eb", "score": "0.6234778", "text": "function startTimer(){\n var timeinterval = setInterval(function(){\n timer.innerText = count\n count--;\n }, 1000);\n}", "title": "" }, { "docid": "631c3f86a568d76951d07e8a8f6cf50b", "score": "0.6225454", "text": "function startCounting() {\n for(var sec = 1; sec <= totalSeconds; sec++)\n timer = setTimeout(countDown, (1000*sec));\n}", "title": "" }, { "docid": "b9db7e02fbb426e8ef491941d9d21d1e", "score": "0.62222856", "text": "function setTime() {\n second+=1;\n seconds.innerHTML =pad(second);\n if (second===60)//evey 60 seconds minutes counter increase by one\n {\n \tsecond=0;\n \tminute+=1;\n \tminutes.innerHTML =pad(minute);\n }\n \n}", "title": "" }, { "docid": "7aecf0c52e91cf953b758a23fe769c4a", "score": "0.6196394", "text": "function timer () {\n\tintervalId = setInterval(count, 10);\n}", "title": "" }, { "docid": "72c15ff5fda93e491635f94d5fda13e7", "score": "0.6196039", "text": "function counter() {\n count = count + 1;\n return count;\n }", "title": "" }, { "docid": "8be1f9d434e628ef3b5c4427cff6c670", "score": "0.61942536", "text": "function counterFunc() {\r\n if (counter > 0) {\r\n counter--;\r\n time.textContent = counter;\r\n } else {\r\n clearInterval();\r\n game_over.style.display = 'block';\r\n }\r\n}", "title": "" }, { "docid": "3d313b2b24bcec9d73f704726ea952e1", "score": "0.6186293", "text": "function timer(){\r\n\t\t\t\ttimerCount=timerCount-1;\r\n\t\t\t\tif(timerCount<=-1){\r\n\t\t\t\t\t return;\t\r\n\t\t\t\t}\r\n\t\t\t\tif(timerCount<=0){\r\n\t\t\t\t\tsym.$(\"OK\").hide();\r\n\t\t\t\t\tif(acnt!=5){\r\n\t\t\t\t\t\tsym.$(\"badresult\").show();\r\n\t\t\t\t\t\tsym.$(\"time2\").hide();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsym.$(\"a\").html(acnt);\r\n\t\t\t\t}\r\n\t\t\t\tconsole.log(\"tCounter\");\t \r\n sym.getComposition().getStage().getSymbol(\"time\").$(\"time_txt\").html(timerCount); // Display the timer value \r\n \t}", "title": "" }, { "docid": "9df9d738a861e977f54632287d8d829a", "score": "0.6185203", "text": "function timer()\n{\n count=count-1;\n if (count <= 0)\n {\n clearInterval(counter);\n return;\n }\n document.getElementById(\"timer\").innerHTML=count + \" secs\"; // watch for spelling\n}", "title": "" }, { "docid": "3c72163bd9e7d66d9f52d4b32a401a8c", "score": "0.6169033", "text": "function timer() {\n if (active) {\n sec++;\n if (sec < 10) {\n sec = \"0\" + sec;\n if (min < 1) {\n min = 0 + \"0\"\n }\n }\n if (sec == 60) {\n min++\n sec = 0 + \"0\";\n if (min < 10) {\n min = \"0\" + min;\n }\n }\n\n timerCount.innerHTML = `${min}:${sec}`;\n // repeat timer every 1 second\n setTimeout(timer, 1000)\n }\n}", "title": "" }, { "docid": "432aed280489e3d996dac642e1c7540f", "score": "0.61594886", "text": "function secondCounter() {\n seconds_passed ++;\n \n console.log(seconds_passed);\n \n // ---- ---- Vänta två sekunder så att användaren hinner gå från bordet\n if (seconds_passed == 3){\n console.log(\"3 sekunder\");\n \n //Starta kalibrering\n //Detta gör så att azmax börjar spelas in nere under window.ondevicemotion ------------------- Notera att det är först här axmax börjar spelas in, och då skrivs modalen ut. \n currently_calibrating = true;\n azmax = 0;\n document.getElementById(\"modal_text\").innerHTML = \"Kalibrerar <br> Max movement: \" + azmax;\n }\n \n \n // ---- ---- Ytterligare sex sekunder senare\n // Avsluta och ställ in värden\n if (seconds_passed > 8){\n console.log(\"9 sekunder\");\n \n //När azmax har spelats in i 7 sekunder, sätt den till threshold (occh lägg på marginal)\n threshold = (azmax * safety_margin);\n \n //Sätt minimigränsen på slidern till threshold\n slider.setAttribute(\"min\", threshold.toString());\n slider.setAttribute(\"value\", threshold.toString());\n slider.setAttribute(\"step\", threshold.toString());\n \n //EXTREMT FULT SÄTT ATT SÄTTA MAX, OCH DET SKALL LÖSAS\n threshold *= 40;\n slider.setAttribute(\"max\", threshold.toString());\n threshold /= 40;\n \n //Skriv ovanför slidern\n output.innerHTML = \"Styrka: \" + threshold.toString();\n \n //Skriv ut klart!\n document.getElementById(\"modal_text\").innerHTML = \"Klart!\";\n \n //Lägg in en \"Avsluta knapp\"\n document.getElementById(\"btn_field\").innerHTML = '<button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Grymt!</button>'\n \n //Avsluta loop\n clearInterval(loopVar);\n \n //Stäng av klibreringen i window.Ondevicemotion\n currently_calibrating = false;\n }\n }", "title": "" }, { "docid": "19f34d21025887c9424217b056d2bf62", "score": "0.6159385", "text": "function checkSeconds(i) {\n if (i === 59) {\n return 0;\n } else {\n return i + 1;\n }\n\n}", "title": "" }, { "docid": "c6b58e8b7fa522ee0bcb273544845a8d", "score": "0.61522627", "text": "function timer() {\nmsec++\nmsecHeading.innerHTML = msec;\nif (msec >= 100) {\n sec++\n secHeading.innerHTML = sec\n msec = 0;\n}\n\nelse if(sec >= 60) {\n min++\n minHeading.innerHTML = min;\n sec =0 \n}\n}", "title": "" }, { "docid": "6b67f61a76af2e25c5deb7f525d7fb8a", "score": "0.61502916", "text": "function gameTimer () {\n setInterval(function() {\n formattedSecond = (\"0\" + second).slice(-2);\n timer.innerHTML = `${minute}:${formattedSecond}`;\n if(second == 60){\n minute++;\n second=0;\n }\n second++;\n },1000)\n}", "title": "" }, { "docid": "7ee9f88aa25b72dae09844c8eb0956f3", "score": "0.61388296", "text": "function time_count(){\n\t\t\t\tvar temp = new Date();\n\n\t\t\t\tvar t2 = temp.getSeconds();\n\t\t\t\tif(t1 != t2){\n\t\t\t\t\ttime--;\n\t\t\t\t\tt1 = t2;\n\t\t\t\t}\n\t\t\t\tif(time<1){\n\t\t\t\t\tconsole.log(time);\n\t\t\t\t\tdocument.getElementById(\"overid\").style.display = \"block\";\n\t\t\t\t\tdocument.getElementById(\"boardid\").style.display = \"none\";\n\t\t\t\t\tdocument.getElementById(\"win\").style.display = \"none\";\n\t\t\t\t\tclearInterval(time_id);\n\t\t\t\t}\n\t\t\t\tdocument.getElementById(\"time\").innerHTML = time + \" sec\";\n\t\t\t}", "title": "" }, { "docid": "04e5d1eb6228728c761fa398269e369f", "score": "0.61325186", "text": "function clock(){\n sec+=1;\n playTime = convertSeconds(sec);\n document.querySelector('.timer').innerHTML=playTime;\n }", "title": "" }, { "docid": "daf075693613e3223153d33cbde3ab75", "score": "0.6123718", "text": "function countTheSeconds() {\n //declare function countTheSeconds\n //var secondsCounted = getTime + \n}", "title": "" }, { "docid": "0103c4444191b1129422e2d704f13cf0", "score": "0.6098907", "text": "function studyInc() {\n if (time < 50) {\n time++;\n countdown = time;\n totalSeconds += 60;\n $('#study-length').html(time);\n }\n}", "title": "" }, { "docid": "9973bf0bf5c678c75fc1b893b07841f0", "score": "0.60958564", "text": "function updateTime() {\n ++seconds;\n document.getElementById(\"soFar\").innerHTML = seconds;\n } // end function updateTime", "title": "" }, { "docid": "8f37cc22c45a9b4b0c1e4e811f284ae8", "score": "0.6094522", "text": "function startTime() {\n counter += 1;\n document.querySelector('.counter').innerHTML = counter; \n t = setTimeout(startTime, 1000);\n}", "title": "" }, { "docid": "a0e7ef54097fcb939b235134853b7a84", "score": "0.60805994", "text": "function timer(){\r\n \t\t\t\ttimerCount=timerCount-1;\r\n \t\t\t\tif(timerCount<=-1){\r\n \t\t\t\t\t return;\t\r\n \t\t\t\t}\r\n \t\t\t\tif(timerCount<=0){\r\n \t\t\t\t\tsym.$(\"OK\").hide();\r\n \t\t\t\t\tif(acnt!=5){\r\n \t\t\t\t\t\tsym.$(\"badresult\").show();\r\n \t\t\t\t\t\tsym.$(\"time2\").hide();\r\n \t\t\t\t\t}\r\n \t\t\t\t\tsym.$(\"a\").html(acnt);\r\n \t\t\t\t}\r\n \t\t\t\tconsole.log(\"tCounter\");\t \r\n sym.getComposition().getStage().getSymbol(\"time\").$(\"time_txt\").html(timerCount); // Display the timer value \r\n \t}", "title": "" }, { "docid": "a0e7ef54097fcb939b235134853b7a84", "score": "0.60805994", "text": "function timer(){\r\n \t\t\t\ttimerCount=timerCount-1;\r\n \t\t\t\tif(timerCount<=-1){\r\n \t\t\t\t\t return;\t\r\n \t\t\t\t}\r\n \t\t\t\tif(timerCount<=0){\r\n \t\t\t\t\tsym.$(\"OK\").hide();\r\n \t\t\t\t\tif(acnt!=5){\r\n \t\t\t\t\t\tsym.$(\"badresult\").show();\r\n \t\t\t\t\t\tsym.$(\"time2\").hide();\r\n \t\t\t\t\t}\r\n \t\t\t\t\tsym.$(\"a\").html(acnt);\r\n \t\t\t\t}\r\n \t\t\t\tconsole.log(\"tCounter\");\t \r\n sym.getComposition().getStage().getSymbol(\"time\").$(\"time_txt\").html(timerCount); // Display the timer value \r\n \t}", "title": "" }, { "docid": "9b7f62727ea6d499b6c60c529ed6d2eb", "score": "0.60767114", "text": "function countDownFunction(){\n interval = setInterval(function(){\n countDown--;\n containerLoader.html(countDown);\n if ( parseInt(countDown) === 0 ){\n nextQuestion();\n }\n },1000);\n }", "title": "" }, { "docid": "9cdf57fc172bb6df8a5f649e4b25ca7b", "score": "0.60757536", "text": "function updateTime() {\n seconds++;\n timer.textContent =\"Time elapsed: \" + seconds;\n}", "title": "" }, { "docid": "ce194b56a722e1e7ef87df3ea194baa2", "score": "0.607346", "text": "function countTimer() {\n\n matchingGame.elapsedTime++;\n\n // calculate the minutes and seconds from elapsed time\n var minute = Math.floor(matchingGame.elapsedTime / 60);\n var second = matchingGame.elapsedTime % 60;\n\n // add padding 0 if minute and second is less then 10\n if (minute < 10) minute = \"0\" + minute;\n if (second < 10) second = \"0\" + second;\n\n // display the elapsed time\n $(\"#elapsed-time\").html(minute + \":\" + second);\n }", "title": "" }, { "docid": "660b387220de463142169f1f642a35be", "score": "0.6069451", "text": "function timerFunc() {\n\t\t$('#timeText').text(timer);\n\t\ttimer++;\n\t}", "title": "" }, { "docid": "f6f85acb4e9fd7cb714ae3235995143c", "score": "0.606746", "text": "function startTimer() {\n timer = setInterval(function () {\n count--;\n console.log(count);\n timeCount.textContent = count;\n if (count === 0) {\n // stops execution of action at set interval\n clearInterval(timer);\n }\n }, 1000); // timer is a loop, iterates\n}", "title": "" }, { "docid": "de9f8bef12287853f0b014ad251906d8", "score": "0.60657084", "text": "function countr()\r\n{\r\n document.getElementById('s').value = c\r\n c = c + 1\r\n setTimeout(\"countr()\", 1000)\r\n}", "title": "" }, { "docid": "33f42ad50e53f208398caa58b8625b6c", "score": "0.606392", "text": "function timedCount() {\n time = time + 1;\n t = setTimeout(\"timedCount()\", 1000);\n}", "title": "" }, { "docid": "f135c9115b8131ce443a537d7fcb2143", "score": "0.6055916", "text": "function countTimer() {\n totalSeconds++;\n const hour = Math.floor(totalSeconds / 3600);\n const minute = Math.floor((totalSeconds - hour * 3600) / 60);\n const seconds = totalSeconds - (hour * 3600 + minute * 60);\n\n timePlayed = `${pad(hour, 2, '0')}:${pad(minute, 2, '0')}:${pad(seconds, 2, '0')}`;\n timer.innerText = timePlayed;\n}", "title": "" }, { "docid": "c1615a0613011f356439240c56271397", "score": "0.6052437", "text": "function timer() {\n sec += 1;\n\n if (sec >= 60) {\n sec = 0;\n mins += 1;\n\n if (mins >= 60) {\n mins = 0;\n hrs += 1;\n }\n }\n}", "title": "" }, { "docid": "7d74c7be7b05a1e39bffe666b33d2f40", "score": "0.60514003", "text": "function countSecondLeft (){\n secondLeft--;\n timer.textContent = \"Time : \" + Math.max(0,secondLeft);\n // when time is up or no more question\n if (secondLeft <= 0 || currentQues>(numOfQuestion-1)){\n // clear interval - stop counting down\n clearInterval(timeInterval);\n // hide the question body (function 0)\n hideQuestionBody();\n // show the result body (function 12)\n showResultBody();\n }\n // else continue to count down (no action)\n}", "title": "" }, { "docid": "84738bd0432c9b8099d979560137f127", "score": "0.60512406", "text": "function incrementSeconds(array){\n for(let i=0; i<array.length; i++){\n if(i%2 !== 0){\n array[i]= array[i]+1;\n }\n console.log(array[i]);\n }\n return array;\n }", "title": "" }, { "docid": "a4f3cedbc12d773980551a704ec21eef", "score": "0.60480666", "text": "function tensSeconds(){\n if(onesSec === 9 && tensSec === 0){\n \ttensSec = 5;\n }else if(onesSec === 9 && tensSec > 0){\n \ttensSec -= 1;\n }\n}", "title": "" }, { "docid": "fe328dc1fea1114e7893d504941da931", "score": "0.60424745", "text": "function timer()\n {\n count=count-1;\n $('#timer').attr(\"style\", \"color: #70bf4f\");\n if (count < 0)\n {\n clearInterval(counter);\n $('.continue-delay').removeClass('hidden');\n return;\n };\n\n document.getElementById(\"timer\").innerHTML=count; // watch for spelling\n }", "title": "" }, { "docid": "4670fb99a01bf6e568e9a664c3b842a8", "score": "0.6037917", "text": "function times2Async (number, timescallback) {\n\t\ttimesAsync (number, 2, timescallback)\n\t}", "title": "" }, { "docid": "472aecd0c7b294d0d8c3e9c28b6d0b71", "score": "0.6018765", "text": "function updateTime(){\n\tif(tenthSeconds < 9){\n\t\t\ttenthSeconds++;\n\t\t}else {\n\t\t\ttenthSeconds = 0;\n\t\t\tseconds++\n\t\t}\n\n\t\ttimerDisplay.textContent = seconds +\".\"+tenthSeconds;\n}", "title": "" }, { "docid": "145c7c7e73906f75e44b1ab828bbc913", "score": "0.6013857", "text": "function timecounting() {\n myTime = setInterval(() => {\n time = time - 1;\n\n if (time <= 0) {\n document.getElementById('timecount').innerHTML = 0;\n return;\n } document.getElementById('timecount').innerHTML = time;\n }, 1000)// every 1 second, it will decrease 1 into time variable (computer use millisecond so 1000 is 1 second)\n}", "title": "" }, { "docid": "5bafc9c4ffc395b371189076bacc5150", "score": "0.6012973", "text": "incrementTimesSeen() {\n this.timesSeen++;\n }", "title": "" }, { "docid": "fcf6aa0be5c7bda4361345654f23d7ab", "score": "0.60067403", "text": "function timer(){\n if(count > 0) {\n count--;\n if (count===0) {\n resetTimer();\n }\n $timer.html(\"Timer: \"+count + \" seconds\");\n }\n }", "title": "" }, { "docid": "a1f2ee253db6696e578490ed9858ba70", "score": "0.60019875", "text": "function startClock(){\n var counter = 6;\n setInterval(function() {\n counter--;\n if (counter >= 0) {\n span = document.getElementById(\"count\");\n span.innerHTML = counter;\n // span.innerHTML = counter + '!';\n }\n if (counter === 1) {\n span = document.getElementById(\"count\");\n span.innerHTML = 'OH MY GOD';\n }\n if (counter === 0) {\n span = document.getElementById(\"count\");\n span.innerHTML = '';\n }\n }, 1000);\n}", "title": "" }, { "docid": "a712384eb0666d2adb4c0319a469eaf8", "score": "0.5997686", "text": "function SECS_TO_TIMER(secs) {return secs*1000;}", "title": "" }, { "docid": "19b1fd1c07b3ec00527ad3e270764c19", "score": "0.5995177", "text": "goToSecond(s) {\n as(s, Number);\n let i;\n let e;\n \n this.start();\n \n for(i = 0; i < s; i++) {\n this.advanceToNextSecond();\n }\n\n if(s === 0) {\n // If second is zero, the event are not removed from the queue\n // Cause problem with isCompleted() when the build order is empty\n // isCompleted() should return true but returns false because the main building is considered in construction\n\n while((e = this._pollEvent()) !== null) {\n e.trigger(this);\n }\n }\n }", "title": "" }, { "docid": "e750705a042aa7b16065283033d62c65", "score": "0.59950274", "text": "function initTime() {\n\tcurrentTimer = setInterval(function () {\n\t\t$timer.text(`${second}`)\n\t\tsecond = second + 1\n\t}, 1000);\n}", "title": "" }, { "docid": "38c824dfa040ca39eddce06fdab26233", "score": "0.59919167", "text": "function countDownTimer(){\n\t\t\t\tcountDown.style.display = \"block\";\t\n\t\t\t\tcountDown.style.opacity = 1;\t\n\t\t\t\tcountDownAudio.play();\n\t\t\t\tcountDown.innerHTML=x;\n\t\t\t\tif (x<1) {\n\t\t\t\t\tclearInterval(interval);\n\t\t\t\t\tgoFunction();\t\t\n\t\t\t\t}\n\t\t\t\tx--;\n\t\t\t}", "title": "" }, { "docid": "36151743507de200983c7786c29d9b3d", "score": "0.5987924", "text": "function counter() {\r\n count: 0;\r\n return counter.count++;\r\n }", "title": "" }, { "docid": "968b61fda52ffa6563865346aae10db3", "score": "0.5984989", "text": "function timedCountTwo() {\n document.getElementById('counterTwo').innerHTML = '<img src=\"img/clock.gif\" width=\"20\" height=\"20\" />&nbsp; &nbsp;' + c;\n c = c - 1;\n\n\n\n t = setTimeout(function () {\n timedCountTwo()\n }, 1000);\n if (c == -1) {\n c = 30;\n stopCountTwo();\n\n alert('หมดเวลา!');\n\n var point = (parseInt($('#pointTwo').text()));\n var life = (parseInt($('#lifeTwo').text()));\n\n if (point == 0) {\n var calLifee = life - 1;\n document.getElementById('lifeTwo').innerHTML = calLifee;\n startGameTwo();\n } else {\n\n var calPoint = point - 1;\n document.getElementById('pointTwo').innerHTML = calPoint;\n\n }\n\n\n if (life == 0) {\n // alert('Game Over');\n stopCount();\n $('#resultPoint').val(point);\n $.mobile.pageContainer.pagecontainer(\"change\", \"#gameOver\");\n } else {\n var calLifee = life - 1;\n document.getElementById('lifeTwo').innerHTML = calLifee;\n startGameTwo();\n }\n\n\n\n\n\n return;\n } //เมื่อหมดเวลาแล้วจะหยุดการทำงานของ function display\n}", "title": "" }, { "docid": "1d0f1fb792302532cececc331445a37d", "score": "0.59846526", "text": "function toDoWhileCounting() {\t\t\n\t\ttimer_div = document.getElementById('timeleft');\n\t\ttimer_div.innerHTML = CounterStart + \" seconds remaining!\";\t\n\t\t//console.log(CounterStart);\n\t\t//popup.document.timer.timeleft.value = CounterStart;\t\t\n\t\t//console.log(\"counting down..\");\n\t\t// other things lol\n\t}", "title": "" }, { "docid": "8420f33c6900c74e54bde328200f9fa9", "score": "0.59824216", "text": "function secondaryLabelInterval(pxPerSec) {\n // draw one every 10s as an example\n return Math.floor(10 / timeInterval(pxPerSec));\n}", "title": "" }, { "docid": "5e104f6a93a42eb978802b563d64dc36", "score": "0.59799737", "text": "function startTimer() {\n let cardclick = 0;\n $(\".card\").click(function() {\n cardclick += 1;\n if (cardclick === 1) {\n timer = setInterval(function() {\n $(\".seconds\").html(++sec);\n }, 1000);\n }\n })\n}", "title": "" }, { "docid": "44dc8487ead64142476c07287505ef83", "score": "0.5971429", "text": "function incrementTheSeconds(arr){\n for(var i=0;i<arr.length;i++){\n if (arr[i]%2!==0){ //if number is odd\n console.log(arr[i]+=1); // add 1\n }\n }\n return arr;\n }", "title": "" }, { "docid": "84450f2aea5e0155feb48a55fdd17937", "score": "0.59711355", "text": "function setTimer() {\n secs++;\n min = secs / 60;\n if (Number.isInteger(min)) {\n mins++;\n secs = 0;\n counter.textContent = `${ leadZero(mins) }:${ leadZero(secs) }`;\n } else {\n counter.textContent = `${ leadZero(mins) }:${ leadZero(secs) }`;\n }\n\n\n}", "title": "" }, { "docid": "2a7d1ae21c6aa69993369b189fce59af", "score": "0.59630406", "text": "function timer(){\r\n\t\tnb = nb - 1;\r\n\t\t$('.Rebours').html(nb);\r\n\t\tif(nb===0){\r\n\t\t\tclearInterval(interval);\r\n\t\t}\r\n\r\n}", "title": "" }, { "docid": "7d55b2bc207b61260027a8e4ced33d10", "score": "0.5960537", "text": "function startCount() {\n if (!timerOn) {\n timerOn = 1;\n countTime();\n }\n}", "title": "" }, { "docid": "f74faf04fbe00793ab642a7dc069feec", "score": "0.5960339", "text": "function count() {\n timer--;\n $('#time_span').html(timer + \" Seconds\");\n if(timer === -1){\n endGame();\n }\n }", "title": "" }, { "docid": "3a6bbeb05a6900a32f9b34d48e3c4692", "score": "0.59580106", "text": "function initTimerPerSecond1(segundos,functionPerSecond, finishFunction){\n\tvar contador = 1;\n\tvar timerPerSecond = setInterval(function(){\n\t\tif((contador % 2) == 0){\n\t\t\tfunctionPerSecond();\n\t\t}\n\n\t\tif(contador == segundos && !notFinish1){\n\t\t\tfinishFunction();\n\t\t}\n\n\t\tif(contador == segundos || stopExecPerSecond1){\n\t\t\tclearInterval(timerPerSecond);\n\t\t}\n\n\t\tcontador ++;\n\t},1000);\n}", "title": "" }, { "docid": "0ea3ce546fffb58c2cfbbe7b4f414319", "score": "0.59579796", "text": "function counter() {\n\tlet move = document.querySelector(\"#move\");\n\tmove.innerHTML = \" Move\";\n\tnumber++;\n\tmoves.innerHTML = number;\n\tif (number === 1) {\n\t\tsetTimer();\n\t} else {\n\t\tmove.innerHTML = \" Moves\";\n\t};\n\trating();\n}", "title": "" }, { "docid": "a6432d07e3389f3f062844e32eaed799", "score": "0.5957198", "text": "function count(counter) {\n while (counter < 5) {\n counter += 1;\n }\n }", "title": "" }, { "docid": "c51613e23257b0bb3a05fed2b8342c30", "score": "0.5956203", "text": "function countcoinsPerSecond(single, ten) {\n coinsPerSecond = single + ten * 10;\n document.getElementById('coins-per-second').innerHTML = coinsPerSecond;\n document.getElementById('coins-available').innerHTML = coinsAvailable;\n return coinsPerSecond;\n}", "title": "" }, { "docid": "192aa71dafcc7bb32e69bddb30cb0a46", "score": "0.59464467", "text": "function counter(){\n count =count-0.1;\n count= Math.round(count * 10) / 10\n console.log(count)\n countTime.innerText=count\n if(count==0){\n cancel()\n }\n}", "title": "" }, { "docid": "5d23ba710afac6d72d1e743eac4fbbfc", "score": "0.59452564", "text": "function incremCounter(){\n count += 1;\n counter.innerText = count;\n}", "title": "" }, { "docid": "b10de1936ce4bcca0851aa0dea6afb9e", "score": "0.5940963", "text": "function doTimer( evt )\r\n{\r\n\t// Timer keeps track of current iteration\r\n\t$(\"#txtCount\" ).text( REPEAT - evt.target.currentCount );\r\n}", "title": "" }, { "docid": "4276804fdfe757abb3afaf7a468bad87", "score": "0.59394133", "text": "function penalty(){\n var penalty = 15;\nseconds = seconds - penalty;\n document.getElementById(\"timer\").innerHTML =\"timer: \" + --seconds;\n\n}", "title": "" }, { "docid": "5586691bc0d2ce16737c1a7db3468330", "score": "0.5937036", "text": "static secondTick() {\n wordStatisticsManager.tickSecondTime = parseInt(new Date().getTime() / 1000);\n let expireKeys = new Array();\n for (let second of wordStatisticsManager.expireWordMap.keys()) {\n if (wordStatisticsManager.tickSecondTime - second > 5) {\n expireKeys.push(second)\n }\n }\n let deleteWord = new Array();\n expireKeys.forEach(key => {\n wordStatisticsManager.expireWordMap.get(key).forEach(element => {\n deleteWord.push(element);\n });\n wordStatisticsManager.expireWordMap.delete(key);\n });\n wordStatisticsManager.delPolularWord(deleteWord);\n }", "title": "" } ]
883422b37e511d9020dd9a9a76b053be
Internal usage. Do not use in your code since this will be removed.
[ { "docid": "90d6d63765f12bd1aa46bde0c6fb7613", "score": "0.0", "text": "function generateTrigger(PortalComponent) {\n var Trigger = /*#__PURE__*/function (_React$Component) {\n _inherits(Trigger, _React$Component);\n var _super = _createSuper(Trigger);\n\n // ensure `getContainer` will be called only once\n function Trigger(props) {\n var _this;\n _classCallCheck(this, Trigger);\n _this = _super.call(this, props);\n _defineProperty$2(_assertThisInitialized(_this), \"popupRef\", /*#__PURE__*/React.createRef());\n _defineProperty$2(_assertThisInitialized(_this), \"triggerRef\", /*#__PURE__*/React.createRef());\n _defineProperty$2(_assertThisInitialized(_this), \"portalContainer\", void 0);\n _defineProperty$2(_assertThisInitialized(_this), \"attachId\", void 0);\n _defineProperty$2(_assertThisInitialized(_this), \"clickOutsideHandler\", void 0);\n _defineProperty$2(_assertThisInitialized(_this), \"touchOutsideHandler\", void 0);\n _defineProperty$2(_assertThisInitialized(_this), \"contextMenuOutsideHandler1\", void 0);\n _defineProperty$2(_assertThisInitialized(_this), \"contextMenuOutsideHandler2\", void 0);\n _defineProperty$2(_assertThisInitialized(_this), \"mouseDownTimeout\", void 0);\n _defineProperty$2(_assertThisInitialized(_this), \"focusTime\", void 0);\n _defineProperty$2(_assertThisInitialized(_this), \"preClickTime\", void 0);\n _defineProperty$2(_assertThisInitialized(_this), \"preTouchTime\", void 0);\n _defineProperty$2(_assertThisInitialized(_this), \"delayTimer\", void 0);\n _defineProperty$2(_assertThisInitialized(_this), \"hasPopupMouseDown\", void 0);\n _defineProperty$2(_assertThisInitialized(_this), \"onMouseEnter\", function (e) {\n var mouseEnterDelay = _this.props.mouseEnterDelay;\n _this.fireEvents('onMouseEnter', e);\n _this.delaySetPopupVisible(true, mouseEnterDelay, mouseEnterDelay ? null : e);\n });\n _defineProperty$2(_assertThisInitialized(_this), \"onMouseMove\", function (e) {\n _this.fireEvents('onMouseMove', e);\n _this.setPoint(e);\n });\n _defineProperty$2(_assertThisInitialized(_this), \"onMouseLeave\", function (e) {\n _this.fireEvents('onMouseLeave', e);\n _this.delaySetPopupVisible(false, _this.props.mouseLeaveDelay);\n });\n _defineProperty$2(_assertThisInitialized(_this), \"onPopupMouseEnter\", function () {\n _this.clearDelayTimer();\n });\n _defineProperty$2(_assertThisInitialized(_this), \"onPopupMouseLeave\", function (e) {\n var _this$popupRef$curren;\n\n // https://github.com/react-component/trigger/pull/13\n // react bug?\n if (e.relatedTarget && !e.relatedTarget.setTimeout && contains((_this$popupRef$curren = _this.popupRef.current) === null || _this$popupRef$curren === void 0 ? void 0 : _this$popupRef$curren.getElement(), e.relatedTarget)) {\n return;\n }\n _this.delaySetPopupVisible(false, _this.props.mouseLeaveDelay);\n });\n _defineProperty$2(_assertThisInitialized(_this), \"onFocus\", function (e) {\n _this.fireEvents('onFocus', e); // incase focusin and focusout\n\n _this.clearDelayTimer();\n if (_this.isFocusToShow()) {\n _this.focusTime = Date.now();\n _this.delaySetPopupVisible(true, _this.props.focusDelay);\n }\n });\n _defineProperty$2(_assertThisInitialized(_this), \"onMouseDown\", function (e) {\n _this.fireEvents('onMouseDown', e);\n _this.preClickTime = Date.now();\n });\n _defineProperty$2(_assertThisInitialized(_this), \"onTouchStart\", function (e) {\n _this.fireEvents('onTouchStart', e);\n _this.preTouchTime = Date.now();\n });\n _defineProperty$2(_assertThisInitialized(_this), \"onBlur\", function (e) {\n _this.fireEvents('onBlur', e);\n _this.clearDelayTimer();\n if (_this.isBlurToHide()) {\n _this.delaySetPopupVisible(false, _this.props.blurDelay);\n }\n });\n _defineProperty$2(_assertThisInitialized(_this), \"onContextMenu\", function (e) {\n e.preventDefault();\n _this.fireEvents('onContextMenu', e);\n _this.setPopupVisible(true, e);\n });\n _defineProperty$2(_assertThisInitialized(_this), \"onContextMenuClose\", function () {\n if (_this.isContextMenuToShow()) {\n _this.close();\n }\n });\n _defineProperty$2(_assertThisInitialized(_this), \"onClick\", function (event) {\n _this.fireEvents('onClick', event); // focus will trigger click\n\n if (_this.focusTime) {\n var preTime;\n if (_this.preClickTime && _this.preTouchTime) {\n preTime = Math.min(_this.preClickTime, _this.preTouchTime);\n } else if (_this.preClickTime) {\n preTime = _this.preClickTime;\n } else if (_this.preTouchTime) {\n preTime = _this.preTouchTime;\n }\n if (Math.abs(preTime - _this.focusTime) < 20) {\n return;\n }\n _this.focusTime = 0;\n }\n _this.preClickTime = 0;\n _this.preTouchTime = 0; // Only prevent default when all the action is click.\n // https://github.com/ant-design/ant-design/issues/17043\n // https://github.com/ant-design/ant-design/issues/17291\n\n if (_this.isClickToShow() && (_this.isClickToHide() || _this.isBlurToHide()) && event && event.preventDefault) {\n event.preventDefault();\n }\n var nextVisible = !_this.state.popupVisible;\n if (_this.isClickToHide() && !nextVisible || nextVisible && _this.isClickToShow()) {\n _this.setPopupVisible(!_this.state.popupVisible, event);\n }\n });\n _defineProperty$2(_assertThisInitialized(_this), \"onPopupMouseDown\", function () {\n _this.hasPopupMouseDown = true;\n clearTimeout(_this.mouseDownTimeout);\n _this.mouseDownTimeout = window.setTimeout(function () {\n _this.hasPopupMouseDown = false;\n }, 0);\n if (_this.context) {\n var _this$context;\n (_this$context = _this.context).onPopupMouseDown.apply(_this$context, arguments);\n }\n });\n _defineProperty$2(_assertThisInitialized(_this), \"onDocumentClick\", function (event) {\n if (_this.props.mask && !_this.props.maskClosable) {\n return;\n }\n var target = event.target;\n var root = _this.getRootDomNode();\n var popupNode = _this.getPopupDomNode();\n if (\n // mousedown on the target should also close popup when action is contextMenu.\n // https://github.com/ant-design/ant-design/issues/29853\n (!contains(root, target) || _this.isContextMenuOnly()) && !contains(popupNode, target) && !_this.hasPopupMouseDown) {\n _this.close();\n }\n });\n _defineProperty$2(_assertThisInitialized(_this), \"getRootDomNode\", function () {\n var getTriggerDOMNode = _this.props.getTriggerDOMNode;\n if (getTriggerDOMNode) {\n return getTriggerDOMNode(_this.triggerRef.current);\n }\n try {\n var domNode = findDOMNode(_this.triggerRef.current);\n if (domNode) {\n return domNode;\n }\n } catch (err) {// Do nothing\n }\n return ReactDOM__default.findDOMNode(_assertThisInitialized(_this));\n });\n _defineProperty$2(_assertThisInitialized(_this), \"getPopupClassNameFromAlign\", function (align) {\n var className = [];\n var _this$props = _this.props,\n popupPlacement = _this$props.popupPlacement,\n builtinPlacements = _this$props.builtinPlacements,\n prefixCls = _this$props.prefixCls,\n alignPoint = _this$props.alignPoint,\n getPopupClassNameFromAlign = _this$props.getPopupClassNameFromAlign;\n if (popupPlacement && builtinPlacements) {\n className.push(getAlignPopupClassName(builtinPlacements, prefixCls, align, alignPoint));\n }\n if (getPopupClassNameFromAlign) {\n className.push(getPopupClassNameFromAlign(align));\n }\n return className.join(' ');\n });\n _defineProperty$2(_assertThisInitialized(_this), \"getComponent\", function () {\n var _this$props2 = _this.props,\n prefixCls = _this$props2.prefixCls,\n destroyPopupOnHide = _this$props2.destroyPopupOnHide,\n popupClassName = _this$props2.popupClassName,\n onPopupAlign = _this$props2.onPopupAlign,\n popupMotion = _this$props2.popupMotion,\n popupAnimation = _this$props2.popupAnimation,\n popupTransitionName = _this$props2.popupTransitionName,\n popupStyle = _this$props2.popupStyle,\n mask = _this$props2.mask,\n maskAnimation = _this$props2.maskAnimation,\n maskTransitionName = _this$props2.maskTransitionName,\n maskMotion = _this$props2.maskMotion,\n zIndex = _this$props2.zIndex,\n popup = _this$props2.popup,\n stretch = _this$props2.stretch,\n alignPoint = _this$props2.alignPoint,\n mobile = _this$props2.mobile,\n forceRender = _this$props2.forceRender,\n onPopupClick = _this$props2.onPopupClick;\n var _this$state = _this.state,\n popupVisible = _this$state.popupVisible,\n point = _this$state.point;\n var align = _this.getPopupAlign();\n var mouseProps = {};\n if (_this.isMouseEnterToShow()) {\n mouseProps.onMouseEnter = _this.onPopupMouseEnter;\n }\n if (_this.isMouseLeaveToHide()) {\n mouseProps.onMouseLeave = _this.onPopupMouseLeave;\n }\n mouseProps.onMouseDown = _this.onPopupMouseDown;\n mouseProps.onTouchStart = _this.onPopupMouseDown;\n return /*#__PURE__*/React.createElement(Popup, _extends$3({\n prefixCls: prefixCls,\n destroyPopupOnHide: destroyPopupOnHide,\n visible: popupVisible,\n point: alignPoint && point,\n className: popupClassName,\n align: align,\n onAlign: onPopupAlign,\n animation: popupAnimation,\n getClassNameFromAlign: _this.getPopupClassNameFromAlign\n }, mouseProps, {\n stretch: stretch,\n getRootDomNode: _this.getRootDomNode,\n style: popupStyle,\n mask: mask,\n zIndex: zIndex,\n transitionName: popupTransitionName,\n maskAnimation: maskAnimation,\n maskTransitionName: maskTransitionName,\n maskMotion: maskMotion,\n ref: _this.popupRef,\n motion: popupMotion,\n mobile: mobile,\n forceRender: forceRender,\n onClick: onPopupClick\n }), typeof popup === 'function' ? popup() : popup);\n });\n _defineProperty$2(_assertThisInitialized(_this), \"attachParent\", function (popupContainer) {\n wrapperRaf.cancel(_this.attachId);\n var _this$props3 = _this.props,\n getPopupContainer = _this$props3.getPopupContainer,\n getDocument = _this$props3.getDocument;\n var domNode = _this.getRootDomNode();\n var mountNode;\n if (!getPopupContainer) {\n mountNode = getDocument(_this.getRootDomNode()).body;\n } else if (domNode || getPopupContainer.length === 0) {\n // Compatible for legacy getPopupContainer with domNode argument.\n // If no need `domNode` argument, will call directly.\n // https://codesandbox.io/s/eloquent-mclean-ss93m?file=/src/App.js\n mountNode = getPopupContainer(domNode);\n }\n if (mountNode) {\n mountNode.appendChild(popupContainer);\n } else {\n // Retry after frame render in case parent not ready\n _this.attachId = wrapperRaf(function () {\n _this.attachParent(popupContainer);\n });\n }\n });\n _defineProperty$2(_assertThisInitialized(_this), \"getContainer\", function () {\n if (!_this.portalContainer) {\n // In React.StrictMode component will call render multiple time in first mount.\n // When you want to refactor with FC, useRef will also init multiple time and\n // point to different useRef instance which will create multiple element\n // (This multiple render will not trigger effect so you can not clean up this\n // in effect). But this is safe with class component since it always point to same class instance.\n var getDocument = _this.props.getDocument;\n var popupContainer = getDocument(_this.getRootDomNode()).createElement('div'); // Make sure default popup container will never cause scrollbar appearing\n // https://github.com/react-component/trigger/issues/41\n\n popupContainer.style.position = 'absolute';\n popupContainer.style.top = '0';\n popupContainer.style.left = '0';\n popupContainer.style.width = '100%';\n _this.portalContainer = popupContainer;\n }\n _this.attachParent(_this.portalContainer);\n return _this.portalContainer;\n });\n _defineProperty$2(_assertThisInitialized(_this), \"setPoint\", function (point) {\n var alignPoint = _this.props.alignPoint;\n if (!alignPoint || !point) return;\n _this.setState({\n point: {\n pageX: point.pageX,\n pageY: point.pageY\n }\n });\n });\n _defineProperty$2(_assertThisInitialized(_this), \"handlePortalUpdate\", function () {\n if (_this.state.prevPopupVisible !== _this.state.popupVisible) {\n _this.props.afterPopupVisibleChange(_this.state.popupVisible);\n }\n });\n _defineProperty$2(_assertThisInitialized(_this), \"triggerContextValue\", {\n onPopupMouseDown: _this.onPopupMouseDown\n });\n var _popupVisible;\n if ('popupVisible' in props) {\n _popupVisible = !!props.popupVisible;\n } else {\n _popupVisible = !!props.defaultPopupVisible;\n }\n _this.state = {\n prevPopupVisible: _popupVisible,\n popupVisible: _popupVisible\n };\n ALL_HANDLERS.forEach(function (h) {\n _this[\"fire\".concat(h)] = function (e) {\n _this.fireEvents(h, e);\n };\n });\n return _this;\n }\n _createClass(Trigger, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.componentDidUpdate();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n var props = this.props;\n var state = this.state; // We must listen to `mousedown` or `touchstart`, edge case:\n // https://github.com/ant-design/ant-design/issues/5804\n // https://github.com/react-component/calendar/issues/250\n // https://github.com/react-component/trigger/issues/50\n\n if (state.popupVisible) {\n var currentDocument;\n if (!this.clickOutsideHandler && (this.isClickToHide() || this.isContextMenuToShow())) {\n currentDocument = props.getDocument(this.getRootDomNode());\n this.clickOutsideHandler = addEventListenerWrap(currentDocument, 'mousedown', this.onDocumentClick);\n } // always hide on mobile\n\n if (!this.touchOutsideHandler) {\n currentDocument = currentDocument || props.getDocument(this.getRootDomNode());\n this.touchOutsideHandler = addEventListenerWrap(currentDocument, 'touchstart', this.onDocumentClick);\n } // close popup when trigger type contains 'onContextMenu' and document is scrolling.\n\n if (!this.contextMenuOutsideHandler1 && this.isContextMenuToShow()) {\n currentDocument = currentDocument || props.getDocument(this.getRootDomNode());\n this.contextMenuOutsideHandler1 = addEventListenerWrap(currentDocument, 'scroll', this.onContextMenuClose);\n } // close popup when trigger type contains 'onContextMenu' and window is blur.\n\n if (!this.contextMenuOutsideHandler2 && this.isContextMenuToShow()) {\n this.contextMenuOutsideHandler2 = addEventListenerWrap(window, 'blur', this.onContextMenuClose);\n }\n return;\n }\n this.clearOutsideHandler();\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.clearDelayTimer();\n this.clearOutsideHandler();\n clearTimeout(this.mouseDownTimeout);\n wrapperRaf.cancel(this.attachId);\n }\n }, {\n key: \"getPopupDomNode\",\n value: function getPopupDomNode() {\n var _this$popupRef$curren2;\n\n // for test\n return ((_this$popupRef$curren2 = this.popupRef.current) === null || _this$popupRef$curren2 === void 0 ? void 0 : _this$popupRef$curren2.getElement()) || null;\n }\n }, {\n key: \"getPopupAlign\",\n value: function getPopupAlign() {\n var props = this.props;\n var popupPlacement = props.popupPlacement,\n popupAlign = props.popupAlign,\n builtinPlacements = props.builtinPlacements;\n if (popupPlacement && builtinPlacements) {\n return getAlignFromPlacement(builtinPlacements, popupPlacement, popupAlign);\n }\n return popupAlign;\n }\n }, {\n key: \"setPopupVisible\",\n value:\n /**\n * @param popupVisible Show or not the popup element\n * @param event SyntheticEvent, used for `pointAlign`\n */\n function setPopupVisible(popupVisible, event) {\n var alignPoint = this.props.alignPoint;\n var prevPopupVisible = this.state.popupVisible;\n this.clearDelayTimer();\n if (prevPopupVisible !== popupVisible) {\n if (!('popupVisible' in this.props)) {\n this.setState({\n popupVisible: popupVisible,\n prevPopupVisible: prevPopupVisible\n });\n }\n this.props.onPopupVisibleChange(popupVisible);\n } // Always record the point position since mouseEnterDelay will delay the show\n\n if (alignPoint && event && popupVisible) {\n this.setPoint(event);\n }\n }\n }, {\n key: \"delaySetPopupVisible\",\n value: function delaySetPopupVisible(visible, delayS, event) {\n var _this2 = this;\n var delay = delayS * 1000;\n this.clearDelayTimer();\n if (delay) {\n var point = event ? {\n pageX: event.pageX,\n pageY: event.pageY\n } : null;\n this.delayTimer = window.setTimeout(function () {\n _this2.setPopupVisible(visible, point);\n _this2.clearDelayTimer();\n }, delay);\n } else {\n this.setPopupVisible(visible, event);\n }\n }\n }, {\n key: \"clearDelayTimer\",\n value: function clearDelayTimer() {\n if (this.delayTimer) {\n clearTimeout(this.delayTimer);\n this.delayTimer = null;\n }\n }\n }, {\n key: \"clearOutsideHandler\",\n value: function clearOutsideHandler() {\n if (this.clickOutsideHandler) {\n this.clickOutsideHandler.remove();\n this.clickOutsideHandler = null;\n }\n if (this.contextMenuOutsideHandler1) {\n this.contextMenuOutsideHandler1.remove();\n this.contextMenuOutsideHandler1 = null;\n }\n if (this.contextMenuOutsideHandler2) {\n this.contextMenuOutsideHandler2.remove();\n this.contextMenuOutsideHandler2 = null;\n }\n if (this.touchOutsideHandler) {\n this.touchOutsideHandler.remove();\n this.touchOutsideHandler = null;\n }\n }\n }, {\n key: \"createTwoChains\",\n value: function createTwoChains(event) {\n var childPros = this.props.children.props;\n var props = this.props;\n if (childPros[event] && props[event]) {\n return this[\"fire\".concat(event)];\n }\n return childPros[event] || props[event];\n }\n }, {\n key: \"isClickToShow\",\n value: function isClickToShow() {\n var _this$props4 = this.props,\n action = _this$props4.action,\n showAction = _this$props4.showAction;\n return action.indexOf('click') !== -1 || showAction.indexOf('click') !== -1;\n }\n }, {\n key: \"isContextMenuOnly\",\n value: function isContextMenuOnly() {\n var action = this.props.action;\n return action === 'contextMenu' || action.length === 1 && action[0] === 'contextMenu';\n }\n }, {\n key: \"isContextMenuToShow\",\n value: function isContextMenuToShow() {\n var _this$props5 = this.props,\n action = _this$props5.action,\n showAction = _this$props5.showAction;\n return action.indexOf('contextMenu') !== -1 || showAction.indexOf('contextMenu') !== -1;\n }\n }, {\n key: \"isClickToHide\",\n value: function isClickToHide() {\n var _this$props6 = this.props,\n action = _this$props6.action,\n hideAction = _this$props6.hideAction;\n return action.indexOf('click') !== -1 || hideAction.indexOf('click') !== -1;\n }\n }, {\n key: \"isMouseEnterToShow\",\n value: function isMouseEnterToShow() {\n var _this$props7 = this.props,\n action = _this$props7.action,\n showAction = _this$props7.showAction;\n return action.indexOf('hover') !== -1 || showAction.indexOf('mouseEnter') !== -1;\n }\n }, {\n key: \"isMouseLeaveToHide\",\n value: function isMouseLeaveToHide() {\n var _this$props8 = this.props,\n action = _this$props8.action,\n hideAction = _this$props8.hideAction;\n return action.indexOf('hover') !== -1 || hideAction.indexOf('mouseLeave') !== -1;\n }\n }, {\n key: \"isFocusToShow\",\n value: function isFocusToShow() {\n var _this$props9 = this.props,\n action = _this$props9.action,\n showAction = _this$props9.showAction;\n return action.indexOf('focus') !== -1 || showAction.indexOf('focus') !== -1;\n }\n }, {\n key: \"isBlurToHide\",\n value: function isBlurToHide() {\n var _this$props10 = this.props,\n action = _this$props10.action,\n hideAction = _this$props10.hideAction;\n return action.indexOf('focus') !== -1 || hideAction.indexOf('blur') !== -1;\n }\n }, {\n key: \"forcePopupAlign\",\n value: function forcePopupAlign() {\n if (this.state.popupVisible) {\n var _this$popupRef$curren3;\n (_this$popupRef$curren3 = this.popupRef.current) === null || _this$popupRef$curren3 === void 0 ? void 0 : _this$popupRef$curren3.forceAlign();\n }\n }\n }, {\n key: \"fireEvents\",\n value: function fireEvents(type, e) {\n var childCallback = this.props.children.props[type];\n if (childCallback) {\n childCallback(e);\n }\n var callback = this.props[type];\n if (callback) {\n callback(e);\n }\n }\n }, {\n key: \"close\",\n value: function close() {\n this.setPopupVisible(false);\n }\n }, {\n key: \"render\",\n value: function render() {\n var popupVisible = this.state.popupVisible;\n var _this$props11 = this.props,\n children = _this$props11.children,\n forceRender = _this$props11.forceRender,\n alignPoint = _this$props11.alignPoint,\n className = _this$props11.className,\n autoDestroy = _this$props11.autoDestroy;\n var child = React.Children.only(children);\n var newChildProps = {\n key: 'trigger'\n }; // ============================== Visible Handlers ==============================\n // >>> ContextMenu\n\n if (this.isContextMenuToShow()) {\n newChildProps.onContextMenu = this.onContextMenu;\n } else {\n newChildProps.onContextMenu = this.createTwoChains('onContextMenu');\n } // >>> Click\n\n if (this.isClickToHide() || this.isClickToShow()) {\n newChildProps.onClick = this.onClick;\n newChildProps.onMouseDown = this.onMouseDown;\n newChildProps.onTouchStart = this.onTouchStart;\n } else {\n newChildProps.onClick = this.createTwoChains('onClick');\n newChildProps.onMouseDown = this.createTwoChains('onMouseDown');\n newChildProps.onTouchStart = this.createTwoChains('onTouchStart');\n } // >>> Hover(enter)\n\n if (this.isMouseEnterToShow()) {\n newChildProps.onMouseEnter = this.onMouseEnter; // Point align\n\n if (alignPoint) {\n newChildProps.onMouseMove = this.onMouseMove;\n }\n } else {\n newChildProps.onMouseEnter = this.createTwoChains('onMouseEnter');\n } // >>> Hover(leave)\n\n if (this.isMouseLeaveToHide()) {\n newChildProps.onMouseLeave = this.onMouseLeave;\n } else {\n newChildProps.onMouseLeave = this.createTwoChains('onMouseLeave');\n } // >>> Focus\n\n if (this.isFocusToShow() || this.isBlurToHide()) {\n newChildProps.onFocus = this.onFocus;\n newChildProps.onBlur = this.onBlur;\n } else {\n newChildProps.onFocus = this.createTwoChains('onFocus');\n newChildProps.onBlur = this.createTwoChains('onBlur');\n } // =================================== Render ===================================\n\n var childrenClassName = classNames(child && child.props && child.props.className, className);\n if (childrenClassName) {\n newChildProps.className = childrenClassName;\n }\n var cloneProps = _objectSpread2$1({}, newChildProps);\n if (supportRef(child)) {\n cloneProps.ref = composeRef(this.triggerRef, child.ref);\n }\n var trigger = /*#__PURE__*/React.cloneElement(child, cloneProps);\n var portal; // prevent unmounting after it's rendered\n\n if (popupVisible || this.popupRef.current || forceRender) {\n portal = /*#__PURE__*/React.createElement(PortalComponent, {\n key: \"portal\",\n getContainer: this.getContainer,\n didUpdate: this.handlePortalUpdate\n }, this.getComponent());\n }\n if (!popupVisible && autoDestroy) {\n portal = null;\n }\n return /*#__PURE__*/React.createElement(TriggerContext.Provider, {\n value: this.triggerContextValue\n }, trigger, portal);\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(_ref, prevState) {\n var popupVisible = _ref.popupVisible;\n var newState = {};\n if (popupVisible !== undefined && prevState.popupVisible !== popupVisible) {\n newState.popupVisible = popupVisible;\n newState.prevPopupVisible = prevState.popupVisible;\n }\n return newState;\n }\n }]);\n return Trigger;\n }(React.Component);\n _defineProperty$2(Trigger, \"contextType\", TriggerContext);\n _defineProperty$2(Trigger, \"defaultProps\", {\n prefixCls: 'rc-trigger-popup',\n getPopupClassNameFromAlign: returnEmptyString,\n getDocument: returnDocument,\n onPopupVisibleChange: noop,\n afterPopupVisibleChange: noop,\n onPopupAlign: noop,\n popupClassName: '',\n mouseEnterDelay: 0,\n mouseLeaveDelay: 0.1,\n focusDelay: 0,\n blurDelay: 0.15,\n popupStyle: {},\n destroyPopupOnHide: false,\n popupAlign: {},\n defaultPopupVisible: false,\n mask: false,\n maskClosable: true,\n action: [],\n showAction: [],\n hideAction: [],\n autoDestroy: false\n });\n return Trigger;\n}", "title": "" } ]
[ { "docid": "7bdf3f19a966fba21dda2ce3369aae12", "score": "0.6087466", "text": "function __aQHTPPuL1Di4jeIELPbjrw(){}", "title": "" }, { "docid": "db7e1b0668c63f3244d920e58b041970", "score": "0.60181993", "text": "function qgAzysV_bHje7HMBqh73wBw(){}", "title": "" }, { "docid": "e38edb5dd151abf14bec4bb78bd9efb2", "score": "0.5997825", "text": "function _fn(){ /*...*/ }\t//Funzioni private", "title": "" }, { "docid": "dacd20c2f775823da2f56905f80b066c", "score": "0.5745308", "text": "look() {\n // Implemented at runtime by a worker thread.\n }", "title": "" }, { "docid": "e543f3984bb318ca7d3b2fadb6ca2943", "score": "0.56255347", "text": "static of() { return undefined; }", "title": "" }, { "docid": "13df25260e4440a35d55566645faf853", "score": "0.56033206", "text": "function mifuncion(){}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.55790085", "text": "initialize() {}", "title": "" }, { "docid": "79e75f3255ba93f5015a28971728be70", "score": "0.5430175", "text": "prepare() {\n\n\t}", "title": "" }, { "docid": "23c456980a5333ec250339bb791b0946", "score": "0.5416387", "text": "static from() { return undefined; }", "title": "" }, { "docid": "8e0d47c54af8e39572800bc9124ead10", "score": "0.5401428", "text": "initialize() { }", "title": "" }, { "docid": "8759268c13be59ee803815711c45b755", "score": "0.5398821", "text": "constructor() {\n\t\t// Empty\n\t}", "title": "" }, { "docid": "bed5e9a3a8955d5d5bc2c94ac6f87006", "score": "0.5375776", "text": "function init() {\t\t\t\t\t\n\t\t}", "title": "" }, { "docid": "391bd447992f5cdb8139fc190217a04d", "score": "0.5361542", "text": "_init () {}", "title": "" }, { "docid": "f6d3a057a9c974a25b9c87fc1d3f79d7", "score": "0.53411525", "text": "initialize() {\n\t\treturn null;\n\t}", "title": "" }, { "docid": "ca1fe47a73d47c51c8a48b2ab613260b", "score": "0.5295717", "text": "function _34Z38D1h1jWisfyZw_a9KnQ(){}", "title": "" }, { "docid": "1e0aeab2ac22eaa5d8208361f81a78b4", "score": "0.52743036", "text": "function __adNhkYkODD_aby8Cz6QAvuQ(){}", "title": "" }, { "docid": "f97925d34e944763d94c11ac8b79c5e8", "score": "0.5250402", "text": "initialize()\n {\n }", "title": "" }, { "docid": "e709e71d522b9f57d7abefd8724cffc8", "score": "0.5229429", "text": "constructor() {\r\n\t}", "title": "" }, { "docid": "935ea97ee614cb49b0a1dbbe0b0a50fb", "score": "0.5223992", "text": "function IO_bW2yv67jeVWcmCqoo9Yw(){}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.5201089", "text": "prepare() {}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.5201089", "text": "prepare() {}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.5201089", "text": "prepare() {}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.5201089", "text": "prepare() {}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.5201089", "text": "prepare() {}", "title": "" }, { "docid": "69e4bfa14772f95785f26dec9b893d95", "score": "0.51985085", "text": "constructor(_) {\n\t\t// $FlowFixMe: Won't be fixed ;)\n\t\treturn (_ = super(_)).init(), _; // eslint-disable-line\n\t}", "title": "" }, { "docid": "18c21d02f553eebb046741d665a5a96e", "score": "0.5179823", "text": "prepare() {\n return;\n }", "title": "" }, { "docid": "c2ab77f5ef828a7079c80a72326c9b96", "score": "0.51755446", "text": "_map_data() { }", "title": "" }, { "docid": "dc7586e9a971dffa4d38a62643528a32", "score": "0.5167941", "text": "_registered() {}", "title": "" }, { "docid": "e439de9a623005c3cce9e0743168670e", "score": "0.51419103", "text": "_refine() {}", "title": "" }, { "docid": "4a7d9e8a2183537764d0594028077cf2", "score": "0.51394314", "text": "added() { }", "title": "" }, { "docid": "013dfe94df8e743571c91a34b1a2dfd1", "score": "0.5125809", "text": "error() {\n\t\t\treturn;\n\t\t}", "title": "" }, { "docid": "0cfe2d50883b226f985af500c0b3c4f8", "score": "0.51185703", "text": "constructor() { super() }", "title": "" }, { "docid": "8bd1dea1bc5545813f88344934a5fe75", "score": "0.51105154", "text": "_init() {}", "title": "" }, { "docid": "2d0c75263c77bbe971042289cad69f4f", "score": "0.5108375", "text": "_settings() {\n throw \"Not implemented!\";\n }", "title": "" }, { "docid": "bda22ab7d5efc0b7f2fe7281b48438c4", "score": "0.5105629", "text": "function __bJQ43mBkATis_auW8hsdm0Q(){}", "title": "" }, { "docid": "f022f922b19942ce162c27fb1228060a", "score": "0.51029205", "text": "constructor() {\r\n // intentionally empty\r\n }", "title": "" }, { "docid": "f022f922b19942ce162c27fb1228060a", "score": "0.51029205", "text": "constructor() {\r\n // intentionally empty\r\n }", "title": "" }, { "docid": "f022f922b19942ce162c27fb1228060a", "score": "0.51029205", "text": "constructor() {\r\n // intentionally empty\r\n }", "title": "" }, { "docid": "1be0dda0de4ebfc4c0bd62d9f288b1a0", "score": "0.50881636", "text": "update() {\r\n\t\t// do nothing for now\r\n\t}", "title": "" }, { "docid": "127b148233c6b22a1f515be3d1dddaed", "score": "0.50780123", "text": "function walkthrough() {\n\n}", "title": "" }, { "docid": "367e9e1c0f4ef7259f8d24067a4b93f0", "score": "0.50729483", "text": "postinit() {}", "title": "" }, { "docid": "1dbd94201a03f24c6420d7f830a1d336", "score": "0.50695646", "text": "_grow() {\n\t\t// TODO: implementation left as an exercise\n\t}", "title": "" }, { "docid": "73a750f0bf7174043ac43fdfb329b392", "score": "0.5064601", "text": "function Fp3EngineUtils() {}", "title": "" }, { "docid": "502eaa82d6d070bb36626c3cad493f87", "score": "0.50620526", "text": "prepare() { }", "title": "" }, { "docid": "502eaa82d6d070bb36626c3cad493f87", "score": "0.50620526", "text": "prepare() { }", "title": "" }, { "docid": "3f345906af0c223635f5d05f79bdd5aa", "score": "0.50525606", "text": "prepare() {\n \n }", "title": "" }, { "docid": "f4182c7ece22fb7f06f19ca5815df5da", "score": "0.50463915", "text": "function XY27_a3uEfjuPVlzJ1epT7g(){}", "title": "" }, { "docid": "e1a92a6de1f8909945c915fafc799bb6", "score": "0.50450766", "text": "__init14() {this.forceRenames = new Map()}", "title": "" }, { "docid": "df62f6aeeb238679210f69c60a41b7f7", "score": "0.50386035", "text": "load() {\n // not implemented\n }", "title": "" }, { "docid": "95ae9f38ac5ff4d43547807e2d7e0457", "score": "0.5033464", "text": "constructor() {\n\n }", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5028269", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5028269", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5028269", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5028269", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5028269", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5028269", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5028269", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5028269", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.50256515", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.50256515", "text": "init() { }", "title": "" }, { "docid": "021cfb9155dcd6690ac157d44aedd6a2", "score": "0.50246936", "text": "finalize() {\n //override as necessary\n }", "title": "" }, { "docid": "edaef20edcc2a2d283ef53659c62fe4b", "score": "0.5019498", "text": "_update() {\n\t\t\n\t}", "title": "" }, { "docid": "68ccff687712efa198ba14f4ac3254c8", "score": "0.50155824", "text": "get Internal() {}", "title": "" }, { "docid": "8aea9d981f063cfa1db4f0752960981e", "score": "0.5002483", "text": "_read() {\n return undefined;\n }", "title": "" }, { "docid": "5412cbec186d84761f7c0bb74ddbad34", "score": "0.50004905", "text": "function __func(){}", "title": "" }, { "docid": "6b9ced2a750275a57fa83921a50577e0", "score": "0.49964097", "text": "function _2fFEyKdwBjC3MMVY48h7UA(){}", "title": "" }, { "docid": "67cd975aca585978e6e334296c57f985", "score": "0.4993133", "text": "patched() { }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.49845693", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" } ]
339b6aed6560ecbe8afc8439e961f025
It creates a single child not atached to the node but with a copy of the mother It serves for creating a template of new node By default it creates a empty lang data children if it is related to a lang element parent
[ { "docid": "abe575ed592c85b93218a685b789c7f7", "score": "0.0", "text": "loaddesc(source, level, thisProperties, myConstructor) {\n if (!myConstructor) return super.loaddesc(source, level, thisProperties, NodeMale);\n return super.loaddesc(source, level, thisProperties, myConstructor);\n }", "title": "" } ]
[ { "docid": "abbf5e67b76c0f3cebc75291ade46dc8", "score": "0.64637125", "text": "function hc_nodereplacechildinvalidnodetype() {\n var success;\n if(checkInitialization(builder, \"hc_nodereplacechildinvalidnodetype\") != null) return;\n var doc;\n var rootNode;\n var newChild;\n var elementList;\n var oldChild;\n var replacedChild;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n newChild = doc.createAttribute(\"lang\");\n elementList = doc.getElementsByTagName(\"p\");\n oldChild = elementList.item(1);\n rootNode = oldChild.parentNode;\n\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n replacedChild = rootNode.replaceChild(newChild,oldChild);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 3);\n\t\t}\n\t\tassertTrue(\"throw_HIERARCHY_REQUEST_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "10a88e9a511c5aa135c45d46440e8f97", "score": "0.63726", "text": "async function addNewNode(currentNode, noLangs) {\n const parentNode=currentNode.parent;\n let parameters={updateSiblingsOrder: true};\n const datarel = currentNode.relationships.find(rel => rel.sysChildTableKeysInfo.some( syskey => syskey.type=='foreignkey' && syskey.parentTableName==languages.props.childTableName) );\n if (!noLangs && datarel) Object.assign(parameters, {extraParents: currentLanguage.getRelationship(datarel.props.name)});\n const skey=parentNode.getSysKey('sort_order');\n if (currentNode.props.id) { // we are getting the previous sibling so we got to get the actual new node\n let position;\n if (skey && parentNode.children.length) {\n position=currentNode.props[skey]+1;\n }\n if (!noLangs) currentNode=await createInstanceChildText(parentNode, position);\n else currentNode=parentNode.createInstanceChild(position);\n }\n await currentNode.loadRequest(\"add my tree\", parameters);\n //We copy the data row to any language\n if (!noLangs && languages.children.length>1) {\n const restLanguages=languages.children.filter(lang => lang.props.id!=currentLanguage.props.id);\n const relLangCandidates=currentNode.arrayFromTree();\n const relLangs=relLangCandidates.filter(relLang=>{\n if (!relLang.detectLinker()) return false;\n const findLangKey=relLang.sysChildTableKeysInfo.find(syskey=>syskey.parentTableName==languages.props.parentTableName && syskey.type=='foreignkey');\n if (findLangKey) return true;\n });\n restLanguages.forEach(lang=>relLangs.forEach(relLang=>relLang.request(\"add my children\", {extraParents: lang.getRelationship(relLang.props.name)})));\n }\n\n // we must update the siblings sort_order because we can add the child at any position\n if (currentNode.props[skey]<=parentNode.children.length) {\n parentNode.children=parentNode.children.sort((a,b)=>a.props[skey]-b.props[skey]);\n parentNode.children.filter(child=>child.props[skey] >= currentNode.props[skey]).forEach(child=>child.props[skey]++);\n }\n parentNode.addChild(currentNode);\n parentNode.children=parentNode.children.sort((a,b)=>a.props[skey]-b.props[skey]); // just to make the array order fit the position value\n return currentNode;\n}", "title": "" }, { "docid": "c959c2175fde9e9601b495b80493dc77", "score": "0.6230514", "text": "function create_child(data){\n var item = find_item(data.item_id)\n var new_item = create_an_item(function(node){ item.find('.contents:first').prepend(node) }, data.new_item_id)\n action_history.record({ type : 'create_child', \n item_id : data.item_id, \n new_item_id : encode_item(new_item) })\n}", "title": "" }, { "docid": "a4be99fdf5599dce6163d1840f69605b", "score": "0.6010434", "text": "createNode(mode = \"after\", node, init) {\n const tree = this.tree;\n node = node !== null && node !== void 0 ? node : tree.getActiveNode();\n assert(node, \"No node was passed, or no node is currently active.\");\n // const validity = this.getPluginOption(\"validity\");\n mode = mode || \"prependChild\";\n if (init == null) {\n init = { title: \"\" };\n }\n else if (typeof init === \"string\") {\n init = { title: init };\n }\n else {\n assert(isPlainObject(init));\n }\n // Make sure node is expanded (and loaded) in 'child' mode\n if ((mode === \"prependChild\" || mode === \"appendChild\") &&\n (node === null || node === void 0 ? void 0 : node.isExpandable(true))) {\n node.setExpanded().then(() => {\n this.createNode(mode, node, init);\n });\n return;\n }\n const newNode = node.addNode(init, mode);\n newNode.setClass(\"wb-edit-new\");\n this.relatedNode = node;\n // Don't filter new nodes:\n newNode.match = true;\n newNode.makeVisible({ noAnimation: true }).then(() => {\n this.startEditTitle(newNode);\n });\n }", "title": "" }, { "docid": "f14ad8148287fb913c2b9558dfad22be", "score": "0.6007669", "text": "addChildNode(type = \"text\") {\n let newChild = new Node(this);\n newChild.type = type;\n this.children.push(newChild);\n return newChild;\n }", "title": "" }, { "docid": "7494ef77679c92f264463f6e9216fb9a", "score": "0.58350325", "text": "function CreateNode(ParentId, NewTagType, Text, AttributeType, AttributeName) {\n var NewTagType = document.createElement(NewTagType);\n var Text = document.createTextNode(Text);\n NewTagType.appendChild(Text);\n var element = document.getElementById(ParentId);\n g = element.appendChild(NewTagType);\n g.setAttribute(AttributeType, AttributeName);\n}", "title": "" }, { "docid": "9208a3b8a3a8bb533762834a22bc0918", "score": "0.57839674", "text": "function createNode(transform, render, sibling, child){\n var node = {\n transform: transform,\n render: render,\n sibling: sibling,\n child: child,\n }\n return node;\n}", "title": "" }, { "docid": "9208a3b8a3a8bb533762834a22bc0918", "score": "0.57839674", "text": "function createNode(transform, render, sibling, child){\n var node = {\n transform: transform,\n render: render,\n sibling: sibling,\n child: child,\n }\n return node;\n}", "title": "" }, { "docid": "280bf6e15f0f2b1727897e836971d200", "score": "0.57501525", "text": "function createNode(parent_node, new_node_id, new_node_text, position) {\n $('#jstree').jstree('create_node', $(parent_node), { \"text\": new_node_text, \"id\": new_node_id }, position, false, false);\n }", "title": "" }, { "docid": "794d6c50fa97e43a9190b554e2414c35", "score": "0.56699544", "text": "function createNode(transform, render, sibling, child){\n var node = {\n transform: transform,\n render: render,\n sibling: sibling,\n child: child,\n }\n return node;\n}", "title": "" }, { "docid": "8e8de5afcf70ce45e4258771f89c1b76", "score": "0.5589159", "text": "function createChild(name, value, depth) {\n if (name === \"value\") return value;\n if (Array.isArray(value)) return `<${name}>${value.map(v => js2Xml(v, depth + 1)).join('')}</${name}>`;\n if (['boolean', 'string', 'number'].includes(typeof value)) return `<${name}>${value}</${name}>`;\n if (['object'].includes(typeof value) && typeof value.type !== \"undefined\") return `<${name}>${value.type}</${name}>`;\n if (name === \"text\" && typeof value === \"object\") return js2Xml({ [name] : value }, depth);\n //console.log(name, value);\n throw new Error(\"Unexpected child: \" + name + \" \" + (typeof value) );\n}", "title": "" }, { "docid": "985991b31f3e5b219811210add4d3d8a", "score": "0.5553341", "text": "function hc_nodereplacechild() {\n var success;\n if(checkInitialization(builder, \"hc_nodereplacechild\") != null) return;\n var doc;\n var elementList;\n var employeeNode;\n var childList;\n var oldChild;\n var newChild;\n var child;\n var childName;\n var replacedNode;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"p\");\n employeeNode = elementList.item(1);\n childList = employeeNode.childNodes;\n\n oldChild = childList.item(0);\n newChild = doc.createElement(\"br\");\n replacedNode = employeeNode.replaceChild(newChild,oldChild);\n child = childList.item(0);\n childName = child.nodeName;\n\n assertEqualsAutoCase(\"element\", \"nodeName\",\"br\",childName);\n \n}", "title": "" }, { "docid": "75c55d7b4e66cc40678a0328220d5381", "score": "0.5537957", "text": "constructor(data, parent) {\n // Base: id, type, displayName, parent, node, tags, children,\n // destroy\n super(data, parent)\n const par = this\n par.children = []\n par.activeChild = null\n }", "title": "" }, { "docid": "25dfd517a4222e5ca9616252ee2359d3", "score": "0.5526117", "text": "function newElement(tag, p){\n var x = myDocument.createElement(tag);\n x['child'] = function(tag){return newElement(tag,x)};\n if(!p){ pubsPane.appendChild(x); }\n else{ p.appendChild(x); }\n return x;\n }", "title": "" }, { "docid": "0058beaa66fa88d0f228b27ae764bf6d", "score": "0.5514398", "text": "function createNode(content, type, myClass, myHref, id) {\n var node = document.createElement(type);\n if (content != \"note\") {\n var textnode = document.createTextNode(content);\n node.appendChild(textnode);\n }\n if (myClass != false) {\n node.classList.add(myClass);\n }\n if (myHref != false) {\n node.setAttribute(\"href\", myHref);\n }\n if (id != false) {\n node.setAttribute(\"id\", id);\n }\n\n return node;\n}", "title": "" }, { "docid": "1a5859f2224ffac6c1e4c1e8c66f39d6", "score": "0.5508089", "text": "function nodereplacechildnomodificationallowederrEE() {\n var success;\n if(checkInitialization(builder, \"nodereplacechildnomodificationallowederrEE\") != null) return;\n var doc;\n var entRef;\n var entText;\n var createdNode;\n var replacedChild;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n entRef = doc.createEntityReference(\"ent4\");\n assertNotNull(\"createdEntRefNotNull\",entRef);\nentText = entRef.firstChild;\n\n createdNode = doc.createElement(\"newChild\");\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n replacedChild = entRef.replaceChild(createdNode,entText);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 7);\n\t\t}\n\t\tassertTrue(\"throw_NO_MODIFICATION_ALLOWED_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "426b1a83d33e9fe7ac7d319c37c614dd", "score": "0.5503884", "text": "addChild(name) {\r\n const child = new Tree(name, this);\r\n this.children.set(name, child);\r\n this.emit('add', child);\r\n return child;\r\n }", "title": "" }, { "docid": "fa1acff9bfc60f1889ef1bfe2243327f", "score": "0.54809725", "text": "insertWord(word) {\n const firstLetter = word.slice(0, 1); //can be '' if word is empty\n let child = this.children.get(firstLetter);\n if (!child) {\n child = new TextTree;\n this.children.set(firstLetter, child);\n }\n if (word)\n child.insertWord(word.substring(1));\n }", "title": "" }, { "docid": "a0ffc6165c61d6da3059d2bb153bd28a", "score": "0.54352987", "text": "function hc_nodereplacechildnewchilddiffdocument() {\n var success;\n if(checkInitialization(builder, \"hc_nodereplacechildnewchilddiffdocument\") != null) return;\n var doc1;\n var doc2;\n var oldChild;\n var newChild;\n var elementList;\n var elementNode;\n var replacedChild;\n \n var doc1Ref = null;\n if (typeof(this.doc1) != 'undefined') {\n doc1Ref = this.doc1;\n }\n doc1 = load(doc1Ref, \"doc1\", \"hc_staff\");\n \n var doc2Ref = null;\n if (typeof(this.doc2) != 'undefined') {\n doc2Ref = this.doc2;\n }\n doc2 = load(doc2Ref, \"doc2\", \"hc_staff\");\n newChild = doc1.createElement(\"br\");\n elementList = doc2.getElementsByTagName(\"p\");\n elementNode = elementList.item(1);\n oldChild = elementNode.firstChild;\n\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n replacedChild = elementNode.replaceChild(newChild,oldChild);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 4);\n\t\t}\n\t\tassertTrue(\"throw_WRONG_DOCUMENT_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "b1ec61f5e4797974b7e889823cf76ce6", "score": "0.54115665", "text": "function hc_nodechildnodesappendchild() {\n var success;\n if(checkInitialization(builder, \"hc_nodechildnodesappendchild\") != null) return;\n var doc;\n var elementList;\n var employeeNode;\n var childList;\n var createdNode;\n var childNode;\n var childName;\n var childType;\n var textNode;\n var actual = new Array();\n\n expected = new Array();\n expected[0] = \"em\";\n expected[1] = \"strong\";\n expected[2] = \"code\";\n expected[3] = \"sup\";\n expected[4] = \"var\";\n expected[5] = \"acronym\";\n expected[6] = \"br\";\n\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"p\");\n employeeNode = elementList.item(1);\n childList = employeeNode.childNodes;\n\n createdNode = doc.createElement(\"br\");\n employeeNode = employeeNode.appendChild(createdNode);\n for(var indexN10087 = 0;indexN10087 < childList.length; indexN10087++) {\n childNode = childList.item(indexN10087);\n childName = childNode.nodeName;\n\n childType = childNode.nodeType;\n\n \n\tif(\n\t(1 == childType)\n\t) {\n\tactual[actual.length] = childName;\n\n\t}\n\t\n\t\telse {\n\t\t\tassertEquals(\"textNodeType\",3,childType);\n \n\t\t}\n\t\n\t}\n assertEqualsListAutoCase(\"element\", \"childElements\",expected,actual);\n \n}", "title": "" }, { "docid": "d7f6b3564e19fca518021141b701508b", "score": "0.540735", "text": "_createItem(value, index) {\n const templateString = this.getTemplateString(value, index);\n let template;\n\n if (templateCache$1[templateString]) {\n template = templateCache$1[templateString];\n } else {\n template = this.createTemplate(templateString);\n templateCache$1[templateString] = template;\n }\n\n const instance = template.content.cloneNode(true);\n\n // get first non-text node of instance\n\n // const el = instance.children[0];\n // above doesn't work on IE11\n const el = [...instance.childNodes]\n .filter(node => node.nodeType === Node.ELEMENT_NODE)[0];\n\n // set key\n el.key = this.getKey(value, index);\n\n return el;\n }", "title": "" }, { "docid": "59a494b393360c557f9008408da2fb54", "score": "0.54072005", "text": "function createNode(obj, node, id) {\n node.type = 'node';\n node.children = [];\n const nodeType = getNodeType(node);\n if (nodeType === 'normal' || nodeType === 'data') {\n obj[id] = node;\n }\n return obj;\n }", "title": "" }, { "docid": "499705e75d53d84dd310c7684e068197", "score": "0.54031235", "text": "function hc_nodereplacechildoldchildnonexistent() {\n var success;\n if(checkInitialization(builder, \"hc_nodereplacechildoldchildnonexistent\") != null) return;\n var doc;\n var oldChild;\n var newChild;\n var elementList;\n var elementNode;\n var replacedNode;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n newChild = doc.createElement(\"br\");\n oldChild = doc.createElement(\"b\");\n elementList = doc.getElementsByTagName(\"p\");\n elementNode = elementList.item(1);\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n replacedNode = elementNode.replaceChild(newChild,oldChild);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 8);\n\t\t}\n\t\tassertTrue(\"throw_NOT_FOUND_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "0cad25d8bfeeabc5693b4b8084a7d734", "score": "0.5398524", "text": "function hc_nodeappendchildinvalidnodetype() {\n var success;\n if(checkInitialization(builder, \"hc_nodeappendchildinvalidnodetype\") != null) return;\n var doc;\n var rootNode;\n var newChild;\n var appendedChild;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n rootNode = doc.documentElement;\n\n newChild = doc.createAttribute(\"newAttribute\");\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n appendedChild = rootNode.appendChild(newChild);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 3);\n\t\t}\n\t\tassertTrue(\"throw_HIERARCHY_REQUEST_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "63fba2f89fecccc645448f4b37d2777f", "score": "0.538864", "text": "createNode(parent, node, myCache){\n const tempNode = this.findNode(node.id)\n if(tempNode){\n console.log(\"Cannot duplicate ID's\");\n return 400;\n }\n \n const newNode = new Node(node);\n if(!newNode){\n console.log(\"error creating node\");\n return 400;\n }\n const parentNode = this.findParentNode(parent);\n if(!parentNode){\n console.log(\"parent not found\");\n return 400;\n }\n parentNode.children.push(newNode);\n myCache.set(\"tree\", this, 10000);\n return newNode.id;\n }", "title": "" }, { "docid": "1da5d127da7e75e04748f0dbdcb712f8", "score": "0.5375542", "text": "function createNode(tag, children) {\n\t\tif (tag === TEXT_NODE) {\n\t\t\treturn document.createTextNode(children[0]);\n\t\t} else {\n\t\t\treturn document.createElement(tag);\n\t\t}\n\t}", "title": "" }, { "docid": "8592fdad5ea3ab359b08a07fc45655fe", "score": "0.5351809", "text": "function nodeappendchildnomodificationallowederrEE() {\n var success;\n if(checkInitialization(builder, \"nodeappendchildnomodificationallowederrEE\") != null) return;\n var doc;\n var entRef;\n var createdNode;\n var appendedNode;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n entRef = doc.createEntityReference(\"ent4\");\n assertNotNull(\"createdEntRefNotNull\",entRef);\ncreatedNode = doc.createElement(\"text3\");\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n appendedNode = entRef.appendChild(createdNode);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 7);\n\t\t}\n\t\tassertTrue(\"throw_NO_MODIFICATION_ALLOWED_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "d1ec367addb9675daaa017309d76d306", "score": "0.53513145", "text": "function createElement(context,tag,data,children,normalizationType,alwaysNormalize){if(Array.isArray(data)||isPrimitive(data)){normalizationType=children;children=data;data=undefined;}if(isTrue(alwaysNormalize)){normalizationType=ALWAYS_NORMALIZE;}return _createElement(context,tag,data,children,normalizationType);}", "title": "" }, { "docid": "d1ec367addb9675daaa017309d76d306", "score": "0.53513145", "text": "function createElement(context,tag,data,children,normalizationType,alwaysNormalize){if(Array.isArray(data)||isPrimitive(data)){normalizationType=children;children=data;data=undefined;}if(isTrue(alwaysNormalize)){normalizationType=ALWAYS_NORMALIZE;}return _createElement(context,tag,data,children,normalizationType);}", "title": "" }, { "docid": "d1ec367addb9675daaa017309d76d306", "score": "0.53513145", "text": "function createElement(context,tag,data,children,normalizationType,alwaysNormalize){if(Array.isArray(data)||isPrimitive(data)){normalizationType=children;children=data;data=undefined;}if(isTrue(alwaysNormalize)){normalizationType=ALWAYS_NORMALIZE;}return _createElement(context,tag,data,children,normalizationType);}", "title": "" }, { "docid": "60fd9a18fe656de48b0a34afb75f2e9a", "score": "0.5345999", "text": "function hc_nodeappendchild() {\n var success;\n if(checkInitialization(builder, \"hc_nodeappendchild\") != null) return;\n var doc;\n var elementList;\n var employeeNode;\n var childList;\n var createdNode;\n var lchild;\n var childName;\n var appendedChild;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"p\");\n employeeNode = elementList.item(1);\n childList = employeeNode.childNodes;\n\n createdNode = doc.createElement(\"br\");\n appendedChild = employeeNode.appendChild(createdNode);\n lchild = employeeNode.lastChild;\n\n childName = lchild.nodeName;\n\n assertEqualsAutoCase(\"element\", \"nodeName\",\"br\",childName);\n \n}", "title": "" }, { "docid": "f41d7b2b6b747da30a80752a75fe6046", "score": "0.53418833", "text": "function nodeappendchildinvalidnodetype() {\n var success;\n if(checkInitialization(builder, \"nodeappendchildinvalidnodetype\") != null) return;\n var doc;\n var rootNode;\n var newChild;\n var appendedChild;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n rootNode = doc.documentElement;\n\n newChild = doc.createAttribute(\"newAttribute\");\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n appendedChild = rootNode.appendChild(newChild);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 3);\n\t\t}\n\t\tassertTrue(\"throw_HIERARCHY_REQUEST_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "8ad80f12ed1fd524df6688c05a93f46d", "score": "0.5334016", "text": "function creater(btnID, text) {\n if ('content' in document.createElement('template')) {\n const avatarColorClass = ['color-one', 'color-two'];\n const authorName = ['Tom', 'Jerry'];\n\n const msgBodyNode = document.querySelector('[data-msg-body]');\n const msgTmlpNode = document.querySelector('[data-msg-tmlp]');\n const clone = msgTmlpNode.content.cloneNode(true);\n const msgAvatar = clone.querySelector('.avatar');\n const msgTitile = clone.querySelector('.msg-title');\n const msgBody = clone.querySelector('.msg-body');\n\n msgAvatar.classList.add(avatarColorClass[btnID]);\n msgTitile.textContent = authorName[btnID];\n msgBody.textContent = text;\n\n msgBodyNode.appendChild(clone);\n msgBodyNode.scrollTop = 65535;\n } else alert('Ошибка! Браузер не поддерживает <template>');\n}", "title": "" }, { "docid": "876bab69cd5d04598651ad274118ae7b", "score": "0.5329194", "text": "function childCreator(obj, uridata, piece, index) {\n var regE = /[$]/g;\n if (index != piece.length) {\n if (obj.children.length == 0) {\n var objChild = createObj(piece[index], uridata, piece);\n obj.children.push(objChild);\n childCreator(objChild, uridata, piece, index + 1);\n } else {\n for (var i = 0; i < obj.children.length; i++) {\n var newPiece = piece[index].replace(\" \", \"\").replace(regE, \"\");\n var newBaseChild = obj.children[i].parent.replace(\" \", \"\").replace(regE, \"\");\n if (newBaseChild.search(newPiece) == -1) {\n //console.log(obj.children[i].parent);\n var objChild = createObj(piece[index], uridata, piece);\n obj.children.push(objChild);\n childCreator(objChild, uridata, piece, index + 1);\n }\n }\n }\n\n } else {\n return obj;\n }\n}", "title": "" }, { "docid": "35fa09b415cd8a046b6188ba3483d72e", "score": "0.5325794", "text": "function renderNode(node, elemParent) {\n\t\t\t\tvar currentElem = jQuery('<li></li>');\n\t\t\t\tcurrentElem.append('<a href=\"#\">'+node.label+'</a>')\n\t\t\t\tif (node.type === 'meta') {\n\t\t\t\t\tcurrentElem.attr('rel', 'meta');\n\t\t\t\t\tcurrentElem.attr('class', 'termgenie-select-template-tree-node');\n\t\t\t\t\tif (node.children) {\n\t\t\t\t\t\tvar childrenParent = jQuery('<ul></ul>');\n\t\t\t\t\t\tjQuery.each(node.children, function(intIndex, childNode) {\n\t\t\t\t\t\t\trenderNode(childNode, childrenParent);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcurrentElem.append(childrenParent);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (node.type === 'template'){\n\t\t\t\t\tcurrentElem.data('termTemplate', node.template);\n\t\t\t\t\t\n\t\t\t\t\t// add tooltip to rendered node\n\t\t\t\t\t// add an empty title tag, otherwise the widget \n\t\t\t\t\t// does not render the tooltip!\n\t\t\t\t\tcurrentElem.attr('title', '');\n\t\t\t\t\t// add class to hide icons on leaf nodes\n\t\t\t\t\tcurrentElem.attr('class', 'jstree-no-icons termgenie-select-template-tree-node');\n\t\t\t\t\tvar tooltipContent = renderTemplateDesc(node.template, 'termgenie-select-template-tree-tooltip');\n\t\t\t\t\tcurrentElem.tooltip( {\n\t\t\t\t\t\tcontent: tooltipContent\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telemParent.append(currentElem);\n\t\t\t}", "title": "" }, { "docid": "74d07eee3cc2e091a67812216fe7bcbd", "score": "0.53215957", "text": "function createNode(nameOrCtor, key) {\n var node;\n if (nameOrCtor === '#text') {\n node = createText(doc);\n } else {\n node = createElement(doc, currentParent, nameOrCtor, key);\n }\n context.markCreated(node);\n return node;\n}", "title": "" }, { "docid": "75e78393eebb3c3b2e2d23229f6bdda0", "score": "0.5315211", "text": "createElement (node, index, groupInfo, parentTagName, parentIsText) {\n return (\n <HTMLElement\n key={index}\n htmlStyles={this.props.htmlStyles}\n imagesMaxWidth={this.props.imagesMaxWidth}\n htmlAttribs={node.attribs}\n tagName={node.name}\n groupInfo={groupInfo}\n parentTagName={parentTagName}\n parentIsText={parentIsText}\n onLinkPress={this.props.onLinkPress}\n renderers={this.renderers}>\n {this.renderHtmlAsRN(node.children, node.name, !HTMLStyles.blockElements.has(node.name))}\n </HTMLElement>\n )\n }", "title": "" }, { "docid": "4846ac8aa4564c62cedd5dcca2b3c0ba", "score": "0.53062266", "text": "function createTextNode(parent, first) {\n var textNode = doc.createTextNode('');\n return first ? parent.insertBefore(textNode, parent.childNodes[0]) :\n parent.appendChild(textNode);\n}", "title": "" }, { "docid": "83c30645f327911a15bdd7cbaa57fbf4", "score": "0.5304305", "text": "function createChild(children, child) {\n if (isArray(child)) return child.reduce(createChild, children)\n else return children.push(createNode(child)), children\n}", "title": "" }, { "docid": "33eb8451bbb3b76d240bd6b3321a6e6e", "score": "0.5304175", "text": "function appendNodeWithText(parent, nodoTag, text){\n\tvar nuevoElemento = document.createElement(nodoTag);\n\tvar textoNode = document.createTextNode(text);\n\tnuevoElemento.appendChild(textoNode);\n\tparent.appendChild(nuevoElemento);\n}", "title": "" }, { "docid": "a87d8885f2ac2bd60953815b8f9db542", "score": "0.5299126", "text": "child (chd, idx) {\n try {\n\t this.rootDom();\n\t let ct = (true === cmputl.isinncmp(this)) ? this.childDom().component().getTree() : this.getTree();\n if (undefined === chd) {\n /* getter */\n return ct.getChild();\n }\n /* setter */\n ct.addChild(chd, idx);\n if ((true === this.isExists()) && (true === cmputl.isinncmp(this))) {\n /* perform layout on added components */\n cmputl.initmconf(this, \"layout\");\n }\n } catch (e) {\n console.error(e.stack);\n throw e;\n }\n }", "title": "" }, { "docid": "75ea953ba02bdc416e70b21441f31628", "score": "0.52902275", "text": "_createContreteType() {\n if (this.defaultElement.bindData) {\n const l = this.attributes.length;\n // eslint-disable-next-line no-plusplus\n for (let i = 0; i < l; ++i) {\n const { nodeName } = this.attributes.item(i);\n const { nodeValue } = this.attributes.item(i);\n // eslint-disable-next-line eqeqeq\n if (!nodeName.startsWith('@') && !nodeName.startsWith('ƒ')) {\n this.defaultElement.setAttribute(nodeName, nodeValue);\n }\n }\n this.defaultElement.bindData(this._field);\n this.parentNode.appendChild(this.defaultElement);\n } else {\n this._warning();\n }\n }", "title": "" }, { "docid": "ae8bb7ee2ee73f023b6a23530670a4cd", "score": "0.52898514", "text": "function makeChild(content,cls,tag,parent){\n var el = document.createElement( tag );\n el.className = cls ;\n el.innerHTML = content; //maybe use innerHTML for more control\n parent.appendChild( el );\n}", "title": "" }, { "docid": "89508ad30f29070317dc1f8fb2e653de", "score": "0.528793", "text": "addStoryNode(id, parent=false) {\n const { story } = this.state\n const node = {\n \"title\": `Node ${id}`,\n \"id\" : id,\n \"story_id\": story.id,\n \"votes\": 0,\n \"is_accepted\": false,\n \"background_id\": null,\n \"music_id\": null,\n \"text\": \"\"\n }\n story.nodes.push(node)\n\n if (parent) {\n\n if (parent.choices == null) {\n\n // First child\n if (parent.next_node_id == null) {\n parent.next_node_id = node.id\n\n // Second child\n } else {\n parent.choices = [\n {\n text : \"Option 1\",\n next_node_id : parent.next_node_id\n },\n {\n text : \"Option 2\",\n next_node_id : node.id\n }\n ]\n\n parent.next_node_id\n\n }\n\n // Other cases\n } else {\n parent.choices.push({\n text: `Option ${parent.choices.length + 1}`,\n next_node_id: node.id\n })\n\n }\n }\n\n return node\n }", "title": "" }, { "docid": "880efdbf76814ec07cf5c0784d704d46", "score": "0.5282985", "text": "function insertNode(node)\n {\n var d = node.getData();\n var cat = d.category;\n \n if(!root)\n { \n nodes.push(node); \n root = node.getData();\n node.parents = null; \n }\n else\n {\n if(cat === 'Group')\n {\n console.log('this is a group node');\n var gNode = new GroupNode();\n gNode.setID(d.id);\n nodes.push(gNode); \n }\n if(cat === 'Control Group')\n {\n console.log('this is the control group node');\n var gNode = new GroupNode();\n gNode.setID(d.id);\n nodes.push(gNode); \n }\n if(cat === 'Atlas')\n {\n console.log('this is the atlas node');\n var gNode = new TemplateNode();\n gNode.setID(d.id);\n nodes.push(gNode); \n }\n if(cat === 'Template')\n {\n console.log('this is template group node');\n var gNode = new TemplateNode();\n gNode.setID(d.id);\n nodes.push(gNode); \n }\n if(cat === 'Subject')\n {\n console.log('this is subject group node');\n var gNode = new SubjectNode();\n gNode.setID(d.id);\n nodes.push(gNode); \n }\n } \n }", "title": "" }, { "docid": "2e0ebf703aa3b3b09cd3b103b23b243f", "score": "0.5282895", "text": "function createTreeNode(_id, _text, _type, _children) {\n return { id: _id, text: _text, type: _type, children: _children };\n }", "title": "" }, { "docid": "29d49032d6614013fd9cdb2d0eb36834", "score": "0.52776533", "text": "insertChild(value) {\n const newTree = new Tree(value);\n this.children.push(newTree);\n return newTree;\n }", "title": "" }, { "docid": "9e59794eda07b5a3f806c66d53777d02", "score": "0.52758545", "text": "function hc_nodereplacechildnewchildexists() {\n var success;\n if(checkInitialization(builder, \"hc_nodereplacechildnewchildexists\") != null) return;\n var doc;\n var elementList;\n var employeeNode;\n var childList;\n var oldChild = null;\n\n var newChild = null;\n\n var child;\n var childName;\n var childNode;\n var actual = new Array();\n\n expected = new Array();\n expected[0] = \"strong\";\n expected[1] = \"code\";\n expected[2] = \"sup\";\n expected[3] = \"var\";\n expected[4] = \"em\";\n\n var replacedChild;\n var nodeType;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"p\");\n employeeNode = elementList.item(1);\n childList = employeeNode.getElementsByTagName(\"*\");\n newChild = childList.item(0);\n oldChild = childList.item(5);\n replacedChild = employeeNode.replaceChild(newChild,oldChild);\n assertSame(\"return_value_same\",oldChild,replacedChild);\nfor(var indexN10094 = 0;indexN10094 < childList.length; indexN10094++) {\n childNode = childList.item(indexN10094);\n childName = childNode.nodeName;\n\n nodeType = childNode.nodeType;\n\n \n\tif(\n\t(1 == nodeType)\n\t) {\n\tactual[actual.length] = childName;\n\n\t}\n\t\n\t\telse {\n\t\t\tassertEquals(\"textNodeType\",3,nodeType);\n assertEquals(\"textNodeName\",\"#text\",childName);\n \n\t\t}\n\t\n\t}\n assertEqualsListAutoCase(\"element\", \"childNames\",expected,actual);\n \n}", "title": "" }, { "docid": "db3060ef5ae56440e90ff447ca2d13d5", "score": "0.52749807", "text": "insertNodeInOriginalTree(nodeId, newNode, tree) {\n const parentIndex = tree.findIndex(element => element.id === nodeId);\n if (parentIndex > -1) {\n tree[parentIndex].children.push(newNode);\n }\n return tree;\n }", "title": "" }, { "docid": "788cf4fc341e18bdfd954ee83d918b2f", "score": "0.52633995", "text": "function addNode(parent, n) {\n if (!n) {\n return parent;\n }\n\n if (!parent.children) {\n parent.children = [];\n }\n\n // If text is present, move it to a subnode.\n if (parent.text) {\n parent.children.push({\n text: parent.text,\n parent: parent\n });\n delete parent.text;\n }\n\n n.parent = parent;\n parent.children.push(n);\n\n return parent;\n}", "title": "" }, { "docid": "0a94f6bf7afde010cc841c06d2527a07", "score": "0.52609396", "text": "appendInitialChild(parentInstance, child) {\n parentInstance.appendChild(child);\n }", "title": "" }, { "docid": "0a94f6bf7afde010cc841c06d2527a07", "score": "0.52609396", "text": "appendInitialChild(parentInstance, child) {\n parentInstance.appendChild(child);\n }", "title": "" }, { "docid": "3ab1db953a0ca5de7d47bfb4a63f76f0", "score": "0.52532536", "text": "static append(parent, node) {\n const last = parent.children[parent.children.length - 1];\n if (last)\n last.rs = node;\n node.ls = last;\n node.rs = null;\n node.parent = parent;\n parent.children.push(node);\n return node;\n }", "title": "" }, { "docid": "b69bb29174c916443aa13c7e60c37928", "score": "0.52492255", "text": "function hc_nodeinsertbeforeinvalidnodetype() {\n var success;\n if(checkInitialization(builder, \"hc_nodeinsertbeforeinvalidnodetype\") != null) return;\n var doc;\n var rootNode;\n var newChild;\n var elementList;\n var refChild;\n var insertedNode;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n newChild = doc.createAttribute(\"title\");\n elementList = doc.getElementsByTagName(\"p\");\n refChild = elementList.item(1);\n rootNode = refChild.parentNode;\n\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n insertedNode = rootNode.insertBefore(newChild,refChild);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 3);\n\t\t}\n\t\tassertTrue(\"throw_HIERARCHY_REQUEST_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "b00dba70af5137dcfef8d8bbc9ea506b", "score": "0.52486515", "text": "static insert(parent, idx, node) {\n node.ls = parent.children[idx - 1];\n if (parent.children[idx - 1])\n parent.children[idx - 1].rs = node;\n node.rs = parent.children[idx];\n if (parent.children[idx])\n parent.children[idx].ls = node;\n node.parent = parent;\n parent.children.splice(idx, 0, node);\n return node;\n }", "title": "" }, { "docid": "bcc93ac3c0a3f1192e60ad652260647e", "score": "0.5231183", "text": "build() {\n this._entries.forEach((n) => this._processNode(n));\n if (!this._rootNode) {\n if (this._debug) {\n /* eslint-disable no-console */\n console.log(`substituting dummy node for missing root span: traceId=${this._traceId}`);\n }\n this._rootNode = new Node();\n }\n\n // Materialize the tree using parent - child relationships\n Object.keys(this._idToParent).forEach(id => {\n if (id === this._rootId) return; // don't re-process root\n\n const node = this._idToNode[id];\n const parent = this._idToNode[this._idToParent[id]];\n if (!parent) { // handle headless\n this._rootNode.addChild(node);\n } else {\n parent.addChild(node);\n }\n });\n return this._rootNode;\n }", "title": "" }, { "docid": "7f79ca17be38894b751f1619b06e6f30", "score": "0.5231063", "text": "function CreateAndAppendElement (parentId, childId, elementType, html) {\r\n\tvar e = document.createElement(elementType);\r\n\te.setAttribute(\"id\", childId);\r\n\te.innerHTML = html;\r\n\tdocument.getElementById(parentId).appendChild(e);\t\r\n}", "title": "" }, { "docid": "2f03a28c01579ce89f09891efda44a4a", "score": "0.5228456", "text": "function cloneNode(node, recursive) {\n if (recursive === void 0) { recursive = false; }\n var result;\n if (isText(node)) {\n result = new Text(node.data);\n }\n else if (isComment(node)) {\n result = new Comment(node.data);\n }\n else if (isTag(node)) {\n var children = recursive ? cloneChildren(node.children) : [];\n var clone_1 = new Element(node.name, __assign({}, node.attribs), children);\n children.forEach(function (child) { return (child.parent = clone_1); });\n if (node.namespace != null) {\n clone_1.namespace = node.namespace;\n }\n if (node[\"x-attribsNamespace\"]) {\n clone_1[\"x-attribsNamespace\"] = __assign({}, node[\"x-attribsNamespace\"]);\n }\n if (node[\"x-attribsPrefix\"]) {\n clone_1[\"x-attribsPrefix\"] = __assign({}, node[\"x-attribsPrefix\"]);\n }\n result = clone_1;\n }\n else if (isCDATA(node)) {\n var children = recursive ? cloneChildren(node.children) : [];\n var clone_2 = new NodeWithChildren(domelementtype_1.ElementType.CDATA, children);\n children.forEach(function (child) { return (child.parent = clone_2); });\n result = clone_2;\n }\n else if (isDocument(node)) {\n var children = recursive ? cloneChildren(node.children) : [];\n var clone_3 = new Document(children);\n children.forEach(function (child) { return (child.parent = clone_3); });\n if (node[\"x-mode\"]) {\n clone_3[\"x-mode\"] = node[\"x-mode\"];\n }\n result = clone_3;\n }\n else if (isDirective(node)) {\n var instruction = new ProcessingInstruction(node.name, node.data);\n if (node[\"x-name\"] != null) {\n instruction[\"x-name\"] = node[\"x-name\"];\n instruction[\"x-publicId\"] = node[\"x-publicId\"];\n instruction[\"x-systemId\"] = node[\"x-systemId\"];\n }\n result = instruction;\n }\n else {\n throw new Error(\"Not implemented yet: \".concat(node.type));\n }\n result.startIndex = node.startIndex;\n result.endIndex = node.endIndex;\n if (node.sourceCodeLocation != null) {\n result.sourceCodeLocation = node.sourceCodeLocation;\n }\n return result;\n}", "title": "" }, { "docid": "2f03a28c01579ce89f09891efda44a4a", "score": "0.5228456", "text": "function cloneNode(node, recursive) {\n if (recursive === void 0) { recursive = false; }\n var result;\n if (isText(node)) {\n result = new Text(node.data);\n }\n else if (isComment(node)) {\n result = new Comment(node.data);\n }\n else if (isTag(node)) {\n var children = recursive ? cloneChildren(node.children) : [];\n var clone_1 = new Element(node.name, __assign({}, node.attribs), children);\n children.forEach(function (child) { return (child.parent = clone_1); });\n if (node.namespace != null) {\n clone_1.namespace = node.namespace;\n }\n if (node[\"x-attribsNamespace\"]) {\n clone_1[\"x-attribsNamespace\"] = __assign({}, node[\"x-attribsNamespace\"]);\n }\n if (node[\"x-attribsPrefix\"]) {\n clone_1[\"x-attribsPrefix\"] = __assign({}, node[\"x-attribsPrefix\"]);\n }\n result = clone_1;\n }\n else if (isCDATA(node)) {\n var children = recursive ? cloneChildren(node.children) : [];\n var clone_2 = new NodeWithChildren(domelementtype_1.ElementType.CDATA, children);\n children.forEach(function (child) { return (child.parent = clone_2); });\n result = clone_2;\n }\n else if (isDocument(node)) {\n var children = recursive ? cloneChildren(node.children) : [];\n var clone_3 = new Document(children);\n children.forEach(function (child) { return (child.parent = clone_3); });\n if (node[\"x-mode\"]) {\n clone_3[\"x-mode\"] = node[\"x-mode\"];\n }\n result = clone_3;\n }\n else if (isDirective(node)) {\n var instruction = new ProcessingInstruction(node.name, node.data);\n if (node[\"x-name\"] != null) {\n instruction[\"x-name\"] = node[\"x-name\"];\n instruction[\"x-publicId\"] = node[\"x-publicId\"];\n instruction[\"x-systemId\"] = node[\"x-systemId\"];\n }\n result = instruction;\n }\n else {\n throw new Error(\"Not implemented yet: \".concat(node.type));\n }\n result.startIndex = node.startIndex;\n result.endIndex = node.endIndex;\n if (node.sourceCodeLocation != null) {\n result.sourceCodeLocation = node.sourceCodeLocation;\n }\n return result;\n}", "title": "" }, { "docid": "fcf2955164f5aa3621fda530ecaaef3e", "score": "0.5224564", "text": "function hc_nodeinsertbeforerefchildnull() {\n var success;\n if(checkInitialization(builder, \"hc_nodeinsertbeforerefchildnull\") != null) return;\n var doc;\n var elementList;\n var employeeNode;\n var childList;\n var refChild = null;\n\n var newChild;\n var child;\n var childName;\n var insertedNode;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"p\");\n employeeNode = elementList.item(1);\n childList = employeeNode.childNodes;\n\n newChild = doc.createElement(\"br\");\n insertedNode = employeeNode.insertBefore(newChild,refChild);\n child = employeeNode.lastChild;\n\n childName = child.nodeName;\n\n assertEqualsAutoCase(\"element\", \"nodeName\",\"br\",childName);\n \n}", "title": "" }, { "docid": "5aabd9e0c6329b898251197ebc7f98cd", "score": "0.5210173", "text": "function node(value) {\n return {\n value,\n children: [],\n };\n}", "title": "" }, { "docid": "0b11f3d2984325e670eb09d98ebbbe82", "score": "0.5202142", "text": "function createNode() {\r\n var node = document.createElement('div');\r\n var content = document.createElement('ul');\r\n content.className = 'p-Menu-content';\r\n node.appendChild(content);\r\n node.tabIndex = -1;\r\n return node;\r\n }", "title": "" }, { "docid": "e97c8ae0e7b29618f08a9c966b9966fe", "score": "0.5198033", "text": "function addNewNode ( json ) {\r\n \r\n\tvar pid = tid ; // pid is local variable for pid to which node is to be attached\r\n\t\r\n\tvar id = nid ; //id contains id for new node\r\n\t\tnid += 1 ; \r\n\tvar child = 0 ; \r\n\tvar level ; \r\n\t\r\n\tif ( pid === 0 ) \r\n\t\tlevel = 0 ; \r\n\telse {\r\n\t\r\n\r\n\t\t\r\n\t\tlevel = getLevel ( pid ) ; \r\n\t\tincrChild ( pid ) ; \r\n\r\n\t}\r\n\r\n\tvar p ; \r\n\r\n\r\n\tif ( json && json.text ) \r\n\r\n\t\tp = {node:(json.text)?json.text:'',instDetail:(json.instDetail)?json.instDetail:\"\" , x:0 , y:0 , pid:pid , id:id , flow:3 , child:child , level:level , text:nodeTextFormatorHandler ( json.text , json.visibility, id ) , suspended:\"\"+json.suspended , visibility: ( json.visibility === \"undefined\" ) ?2:json.visibility , typeOfStr: ( json.typeOfStr ) ?json.typeOfStr:\"EL\"} ; \r\n\telse\r\n\r\n\t\tp = {node:(json.text)?json.text:'',instDetail:(json.instDetail)?json.instDetail:\"\" , x:0 , y:0 , pid:pid , id:id , child:child , level:level , text:id , suspended:\"\"+json.suspended , visibility: ( json.visibility === \"undefined\" ) ?2:json.visibility , typeOfStr: ( json.typeOfStr ) ?json.typeOfStr:\"EL\"} ; \r\n\r\n\tif ( json && json.dbid ) \r\n\t\tp.dbid = json.dbid ; \r\n\telse\r\n\t\tp.dbid = -1 ; //default dbid is equal to -1\r\n\r\n\tif ( json && json.toolTip ) \r\n\tp.toolTip = json.toolTip ; \r\n\r\n\t\r\n\tif ( model.length ) {\r\n\t \r\n\r\n\t\tinsertInToModel ( p ) ; \r\n\t}\r\n\telse\r\n\t\tmodel [ 0 ] = p ; \r\n\r\n\r\n\trender ( ) ; \r\n\r\n\t\r\n\r\n}", "title": "" }, { "docid": "07420bd37a543ed2d30eac47bc57f4de", "score": "0.51962024", "text": "function hc_nodereplacechildnodename() {\n var success;\n if(checkInitialization(builder, \"hc_nodereplacechildnodename\") != null) return;\n var doc;\n var elementList;\n var employeeNode;\n var childList;\n var oldChild;\n var newChild;\n var replacedNode;\n var childName;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"p\");\n employeeNode = elementList.item(1);\n childList = employeeNode.getElementsByTagName(\"em\");\n oldChild = childList.item(0);\n newChild = doc.createElement(\"br\");\n replacedNode = employeeNode.replaceChild(newChild,oldChild);\n childName = replacedNode.nodeName;\n\n assertEqualsAutoCase(\"element\", \"replacedNodeName\",\"em\",childName);\n \n}", "title": "" }, { "docid": "6bc79cf2264bf2782ab985b7b096d524", "score": "0.51936394", "text": "function traverseAndCreate(node) {\n var item = node.item;\n\n var tn = new fieldmapper.aouctn();\n tn.tree(mTree.id());\n tn.org_unit(item.id[0])\n\n var pnode = node.getParent();\n if (pnode) {\n // find the newly created parent node and extract the ID \n var ptn = ctNodes.filter(function(n) {\n return n.org_unit() == pnode.item.id[0]})[0];\n tn.parent_node(ptn.id());\n }\n\n // if the last node was our previous sibling\n if (prevTn && prevTn.parent_node() == tn.parent_node()) {\n tn.sibling_order(++sorder);\n } else { sorder = 0; }\n\n console.log(\"Creating new node for org unit \" + tn.org_unit());\n\n // create the new node, then process the children\n pcrud.create(tn, {\n oncomplete : function(r, objs) {\n var newTn = objs[0];\n ctNodes.push(newTn);\n prevTn = newTn;\n if (nodeList.length == 0) {\n progressDialog.hide();\n location.href = location.href;\n } else {\n progressDialog.update({maximum : nodeList.length, progress : ++progress});\n traverseAndCreate(nodeList.shift());\n }\n }\n });\n }", "title": "" }, { "docid": "b29f6c1b93f8d05766b252b65cd6ce47", "score": "0.51927793", "text": "function appendNode(data, parent_node) {\n\t\tswitch (data.type) {\n\t\tcase \"window\":\n\t\t\tvar id = data.id;\n\t\t\tif (!id) \n\t\t\t\tid = 'dialog-' + (new Date()).getTime();\n\t\t\tvar obj = $('<div />').attr('id', id).addClass('machine-subwindow');\n\t\t\tobj.type = \"window\";\n\t\t\tobjects[id] = obj;\n\t\t\tif (data.title) \n\t\t\t\tobj.attr('title', data.title);\n\t\t\t$(parent_node).append(obj);\n\t\t\tobj.dialog(oCanvas.extend({ autoOpen: false }, data));\n\t\t\tbreak;\n\n\t\tcase \"html\":\n\t\t\tvar obj = $(data.content);\n\t\t\t$(parent_node).append(obj);\n\t\t\tbreak;\n\n\t\tcase \"canvas\":\n\t\t\tvar id = data.id;\n\t\t\tif (!id) id = 'canvas-' + (new Date()).getTime();\n\t\t\tvar obj = $('<canvas />').attr('id', id).appendTo(parent_node);\n\t\t\tvar c = oCanvas.create({ canvas: '#'+id });\n\t\t\tc.width = data.width;\n\t\t\tc.height = data.height;\n\t\t\tobj.type = 'canvas';\n\t\t\tif (data.nodes) {\n\t\t\t\tvar nodes = data.nodes;\n\t\t\t\tfor (var i = 0; i < nodes.length; i++) {\n\t\t\t\t\tvar node = createCanvasNode(nodes[i], c);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn obj;\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tconsole.log(\"Unknown data\");\n\t\t\tconsole.log(data);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (obj && obj.type !== 'canvas') {\n\t\t\t// Add children\n\t\t\tif (data.nodes) {\n\t\t\t\tvar nodes = data.nodes;\n\t\t\t\tfor (var i = 0; i < nodes.length; i++) {\n\t\t\t\t\tappendNode(nodes[i], obj);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn obj;\n\t}", "title": "" }, { "docid": "2b839c2b7b845aa68da4dc6e02186e1b", "score": "0.5192424", "text": "function nodereplacechildnomodificationallowederr() {\n var success;\n if(checkInitialization(builder, \"nodereplacechildnomodificationallowederr\") != null) return;\n var doc;\n var genderList;\n var genderNode;\n var entRef;\n var entElement;\n var createdNode;\n var replacedChild;\n var nodeType;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n genderList = doc.getElementsByTagName(\"gender\");\n genderNode = genderList.item(2);\n entRef = genderNode.firstChild;\n\n nodeType = entRef.nodeType;\n\n \n\tif(\n\t(1 == nodeType)\n\t) {\n\tentRef = doc.createEntityReference(\"ent4\");\n assertNotNull(\"createdEntRefNotNull\",entRef);\n\n\t}\n\tentElement = entRef.firstChild;\n\n createdNode = doc.createElement(\"newChild\");\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n replacedChild = entRef.replaceChild(createdNode,entElement);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 7);\n\t\t}\n\t\tassertTrue(\"throw_NO_MODIFICATION_ALLOWED_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "bca15a2d0bb1c513e022b0635b2bdc5a", "score": "0.51914877", "text": "function nodereplacechild() {\n var success;\n if(checkInitialization(builder, \"nodereplacechild\") != null) return;\n var doc;\n var elementList;\n var employeeNode;\n var childList;\n var oldChild;\n var newChild;\n var child;\n var childName;\n var replacedNode;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"employee\");\n employeeNode = elementList.item(1);\n childList = employeeNode.childNodes;\n\n oldChild = childList.item(0);\n newChild = doc.createElement(\"newChild\");\n replacedNode = employeeNode.replaceChild(newChild,oldChild);\n child = childList.item(0);\n childName = child.nodeName;\n\n assertEquals(\"nodeReplaceChildAssert1\",\"newChild\",childName);\n \n}", "title": "" }, { "docid": "8e442a0d0c4ac18a91ab9c27bb386452", "score": "0.5188623", "text": "appendAndCreateP(content, parent) {\n let p = this.p.createP(content)\n p.elt.className = \"gameP\"\n\n parent.elt.appendChild(p.elt)\n return p\n }", "title": "" }, { "docid": "60958c5776e24c29d229eee762c0f2ac", "score": "0.5188495", "text": "function createNode() {\n var node = document.createElement('div');\n var content = document.createElement('ul');\n content.className = 'p-Menu-content';\n node.appendChild(content);\n node.tabIndex = -1;\n return node;\n }", "title": "" }, { "docid": "fa44f115059b42d4feb5aabf9825bf8d", "score": "0.518381", "text": "setParent(parentNode, childNode){\r\n parentNode.children.push(childNode);\r\n childNode.parent = parentNode;\r\n }", "title": "" }, { "docid": "0deda7066f199479973cf02856a8ea1a", "score": "0.51790756", "text": "function customDeepCloneNode(node) {\n var cloned = null;\n if (node.nodeName.match(/^YT/)) {\n cloned = document.createElement('div');\n node.getAttributeNames().forEach(function(attributeName) {\n cloned.setAttribute(attributeName, node.getAttribute(attributeName));\n });\n } else {\n cloned = node.cloneNode();\n }\n\n if (node.children.length == 0) {\n cloned.textContent = node.textContent;\n return cloned;\n }\n\n cloned.innerHTML = '';\n for (var i = 0; i < node.children.length; i++) {\n cloned.appendChild(customDeepCloneNode(node.children[i], null));\n }\n return cloned;\n }", "title": "" }, { "docid": "1740011db04d7543b70110096862c178", "score": "0.517869", "text": "function addNewChildNodeToParent(graph, parentNodeId, child) {\n nodeCount = graph.getNodesCount();\n nodeCount++;\n childNodeId = child.tagName + '-' + nodeCount;\n // graph.addLink(parentNodeId, childNodeId);\n events.fire('added', parentNodeId, childNodeId);\n return childNodeId;\n}", "title": "" }, { "docid": "a9a89ef5a452d2b61a9ef3f9487cd574", "score": "0.5178068", "text": "function pathForNewNode(node, parentPath) {\n var contextPath = parentPath;\n while (!contextPath.context) {\n contextPath = contextPath.parentPath;\n if (contextPath === null) {\n throw parentPath.buildCodeFrameError(\"Unable to find a context upon which to traverse!\", TypeError);\n }\n }\n var result = contextPath.context.create(parentPath.node, [node], 0, \"dummy\");\n result.setContext(contextPath.context);\n return result;\n }", "title": "" }, { "docid": "eebb016197d9c0728f93f8408871d127", "score": "0.5173508", "text": "function cloneNode(node, recursive) {\n if (recursive === void 0) { recursive = false; }\n var result;\n switch (node.type) {\n case \"text\" /* Text */:\n result = new Text(node.data);\n break;\n case \"directive\" /* Directive */: {\n var instr = node;\n result = new ProcessingInstruction(instr.name, instr.data);\n if (instr[\"x-name\"] != null) {\n result[\"x-name\"] = instr[\"x-name\"];\n result[\"x-publicId\"] = instr[\"x-publicId\"];\n result[\"x-systemId\"] = instr[\"x-systemId\"];\n }\n break;\n }\n case \"comment\" /* Comment */:\n result = new Comment(node.data);\n break;\n case \"tag\" /* Tag */:\n case \"script\" /* Script */:\n case \"style\" /* Style */: {\n var elem = node;\n var children = recursive ? cloneChildren(elem.children) : [];\n var clone_1 = new Element(elem.name, __assign({}, elem.attribs), children);\n children.forEach(function (child) { return (child.parent = clone_1); });\n if (elem[\"x-attribsNamespace\"]) {\n clone_1[\"x-attribsNamespace\"] = __assign({}, elem[\"x-attribsNamespace\"]);\n }\n if (elem[\"x-attribsPrefix\"]) {\n clone_1[\"x-attribsPrefix\"] = __assign({}, elem[\"x-attribsPrefix\"]);\n }\n result = clone_1;\n break;\n }\n case \"cdata\" /* CDATA */: {\n var cdata = node;\n var children = recursive ? cloneChildren(cdata.children) : [];\n var clone_2 = new NodeWithChildren(node.type, children);\n children.forEach(function (child) { return (child.parent = clone_2); });\n result = clone_2;\n break;\n }\n case \"root\" /* Root */: {\n var doc = node;\n var children = recursive ? cloneChildren(doc.children) : [];\n var clone_3 = new Document(children);\n children.forEach(function (child) { return (child.parent = clone_3); });\n if (doc[\"x-mode\"]) {\n clone_3[\"x-mode\"] = doc[\"x-mode\"];\n }\n result = clone_3;\n break;\n }\n case \"doctype\" /* Doctype */: {\n // This type isn't used yet.\n throw new Error(\"Not implemented yet: ElementType.Doctype case\");\n }\n }\n result.startIndex = node.startIndex;\n result.endIndex = node.endIndex;\n return result;\n}", "title": "" }, { "docid": "7b210b8232f3c2076d3bd10508176b71", "score": "0.5172708", "text": "function hc_nodeappendchildnewchilddiffdocument() {\n var success;\n if(checkInitialization(builder, \"hc_nodeappendchildnewchilddiffdocument\") != null) return;\n var doc1;\n var doc2;\n var newChild;\n var elementList;\n var elementNode;\n var appendedChild;\n \n var doc1Ref = null;\n if (typeof(this.doc1) != 'undefined') {\n doc1Ref = this.doc1;\n }\n doc1 = load(doc1Ref, \"doc1\", \"hc_staff\");\n \n var doc2Ref = null;\n if (typeof(this.doc2) != 'undefined') {\n doc2Ref = this.doc2;\n }\n doc2 = load(doc2Ref, \"doc2\", \"hc_staff\");\n newChild = doc1.createElement(\"br\");\n elementList = doc2.getElementsByTagName(\"p\");\n elementNode = elementList.item(1);\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n appendedChild = elementNode.appendChild(newChild);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 4);\n\t\t}\n\t\tassertTrue(\"throw_WRONG_DOCUMENT_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "302d7307e7adbef68c4fac3e8f65ce56", "score": "0.5164299", "text": "function createNode(tag, parent, id, className, text, send = null) {\n const node = document.createElement(tag);\n if (id) node.id = id;\n if (className) node.className = className;\n if (text) {\n const textNode = document.createTextNode(text);\n node.appendChild(textNode);\n }\n if (send) node.classList.add(\"ship-send\");\n document.getElementById(parent).appendChild(node);\n}", "title": "" }, { "docid": "c7712a38a45e5cdab07e9942db353b66", "score": "0.5161701", "text": "function setNodeTemplate() {\n var canvas = new ej2_react_diagrams_2.StackPanel();\n canvas.children = [];\n canvas.style.strokeWidth = 0;\n canvas.style.fill = \"#e6e0eb\";\n canvas.children.push(getTextElement(\"Events\", \"#a6a1e0\"));\n canvas.children.push(getTextElement(\"Emails\", \"#db8ec9\"));\n canvas.children.push(getTextElement(\"Calls\", \"#db8ec9\"));\n canvas.children.push(getTextElement(\"Smart Contents\", \"#db8ec9\"));\n return canvas;\n}", "title": "" }, { "docid": "b345d690a6dabb3302c063aa4907d73d", "score": "0.51558304", "text": "function hc_nodeinsertbeforerefchildnonexistent() {\n var success;\n if(checkInitialization(builder, \"hc_nodeinsertbeforerefchildnonexistent\") != null) return;\n var doc;\n var refChild;\n var newChild;\n var elementList;\n var elementNode;\n var insertedNode;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n newChild = doc.createElement(\"br\");\n refChild = doc.createElement(\"b\");\n elementList = doc.getElementsByTagName(\"p\");\n elementNode = elementList.item(1);\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n insertedNode = elementNode.insertBefore(newChild,refChild);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 8);\n\t\t}\n\t\tassertTrue(\"throw_NOT_FOUND_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "6d4955049eec0565a3ca3e5cfad70f49", "score": "0.51549786", "text": "function createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, text, isICU) {\n const i18nNodeIdx = allocExpando(tView, lView, 1, null);\n let opCode = i18nNodeIdx << I18nCreateOpCode.SHIFT;\n let parentTNode = getCurrentParentTNode();\n if (rootTNode === parentTNode) {\n // FIXME(misko): A null `parentTNode` should represent when we fall of the `LView` boundary.\n // (there is no parent), but in some circumstances (because we are inconsistent about how we set\n // `previousOrParentTNode`) it could point to `rootTNode` So this is a work around.\n parentTNode = null;\n }\n if (parentTNode === null) {\n // If we don't have a parent that means that we can eagerly add nodes.\n // If we have a parent than these nodes can't be added now (as the parent has not been created\n // yet) and instead the `parentTNode` is responsible for adding it. See\n // `TNode.insertBeforeIndex`\n opCode |= I18nCreateOpCode.APPEND_EAGERLY;\n }\n if (isICU) {\n opCode |= I18nCreateOpCode.COMMENT;\n ensureIcuContainerVisitorLoaded(loadIcuContainerVisitor);\n }\n createOpCodes.push(opCode, text === null ? '' : text);\n // We store `{{?}}` so that when looking at debug `TNodeType.template` we can see where the\n // bindings are.\n const tNode = createTNodeAtIndex(tView, i18nNodeIdx, isICU ? 32 /* Icu */ : 1 /* Text */, text === null ? (ngDevMode ? '{{?}}' : '') : text, null);\n addTNodeAndUpdateInsertBeforeIndex(existingTNodes, tNode);\n const tNodeIdx = tNode.index;\n setCurrentTNode(tNode, false /* Text nodes are self closing */);\n if (parentTNode !== null && rootTNode !== parentTNode) {\n // We are a child of deeper node (rather than a direct child of `i18nStart` instruction.)\n // We have to make sure to add ourselves to the parent.\n setTNodeInsertBeforeIndex(parentTNode, tNodeIdx);\n }\n return tNode;\n}", "title": "" }, { "docid": "6d4955049eec0565a3ca3e5cfad70f49", "score": "0.51549786", "text": "function createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, text, isICU) {\n const i18nNodeIdx = allocExpando(tView, lView, 1, null);\n let opCode = i18nNodeIdx << I18nCreateOpCode.SHIFT;\n let parentTNode = getCurrentParentTNode();\n if (rootTNode === parentTNode) {\n // FIXME(misko): A null `parentTNode` should represent when we fall of the `LView` boundary.\n // (there is no parent), but in some circumstances (because we are inconsistent about how we set\n // `previousOrParentTNode`) it could point to `rootTNode` So this is a work around.\n parentTNode = null;\n }\n if (parentTNode === null) {\n // If we don't have a parent that means that we can eagerly add nodes.\n // If we have a parent than these nodes can't be added now (as the parent has not been created\n // yet) and instead the `parentTNode` is responsible for adding it. See\n // `TNode.insertBeforeIndex`\n opCode |= I18nCreateOpCode.APPEND_EAGERLY;\n }\n if (isICU) {\n opCode |= I18nCreateOpCode.COMMENT;\n ensureIcuContainerVisitorLoaded(loadIcuContainerVisitor);\n }\n createOpCodes.push(opCode, text === null ? '' : text);\n // We store `{{?}}` so that when looking at debug `TNodeType.template` we can see where the\n // bindings are.\n const tNode = createTNodeAtIndex(tView, i18nNodeIdx, isICU ? 32 /* Icu */ : 1 /* Text */, text === null ? (ngDevMode ? '{{?}}' : '') : text, null);\n addTNodeAndUpdateInsertBeforeIndex(existingTNodes, tNode);\n const tNodeIdx = tNode.index;\n setCurrentTNode(tNode, false /* Text nodes are self closing */);\n if (parentTNode !== null && rootTNode !== parentTNode) {\n // We are a child of deeper node (rather than a direct child of `i18nStart` instruction.)\n // We have to make sure to add ourselves to the parent.\n setTNodeInsertBeforeIndex(parentTNode, tNodeIdx);\n }\n return tNode;\n}", "title": "" }, { "docid": "6d4955049eec0565a3ca3e5cfad70f49", "score": "0.51549786", "text": "function createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, text, isICU) {\n const i18nNodeIdx = allocExpando(tView, lView, 1, null);\n let opCode = i18nNodeIdx << I18nCreateOpCode.SHIFT;\n let parentTNode = getCurrentParentTNode();\n if (rootTNode === parentTNode) {\n // FIXME(misko): A null `parentTNode` should represent when we fall of the `LView` boundary.\n // (there is no parent), but in some circumstances (because we are inconsistent about how we set\n // `previousOrParentTNode`) it could point to `rootTNode` So this is a work around.\n parentTNode = null;\n }\n if (parentTNode === null) {\n // If we don't have a parent that means that we can eagerly add nodes.\n // If we have a parent than these nodes can't be added now (as the parent has not been created\n // yet) and instead the `parentTNode` is responsible for adding it. See\n // `TNode.insertBeforeIndex`\n opCode |= I18nCreateOpCode.APPEND_EAGERLY;\n }\n if (isICU) {\n opCode |= I18nCreateOpCode.COMMENT;\n ensureIcuContainerVisitorLoaded(loadIcuContainerVisitor);\n }\n createOpCodes.push(opCode, text === null ? '' : text);\n // We store `{{?}}` so that when looking at debug `TNodeType.template` we can see where the\n // bindings are.\n const tNode = createTNodeAtIndex(tView, i18nNodeIdx, isICU ? 32 /* Icu */ : 1 /* Text */, text === null ? (ngDevMode ? '{{?}}' : '') : text, null);\n addTNodeAndUpdateInsertBeforeIndex(existingTNodes, tNode);\n const tNodeIdx = tNode.index;\n setCurrentTNode(tNode, false /* Text nodes are self closing */);\n if (parentTNode !== null && rootTNode !== parentTNode) {\n // We are a child of deeper node (rather than a direct child of `i18nStart` instruction.)\n // We have to make sure to add ourselves to the parent.\n setTNodeInsertBeforeIndex(parentTNode, tNodeIdx);\n }\n return tNode;\n}", "title": "" }, { "docid": "6d4955049eec0565a3ca3e5cfad70f49", "score": "0.51549786", "text": "function createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, text, isICU) {\n const i18nNodeIdx = allocExpando(tView, lView, 1, null);\n let opCode = i18nNodeIdx << I18nCreateOpCode.SHIFT;\n let parentTNode = getCurrentParentTNode();\n if (rootTNode === parentTNode) {\n // FIXME(misko): A null `parentTNode` should represent when we fall of the `LView` boundary.\n // (there is no parent), but in some circumstances (because we are inconsistent about how we set\n // `previousOrParentTNode`) it could point to `rootTNode` So this is a work around.\n parentTNode = null;\n }\n if (parentTNode === null) {\n // If we don't have a parent that means that we can eagerly add nodes.\n // If we have a parent than these nodes can't be added now (as the parent has not been created\n // yet) and instead the `parentTNode` is responsible for adding it. See\n // `TNode.insertBeforeIndex`\n opCode |= I18nCreateOpCode.APPEND_EAGERLY;\n }\n if (isICU) {\n opCode |= I18nCreateOpCode.COMMENT;\n ensureIcuContainerVisitorLoaded(loadIcuContainerVisitor);\n }\n createOpCodes.push(opCode, text === null ? '' : text);\n // We store `{{?}}` so that when looking at debug `TNodeType.template` we can see where the\n // bindings are.\n const tNode = createTNodeAtIndex(tView, i18nNodeIdx, isICU ? 32 /* Icu */ : 1 /* Text */, text === null ? (ngDevMode ? '{{?}}' : '') : text, null);\n addTNodeAndUpdateInsertBeforeIndex(existingTNodes, tNode);\n const tNodeIdx = tNode.index;\n setCurrentTNode(tNode, false /* Text nodes are self closing */);\n if (parentTNode !== null && rootTNode !== parentTNode) {\n // We are a child of deeper node (rather than a direct child of `i18nStart` instruction.)\n // We have to make sure to add ourselves to the parent.\n setTNodeInsertBeforeIndex(parentTNode, tNodeIdx);\n }\n return tNode;\n}", "title": "" }, { "docid": "2b65c12fc8ed88cc25c8d801c9c84286", "score": "0.51539654", "text": "static mount(targetNode) {\n\t\t\n\t\t/* Comment */\n\t\tconst comment = document.createComment(TEMPLATE_COMMENT);\n\t\ttargetNode.appendChild(comment);\n\t\t\n\t\t/* Styles */\n\t\tconst styleFragment = InlineNote.createStyles();\n\n\t\t/* Template */\n\t\tconst templateFragment = InlineNote.createTemplate();\n\t\tconst templateElement = document.createElement('template');\n\t\ttemplateElement.setAttribute('id', TEMPLATE_ID);\n\t\ttemplateElement.content.appendChild(styleFragment);\n\t\ttemplateElement.content.appendChild(templateFragment);\n\t\t\n\t\t/* Document */\n\t\tconst templateNode = targetNode.appendChild(templateElement);\n\n\t\treturn templateNode;\n\t}", "title": "" }, { "docid": "aecf6aae7f5e49c6ff6727de8e26e39d", "score": "0.5152994", "text": "finalizeInitialChildren(element, type, props) {\n Object.keys(props).forEach(propName => {\n const propValue = props[propName];\n\n if (propName === 'children') {\n if (typeof propValue === 'string' || typeof propValue === 'number') {\n element.appendChild(new SSRTreeNode(RAW_TEXT_TYPE, propValue));\n }\n } else if (propName === 'className') {\n element.setAttribute('class', propValue);\n } else if (!isEventListener(propName)) {\n element.setAttribute(propName, propValue);\n }\n });\n return false;\n }", "title": "" }, { "docid": "3b2853470696b81eb3d2a43e3726ac2e", "score": "0.5148197", "text": "finalizeInitialChildren(element, type, props) {\n Object.keys(props).forEach(propName => {\n const propValue = props[propName];\n\n if (propName === 'children') {\n if (\n typeof propValue === 'string' ||\n typeof propValue === 'number'\n ) {\n element.appendChild(\n new SSRTreeNode(RAW_TEXT_TYPE, propValue)\n );\n }\n } else if (propName === 'className') {\n element.setAttribute('class', propValue);\n } else if (propName === 'style') {\n element.setAttribute(\n propName,\n createMarkupForStyles(propValue)\n );\n } else if (!isEventListener(propName)) {\n element.setAttribute(propName, propValue);\n }\n });\n return false;\n }", "title": "" }, { "docid": "f7ff731d20ff7c5bf87b39db5b4c7679", "score": "0.5147176", "text": "function build_template(container){\n var $child_scope = $scope.$new();\n $child_scope.$digger = container;\n linker($child_scope, function(clone_of_template){\n elems.push(clone_of_template);\n parent.append(clone_of_template);\n })\n }", "title": "" }, { "docid": "8abc3a2e8d1e0a68df8171a5dfeec868", "score": "0.51471525", "text": "$_generateDomTree(node) {\n const {\n type,\n tagName = '',\n attrs = [],\n children = [],\n content = '',\n } = node;\n\n // generated at runtime, using the b- prefix\n const nodeId = `b-${tool.getId()}`;\n\n if (type === 'element') {\n // Element\n const attrsMap = {};\n\n // The property list is converted to a map\n for (const attr of attrs) {\n const name = attr.name;\n let value = attr.value;\n\n if (name === 'style') value = value && value.replace('\"', '\\'') || '';\n\n attrsMap[name] = value;\n }\n\n const element = this.ownerDocument.$$createElement({\n tagName, attrs: attrsMap, nodeId\n });\n\n for (let child of children) {\n child = this.$_generateDomTree(child);\n\n if (child) element.appendChild(child);\n }\n\n return element;\n } else if (type === 'text') {\n // Text node\n return this.ownerDocument.$$createTextNode({\n content: tool.decodeContent(content), nodeId\n });\n }\n }", "title": "" }, { "docid": "6f1194953ee37683d4cea047838d5b87", "score": "0.5142003", "text": "addChild(value, key = null) {\n let node = null;\n if (value instanceof TreeNode) {\n value._parent = this;\n node = value;\n }\n else {\n node = new TreeNode(value, key, this);\n }\n this._children.push(node);\n }", "title": "" }, { "docid": "556d7fde11da91f4b01eb926a529b1dd", "score": "0.51398414", "text": "function lib_data_disco_create_tree_item( iparams ) // iparams = {parent_elem_id, name, type, lock_id, cb_fctn_str}\r\n{\r\n var iparams_cp = jQuery.extend(true, {}, iparams); \r\n \r\n var myContent = new Disco.Ontology.Content(); \r\n var newId = undefined;\r\n myContent.Text = \"\";\r\n myContent.Title = iparams_cp.name;\r\n myContent.CultureId = \"2\";\r\n this.context.Content.add(myContent); \r\n this.context.saveChanges().then\r\n (\r\n function(response)\r\n {\r\n var myPost = new Disco.Ontology.Post();\r\n myPost.PostTypeId = ontology_xtm2disco_post(iparams_cp.type);\r\n myPost.ContentId = myContent.Id;\r\n this.context.Posts.add(myPost); \r\n this.context.saveChanges().then\r\n (\r\n function(response)\r\n { \r\n var myPostRef = new Disco.Ontology.PostReference();\r\n myPostRef.ReferrerId = myPost.Id;\r\n myPostRef.ReferreeId = iparams_cp.parent_elem_id;\r\n myPostRef.ReferenceTypeId = ontology_xtm2disco_postref(iparams_cp.type);\r\n this.context.PostReferences.add(myPostRef); \r\n this.context.saveChanges().then\r\n (\r\n function(response)\r\n {\r\n // reload Tree\r\n this.req_tree({elemId:[iparams_cp.parent_elem_id], lock_id:iparams_cp.lock_id, favIds:[], tickerIds:[], cb_fct_call:iparams_cp.cb_fctn_str, mode:\"tree_only\"});\r\n }.bind(this)\r\n ).catch\r\n (\r\n function(response) \r\n { \r\n alert(\"Create PostRef failed !\"); \r\n }.bind(this) \r\n ); \r\n }.bind(this)\r\n ).catch\r\n (\r\n function(response) \r\n { \r\n alert(\"Create Post failed !\"); \r\n }.bind(this) \r\n ); \r\n \r\n }.bind(this)\r\n ).catch\r\n (\r\n function(response) \r\n { \r\n alert(\"Create Content failed !\"); \r\n }.bind(this) \r\n );\r\n}", "title": "" }, { "docid": "776cbec141ed9f9ea15e04297ff51266", "score": "0.5139438", "text": "createElement(type, props, children){\n const element = {\n type,\n props: props || {}\n }\n\n if(children){\n element.props.children = children;\n }\n\n return element;\n }", "title": "" }, { "docid": "ac185f9a445faf32245dc7ec8bf55d32", "score": "0.51361716", "text": "function applyTemplateInfo(inst, node, nodeInfo, parentTemplateInfo) {\n if (nodeInfo.templateInfo) {\n // Give the node an instance of this templateInfo and set its parent\n node._templateInfo = nodeInfo.templateInfo;\n node._parentTemplateInfo = parentTemplateInfo;\n }\n}", "title": "" }, { "docid": "ac185f9a445faf32245dc7ec8bf55d32", "score": "0.51361716", "text": "function applyTemplateInfo(inst, node, nodeInfo, parentTemplateInfo) {\n if (nodeInfo.templateInfo) {\n // Give the node an instance of this templateInfo and set its parent\n node._templateInfo = nodeInfo.templateInfo;\n node._parentTemplateInfo = parentTemplateInfo;\n }\n}", "title": "" }, { "docid": "3b1ea4eb46ceac25f03e9f48bdf1cea4", "score": "0.5135737", "text": "add(data) {\n\t\tthis.children.push(new Node(data));\n\t}", "title": "" }, { "docid": "7c63019aa0f55f944a5a4c4f1012698c", "score": "0.51345783", "text": "onAddNode (parent) {\n const graph = this.graph()\n\n // Create new node\n const id = randomId()\n\n const storyNode = this.addStoryNode(id, parent.data)\n const parentStoryNode = parent.data\n\n graph.addNode({\n id,\n data: storyNode\n }, parent)\n\n const node = graph.getNode(id)\n\n\n // Calculate position\n const insertAbove = parent.children.length % 2 != 0\n\n const xRange = parent.children.reduce((range, c) =>\n [Math.min(range[0], graph.getNode(c).x), Math.max(range[1], graph.getNode(c).x)]\n , [parent.x, parent.x])\n\n node.y = parent.y + 300,\n node.x = parent.children.length == 0\n ? parent.x\n : insertAbove\n ? xRange[0] - 175\n : xRange[1] + 175\n\n // Update graph\n this.setState({graph})\n console.log('Added new node')\n\n this.saveStory()\n }", "title": "" }, { "docid": "685fa78756f1a4e197c5f26373c93add", "score": "0.5121556", "text": "function createNode(el, attr) {\n\t\t\t\t// html comment is not currently supported by virtual-dom\n\t\t\t\tif (el.nodeType === 3) {\n\t\t\t\t\treturn createVirtualTextNode(el);\n\n\t\t\t\t\t// cdata or doctype is not currently supported by virtual-dom\n\t\t\t\t} else if (el.nodeType === 1 || el.nodeType === 9) {\n\t\t\t\t\treturn createVirtualDomNode(el, attr);\n\t\t\t\t}\n\n\t\t\t\t// default to empty text node\n\t\t\t\treturn new VText('');\n\t\t\t}", "title": "" }, { "docid": "685fa78756f1a4e197c5f26373c93add", "score": "0.5121556", "text": "function createNode(el, attr) {\n\t\t\t\t// html comment is not currently supported by virtual-dom\n\t\t\t\tif (el.nodeType === 3) {\n\t\t\t\t\treturn createVirtualTextNode(el);\n\n\t\t\t\t\t// cdata or doctype is not currently supported by virtual-dom\n\t\t\t\t} else if (el.nodeType === 1 || el.nodeType === 9) {\n\t\t\t\t\treturn createVirtualDomNode(el, attr);\n\t\t\t\t}\n\n\t\t\t\t// default to empty text node\n\t\t\t\treturn new VText('');\n\t\t\t}", "title": "" }, { "docid": "a31be73aefc21db55a4ffc85e30e42d8", "score": "0.51139426", "text": "function valueAsNode(childType, parent, subpath, newValue, oldNode) {\n // ensure the value is valid-ish\n typecheck$$1(childType, newValue);\n // the new value has a MST node\n if (isStateTreeNode$$1(newValue)) {\n var childNode_1 = getStateTreeNode$$1(newValue);\n childNode_1.assertAlive();\n // the node lives here\n if (childNode_1.parent !== null && childNode_1.parent === parent) {\n childNode_1.setParent(parent, subpath);\n if (oldNode && oldNode !== childNode_1)\n oldNode.die();\n return childNode_1;\n }\n }\n // there is old node and new one is a value/snapshot\n if (oldNode) {\n var childNode_2 = childType.reconcile(oldNode, newValue);\n childNode_2.setParent(parent, subpath);\n return childNode_2;\n }\n // nothing to do, create from scratch\n var childNode = childType.instantiate(parent, subpath, parent._environment, newValue);\n return childNode;\n}", "title": "" }, { "docid": "4494fe84c6abd0b19d62062803e28687", "score": "0.51128805", "text": "function create(library, node) {\n let type = node.type;\n let tag = library.getTag(type);\n let ctx = Object.create(library.getCtx());\n ctx.props = prepareProps(node.props);\n ctx.children = node.children;\n ctx.state = {};\n ctx.domNode = null;\n ctx.template = data => library.renderTemplate(type, data);\n if (tag.init) {\n tag.init(ctx);\n }\n return Tools.instance({\n type,\n tag,\n ctx,\n childWrap: library.createWrap(tag.render(ctx))\n }, {\n renderToString,\n renderToDom,\n mount,\n update,\n unmount\n });\n}", "title": "" }, { "docid": "ac4d8e040d33f23c1148d4b0127cfffe", "score": "0.51091444", "text": "function valueAsNode(childType, parent, subpath, newValue, oldNode) {\n // ensure the value is valid-ish\n typecheckInternal$$1(childType, newValue);\n // the new value has a MST node\n if (isStateTreeNode$$1(newValue)) {\n var childNode = getStateTreeNode$$1(newValue);\n childNode.assertAlive();\n // the node lives here\n if (childNode.parent !== null && childNode.parent === parent) {\n childNode.setParent(parent, subpath);\n if (oldNode && oldNode !== childNode)\n oldNode.die();\n return childNode;\n }\n }\n // there is old node and new one is a value/snapshot\n if (oldNode) {\n var childNode = childType.reconcile(oldNode, newValue);\n childNode.setParent(parent, subpath);\n return childNode;\n }\n // nothing to do, create from scratch\n return childType.instantiate(parent, subpath, parent.environment, newValue);\n}", "title": "" }, { "docid": "f356cca11bb42a0edf10ab75fed805e7", "score": "0.51070356", "text": "function lib_data_disco_create_tree_item_field(itemId, fieldId, content)\r\n{\r\n}", "title": "" } ]
7496fd7daaf4acdbd88f39729202dc74
checks for a vertical win in a single layer based on the latest move
[ { "docid": "8d6056c089847c0a0f7656cb8f086c3e", "score": "0.7748336", "text": "function checkWinVertical(move) {\n\tfor (i=1;i<5;i++) {\n\t\tid = ''+move.layer+i+move.col;\n\t\tif (document.getElementById(id).style.backgroundColor !== move.maker) {\n\t\t\treturn null;\n\t\t}\n\t}\n\treturn move;\n}", "title": "" } ]
[ { "docid": "13385755c445fdbf97949251ce2f653a", "score": "0.7674919", "text": "function checkWinInLayer() {\n\t//get latest move\n\tmove = moves[moves.length-1];\n\n\t//check all wins\n\tif (!checkWinVertical(move)) {\n\t\tif (!checkWinHorizontal(move)) {\n\t\t\tif (!checkWinDiagonal(move)) {\n\t\t\t\treturn null;\n\t\t\t} else {\n\t\t\t\treturn move;\n\t\t\t}\n\t\t} else {\n\t\t\treturn move;\n\t\t}\n\t} else {\n\t\treturn move;\n\t}\n}", "title": "" }, { "docid": "a7cd7f832490629047c630ef36e70e48", "score": "0.7645552", "text": "function checkWinVerticalInAllLayers(move) {\n\tfor (i=1;i<5;i++) {\n\t\tid = ''+i+move.row+move.col;\n\t\tif (document.getElementById(id).style.backgroundColor !== move.maker) {\n\t\t\treturn null;\n\t\t}\n\t}\n\treturn move;\n}", "title": "" }, { "docid": "1f31e69f0e367a1177b7aa6edc34ee1c", "score": "0.75217193", "text": "function verticalWin() {\n \n if(\n (board[0][0] === playerTurn && board[1][0]=== playerTurn && board[2][0] === playerTurn) ||\n (board[0][1] === playerTurn && board[1][1]=== playerTurn && board[2][1] === playerTurn) ||\n (board[0][2] === playerTurn && board[1][2]=== playerTurn && board[2][2] === playerTurn)){\n return true\n }\n }", "title": "" }, { "docid": "29ebcff991e735381ad843acfabb9404", "score": "0.7345449", "text": "function verticalWin () {\n return ($('[data-cell=\"0\"]').text() === playerTurn && $('[data-cell=\"3\"]').text() === playerTurn && $('[data-cell=\"6\"]').text() === playerTurn)||\n ($('[data-cell=\"1\"]').text() === playerTurn && $('[data-cell=\"4\"]').text() === playerTurn && $('[data-cell=\"7\"]').text() === playerTurn)||\n ($('[data-cell=\"2\"]').text() === playerTurn && $('[data-cell=\"5\"]').text() === playerTurn && $('[data-cell=\"8\"]').text() === playerTurn);\n }", "title": "" }, { "docid": "de60b405327fd247c6f701dd3b8ce257", "score": "0.72795576", "text": "verticalWinner() {\n let won = 1;\n for(let row = 0; row < this.ht - 3; row++) {\n for(let col = 0; col < this.wd; col++) {\n let disc = this.state.squares[col][row];\n if(disc !== null) {\n if(this.state.squares[col][row + 1] === disc\n && this.state.squares[col][row + 2] === disc\n && this.state.squares[col][row + 3] === disc) {\n return won;\n }\n }\n }\n }\n return !won;\n }", "title": "" }, { "docid": "bf7cc213fcb743fed5072850a3bde05c", "score": "0.70330995", "text": "function verticalWinCheck() {\n for (var col = 0; col < 7; col++) {\n for (var row = 0; row < 3; row++) {\n if (\n colorMatchCheck(\n returnColor(row, col),\n returnColor(row + 1, col),\n returnColor(row + 2, col),\n returnColor(row + 3, col)\n )\n ) {\n console.log(\"vertical\");\n return true;\n } else {\n continue;\n }\n }\n }\n}", "title": "" }, { "docid": "fc898cc290149e5a79163ba7d9c8f94a", "score": "0.69757366", "text": "function verticalWinCheck() {\r\n for (var col = 0; col < 7; col++) {\r\n for (var row = 0; row < 3; row++) {\r\n if (colorMatchCheck(returnColor(row,col), returnColor(row+1,col) ,returnColor(row+2,col), returnColor(row+3,col))) {\r\n console.log('vertical');\r\n return true;\r\n }else {\r\n continue;\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "58628ace3095f91549900f50e6d35e0e", "score": "0.69440037", "text": "function verticalWinCheck(){\n for (var col = 0; col < 7; col++){\n for (var row = 0; row < 3; row++){\n if (colorMatchCheck(reportColor(row,col), reportColor(row+1, col), reportColor(row+2,col), reportColor(row+3,col))){\n console.log('horiz');\n reportWin(row,col);\n return true;\n }else{\n continue;\n }\n }\n }\n}", "title": "" }, { "docid": "3d90b7cbbc7c440f43705e9ca3ca08c4", "score": "0.6917483", "text": "function checkVerticale(){\n\t\t\treturn checkWin({i : -1, j: 0}, {i : 1, j: 0});\n\t\t}", "title": "" }, { "docid": "1813b58645759760300e5c6d06a876d3", "score": "0.69069624", "text": "vertical (board) {\n for (let r = 3; r < 6; r++) {\n for (let c = 0; c < 7; c++) {\n if (board[r][c]) { // not null\n if (board[r][c] === board[r - 1][c] && board[r][c] === board[r - 2][c] && board[r][c] === board[r - 3][c]) {\n return board[r][c]; // this will return which player wins \n }\n }\n }\n }\n }", "title": "" }, { "docid": "95c491c2131c57fb08fbd4db2e403ac1", "score": "0.6892525", "text": "function checkWinVerticalDiagonalInAllLayers(move) {\n\t// this can be a forward diagonal or a backward diagonal\n\n\t// forward diagonal\n\tif (move.layer === move.row) {\n\t\tfor (i=1;i<5;i++) {\n\t\t\tid = ''+i+i+move.col;\n\t\t\tif (document.getElementById(id).style.backgroundColor !== move.maker) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\treturn move;\n\t} else if (move.layer == 5-move.row) {\n\t\t// backward diagonal\n\t\tfor (i=1;i<5;i++) {\n\t\t\tid = ''+i+(5-i)+move.col;\n\t\t\tif (document.getElementById(id).style.backgroundColor !== move.maker) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\treturn move;\n\t} else {\n\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "28d69d8b265616bf6e7aa813e4ce13dc", "score": "0.68779224", "text": "function verticalWinCheck() {\n for (var col = 0; col < 7; col++) {\n for (var row = 0; row < 3; row++) {\n if (colorMatchCheck(checkColor(row,col), checkColor(row+1,col) ,checkColor(row+2,col), checkColor(row+3,col))) {\n console.log('Vertical match!');\n reportWin(row,col);\n return true;\n }else {\n continue;\n }\n }\n }\n}", "title": "" }, { "docid": "55f35745d2beb7cd339aace438e01e62", "score": "0.6853163", "text": "function checkWinInAllLayers() {\n\t//get latest move\n\tmove = moves[moves.length-1];\n\n\t//check all wins\n\tif (!checkWinVerticalInAllLayers(move)) {\n\t\tif (!checkWinVerticalDiagonalInAllLayers(move)) {\n\t\t\tif (!checkWinHorizontalDiagonalInAllLayers(move)) {\n\t\t\t\tif(!checkWinDiagonallyDiagonalInAllLayers(move)) {\n\t\t\t\t\treturn null;\n\t\t\t\t} else {\n\t\t\t\t\treturn move;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn move;\n\t\t\t}\n\t\t} else {\n\t\t\treturn move;\n\t\t}\n\t} else {\n\t\treturn move;\n\t}\n}", "title": "" }, { "docid": "e7c1a5b25e6bfdc4e01cdc8a0681d47b", "score": "0.68508047", "text": "function horizantalWinCheck(){\n for (var row = 0; row < 6; row++){\n for (var col = 0; col < 4; col++){\n if (colorMatchCheck(reportColor(row,col), reportColor(row, col+1), reportColor(row,col+2), reportColor(row,col+3))){\n console.log('vertical');\n reportWin(row,col);\n return true;\n }else{\n continue;\n }\n }\n }\n}", "title": "" }, { "docid": "70ea52b69e9d89360d7e5595c09352c2", "score": "0.68430096", "text": "function verticalWinCheck() {\r\n for (var col = 0; col < 7; col++) {\r\n for (var row = 0; row < 3; row++) {\r\n if (colorMatchCheck(returnColor(row,col), returnColor(row+1,col) ,returnColor(row+2,col), returnColor(row+3,col))) {\r\n console.log('vert');\r\n return true;\r\n }else {\r\n continue;\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "0777d505f9ffc4415ea0193059eddcd8", "score": "0.6787408", "text": "isWinningMove(col) {\n return this.winning_position() & this.possible() & this.column_mask(col);\n }", "title": "" }, { "docid": "d1bd8a0cfe1f5d37d0df48d43c06fc1b", "score": "0.6681815", "text": "function compCheckBottom(xCor, yCor, winOn) {\n var retVal = false;\n if (xCor < boardsize && yCor < boardsize && yCor + (winOn - 1) < boardsize) {\n // Declaration and initialization of arrray\n var winning = new Array();\n for (var i = 0; i < winOn; i++) {\n winning[i] = i;\n }\n for (var k = 0; k < winOn; k++) {\n winning[k] = gameMatrix[xCor][yCor + k];\n }\n retVal = true;\n for (var i = 1; i < winOn; i++) {\n // if (winOn == 1 && winning[i] == playerWM) {\n // retVal = true;\n // return retVal;\n // }\n if (winning[i] == '-1') {\n retVal = false;\n return retVal;\n }\n else {\n if (winning[i] != winning[(i - 1)]) {\n retVal = false;\n }\n }\n }\n \n }\n return retVal;\n}", "title": "" }, { "docid": "81bbb9f4686ab0a275ea9a9ec8959ce4", "score": "0.6620244", "text": "function checkVerticalWinPrevented(board, opponent){\n\n // For every column of the board\n for(let i = 0; i < cols; i++){\n\n let c = board.columns[i];\n\n // If there are +3 pods in the column (AKA a win is prevenable)\n if(c.pods.length > 3){\n\n // Check every 4 n=consecutive pods\n for(let j = 0; j < c.pods.length - 4; j++){\n\n // If the first 3 are opponent - type pods\n if( equals4(c.pods[j].player, c.pods[j + 1].player,\n c.pods[j + 2].player, opponent) ){\n \n // And if the fourth is a current player- type pod\n if(c.pods[j + 3].player != opponent){\n return true;\n\n } // last pod if end\n\n } // three consecutive pods if end\n\n } // four consecutive pods loop end\n\n } // pods length > 3 if end\n\n } // every column loop end\n\n return false;\n }", "title": "" }, { "docid": "b98534860ddf70f873bec3bf26fb9179", "score": "0.6580439", "text": "function checkVert() {\n\tvar sym = getCur();\n\tfor (var i = 0; i < board.length - 3; i++) {\n\t\tfor (var j = 0; j < board.length; j++) {\n\t\t\tif ( (board[i][j] == board[i+1][j]) &&\n\t\t\t\t (board[i][j] == board[i+2][j]) &&\n\t\t\t\t (board[i][j] == board[i+3][j]) &&\n\t\t\t\t (board[i][j] == sym))\n\t\t\t\t\t{ showWinner(); playVid(); return true }\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "c2de5ae4f7636154a4ae8b6c31fc126b", "score": "0.6496465", "text": "function resolveTopCollision(row, column) {//row and column tile is in grid\n if (player.y_cordinate > player.old_y_cordinate) {//for top-collision player should be moving down\n let y_value_of_tile_top = row * Drawing.size_of_tile;\n if (player.y_cordinate + player.height > y_value_of_tile_top && player.old_y_cordinate + player.height <= y_value_of_tile_top) {\n player.speed_y = 0;\n player.in_air = false;\n player.old_y_cordinate = player.y_cordinate = y_value_of_tile_top - player.height - 0.01;\n return true;\n }\n\n }\n return false;\n}", "title": "" }, { "docid": "65c15f675c2d44bc1260b08288f03de8", "score": "0.6455946", "text": "isOpponentWinningMove(col) {\n return this.opponent_winning_position() & this.possible() & this.column_mask(col);\n }", "title": "" }, { "docid": "b6687062c19d591e2b32e05219baa072", "score": "0.64332587", "text": "win() {\n for (let i = 0; i < this.state.tileArray.length; i++) {\n if (JSON.stringify(this.state.tileArray[i].currentPos) === JSON.stringify(this.state.tileArray[i].winPos)) { // Used stringify cause it took more code to set 2 nested arrays === to eachother a normal way\n if (i === 15) return true\n } else return false;\n }\n }", "title": "" }, { "docid": "33269c371804d2d7290872363e5c88f1", "score": "0.6422182", "text": "checkWin(target) {\n const owner = target.owner;\n let win = false;\n\n // vertical wins\n for (let x = 0; x < this.board.columns - 2; x++) {\n for (let y = 0; y < this.board.rows; y++) {\n if (\n this.board.squares[x][y].owner === owner &&\n this.board.squares[x + 1][y].owner === owner &&\n this.board.squares[x + 2][y].owner === owner\n ) {\n win = true;\n return win;\n }\n }\n }\n\n // horizontal wins\n for (let x = 0; x < this.board.columns; x++) {\n for (let y = 0; y < this.board.rows - 2; y++) {\n if (\n this.board.squares[x][y].owner === owner &&\n this.board.squares[x][y + 1].owner === owner &&\n this.board.squares[x][y + 2].owner === owner\n ) {\n win = true;\n return win;\n }\n }\n }\n\n //diagonal wins\n if (\n this.board.squares[0][0].owner === owner &&\n this.board.squares[1][1].owner === owner &&\n this.board.squares[2][2].owner === owner\n ) {\n win = true;\n return win;\n }\n if (\n this.board.squares[0][2].owner === owner &&\n this.board.squares[1][1].owner === owner &&\n this.board.squares[2][0].owner === owner\n ) {\n win = true;\n return win;\n }\n return win;\n }", "title": "" }, { "docid": "d6305762f7da56af873a3b683be62ed6", "score": "0.6400647", "text": "checkForWin(target){\n const owner = target.token.owner;\n let win = false;\n\n // vertical\n for (let x = 0; x < this.board.columns; x++ ){\n for (let y = 0; y < this.board.rows - 3; y++){\n if (this.board.spaces[x][y].owner === owner && \n this.board.spaces[x][y+1].owner === owner && \n this.board.spaces[x][y+2].owner === owner && \n this.board.spaces[x][y+3].owner === owner) {\n win = true;\n } \n }\n }\n\n // horizontal\n for (let x = 0; x < this.board.columns - 3; x++ ){\n for (let y = 0; y < this.board.rows; y++){\n if (this.board.spaces[x][y].owner === owner && \n this.board.spaces[x+1][y].owner === owner && \n this.board.spaces[x+2][y].owner === owner && \n this.board.spaces[x+3][y].owner === owner) {\n win = true;\n } \n }\n }\n \n // diagonal\n for (let x = 3; x < this.board.columns; x++ ){\n for (let y = 0; y < this.board.rows - 3; y++){\n if (this.board.spaces[x][y].owner === owner && \n this.board.spaces[x-1][y+1].owner === owner && \n this.board.spaces[x-2][y+2].owner === owner && \n this.board.spaces[x-3][y+3].owner === owner) {\n win = true;\n } \n }\n }\n\n // diagonal\n for (let x = 3; x < this.board.columns; x++ ){\n for (let y = 3; y < this.board.rows; y++){\n if (this.board.spaces[x][y].owner === owner && \n this.board.spaces[x-1][y-1].owner === owner && \n this.board.spaces[x-2][y-2].owner === owner && \n this.board.spaces[x-3][y-3].owner === owner) {\n win = true;\n } \n }\n }\n\n return win;\n }", "title": "" }, { "docid": "fbdf8fe3a0f68e20063109348cc5c1bc", "score": "0.63981366", "text": "function winCheck(oOrX, whoseVictory) {\n \n //across, down, zigzag from top left\n if (grid[0][0] === oOrX && grid[0][0] === grid[0][1] && grid[0][0] === grid[0][2]) {\n victoryScreen = whoseVictory;\n }\n else if (grid[0][0] === oOrX && grid[0][0] === grid[1][1] && grid[0][0] === grid[2][2]) {\n victoryScreen = whoseVictory;\n }\n else if (grid[0][0] === oOrX && grid[0][0] === grid[1][0] && grid[0][0] === grid[2][0]) {\n victoryScreen = whoseVictory;\n }\n \n //across horizontal middle\n else if (grid[1][0] === oOrX && grid[1][0] === grid[1][1] && grid[1][0] === grid[1][2]) { \n victoryScreen = whoseVictory;\n }\n \n //down vertical middle\n else if (grid[0][1] === oOrX && grid[0][1] === grid[1][1] && grid[0][1] === grid[2][1]) {\n victoryScreen = whoseVictory;\n }\n \n //down vertical right\n else if (grid[0][2] === oOrX && grid[0][2] === grid[1][2] && grid[0][2] === grid[2][2]) {\n victoryScreen = whoseVictory;\n }\n \n //across, zigzag from bottom left\n else if (grid[2][0] === oOrX && grid[2][0] === grid[2][1] && grid[2][0] === grid[2][2]) {\n victoryScreen = whoseVictory;\n }\n else if (grid[2][0] === oOrX && grid[2][0] === grid[1][1] && grid[2][0] === grid[0][2]) {\n victoryScreen = whoseVictory;\n }\n\n //no one wins\n else if (noBlanks()) {\n victoryScreen = \"draw\";\n }\n\n //helps determine if player should get points when setup is called\n if (oOrX === 2 && victoryScreen === \"main player win\") {\n previousVictory = \"player\";\n }\n else if (oOrX === 1 && victoryScreen === \"other player win\") {\n previousVictory = \"other\";\n }\n\n}", "title": "" }, { "docid": "6d9ef023a0f2b61205acacfc74f46f3f", "score": "0.63833827", "text": "function checkWin(yMove, xMove) {\n const total = 1 +\n checkDirection(yMove) +\n checkDirection(xMove);\n if (total >= 4) {\n return true;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "2fb45a1312bd705a3d5069770933992f", "score": "0.6381998", "text": "checkForWin(positionX, positionY, optionalState) {\n let { incrementWin } = this.props;\n let squares = optionalState ? optionalState : this.state.squares;\n let winHorizontally0 = (squares[0][0] !== null) && squares[0][0] === squares[0][1] && squares[0][1] === squares[0][2];\n let winHorizontally1 = (squares[1][0] !== null) && squares[1][0] === squares[1][1] && squares[1][1] === squares[1][2];\n let winHorizontally2 = (squares[2][0] !== null) && squares[2][0] === squares[2][1] && squares[2][1] === squares[2][2];\n\n let winVertically0 = (squares[0][0] !== null) && squares[0][0] === squares[1][0] && squares[1][0] === squares[2][0];\n let winVertically1 = (squares[0][1] !== null) && squares[0][1] === squares[1][1] && squares[1][1] === squares[2][1];\n let winVertically2 = (squares[0][2] !== null) && squares[0][2] === squares[1][2] && squares[1][2] === squares[2][2];\n\n let winDiagonally0 = (squares[0][0] !== null) && squares[0][0] === squares[1][1] && squares[1][1] === squares[2][2];\n let winDiagonally1 = (squares[0][2] !== null) && squares[0][2] === squares[1][1] && squares[1][1] === squares[2][0];\n \n const horizontalWin = winHorizontally1 || winHorizontally2 || winHorizontally0;\n const verticalWin = winVertically1 || winVertically2 || winVertically0;\n const diagonalWin = winDiagonally0 || winDiagonally1;\n\n if (horizontalWin || verticalWin || diagonalWin) {\n let winner = squares[positionX][positionY];\n alert(`${winner}'s won!`);\n optionalState ? null : incrementWin(winner);\n this.props.fetch.delete('/api/game').then(() => {\n this.setState({\n squares: Array(3).fill([null, null, null]),\n numberOfTurns: 0\n });\n })\n return true;\n } else if (!horizontalWin && !verticalWin && !diagonalWin && this.state.numberOfTurns === 9) {\n alert(`It's a tie!`);\n incrementWin('Draw');\n this.props.fetch.delete('/api/game').then(() => {\n this.setState({\n squares: Array(3).fill([null, null, null]),\n numberOfTurns: 0\n });\n })\n return false;\n }\n }", "title": "" }, { "docid": "e7094a3281e6ebf439b6064b6da4b36a", "score": "0.6359414", "text": "checkForWin(target){\n const owner = target.token.owner;\n let win = false;\n\n // vertical\n for (let x = 0; x < this.board.columns; x++ ){\n for (let y = 0; y < this.board.rows - 3; y++){\n if (this.board.spaces[x][y].owner === owner &&\n this.board.spaces[x][y+1].owner === owner &&\n this.board.spaces[x][y+2].owner === owner &&\n this.board.spaces[x][y+3].owner === owner) {\n win = true;\n }\n }\n }\n\n // horizontal\n for (let x = 0; x < this.board.columns - 3; x++ ){\n for (let y = 0; y < this.board.rows; y++){\n if (this.board.spaces[x][y].owner === owner &&\n this.board.spaces[x+1][y].owner === owner &&\n this.board.spaces[x+2][y].owner === owner &&\n this.board.spaces[x+3][y].owner === owner) {\n win = true;\n }\n }\n }\n\n // diagonal1\n for (let x = 3; x < this.board.columns; x++ ){\n for (let y = 0; y < this.board.rows - 3; y++){\n if (this.board.spaces[x][y].owner === owner &&\n this.board.spaces[x-1][y+1].owner === owner &&\n this.board.spaces[x-2][y+2].owner === owner &&\n this.board.spaces[x-3][y+3].owner === owner) {\n win = true;\n }\n }\n }\n\n // diagonal2\n for (let x = 3; x < this.board.columns; x++ ){\n for (let y = 3; y < this.board.rows; y++){\n if (this.board.spaces[x][y].owner === owner &&\n this.board.spaces[x-1][y-1].owner === owner &&\n this.board.spaces[x-2][y-2].owner === owner &&\n this.board.spaces[x-3][y-3].owner === owner) {\n win = true;\n }\n }\n }\n\n return win;\n }", "title": "" }, { "docid": "4d55e1528860167ab6d65f78c75387b7", "score": "0.63504905", "text": "function checkForWinner(row, column){\n let lastPlayer = gameState[row][column]\n let win = false;\n\n let count = 0\n // count horizontal\n if (column - 1 >= 0 && (gameState[row][column - 1 ] === lastPlayer)) {}//do it again\n // win = win || count > 3 ?\n // console.log(row, column)\n\n // count horizontally\n // to left\n for(let i = column - 1; i >= 0; i--) {\n\n if (gameState[row][i] === lastPlayer) {\n count++\n } else {break}\n\n }\n //to right\n for(let i = column + 1; i < gameState[row].length; i++) {\n\n // count diagonal\n if (gameState[row][i] === lastPlayer) {\n count++\n } else {break}\n\n }\n\n if (count >= 3) {\n return true\n }\n\n // count vertical\n count = 0;\n\n //checking vertically\n //checking above\n for(let i = row - 1; i >= 0; i--) {\n if (gameState[i][column] === lastPlayer) {\n count++\n } else {break}\n\n }\n //below\n for(let i = row + 1; i < gameState.length; i++) {\n\n if (gameState[i][column] === lastPlayer) {\n count++\n } else {break}\n\n }\n\n if (count >= 3) {\n return true\n }\n\n count = 0;\n\n //check diagonal\n //upper left \n for(let i = 1; Math.min(row,column) - i >= 0; i++) {\n if (gameState[row - i][column - i] === lastPlayer) {\n count++\n } else {break}\n\n }\n //lower right\n for(let i = 1; (row + i < gameState.length) && (column + i < gameState[0].length); i++) {\n if (gameState[row + i][column + i] === lastPlayer) {\n count++\n } else {break}\n\n }\n\n if (count >= 3) {\n return true\n }\n\n count = 0\n\n //upper right\n for(let i = 1; (row - i >= 0) && (column + i < gameState[0].length); i++) {\n if (gameState[row - i][column + i] === lastPlayer) {\n count++\n } else {break}\n\n }\n //lower left\n for(let i = 1; (row + i < gameState.length) && (column - i >= 0); i++) {\n if (gameState[row + i][column - i] === lastPlayer) {\n count++\n } else {break}\n\n }\n\n if (count >= 3) {\n return true\n }\n\n // count counter-diagonal\n\n if (win) alert(\"winner\")\n}", "title": "" }, { "docid": "972504e22eee6a753d9f562f894074b7", "score": "0.6335223", "text": "colWin() {\n for (var i = 0; i < this.grid.length; i++) {\n let colArray = [];\n for (var j = 0; j < this.grid.length; j++) {\n colArray.push(this.grid[i][j]);\n }\n if (colArray.every( el => el === colArray[i])) {\n this.winningSymble = colArray[i];\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "f30d56e234b425bb1042e4decee65a91", "score": "0.6329431", "text": "function checkWinHorizontal(move) {\n\tfor (j=1;j<5;j++) {\n\t\tid = ''+move.layer+move.row+j;\n\t\tif (document.getElementById(id).style.backgroundColor !== move.maker) {\n\t\t\treturn null;\n\t\t}\n\t}\n\treturn move;\n}", "title": "" }, { "docid": "5133bf081ac17897fcb6a24883bcd6a0", "score": "0.63289195", "text": "function backwardCheck(rover) {\n switch(rover.direction) {\n case \"N\":\n if (marsGrid[rover.y+1][rover.x] === null && rover.y < 9) return true\n else {\n console.log(`${rover.name} has encountered an obstacle at [${rover.x}, ${rover.y+1}]`)\n return false;\n }\n case \"E\":\n if (marsGrid[rover.y][rover.x-1] === null && rover.x > 0) return true\n else {\n console.log(`${rover.name} has encountered an obstacle at [${rover.x-1}, ${rover.y}]`)\n return false;\n }\n case \"S\":\n if (marsGrid[rover.y-1][rover.x] === null && rover.y > 0) return true\n else {\n console.log(`${rover.name} has encountered an obstacle at [${rover.x}, ${rover.y-1}]`)\n return false;\n }\n case \"W\":\n if (marsGrid[rover.y][rover.x+1] === null && rover.x < 9) return true\n else {\n console.log(`${rover.name} has encountered an obstacle at [${rover.x+1}, ${rover.y}]`)\n return false;\n }\n }\n}", "title": "" }, { "docid": "231f09f214ccc4266c6d771d3ec749d4", "score": "0.6321774", "text": "function checkForBoardWin(outerX, outerY, player)\r\n{\r\n //Check for win\r\n //Down left column\r\n if(selected[outerX][outerY][0][0] == player && selected[outerX][outerY][0][1] == player && selected[outerX][outerY][0][2] == player)\r\n return player;\r\n //Down middle column\r\n if(selected[outerX][outerY][1][0] == player && selected[outerX][outerY][1][1] == player && selected[outerX][outerY][1][2] == player)\r\n return player;\r\n //Down right column\r\n if(selected[outerX][outerY][2][0] == player && selected[outerX][outerY][2][1] == player && selected[outerX][outerY][2][2] == player)\r\n return player;\r\n //Across top row\r\n if(selected[outerX][outerY][0][0] == player && selected[outerX][outerY][1][0] == player && selected[outerX][outerY][2][0] == player)\r\n return player; \r\n //Across middle row\r\n if(selected[outerX][outerY][0][1] == player && selected[outerX][outerY][1][1] == player && selected[outerX][outerY][2][1] == player)\r\n return player;\r\n //Across bottom row\r\n if(selected[outerX][outerY][0][2] == player && selected[outerX][outerY][1][2] == player && selected[outerX][outerY][2][2] == player)\r\n return player;\r\n //Top left to bottom right\r\n if(selected[outerX][outerY][0][0] == player && selected[outerX][outerY][1][1] == player && selected[outerX][outerY][2][2] == player)\r\n return player;\r\n //Top right to bottom left\r\n if(selected[outerX][outerY][0][2] == player && selected[outerX][outerY][1][1] == player && selected[outerX][outerY][2][0] == player)\r\n return player;\r\n\r\n \r\n //If no win, check for tie\r\n var countOfSelected = 0;\r\n for(var i = 0; i < 3; i++)\r\n {\r\n for(var j = 0; j < 3; j++)\r\n {\r\n if(selected[outerX][outerY][i][j] != 0)\r\n countOfSelected++;\r\n }\r\n }\r\n\r\n if(countOfSelected == 9)\r\n return -1;\r\n else\r\n return 0;\r\n}", "title": "" }, { "docid": "eaef5e459101f354123ff29262668d7d", "score": "0.6307223", "text": "function checkWin (aBoard) {\n var directions = [\n new vector(-1,0), // left\n new vector(-1,1), // left-up\n new vector(0,1), // up\n new vector(1,1), // up-right\n new vector(1,0), // right\n new vector(1,-1), // down-right\n new vector(0,-1), // down\n new vector(-1,-1) // down-left\n ];\n\n for(var i = 0; i < aBoard.xSize; i++) {\n for(var j = 0; j < aBoard.ySize; j++) {\n for(var dir = 0; dir < directions.length; dir++){\n var loc = {x:i, y:j};\n var winner = checkDirection(aBoard, directions[dir], loc );\n if(winner) {\n return winner;\n }\n }\n }\n }\n return '';\n}", "title": "" }, { "docid": "908612b4b9f05db604d036f9dbc47c88", "score": "0.630407", "text": "function checkHoriz() {\n\tvar sym = getCur();\n\tfor (var i = 0; i < board.length; i++) { //rows\t\t\n\t\tfor (var j = 0; j < board[i].length - 3; j++) {//columns\n\t\t\t\n\t\t\tif ( (board[i][j] == board[i][j+1]) &&\n\t\t\t\t (board[i][j] == board[i][j+2]) &&\n\t\t\t\t (board[i][j] == board[i][j+3]) &&\n\t\t\t\t (board[i][j] == sym))\n\t\t\t\t\t{ showWinner(); playVid(); return true }\n\t\t\t\t\n\n\t\t}\n\n\t\t\t\t\t\t\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "b6a6a370c5350d26633a0c1e068b7e9a", "score": "0.6300905", "text": "checkWin() {\n let winner;\n for (let i = 0; i < this.rows(); i++) {\n for (let j = 0; j < this.cols(); j++) {\n let piece = this.model[i][j];\n if (piece) {\n winner = this.checkFrom({ x: j, y: i }, piece);\n if (winner) {\n return winner;\n }\n }\n }\n }\n if (this.isFull()) {\n return -1;\n }\n return undefined;\n }", "title": "" }, { "docid": "e4ad4f0c330b6da149ee4faaa2a5c742", "score": "0.6296343", "text": "function checkMove() {\n for (var i = 0; i < winConditions.length; i++) {\n if (boardArray[winConditions[i][0]] === currentTurn && boardArray[winConditions[i][0]] === boardArray[winConditions[i][1]] && boardArray[winConditions[i][1]] === boardArray[winConditions[i][2]]) {\n win = true;\n h2.html(currentTurn + \" has won!\").hide().fadeIn(\"fast\");\n }\n }\n\n if (moveCnt > 8 && win === false) {\n h2.html(\"The game is over. It's a draw.\").hide().fadeIn(\"fast\");\n } else if (moveCnt <= 8 && win === false) {\n if (currentTurn === \"X\") {\n currentTurn = \"O\";\n } else {\n currentTurn = \"X\";\n }\n h2.html(\"It is \" + currentTurn + \"'s turn.\").hide().fadeIn(\"fast\");\n }\n }", "title": "" }, { "docid": "ddbaa7f1a69f2372109fbac78c8626da", "score": "0.6295114", "text": "checkWin(row, col, player) {\n const { board } = this.state;\n // check for vertical win\n let vertCount = 1;\n while (board[row + vertCount] &&\n board[row + vertCount][col] === player) {\n vertCount++;\n }\n if (vertCount >= 4) {\n return player;\n }\n \n // check for horizontal win\n // check left to see if there are same pieces\n let horizStart = 0;\n while (board[row][col + horizStart - 1] &&\n board[row][col + horizStart - 1] === player) {\n horizStart--;\n }\n // check to the right and count\n let horizCount = 1;\n while (board[row][col + horizStart + horizCount] === player) {\n horizCount++;\n }\n if (horizCount >= 4) {\n return player;\n }\n\n // check for minor diagonal win\n // check row - 1 and col - 1 to see if there are the same pieces\n let minorStart = 0;\n while (board[row - minorStart - 1] &&\n board[row - minorStart - 1][col - minorStart - 1] === player) {\n minorStart++;\n }\n // check to the right and down one and count\n let minorCount = 1;\n while (board[row - minorStart + minorCount] &&\n board[row - minorStart + minorCount][col - minorStart + minorCount] === player) {\n minorCount++;\n }\n if (minorCount >= 4) {\n return player;\n }\n\n // check for major diagonal win\n // check row + 1 and col - 1 to see if there are the same pieces\n let majorStart = 0;\n while (board[row + majorStart + 1] &&\n board[row + majorStart + 1][col - majorStart - 1] === player) {\n majorStart++;\n }\n // check to the right and up one and count\n let majorCount = 1;\n while (board[row + majorStart - majorCount] &&\n board[row + majorStart - majorCount][col - majorStart + majorCount] === player) {\n majorCount++;\n }\n if (majorCount >= 4) {\n return player;\n }\n return false;\n }", "title": "" }, { "docid": "b868b46798af2ecd3a35d8de133a390e", "score": "0.6289809", "text": "function checkForWin(y, x) {\n const _win = {\n upLeft: (y, x) => {\n let matches = 0;\n y--;\n x--;\n while (testMatch(y, x)) {\n y--;\n x--;\n matches++;\n }\n\n return matches;\n },\n\n left: (y, x) => {\n let matches = 0;\n x--;\n while (testMatch(y, x)) {\n x--;\n matches++;\n }\n return matches;\n },\n\n downLeft: (y, x) => {\n let matches = 0;\n y++;\n x--;\n while (testMatch(y, x)) {\n y++;\n x--;\n matches++;\n }\n return matches;\n },\n\n down: (y, x) => {\n let matches = 0;\n y++;\n while (testMatch(y, x)) {\n y++;\n matches++;\n }\n return matches;\n },\n\n downRight: (y, x) => {\n let matches = 0;\n y++;\n x++;\n while (testMatch(y, x)) {\n y++;\n x++;\n matches++;\n }\n return matches;\n },\n\n right: (y, x) => {\n let matches = 0;\n x++;\n while (testMatch(y, x)) {\n x++;\n matches++;\n }\n return matches;\n },\n\n upRight: (y, x) => {\n let matches = 0;\n y--;\n x++;\n while (testMatch(y, x)) {\n y--;\n x++;\n matches++;\n }\n return matches;\n },\n };\n\n /**testMatch checks if coordinates are on the board and if chip is assigned to currentPlayer */\n const testMatch = (y, x) => {\n if (\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n ) {\n return true;\n }\n return false;\n };\n\n let horizontalMatches = _win.left(y, x) + _win.right(y, x);\n let verticalMatches = _win.down(y, x);\n let rightDiagnolMatches = _win.downLeft(y, x) + _win.upRight(y, x);\n let leftDiagnolMatches = _win.upLeft(y, x) + _win.downRight(y, x);\n\n if (\n horizontalMatches >= 3 ||\n verticalMatches >= 3 ||\n rightDiagnolMatches >= 3 ||\n leftDiagnolMatches >= 3\n ) {\n return true;\n }\n}", "title": "" }, { "docid": "274ad1e90dbf2ece839d0a2fd999128f", "score": "0.62861305", "text": "function isWin(){\r\n\t\tif (verticalTesting(0)) {\r\n\t\t\treturn true;\r\n\t\t}else if (verticalTesting(1)) {\r\n\t\t\treturn true;\r\n\t\t}else if (verticalTesting(2)) {\r\n\t\t\treturn true;\r\n\t\t}else if (horizantalTesting(0)) {\r\n\t\t\treturn true;\r\n\t\t}else if (horizantalTesting(3)) {\r\n\t\t\treturn true;\r\n\t\t}else if (horizantalTesting(6)) {\r\n\t\t\treturn true;\r\n\t\t}else if (diagonalTestinRL(2)) {\r\n\t\t\treturn true;\r\n\t\t}else if (diagonalTestinLR(0)) {\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t\t//console.log(\"anhaa\")\r\n\t\t}\r\n\r\n\t}", "title": "" }, { "docid": "e7a9664d26b4f2aaf98d3c87db99b32f", "score": "0.628175", "text": "horizontalWinner() {\n let won = 1;\n for(let row = 0; row < this.ht; row++) {\n for(let col = 0; col < this.wd - 3; col++) {\n let disc = this.state.squares[col][row];\n if(disc !== null) {\n if(this.state.squares[col + 1][row] === disc\n && this.state.squares[col + 2][row] === disc\n && this.state.squares[col + 3][row] === disc) {\n return won;\n }\n }\n }\n }\n return !won;\n }", "title": "" }, { "docid": "eb0c785aaa6f7a6d3f32ea50602d7b0a", "score": "0.627232", "text": "function checkHorizontalWinPrevented(board, opponent, mode){\n\n // For every row of the board\n for(let i = 0; i < board.highestRow; i++){\n\n let rowPods = getRow(board, i);\n\n // Check every three consecutive pods \n for(let j = 1; j < rowPods.length - 3; j++){\n\n // If any three consecutive pairs match\n if( equals4(rowPods[j], rowPods[j + 1], rowPods[j + 2], opponent) ){\n \n\n if(mode == 'before'){\n\n let beforeIndex = j -1;\n if(rowPods[beforeIndex] != opponent && rowPods[beforeIndex] != -1){\n return true;\n }\n }\n else if(mode == 'after'){\n \n let afterIndex = j + 3;\n if(rowPods[afterIndex] != opponent && rowPods[afterIndex] != -1){\n console.log(\"AFTER WIN PREVENTED: \", rowPods);\n return true;\n }\n }\n \n } // three pair match if end\n\n } // three consecutive pods loop end\n\n } // check every row loop end\n\n return false;\n }", "title": "" }, { "docid": "5538a0bef38632fcabf65ee7776b2a87", "score": "0.62681806", "text": "function checkWin() {\n let lines = [\n // row wins\n [0, 1, 2],\n [3, 4, 5],\n [6, 7, 8],\n // column wins\n [0, 3, 6],\n [1, 4, 7],\n [2, 5, 8],\n // diagonal wins\n [0, 4, 8],\n [2, 4, 6]\n ]\n\n for (let i = 0; i < lines.length; i++) {\n const [a, b, c] = lines[i];\n // highlight winning marks\n if (_board[a] && _board[a] === _board[b] && _board[a] === _board[c]) {\n let sq1 = document.getElementById(String(a));\n let sq2 = document.getElementById(String(b));\n let sq3 = document.getElementById(String(c));\n sq1.classList.add(\"win\");\n sq2.classList.add(\"win\");\n sq3.classList.add(\"win\");\n return _board[a];\n }\n }\n return false;\n }", "title": "" }, { "docid": "461d1da0f0fe8f771e38e051f57cfbce", "score": "0.62645614", "text": "won() {\n return( this.rowWin()|| this.colWin() || this.diaglWin());\n\n }", "title": "" }, { "docid": "5bff195dfd3a3527573c79c8f5bcaec1", "score": "0.6261764", "text": "checkInVertical(color) {\n let value = 0;\n for (let col = 0; col < 15; col++) {\n value = 0;\n for (let row = 0; row < 15; row++) {\n if (game.board[row][col] != color) {\n value = 0;\n } else {\n value++;\n }\n if (value == 5) {\n this.announceWinner();\n return;\n }\n }\n }\n }", "title": "" }, { "docid": "c8f32e978e1dce3b4989371cca491f41", "score": "0.6256167", "text": "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n return cells.every(\n ([y, x]) => y >= 0 && y < HEIGHT && x >= 0 && x < WIDTH && board[y][x] === currPlayer\n );\n }\n\n // loop through and provide variables for horiz, ver, diagDr & diagDL to be checked against _win function\n // each variable will provide 4 x & 4 y corodinates to check\n // note -- as each loop starts at y & x andcontinues until the y or x values are the maximum some outputs will exceed the cell board width or height. the _win function will deal with this logic\n for (let y = 0; y < HEIGHT; y++) {\n for (let x = 0; x < WIDTH; x++) {\n let horiz = [\n [y, x],\n [y, x + 1],\n [y, x + 2],\n [y, x + 3],\n ];\n let vert = [\n [y, x],\n [y + 1, x],\n [y + 2, x],\n [y + 3, x],\n ];\n let diagDR = [\n [y, x],\n [y + 1, x + 1],\n [y + 2, x + 2],\n [y + 3, x + 3],\n ];\n let diagDL = [\n [y, x],\n [y + 1, x - 1],\n [y + 2, x - 2],\n [y + 3, x - 3],\n ];\n\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n}", "title": "" }, { "docid": "45945521788c409c57d89fa02c82201d", "score": "0.6254196", "text": "function verticalMoveCheck(pos1, pos2, board) {\r\n var greaterpos;\r\n var lesserpos;\r\n var i;\r\n if (Math.abs(pos1.col - pos2.col) === 0) {\r\n if (pos2.row > pos1.row) {\r\n greaterpos = pos2;\r\n lesserpos = pos1;\r\n for (i = lesserpos.row + 1; i <= greaterpos.row; i += 1) {\r\n if (board[i][greaterpos.col] !== '') {\r\n return false;\r\n }\r\n }\r\n }\r\n else {\r\n greaterpos = pos1;\r\n lesserpos = pos2;\r\n for (i = greaterpos.row - 1; i >= lesserpos.row; i -= 1) {\r\n if (board[i][greaterpos.col] !== '') {\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n return true;\r\n }", "title": "" }, { "docid": "66abcd15806a5ee691c494b078215a67", "score": "0.62533474", "text": "function detectWinningMove(square, player) {\n var grid = $.extend(true, {}, gameState.grid);\n grid[square].occupied = player;\n if (checkWin(player, grid)) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "d177b9711a9a7e282dea589d421aba16", "score": "0.6243384", "text": "calcWin(coord) {\n // copy the coordinates\n const coordmap = this.state.squares.slice();\n if(!coordmap[coord.y][coord.x]) return;\n var point = coordmap[coord.y][coord.x];\n\n var testPoint = function (c) {\n if(c.x < 0 || c.y < 0 // test if (x or y) < 0..\n || c.x > coordmap[0].length - 1 // ..or (x or y) > boundaries\n || c.y > coordmap.length - 1)\n return false;\n return coordmap[c.y][c.x] === point;\n };\n\n //relative positions for testing for straights\n const testables = [\n [1,0],\n [1,1],\n [0,1],\n [-1,1],\n [-1,0],\n [-1,-1],\n [1,-1],\n [0,-1],\n ];\n\n // moves specified coordinate by 1 to\n // direction spefified by testables index\n var moveCoord = function (c, index) {\n const item = testables[index];\n return {x: c.x+item[0], y: c.y+item[1]};\n }\n\n // test for each direction\n for(var i=0;i<8;i++){\n var c = coord;\n // test for straight of 5\n for(var count=0; count<5; count++){\n c = moveCoord(c, i);\n if(!testPoint(c)) { break; }\n // count needs to be tested for straightlength - 2\n else if (count === 3) {\n return point;\n }\n }\n }\n }", "title": "" }, { "docid": "f4f491d4c3395281b101655a33e30132", "score": "0.62399095", "text": "function winCheck()\n\t{\n\t\t// check for win\n\t\tlet win = false;\n\t\t\t\n\t\t// check horizontal\n\t\tlet match = 0;\n\t\tfor(let y = 0; y < numRows; y++)\n\t\t{\n\t\t\tlet current;\n\t\t\tfor (let x = 0; x < numCols; x++)\n\t\t\t{\n\t\t\t\tcurrent = cells[y][x];\n\t\t\t\t// check if next element is match\n\t\t\t\tif(current.className === playerColor)\n\t\t\t\t{\n\t\t\t\t\tmatch++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tmatch = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(match >= 4)\n\t\t\t\t{\n\t\t\t\t\twin = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmatch = 0;\n\t\t}\t\t\t\n\t\t\n\t\t// check vertical\n\t\tmatch = 0;\n\t\tfor(let x = 0; x < numCols; x++)\n\t\t{\n\t\t\tlet current;\n\t\t\tfor (let y = 0; y < numRows; y++)\n\t\t\t{\n\t\t\t\tcurrent = cells[y][x];\n\t\t\t\t// check if next element is match\n\t\t\t\tif(current.className === playerColor)\n\t\t\t\t{\n\t\t\t\t\tmatch++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tmatch = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(match >= 4)\n\t\t\t\t{\n\t\t\t\t\twin = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmatch = 0;\n\t\t}\n\t\t\t\n\t\t// check diagonals\n\t\tlet Ylength = cells.length;\n\t\tlet Xlength = cells[0].length;\n\t\tlet maxLength = Math.max(Xlength, Ylength);\n\t\t\n\t\tfor (let i = 0; i <= 2 *(maxLength - 1); ++i)\n\t\t{\n\t\t\tfor (let y = Ylength - 1; y >= 0; --y)\n\t\t\t{\n\t\t\t\tlet x = i - (Ylength - y);\n\t\t\t\tif (x >= 0 && x < Xlength)\n\t\t\t\t{\n\t\t\t\t\tcurrent = cells[y][x];\n\t\t\t\t\t// check if next element is match\n\t\t\t\t\tif(current.className === playerColor)\n\t\t\t\t\t{\n\t\t\t\t\t\tmatch++;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tmatch = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(match >= 4)\n\t\t\t\t\t{\n\t\t\t\t\t\twin = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tmatch = 0;\n\t\t}\n\t\t\t\n\t\tfor (let i = 0; i <= 2 *(maxLength - 1); ++i)\n\t\t{\n\t\t\tfor (let y = Ylength - 1; y >= 0; --y)\n\t\t\t{\n\t\t\t\tlet x = i - y;\n\t\t\t\tif (x >= 0 && x < Xlength)\n\t\t\t\t{\n\t\t\t\t\tcurrent = cells[y][x];\n\t\t\t\t\t// check if next element is match\n\t\t\t\t\tif(current.className === playerColor)\n\t\t\t\t\t{\n\t\t\t\t\t\tmatch++;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tmatch = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(match >= 4)\n\t\t\t\t\t{\n\t\t\t\t\t\twin = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tmatch = 0;\n\t\t}\n\t\t\n\t\treturn win;\n\t}", "title": "" }, { "docid": "b3ddb67eac003952c5a702c2777ce996", "score": "0.6235493", "text": "function checkWin() {\n\n let bStones;\n let wStones;\n\n //Check vertical\n for (let i = 0; i < grid.length; i++) {\n bStones = 0;\n wStones = 0;\n for (let j = 0; j < grid.length; j++) {\n\n if(grid[i][j] == \"b\"){\n bStones ++;\n if(bStones == rows){\n console.log(\"Black Won\");\n winner = \"black\";\n }\n } else if(grid[i][j] == \"w\"){\n wStones ++;\n if(wStones == rows){\n console.log(\"White Won\");\n winner = \"white\";\n }\n }\n } \n }\n\n\n //Check horizontal\n for (let i = 0; i < grid.length; i++) {\n bStones = 0;\n wStones = 0;\n for (let j = 0; j < grid.length; j++) {\n\n if(grid[j][i] == \"b\"){\n bStones ++;\n if(bStones == cols){\n console.log(\"Black Won\");\n winner = \"black\";\n }\n } else if(grid[j][i] == \"w\"){\n wStones ++;\n if(wStones == cols){\n console.log(\"White Won\");\n winner = \"white\";\n }\n }\n } \n }\n}", "title": "" }, { "docid": "35757aba5da3a35fc434ce143460add9", "score": "0.62302065", "text": "isGameOver(board){\n //check for all winning lines\n //diagonals\n if( board[0][0] !== '' && board[0][0] === board[1][1] && \n board[1][1] === board[2][2] )\n { //if the checked line is found, return the winning token from any point on that line\n return board[0][0]; \n }\n else if( board[0][2] !== '' && board[0][2] === board[1][1] && \n board[1][1] === board[2][0] )\n { return board[0][2] }\n //horizontals\n else if( board[0][0] !== '' && board[0][0] === board[0][1] && \n board[0][1] === board[0][2] )\n { return board[0][0] }\n else if( board[1][0] !== '' && board[1][0] === board[1][1] && \n board[1][1] === board[1][2] )\n { return board[1][0] }\n else if( board[2][0] !== '' && board[2][0] === board[2][1] && \n board[2][1] === board[2][2] )\n { return board[2][0] }\n //verticals\n else if( board[0][0] !== '' && board[0][0] === board[1][0] && \n board[1][0] === board[2][0] )\n { return board[0][0] }\n else if( board[0][1] !== '' && board[0][1] === board[1][1] && \n board[1][1] === board[2][1] )\n { return board[0][1] }\n else if( board[0][2] !== '' && board[0][2] === board[1][2] && \n board[1][2] === board[2][2] )\n { return board[0][2] }\n\n //no winner yet? check for empty spaces, return false if one is found, game is not over\n let found = false;\n board.forEach((element)=>{\n element.forEach((innerElement)=> {\n if(innerElement === ''){\n found = true;\n }\n });\n });\n if (found){ return false }\n\n //no winner and no empty spaces? return null indicating tie\n return null;\n\n }", "title": "" }, { "docid": "f87c348c35bbe4438b8ea1f478665846", "score": "0.6228925", "text": "checkShipPlacementVertical(row, col, matrix, shipSize){\n //if the position does not have -1 then return false straight away!\n if (matrix[row][col] != -1){\n return false;\n }\n\n //checking below. if the length of the ship is crossing the border then return false straight away\n if (row+(shipSize)>9){\n return false;\n }\n //if for the length of the ship we encounter a value that is not -1 then we return false and otherwise true.\n for (let i = 0; i<shipSize; i++){\n if(matrix[row+i][col] != -1){\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "0e971faeb282849b98531d8bbd667925", "score": "0.62257934", "text": "checkForWin() {\n const _win = (cells) => {\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < this.height &&\n x >= 0 &&\n x < this.width &&\n this.board[y][x] === this.currPlayer.number\n );\n };\n\n for (let y = 0; y < this.height; y++) {\n for (let x = 0; x < this.width; x++) {\n const horiz = [\n [y, x],\n [y, x + 1],\n [y, x + 2],\n [y, x + 3],\n ];\n const vert = [\n [y, x],\n [y + 1, x],\n [y + 2, x],\n [y + 3, x],\n ];\n const diagDR = [\n [y, x],\n [y + 1, x + 1],\n [y + 2, x + 2],\n [y + 3, x + 3],\n ];\n const diagDL = [\n [y, x],\n [y + 1, x - 1],\n [y + 2, x - 2],\n [y + 3, x - 3],\n ];\n\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n }", "title": "" }, { "docid": "599d7cacd69c1c6093d65739a4331252", "score": "0.622366", "text": "function didWin(tiles, player) {\n const currentPlayer = player ? 'X' : 'O';\n const winFlag =\n // Check Verticals\n (tiles[0][0] === currentPlayer && tiles[0][1] === currentPlayer && tiles[0][2] === currentPlayer) ||\n (tiles[1][0] === currentPlayer && tiles[1][1] === currentPlayer && tiles[1][2] === currentPlayer) ||\n (tiles[2][0] === currentPlayer && tiles[2][1] === currentPlayer && tiles[2][2] === currentPlayer) ||\n // Check Horizontals\n (tiles[0][0] === currentPlayer && tiles[1][0] === currentPlayer && tiles[2][0] === currentPlayer) ||\n (tiles[0][1] === currentPlayer && tiles[1][1] === currentPlayer && tiles[2][1] === currentPlayer) ||\n (tiles[0][2] === currentPlayer && tiles[1][2] === currentPlayer && tiles[2][2] === currentPlayer) ||\n // Check diagonals\n (tiles[0][0] === currentPlayer && tiles[1][1] === currentPlayer && tiles[2][2] === currentPlayer) ||\n (tiles[0][2] === currentPlayer && tiles[1][1] === currentPlayer && tiles[2][0] === currentPlayer);\n \n return winFlag;\n}", "title": "" }, { "docid": "55ac0d487666a3b09eb80000b8c14b42", "score": "0.62199104", "text": "function moveOutcomes() {\n // deals with snake hitting border and snake hitting self\n if (\n (currentSnake[0] + width >= (width * width) && direction === width) // if snake hits bottom\n )\n}", "title": "" }, { "docid": "b4a2d9d2b4aedef32121cdd237b9243d", "score": "0.6204617", "text": "function checkWin(x,y) { \n var startx =x;\n var starty=y; \n var tempx = x ; \n var tempy = y;\n var count = 1; \n var go = true; \n var highc =0; \n var a = board[startx][starty].team; \n console.log(\"Starting position: ({0},{1})\", startx,starty);\n for(i=-1; i<=1;i++) {\n for(j=-1; j<=1;j++){\n if(i==0 && j==0) continue;\n \n var i2 = i ;\n var j2= j;\n \n if(x+i2 >6 || y+j2 > 5 || x+i2 <0 || y+j2 < 0) {\n go =false; \n }else if(a != board[x+i][y+j].team) continue; \n \n while(go){\n console.log(\"found position: ({0},{1})\", (x+i2),(y+j2));\n count++; \n if(i2<0) i2-- ;\n if (j2<0) j2 --; \n if( j2>0) j2++;\n if(i2>0)i2++;\n \n if(x+i2 >6 || y+j2 > 5 || x+i2 <0 || y+j2 < 0) {\n go =false; \n }else if(a != board[x+i2][y+j2].team) go = false; \n }\n \n i2=i;\n j2=j; \n go = true;\n \n if(x-i2 <0 || y-j2 <0|| x-i2 >6 || y-j2 >5) {\n go =false; \n }else if(a != board[x-i2][y-j2].team) go = false; \n \n while(go){\n console.log(\"2 found position: ({0},{1})\", (x-i2),(y-j2));\n count++; \n if(i2<0) i2-- ;\n if (j2<0) j2 --; \n if( j2>0) j2++;\n if(i2>0)i2++;\n if(x-i2 <0 || y-j2 <0|| x-i2 >6 || y-j2 >5) {\n go =false; \n }else if(a != board[x-i2][y-j2].team) go = false; \n }\n \n \n \n \n } \n console.log(\"win count: \"+count);\n if( count >= highc){\n highc = count;\n }\n \n count =1;\n }\n \n return highc;\n \n \n \n }", "title": "" }, { "docid": "16e524384119aa09cd18396614095746", "score": "0.6200944", "text": "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n return cells.every(\n ([y, x]) =>\n \n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n \n }\n\n board.forEach((row, x, arr) => {\n board.forEach((column, y, arr) => {\n y = y + 1;\n const horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n const vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n const diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n const diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]]; \n // COMMENT: check if any of the four winning game states has pieces of the same player\n\n console.log((_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)));\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n winner = true;\n }\n\n });\n\n })\n\n\n // horizArr.push([[y, x], [y, x + 1], [y, x + 2], [y, x + 3]]);\n // console.log(horizArr);\n\n // COMMENT: nested loop to traverse the array matrix\n // for (let y = 0; y < HEIGHT; y++) {\n // for (let x = 0; x < WIDTH; x++) {\n // // console.log('old',x);\n // //COMMENT: define all 4 legal winning game states\n // const horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n // const vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n // const diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n // const diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n \n \n // // COMMENT: check if any of the four winning game states has pieces of the same player\n\n // // console.log('old: ', vert);\n // console.log((_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)));\n // if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n // return true;\n // }\n // }\n // }\n}", "title": "" }, { "docid": "6e527f5a4163bf1011415b1a33a34960", "score": "0.6200461", "text": "function horizontalWinCheck(){\n for(var row = 0; row < 6; row++) {\n for(var col = 0; col < 4; col++) {\n if(colorMatchCheck(returnColor(row,col), returnColor(row,col+1), returnColor(row,col+2), returnColor(row,col+3))){\n console.log('horiz');\n reportWin(row,col);\n return true;\n } else {\n continue;\n }\n }\n }\n}", "title": "" }, { "docid": "03e1fd2a7030cce51405dee57b2e1378", "score": "0.6197004", "text": "function checkIfWinner(position, player) {\n\n const winner = document.getElementsByClassName('winnerBox')[0];\n\n console.log('position - ' + position );\n console.log('player - ' + player);\n\n var isPlayerWinner = false;\n\n\n// ******************** Check from position 1 Row 1 column 1 ***********************************\n\n if (position === '1') {\n if ((row1col1_status === player) &&\n (row1col2_status === player) && \n (row1col3_status === player)) {\n\n changeStatusCell(row1col1, \"winner\");\n changeStatusCell(row1col2, \"winner\");\n changeStatusCell(row1col3, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n else if ((row1col1_status === player) &&\n (row2col2_status === player) && \n (row3col3_status === player)) {\n\n changeStatusCell(row1col1, \"winner\");\n changeStatusCell(row2col2, \"winner\");\n changeStatusCell(row3col3, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n else if ((row1col1_status === player) &&\n (row2col1_status === player) && \n (row3col1_status === player)) {\n\n changeStatusCell(row1col1, \"winner\");\n changeStatusCell(row2col1, \"winner\");\n changeStatusCell(row3col1, \"winner\");\n\n isPlayerWinner = true;\n \n }\n }\n\n// ******************** Check from position 2 Row 1 column 2 ***********************************\n\n else if (position === '2') {\n console.log(\"position 2\");\n if ((row1col2_status === player) &&\n (row2col2_status === player) && \n (row3col2_status === player)) {\n\n changeStatusCell(row1col2, \"winner\");\n changeStatusCell(row2col2, \"winner\");\n changeStatusCell(row3col2, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n else if ((row1col1_status === player) &&\n (row1col2_status === player) && \n (row1col3_status === player)) {\n\n changeStatusCell(row1col1, \"winner\");\n changeStatusCell(row1col2, \"winner\");\n changeStatusCell(row1col3, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n }\n\n// ******************** Check from position 3 Row 1 column 3 ***********************************\n\n else if (position === '3') {\n console.log('position 3');\n\n if ((row1col1_status === player) &&\n (row1col2_status === player) && \n (row1col3_status === player)) {\n\n changeStatusCell(row1col1, \"winner\");\n changeStatusCell(row1col2, \"winner\");\n changeStatusCell(row1col3, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n else if ((row3col1_status === player) &&\n (row2col2_status === player) && \n (row1col3_status === player)) {\n\n changeStatusCell(row3col1, \"winner\");\n changeStatusCell(row2col2, \"winner\");\n changeStatusCell(row1col3, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n else if ((row1col3_status === player) &&\n (row2col3_status === player) && \n (row3col3_status === player)) {\n\n changeStatusCell(row1col3, \"winner\");\n changeStatusCell(row2col3, \"winner\");\n changeStatusCell(row3col3, \"winner\");\n\n isPlayerWinner = true;\n \n }\n }\n\n// ******************** Check from position 4 Row 2 column 1 ***********************************\n\n else if (position === '4') {\n console.log('position 4');\n\n if ((row1col1_status === player) &&\n (row2col1_status === player) && \n (row3col1_status === player)) {\n\n changeStatusCell(row1col1, \"winner\");\n changeStatusCell(row2col1, \"winner\");\n changeStatusCell(row3col1, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n else if ((row2col1_status === player) &&\n (row2col2_status === player) && \n (row2col3_status === player)) {\n\n changeStatusCell(row2col1, \"winner\");\n changeStatusCell(row2col2, \"winner\");\n changeStatusCell(row2col3, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n }\n\n// ******************** Check from position 5 Row 2 column 2 ***********************************\n\n else if (position === '5') {\n console.log('position 5');\n\n if ((row1col1_status === player) &&\n (row2col2_status === player) && \n (row3col3_status === player)) {\n\n changeStatusCell(row1col1, \"winner\");\n changeStatusCell(row2col2, \"winner\");\n changeStatusCell(row3col3, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n else if ((row1col2_status === player) &&\n (row2col2_status === player) && \n (row3col2_status === player)) {\n\n changeStatusCell(row1col2, \"winner\");\n changeStatusCell(row2col2, \"winner\");\n changeStatusCell(row3col2, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n else if ((row1col3_status === player) &&\n (row2col2_status === player) && \n (row3col1_status === player)) {\n\n changeStatusCell(row1col3, \"winner\");\n changeStatusCell(row2col2, \"winner\");\n changeStatusCell(row3col1, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n else if ((row2col1_status === player) &&\n (row2col2_status === player) && \n (row2col3_status === player)) {\n\n changeStatusCell(row2col1, \"winner\");\n changeStatusCell(row2col2, \"winner\");\n changeStatusCell(row2col3, \"winner\");\n\n isPlayerWinner = true;\n \n }\n }\n\n// ******************** Check from position 6 Row 2 column 3 ***********************************\n\n else if (position === '6') {\n console.log('position 6');\n\n if ((row1col3_status === player) &&\n (row2col3_status === player) && \n (row3col3_status === player)) {\n\n changeStatusCell(row1col3, \"winner\");\n changeStatusCell(row2col3, \"winner\");\n changeStatusCell(row3col3, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n else if ((row2col1_status === player) &&\n (row2col2_status === player) && \n (row2col3_status === player)) {\n\n changeStatusCell(row2col1, \"winner\");\n changeStatusCell(row2col2, \"winner\");\n changeStatusCell(row2col3, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n }\n\n// ******************** Check from position 7 Row 3 column 1 ***********************************\n\n else if (position === '7') {\n console.log('position 7');\n\n if ((row1col1_status === player) &&\n (row2col1_status === player) && \n (row3col1_status === player)) {\n\n changeStatusCell(row1col1, \"winner\");\n changeStatusCell(row2col1, \"winner\");\n changeStatusCell(row3col1, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n else if ((row1col3_status === player) &&\n (row2col2_status === player) && \n (row3col1_status === player)) {\n\n changeStatusCell(row1col3, \"winner\");\n changeStatusCell(row2col2, \"winner\");\n changeStatusCell(row3col1, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n else if ((row3col1_status === player) &&\n (row3col2_status === player) && \n (row3col3_status === player)) {\n\n changeStatusCell(row3col1, \"winner\");\n changeStatusCell(row3col2, \"winner\");\n changeStatusCell(row3col3, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n }\n\n// ******************** Check from position 8 Row 3 column 2 ***********************************\n\n else if (position === '8') {\n console.log('position 8');\n\n if ((row3col1_status === player) &&\n (row3col2_status === player) && \n (row3col3_status === player)) {\n\n changeStatusCell(row3col1, \"winner\");\n changeStatusCell(row3col2, \"winner\");\n changeStatusCell(row3col3, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n else if ((row1col2_status === player) &&\n (row2col2_status === player) && \n (row3col2_status === player)) {\n\n changeStatusCell(row1col2, \"winner\");\n changeStatusCell(row2col2, \"winner\");\n changeStatusCell(row3col2, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n }\n\n\n// ******************** Check from position 9 Row 3 column 3 ***********************************\n\n else if (position === '9') {\n console.log('position 9');\n\n if ((row3col1_status === player) &&\n (row3col2_status === player) && \n (row3col3_status === player)) {\n\n changeStatusCell(row3col1, \"winner\");\n changeStatusCell(row3col2, \"winner\");\n changeStatusCell(row3col3, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n else if ((row1col1_status === player) &&\n (row2col2_status === player) && \n (row3col3_status === player)) {\n\n changeStatusCell(row1col1, \"winner\");\n changeStatusCell(row2col2, \"winner\");\n changeStatusCell(row3col3, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n else if ((row1col3_status === player) &&\n (row2col3_status === player) && \n (row3col3_status === player)) {\n\n changeStatusCell(row1col3, \"winner\");\n changeStatusCell(row2col3, \"winner\");\n changeStatusCell(row3col3, \"winner\");\n\n isPlayerWinner = true;\n \n }\n\n }\n\n\n\n if (isPlayerWinner === true) {\n if (player === 'user') {\n winner.value = \"User is the Winner!!!\";\n winner.style.backgroundColor = \"blue\";\n winner.color = \"white\";\n console.log('Winner');\n \n }\n else if (player === 'computer') {\n winner.value = \"Computer is the Winner!!\";\n }\n\n return true;\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "3f84a5b071fcecbd89213843d31d0cb4", "score": "0.6193211", "text": "function checkForWinner(gamerow, gamecol, opponentClass) {\n\n //Pass a \"cell\" with x and y co-ordinates\n function $getCell(y, x) {\n return $(`.gamecol[data-gamerow='${y}'][data-gamecol='${x}']`);\n }\n\n //Function used to count number of a user pieces in a direction\n //takes in a checkdirection object with x and y value\n function checkDirection(checkDirection) {\n let total = 0;\n let y = gamerow + checkDirection.y;\n let x = gamecol + checkDirection.x;\n let $next = $getCell(y, x);\n //While in bounds and cell is still a user piece increase total\n while (y >= 0 && y < 6 && x >= 0 && x < 7 && $next.hasClass(opponentClass)) {\n total++;\n y += checkDirection.y;\n x += checkDirection.x;\n $next = $getCell(y, x);\n }\n return total;\n }\n\n //Function that uses checkDirection in both directions\n //If verical, check up and down; horizontal left and right... similar with diagonals\n function checkWin(yMove, xMove) {\n const total = 1 +\n checkDirection(yMove) +\n checkDirection(xMove);\n if (total >= 4) {\n return true;\n } else {\n return null;\n }\n }\n\n //Check Diagonal with '/' Slope\n function checkCounterDiag() {\n return checkWin({y: 1, x: -1}, {y: -1, x: 1});\n }\n\n //Diagonal with '\\' Slope\n function checkMainDiag() {\n return checkWin({y: 1, x: 1}, {y: -1, x: -1});\n }\n\n //Verical Direction\n function checkVerticals() {\n return checkWin({y: -1, x: 0}, {y: 1, x: 0});\n }\n\n //Horizontal Direction\n function checkHorizontals() {\n return checkWin({y: 0, x: -1}, {y: 0, x: 1});\n }\n \n //return results of OR of checking all directions, user won if any direction is true\n return checkVerticals() || checkHorizontals() || checkCounterDiag() || checkMainDiag();\n }", "title": "" }, { "docid": "e5799702ff3ba58c82752630734ed7db", "score": "0.6189407", "text": "function IsVerticalStreak(row_ver_streak, col_ver_streak)\r\n{\r\n\tif (row_ver_streak != -1 && col_ver_streak != -1)\r\n\t{\r\n\t\tlet tileValue = jewels[row_ver_streak][col_ver_streak];\r\n\t\tlet streak = 0;\r\n\t\tlet tmp = row_ver_streak;\r\n\r\n\t\twhile (tmp > 0 && jewels[tmp - 1][col_ver_streak] == tileValue)\r\n\t\t{\r\n\t\t\tstreak++;\r\n\t\t\ttmp--;\r\n\t\t}\r\n\r\n\t\ttmp = row_ver_streak;\r\n\t\t\r\n\t\twhile (tmp < numRows - 1 && jewels[tmp + 1][col_ver_streak] == tileValue)\r\n\t\t{\r\n\t\t\tstreak++;\r\n\t\t\ttmp++;\r\n\t\t}\r\n\r\n\t\treturn streak > 0;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "c0fa79fc9a1ccf652b37346038be8442", "score": "0.61869353", "text": "function checkWin(){\n\n\t/* Row check */\n\tfor(let x=0; x<3; x++){\n\t\tfor(let y=0; y<1; y++){\n\t\t\tif (( boxArray[x][y].getState() === boxArray[x][y+1].getState()) && (boxArray[x][y].getState() !== 0) && (boxArray[x][y+1].getState() ===\n\t\t\t\tboxArray[x][y+2].getState())) {\n\t\t\t\tconsole.log('Row completed');\n\t\t\t\treturn boxArray[x][y].getState();\t// 1 is player 1, 2 is player 2, you can tell from the value here\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Column check */\n\tfor(let x=0; x<1; x++){\n\t\tfor(let y=0; y<3; y++){\n\t\t\tif (( boxArray[x][y].getState() === boxArray[x+1][y].getState()) && (boxArray[x][y].getState() !== 0) && boxArray[x+1][y].getState() ===\n\t\t\t\tboxArray[x+2][y].getState()) {\n\t\t\t\tconsole.log('Column completed');\n\t\t\t\treturn boxArray[x][y].getState();\t// 1 is player 1, 2 is player 2, you can tell from the value here\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Diagonal check */\n\tif (boxArray[0][0].getState() === boxArray[1][1].getState() && (boxArray[0][0].getState() === boxArray[2][2].getState()) && (boxArray[0][0].getState() !== 0) ||\n\t\t\t(boxArray[0][2].getState() === boxArray[1][1].getState()) && (boxArray[0][2].getState() === boxArray[2][0].getState()) && (boxArray[0][2].getState() !== 0)) {\n\t\t\tconsole.log('Diagonal completed');\n\t\t\treturn boxArray[1][1].getState();\t// Middle cell (1,1) is always set\n\t}\n\treturn 0;\t// Result is draw\n}", "title": "" }, { "docid": "586b0fc38aae0729bdb9a2be5ee1146c", "score": "0.6184308", "text": "checkForWinner(row, col) { \n const that = this;\n\n function $getCell(i, j) {\n return $(`.col[data-row='${i}'][data-col='${j}']`);\n }\n\n function checkDirection(direction) {\n let total = 0;\n let i = row + direction.i;\n let j = col + direction.j;\n let $next = $getCell(i, j);\n while (i >= 0 &&\n i < that.ROWS &&\n j >= 0 && \n j < that.COLS &&\n $next.data('player') === that.player\n ) {\n total++;\n i += direction.i\n j += direction.j;\n $next = $getCell(i, j);\n }\n return total;\n }\n\n function checkWin(directionA, directionB) {\n const total = 1 +\n checkDirection(directionA) +\n checkDirection(directionB);\n if (total >= 4) {\n return that.player;\n } else {\n return null;\n }\n }\n\n function checkDiagonalBLtoTR() {\n return checkWin({i: 1, j: -1}, {i: 1, j: 1});\n }\n\n function checkDiagonalTLtoBR() {\n return checkWin({i: 1, j: 1}, {i: -1, j: -1});\n }\n\n function checkVerticals() {\n return checkWin({i: -1, j: 0}, {i: 1, j: 0});\n }\n\n function checkHorizontals() {\n return checkWin({i: 0, j: -1}, {i: 0, j: 1});\n }\n return checkVerticals() || \n checkHorizontals() ||\n checkDiagonalBLtoTR() ||\n checkDiagonalTLtoBR();\n }", "title": "" }, { "docid": "624d990027417e325faeab1bbb82a052", "score": "0.61760074", "text": "function checkWin(player, grid) {\n // check y1x1 diagonal\n if (grid.y1x1.occupied === player && grid.y2x2.occupied === player && grid.y3x3.occupied === player) {\n gameState.winningArr = ['y1x1', 'y2x2', 'y3x3'];\n return true;\n }\n // check y1x3 diagonal\n if (grid.y1x3.occupied === player && grid.y2x2.occupied === player && grid.y3x1.occupied === player) {\n gameState.winningArr = ['y1x3', 'y2x2', 'y3x1'];\n return true;\n }\n // check verticals\n if (grid.y1x1.occupied === player && grid.y2x1.occupied === player && grid.y3x1.occupied === player) {\n gameState.winningArr = ['y1x1', 'y2x1', 'y3x1'];\n return true;\n }\n if (grid.y1x2.occupied === player && grid.y2x2.occupied === player && grid.y3x2.occupied === player) {\n gameState.winningArr = ['y1x2', 'y2x2', 'y3x2'];\n return true;\n }\n if (grid.y1x3.occupied === player && grid.y2x3.occupied === player && grid.y3x3.occupied === player) {\n gameState.winningArr = ['y1x3', 'y2x3', 'y3x3'];\n return true;\n }\n // check horizontals\n if (grid.y1x1.occupied === player && grid.y1x2.occupied === player && grid.y1x3.occupied === player) {\n gameState.winningArr = ['y1x1', 'y1x2', 'y1x3'];\n return true;\n }\n if (grid.y2x1.occupied === player && grid.y2x2.occupied === player && grid.y2x3.occupied === player) {\n gameState.winningArr = ['y2x1', 'y2x2', 'y2x3'];\n return true;\n }\n if (grid.y3x1.occupied === player && grid.y3x2.occupied === player && grid.y3x3.occupied === player) {\n gameState.winningArr = ['y3x1', 'y3x2', 'y3x3'];\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "8cefb020308e6f91f8932cc03aabce10", "score": "0.6169071", "text": "checkWin(lgn, col){ // on a besoin des lignes et colonnes en arguments \n\t\tconst that = this; // variable on lui dit que that est égale à this \n\n\t\tfunction $getCell(i, j){ // cette fonction va nous retourner la cellule qui correspond aux coordonnées html (data) !! ligne on appellera i et colonne on appellera j \n\t\t\treturn $(`.col[data-lgn=\"${i}\"][data-col=\"${j}\"]`); // blackquotes \n\t\t}\n// CETTE FONCTION VA VERIFIER LES DIRECTIONS\n\t\tfunction checkDirection(direction){\n\t\t\tlet total = 0; \n\t\t\tlet i = lgn + direction.i; \n\t\t\tlet j = col + direction.j;\n\t\t\tlet $next = $getCell(i, j); // renvoie a la function getCell pour obtenir la data\n\t\t\twhile(i >= 0 && i < that.LGN && j >= 0 && j < that.COL && $next.data(\"player\") === that.player){ // boucle tant que i supérieur à 0 et que les lignes correspondent aux 6 de départ ! pareil avec pour j ! Pour pas qui dépasse du tableau ! On veut le data.player pour vérifier que les pions correspondent au bon joueur ! \n\t\t\t\ttotal++; // si la boucle est ok on incrémente et passe à une autre cellule du tableau\n\t\t\t\ti += direction.i; \n\t\t\t\tj += direction.j;\n\t\t\t\t$next = $getCell(i, j); \n\t\t\t}\n\t\t\treturn total;\n\t\t}\n// VERIFIE SI IL Y A UN GAGNANT DANS DIFFERENTES DIRECTIONS !!\n\t\tfunction checkWin(directionA, directionB){\n\t\t\tconst total = 1 + checkDirection(directionA) + checkDirection(directionB);\n\t\t\tif(total >=4){ \n\t\t\t\treturn that.player;\n\t\t\t}else{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n// HORIZONTALE C'EST LES COLONNES !!\n\t\tfunction checkHorizontale(){\n\t\t\treturn checkWin({i : 0, j: -1}, {i : 0, j: 1});\n\t\t}\n// VERTICALE C'EST LES LIGNES !!\n\t\tfunction checkVerticale(){\n\t\t\treturn checkWin({i : -1, j: 0}, {i : 1, j: 0});\n\t\t}\n// DIAGONALE DANS UN SENS !!\n\t\tfunction checkDiagonale1(){\n\t\t\treturn checkWin({i : 1, j: 1}, {i : -1, j: -1});\n\t\t}\n// DIAGONALE DANS L'AUTRE SENS !! \n\t\tfunction checkDiagonale2(){\n\t\t\treturn checkWin({i : 1, j: -1}, {i : -1, j: 1});\n\t\t}\n\t\treturn checkHorizontale() || checkVerticale() || checkDiagonale1() || checkDiagonale2();\n\t}", "title": "" }, { "docid": "226d0340395348cca78d7468927dfd37", "score": "0.6168391", "text": "function horizontalWinCheck() {\n for (var row = 0; row < 6; row++) {\n for (var col = 0; col < 4; col++) {\n if (\n colorMatchCheck(\n returnColor(row, col),\n returnColor(row, col + 1),\n returnColor(row, col + 2),\n returnColor(row, col + 3)\n )\n ) {\n console.log(\"horiz\");\n return true;\n } else {\n continue;\n }\n }\n }\n}", "title": "" }, { "docid": "45cc5beb6fac415c0ac68f5273efb173", "score": "0.6163026", "text": "function isLineWin(matrix){\n\n}", "title": "" }, { "docid": "90a54ac578089f8f6e20a994c557cc2d", "score": "0.615188", "text": "function checkBottom(xCor, yCor){\n // Declaration and initialization of arrray\n var winning = new Array();\n for(var i = 0; i < winSteak; i++){\n winning[i] = i;\n }\n for(var k = 0; k < winSteak; k++){\n winning[k] = gameMatrix[xCor][yCor+k];\n }\n var retVal = true;\n for(var i = 1; i < winSteak; i++){\n if(winning[i] == '-1'){\n retVal = false;\n return retVal;\n }\n else{\n if(winning[i] != winning[(i-1)] ){\n retVal = false;\n }\n }\n }\n return retVal;\n}", "title": "" }, { "docid": "31624934bbb12b4d174c85b9d31bf172", "score": "0.61503565", "text": "function checkWin() {\n if (\n searchForFourConsecutiveDiscsHorizontally(horizontally) \n || searchForFourConsecutiveDiscsVertically(vertically) \n || searchForFourConsecutiveDiscsDiagonallyUpRight(diagonallyUpRight)\n || searchForFourDiagonallyLeft(diagonallyUpLeft)\n ) {\n addWinMessage();\n winCondition = true;\n }\n}", "title": "" }, { "docid": "8f42ebc7f8a2cc46b60cdbffaa1334f9", "score": "0.61484635", "text": "checkForWin(row, col) {\n let count = 1; // number in a row\n let currRow = row;\n let currCol = col;\n\n // check south\n currRow++;\n while (this.validCount(currRow, currCol)) {\n count++;\n currRow++;\n }\n if (count >= 4) {\n return true;\n }\n\n // check NE and SW\n count = 1;\n // NE\n currRow = row - 1;\n currCol = col + 1;\n while (this.validCount(currRow, currCol)) {\n count++;\n currRow--;\n currCol++;\n }\n // SW\n currRow = row + 1;\n currCol = col -1;\n while (this.validCount(currRow, currCol)) {\n count++;\n currRow++;\n currCol--;\n }\n if (count >= 4) {\n return true;\n }\n\n // check east west\n count = 1;\n // east\n currRow = row;\n currCol = col + 1;\n while (this.validCount(currRow, currCol)) {\n count++;\n currCol++;\n }\n // west\n currCol = col - 1;\n while (this.validCount(currRow, currCol)) {\n count++;\n currCol--;\n }\n if (count >= 4) {\n return true;\n }\n\n // check SE and NW\n count = 1;\n // SE\n currRow = row + 1;\n currCol = col + 1;\n while (this.validCount(currRow, currCol)) {\n count++;\n currCol++;\n currRow++;\n }\n // NW\n currRow = row - 1;\n currCol = col - 1;\n while (this.validCount(currRow, currCol)) {\n count++;\n currRow--;\n currCol--;\n }\n if (count >= 4) {\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "c722d2ba666aa7a2110107fafa0d551e", "score": "0.61475265", "text": "currentState() {\n let m = this.moves;\n let winner = 0;\n [-1, 1].forEach(function (p) {\n for (let i = 0; i < 3; i++) {\n // Check vertical\n if (m[i] == p && m[i + 3] == p && m[i + 6] == p) winner = p;\n // Check horizontal\n if (m[3 * i] == p && m[3 * i + 1] == p && m[3 * i + 2] == p) winner = p;\n }\n // Check diagonal like \\\n if (m[0] == p && m[4] == p && m[8] == p) winner = p;\n // Check diagonal like /\n if (m[2] == p && m[4] == p && m[6] == p) winner = p;\n });\n return winner;\n }", "title": "" }, { "docid": "aabbcde5c6f118aef374460bdae0200c", "score": "0.61465746", "text": "function checkWin(col, row, localBoard) {\n let p1Score = 0;\n let p2Score = 0;\n \n //Horizontal Win\n for (let i = 0; i < cols; i++) {\n if (localBoard[i][row] === P1) {\n p1Score++;\n if (p1Score >= WINNUMBER) {\n return P1\n }\n } else {\n p1Score = 0;\n if (localBoard[i][row] === P2) {\n p2Score++;\n if (p2Score >= WINNUMBER) {\n return P2\n }\n } else {\n p2Score = 0;\n }\n }\n }\n\n p1Score =0;\n p2Score =0;\n\n //vertical\n for (let i = 0; i < rows; i++) {\n if (localBoard[col][i] === P1) {\n p1Score++;\n if (p1Score >= WINNUMBER) {\n return P1\n }\n } else {\n p1Score = 0;\n if (localBoard[col][i] === P2) {\n p2Score++;\n if (p2Score >= WINNUMBER) {\n return P2\n }\n } else {\n p2Score = 0;\n }\n }\n }\n\n \n //Diagnol win - first transpose matrix\n let count = 0;\n const diagBoard = [];\n localBoard.flat().forEach((circle) => {\n const column = count % localBoard[0].length;\n if (count <localBoard[0].length) {\n diagBoard.push([]);\n }\n diagBoard[column].unshift(`${circle}`);\n count += 1;\n });\n\n //Diaganol win\n for (let row = 0; row < diagBoard.length - WINNUMBER + 1; row += 1) {\n let leftCounter = 0;\n let rightCounter = diagBoard[0].length - 1;\n // loop over columns\n for (let column = 0; column < diagBoard[0].length - WINNUMBER + 1; column += 1) {\n // if a colour is encountered\n if (diagBoard[row][leftCounter] !== \"empty\") {\n winner = diagBoard[row][leftCounter];\n for (let i = 0; i < WINNUMBER; i += 1) {\n if (i === WINNUMBER - 1) {\n return winner;\n }\n // if there is WINNUMBER in a diagonal down to the right return the winner\n if (diagBoard[row + i][leftCounter + i] !== diagBoard[row + i + 1][leftCounter + i + 1]) {\n break;\n }\n }\n }\n // if a colour is encountered\n if (diagBoard[row][rightCounter] !== \"empty\") {\n winner = diagBoard[row][rightCounter];\n for (let i = 0; i < WINNUMBER; i += 1) {\n if (i === WINNUMBER - 1) {\n return winner;\n }\n // if there is WINNUMBER in a diagonal down to the left return the winner\n if (diagBoard[row + i][rightCounter - i] !== diagBoard[row + i + 1][rightCounter - i - 1]) {\n break;\n }\n }\n }\n // increment counters to test for diagonals to the left and right\n leftCounter += 1;\n rightCounter -= 1;\n }\n }\n\n //if no winner\n return NOWIN;\n}", "title": "" }, { "docid": "caa6a91268295f7702aa17883c8c8a6b", "score": "0.6132775", "text": "function gameOver(onWin, onLose){\n if(outsideLimits() || maze[currentPos[1]][currentPos[0]] === 0) {\n onLose();\n return true;\n }else if(directions.length === 0){\n if(maze[currentPos[1]][currentPos[0]] === 3) { \n onWin();\n return true;\n }else{\n onLose();\n return true;\n }\n }else{\n return false;\n }\n}", "title": "" }, { "docid": "cf9749afdd0b4a7eefd410ea5e535a30", "score": "0.6119955", "text": "function checkDiagRightUp() {\n\tvar sym = getCur();\n\tfor (var i = 3; i < board.length; i++) {\n\t\tfor (var j =0; j < board[i].length - 3; j++) {\n\t\t\tif ( (board[i][j] == board[i-1][j+1]) &&\n\t\t\t\t (board[i][j] == board[i-2][j+2]) &&\n\t\t\t\t (board[i][j] == board[i-3][j+3]) &&\n\t\t\t\t (board[i][j] == sym))\n\t\t\t\t\t{ showWinner(); playVid(); return true }\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "dd7a8af0e076f48860c3a35581d4fe6d", "score": "0.6118278", "text": "function check_winner(row, col) {\n // check row\n for (var i = 0; i < size; i++) {\n if (position[row][i] !== currentPlayer) {\n break;\n }\n if (i == size - 1) {\n winner = currentPlayer;\n return;\n }\n }\n\n // check column\n for (var i = 0; i < size; i++) {\n if (position[i][col] != currentPlayer) {\n break;\n }\n if (i == size - 1) {\n winner = currentPlayer;\n return\n }\n }\n\n // check diagnal\n if (row == col) {\n for (var i = 0; i < size; i++) {\n if (position[i][i] != currentPlayer) {\n break;\n }\n if (i == size - 1) {\n winner = currentPlayer;\n return;\n }\n }\n }\n \n // check anti-diaganal\n if (row + col == size - 1) {\n for (var i = 0; i < size; i++) {\n if (position[i][size - 1 - i] != currentPlayer) {\n break;\n }\n if (i == size - 1) {\n winner = currentPlayer;\n return;\n }\n }\n }\n}", "title": "" }, { "docid": "6c5ed28dfe3f419e01c4b5a21401cbff", "score": "0.6113625", "text": "function getWinner() {\n\n var sum = 0;\n $scope.game.winner = 0;\n\n //win row by starting with 0 and mult time 3.\n for (var row = 0; row < 3; row++) {\n sum = $scope.game.board[row * 3] + $scope.game.board[row * 3 + 1] + $scope.game.board[row * 3 + 2];\n $scope.game.winner = checkWinner(sum);\n if ($scope.game.winner) {\n vegasWinner();\n return $scope.game.winner;\n }\n }\n //going down by bye bye\n for (var col = 0; col < 3; col++) {\n sum = $scope.game.board[col] + $scope.game.board[col + 3] + $scope.game.board[col + 6];\n $scope.game.winner = checkWinner(sum);\n if ($scope.game.winner) {\n vegasWinner();\n return $scope.game.winner;\n }\n }\n\n //only 2 way's to win diag so just need to specify the cellIndex.\n sum = $scope.game.board[0] + $scope.game.board[4] + $scope.game.board[8];\n $scope.game.winner = checkWinner(sum);\n if ($scope.game.winner) {\n vegasWinner();\n return $scope.game.winner;\n }\n\n //only 2 way's to win diag so just need to specify the cellIndex.\n sum = $scope.game.board[6] + $scope.game.board[4] + $scope.game.board[2];\n $scope.game.winner = checkWinner(sum);\n if ($scope.game.winner) {\n vegasWinner();\n return $scope.game.winner;\n }\n\n //everytime a person makes a move add 1.\n $scope.game.moveCount++;\n //if movecount = 9 then we get a draw because no more move to be made\n if ($scope.game.moveCount === 9) {\n $scope.game.winnerDisplay = \"Draw\";\n\n }\n //no one won and nothing happened\n return 0;\n }", "title": "" }, { "docid": "accfbc8443dfca8e6ef84d9509ebc2cc", "score": "0.6100594", "text": "checkEndWin() {\n if (this.y <= 50) {\n this.score += 1;\n this.y = height - 30;\n }\n }", "title": "" }, { "docid": "bf13ce4edad679657a318243350342d9", "score": "0.60973746", "text": "function checkFinished(board) {\n var i, j, winner;\n\n\t// TODO rewrite this function to be dynamic so that it works with any board size\n\n function sameNotNullHorizontal(i){\n return board[i][0].v === board[i][1].v &&\n board[i][1].v === board[i][2].v &&\n board[i][0].v;\n }\n for(i = 0; i < board.length; i++){\n if(sameNotNullHorizontal(i)){\n winner = board[i][0].v;\n }\n }\n\n function sameNotNullVertical(j){\n return board[0][j].v === board[1][j].v &&\n board[1][j].v === board[2][j].v &&\n board[0][j].v;\n }\n for(j = 0; j < board.length; j++){\n if(sameNotNullVertical(j)){\n winner = board[0][j].v;\n }\n }\n\n if(board[0][0].v &&\n board[0][0].v === board[1][1].v &&\n board[1][1].v === board[2][2].v\n ){\n winner = board[1][1].v;\n }\n\n if(board[0][2].v &&\n board[0][2].v === board[1][1].v &&\n board[1][1].v === board[2][0].v\n ){\n winner = board[1][1].v;\n }\n\n if(!winner){\n //check for a draw\n var allFull = true;\n for(i = 0; i < board.length; i++){\n for(j = 0; j < board[i].length; j++){\n if(!board[i][j].v){\n allFull = false;\n break;\n }\n }\n }\n if(allFull){\n return DRAW;\n }\n }\n\n return winner;\n}", "title": "" }, { "docid": "948b8ac40a0f4b736d2645dd3ca5bd71", "score": "0.609674", "text": "function checkWin() {\n // check rows for wins\n board.forEach((row) => {\n const rowWin = row[0] + row[1] + row[2];\n if (rowWin === 'XXX' || rowWin === 'OOO') win = true;\n });\n // check columsn for win\n for (let i = 0; i < board.length; i += 1) {\n const columnWin = board[0][i] + board[1][i] + board[2][i];\n if (columnWin === 'XXX' || columnWin === 'OOO') win = true;\n }\n // check diagonal for win\n const diaDown = board[0][0] + board[1][1] + board[2][2];\n const diaUp = board[0][2] + board[1][1] + board[2][0];\n if (diaDown === 'XXX' || diaDown === 'OOO') win = true;\n else if (diaUp === 'XXX' || diaUp === 'OOO') win = true;\n // check tie\n if (checkTie()) ui.displayGameEnd('tie');\n // display win\n if (win) ui.displayGameEnd('win');\n}", "title": "" }, { "docid": "158245262b43ad26c45d7652c9d0e1c0", "score": "0.6092819", "text": "function compCheckRight(xCor, yCor, winOn) {\n var retVal = false;\n if (xCor < boardsize && yCor < boardsize && xCor + (winOn - 1) < boardsize) {\n // Declaration and initialization of arrray\n var winning = new Array();\n for (var i = 0; i < winOn; i++) {\n winning[i] = i;\n }\n for (var k = 0; k < winOn; k++) {\n winning[k] = gameMatrix[xCor+k][yCor];\n }\n retVal = true;\n for (var i = 1; i < winOn; i++) {\n // if (winOn == 1 && winning[i] == playerWM) {\n // retVal = true;\n // return retVal;\n // }\n if (winning[i] == '-1') {\n retVal = false;\n return retVal;\n }\n else {\n if (winning[i] != winning[(i - 1)]) {\n retVal = false;\n }\n }\n }\n \n }\n return retVal;\n}", "title": "" }, { "docid": "8bbc4758623cad573ae9b0405864254e", "score": "0.60914546", "text": "checkVictory() {\n var cells = this.cells;\n\n this.findLegalMoves()\n\n function isMatch(a,b,c,d) {\n return (a|b|c|d) !== -1 && (((a&b&c&d) !== 0) || ((a|b|c|d) !==15))\n }\n\n function checkLine(x,y,dx,dy) {\n return isMatch(\n cells[x ][y ],\n cells[x+ dx][y+ dy],\n cells[x+2*dx][y+2*dy],\n cells[x+3*dx][y+3*dy])\n }\n\n function checkSquare(x,y) {\n return isMatch(\n cells[x ][y ],\n cells[x ][y+1],\n cells[x+1][y ],\n cells[x+1][y+1])\n }\n\n //check rows and cols\n for (var i=0; i<4; i++) {\n if (checkLine(i,0,0,1)) {this.winner=this.turn; return;}\n if (checkLine(0,i,1,0)) {this.winner=this.turn; return;}\n }\n\n //check diags\n if (checkLine(0,0,1,1)) {this.winner=this.turn; return;}\n if (checkLine(3,0,-1,1)) {this.winner=this.turn; return;}\n\n //check squares\n if (this.matchSquares) {\n for (var x=0; x<3; x++) {\n for (var y=0; y<3; y++) {\n if (checkSquare(x,y)) {this.winner=this.turn; return;}\n }\n }\n }\n\n if (this.legalMoves.length === 0) {\n this.winner = -1;\n return;\n }\n }", "title": "" }, { "docid": "cf80e221d148566afea8ac28cea5fbf7", "score": "0.60893", "text": "function canRoverMoveBackInY() {\n switch (rover.y) {\n case 0:\n if (rover.direction === \"N\") {\n moveBackward();\n } else {\n console.log(\"You can go out of the grid\");\n console.log(\"Actual position x = \" + rover.x + \" y = \" + rover.y);\n }\n break;\n\n case 9:\n if (rover.direction === \"S\") {\n moveBackward();\n } else {\n console.log(\"You can go out of the grid\");\n console.log(\"Actual position x = \" + rover.x + \" y = \" + rover.y);\n }\n break;\n\n default:\n moveBackward();\n }\n}", "title": "" }, { "docid": "0374bac738af08a2421c03118c3b2718", "score": "0.6079738", "text": "evaluate() {\r\n if(this.isEmpty()) return 0;\r\n\r\n //checking for horizontal wins\r\n if(this.grid[0][0] == this.grid[0][1] && this.grid[0][0] == this.grid[0][2] && this.grid[0][0]) {\r\n this.win_row = 1;\r\n this.win_direction = 'H';\r\n if(this.grid[0][0] == 'x')\r\n return 10;\r\n else\r\n return -10;\r\n }\r\n if(this.grid[1][0] == this.grid[1][1] && this.grid[1][0] == this.grid[1][2] && this.grid[1][0]) {\r\n this.win_row = 2;\r\n this.win_direction = 'H';\r\n if(this.grid[1][0] == 'x')\r\n return 10;\r\n else\r\n return -10;\r\n }\r\n if(this.grid[2][0] == this.grid[2][1] && this.grid[2][0] == this.grid[2][2] && this.grid[2][0]) {\r\n this.win_row = 3;\r\n this.win_direction = 'H';\r\n if(this.grid[2][0] == 'x')\r\n return 10;\r\n else\r\n return -10;\r\n }\r\n\r\n //checking for vertical wins\r\n if(this.grid[0][0] == this.grid[1][0] && this.grid[0][0] == this.grid[2][0] && this.grid[0][0]) {\r\n this.win_row = 1;\r\n this.win_direction = 'V';\r\n if(this.grid[0][0] == 'x')\r\n return 10;\r\n else\r\n return -10;\r\n }\r\n if(this.grid[0][1] == this.grid[1][1] && this.grid[0][1] == this.grid[2][1] && this.grid[0][1]) {\r\n this.win_row = 2;\r\n this.win_direction = 'V';\r\n if(this.grid[0][1] == 'x')\r\n return 10;\r\n else\r\n return -10;\r\n }\r\n if(this.grid[0][2] == this.grid[1][2] && this.grid[0][2] == this.grid[2][2] && this.grid[0][2]) {\r\n this.win_row = 3;\r\n this.win_direction = 'V';\r\n if(this.grid[0][2] == 'x')\r\n return 10;\r\n else\r\n return -10;\r\n }\r\n\r\n //checking for diagonal wins\r\n if(this.grid[0][0] == this.grid[1][1] && this.grid[0][0] == this.grid[2][2] && this.grid[0][0]) {\r\n this.win_row = 1;\r\n this.win_direction = 'D';\r\n if(this.grid[0][0] == 'x')\r\n return 10;\r\n else\r\n return -10; \r\n }\r\n if(this.grid[0][2] == this.grid[1][1] && this.grid[0][2] == this.grid[2][0] && this.grid[0][2]) {\r\n this.win_row = 2;\r\n this.win_direction = 'D';\r\n if(this.grid[0][2] == 'x')\r\n return 10;\r\n else\r\n return -10; \r\n }\r\n\r\n return 0;\r\n }", "title": "" }, { "docid": "9fd06ba599ed696e94357ff124adcafc", "score": "0.6077439", "text": "function checkWin(grid) {\n\n let flatGrid = grid.flat();\n\n let tie = flatGrid.filter((ele) => ele === ' ')\n\n if (tie.length === 0) {\n return 'T';\n }\n\n let winningConditions = [\n [0,1,2],\n [3,4,5],\n [6,7,8],\n [0,3,6],\n [1,4,7],\n [2,5,8],\n [0,4,8],\n [2,4,6]\n ];\n\n for (let i = 0; i <= 7; i++) {\n const winCondition = winningConditions[i];\n let a = flatGrid[winCondition[0]];\n let b = flatGrid[winCondition[1]];\n let c = flatGrid[winCondition[2]];\n\n if (a === ' ' || b === ' ' || c === ' ') {\n continue;\n }\n\n if (a === b && b === c) {\n if (a === 'X') {\n return 'X';\n } \n if (a === 'O') {\n return 'O';\n }\n }\n }\n \n return false;\n\n}", "title": "" }, { "docid": "72d4d0724a33714c9afed2bfefd517eb", "score": "0.6076854", "text": "function isWin() {\n\tboard.tiles.forEach(function (tile) {\n\t\tif (tile && tile.val === 2048) {\n\t\t\treturn true;\n\t\t}\n\t});\n\n\treturn false;\n}", "title": "" }, { "docid": "cc8e183d65ccfe34980e7e1dd6bc2684", "score": "0.60730284", "text": "function horizontalWin() {\n if(\n (board[0][0] === playerTurn && board[0][1]=== playerTurn && board[0][2] === playerTurn) ||\n (board[1][0] === playerTurn && board[1][1]=== playerTurn && board[1][2] === playerTurn) ||\n (board[2][0] === playerTurn && board[2][1]=== playerTurn && board[2][2] === playerTurn)){\n return true\n }\n }", "title": "" }, { "docid": "8c1fbe39cc937d85e51493282157d54a", "score": "0.6066019", "text": "isTerminal() {\n //Return False if board in empty\n if (this.isEmpty()) return false;\n //Checking Horizontal Wins\n if (this.state[0] === this.state[1] && this.state[0] === this.state[2] && this.state[0]) {\n return { winner: this.state[0], direction: \"row 1\" };\n }\n if (this.state[3] === this.state[4] && this.state[3] === this.state[5] && this.state[3]) {\n return { winner: this.state[3], direction: \"row 2\"};\n }\n if (this.state[6] === this.state[7] && this.state[6] === this.state[8] && this.state[6]) {\n return { winner: this.state[6], direction: \"row 3\" };\n }\n\n //Checking Vertical Wins\n if (this.state[0] === this.state[3] && this.state[0] === this.state[6] && this.state[0]) {\n return { winner: this.state[0], direction: \"column 1\" };\n }\n if (this.state[1] === this.state[4] && this.state[1] === this.state[7] && this.state[1]) {\n return { winner: this.state[1], direction: \"column 2\" };\n }\n if (this.state[2] === this.state[5] && this.state[2] === this.state[8] && this.state[2]) {\n return { winner: this.state[2], direction: \"column 3\" };\n }\n\n //Checking Diagonal Wins\n if (this.state[0] === this.state[4] && this.state[0] === this.state[8] && this.state[0]) {\n return { winner: this.state[0], direction: \"main diagonal\" };\n }\n if (this.state[2] === this.state[4] && this.state[2] === this.state[6] && this.state[2]) {\n return { winner: this.state[2], direction: \"counter diagonal\" };\n }\n\n //If no winner but the board is full, then it's a draw\n if (this.isFull()) {\n return { winner: \"draw\" };\n }\n\n //return false otherwise\n return false;\n }", "title": "" }, { "docid": "f543b37aaf6dea3c49e249b86cb7e627", "score": "0.606587", "text": "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n\n // TODO: read and understand this code. Add comments to help you.\n/**\n * Short and sweet explanation\n * horiz, vert, diagDR, and diagDL are some form of 4 \"boxes\" in a row\n * either horizontally starting from 0 going to 6 or vertical starting from 0 going to 5\n * or diagnal from the R (DR) or diagnal from the left (DL)\n * these cells are checked 43 times in a sense HEIGHT * WIDTH of the board\n * to see if any 4 boxes have an ID that is the same as the current players number \n * either 0 or 1\n */\n for (var y = 0; y < HEIGHT; y++) {\n for (var x = 0; x < WIDTH; x++) {\n var horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n var vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n var diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n var diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n}", "title": "" }, { "docid": "6a9a686a681d97a4d84bb6ab43e36944", "score": "0.6059723", "text": "function checkWinner(board, player, theory) {\n const diagDownEqual = (board, player) => {\n if (board[0][0] === player && board[0][0] === board[1][1] && board[0][0] === board[2][2]) {\n if (theory !== 'yes') {\n //if theory = \"yes\", AI is calculating best move and therefore winning highlight should not be applied.\n for (let i = 0; i < 3; i++) {\n let cell = document.getElementById(`${i}${i}`);\n cell.classList.add(`cell-win-${player}`);\n }\n return true;\n }\n return true;\n }\n };\n\n const diagUpEqual = (board, player) => {\n if (board[0][2] === player && board[0][2] === board[1][1] && board[0][2] === board[2][0]) {\n if (theory !== 'yes') {\n //if theory = \"yes\", AI is calculating best move and therefore winning highlight should not be applied.\n let cells = [];\n cells.push(document.getElementById(`02`));\n cells.push(document.getElementById(`11`));\n cells.push(document.getElementById(`20`));\n for (let i = 0; i < 3; i++) {\n cells[i].classList.add(`cell-win-${player}`);\n }\n return true;\n }\n return true;\n }\n };\n\n const rowEqual = function (board, player) {\n const xCheck = (board, player) => board.every((val) => val === player);\n for (i = 0; i < board.length; i++) {\n if (xCheck(board[i], player)) {\n if (theory !== 'yes') {\n //if theory = \"yes\", AI is calculating best move and therefore winning highlight should not be applied.\n for (j = 0; j < board[i].length; j++) {\n let cell = document.getElementById(`${i}${j}`);\n cell.classList.add(`cell-win-${player}`);\n }\n return true;\n }\n return true;\n }\n }\n return false;\n };\n\n const columnEqual = function (board, player) {\n for (let i = 0; i < board[0].length; i++) {\n if (board[0][i] === player && board[0][i] === board[1][i] && board[0][i] === board[2][i]) {\n if (theory !== 'yes') {\n //if theory = \"yes\", AI is calculating best move and therefore winning highlight should not be applied.\n for (let j = 0; j < board[0].length; j++) {\n let cell = document.getElementById(`${j}${i}`);\n cell.classList.add(`cell-win-${player}`);\n }\n return true;\n }\n return true;\n }\n }\n return false;\n };\n\n if (diagUpEqual(board, player) || diagDownEqual(board, player) || rowEqual(board, player) || columnEqual(board, player)) {\n return true;\n } else return false;\n }", "title": "" }, { "docid": "b9c8cd04609b044e7fa0984ac726053d", "score": "0.60475636", "text": "checkGameWin(){\n if (this.y <=-15)\n {\n this.winGame();\n }\n }", "title": "" }, { "docid": "55ca6bf59dff3ba41c2c7b5d0c1be7ec", "score": "0.6043757", "text": "check_win() {\n return (\n this._player[0] === this._end_point[0] &&\n this._player[1] === this._end_point[1]\n );\n }", "title": "" }, { "docid": "70115a97faf9951d0911b009b2a0d99d", "score": "0.6043386", "text": "function getWinner() {\n if (!$scope.game) {\n return;\n }\n var boxes = $scope.game.board;\n //get winner function by row (0,1,2) (3,4,5) (6,7,8). Lock off can move if winner.\n for (var row = 0; row < 3; row++) {\n var sum = boxes[row * 3] + boxes[row * 3 + 1] + boxes[row * 3 + 2];\n var winner = checkWinner(sum);\n if (winner) {\n $scope.canMove = false;\n\n }\n }\n // column (0,3,6) (1,4,7) (2,5,8). Lock off can move if winner.\n for (var col = 0; col < 3; col++) {\n var sum = boxes[col] + boxes[col + 3] + boxes[col + 6];\n winner = checkWinner(sum);\n if (winner) {\n $scope.canMove = false;\n }\n }\n // and both diagonals (0,4,8) (6,4,8). Lock off can move if winner.\n var sum = boxes[0] + boxes[4] + boxes[8];\n winner = checkWinner(sum);\n if (winner) {\n $scope.canMove = false;\n }\n\n var sum = boxes[6] + boxes[4] + boxes[2];\n winner = checkWinner(sum);\n if (winner) {\n $scope.canMove = false;\n }\n\n else {\n return \"\";\n\n }\n\n }", "title": "" }, { "docid": "ecf3ce0ecc4bdeb1d3ea61cb62c7f040", "score": "0.6038628", "text": "function horizontalWin () {\n return ($('[data-cell=\"0\"]').text() === playerTurn && $('[data-cell=\"1\"]').text() === playerTurn && $('[data-cell=\"2\"]').text() === playerTurn)||\n ($('[data-cell=\"3\"]').text() === playerTurn && $('[data-cell=\"4\"]').text() === playerTurn && $('[data-cell=\"5\"]').text() === playerTurn)||\n ($('[data-cell=\"6\"]').text() === playerTurn && $('[data-cell=\"7\"]').text() === playerTurn && $('[data-cell=\"8\"]').text() === playerTurn);\n }", "title": "" }, { "docid": "f16ffab3573dca3a8e943ae20197e976", "score": "0.60337895", "text": "checkForWin(y, x) {\n for(let [r1,c1, r2,c2] of [[-1,-1,1,1],[-1,0,1,0],[-1,1,1,-1],[0,1,0,-1]]) { \n let cnt = 1; \n cnt += this.checkForWinHelper(y + r1, x + c1, r1, c1);\n cnt += this.checkForWinHelper(y + r2, x + c2, r2, c2); \n if(cnt >= 4) return true; \n } \n return false;\n }", "title": "" }, { "docid": "d97386d6b046f5f3fde952020d1b1458", "score": "0.6033049", "text": "function playerWinner(tile) {\n\t\t//check for first row horizontal win\n\t\tif ($(\"span#span1\").html() == tile && $(\"span#span2\").html() == tile && $(\"span#span3\").html() == tile) {\n\t\t\treturn true\n\t\t}\n\t\t//check for second row horizontal win\n\t\telse if ($(\"span#span4\").html() == tile && $(\"span#span5\").html() == tile && $(\"span#span6\").html() == tile) {\n\t\t\treturn true\n\t\t}\n\t\t//check for third row horizontal win\n\t\telse if ($(\"span#span7\").html() == tile && $(\"span#span8\").html() == tile && $(\"span#span9\").html() == tile) {\n\t\t\treturn true\n\t\t}\n\t\t//check for first horizontal win\n\t\telse if ($(\"span#span1\").html() == tile && $(\"span#span4\").html() == tile && $(\"span#span7\").html() == tile) {\n\t\t\treturn true\n\t\t}\n\t\t//check for second horizontal win\n\t\telse if ($(\"span#span2\").html() == tile && $(\"span#span5\").html() == tile && $(\"span#span8\").html() == tile) {\n\t\t\treturn true\n\t\t}\n\t\t//check for third horizontal win\n\t\telse if ($(\"span#span3\").html() == tile && $(\"span#span6\").html() == tile && $(\"span#span9\").html() == tile) {\n\t\t\treturn true\n\t\t}\n\t\t//check for first diagonal win\n\t\telse if ($(\"span#span1\").html() == tile && $(\"span#span5\").html() == tile && $(\"span#span9\").html() == tile) {\n\t\t\treturn true\n\t\t}\n\t\t//check for third horizontal win\n\t\telse if ($(\"span#span3\").html() == tile && $(\"span#span5\").html() == tile && $(\"span#span7\").html() == tile) {\n\t\t\treturn true\n\t\t}\n\t\telse {\n\t\t\treturn false\n\t\t}\n\t}", "title": "" }, { "docid": "060d351c1c108b59a4c95c0dbecf9738", "score": "0.6028158", "text": "function didWin(){\n if (JSON.stringify(BOARD) === JSON.stringify(PUZZLE.solutionGrid)){\n console.log('nice');\n // $('body').off(handleMove);\n } else{\n console.log('no good');\n console.log(PUZZLE.solutionGrid);\n }\n}", "title": "" }, { "docid": "8072dd3213aed85a5b194eb3437b300a", "score": "0.602781", "text": "function checkForWin() {\n // function _win(cells) {\n // // Check four cells to see if they're all color of current player\n // // - cells: list of four (y, x) cells\n // // - returns true if all are legal coordinates & all match currPlayer\n\n // return cells.every(\n // ([y, x]) =>\n // y >= 0 &&\n // y < HEIGHT &&\n // x >= 0 &&\n // x < WIDTH &&\n // board[y][x] === currPlayer\n // );\n // }\n\n // // TODO: read and understand this code. Add comments to help you.\n\n // for (let y = 0; y < HEIGHT; y++) {\n // for (let x = 0; x < WIDTH; x++) {\n // let horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n // let vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n // let diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n // let diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n\n // if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n // return true;\n // }\n // }\n // }\n\n // let tie = [null, null, null, null];\n // find the first cell which is not empty\n\n for (let b = 0; b < HEIGHT; b++){\n for (let a = 0; a < WIDTH; a++){\n\n let dir1;\n let dir2;\n let dir3;\n let dir4;\n\n try {\n dir1 = [board[a][b], board[a][b+1], board[a][b+2], board[a][b+3]];\n } catch (TypeError){\n dir1 = [null];\n }\n\n try {\n dir2 = [board[a][b], board[a+1][b-1], board[a+2][b-2], board[a+3][b-3]];\n } catch (TypeError){\n dir2 = [null];\n }\n\n try {\n dir3 = [board[a][b], board[a+1][b], board[a+2][b], board[a+3][b]];\n } catch (TypeError){\n dir3 = [null];\n }\n\n try {\n dir4 = [board[a][b], board[a+1][b+1], board[a+2][b+2], board[a+3][b+3]];\n } catch (TypeError){\n dir4 = [null];\n }\n\n let allDirs = [dir1, dir2, dir3, dir4];\n let checktie = allDirs.some(dir => dir.every(val => val === currPlayer));\n if (checktie){\n return true;\n }\n }\n }\n}", "title": "" }, { "docid": "2cade665858052abbda10b52bc523269", "score": "0.60275215", "text": "function checkWin() {\n let elements = $('.game_cell_hidden:has(.fa-flag)');\n let userWin = true;\n elements.each(function () {\n let rowIndex = $(this).parent().data('row-index');\n let cellIndex = $(this).data('cell-index');\n if (GAME_MODULE.gameMap[rowIndex][cellIndex] !== -1) {\n userWin = false;\n return;\n }\n });\n if (userWin) {\n GAME_MODULE.endGameForWinner();\n }\n}", "title": "" }, { "docid": "d0eb34990830575f9ddfcaf05761d59f", "score": "0.6026391", "text": "winner() {\n // Check columms and rows\n var cols = [0,1,2];\n var rows = [0,3,6];\n for (let i=0; i<3; i++){\n var k = cols[i]\n if (this.winningSeq(k,k+3,k+6)) {\n return this.prevPlayer();\n }\n var j = rows[i]\n if (this.winningSeq(j,j+1,j+2)) {\n return this.prevPlayer();\n } \n }\n // Check diagonals\n if (this.winningSeq(0,4,8)){\n return this.prevPlayer();\n }\n if (this.winningSeq(2,4,6)){\n return this.prevPlayer();\n }\n return null;\n }", "title": "" } ]
2677449f9e68cbbdc71b8bf38d3dacd0
Function that develops main table cell
[ { "docid": "9b707d9de30bf6acabed3f9ed5a38b47", "score": "0.66381097", "text": "function devMainTable() {\n var div = document.getElementById('mainTable');\n var main_table = document.createElement('table');\n main_table.style.width = '100%';\n var main_row = document.createElement('tr');\n var main_cell = createCell('mainCell');\n // Start scoreboard structure\n main_cell.appendChild(devScoreboard());\n // append the rest to main\n main_row.appendChild(main_cell);\n main_table.appendChild(main_row);\n div.appendChild(main_table);\n}", "title": "" } ]
[ { "docid": "e22d71315c9f4af05e3c6dd00cde8e73", "score": "0.710905", "text": "function tableCell(table_data, index, type) {\n\tvar cell = '';\n\tif (type == 0) { //feature desc\n\t\tvar featClass = \"\";\n\t\t//Check if red or green class is needed for table color: Yes = green, No = red\n\t\tif (table_data.record[index].prod_feature_desc.localeCompare(\"Yes\") == 0) {\n\t\t\tfeatClass = \"green\";\n\t\t} else if (table_data.record[index].prod_feature_desc.localeCompare(\"No\") == 0) {\n\t\t\tfeatClass = \"red\";\n\t\t}\n\t\t//Check if popovers are needed for the cell\n\t\tif (table_data.record[index].more_info_link != undefined && table_data.record[index].more_info_link != \"\" && table_data.record[index].prod_feature_notes != undefined && table_data.record[index].prod_feature_notes != \"\") {\n\t\t\tcell = '<td class=\"' + featClass + '\">' + table_data.record[index].prod_feature_desc + infoPopover(table_data, index, 0) + linkPopover(tableData, index) + '</td>';\n\t\t} else if (table_data.record[index].prod_feature_notes != undefined && table_data.record[index].prod_feature_notes != \"\") {\n\t\t\tcell = '<td class=\"' + featClass + '\">' + table_data.record[index].prod_feature_desc + infoPopover(table_data, index, 0) + '</td>';\n\t\t} else if (table_data.record[index].more_info_link != undefined && table_data.record[index].more_info_link != \"\") {\n\t\t\tcell = '<td class=\"' + featClass + '\">' + table_data.record[index].prod_feature_desc + linkPopover(table_data, index) + '</td>';\n\t\t} else {\n\t\t\tcell = '<td class=\"' + featClass + '\">' + table_data.record[index].prod_feature_desc + '</td>';\n\t\t};\n\t} else if (type == 1) { //feature name (New Row is created here)\n\t\t//Check if popover is needed for next feature\n\t\tif (table_data.record[index].feature_desc != undefined && table_data.record[index].prod_feature_notes != \"\") {\n\t\t\tcell = '</tr><td>' + table_data.record[index].category_id + ',' + table_data.record[index].feature_id + '</td><td>' + table_data.record[index].feature_name + infoPopover(table_data, index, 1) + '</td>';\n\t\t} else {\n\t\t\tcell = '</tr><td>' + table_data.record[index].category_id + ',' + table_data.record[index].feature_id + '</td><td>' + table_data.record[index].feature_name + '</td>';\n\t\t};\n\t} else { //category title (New Row is created here)\n\t\t//Check if popover is needed for next category\n\t\tif (table_data.record[index].category_desc != undefined && table_data.record[index].prod_feature_notes != \"\") {\n\t\t\tcell = '<tr><td>' + table_data.record[index].category_id + ',' + table_data.record[index].category_id + '</td><td class=\"categoryTableColor\">' + table_data.record[index].category_title + infoPopover(table_data, index, 2) + '</td>' + cellSpan() + '</tr>';\n\t\t} else {\n\t\t\tcell = '<tr><td>' + table_data.record[index].category_id + ',' + table_data.record[index].category_id + '</td><td class=\"categoryTableColor\">' + table_data.record[index].category_title + '</td>' + cellSpan() + '</tr>';\n\t\t};\n\t};\n\treturn cell;\n}", "title": "" }, { "docid": "9663ae2ff87a74adc678f07494370916", "score": "0.6600075", "text": "displayContentCells() {\n const self = this;\n self.d3.o.cells = [];\n\n self.data.content.cells.forEach(function (row, row_index) {\n\n let r = self.d3.o.content.append(\"tr\");\n\n self.d3.o.cells[row_index] = [];\n\n row.forEach(function (cell, col_index) {\n let d3cell = r.append(\"td\")\n .style(\"min-width\", self.cell_px_width).style(\"max-width\", self.cell_px_width)\n .style(\"min-height\", self.cell_px_height).style(\"max-height\", self.cell_px_height);\n\n let d3_txt_area;\n\n if (isNaN(cell)) {\n d3_txt_area = self.addTextArea(d3cell, cell, self.colors.cellBorder);\n } else {\n d3_txt_area = self.addTextArea(d3cell, parseFloat(cell), self.colors.cellBorder, null, cell);\n }\n\n self.d3.o.cells[row_index].push(d3cell);\n\n\n d3cell.on(\"mouseenter\", function () {\n self.cellEntered(row_index, col_index);\n });\n d3cell.on(\"mouseleave\", function () {\n self.cellLeft(row_index, col_index);\n });\n\n // Note: the column index of cell, X, is matching the column header index X+1, because of the corner\n // the row index of cell, Y, is matching the row header index Y+1, because of the corner\n // Kept as-is for the moment\n self.addDataLinkEvent(self.data.content, d3_txt_area, col_index + 1, row_index + 1);\n\n });\n });\n }", "title": "" }, { "docid": "c4b43a19deac96bf0108e232ae4b8358", "score": "0.65598696", "text": "createNewCol(){\n for (let i=0; i<this.nodeBook.tbody.length+1; i++){\n if (!i) {\n let newTh = new ThEdit('Assignment ' + (this.nodeBook.thead.length-2).toString() + '&nbsp;&nbsp;&nbsp;&nbsp;');\n newTh.text = '-';\n newTh.cellClick('', newTh);\n this.addTh(newTh);\n } else {\n let newTd = new TdEdit();\n newTd.text = '-';\n newTd.cellClick('', newTd);\n this.nodeBook.tbody[i-1].addObjCell(newTd);\n }\n }\n\n }", "title": "" }, { "docid": "10699d3c58ffca8eff127245f8beaef7", "score": "0.64444226", "text": "createCell() {\r\n\r\n\t}", "title": "" }, { "docid": "5b39eec6f31002f46051c1eb5bebec1d", "score": "0.6422059", "text": "function generateTable(tblName, tdclass){\n // tblName=\"editTable\", \n // tdclass = \"dynamiCells\", \"floatingCells\"\n let tbl = document.getElementById(tblName);\n //\n // remove all rows and cells\n while(tbl.hasChildNodes()){\n tbl.removeChild(tbl.firstChild);\n }\n // create header row and cells\n let tr0 = document.createElement(\"tr\");\n let td00 = document.createElement(\"td\");\n let td01 = document.createElement(\"td\");\n let td02 = document.createElement(\"td\");\n let td03 = document.createElement(\"td\");\n let td04 = document.createElement(\"td\");\n let td05 = document.createElement(\"td\");\n let td06 = document.createElement(\"td\");\n let td07 = document.createElement(\"td\");\n let td08 = document.createElement(\"td\");\n let td09 = document.createElement(\"td\");\n\n // set the html content\n td00.innerHTML = \"Name\"; td00.className=tdclass;\n td01.innerHTML = \"x-pos\"; td01.className=tdclass;\n td02.innerHTML = \"y-pos\"; td02.className=tdclass;\n td03.innerHTML = \"length\"; td03.className=tdclass;\n td04.innerHTML = \"width\"; td04.className=tdclass;\n td05.innerHTML = \"height\"; td05.className=tdclass;\n td06.innerHTML = \"red\"; td06.className=tdclass;\n td07.innerHTML = \"green\"; td07.className=tdclass;\n td08.innerHTML = \"blue\"; td08.className=tdclass;\n td09.innerHTML = \"delete\"; td09.className=tdclass;\n // \n tr0.appendChild(td00);\n tr0.appendChild(td01);\n tr0.appendChild(td02);\n tr0.appendChild(td03);\n tr0.appendChild(td04);\n tr0.appendChild(td05);\n tr0.appendChild(td06);\n tr0.appendChild(td07);\n tr0.appendChild(td08);\n tr0.appendChild(td09);\n //\n tbl.appendChild(tr0);\n //\n for (let i = 0; i < OBJECT_ARRAY.length; i++) {\n let tr = document.createElement(\"tr\");\n let obj=OBJECT_ARRAY[i];\n //\n // create cells of table (columns)\n let tdN = document.createElement(\"td\"); //create a cell - column\n tdN.innerHTML=obj.name; // get the object name\n tdN.className=tdclass; // class name for style\n //\n tdX= document.createElement(\"td\");\n tdX.innerHTML=obj.x; // x coordinate of object\n tdX.className=tdclass; // class name for style\n //\n tdY= document.createElement(\"td\"); //create a cell - column\n tdY.innerHTML=obj.y; // y coordinate of object\n tdY.className=tdclass; // class name for style\n //\n tdL= document.createElement(\"td\");//create a cell - column\n tdL.innerHTML=obj.length; // length attribute of object\n tdL.className=tdclass; // class name for style\n //\n tdW= document.createElement(\"td\");//create a cell - column\n tdW.innerHTML=obj.width; //width attribute of object\n tdW.className=tdclass; // class name for style\n //\n tdH= document.createElement(\"td\");//create a cell - column\n tdH.innerHTML=obj.height; //height attribute of object\n tdH.className=tdclass; // class name for style\n //\n tdRe= document.createElement(\"td\");//create a cell - column\n tdRe.innerHTML=obj.re; //red attribute of object\n tdRe.className=tdclass; // class name for style\n //\n tdGr= document.createElement(\"td\");//create a cell - column\n tdGr.innerHTML=obj.gr; //green attribute of object\n tdGr.className=tdclass; // class name for style\n //\n tdBl= document.createElement(\"td\");//create a cell - column\n tdBl.innerHTML=obj.bl; //blue attribute of object\n tdBl.className=tdclass; // class name for style\n \n //\n var checkbox = document.createElement(\"INPUT\");\n checkbox.setAttribute(\"type\", \"checkbox\");\n tdR=document.createElement(\"td\");\n tdR.appendChild(checkbox);\n tdR.className=tdclass;\n //\n // append cells to row of table\n tr.appendChild(tdN);\n tr.appendChild(tdX);\n tr.appendChild(tdY);\n tr.appendChild(tdL);\n tr.appendChild(tdW);\n tr.appendChild(tdH);\n tr.appendChild(tdRe);\n tr.appendChild(tdGr);\n tr.appendChild(tdBl);\n tr.appendChild(tdR);\n //\n // editable or not\n if(tdclass=== \"dynamicCells\"){\n tdN.contentEditable = 'true';\n tdX.contentEditable = 'true';\n tdY.contentEditable = 'true';\n tdL.contentEditable = 'true';\n tdW.contentEditable = 'true';\n tdH.contentEditable = 'true';\n tdRe.contentEditable = 'true';\n tdGr.contentEditable = 'true';\n tdBl.contentEditable = 'true';\n tdR.contentEditable = 'true';\n // bind eventlistener and get value\n }\n //\n // add row to table\n tbl.appendChild(tr);\n }\n return tbl;\n}", "title": "" }, { "docid": "eb1b7181d356a5f6275f429a60ce529f", "score": "0.6334586", "text": "function outputTableRow(table, cellOne, cellTwo) {\r\n table += \"<tr><td>\" + cellOne + \"</td><td>\" + cellTwo + \"</td></tr>\";\r\n return table;\r\n}", "title": "" }, { "docid": "f3cdf0ef379a2ba87a99f07381538f73", "score": "0.6322377", "text": "function bar_create_datatable_cell(td, cellData, rowData, row, col) {\n\n title_text = cellData\n id = cellData\n percentage = rowData['percentage']||50\n color = 'danger'\n parent_identifier = null\n metric_text = percentage + \"%\"\n $(td).html(list_progress_bar_list_element_thick(title_text,id,percentage,parent_identifier,color,metric_text));\n}", "title": "" }, { "docid": "3953e3e47080d55f9a8739df344eb2f6", "score": "0.631002", "text": "function printCellLocation(event) { \r\nvar t = event.target.parentNode.parentNode.parentNode.id.replace(\"myTable\", \"\"); //t = TableId(0-20)\r\n \r\nvar relRow = event.target.parentNode.rowIndex+1;\r\nvar absRow = +relRow + Math.floor(t/numberOfColsInPlan)*numberOfRowsInTable;\r\n \r\nvar relCol = event.target.cellIndex +1;\r\n if( Math.floor(t / numberOfColsInPlan) % 2 == 0){ //snake busicuit\r\n var absCol = +relCol + (t%numberOfColsInPlan) * numberOfColsInTable;\r\n }else{\r\n var absCol = +relCol + ((t%numberOfColsInPlan) * -1 + (numberOfColsInPlan-1)) * numberOfColsInTable;\r\n }\r\n \r\nvar spaceorbr;\r\nvar str = document.getElementById(\"printDetailOfClickedCell\").innerHTML;\r\nif(str.substr(str.length-1,str.length) == \" \"){spaceorbr = \"</b><br>\";}else{spaceorbr = \"</b> \";}\r\n \r\ndocument.getElementById(\"printDetailOfClickedCell\").innerHTML += \"<b>\" +event.target.innerHTML + \" \" + indexOfTableIDvsHKCECplan[t] + \" \" + indexOfrowvsHKCErow[absRow-1] + \" \" + indexOfcolvsHKCEcol[absCol-1] + spaceorbr; \r\n}", "title": "" }, { "docid": "49bc025259c24c3c7ae2e3553b6036bd", "score": "0.63059086", "text": "function renderTable() {\r\n tbody.innerHTML = \"\";\r\n \r\n for (var i = 0; i < ufoData.length; i++) {\r\n \r\n var sightings = ufoData[i];\r\n var columns = Object.keys(sightings);\r\n \r\n var row = tbody.insertRow(i);\r\n for (var j = 0; j < columns.length; j++) {\r\n \r\n var column = columns[j];\r\n var cell = row.insertCell(j);\r\n cell.innerText = sightings[column];\r\n }\r\n }\r\n }", "title": "" }, { "docid": "19d9672d63bf23b82d5a9efe04d0ff27", "score": "0.62896526", "text": "createTableHeaderRow(){\n let row = document.createElement('tr');\n row.classList.add('table-header-row');\n\n row.appendChild(this.createTableHeaderCell('Pitcher', 'header-main-col-1', ''));\n row.appendChild(this.createTableHeaderCell('IP', 'ip-col', 'header-main-col-5'));\n row.appendChild(this.createTableHeaderCell('H', 'h-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('AB', 'ab-col', 'header-main-col-5'));\n row.appendChild(this.createTableHeaderCell('AVG', 'avg-col', 'header-main-col-6'));\n row.appendChild(this.createTableHeaderCell('2B', 'doubles-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('3B', 'triples-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('HR', 'hr-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('SLG', 'slg-col', 'header-main-col-6'));\n row.appendChild(this.createTableHeaderCell('BB', 'bb-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('HBP', 'hbp-col', 'header-main-col-5'));\n //row.appendChild(this.createTableHeaderCell('OBP', 'obp-col', 'header-main-col-6'));\n //Evan new\n row.appendChild(this.createTableHeaderCell('WHIP', 'whip-col', 'header-main-col-6'));\n row.appendChild(this.createTableHeaderCell('GO', 'go-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('FO', 'fo-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('LO', 'lo-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('K', 'k-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('KL', 'kl-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('SH', 'sh-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('SF', 'sf-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('GDP', 'gdp-col', 'header-main-col-5'));\n\n return row;\n }", "title": "" }, { "docid": "d8b18d2bac42a6146fa70e93a4f7dce4", "score": "0.626921", "text": "function ligandTableCell(colIndex, rowIndex) {\n rowIndex += 2;\n if (colIndex === 0) return document.getElementById('ligandTable').children[0].children[rowIndex].children[colIndex].children[0].children[0];\n else return document.getElementById('ligandTable').children[0].children[rowIndex].children[colIndex].children[0];\n}", "title": "" }, { "docid": "ddddc46b88555515aeacdf60c5535245", "score": "0.6264434", "text": "function newTable() {\n var hot = [\n // don't insert div automatically\n // {loc: \"+div+\", ts: \"\", te: \"\", tx: \"x\", stx: \"x\", type: 'div'}, // trjs.messgs.initdiv\n {loc: \"---\", ts: 0, te: \"\", tx: \"\", type: 'loc'} // trjs.messgs.inittrs\n ];\n initTable(hot);\n }", "title": "" }, { "docid": "4fb71f2050c479755e1c3a1656c99219", "score": "0.62585735", "text": "function priceFormatter(cell, row){\n return ` ${cell}`;\n}", "title": "" }, { "docid": "9efb29c4994b640305fe48fc5dea7939", "score": "0.6258044", "text": "function multiplicationTable (size, targEl) {\n var i, j, tbl, tr = [], e,\n lightblue = '#59C',\n offBackground = '#eee',\n onBackground = '#fff',\n offForeground = '#37A',\n onForeground = '#000',\n operation;\n\n console.log(targEl);\n\n // Default size is 9x9 if not specified\n size = (typeof size === 'undefined') ? 9 : size;\n targEl = (typeof targEl === 'undefined') ?\n document.body :\n document.getElementById(targEl);\n\n tbl = document.createElement('table');\n tbl.style.borderCollapse = 'collapse';\n tbl.style.borderSpacing = '0px';\n\n targEl.appendChild(tbl);\n targEl.style.border = '8px solid' + lightblue;\n // set width to div contents\n targEl.style.display = 'inline-block';\n\n operation = document.createElement('div');\n operation.innerHTML = 'Addition';\n operation.style.color = offForeground;\n operation.style.width = '6em';\n operation.style.margin = '0px auto';\n operation.style.fontFamily = 'Arial, Helvetica, sans-serif';\n operation.style.fontSize = '0.9em';\n operation.style.color = offForeground;\n operation.style.border = '4px solid ' + lightblue;\n operation.style.backgroundColor = offBackground;\n\n \n function cell() {\n var c = [],\n q = i + 1 + '&times;' + (j + 1),\n a = (i + 1) * (j + 1),\n id = i + 1 + '-' + (j + 1);\n\n \n c[i] = document.createElement('td');\n c[i].innerHTML = q;\n c[i].id = id;\n c[i].style.fontFamily = 'Arial, Helvetica, sans-serif';\n c[i].style.textAlign = 'center';\n c[i].style.fontSize = '0.9em';\n c[i].style.color = offForeground;\n c[i].style.width = '2.5em';\n c[i].style.height = '2.5em';\n c[i].style.border = '4px solid ' + offForeground;\n c[i].style.backgroundColor = offBackground;\n c[i].style.padding = '0px';\n c[i].style.margin = '0px';\n c[i].onmouseover = function () {\n this.innerHTML = a;\n this.style.color = onForeground;\n this.style.backgroundColor = onBackground;\n };\n c[i].onmouseout = function () {\n this.innerHTML = q;\n this.style.color = offForeground;\n this.style.backgroundColor = offBackground;\n };\n tr[j].appendChild(c[i]);\n }\n\n function changeCell() {\n var c = [], q, a, id;\n id = i + 1 + '-' + (j + 1);\n c[i] = document.getElementById(id);\n console.log(c[i].id);\n if (operation.innerHTML === 'Subtraction') {\n q = i + 1 + '+' + (j + 1);\n a = (i + 1) + (j + 1);\n } else if (operation.innerHTML === 'Multiplication') {\n if ((i + 1) - (j + 1) > -1) {\n q = i + 1 + '-' + (j + 1);\n a = (i + 1) - (j + 1);\n } else {\n q = j + 1 + '-' + (i + 1);\n a = (j + 1) - (i + 1);\n }\n } else {\n q = i + 1 + '&times;' + (j + 1);\n a = (i + 1) * (j + 1);\n }\n c[i].innerHTML = q;\n c[i].onmouseover = function () {\n this.innerHTML = a;\n this.style.color = onForeground;\n this.style.backgroundColor = onBackground;\n };\n c[i].onmouseout = function () {\n this.innerHTML = q;\n this.style.color = offForeground;\n this.style.backgroundColor = offBackground;\n };\n }\n \n targEl.parentNode.insertBefore(operation, targEl.nextSibling);\n\n \n for(j=0;j<size;j++){\n tr[j] = document.createElement('tr');\n tbl.appendChild(tr[j]);\n for(i=0;i<size;i++){\n cell();\n }\n }\n\n operation.onclick = function () {\n if (this.innerHTML === 'Addition') {\n this.innerHTML = 'Subtraction';\n } else if (this.innerHTML === 'Subtraction') {\n this.innerHTML = 'Multiplication';\n } else {\n this.innerHTML = 'Addition';\n }\n for(j=0;j<size;j++){\n for(i=0;i<size;i++){\n changeCell();\n }\n }\n };\n\n}", "title": "" }, { "docid": "e1bf693be8d6429bf107ca6f9ebf5f9f", "score": "0.6254374", "text": "createCellElement() {\r\n\r\n\t}", "title": "" }, { "docid": "a23f5094104e0f0d52a4990c735b471b", "score": "0.62449586", "text": "function prepareTableCell(ex2, mu2, s2, r2) {\n var ddd = document.createElement(\"B\");\n var uuuu = document.createElement(\"U\")\n var nodee = document.createElement(\"p\");\n var noder = document.createElement(\"p\");\n var nodet = document.createElement(\"p\");\n var nodey = document.createElement(\"p\");\n var ea = document.createElement(\"p\");\n var node = document.createElement(\"br\");\n var nodehr = document.createElement(\"hr\");\n var textnode = document.createTextNode(\"\");\n var textnodehr = document.createTextNode(\"\");\n var easy = document.createElement(\"a\");\n var easy1 = document.createElement(\"a\");\n var easy2 = document.createElement(\"a\");\n var easy3 = document.createElement(\"a\");\n var easy4 = document.createElement(\"a\");\n var buu = document.createElement(\"button\");\n\n\n nodee.appendChild(easy);\n noder.appendChild(easy1);\n nodet.appendChild(easy2);\n nodey.appendChild(easy3);\n ea.appendChild(easy4);\n ddd.appendChild(uuuu);\n uuuu.appendChild(nodee);\n easy4.appendChild(buu)\n var textnode1 = ex2;\n var textnode2 = ex2 + \" Ingredients: \" + mu2;\n var textnode3 = ex2 + \" Steps: \" + s2;\n var textnode4 = ex2 + \" calories:\" + r2;\n var ertyu = ex2 + \" \" + \"360* Image\";\n easy.append(textnode1);\n easy1.append(textnode2);\n easy2.append(textnode3);\n easy3.append(textnode4);\n node.append(textnode);\n nodehr.append(textnodehr);\n buu.append(ertyu);\n /*document.getElementById(\"output1\").appendChild(nodee);*/\n document.getElementById(\"output1\").appendChild(ddd);\n document.getElementById(\"output1\").appendChild(noder);\n document.getElementById(\"output1\").appendChild(nodet);\n document.getElementById(\"output1\").appendChild(nodey);\n document.getElementById(\"output1\").appendChild(node);\n document.getElementById(\"output1\").appendChild(ea);\n\n /*document.getElementById(\"output1\").appendChild(nodehr);*/\n\n\n\n\n\n\n\n}", "title": "" }, { "docid": "ccac7aa80d9a0f85bac114c3fbbcdf4c", "score": "0.62414545", "text": "function createATable(nextTable, characters){\n\t\n\n\treturn (`<table>\n\t<thead>\n\t\t<tr>\n\t\t\t<th>DEC</th>\n\t\t\t<th>HEX</th>\n\t\t\t<th>Char</th>\n\t\t\t<th class='hDesc'>Description</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t${createBody(nextTable, characters)}\n\t</tobdy>\n\t</table>`);\n}", "title": "" }, { "docid": "118896b9ae722092ba5563b8256e767c", "score": "0.6238881", "text": "function ds_template_main_above(t) {\r\n\treturn '<table cellpadding=\"2\" cellspacing=\"1\" class=\"ds_tbl\">'\r\n\t\t + '<tr>'\r\n\t\t + '<td class=\"ds_head\" style=\"cursor: pointer\" onclick=\"ds_10py();\">D</td>'\r\n\t\t + '<td class=\"ds_head\" style=\"cursor: pointer\" onclick=\"ds_py();\">A</td>'\r\n\t\t + '<td class=\"ds_head\" style=\"cursor: pointer\" onclick=\"ds_pm();\">m</td>'\r\n\t\t + '<td class=\"ds_head\" style=\"cursor: pointer\" onclick=\"ds_hi();\" colspan=\"3\">&lt;Fermer&gt;</td>'\r\n\t\t + '<td class=\"ds_head\" style=\"cursor: pointer\" onclick=\"ds_nm();\">m</td>'\r\n\t\t + '<td class=\"ds_head\" style=\"cursor: pointer\" onclick=\"ds_ny();\">A</td>'\r\n\t\t + '<td class=\"ds_head\" style=\"cursor: pointer\" onclick=\"ds_10ny();\">D</td>'\r\n\t\t + '</tr>'\r\n\t\t + '<tr>'\r\n\t\t + '<td colspan=\"10\" class=\"ds_head\">' + t + '</td>'\r\n\t\t + '</tr>'\r\n\t\t + '<tr>';\r\n}", "title": "" }, { "docid": "f6c47e8b996bd152d31ee2ae16dce449", "score": "0.6237602", "text": "function generateTable(table, data) {\n let tbody = table.createTBody();\n tbody.className = \".styled-table\";\n for (let element of data) {\n let row = tbody.insertRow();\n for (key in element) {\n if (key == \"symbol\") {\n let cell = row.insertCell();\n let text = document.createTextNode(element[key]); \n cell.appendChild(text);\n cell.className = \".styled-table\";\n cell.id = \"symbol\";\n } else if (key == \"weight\") {\n let cell = row.insertCell();\n let text = document.createTextNode(element[key].toFixed(1) + \" %\"); \n cell.appendChild(text);\n cell.className = \".styled-table\";\n cell.id = \"weight\";\n } else if (key == \"sharePrice\") {\n let cell = row.insertCell();\n if (element[key] != ''){\n let text = document.createTextNode(\"$ \" + commaSeparators(element[key].toFixed(2)));\n cell.appendChild(text);\n } else {\n let text = document.createTextNode('');\n cell.appendChild(text);\n }\n cell.className = \".styled-table\";\n cell.id = \"sharePrice\";\n } else if (key == \"shares\") {\n let cell = row.insertCell();\n let text = document.createTextNode(element[key]); \n cell.appendChild(text);\n cell.className = \".styled-table\";\n cell.id = \"shares\";\n } else if (key == \"cost\") {\n let cell = row.insertCell();\n let text = document.createTextNode(element[key]); \n cell.appendChild(text);\n cell.className = \".styled-table\";\n cell.id = \"cost\";\n } else if (key == \"currentYield\") {\n let cell = row.insertCell();\n let text = document.createTextNode(element[key]); \n cell.appendChild(text);\n cell.className = \".styled-table\";\n cell.id = \"currentYield\";\n } else {\n let cell = row.insertCell();\n let text = document.createTextNode(element[key]); \n cell.appendChild(text);\n cell.className = \".styled-table\";\n cell.id = \"other\";\n }\n }\n }\n}", "title": "" }, { "docid": "ce92c5b91448e4b14b682bb8ab2362f0", "score": "0.62132645", "text": "function insertTableMain(){\n for(var i= 0; i < 48; i++){\n var tr = $(\"<tr></tr>\");\n var no = i%2 == 0 ? \"trEven\":\"trOdd\";\n var tdFirst = $('<td></td>').addClass(\"timeClass\");\n var h = i / 2;\n// tr.attr(\"id\", \"row_\"+i);\n tr.css({\"font-size\": \"12px\", \"text-align\":\"right\"});\n tr.addClass(no);\n \n if(no == \"trEven\"){\n var text = h < 10 ? \"0\"+h+\":00\" : h+\":00\";\n tdFirst.text(text);\n }\n tr.append(tdFirst);\n for(var k = 1; k <= DateRange; k++){\n var tdd = $(\"<td></td>\").addClass(\"col_\"+k+\" row_\"+i);\n tr.append(tdd);\n } \n $(\"#mainTableData\").append(tr);\n }\n \n $(\".trEven td:first-child\").each(function(){\n $(this).css({\"border-bottom-color\":\"white\"});\n });\n var time = new Date();\n var kk = time.getHours() *2;\n var contD = $(\".contData\");\n contD.animate({\n scrollTop: $(\".row_\"+kk).offset().top - contD.offset().top + contD.scrollTop() -4\n });\n }", "title": "" }, { "docid": "43b4678361845c216534093b8c2f5001", "score": "0.6211963", "text": "function battleRealRender(table, start, attacker, defender, winner, end, status) {\n var row = table.insertRow(table.rows.length);\n insertCells(row, 7);\n row.cells[0].innerHTML = \"<b>\" + (table.rows.length - 1) + \"</b>\";\n row.cells[1].innerHTML = start;\n row.cells[2].innerHTML = attacker;\n row.cells[3].innerHTML = defender;\n row.cells[4].innerHTML = winner;\n row.cells[5].innerHTML = end;\n row.cells[6].innerHTML = status;\n}", "title": "" }, { "docid": "327d90e96d725c820de2c4fe0b740497", "score": "0.6205893", "text": "function getTablaStartupsOrg(){\n var cellFuncs = [\n function(data) { return data.idStartup; },\n function(data) { return data.nombreStartup; },\n function(data) { return data.participanteByIdParticipanteCreador.nombreParticipante; },\n function(data) {\n if (data.activaStartup == 0) {\n return 'Idea';\n } else {\n return '<Strong>Startup</Strong>';\n }\n },\n function(data) {return data.votosStartup},\n function(data){\n if (data.activaStartup) {\n return \"<a onclick='rechazarStartup(\" + data.idStartup + \")'><img class='iconHand' alt='Rechazar \"+data.idStartup+\" ?' title='Rechazar \"+data.idStartup+\" ?' src='img/positive.png'/></a>\";\n } else {\n return \"<a onclick='aprobarStartup(\" + data.idStartup + \")'><img class='iconHand' alt='Aprobar \" + data.idStartup + \" ?' title='Aprobar \" + data.idStartup + \" ?' src='img/negative.png'/></a>\";\n }\n\n },\n function(data){\n return \"<a onclick='cargarStartupORG(\" + data.idStartup + \")'><img class='iconHand' alt='Cargar \"+data.idStartup+\"' title='Cargar \"+data.idStartup+\"' src='images/edit.png'/></a>\";\n }\n\n ];\n\n dwr.util.removeAllRows(\"startupsTbody\");\n\n swRemoto.getStartupsFromCertamen(function (data){\n dwr.util.addRows(\"startupsTbody\", data, cellFuncs, {\n rowCreator:function(options) {\n var row = document.createElement(\"tr\");\n if (options.rowIndex % 2) {\n row.className = 'tablaZebra1';\n// row.style.backgroundColor = \"#c0ff99\";\n// row.style.color = \"rgb(255,255,255)\";\n } else {\n row.className = 'tablaZebra2';\n }\n return row;\n },\n cellCreator:function(options){\n var cell = document.createElement(\"td\");\n cell.className = 'cellBorder';\n return cell;\n },\n escapeHtml:false\n });\n\n// alrt(\"nuevo = \" + nuevo);\n if (tablaStartupsOrgNueva) {\n tablaStartupsOrgNueva = false;\n jQuery(\"#tablaStartupsOrg\").tablesorter();\n } else {\n jQuery(\"#tablaStartupsOrg\").trigger(\"update\");\n }\n\n });\n}", "title": "" }, { "docid": "98eea425f42bff49025d9263c9d5e72d", "score": "0.61874175", "text": "function createExInteriorPartialTable(cellText,divCount,placeID,selectID)\n{\n var partOfTable = [];\n var rowSpanNumber = Math.ceil(divCount/4);\n var currentDiv = placeID.replace ( /[^\\d.]/g, '' );\n //console.log('the current Div is ' + currentDiv);\n\n for (var i = 0; i<divCount;i=i+4)\n {\n var newRow = [];\n\n //create the first cell in the row. if this is the first row, then write the name, row span. if it is not the\n // first row, then create empty cell will be enough.\n if (i == 0)\n {\n var cell0 = {\n text:cellText,\n rowSpan:rowSpanNumber,\n fontSize:10,\n color:'black',\n bold:true,\n alignment:'center'\n };\n newRow.push(cell0);\n }\n else\n {\n var cell0 = {};\n newRow.push(cell0);\n }\n\n //Create the cells in the row, each loop create two cells. it is possible, in some loops, the id is null, will\n //return '' instead\n for (var a = i; a<i+4;a++)\n {\n var place;\n var select;\n\n var cell1;\n var cell2;\n\n // console.log(placeID + a);\n //console.log(selectID + a);\n\n place = document.getElementById(placeID + a);\n select = document.getElementById(selectID + a);\n\n\n if (place != null)\n {\n place = place.value;\n\n cell1 = {\n text:place,\n style: 'tableText',\n noWrap: true\n };\n }\n else\n {\n cell1 = ''\n }\n\n\n\n if (select != null)\n {\n\n //select = select.value;\n cell2 = {\n text:getIt(selectID + a),\n style: 'tableText',\n alignment:'center'\n };\n }\n else\n {\n cell2 = ''\n }\n\n newRow.push(cell1);\n newRow.push(cell2);\n\n }\n partOfTable.push(newRow);\n }\n //console.log(partOfTable);\n return partOfTable;\n}", "title": "" }, { "docid": "2e5b995b113ccc7d61c99e6a9260985f", "score": "0.6186262", "text": "forEachCell(fn){\r\n const fnTR = (tr, rowIndex)=>{\r\n let tds = this.nanny.getTdsInRow(tr),\r\n colIndex = 0;\r\n for(let td of tds){\r\n fn(td, rowIndex, colIndex, tr);\r\n colIndex++;\r\n }\r\n };\r\n // this.forUnderTable(fnTR, '> tr');\r\n this.forEachRow(fnTR);\r\n }", "title": "" }, { "docid": "8bde8b00e4d81115231843ff8f853cfd", "score": "0.6179211", "text": "function createCell(value) {\n return \"<td>\" + value + \"</td>\";\n}", "title": "" }, { "docid": "b704df58a43fb5090b02936a81140104", "score": "0.61727214", "text": "function addCells (row, tidx, tend, textLines, change) {\n if (tidx < tend) {\n row.appendChild(telt(\"th\", (tidx + 1).toString()));\n row.appendChild(ctelt(\"td\", change, textLines[tidx].replace(/\\t/g, \"\\u00a0\\u00a0\\u00a0\\u00a0\")));\n return tidx + 1;\n } else {\n row.appendChild(document.createElement(\"th\"));\n row.appendChild(celt(\"td\", \"empty\"));\n return tidx;\n }\n }", "title": "" }, { "docid": "4467dc5504c8d19e63e12d597c2d1e42", "score": "0.6161805", "text": "function tableInit() {\n}", "title": "" }, { "docid": "531619eab4a777265b89a1105cb30555", "score": "0.6146616", "text": "function callback_create_cell (evt, data) {\n\t\t\tif (params.show_section_brackets) {\n\t\t\t\tupdate_collapsed_headings();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "d9beb15999e1d812596451f2894da1d3", "score": "0.6141156", "text": "function createCells(){\n\t\tvar opt = ret.options;\n\t\tvar def = opt.def;\n\t\tvar table = \"\", row = \"\";\n\t\tfor(var r=0;r<def.rows.length;r++){\n\t\t\trow = \"\";\n\t\t\tfor(var c=0;c<def.cols.length;c++){\n\t\t\t\tvar cell = {}; //should force new variable on each loop\n\t\t\t\tvar type = \"\";\n\t\t\t\tcell.ref = def.name + \"_r\" + r + \"c\" + c; //to be used for binding\n\t\t\t\tcell.css = def.cols[c].css || def.rows[r].css || opt.cell.css || opt.css.cell;\n\t\t\t\ttype = cell.css;\n\t\t\t\tif(!opt[type]){ //not a valid cell type\n\t\t\t\t\tcell.css = opt.cell.css || opt.css.cell + \" \" + cell.css; // over ride to valid type\n\t\t\t\t\ttype = opt.cell.css || opt.css.cell; // over ride to valid type\n\t\t\t\t}\n\t\t\t\tcell.value = \"\"; //Default to blank\n\n\t\t\t\tif(c===0){ //reserved for row headings\n\t\t\t\t\tcell.value = def.rows[r].display;\n\t\t\t\t\tcell.css = def.cols[0].css; //override\n\t\t\t\t}\n\t\t\t\telse if(r===0){ //reserved for column headings\n\t\t\t\t\tcell.value = def.cols[c].display;\n\t\t\t\t\tcell.css = def.cols[0].css + (def.cols[c].css ? \" \" + def.cols[c].css : \"\"); // 20150102 added code to take css from column to support hiding\n\t\t\t\t\tcell.css += \" header\";\n\t\t\t\t}\n\t\t\t\telse if(def.rows[r].css===\"blank\" || def.cols[c].css===\"blank\"){\n\t\t\t\t\tcell.css=\"blank\";\n\t\t\t\t\tcell.value=\" \";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tcell.key = {};\n\t\t\t\t\t$.extend(cell.key, def.key, def.rows[r].key, def.cols[c].key); //used to query datasource\n\t\t\t\t\tcell.formula = def.cols[c].type; //should there be a recalc aspect - can we get data at this point?\n\t\t\t\t\tcell.index = def.cols[c].index || def.rows[r].index || opt[type].index; // changed from cell.css to type\n\t\t\t\t\tcell.type = def.cols[c].type || def.rows[r].type || opt[type].type;\n\t\t\t\t\tcell.format = def.cols[c].format || def.rows[r].format || opt[type].format;\n\t\t\t\t\tcell.chartType = def.cols[c].chartType || def.rows[r].chartType || opt[type].chartType;\n\t\t\t\t\tcell.series = cellSeries; //see below - could be anonymous\n\t\t\t\t\tcell.style = def.cols[c].style || def.rows[r].style || opt[type].style;\n\t\t\t\t}\n\t\t\t\t// 20150106 Pages - support partial update\n\t\t\t\tcell.page = def.cols[c].page || def.rows[r].page || '_';\n\t\t\t\tif(!ret.pages[cell.page]){\n\t\t\t\t\tret.pages[cell.page] = [];\n\t\t\t\t}\n\t\t\t\tret.pages[cell.page].push(cell); // is reference to cell pushed\n\t\t\t\t// could update css and add active/inactive page\n\t\t\t\tif(cell.page!=='_') { cell.css+= ' pg'+cell.page + ' inactivePage'; }\n\t\t\t\tif(o.pageCtrl){ if(cell.page===o.pageCtrl()) { cell.css = cell.css.replace('inactivePage','activePage'); } };\n\t\t\t\trow = row += \"<td id='\" + cell.ref + \"' class='\"+ cell.css + \"' style='\"+ cell.style + \"'>\" + cell.value + \"</td>\";\n\t\t\t\tret.cells.push(cell); //might push to linear and 2d array\n\t\t\t\tret.cellsByRef[cell.ref]=cell; // used for pop up when cell clicked\n\t\t\t}\n\t\t\ttable += \"<tr id='r\" + r + \"' class='\" + opt.css.row + \"'>\" + row + \"</tr>\";\n\t\t}\n\t\tret.table = \"<table id='\" + def.name + \"' class='\" + opt.css.table + \"'>\" + table + \"</table>\"\n\t\t//Populate table\n\t\t$('#'+def.container).html(ret.table);\n\t\t//Handlers\n\t\tvar hdl = def.eventHandlers;\n\t\tif(hdl){\n\t\t\tfor(k in hdl){\n\t\t\t\tfor(l in hdl[k]){\n\t\t\t\t\td3.selectAll('#'+def.name+' '+k)\n\t\t\t\t\t\t.on(l,hdl[k][l])\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "1d1c347102e7b80affe5fc6a2d4c7e6c", "score": "0.61383", "text": "function addRow(){\n var x = table.rows.length; \n var y = table.rows[0].cells.length;\n var row=table.insertRow(x);\n \n for (var c=0; c < y; c++) {\n var new_cell = row.insertCell(c);\n if(c<a)\n {\n new_cell.innerHTML = \"-\";\n new_cell.contentEditable=\"true\";\n }\n else\n {\n new_cell.innerHTML = \"0\";\n }\n if(c>a)\n {\n new_cell.classList.add('show');\n }\n if(c===0)\n {\n new_cell.onclick = function() {highlight(x)};\n }\n }\n b++;\n display();\n calc();\n}", "title": "" }, { "docid": "92fed38808678bde14b7fa3b6d4051de", "score": "0.61226565", "text": "function addCells(row, tidx, tend, textLines, change) {\n if (tidx < tend) {\n row.appendChild(telt(\"th\", (tidx + 1).toString()));\n row.appendChild(ctelt(\"td\", change, textLines[tidx].replace(/\\t/g, \"\\u00a0\\u00a0\\u00a0\\u00a0\")));\n return tidx + 1;\n } else {\n row.appendChild(document.createElement(\"th\"));\n row.appendChild(celt(\"td\", \"empty\"));\n return tidx;\n }\n }", "title": "" }, { "docid": "4a436503b4b6d08148dbdd0e60463e0d", "score": "0.6119539", "text": "createTableHeaderRow(){\n let row = document.createElement('tr');\n row.classList.add('table-header-row');\n\n row.appendChild(this.createTableHeaderCell('Batter', 'header-main-col-1', ''));\n row.appendChild(this.createTableHeaderCell('H', 'h-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('AB', 'ab-col', 'header-main-col-5'));\n row.appendChild(this.createTableHeaderCell('AVG', 'avg-col', 'header-main-col-6'));\n row.appendChild(this.createTableHeaderCell('2B', 'doubles-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('3B', 'triples-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('HR', 'hr-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('SLG', 'slg-col', 'header-main-col-6'));\n row.appendChild(this.createTableHeaderCell('BB', 'bb-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('HBP', 'hbp-col', 'header-main-col-5'));\n row.appendChild(this.createTableHeaderCell('OBP', 'obp-col', 'header-main-col-6'));\n row.appendChild(this.createTableHeaderCell('GO', 'go-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('FO', 'fo-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('LO', 'lo-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('K', 'k-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('KL', 'kl-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('SH', 'sh-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('SF', 'sf-col', 'header-main-col-4'));\n row.appendChild(this.createTableHeaderCell('GDP', 'gdp-col', 'header-main-col-5'));\n\n return row;\n }", "title": "" }, { "docid": "37f877722ebb0c47cb4231ef195d11bf", "score": "0.61147857", "text": "function appendCoinCell(key, coinData, tr) {\n var image = $('<img src=\"'+coinData.icon+'\" width=\"60em\" height=\"60em\" />');\n var td = $('<td style=\"width: 125px; vertical-align: middle; background: white !important; text-align: center;\">');\n td.append(image);\n td.append($('<b style=\"font-size: 17px; display: block; margin-top:3px;color:#666;\">'+key+'</b>'));\n tr.append(td);\n}", "title": "" }, { "docid": "fd666011155b2b0342f501622ad5a599", "score": "0.6108744", "text": "function tableBody(table_data) {\n\t//tBody will contain all html for the table body\n\tvar tBody = '';\n\t//Set reference for when to start next feature row\n\tvar feature_id = '';\n\t//Set reference for when to start a new category\n\tvar category_id = '';\n\t//For every row in the data\n\tfor (var i = 0; i < table_data.record.length; i++) {\n\t\t//If there is a new category add a column span for the new category\n\t\tif (category_id !== table_data.record[i].category_id) {\n\t\t\tcategory_id = table_data.record[i].category_id;\n\t\t\t//Check to make sure the category is not in the blacklist before adding it\n\t\t\tif (jQuery.inArray(table_data.record[i].category_id, white_list) == -1) {\n\t\t\t\ttBody += tableCell(table_data, i, 2);\n\t\t\t\t//Add the category id to the main whitelist\n\t\t\t\twhite_list_main.push(category_id);\n\t\t\t} else {\n\t\t\t\t//If the category is in the blacklist, skip over the rest of the features with that id\n\t\t\t\twhile (i < table_data.record.length && category_id == table_data.record[i].category_id) {\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\ti--; //add buffer for continue\n\t\t\t\tcontinue;\n\t\t\t};\n\t\t};\n\t\t//Check to make sure the next feature is in the blacklist\n\t\tif (jQuery.inArray(table_data.record[i].feature_id, white_list) == -1) {\n\t\t\t//If in the same row, add next cell\n\t\t\tif (feature_id == table_data.record[i].feature_id) {\n\t\t\t\ttBody += tableCell(table_data, i, 0);\t\n\t\t\t} else {\n\t\t\t\t//If new row, start next row with feature name and first product description\n\t\t\t\ttBody += tableCell(table_data, i, 1);\n\t\t\t\ttBody += tableCell(table_data, i, 0);\n\t\t\t\t//Reset reference for when to start next row\n\t\t\t\tfeature_id = table_data.record[i].feature_id;\n\t\t\t\t//Add the feature id to the main whitelist\n\t\t\t\twhite_list_main.push(feature_id);\n\t\t\t};\n\t\t};\n\t};\n\t//Close last row\n\ttBody += '</tr>'\n\t//Fill the whitelist with the newly created main list\n\twhite_list = white_list_main.slice();\n\t//Attach generated html to table body in index page\n\tdocument.getElementById(\"ehrTableBody\").innerHTML = tBody;\n\treturn;\n}", "title": "" }, { "docid": "04a9e251e00305b8c08a0eba2552b34a", "score": "0.60971534", "text": "function buildTable2(){\n var table2;\n var tableHead2 = \"<table><thead><p style=\\\"color:red;\\\">\" + compoundFormula[0] + \"</p></thead>\";\n var tableBody = \"<tbody>\";\n var content = buildRow();\n var endTable =\"</tbody></table>\";\n table2 = tableHead2 + tableBody + content + endTable;\n document.getElementById(\"testTable\").innerHTML = table2;\n return table2;\n \n}", "title": "" }, { "docid": "b25b1149d9e526c5c3a40a2ecc5282e5", "score": "0.60970783", "text": "updateTable() {\r\n \r\n // ******* TODO: PART III *******\r\n var tree = new Tree(this.tableElements);\r\n var table = d3.select(\"#matchTable\");\r\n var t_rows = table.select(\"tbody\")\r\n .selectAll(\"tr\")\r\n .data(this.tableElements)\r\n .on(\"mouseenter\", function(d){\r\n //console.log(\"********************\",this.tableElements);\r\n tree.updateTree(this.rowIndex - 2);\r\n })\r\n .on(\"mouseleave\", function(d) {\r\n tree.clearTree();\r\n });\r\n t_rows.exit().remove();\r\n t_rows = t_rows.enter().append(\"tr\")\r\n .on(\"mouseenter\", function(d){\r\n // console.log(\"-----------\",d.value.type);\r\n tree.updateTree(this.rowIndex - 2);\r\n })\r\n .on(\"mouseleave\", function(d) {\r\n tree.clearTree();\r\n })\r\n .merge(t_rows);\r\n\r\n var t_columns = t_rows.selectAll(\"td\")\r\n .data(function(d) {\r\n var list_values = [];\r\n var goalInfo = {\"Made\": d.value[\"Goals Made\"], \"Conceded\": d.value[\"Goals Conceded\"]};\r\n var type = d.value.type;\r\n if (type == \"aggregate\") {\r\n list_values.push({\"type\": type, \"vis\": \"ctext\", \"value\": d.key});\r\n list_values.push({\"type\": type, \"vis\": \"goals\", \"value\": goalInfo});\r\n list_values.push({\"type\": type, \"vis\": \"text\", \"value\": d.value.Result.label});\r\n list_values.push({\"type\": type, \"vis\": \"bars\", \"value\": d.value.Wins});\r\n list_values.push({\"type\": type, \"vis\": \"bars\", \"value\": d.value.Losses});\r\n list_values.push({\"type\": type, \"vis\": \"bars\", \"value\": d.value.TotalGames});\r\n } \r\n else {\r\n list_values.push({\"type\": type, \"vis\": \"ctext\", \"value\": d.key});\r\n list_values.push({\"type\": type, \"vis\": \"goals\", \"value\": goalInfo});\r\n list_values.push({\"type\": type, \"vis\": \"text\", \"value\": d.value.Result.label});\r\n list_values.push({\"type\": type, \"vis\": \"bars\", \"value\": null});\r\n list_values.push({\"type\": type, \"vis\": \"bars\", \"value\": null});\r\n list_values.push({\"type\": type, \"vis\": \"bars\", \"value\": null});\r\n }\r\n\r\n return list_values;\r\n });\r\n\r\n t_columns.exit().remove();\r\n t_columns = t_columns.enter()\r\n .append(\"td\")\r\n .merge(t_columns);\r\n\r\n var classed_cell_text = t_columns.filter(function (d){\r\n return d.vis == \"ctext\";\r\n })\r\n .classed(\"aggregate\",function(d) { return d.type==\"aggregate\";})\r\n .classed(\"game\",function(d) { return d.type ==\"game\"; })\r\n .text(function(d) {\r\n if (d.type == \"aggregate\")\r\n return d.value;\r\n else\r\n return \"x\" + d.value;\r\n })\r\n .on(\"click\",(d)=> {\r\n if (d.type == \"game\")\r\n return;\r\n this.updateList(d3.event.target.parentNode.rowIndex - 2);\r\n });\r\n //this.updateList(this.parentNode.rowIndex - 2);\r\n var cell_text = t_columns.filter(function (d){\r\n return d.vis == \"text\";})\r\n .text(function(d) { return d.value; });\r\n\r\n var cell_bar = t_columns.filter(function (d){\r\n return (d.vis == \"bars\");})\r\n .selectAll(\"svg\")\r\n .data(function(d) { return [d.value]; });\r\n cell_bar.exit().remove();\r\n var svgs = cell_bar.enter()\r\n .append(\"svg\")\r\n .attr(\"width\", this.cell.width)\r\n .attr(\"height\", this.cell.height)\r\n .merge(cell_bar);\r\n var bars = svgs.selectAll(\"rect\")\r\n .data(function(d) { return [d]; });\r\n bars.exit().remove();\r\n bars.attr(\"x\",0)\r\n .attr(\"y\",0)\r\n .attr(\"width\", (d)=> { return this.gameScale(d); })\r\n .attr(\"height\", this.bar.height)\r\n .attr(\"fill\",(d)=> { return this.aggregateColorScale(d); });\r\n bars.enter()\r\n .append(\"rect\")\r\n .attr(\"x\",0)\r\n .attr(\"y\",0)\r\n .attr(\"width\", (d)=> { return this.gameScale(d); })\r\n .attr(\"height\", this.bar.height )\r\n .attr(\"fill\",(d)=> { return this.aggregateColorScale(d); });\r\n var labels = svgs.selectAll(\"text\")\r\n .data(function(d) {return [d];});\r\n\r\n labels.exit().remove();\r\n\r\n labels.attr(\"class\", \"value\")\r\n .attr(\"y\", this.cell.height/2)\r\n .attr(\"x\", (d)=> { return this.gameScale(d);}) \r\n .attr(\"dy\", \".35em\")\r\n .attr(\"text-anchor\", \"end\")\r\n .classed(\"label\",true)\r\n .text(function(d){ return d;});\r\n\r\n labels.enter()\r\n .append(\"text\")\r\n .attr(\"class\", \"value\")\r\n .attr(\"y\", this.cell.height/2)\r\n .attr(\"x\", (d)=> { return this.gameScale(d);}) \r\n .attr(\"dy\", \".35em\")\r\n .attr(\"text-anchor\", \"end\")\r\n .classed(\"label\",true)\r\n .text(function(d){ return d;});\r\n\r\n var goals = t_columns.filter(function (d){\r\n return d.vis == \"goals\";})\r\n .selectAll(\"svg\")\r\n .data(function(d) { return [{\"type\":d.type,\"value\":d.value}]; });\r\n goals.exit().remove();\r\n var gsvgs = goals.enter()\r\n .append(\"svg\")\r\n .attr(\"width\", 2*this.cell.width)\r\n .attr(\"height\", this.cell.height)\r\n .merge(goals);\r\n var goal_bars = gsvgs.selectAll(\"rect\")\r\n .data(function(d) { return [d]; });\r\n //goal_bars.exit().remove();\r\n goal_bars.attr(\"x\", (d)=> {\r\n if(d.value.Made < d.value.Conceded)\r\n return this.goalScale(d.value.Made)\r\n else \r\n return this.goalScale(d.value.Conceded);\r\n })\r\n .attr(\"y\",(d)=> {\r\n if (d.type == \"aggregate\")\r\n return this.cell.height/4; \r\n else \r\n return 3 * this.cell.height/8; })\r\n .attr(\"width\", (d)=> { return Math.abs(this.goalScale(d.value.Made)-this.goalScale(d.value.Conceded)); })\r\n .attr(\"height\", (d)=> { if (d.type == \"aggregate\") return this.cell.height/2; else return this.cell.height/4; })\r\n .attr(\"fill\", (d)=> { return this.goalColorScale(Math.sign(d.value.Made-d.value.Conceded)); });\r\n goal_bars.enter()\r\n .append(\"rect\")\r\n .classed(\"goalBar\", true)\r\n .attr(\"x\", (d)=> {\r\n if(d.value.Made < d.value.Conceded)\r\n return this.goalScale(d.value.Made)\r\n else\r\n return this.goalScale(d.value.Conceded);\r\n })\r\n .attr(\"y\",(d)=> { if (d.type == \"aggregate\") return this.cell.height/4; else return 3 * this.cell.height/8; })\r\n .attr(\"width\", (d)=> { return Math.abs(this.goalScale(d.value.Made)-this.goalScale(d.value.Conceded)); })\r\n .attr(\"height\", (d)=> { if (d.type == \"aggregate\") return this.cell.height/2; else return this.cell.height/4;} )\r\n .attr(\"fill\",(d)=> { return this.goalColorScale(Math.sign(d.value.Made-d.value.Conceded)); });\r\n var goal_circles = gsvgs.selectAll(\"circle\")\r\n .data(function(d) {\r\n if (d.value.Made == d.value.Conceded)\r\n return [{\"type\": d.type, \"value\":d.value.Made, \"color\":\"#777777\"}];\r\n else\r\n return [{\"type\": d.type, \"value\":d.value.Made, \"color\":\"#034e7b\"}, {\"type\": d.type, \"value\":d.value.Conceded, \"color\":\"#cb171c\"}];\r\n });\r\n\r\n goal_circles.exit().remove();\r\n goal_circles\r\n .attr(\"cx\", (d)=> { return this.goalScale(d.value); })\r\n .attr(\"cy\", this.cell.height/2)\r\n .attr(\"stroke\", function(d) { return d.color; })\r\n .attr(\"fill\", function(d) { if (d.type == \"aggregate\") return d.color; else return \"white\"; });\r\n goal_circles.enter()\r\n .append(\"circle\")\r\n .classed(\"goalCircle\",true)\r\n .attr(\"cx\", (d)=> { return this.goalScale(d.value); })\r\n .attr(\"cy\", this.cell.height/2)\r\n .attr(\"stroke\", function(d) { return d.color; })\r\n .attr(\"fill\", function(d) { if (d.type == \"aggregate\") return d.color; else return \"white\"; })\r\n .merge(goal_circles); \r\n }", "title": "" }, { "docid": "5ce111d493edb5c6a3c7819b48416992", "score": "0.60930663", "text": "function renderBoard(board, elSelector) {\n var strHtml = '';\n // this variable assigns a running-number (counter) #id to all cells in the HTML table,\n // so their coords will be recognizable later on \n var tdId = 0;\n board.forEach(function (cells, i) {\n strHtml += '<tr>';\n cells.forEach(function (cell, j) {\n // differernt HTML tags depending on cell.type\n switch (cell.type) {\n case MINE:\n // case 'blank':\n strHtml += '<td id=\"' + tdId + '\" onclick=\"cellClicked(this)\" ' +\n 'oncontextmenu=\"cellMarked(this);return false;\" ' +\n 'class=\"hidden ' + cell.type + '\"></td>';\n break;\n case NUM:\n if (!cell.num) {\n strHtml += '<td id=\"' + tdId + '\" onclick=\"cellClicked(this)\" ' +\n 'oncontextmenu=\"cellMarked(this);return false;\" ' +\n 'class=\"number num' + cell.num + ' hidden\"></td>';\n } else {\n strHtml += '<td id=\"' + tdId + '\" onclick=\"cellClicked(this)\" ' +\n 'oncontextmenu=\"cellMarked(this);return false;\" ' +\n 'class=\"number num' + cell.num + ' hidden\"><span class=\"hiddennumber\">' + cell.num + '</span></td>';\n }\n }\n tdId++;\n\n });\n strHtml += '</tr>';\n });\n // print into the HTML element\n var elMat = document.querySelector(elSelector);\n elMat.innerHTML = strHtml;\n} // *** End of renderBoard", "title": "" }, { "docid": "ed49d0d36de88f3baaa095b197415840", "score": "0.6090454", "text": "function cellSpan() {\n\tvar span = '';\n\t//fill empty cells with place holders\n\tfor (var i = 0; i < numberOfCompanies; i++) {\n\t\tspan += '<td class=\"categoryTableColor\"></td>'\n\t};\n\treturn span;\n}", "title": "" }, { "docid": "3bd1daf39ce268af4afcc18e58a223b3", "score": "0.60898536", "text": "function buildTable() {\n var table = document.createElement(\"table\");\n table.setAttribute(\"id\", \"table\");\n \n //create header row\n var headRow = document.createElement(\"tr\");\n for (var i = 1; i <= 4; i++) {\n var headCell = document.createElement(\"th\");\n headCell.textContent = \"Header \" + i;\n headCell.style.border = \"1px solid black\";\n headRow.appendChild(headCell);\n }\n table.appendChild(headRow);\n\t\n //create data cells\n for (i = 1; i <= 3; i++) {\n var row = document.createElement(\"tr\");\n for (var j = 1; j <= 4; j++) {\n var cell = document.createElement(\"td\");\n cell.textContent = j + \", \" + i;\n cell.style.border = \"1px solid black\"\n if (i == 1 && j == 1) {\n cell.setAttribute(\"id\", \"current\");\n cell.style.border = \"3px solid black\";\n }\n row.appendChild(cell);\n }\n table.appendChild(row);\n }\n\n return table;\n}", "title": "" }, { "docid": "a1cb19298bdd05c2541fdc03849e591f", "score": "0.6077781", "text": "createTableHeaderCell(text, colType, colWidth) {\n let cell = document.createElement('th');\n cell.classList.add(colType);\n cell.setAttribute('col-type', colType.split('-')[0]);\n\n let cellContainer = document.createElement('div');\n\n if(colWidth !== ''){\n cellContainer.classList.add(colWidth);\n }//if:\n\n let textSpan = document.createElement('span');\n textSpan.textContent = text;\n\n let sortArrow = document.createElement('button');\n sortArrow.classList.add('sort-arrow');\n sortArrow.innerHTML = \"&#8675;\";\n sortArrow.style.display = 'none';\n sortArrow.style.color = 'white';\n sortArrow.style.backgroundColor = 'red';\n sortArrow.style.outline = 'none';\n sortArrow.setAttribute('arrow-orientation', 'down');\n\n sortArrow.style.border = 'none';\n\n cellContainer.appendChild(textSpan);\n cellContainer.appendChild(sortArrow);\n\n cell.appendChild(cellContainer);\n return cell;\n }", "title": "" }, { "docid": "af9969e84662d9863c8b2ff8e269d1db", "score": "0.60593045", "text": "function renderBoard() {\r\n var strHTML = '';\r\n for (var i = 0; i < 4; i++) {\r\n strHTML += `<table>`;\r\n for (var j = 0; j < 4; j++) {\r\n var board = strHTML;\r\n var currCell = board[i][j]\r\n currCell = createMat(gLevel)\r\n var cell = board[i][j]\r\n var elTab = document.querySelector('.table');\r\n elTab.innerHTML = currCell\r\n }\r\n board[i][j] = cell;\r\n }\r\n strHTML += `\\t<td class=\"cell ' + `\r\n}", "title": "" }, { "docid": "05da7cee6fd9b433fbcaefd1839c97e4", "score": "0.6055243", "text": "function AddCellContents(data, cell, id)\n{\n var td=document.createElement('TD');\n var dataCell = data[cell][id];\n td.appendChild(document.createTextNode(dataCell));\n return td;\n}", "title": "" }, { "docid": "32f5ecb2642e9f46fdfcbae6a7ec3067", "score": "0.605027", "text": "function buildMainboard() {\n var counter = 1;\n ['B', 'I', 'N', 'G', 'O'].forEach(function(rowLabel) {\n var row = document.createElement('tr');\n var square = document.createElement('td');\n square.className = 'mainboard-label';\n row.appendChild(square);\n square.innerHTML = rowLabel;\n for (var col=0; col<15; col++) {\n square = document.createElement('td');\n square.innerHTML = counter++;\n row.appendChild(square);\n }\n $('#mainboard').append(row);\n });\n }", "title": "" }, { "docid": "f3623897eb4663c81faeb87e9966f04e", "score": "0.6033592", "text": "function makeTable(celldata, formvals) { // build table to display charted records\n\n var tmap = config.tableMap;\n var content = '<tbody>';\n\n for (var i = 0; i < tmap.length; i++) {\n var colhead = tmap.filter(function(obj) {\n return obj.pos == i;\n });\n\n content += '<th>' + colhead[0].title + '</th>';\n }\n $.each(celldata, function(index, val) {\n\n if (val.dest == formvals.airport) {\n content += '<tr style=\"color:#008000\">';\n } else {\n content += '<tr style=\"color:#0000CD\">';\n }\n\n for (var i = 0; i < tmap.length; i++) {\n var mapobj = tmap.filter(function(obj) {\n return obj.pos == i;\n });\n content += '<td>' + val[mapobj[0].data] + '</td>';\n }\n content += '</tr>';\n });\n\n content += '</tbody>';\n\n $('#flightTable').html(content);\n }", "title": "" }, { "docid": "78df50955441ec288f9ac26223c3f29c", "score": "0.60295486", "text": "function generate_table2(world){\n var cell1=document.getElementById('1');\n var cell2=document.getElementById('2');\n var cell3=document.getElementById('3');\n cell1.innerHTML=world[\"total_cases\"];\n cell2.innerHTML=world[\"total_deaths\"];\n cell3.innerHTML=world[\"total_recovered\"];\n}", "title": "" }, { "docid": "425642cc796badbb6615c55dff4489f6", "score": "0.60288787", "text": "appendCellsToRow() {\r\n\r\n\t}", "title": "" }, { "docid": "54baa9d55b840b0fd15c2cb6fdff80d6", "score": "0.6027916", "text": "displayProductTable(productTable) {\n\n // setting up the display table.\n let 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 colors: false,\n style: { head: ['cyan'], border: ['white'] },\n head: ['ID', 'Product Name', 'Department', 'Price', 'Stock']\n });\n\n productTable.forEach(data => {\n table.push(\n [data.item_id, data.product_name, data.department_name, data.price, data.stock_quantity]\n )\n });\n console.log(table.toString());\n }", "title": "" }, { "docid": "8ef33ffdd50d24064441db9ae82e5d38", "score": "0.6024019", "text": "renderTableHead(a, i) {\r\n return (\r\n <TableSquare value={a} key={i} k={i} className=\"square tableFont\" />\r\n );\r\n }", "title": "" }, { "docid": "e039c9191b7c6227ae6dcc4173e532bb", "score": "0.60171014", "text": "function initTable () {\n var table = elem[0].getElementsByTagName('table');\n var t = $(table).DataTable(otUtils.setTableToolsParams({\n 'data': formatDataToArray(scope.ext.data),\n 'ordering': true,\n 'order': [[1, 'asc']],\n 'autoWidth': false,\n 'paging': true,\n 'columnDefs': [\n {\n 'targets': [0], // the access-level (public/private icon)\n 'visible': otConfig.show_access_level,\n 'width': '3%'\n },\n {\n 'targets': [2, 6],\n 'visible': false\n },\n {\n 'targets': [1, 3],\n 'width': '20%'\n },\n {\n 'targets': [1],\n 'render': function (data, type, row) {\n return '<a href=\"/disease/' + row[2] + '\">' + data + '</a>';\n }\n },\n {\n 'targets': [4],\n 'width': '48%',\n 'render': function (data, type, row) {\n var text = data;\n var limit = 260;\n if (data.length > limit) {\n text = '<span>' + data.substring(0, limit) + '</span><span class=\"sysbio-method-more-text hidden\">' + data.substring(limit) + '</span><span class=\"sysbio-method-more-btn\">' + moreHtml + '</span>';\n }\n return '<span class=\"sysbio-method\">' + text + '</span>';\n }\n },\n {\n 'targets': [5],\n 'render': function (data, type, row) {\n return '<a href=\"' + data + '\"><span class=\"ot-publications-string\"><span class=\"badge\">1</span> publication</span></a>';\n }\n }\n ]\n }, (scope.output ? scope.output + '-' : '') + '-systems_biology'));\n\n // Setup click handlers.\n // With Datatables this is the recommended approach (instead of defining onclicks for each cell)\n t.off('click', clickHandler); // remove any old handlers to avoid multiple firing of events\n t.on('click', clickHandler);\n\n return t;\n }", "title": "" }, { "docid": "05872019c1d781dcaf54414aa12b1f84", "score": "0.60140765", "text": "createTableHeaderCell(text, colType, colWidth) {\n let cell = document.createElement('th');\n cell.classList.add(colType);\n cell.setAttribute('col-type', colType.split('-')[0]);\n\n let cellContainer = document.createElement('div');\n\n if(colWidth !== ''){\n cellContainer.classList.add(colWidth);\n }\n\n let textSpan = document.createElement('span');\n textSpan.textContent = text;\n\n let sortArrow = document.createElement('button');\n sortArrow.classList.add('sort-arrow');\n sortArrow.innerHTML = \"&#8675;\";\n sortArrow.style.display = 'none';\n sortArrow.style.color = 'white';\n sortArrow.style.backgroundColor = 'red';\n sortArrow.style.outline = 'none';\n sortArrow.setAttribute('arrow-orientation', 'down');\n\n sortArrow.style.border = 'none';\n\n cellContainer.appendChild(textSpan);\n cellContainer.appendChild(sortArrow);\n\n cell.appendChild(cellContainer);\n return cell;\n }", "title": "" }, { "docid": "cd07ae5d900f17a6ac476edc1b2740c1", "score": "0.60096353", "text": "function setValueOfCell() {\n\t\t\t\tif (cellSizeWithValue > 0) {\n\t\t\t\t\tfor (let i = 1; i < 5; i++) {\n\t\t\t\t\t\tif (cellSizeWithValue == i * 10) {\n\t\t\t\t\t\t\tfor (let j = tab.length - 1; j >= 0; j--) {\n\t\t\t\t\t\t\t\ttab[j].style.width = i * 120 + 300 + 'px';\n\t\t\t\t\t\t\t\ttab[j].style.height = i * 120 + 300 + 'px';\n\t\t\t\t\t\t\t\ttab[j].style.tableLayout = 'fixed';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "0e2fa0da55363b49bfe76127e3526ebe", "score": "0.600578", "text": "function renderFruitCell() {\n\tfruitCell = [getRandomNumber($('tr').length), getRandomNumber($('tr:eq(0)>td').length)]; // get random place for new fruitcell\n\n\t$('td').removeClass('fruitCell'); // remove former fruitcell\n\t\n\t$('tr').eq(fruitCell[0]) // find place on y-axis (vertical)\n\t\t .find('td').eq(fruitCell[1]) // find place on x-axis (horizontal)\n\t\t .addClass('fruitCell'); // add class fruitCell to newly generated fruit\n}", "title": "" }, { "docid": "a5931be40781bb4e03ef440ffbd9e95c", "score": "0.60033125", "text": "function table(data) {\n tabBody.html(\"\");\n data.forEach((dataRow) => {\n let row = tabBody.append(\"tr\");\n Object.values(dataRow).forEach((val) => {\n let ufoInfo = row.append(\"td\");\n ufoInfo.text(val);\n }\n );\n});\n}", "title": "" }, { "docid": "cb266932b0951743c03e763b2fd97818", "score": "0.5997001", "text": "function getMinorDefectsTable(tableID,itemNoID,imageRefID,notesID,recommendationID)\n{\n var data = [];\n var tableBody;\n var table = document.getElementById(tableID);\n var rowCount = table.rows.length;\n\n var firstRow = [\n {\n text:'Maintenance Items and Minor Defects Found (X)',\n color:'red',\n fontSize:10,\n colSpan:4\n },\n '','',''\n ];\n data.push(firstRow);\n\n var secondRow = [\n {\n text:'ITEM NO.',\n fontSize:9,\n fillColor:'#CCCCCC',\n alignment:'center'\n },\n {\n text:'IMAGE REF.',\n fontSize:9,\n fillColor:'#CCCCCC',\n alignment:'center'\n },\n {\n text:'DEFECT NOTES',\n fontSize:9,\n fillColor:'#CCCCCC',\n alignment:'center',\n colSpan:2\n },\n ''\n ];\n data.push(secondRow);\n\n for (var i=0;i<rowCount-1;i++){\n\n var cell1ID = itemNoID + i;\n var cell2ID = imageRefID + i;\n var cell3ID = notesID + i;\n\n\n //console.log(cell1ID);\n //console.log(cell2ID);\n //console.log(cell3ID);\n\n\n var itemNo = getIt(cell1ID);\n var imageRef = getIt(cell2ID);\n var notes = getIt(cell3ID);\n var recommendation = getIt(recommendationID);\n\n if (imageRef == '')\n {\n imageRef = '--'\n }\n if (itemNo == '')\n {\n itemNo = '--'\n }\n if (recommendation == '')\n {\n recommendation = '--'\n }\n\n\n var row = [\n {\n text:itemNo,\n fontSize:9\n },\n {\n text:imageRef,\n fontSize:9\n },\n {\n text:notes,\n fontSize:9,\n colSpan:2\n },\n ''\n ];\n data.push(row)\n }\n\n var recommendationRow = [\n {\n text:'Professional and Trade Recommendations:',\n fontSize:9,\n colSpan:3\n },\n '','',\n {\n text:recommendation,\n fontSize:9\n }\n ];\n data.push(recommendationRow);\n\n tableBody = {\n table: {\n widths: ['auto', 'auto', 'auto','*'],\n body: data\n },\n margin:[0,5,0,10]\n };\n return tableBody;\n}", "title": "" }, { "docid": "7f6ff32a45ade1f9686f1d0d5298eafe", "score": "0.59965676", "text": "function upd_tbl_main () {\n\n main_plan = src_to_5_arr(build_dive());\n //Build main dive table\n dplan_sort_arr(main_plan);\n //Build Total Coms Table\n total_gass_arr(main_plan);\n}", "title": "" }, { "docid": "20a1dfb737ede3d39bc528f9dc230560", "score": "0.5991565", "text": "function cell(content) {\n return new HTML('td',content)\n}", "title": "" }, { "docid": "4ba26bd5a455322b13cd730b5fe36155", "score": "0.5991467", "text": "function TableCell(props) {\n var active = props.active,\n children = props.children,\n className = props.className,\n collapsing = props.collapsing,\n content = props.content,\n disabled = props.disabled,\n error = props.error,\n icon = props.icon,\n negative = props.negative,\n positive = props.positive,\n selectable = props.selectable,\n singleLine = props.singleLine,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n warning = props.warning,\n width = props.width;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOnly */])(active, 'active'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOnly */])(collapsing, 'collapsing'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOnly */])(error, 'error'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOnly */])(negative, 'negative'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOnly */])(positive, 'positive'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOnly */])(selectable, 'selectable'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOnly */])(singleLine, 'single line'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOnly */])(warning, 'warning'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"F\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"H\" /* useVerticalAlignProp */])(verticalAlign), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"I\" /* useWidthProp */])(width, 'wide'), className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"s\" /* getUnhandledProps */])(TableCell, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"r\" /* getElementType */])(TableCell, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_5__lib__[\"d\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n 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 __WEBPACK_IMPORTED_MODULE_6__elements_Icon__[\"a\" /* default */].create(icon),\n content\n );\n}", "title": "" }, { "docid": "4ba26bd5a455322b13cd730b5fe36155", "score": "0.5991467", "text": "function TableCell(props) {\n var active = props.active,\n children = props.children,\n className = props.className,\n collapsing = props.collapsing,\n content = props.content,\n disabled = props.disabled,\n error = props.error,\n icon = props.icon,\n negative = props.negative,\n positive = props.positive,\n selectable = props.selectable,\n singleLine = props.singleLine,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n warning = props.warning,\n width = props.width;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOnly */])(active, 'active'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOnly */])(collapsing, 'collapsing'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOnly */])(error, 'error'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOnly */])(negative, 'negative'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOnly */])(positive, 'positive'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOnly */])(selectable, 'selectable'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOnly */])(singleLine, 'single line'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOnly */])(warning, 'warning'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"F\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"H\" /* useVerticalAlignProp */])(verticalAlign), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"I\" /* useWidthProp */])(width, 'wide'), className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"s\" /* getUnhandledProps */])(TableCell, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"r\" /* getElementType */])(TableCell, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_5__lib__[\"d\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n 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 __WEBPACK_IMPORTED_MODULE_6__elements_Icon__[\"a\" /* default */].create(icon),\n content\n );\n}", "title": "" }, { "docid": "8bc5863e41e8a5de24dc7709e4a18b35", "score": "0.5990864", "text": "getTableScrollRow(i, j, e1, isURL) {\n //<Img src={e1} sty le={{maxWidth: 500}}></Img> //TODO magic style numbers\n return (\n <TableRow key={(\"r_\"+j+\"_\"+i)}>\n <TableCell key={(\"r_\"+j+\"_\"+i)}>\n {(isURL)?(()=>{\n return (\n <div style={{display: 'flex', verticalAlign: 'middle'}}> \n <CopyToClipboard\n onCopy={(e)=>this.snackBarHandle(e)}\n text={e1}\n >\n <WeblinkIcon style={{ marginRight: '3px', marginTop: '3px' }} />\n </CopyToClipboard>\n <a href={e1}>{e1}</a>\n </div>\n )\n })():e1}\n </TableCell>\n </TableRow>\n );\n }", "title": "" }, { "docid": "7251bdb27c1752cbb25e817813e0f523", "score": "0.59907377", "text": "cells () { return (this.cols() - 1) * (this.rows() - 1) }", "title": "" }, { "docid": "501f362112ad1cf6e882dfa312363138", "score": "0.5990191", "text": "function TableCell(props) {\n var active = props.active,\n children = props.children,\n className = props.className,\n collapsing = props.collapsing,\n content = props.content,\n disabled = props.disabled,\n error = props.error,\n icon = props.icon,\n negative = props.negative,\n positive = props.positive,\n selectable = props.selectable,\n singleLine = props.singleLine,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n warning = props.warning,\n width = props.width;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(active, 'active'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(collapsing, 'collapsing'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(error, 'error'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(negative, 'negative'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(positive, 'positive'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(selectable, 'selectable'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(singleLine, 'single line'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(warning, 'warning'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"E\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"G\" /* useVerticalAlignProp */])(verticalAlign), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"H\" /* useWidthProp */])(width, 'wide'), className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"r\" /* getUnhandledProps */])(TableCell, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"q\" /* getElementType */])(TableCell, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_5__lib__[\"d\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n 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 __WEBPACK_IMPORTED_MODULE_6__elements_Icon__[\"a\" /* default */].create(icon),\n content\n );\n}", "title": "" }, { "docid": "f586d4aa7eeb1df9ff9db1a406e09b22", "score": "0.59842193", "text": "function editRow(td) {\n \n }", "title": "" }, { "docid": "ae11828873ea278f243a6c10afc5958c", "score": "0.59794027", "text": "function TableCell(props) {\n var active = props.active,\n children = props.children,\n className = props.className,\n collapsing = props.collapsing,\n content = props.content,\n disabled = props.disabled,\n error = props.error,\n icon = props.icon,\n negative = props.negative,\n positive = props.positive,\n selectable = props.selectable,\n singleLine = props.singleLine,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n warning = props.warning,\n width = props.width;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"y\" /* useKeyOnly */])(active, 'active'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"y\" /* useKeyOnly */])(collapsing, 'collapsing'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"y\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"y\" /* useKeyOnly */])(error, 'error'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"y\" /* useKeyOnly */])(negative, 'negative'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"y\" /* useKeyOnly */])(positive, 'positive'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"y\" /* useKeyOnly */])(selectable, 'selectable'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"y\" /* useKeyOnly */])(singleLine, 'single line'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"y\" /* useKeyOnly */])(warning, 'warning'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"D\" /* useVerticalAlignProp */])(verticalAlign), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"E\" /* useWidthProp */])(width, 'wide'), className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"p\" /* getUnhandledProps */])(TableCell, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"o\" /* getElementType */])(TableCell, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_5__lib__[\"d\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n 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 __WEBPACK_IMPORTED_MODULE_6__elements_Icon__[\"a\" /* default */].create(icon),\n content\n );\n}", "title": "" }, { "docid": "f7226b797d9354d4c71a76e293fad762", "score": "0.59779257", "text": "function MainTable(props) {\n const height = window.innerHeight - 325;\n return <Table\n className=\"Table\"\n dataSource={props.data}\n columns={cols}\n size=\"middle\"\n pagination={ false }\n scroll={{ y: height }}\n locale={ {emptyText: 'No data acquired.' }}\n bordered\n />\n}", "title": "" }, { "docid": "800c6438955866f9f8c2cee0abd45c94", "score": "0.5974569", "text": "function table_creator(newArr) {\n\n //loop through the representative objects\n\n newArr.map(function (item, index, array) {\n\n // body for table 1\n\n row8 = $(\"<tr>\").attr(\"id\", index).click({ param: item.begin_date }, holler)\n row9 = $(\"<td>\").text(item.id);\n row10 = $(\"<td>\").text(item.place);\n row11 = $(\"<td>\").text(item.begin_date);\n blogContainer.append(row8)\n $(\"#\" + index).append(row9, row10, row11)\n })\n }", "title": "" }, { "docid": "6fd266fdb4e07ddef2c4fb9c0d580624", "score": "0.5974175", "text": "function createMainTableFooter() {\n\tvar t = '</table>\\n';\n\tt += '<!-- CHAPTER END -->\\n';\n\treturn t;\n}", "title": "" }, { "docid": "b26cedc08a8d7f8e3c8180c90febdc2d", "score": "0.5968217", "text": "function createTableBody(table,description,url,author){\n let tblBody = table.createTBody();\n let rowCounter = 0;\n if(description != null){\n let tlbDescRow = tblBody.insertRow(rowCounter);\n let tlbDescCell =tlbDescRow.insertCell(0);\n tlbDescCell.colSpan =2;\n tlbDescCell.dataset.id ='description';\n tlbDescCell.innerText = 'Opis zadania: '+ description;\n rowCounter++;\n }\n if(url !== null){\n let tlbUrlRow = tblBody.insertRow(rowCounter);\n let tlbUrlCell =tlbUrlRow.insertCell(0);\n tlbUrlCell.colSpan =2;\n tlbUrlCell.dataset.id ='url';\n tlbUrlCell.innerText =\"Url: \"+ url;\n rowCounter++;\n }\n if(author != ''){\n let tlbAuthorRow = tblBody.insertRow(rowCounter);\n let tlbAuthorCell =tlbAuthorRow.insertCell(0);\n tlbAuthorCell =tlbAuthorRow.insertCell(1);\n tlbAuthorCell.dataset.id='author';\n tlbAuthorCell.innerText = 'Autor: '+ author;\n tlbAuthorCell.classList.add(\"text-right\")\n rowCounter++;\n }\n}", "title": "" }, { "docid": "21306336060982505f3b99dfbb611c88", "score": "0.59633756", "text": "function createTableHeader() {\n return \"<tr><th>Title</th><th>Reference Image</th><th>News Site</th><th>Summary</th><th>Published Date</th>\";\n}", "title": "" }, { "docid": "9d72861774d776a9621be75ee8b31916", "score": "0.59628403", "text": "function buildTable(data){\n tBody.html(\"\") // to clear the data\n data.forEach((rowData) => {\n var row = tBody.append(\"tr\");\n Object.values(rowData).forEach((value) =>{\n var cellData = row.append(\"td\");\n cellData.text(value);\n });\n });\n}", "title": "" }, { "docid": "9d72861774d776a9621be75ee8b31916", "score": "0.59628403", "text": "function buildTable(data){\n tBody.html(\"\") // to clear the data\n data.forEach((rowData) => {\n var row = tBody.append(\"tr\");\n Object.values(rowData).forEach((value) =>{\n var cellData = row.append(\"td\");\n cellData.text(value);\n });\n });\n}", "title": "" }, { "docid": "18a4737e6808fe0ba683a7d365dae133", "score": "0.59614795", "text": "function mainTable(key){\n var dates = [];\n $('#table1').html(\"\");\n var arrays = [];\n for (var i =0;i<9;i++){\n arrays.push(washedData[key][i]);\n}\narrays.push(calculateRental(washedData[key][3]));\ndates.push(arrays);\nvar thead = d3.select(\"#table1\").selectAll(\"th\")\n.data([\"House Name\",\"Phone Number\",\"Address\",\"Units\",\"Community Area Number\",\"Managment Company\",\"Latitude\",\"longitude\",\n\"Distance to the University (m)\",\"Possible Rental Cost (US)\"])\n.enter().append(\"th\").text(function(d) { return d; });\nconsole.log(dates);\nvar tr = d3.select(\"#table1\").selectAll(\"tr\")\n.data(dates).enter().append(\"tr\");\ntr.attr(\"class\", function(d, i){ if (i++ % 2 === 0){return 'row-even'}else {return 'row-odd'}});\n// cells\nvar td = tr.selectAll(\"td\")\n.data(function(d){return d3.values(d)})\n.enter().append(\"td\")\n.text(function(d) {return d});\n}", "title": "" }, { "docid": "e8756b52bd945c971e9d1ffad6afbb33", "score": "0.59600043", "text": "function addTableElement(reportArray, z1, rowNum, header, body, markers) {\n\t//var z1 = document.createElement(\"TABLE\");\n\n\tif (rowNum == 0) {\n\t\tvar row = header.insertRow(rowNum);\n\t}\n\telse {\n\t\tvar row = body.insertRow(rowNum - 1);\n\t\trow.setAttribute(\"height\", \"300\");\n\t}\n\n\tvar cell0 = row.insertCell(0);\n\tvar cell1 = row.insertCell(1);\n\tvar cell2 = row.insertCell(2);\n\tvar cell3 = row.insertCell(3);\n\tvar cell6 = row.insertCell(4);\n\t//var cell7 = row.insertCell(5);\n\tcell0.setAttribute(\"width\", \"3%\");\n\tcell1.setAttribute(\"width\", \"8%\");\n\tcell2.setAttribute(\"width\", \"12%\");\n\tcell3.setAttribute(\"width\", \"10%\");\n\n\tcell6.setAttribute(\"width\", \"15%\");\n\t//cell7.setAttribute(\"width\", \"25%\");\n\n\tcell0.innerHTML = reportArray[0];\n\tif (reportArray[1] == \"Status\") {\n\t\tcell1.innerHTML = reportArray[1]\n\t}\n\telse {\n\t\tcell1.innerHTML = '<div class = \"dropdown\"><button class=\"btn btn-secondary dropdown-toggle\" type=\"button\" id=\"dropdownMenuButton\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">Status</button><div class=\"dropdown-menu\" aria-labelledby=\"dropdownMenuButton\"><a class=\"dropdown-item\" href=\"#\">In Progress</a><a class=\"dropdown-item\" href=\"#\" id =\"action-1\">Almost Done</a><a class=\"dropdown-item\" href=\"#\">Completed</a></div></div>'\n\t}\n\tcell2.innerHTML = reportArray[2];\n\tcell3.innerHTML = reportArray[3];\n\n\n\n\t//var img = document.createElement(\"IMG\");\n\t\n\tif (rowNum == 0) {\n\t\tcell6.innerHTML = \"Image\";\n\t}\n\telse {\n\t\tif (reportArray[4] == 'no image') {\n\t\t\tcell6.innerHTML = \"no image\";\n\t\t}\n\t\telse {\n\t\t\t\n\t\t\t//set rectangle\n\t\t\tvar pothole = reportArray[7];\n\t\t\t\n\n\t\t\tvar canvas = create_canvas(reportArray[4], pothole, \"200\", \"200\");\n\t\t\t//tableDiv = create_canvas_div(\"50\",\"50\", canvas);\n\t\t\tcell6.appendChild(canvas);\n\t\t\t\n\t\t\tvar markerIndex = rowNum - 1;\n\t\t\tvar marker = markers[markerIndex];\n\t\t\t//cell6.innerHTML = \"<img id='myImg' alt='Snow' src = \\\"data:image/jpg;base64,\" +reportArray[4] + \"\\\"width = \\\"100\\\" height = \\\"80\\\">\";\n\t\t\tvar confidense = Math.round(parseFloat(reportArray[3]) * 100) / 100;\n\t\t\t\n\n\t\t\tvar markerDiv = create_marker_infoWindow(create_canvas(reportArray[4], pothole, \"100%\", \"100%\"), confidense);\n\t\t\tmarker.infoWindowContent = markerDiv;\n\t\t\t(function (marker, i) {\n\t\t\tgoogle.maps.event.addListener(marker, 'click', function () {\n\t\t\t\t//infowindow = new google.maps.InfoWindow({ content: markerDiv});\n\t\t\t\tinfoWindow.setContent(marker.infoWindowContent);\n\t\t\t\tinfoWindow.open(map, marker);\n\t\t\t})\n\t\t})(marker, i);\n\t\t}\n\t}\n\t//cell7.innerHTML = reportArray[5];\n\n}", "title": "" }, { "docid": "168615015d745826a2ccd81720c40ac9", "score": "0.5959177", "text": "function createMainTable() {\n // Note that this statement sets the 'inner' var.\n var newt =\n $(document.createElement(\"table\"))\n .attr('align', 'center') // IE sucks.\n .append($(document.createElement(\"tr\"))\n .append(inner = $(document.createElement(\"td\"))));\n\n if (mainTable) {\n mainTable.replaceWith(newt);\n }\n else {\n $(\"body\").append(newt);\n }\n mainTable = newt;\n}", "title": "" }, { "docid": "8d226481a2a1a39069fcc3e4c3f5c514", "score": "0.5957171", "text": "makeTableBetCell(args) {\n this.currentIndex += 1;\n\n const betAreaId = args.id;\n const actualWidth = args.Size.Width - this.currentTable.defaultBorderSize;\n const actualHeight = args.Size.Height - this.currentTable.defaultBorderSize;\n const borderSize = args.BorderSize || this.currentTable.defaultBorderSize;\n const normalAlpha = args.BackColorAlpha || this.currentTable.defaultBackColorAlpha;\n const highlightList = args.Highlight ? args.Highlight : {};\n const betAreasRowsCells = betTable['BetAreasRows'][String(this.currentRow)].length || 0;\n this.currentX = args.Cords && args.Cords.X >= 0 ? args.Cords.X - borderSize : this.currentX;\n this.currentY = args.Cords && args.Cords.Y >= 0 ? args.Cords.Y - borderSize : this.currentY;\n\n // CALL BACKS\n // * Can use default callbacks or your own!\n const clickCallBack = args.Events && args.Events.Click ? this[String(args.Events.Click)] : this.onShapeBetClick;\n const hoverInCallBack = args.Events && args.Events.HoverIN ? this[String(args.Events.HoverIN)] : this.multiBetHoverInShapes;\n const hoverOUTCallBack = args.Events && args.Events.HoverOUT ? this[String(args.Events.HoverOUT)] : this.multiBetHoverOutShapes;\n\n // SET Chip Map\n this.setCipAmountMap(betAreaId, {\n Amount: 0\n });\n\n const Cell = new PIXI.Graphics();\n\n // `this.currentTable.Development.IS_DEBUG_MODE` debugging mode for grid\n this.drawRectangle({\n Shape: Cell,\n LeftX: this.currentX,\n TopY: this.currentY,\n Width: actualWidth,\n Height: actualHeight,\n Background: '0x' + this.currentTable.Development.Grid.Background.replace('#', ''),\n Transparency: this.currentTable.Development.IS_DEBUG_MODE ? normalAlpha : 0,\n BorderSize: borderSize,\n BorderColor: '0x' + this.currentTable.Development.Grid.BorderColor.replace('#', ''),\n BorderTransparency: this.currentTable.Development.IS_DEBUG_MODE ? normalAlpha : 0\n })\n\n Cell.interactive = true;\n Cell.buttonMode = true;\n\n Cell\n .on('pointertap', clickCallBack.bind(this))\n\n Cell\n .on('pointerover', hoverInCallBack.bind(this))\n\n Cell\n .on('pointerout', hoverOUTCallBack.bind(this))\n\n\n this.pixiTableDesign.stage.addChild(Cell);\n\n // This is required to map all shapes\n this.setShapeMap(betAreaId, {\n Config: {\n HighlightShape: false,\n },\n Shape: {\n Width: actualWidth,\n Height: actualHeight,\n X: this.currentX,\n Y: this.currentY,\n NormalBorderSize: borderSize,\n NornalBackColorAlpha: normalAlpha,\n Graphic: Cell\n },\n HighlightShapes: highlightList,\n Id: betAreaId,\n Row: this.currentRow,\n Index: this.currentIndex\n })\n\n // This is required to access it on event handler\n Cell.shapeMap = this.getShapesMap(betAreaId);\n\n this.currentX += actualWidth;\n if (betAreasRowsCells === this.currentIndex) {\n this.currentRow += 1;\n this.currentY += actualHeight;\n this.currentX = 0;\n this.currentIndex = 0;\n }\n }", "title": "" }, { "docid": "53877838c505ba53563b025e701e028d", "score": "0.5956583", "text": "function AddTableCell(value, i, id) {\n var r = new Array();\n var j = 0;\n r[++j] = '<td ';\n r[++j] = (i > 2 ? ' class=\"moreRowsItem' + id + ' hide\" ' : ' ');\n r[++j] = '><span>';\n r[++j] = value;\n r[++j] = '</span></td>';\n return r.join('');\n}", "title": "" }, { "docid": "2ffff758581220a7dfa6047bf8edade4", "score": "0.5951996", "text": "function create_table_body(){\n var tableBody= '';\n for (var form=0; form< numOf_Forms; form++) {\n var id = parsed[form]['form_id'];\n col_id = '<td>'+ parsed[form]['form_id'] +'</td>';\n col_name = '<td>'+ parsed[form]['form_name'] +'</td>';\n col_subs = '<td>'+ parsed[form]['submissions'] +'</td>';\n submit_link = '<td> <button type=\"button\" onclick= \"submit_page(\\'' + id + '\\')\" >View</button></td>';\n submissions_link = '<td> <button type=\"button\" onclick= \"submissions_page(\\'' + id + '\\')\" >View</button></td>';\n\n tableBody += '<tr>'+ col_id + col_name + col_subs + submit_link + submissions_link +'</tr> ';\n }\n return tableBody;\n }", "title": "" }, { "docid": "2446478e4efcd1f659de0fcabdb64a03", "score": "0.5950802", "text": "displayDepartmentTable(departmentTable) {\n\n // setting up the display table.\n let 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 colors: false,\n style: { head: ['cyan'], border: ['white'] },\n head: ['ID', 'Department Name', 'Overhead Costs']\n });\n\n departmentTable.forEach(data => {\n table.push(\n [data.department_id, data.department_name, data.over_head_costs]\n )\n });\n console.log(table.toString());\n }", "title": "" }, { "docid": "f1b6a2d97d99bc9aa2f75279824c4a3a", "score": "0.5949671", "text": "function createCentralityTableCell(value) {\n return \"<td>\" + value + \"</td>\";\n}", "title": "" }, { "docid": "fc4e08cc06f03df718d18f3908686023", "score": "0.59467244", "text": "function basicTable(element, predata){ //REQUIRED\n\t\t\tvar canvas = d3.select(element)\n\t\t\tvar wrapper=canvas.append(\"div\").attr(\"class\",\"ig-basicTable\") //REQUIRED\n\t\t\tfunction transform(data){\n\t\t\t\tvar colList = d3.keys(data[0]);\n\t\t\t\tvar subCols = data.map(function(e){\n\t\t\t\t\tvar current = {}\n\t\t\t\t\tcolList.forEach(function(colName){current[colName]=e[colName]})\n\t\t\t\t\treturn current;\n\t\t\t\t}) \n\t\t\t\tvar rowStart = 0\n\t\t\t\tvar rowCount = data.length \n\t\t\t\tvar subRows = subCols.slice(rowStart, rowStart+rowCount)\n\t\t\t\treturn subRows\n\t\t\t};\n\t\t\tvar sub=transform(predata)\n\t\t\tdraw(canvas,sub);\n\t\t\tfunction draw(canvas, data){\n\t\t\t\t//add table\n\t\t\t\tvar table = canvas.select(\"div.ig-basicTable\").insert(\"table\", \"button\").attr(\"class\",\"table\").datum(settings) \n\n\t\t\t\theaderRow = table.append(\"thead\").append(\"tr\")\n\t\t\t\theaderRow.selectAll(\"th\").data(d3.keys(data[0])).enter().append(\"th\").html(function(d){return d});\n\n\t\t\t\t//add table rows (1 per svg row)\n\t\t\t\tvar tbody = table.append(\"tbody\")\n\t\t\t\tvar rows = tbody.selectAll(\"tr\").data(data).enter().append(\"tr\")\n\n\t\t\t\t//add columns (once per row)\n\t\t\t\tvar cols = rows.selectAll(\"tr\")\n\t\t\t\t\t.data(function(d){return d3.values(d)})\n\t\t\t\t\t.enter()\n\t\t\t\t\t.append(\"td\")\n\t\t\t\t\t.html(function(d){return d});\n\n\t\t\t\t$(table.node()).dataTable();\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "7d9fa07c7cec4e525b175d52f50d62ba", "score": "0.5942456", "text": "returnCol(cell) {\n\t\treturn cell % 9;\n\t}", "title": "" }, { "docid": "4d3d3fc106da76a8c474ece84169de5f", "score": "0.59374493", "text": "function renderTable() {\n clearTable();\n sortInfo();\n\n info.forEach((info) => {\n // Round all scores to 2 decimal places.\n info.baseScore = roundScore(info.baseScore);\n info.installedBonus = roundScore(info.installedBonus);\n info.totalScore = roundScore(info.totalScore);\n\n engagementTableBody.appendChild(createRow(info));\n });\n }", "title": "" }, { "docid": "e94f98fa6d9538b85bfcc16036505b48", "score": "0.59350145", "text": "function getMajorDefectsTable(tableID,itemNoID,imageRefID,notesID,recommendationID)\n{\n var data = [];\n var tableBody;\n var table = document.getElementById(tableID);\n var rowCount = table.rows.length;\n\n var firstRow = [\n {\n text:'Major Defects Found (XX)',\n color:'red',\n fontSize:10,\n colSpan:4\n },\n '','',''\n ];\n data.push(firstRow);\n\n var secondRow = [\n {\n text:'ITEM NO.',\n fontSize:9,\n fillColor:'#CCCCCC',\n alignment:'center'\n },\n {\n text:'IMAGE REF.',\n fontSize:9,\n fillColor:'#CCCCCC',\n alignment:'center'\n },\n {\n text:'DEFECT NOTES',\n fontSize:9,\n fillColor:'#CCCCCC',\n alignment:'center',\n colSpan:2\n },\n ''\n ];\n data.push(secondRow);\n\n for (var i=0;i<rowCount-1;i++){\n\n var cell1ID = itemNoID + i;\n var cell2ID = imageRefID + i;\n var cell3ID = notesID + i;\n\n\n //console.log(cell1ID);\n //console.log(cell2ID);\n //console.log(cell3ID);\n\n\n var itemNo = getIt(cell1ID);\n var imageRef = getIt(cell2ID);\n var notes = getIt(cell3ID);\n var recommendation = getIt(recommendationID);\n\n if (imageRef == '')\n {\n imageRef = '--'\n }\n if (itemNo == '')\n {\n itemNo = '--'\n }\n if (recommendation == '')\n {\n recommendation = '--'\n }\n\n\n var row = [\n {\n text:itemNo,\n fontSize:9\n },\n {\n text:imageRef,\n fontSize:9\n },\n {\n text:notes,\n fontSize:9,\n colSpan:2\n },\n ''\n ];\n data.push(row)\n }\n\n var recommendationRow = [\n {\n text:'Professional and Trade Recommendations:',\n fontSize:9,\n colSpan:3\n },\n '','',\n {\n text:recommendation,\n fontSize:9\n }\n ];\n data.push(recommendationRow);\n\n tableBody = {\n table: {\n widths: ['auto', 'auto', 'auto','*'],\n body: data\n },\n margin:[0,5,0,10]\n };\n return tableBody;\n}", "title": "" }, { "docid": "6101a866d841605a9995e90a9cc63d34", "score": "0.59334457", "text": "function generateTableRow() {\n\tvar emptyColumn = document.createElement('tr');\n\n\temptyColumn.innerHTML = '<td><a class=\"cut\">-</a><span contenteditable></span></td>' +\n\t\t'<td><span data-prefix>$</span><span contenteditable></span></td>' +\n\t\t'<td><span contenteditable>0</span></td>' +\n\t\t'<td><span data-prefix>$</span><span>0.00</span></td>';\n\n\treturn emptyColumn;\n}", "title": "" }, { "docid": "1afa07e596c4e4b2cb2dc2c91c3cb82b", "score": "0.5928496", "text": "function cellsrenderer(row, columnfield, value, defaulthtml, columnproperties,lang) {\n //var lang = new SO1100D1();\n try {\n switch (columnfield.toUpperCase()) {\n case ('RECORDTYPE'): {\n if (value == 1) {\n return '<div style=\"margin: 6px;vertical-align:middle;text-align: ' + columnproperties.cellsalign + ';\">' + lang.CancelACH + '</div>'\n } else {\n return '<div style=\"margin: 6px;vertical-align:middle;text-align: ' + columnproperties.cellsalign + ';\">' + lang.ApplyACH + '</div>'\n //return '<div style=\"margin: 6px;vertical-align:middle;text-align: ' + columnproperties.cellsalign + ';\">' + options.language.ApplyACH + '</div>'\n };\n break;\n };\n case ('AUTHORIZESTATUS'): {\n switch (value) {\n case 1: {\n return '<div style=\"margin: 6px;vertical-align:middle;text-align: ' + columnproperties.cellsalign + ';\">' + lang.ApplyOK + '</div>'\n break;\n };\n case 2: {\n return '<div style=\"margin: 6px;vertical-align:middle;text-align: ' + columnproperties.cellsalign + ';\">' + lang.ACHCancelOK + '</div>'\n break;\n };\n case 3: {\n return '<div style=\"margin: 6px;vertical-align:middle;text-align: ' + columnproperties.cellsalign + ';\">' + lang.ACHFail + '</div>'\n break;\n };\n case 4: {\n return '<div style=\"margin: 6px;vertical-align:middle;text-align: ' + columnproperties.cellsalign + ';\">' + lang.ACHWait + '</div>'\n break; \n }\n default: {\n return '<div style=\"margin: 6px;vertical-align:middle;text-align: ' + columnproperties.cellsalign + ';\">' + lang.ApplyACHing + '</div>'\n break;\n }\n };\n break;\n };\n case ('StopFlag'.toUpperCase()): {\n if (value == 0) {\n return '<div style=\"margin: 6px;vertical-align:middle;text-align: ' + columnproperties.cellsalign + ';\">' + lang.chkNo + '</div>'\n } else {\n return '<div style=\"margin: 6px;vertical-align:middle;text-align: ' + columnproperties.cellsalign + ';color:red;\">' + lang.chkOK + '</div>'\n };\n break;\n };\n default: { return value };\n };\n } finally {\n \n };\n \n }", "title": "" }, { "docid": "403573a8c02e0dde9db7b48d42c6aedf", "score": "0.592239", "text": "buildTable() {\n const { board } = this.state;\n const rows = board.length;\n let table = [];\n\n for(let i = 0; i < rows; i++) {\n const cols = board[i].length;\n let row = [];\n for(let j = 0; j < cols; j++) {\n let key = `${i}-${j}`;\n\n // when the position of the robot found, set robot to that position in the table.\n row.push(<td key={ key }>{ (board[i][j] === \"robot\") ? <div className=\"robo-container\"><i className=\"robot fa fa-android\" aria-label=\"robot\"></i></div> : \"\"}</td>);\n }\n table.push(<tr key={ i }>{row}</tr>);\n }\n \n return table;\n }", "title": "" }, { "docid": "624d33746736918b594b607f21baceb0", "score": "0.59217393", "text": "function updateSubTotal(item) {\n var table = document.getElementById(\"inventories\");\n var tableFoot = document.getElementById(\"total\");\n var footerRow = document.getElementById(\"total-row\");\n cell1 = footerRow.insertCell(0);\n cell1.appendChild(document.createTextNode(\"TOTAL\"));\n cell2 = footerRow.insertCell(1);\n cell2.appendChild(document.createTextNode(\"\"));\n cell3 = footerRow.insertCell(2);\n cell4 = footerRow.insertCell(3);\n cell5 = footerRow.insertCell(4);\n cell5.appendChild(document.createTextNode(\"\"));\n\n let totalForCell3 = Array.from(table.rows).slice(0).reduce((total, row) => {\n return total + parseFloat(row.cells[2].innerHTML);\n }, 0);\n cell3.appendChild(document.createTextNode(totalForCell3));\n\n let totalForCell4 = Array.from(table.rows).slice(0).reduce((total, row) => {\n return total + parseFloat(row.cells[3].innerHTML);\n }, 0);\n cell4.appendChild(document.createTextNode(totalForCell4));\n\n\n\n}", "title": "" }, { "docid": "de2e2480ea74ec593d936a9312ffd966", "score": "0.5921724", "text": "function createSitePartialTable(cellText,divCount,placeID,selectID,fixedLastID)\n{\n var partOfTable = [];\n var rowSpanNumber = Math.ceil(divCount/3);\n var currentDiv = placeID.replace ( /[^\\d.]/g, '' );\n //console.log('the current Div is ' + currentDiv);\n\n for (var i = 0; i<divCount;i=i+3)\n {\n var newRow = [];\n\n //create the first cell in the row. if this is the first row, then write the name, row span. if it is not the\n // first row, then create empty cell will be enough.\n if (i == 0)\n {\n var cell0 = {\n text:cellText,\n rowSpan:rowSpanNumber,\n fontSize:10,\n color:'black',\n bold:true,\n alignment:'center'\n };\n newRow.push(cell0);\n }\n else\n {\n var cell0 = {};\n newRow.push(cell0);\n }\n\n //Create the cells in the row, each loop create two cells. it is possible, in some loops, the id is null, will\n //return '' instead\n for (var a = i; a<i+3;a++)\n {\n var place;\n var select;\n\n var cell1;\n var cell2;\n // console.log(placeID + a);\n //console.log(selectID + a);\n\n place = document.getElementById(placeID + a);\n select = document.getElementById(selectID + a);\n\n\n if (place != null)\n {\n if (currentDiv < 2)\n {\n if (a > fixedLastID)\n {\n place = place.value;\n }\n else\n {\n place = place.textContent;\n }\n }\n else\n {\n place = place.value;\n }\n\n cell1 = {\n text:place,\n style: 'tableText',\n noWrap: true\n };\n }\n else\n {\n cell1 = ''\n }\n\n\n\n if (select != null)\n {\n\n //select = select.value;\n\n cell2 = {\n text:getIt(selectID + a),\n style: 'tableText',\n alignment:'center'\n };\n }\n else\n {\n cell2 = ''\n }\n\n newRow.push(cell1);\n newRow.push(cell2);\n\n }\n partOfTable.push(newRow);\n }\n //console.log(partOfTable);\n return partOfTable;\n}", "title": "" }, { "docid": "3e992e3c500a6fea446f430182dc484a", "score": "0.59205353", "text": "function addTableBody(appointment) {\n var table = document.getElementById(\"appointment-table\");\n var row = table.insertRow(0);\n\n var appointmentID = row.insertCell(0);\n var appointmentDate = row.insertCell(1);\n var appointmentTime = row.insertCell(2);\n var appointmentReason = row.insertCell(3);\n var appointmentStatus = row.insertCell(4);\n\n appointmentID.innerHTML = appointment._id;\n appointmentDate.innerHTML = appointment.appointment_date;\n appointmentTime.innerHTML = appointment.appointment_time;\n appointmentReason.innerHTML = appointment.appointment_reason;\n appointmentStatus.innerHTML = appointment.appointment_status;\n\n // change color based on status\n if (appointment.appointment_status === \"Declined\") {\n\n appointmentStatus.style.color = \"#d1350d\";\n }\n if (appointment.appointment_status === \"Approved\") {\n\n appointmentStatus.style.color = \"#2da44e\";\n }\n if (appointment.appointment_status === \"Pending\") {\n\n appointmentStatus.style.color = \"#f6bd3a\";\n }\n if (appointment.appointment_status === \"Completed\") {\n\n appointmentStatus.style.color = \"#282321\";\n }\n}", "title": "" }, { "docid": "53666058750e242f1e6ae439395d1755", "score": "0.59187275", "text": "function defaultTable(event) {\n\n drawTable(data.slice(0,10));\n}", "title": "" }, { "docid": "6d061282860c2d2879a18f8deac5174b", "score": "0.59156895", "text": "function populatecell(index, content) {\n if (content.length > 0) {\n var cell = curr_row.childNodes[index];\n cell.innerHTML = \"\";\n var cont = document.createElement(\"div\");\n cont.innerHTML = content.toString();\n cont.classList.add(Object.keys(heads)[index], \"entry\");\n cont.classList.add(content.replace(/([^a-z0-9]+)/gi, '_'));\n appendData(cell,\"data-entries\",content.replace(/([^a-z0-9]+)/gi, '_'))\n labeldict[content.replace(/([^a-z0-9]+)/gi, '_')] = content;\n cell.appendChild(cont);\n\n };\n }", "title": "" }, { "docid": "65217a30e64fc67a0821b3dffde02c16", "score": "0.5915408", "text": "function bldt(ri, rf, ci, cf) { \n\n var th = \"<th>\", the = \"</th>\", rw = \"<tr>\", rwe = \"</tr>\", col = \"<td>\", colh = \"</td>\", ival = 0;\n var i, j, yo = \"\", fstrow = ri, fstcol = ci, rowfin = rf, colfin = cf;\n colfin++ ; rowfin++ ; fstcol-- ; fstrow-- ; \n \n for (i = fstrow; i < rowfin; i++) {\n\tyo += rw;\n\tif ( i == fstrow ) {\n\t yo += \"<th class=\\\"hide\\\"></th>\";\n\t} \n\telse{ \n\t yo += th + i + the;\n\t}\n\n\tfor (j = ci; j < colfin; j++) {\n\t if(i != fstrow ) { \n\t\tival = i * j ;\n\t\tyo = yo + col + ival.toString() + colh;\n\t }\n\t else { \n\t\tyo = yo + th + j + the;\n\t } \n\t}\n\tyo += rwe;\n }\n document.getElementById(\"tbl1\").innerHTML = yo;\n document.getElementById(\"frm1\").reset(); \n}", "title": "" }, { "docid": "ff892980612bbea006c374fd21e5bb6b", "score": "0.591497", "text": "createTableCell(colType, text){\n let cell = document.createElement('td');\n cell.classList.add(colType + '-col');\n cell.setAttribute('col-type', colType);\n cell.textContent = text;\n return cell\n }", "title": "" }, { "docid": "b28f34343aafedb61b8a33a4f7fdf68b", "score": "0.5907119", "text": "function addCellsnew (row, tidx, tend, textLines, change) {\n\n if (tidx < tend) {\n row.appendChild(teltnew(\"th\", (tidx + 1).toString()));\n row.appendChild(cteltnewnew(\"td\", change, textLines[tidx].replace(/\\t/g, \"\\u00a0\\u00a0\\u00a0\\u00a0\")));\n return tidx + 1;\n } else {\n row.appendChild(document.createElement(\"th\"));\n row.appendChild(celtnew(\"td\", \"empty\"));\n return tidx;\n }\n }", "title": "" }, { "docid": "d5a7da6bcc0b29078bac636daf9c9252", "score": "0.5903184", "text": "function tableAdder(val , mainData) {\n if(val !== 'Prev Page') {\n tbody.innerHTML = \"\";\n if(val === 'First Page') {\n for(let i = 0 ; i < 10 ; i++) {\n let myBodyTr = document.createElement('tr');\n for(let index in mainData[i]) {\n let myTd = document.createElement('td');\n myTd.innerText = mainData[i][index];\n myBodyTr.appendChild(myTd);\n tbody.appendChild(myBodyTr);\n mainTable.appendChild(tbody);\n }\n }\n }\n else if(val === 'Last Page') {\n for(let i = 90 ; i < 101 ; i++) {\n let myBodyTr = document.createElement('tr');\n for(let index in mainData[i]) {\n let myTd = document.createElement('td');\n myTd.innerText = mainData[i][index];\n myBodyTr.appendChild(myTd);\n tbody.appendChild(myBodyTr);\n mainTable.appendChild(tbody);\n }\n }\n }\n else{\n for(let i = val*10 ; i < (val*10) + 10 ; i++) {\n let myBodyTr = document.createElement('tr');\n for(let index in mainData[i]) {\n let myTd = document.createElement('td');\n myTd.innerText = mainData[i][index];\n myBodyTr.appendChild(myTd);\n tbody.appendChild(myBodyTr);\n mainTable.appendChild(tbody);\n }\n }\n } \n }\n else{\n let prevVal = tbody.children;\n if(prevVal.length !== 0) {\n displayDiv.textContent = \"__!__\";\n let fromVal = prevVal[0].children[0].textContent;\n \n if(+fromVal !== 1) {\n tbody.innerHTML = \"\";\n for(let i = fromVal-11 ; i < fromVal-1 ; i++) {\n let myBodyTr = document.createElement('tr');\n for(let index in mainData[i]) {\n let myTd = document.createElement('td');\n myTd.innerText = mainData[i][index];\n myBodyTr.appendChild(myTd);\n tbody.appendChild(myBodyTr);\n mainTable.appendChild(tbody);\n }\n }\n }\n else{\n let btn = document.querySelector('.stopper');\n let timerId = setInterval(() => {\n btn.style.backgroundColor = \"Silver\";\n } , 100);\n\n setTimeout(() => {\n clearInterval(timerId);\n btn.style.backgroundColor = \"green\";\n } , 1000);\n displayDiv.textContent = \"No page Available Before that\";\n }\n \n }\n else{\n let btn = document.querySelector('.stopper');\n let timerId = setInterval(() => {\n btn.style.backgroundColor = \"Silver\";\n } , 100);\n\n setTimeout(() => {\n clearInterval(timerId);\n btn.style.backgroundColor = \"green\";\n } , 1000);\n displayDiv.textContent = \"No page Available Befor that\";\n }\n \n }\n}", "title": "" }, { "docid": "771dbb4c26361d6b0e9f23dbfacf8034", "score": "0.5900916", "text": "function getAccessLimitationTable(tableID,itemID,imageRefID,selectID,notesID)\n{\n var data = [];\n var tableBody;\n var table = document.getElementById(tableID);\n var rowCount = table.rows.length;\n\n var firstRow = [\n {\n text:'Access Limitations (U)',\n color:'red',\n fontSize:10,\n colSpan:4\n },\n '','',''\n ];\n data.push(firstRow);\n\n var secondRow = [\n {\n text:'ITEM NO.',\n fontSize:9,\n fillColor:'#CCCCCC',\n alignment:'center'\n },\n {\n text:'IMAGE REF.',\n fontSize:9,\n fillColor:'#CCCCCC',\n alignment:'center'\n },\n {\n text:'ACCESS LIMITATIONS',\n fontSize:9,\n fillColor:'#CCCCCC',\n alignment:'center'\n },\n {\n text:'ACCESS NOTES',\n fontSize:9,\n fillColor:'#CCCCCC',\n alignment:'center'\n }\n ];\n data.push(secondRow);\n\n for (var i=0;i<rowCount-1;i++){\n\n var cell1ID = itemID + i;\n var cell2ID = imageRefID + i;\n var cell3ID = selectID + i;\n var cell4ID = notesID + i;\n\n //console.log(cell1ID);\n //console.log(cell2ID);\n //console.log(cell3ID);\n //console.log(cell4ID);\n\n var itemNo = getIt(cell1ID);\n\n var imageRef = getIt(cell2ID);\n var access = getIt(cell3ID);\n var notes = getIt(cell4ID);\n\n if (imageRef == '')\n {\n imageRef = '--'\n }\n if (itemNo == '')\n {\n itemNo = '--'\n }\n\n var row = [\n {\n text:itemNo,\n fontSize:9\n },\n {\n text:imageRef,\n fontSize:9\n },\n {\n text:access,\n fontSize:9\n },\n {\n text:notes,\n fontSize:9\n }\n ];\n data.push(row)\n }\n\n tableBody = {\n table: {\n widths: ['auto', 'auto', 'auto', '*'],\n body: data\n },\n margin:[0,5,0,10]\n };\n return tableBody;\n\n}", "title": "" }, { "docid": "ab41a760e4456e22535101c7c3c0b497", "score": "0.5897932", "text": "function tables(tableName, color, footprint) {\n\n //Erstmal die vorhandene Tabelle löschen\n let allTableRows = document.querySelectorAll(\"tbody tr\");\n for (let i = 0; i < allTableRows.length; i++) {\n allTableRows[i].remove();\n }\n //DOM-Elemente selektieren \n let laender = jsonData.laender;\n let tableTitle = document.querySelector(\"p.tableTitle\");\n let tableTitleDiv = document.querySelector(\"div.tableTitle\");\n let table = document.querySelector(\"div.Table\");\n let platz = document.querySelector(\"div.platz\");\n let parameterKey;\n\n //Werte sortieren\n if (footprint) {\n laender.sort(function (a, b) {\n return parseInt(b.totalOekologischerFussabdruck) - parseInt(a.totalOekologischerFussabdruck);\n });\n } else {\n laender.sort(function (a, b) {\n return parseInt(b.totalBiokapazitaet) - parseInt(a.totalBiokapazitaet);\n });\n }\n\n //Neue Tabelle erzeugen\n for (let i = 0; i < laender.length; i++) {\n let einLand = laender[i];\n if (footprint) {\n parameterKey = einLand.totalOekologischerFussabdruck;\n } else {\n parameterKey = einLand.totalBiokapazitaet;\n }\n let row = addItemTabelle(\n i + 1,\n einLand.name,\n parameterKey);\n }\n //Neue Tabelle Titel erzeugen \n tableTitle.textContent = tableName;\n //Neue Style Eigenschaften erzeugen\n tableTitle.style.backgroundColor = color;\n tableTitle.style.color = \"white\";\n tableTitleDiv.style.backgroundColor = color;\n tableTitleDiv.style.opacity = 0.75;\n table.style.backgroundColor = color;\n table.style.opacity = 0.75;\n table.style.color = \"white\";\n platz.style.backgroundColor = color;\n platz.style.opacity = 0.75;\n}", "title": "" }, { "docid": "01ea2b9c04176249cde86558be70fdbd", "score": "0.58934516", "text": "function createTable() {\n var contentTbody = \"\";\n contentTbody = contentTbody + `\n <tr>\n <td>${loaiXe}</td>\n <td>${soKm}</td>\n <td>${soTime}</td>\n <td>${thanhTien}</td>\n </tr>\n <tr>\n <td>${loaiXe}</td>\n <td>${soKm}</td>\n <td>${soTime}</td>\n <td>${thanhTien}</td>\n </tr>\n <tr>\n <td>${loaiXe}</td>\n <td>${soKm}</td>\n <td>${soTime}</td>\n <td>${thanhTien}</td>\n </tr>\n <tr>\n <td>${loaiXe}</td>\n <td>${soKm}</td>\n <td>${soTime}</td>\n <td>${thanhTien}</td>\n </tr>\n `;\n}", "title": "" }, { "docid": "5fc8a1ed075f4a6dfe119a49d491f3b6", "score": "0.58870876", "text": "function renderData() {\n tableBody.innerHTML = \"\";\n for (var i = 0; i < tableData.length; i++) {\n var data = tableData[i];\n var rows = Object.keys(data);\n var input = tableBody.insertRow(i);\n for (var j = 0; j < rows.length; j++) {\n var field = rows[j];\n var cell = input.insertCell(j);\n cell.innerText = data[field];\n }\n }\n}", "title": "" }, { "docid": "a286b01aa23e1e334f7381246a244e7e", "score": "0.5887079", "text": "switchBuiltTable() {\n this.buildTableBackground();\n this.buildTableBetGrid();\n }", "title": "" }, { "docid": "808b7639d2b769582ce44a2329f557ca", "score": "0.58811957", "text": "buildConfiguration(tile, table) {\n // table.addImageButton(\n // Icon.arrowUpSmall,\n // Styles.clearTransi,\n\n // // configure the tile to signal that it has been\n // // pressed (this sync on client to server)\n // run(() => tile.configure(0))\n // ).size(50);\n\n table.background(Styles.black6);\n table\n .pane((pane) => {\n pane.add(\"test\").left().get().alignment = Align.left;\n pane.row();\n })\n .size(200, 200)\n .pad(10);\n }", "title": "" } ]
83ed064426306a46b37238770728fe41
Recursively remove node and node's children
[ { "docid": "c8634adf6e856fef089988feb9f84a3e", "score": "0.6296282", "text": "function removeChildren(node, keepThis)\n{\n\tif(node === undefined || node === null)\n\t{\n\t\treturn;\n\t}\n\n\twhile (node.hasChildNodes())\n\t{\n\t\tremoveChildren(node.firstChild, false);\n\t}\n\n\t//silence html5 element\n\tif (node.tagName === \"VIDEO\")\n\t{\n\t\tnode.pause();\n\t\tnode.play = function(){console.log('video.play()');}\n\t\tnode.src = \"\";\n\t\tnode.load();\n\t}\n\n\tif(!keepThis) node.parentNode.removeChild(node);\n}", "title": "" } ]
[ { "docid": "beb47a498d47c1b051bd72b012d29815", "score": "0.7641703", "text": "function removeChildren(node) {\n\t\tnode = node.lastChild;\n\t\twhile (node) {\n\t\t\tvar next = node.previousSibling;\n\t\t\trecollectNodeTree(node, true);\n\t\t\tnode = next;\n\t\t}\n\t}", "title": "" }, { "docid": "949a94ce88ff623c06cc156ee70544f7", "score": "0.76063687", "text": "function removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}", "title": "" }, { "docid": "949a94ce88ff623c06cc156ee70544f7", "score": "0.76063687", "text": "function removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}", "title": "" }, { "docid": "949a94ce88ff623c06cc156ee70544f7", "score": "0.76063687", "text": "function removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}", "title": "" }, { "docid": "949a94ce88ff623c06cc156ee70544f7", "score": "0.76063687", "text": "function removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}", "title": "" }, { "docid": "949a94ce88ff623c06cc156ee70544f7", "score": "0.76063687", "text": "function removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}", "title": "" }, { "docid": "949a94ce88ff623c06cc156ee70544f7", "score": "0.76063687", "text": "function removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}", "title": "" }, { "docid": "949a94ce88ff623c06cc156ee70544f7", "score": "0.76063687", "text": "function removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}", "title": "" }, { "docid": "949a94ce88ff623c06cc156ee70544f7", "score": "0.76063687", "text": "function removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}", "title": "" }, { "docid": "949a94ce88ff623c06cc156ee70544f7", "score": "0.76063687", "text": "function removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}", "title": "" }, { "docid": "949a94ce88ff623c06cc156ee70544f7", "score": "0.76063687", "text": "function removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}", "title": "" }, { "docid": "949a94ce88ff623c06cc156ee70544f7", "score": "0.76063687", "text": "function removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}", "title": "" }, { "docid": "0bb2273d1d5406f66fb1d33dfb13b0b4", "score": "0.7597216", "text": "function removeChildren(node) {\n node = node.lastChild;\n while (node) {\n var next = node.previousSibling;\n recollectNodeTree(node, true);\n node = next;\n }\n}", "title": "" }, { "docid": "03a255f5af57865e1a4703c35b1995e7", "score": "0.7586772", "text": "function removeChildren(node) {\n node = node.lastChild;\n\n while (node) {\n var next = node.previousSibling;\n recollectNodeTree(node, true);\n node = next;\n }\n}", "title": "" }, { "docid": "0d1523f5a6181a2ec38bb909127084de", "score": "0.7479541", "text": "function _removeNodesRecursively(node, canRemove) {\n\tvar children=node.childNodes;\n\tfor(var i=0;i<children.length;i++){\n\t\tif (canRemove(children[i], node)) {\n\t\t\tchildren[i].parentNode.removeChild(children[i]);\n\t\t\ti--;\n\t\t}else{\n\t\t\t_removeNodesRecursively(children[i], canRemove);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2bbf43bc7e4887b95f5c97ee78bba3b0", "score": "0.7160019", "text": "function removeKeepChildren(node) {\n var $node = $(node);\n $node.contents().each(function () {\n $(this).insertBefore($node);\n });\n $node.remove();\n }", "title": "" }, { "docid": "54b8c07bab8acabceb23f02d55222ef7", "score": "0.70638543", "text": "function removeAllChildrenFromNode(node){\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n}", "title": "" }, { "docid": "5232377035e2c2268f76eeea4e18836f", "score": "0.70533454", "text": "removeAllChildren(obj) {\n _.each(obj.children, (child) => {obj.remove(child);});\n }", "title": "" }, { "docid": "4ce6fc0925c817f61e5407a85774d450", "score": "0.704357", "text": "function clearChildren(node) {\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n}", "title": "" }, { "docid": "abaf99b538e4264f9ba8574549372722", "score": "0.6895236", "text": "function removeOrphanedChildren(children, unmountOnly) {\n\tfor (var i=children.length; i--; ) {\n\t\tif (children[i]) {\n\t\t\trecollectNodeTree(children[i], unmountOnly);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "341be0eb6e6584401848d17d62db1cce", "score": "0.6859261", "text": "function _removeNodeNameRecursively(node, name) {\n\tvar children=node.childNodes;\n\tfor(var i=0;i<children.length;i++){\n\t\tif(children[i].nodeName == name){\n\t\t\tchildren[i].parentNode.removeChild(children[i]);\n\t\t\ti--;\n\t\t\tcontinue;\n\t\t}else{\n\t\t\t_removeNodeNameRecursively(children[i], name);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "46af49cc71be31814dab7cb06a16c1a7", "score": "0.6850395", "text": "function cleanNode (node){\n if (!node)\n return;\n // remove childs\n while (node.firstChild)\n node.removeChild(node.firstChild);\n // remove node\n var parentNode = node.parentNode;\n if (parentNode){\n parentNode.removeChild(node);\n }\n}", "title": "" }, { "docid": "a68a52579ebcd80dde2c85c2550b1ab0", "score": "0.68362325", "text": "function removeChildrenFromNode(node) {\n\tvar fc = node.firstChild;\n\n\twhile( fc ) {\n\t\tnode.removeChild( fc );\n\t\tfc = node.firstChild;\n\t}\n}", "title": "" }, { "docid": "23cff60f79fa54cfe3d928b4989b1972", "score": "0.6823253", "text": "removeNodeAndChildren(id) {\n\n let nodeFound = this.getNodeById(id)\n\n\n if(nodeFound.parentId !== null) {\n let parentNode = this.getNodeById(nodeFound.parentId)\n parentNode.submenuNodes = parentNode.submenuNodes.filter(node => node.id !== id)\n } else {\n this.nodes = this.nodes.filter(node => node.id !== id)\n }\n }", "title": "" }, { "docid": "065ca0316bbb7f815afa49b4efd4a4c2", "score": "0.6808363", "text": "removeAllChildren() {\n while (this.children.length)\n this.removeChild(this.children[0]);\n }", "title": "" }, { "docid": "61cd479a7f3c5c4b517603f5fc06b5f6", "score": "0.6795722", "text": "function fremoveChildren(forest, node, targets) {\n var children = _.reject(node.c, function(c) {\n return _.find(targets, function(t) { return _.isEqual(t.v, c.v); }); });\n return freplace(forest, node, fnode(node.v, children));\n }", "title": "" }, { "docid": "67fab63e567a2979dd4750b64fe7004c", "score": "0.6775796", "text": "function remove_node_parent(node)\n{\n if(node.value === memorySize)\n {\n //reaches root\n return;\n }\n\n delete node.parent.children;\n queue = [root];\n}", "title": "" }, { "docid": "3f2959e4773b4616ab60a5570491fdc1", "score": "0.67593825", "text": "function removeNodeSaveChildren(node) {\n // We can't save the children if there's no parent node to provide\n // for them.\n const fosterParent = node.parentNode;\n if (!fosterParent) {\n return;\n }\n const children = (node.childNodes || []).slice();\n for (const child of children) {\n insertBefore(node.parentNode, node, child);\n }\n remove(node);\n}", "title": "" }, { "docid": "c2d58e716b5e99ead88a0f90744668e8", "score": "0.6758143", "text": "function removeAllChild(node) {\n\tif (node == undefined || node == null)\n\t\treturn;\n\n\twhile (node.firstChild)\n\t\tnode.removeChild(node.firstChild);\n}", "title": "" }, { "docid": "b490a364266a9faed0227159ee6a22c1", "score": "0.668205", "text": "function clearChildren(node){\n\tnode.innerHTML = \"\";\n}", "title": "" }, { "docid": "abf1d15e8248e9fc2ccff2e7caf38f1b", "score": "0.6679665", "text": "function remove_children(parent) {\n const ls = parent.childNodes;\n while (ls.length > 0) {\n const obj = ls.item(0);\n parent.removeChild(obj);\n }\n}", "title": "" }, { "docid": "a77042cbcb3b1dfdb90b1b24084e39e9", "score": "0.6668863", "text": "function removeAllChildNodes(parent){\n while(parent.firstChild){\n parent.removeChild(parent.firstChild);\n }\n}", "title": "" }, { "docid": "09215893e4356aea1381f455090a7f42", "score": "0.66264504", "text": "removeInternalNodes(node) {\n let children = node.children;\n Object\n .keys(children)\n .forEach(key => {\n if (children[key].doclet.internal) {\n delete children[key];\n }\n else {\n this.removeInternalNodes(children[key]);\n }\n });\n }", "title": "" }, { "docid": "29157bc4a63d94553cb44fabd1d20340", "score": "0.6613182", "text": "function removeAllChildNodes(parent) {\r\n while (parent.firstChild) {\r\n parent.removeChild(parent.firstChild);\r\n }\r\n}", "title": "" }, { "docid": "b66d75aa75bb5544864a1e5834849963", "score": "0.66057014", "text": "detach(node) {\n // if Node is not the root or not detached already\n if (node.parent !== undefined) {\n const parentNode = node.parent;\n // Make it orphan & remove from parent\n node.parent = undefined;\n parentNode.children.splice(node.id, 1);\n }\n }", "title": "" }, { "docid": "8ec5e065656f02cb240ad09bc9b33437", "score": "0.6603846", "text": "function prune(node)\n {\n delete node.index;\n delete node.dateAdded;\n delete node.dateGroupModified;\n delete node.unmodifiable;\n\n if (is_folder(node)) { node.children.forEach(child => prune(child)); }\n\n return node;\n }", "title": "" }, { "docid": "8c601509f765f579353f51b0744a0be6", "score": "0.65931803", "text": "function removeAllChildNodes(parent){\n\twhile (parent.firstChild) {\n\t\tparent.removeChild(parent.firstChild);\n\t}\n}", "title": "" }, { "docid": "1c8962fe14390e159c9926aa9e58e2f6", "score": "0.65870154", "text": "function cleanRecursively(el) {\n\t\tcallCleaners(el);\n\t\tfor(var child=el.firstElementChild!==undefined? el.firstElementChild : el.firstChild; child; \n\t\t\tchild = child.nextElementSibling!==undefined? child.nextElementSibling : child.nextSibling) {\n\t\t\tcleanRecursively(child);\n\t\t}\n\t}", "title": "" }, { "docid": "3057ab1f8d8629113cf482b4e2505146", "score": "0.6583929", "text": "function removeChildren(parentNode){\n while (parentNode.hasChildNodes()){\n parentNode.removeChild(parentNode.firstChild);\n }\n}", "title": "" }, { "docid": "aaed0bf53bad91b21c8944b605c1b055", "score": "0.65802586", "text": "_purge() {\n this.removeChildren(2);\n }", "title": "" }, { "docid": "56efcf6b47a5658900a2534a497cf1ef", "score": "0.6565438", "text": "function removeAllChildNodes(parent) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n}", "title": "" }, { "docid": "56efcf6b47a5658900a2534a497cf1ef", "score": "0.6565438", "text": "function removeAllChildNodes(parent) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n}", "title": "" }, { "docid": "44ed15f74f91f26220791d8ee4ea0ebe", "score": "0.6551061", "text": "function recollectNodeTree(node, unmountOnly) {\n\t// @TODO: Need to make a call on whether Preact should remove nodes not created by itself.\n\t// Currently it *does* remove them. Discussion: https://github.com/developit/preact/issues/39\n\t//if (!node[ATTR_KEY]) return;\n\n\tvar component = node._component;\n\tif (component) {\n\t\tunmountComponent(component, !unmountOnly);\n\t}\n\telse {\n\t\tif (node[ATTR_KEY] && node[ATTR_KEY].ref) { node[ATTR_KEY].ref(null); }\n\n\t\tif (!unmountOnly) {\n\t\t\tcollectNode(node);\n\t\t}\n\n\t\tif (node.childNodes && node.childNodes.length) {\n\t\t\tremoveOrphanedChildren(node.childNodes, unmountOnly);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "53c67ae85acecd427298c2955f38d32a", "score": "0.6551029", "text": "function _removeAllChildNodes(parent) {\n while (parent.firstChild) parent.removeChild(parent.firstChild);\n }", "title": "" }, { "docid": "43c5cbfeb393f262f03870192ec9942d", "score": "0.65379655", "text": "clear(){\n this._children.forEach(function(child,key){\n child.notify(\"node_removed\");\n child._parentNode = null;\n this._children.delete(key);\n this.notify(\"child_removed\", child);\n }, this);\n this._isLoaded = false;\n this.notify(\"force_clear\");\n }", "title": "" }, { "docid": "263405a484ac5b4723d6b3efa91c1577", "score": "0.6519909", "text": "function removeAllChildNodes(parent) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n}", "title": "" }, { "docid": "2bd53310717027cae2120a51ae8edcae", "score": "0.65099835", "text": "function removeAllChildNodes(parent) {\n\twhile (parent.firstChild) {\n\t\tparent.removeChild(parent.firstChild);\n\t}\n}", "title": "" }, { "docid": "d4fca0ca00a28518fb7edeb6027816cf", "score": "0.6502727", "text": "function clearNodes(node) {\r\n\r\n while (node.hasChildNodes()) {\r\n clear(node.firstChild);\r\n }\r\n}", "title": "" }, { "docid": "686595192f53bc5aced8999747de626e", "score": "0.64981717", "text": "function removeChildren(el){\n 'use strict';\n while (el.hasChildNodes()) {\n el.removeChild(el.firstChild);\n }\n}", "title": "" }, { "docid": "5568df4ced2abfce7ec1be1ab91b611a", "score": "0.6450761", "text": "function removeChildren(e)\r\n{\r\n while(e.hasChildNodes())\r\n e.removeChild(e.firstChild);\r\n}", "title": "" }, { "docid": "3c3b6f8eb38b05b26aebdec8b95a1120", "score": "0.6450092", "text": "remove() {\n let loc = this._parent.removeChild(this);\n\n for (const child of this._children) {\n // do not use the set method because we want to insert at a particular location\n child._parent = this._parent;\n\n this._parent.addChild(child, loc++);\n }\n }", "title": "" }, { "docid": "cd9a817b722d6fb1475704c69d571bc6", "score": "0.6446849", "text": "function remover(myNode){\r\n\r\n while(myNode.hasChildNodes())\r\n {\r\n myNode.removeChild(myNode.lastChild);\r\n }\r\n }", "title": "" }, { "docid": "6061c843c07194c0eef2d9d539481879", "score": "0.64284015", "text": "function removeChildren(e)\n{\n jQuery(e).empty();\n}", "title": "" }, { "docid": "39eb4e0206dc715cd9987aad3585c069", "score": "0.64247316", "text": "function ga_clear_children(element) {\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n}", "title": "" }, { "docid": "e2bf6e70c090918737da6f4456031202", "score": "0.64136064", "text": "function removeAllChildren(ele) {\n\twhile(ele.hasChildNodes()) {\n\t\tele.removeChild(ele.lastChild);\n\t}\n}", "title": "" }, { "docid": "99a31795b10e2f4f2c9b0313a7a1c58f", "score": "0.64132756", "text": "function removeUnusedSubtrees(node) {\n if (node instanceof dataflow_1.OutputNode || node.numChildren() > 0 || node instanceof facet_1.FacetNode) {\n // no need to continue with parent because it is output node or will have children (there was a fork)\n return false;\n }\n else {\n node.remove();\n }\n return true;\n}", "title": "" }, { "docid": "51743b1221b705821634da3702056528", "score": "0.6406603", "text": "remove(...args) { \n if (args.length === 2) {\n let node = args[0];\n let item = Object.assign({}, args[1]);\n let field = node.field;\n\n if (field in item) {\n if (item[field] == node.key) {\n if (!node.alternativeTree){\n let res = true;\n for (let i in item) res = res && item[i] === node.value[i];\n if (res){\n node = this.deleteNode(node, node[field]);;\n }\n } else if (node.alternativeTree) {\n delete item[field];\n if (Object.keys(item).length != 0){\n let newAltTree = this.remove(node.alternativeTree, item);\n if (newAltTree) node.value = newAltTree.value;\n node.alternativeTree = newAltTree;\n } else {\n node.alternativeTree = null;\n node = this.deleteNode(node, node[field]);\n }\n }\n }\n\n else if (item[field] > node.key && node.right) {\n node.right = this.remove(node.right, item);\n }\n\n else if (item[field] < node.key && node.left) {\n node.left = this.remove(node.left, item);\n }\n } else {\n let res = true;\n for (let i in item) res = res && item[i] === node.value[i];\n if (res) {\n if (node.alternativeTree) node.alternativeTree = this.remove(node.alternativeTree, item);\n node = this.deleteNode(node, node[field]);\n if (node) node = this.remove(node, item);\n }\n\n else if (node) {\n if (node.alternativeTree) node.alternativeTree = this.remove(node.alternativeTree, item);\n if (node.right) node.right = this.remove(node.right, item);\n if (node.left) node.left = this.remove(node.left, item);\n }\n }\n return node;\n }\n\n else if (args.length === 1) {\n if (this.root) this.root = this.remove(this.root, args[0]);\n }\n }", "title": "" }, { "docid": "fa3c8d4df4aa3df58c1c4494f73914cd", "score": "0.63882643", "text": "function removeUnusedSubtrees(node) {\n if (node instanceof _dataflow__WEBPACK_IMPORTED_MODULE_2__[\"OutputNode\"] || node.numChildren() > 0 || node instanceof _facet__WEBPACK_IMPORTED_MODULE_3__[\"FacetNode\"]) {\n // no need to continue with parent because it is output node or will have children (there was a fork)\n return false;\n }\n else {\n node.remove();\n }\n return true;\n}", "title": "" }, { "docid": "4f3af203606228291af2169c0963df43", "score": "0.63861763", "text": "function clear(node) {\r\n\r\n while (node.hasChildNodes()) {\r\n clear(node.firstChild);\r\n }\r\n node.parentNode.removeChild(node);\r\n}", "title": "" }, { "docid": "707e9ccbcaf5cbb64e20a2597fe041ce", "score": "0.6383312", "text": "function clear(node) {\n if (node.type === 0 /* Branch */) {\n (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.each)(node.children, clear);\n node.children.length = 0;\n node.sizes.length = 0;\n node.items.length = 0;\n }\n else {\n node.items.length = 0;\n node.next = null;\n node.prev = null;\n }\n }", "title": "" }, { "docid": "223eb7203772d7fc3d7ced7fa5c9e969", "score": "0.6382832", "text": "function removeChildren(ele) {\n ele.innerHTML = \"\";\n }", "title": "" }, { "docid": "42cd43a99bb79c0cab59f56e0d420be7", "score": "0.6357454", "text": "removeAllChilds() {\n while (this.div.hasChildNodes()) {\n this.removeChild(this.div.lastChild);\n }\n }", "title": "" }, { "docid": "258fac52b78eaef28af67ed0e3681c50", "score": "0.635485", "text": "removeChildren() {\n while (this._el.firstChild)\n this._el.removeChild(this._el.firstChild);\n }", "title": "" }, { "docid": "39e1be4acd2d461943f9450ea7e0770d", "score": "0.63536763", "text": "function removeChildren(node, keepThis)\n{\n\tif(node === undefined || node === null)\n\t{\n\t\treturn;\n\t}\n\n\t//silence html5 element\n\tif (node.tagName === \"VIDEO\")\n\t{\n\t\tnode.pause();\n\t\tnode.play = function(){console.log('video.play()');}\n\t\tnode.src = \"\";\n\t\tnode.load();\n\t}\n\n\twhile (node.hasChildNodes())\n\t{\n\t\tremoveChildren(node.firstChild, false);\n\t}\n\n\tif(!keepThis) node.parentNode.removeChild(node);\n}", "title": "" }, { "docid": "9d9716d98df15d2828fe7343f1b2bb31", "score": "0.6351848", "text": "function delete_one(node) {\n\n // Get the parent.\n var parent = node.parent().closest('.node');\n\n // Remove the node pk from its parent.\n methods.remove_child_pk.call(tree, parent, pk);\n\n // Process each child.\n methods.children.call(tree, node).each(function() {\n var child = $(this);\n\n // Remove the parent pk.\n methods.remove_parent_pk.call(tree, child, pk);\n\n // If there are no parents left and this child does not already exist\n // at the root, move it.\n if(!methods.has_parent.call(tree, child) && !methods.is_root_node.call(tree, child))\n tree.find('.root > .children').prepend(child);\n });\n\n // Now remove the node.\n node.remove();\n\n // If there is nothing left in the parent, close it.\n if(!methods.children_container.call(tree, parent).children().length)\n methods.toggle_children.call(tree, parent, false);\n\n // Update navigation on parent.\n methods.update_navigation.call(tree, parent);\n }", "title": "" }, { "docid": "48eb04cd175315367101797d09414e12", "score": "0.6343491", "text": "function clearNode(parent)\n{\n while (parent.hasChildNodes())\n {\n parent.removeChild(parent.firstChild);\n }\n}", "title": "" }, { "docid": "3b68b600ee3ccd0c0470864714d6723e", "score": "0.6331801", "text": "function removeChildren(e)\n{\n\twhile(e.hasChildNodes())\n\t\te.removeChild(e.firstChild);\n}", "title": "" }, { "docid": "f18cca50613694a7716a8a72dece5d12", "score": "0.63305193", "text": "function cleanNode(node) {\n \"use strict\";\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n}", "title": "" }, { "docid": "414a8f0f76bd7dd9092774d7c49de237", "score": "0.63184136", "text": "function clear(node) {\r\n if (node.type === 0 /* Branch */) {\r\n algorithm_1.each(node.children, clear);\r\n node.children.length = 0;\r\n node.sizes.length = 0;\r\n node.items.length = 0;\r\n }\r\n else {\r\n node.items.length = 0;\r\n node.next = null;\r\n node.prev = null;\r\n }\r\n }", "title": "" }, { "docid": "89ec66be9ff9f183a05dfc68ada28564", "score": "0.63148826", "text": "removeChild(ajxpNode){\n const removePath = ajxpNode.getPath();\n ajxpNode.notify(\"node_removed\");\n ajxpNode._parentNode = null;\n this._children.delete(ajxpNode.getPath());\n this.notify(\"child_removed\", removePath);\n }", "title": "" }, { "docid": "aadc80dccef2f89f3edb7ae88cdb9e0d", "score": "0.6311267", "text": "function uunodeclear(parent) { // @param Node: parent node\n // @return Node: parent\n // [1][clear children] uu.node.clear(<body>)\n\n var rv = uutag(\"\", parent), v, i = 0;\n\n for (; v = rv[i++]; ) {\n uunodeidremove(v);\n uueventunbind(v);\n }\n while (parent[_lastChild]) {\n parent[_removeChild](parent[_lastChild]);\n }\n return parent;\n}", "title": "" }, { "docid": "d07335ff7e9ee2a9c3c78194c6f634ee", "score": "0.6302363", "text": "remove() {\n let loc = this._parent.removeChild(this);\n for (const child of this._children) {\n // do not use the set method because we want to insert at a particular location\n child._parent = this._parent;\n this._parent.addChild(child, loc++);\n }\n }", "title": "" }, { "docid": "6dbdc9290e17f67eb9c1cade7a77a767", "score": "0.6287393", "text": "function clearChildren(parent) {\n while (parent.firstChild !== null) {\n parent.removeChild(parent.firstChild);\n }\n}", "title": "" }, { "docid": "407d50854a527b3e12d139386a985330", "score": "0.6265696", "text": "remove(data)\n{\n // root is re-initialized with\n // root of a modified tree.\n this.root = this.removeNode(this.root, data);\n}", "title": "" }, { "docid": "3f93cebebe36cc24b7f854324a7795c0", "score": "0.62624097", "text": "removeAllChildren(){this.__childNodes=[];this.repeats=[];this.dispatchNodeEvent(new NodeEvent(\"repeated-fields-all-removed\",this.repeats,!1))}", "title": "" }, { "docid": "b0575345d51b9af38b0b44b5e8dda8e5", "score": "0.62575763", "text": "_remove(leaf) {\n if (leaf === this.root) {\n this.root = null;\n return;\n }\n const parent = leaf.parent;\n const grandParent = parent.parent;\n let sibling;\n if (parent.left === leaf) {\n sibling = parent.right;\n }\n else {\n sibling = parent.left;\n }\n if (grandParent) {\n if (grandParent.left === parent) {\n grandParent.left = sibling;\n }\n else {\n grandParent.right = sibling;\n }\n sibling.parent = grandParent;\n let currentNode = grandParent;\n while (currentNode) {\n currentNode = this._balance(currentNode);\n currentNode.bounds = currentNode.left.bounds.combine(currentNode.right.bounds);\n currentNode.height = 1 + Math.max(currentNode.left.height, currentNode.right.height);\n currentNode = currentNode.parent;\n }\n }\n else {\n this.root = sibling;\n sibling.parent = null;\n }\n }", "title": "" }, { "docid": "86b93c9cf45cbeb9ec7aed2a4b15fd38", "score": "0.6256153", "text": "clear () {\n const taskCenter = getTaskCenter(this.docId)\n /* istanbul ignore else */\n if (taskCenter) {\n this.pureChildren.forEach(node => {\n taskCenter.send(\n 'dom',\n { action: 'removeElement' },\n [node.ref]\n )\n })\n }\n this.children.forEach(node => {\n node.destroy()\n })\n this.children.length = 0\n this.pureChildren.length = 0\n }", "title": "" }, { "docid": "b466311c9e48347b63360258ac4dd310", "score": "0.62512136", "text": "function purgeChildren(element) {\n var children = element.childNodes;\n\n if (children) {\n var l = children.length, i, child;\n\n for (i = 0; i < l; i++) {\n var child = children[i];\n\n /* Just purge element nodes, not text, etc. */\n if (child.nodeType == 1)\n purge(children[i]);\n }\n }\n }", "title": "" }, { "docid": "c55ee9928c6e5ce5feac1d9c196f8f35", "score": "0.6248111", "text": "function removeChildren(elem) {\n while (elem.firstChild){\n\telem.removeChild(elem.lastChild);\n }\n}", "title": "" }, { "docid": "caf9b435b5b033588565e470f8016c5e", "score": "0.62467784", "text": "function cleanTree(tree) {\n if (Array.isArray(tree)) return tree.map(cleanTree);\n if (tree.children) tree.children = tree.children.slice(0, - 1).map(cleanTree);\n if (tree.chain) tree.chain = cleanTree(tree.chain);\n return tree;\n }", "title": "" }, { "docid": "7857fe550d6f224116e4d047a6c324bd", "score": "0.62460256", "text": "function remove_children(id){\n var myNode = document.getElementById(id);\n while (myNode.firstChild) {\n myNode.removeChild(myNode.firstChild);\n }\n}", "title": "" }, { "docid": "14bfc2e53758a2b0d4d7ea178ab826c5", "score": "0.62433714", "text": "function remove_node_rec(parent, tree) {\n if (typeof parent == 'object') {\n if (Object.keys(parent).length == 0) {\n delete tree[value];\n } else {\n var key = Object.keys(parent)[0];\n if (tree.hasOwnProperty(key)) {\n tree[key] = remove_node_rec(parent[key], tree[key]);\n }\n }\n } else {\n if (tree.hasOwnProperty(parent)) {\n delete tree[parent];\n }\n }\n return tree;\n}", "title": "" }, { "docid": "f0e892a647bef285423afd75f66e46ae", "score": "0.62417096", "text": "removeChildren() {\n while (this._el.firstChild)\n this._el.removeChild(this._el.firstChild);\n }", "title": "" }, { "docid": "612783fb6c9c60ae87c411ed61a547d0", "score": "0.622915", "text": "function _XMLNode_clear()\n{\n\tthis.setModified( true );\n\tthis.children = new Array();\n\tfor( ;this.domNode.childNodes.length > 0 ; )\n\t{\n\t\tthis.domNode.removeChild( this.domNode.childNodes[0] );\n\t}\n}", "title": "" }, { "docid": "e619147ed690a5ac8f9eb1bff3dda840", "score": "0.62243843", "text": "function RemoveChildren(parentNode) {\n if (parentNode) {\n while (parentNode.hasChildNodes()) {\n parentNode.removeChild(parentNode.lastChild);\n }\n }\n}", "title": "" }, { "docid": "e619147ed690a5ac8f9eb1bff3dda840", "score": "0.62243843", "text": "function RemoveChildren(parentNode) {\n if (parentNode) {\n while (parentNode.hasChildNodes()) {\n parentNode.removeChild(parentNode.lastChild);\n }\n }\n}", "title": "" }, { "docid": "1f6b8684daade53c78623797752c16bf", "score": "0.6223521", "text": "removeByNode(node) {\n // there is three case for removing a node N:\n // - N has no child, we can simply remove it\n // - N has one child, we need to attach it to the parent of the removed node\n // - N has two child, we need to find a node N' with no child that can replace N.\n // To maintain the BST property, we can take the smallest value greater than N,\n // which is fortunately the \"leftest\" value of the right subtree of N.\n // Then, we fix the red-black violations\n\n const value = node.value;\n if (node.left == null && node.right == null) { // case 1\n // the node has no child\n this._repairRemove(node);\n this._splice(node); // node has one or no child, splice it\n } else if (node.left == null || node.right == null) { // case 2\n const spliced = this._splice(node); // node has one child, splice it\n this._repairRemove(spliced);\n } else { // case 3\n // find the leftest node of the right subtree\n let leftest = node.right;\n while (leftest.left != null) {\n leftest = leftest.left;\n }\n\n // replace the node to remove by the leftest node\n node.value = leftest.value;\n // remove the leftest node\n this.removeByNode(leftest);\n }\n return value;\n }", "title": "" }, { "docid": "1440a7187f370084e0bcb3e4d2916394", "score": "0.62131786", "text": "function removeAllChildren(parent) {\n var kids = parent.children;\n var numKids = kids.length;\n // Remove all kids\n while (numKids > 0) {\n //keep at least one default\n parent.remove(kids[numKids - 1]);\n numKids--;\n }\n updateUILayout(parent); //Update UI\n }", "title": "" }, { "docid": "4d822cea468f968126d5ada1e18f3522", "score": "0.6212742", "text": "scrubElementJOSData(node){// attempt to replace things inside very aggressively\nfor(var i in node.children){node.removeAttribute(\"data-jos-id\");node.removeAttribute(\"data-jos-location\");// deep scrub child references\nif(node.children[i].children){this.scrubElementJOSData(node.children[i])}}}", "title": "" }, { "docid": "daf5beb2d89784b0183e05446f2818f6", "score": "0.62078047", "text": "function deleteAllChildren(el) {\n while (el.lastChild) el.removeChild(el.lastChild)\n}", "title": "" }, { "docid": "0cc9b92101a0b96460be86594535a0fc", "score": "0.6201247", "text": "removeEmptyTextNodes(node) {\n recursiveRemoveEmptyTextNodes(node);\n }", "title": "" }, { "docid": "850a082d89f451ed8b206edaac1b30ce", "score": "0.6195176", "text": "function removeChildren(element) {\n purgeChildren(element);\n element.innerHTML = '';\n }", "title": "" }, { "docid": "d858c6c211e12d8290fbf243f9c9374e", "score": "0.61859107", "text": "function clearNode(node){\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n }", "title": "" }, { "docid": "9cab8b9644b1913e6556f82f477112b0", "score": "0.6182523", "text": "function removeAllChildren(element) {\n var length = element.childNodes.length;\n for (var i = 0; i < length; i++) {\n element.removeChild(element.childNodes[0]);\n }\n}", "title": "" }, { "docid": "c72c0833f0f5c52865b8624df3e7b0bf", "score": "0.6182002", "text": "function removeDestroyedChildren(parentNode) {\n var forceRemoval = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];\n\n var child = parentNode.childNodes.head;\n var nextChild = undefined,\n method = undefined;\n while (child) {\n nextChild = child.next;\n if (child.isRemoved || forceRemoval) {\n removeDestroyedChildren(child, true);\n method = child.postNode.type;\n if (!destroyHooks[method]) {\n throw new Error('editor-dom cannot destroy \"' + method + '\"');\n }\n destroyHooks[method](child, child.postNode);\n parentNode.childNodes.remove(child);\n }\n child = nextChild;\n }\n }", "title": "" }, { "docid": "5d51e8fce1e6bf8053006dddb867ba5a", "score": "0.61656356", "text": "remove(value){\n this.root = this.recursiveRemove(value, this.root);\n }", "title": "" }, { "docid": "88d10a5e05a6cfc24052b55c56d82d7c", "score": "0.6162518", "text": "remove(data) {\n // A recursive function to perform the node removal.\n const removeNode = function(node, data){\n // Check if we have an empty tree.\n if (node === null) {\n return null;\n }\n // If we find a node that matches the data.\n if (data === node.data) {\n // Base Case 1: node has no children, return null.\n if (node.left === null && node.right === null) {\n return null; // set the reference to the node to null\n }\n // Node has no left child, replace the node reference with\n // whatever on the right.\n if (node.left === null) {\n return node.right;\n }\n // Node has no right child, replace the node reference with\n // whatever on the left.\n if (node.right === null) {\n return node.left;\n }\n // Node has two children.\n var tmpNode = node.right; // go to the right subnode\n // Go all the way left down to the left leaf node.\n while (tmpNode.left !== null) {\n tmpNode = tmpNode.left;\n }\n node.data = tmpNode.data; // update the node data with the left\n // leaf node data\n node.right = removeNode(node.right, tmpNode.data); // recursion\n return node;\n } else if (data < node.data) {\n node.left = removeNode(node.left, data);\n return node;\n } else {\n node.right = removeNode(node.right, data);\n return node;\n }\n }\n this.root = removeNode(this.root, data); // call the function at the end\n }", "title": "" }, { "docid": "cd747e812cda9c3afb55c6f2c8c3a3b5", "score": "0.6145752", "text": "function removeChildren(node, name) {\n name = name.toLowerCase();\n // Iterate backwards to simplify array removal. (thanks to @the31)\n for (var i = node.childNodes.length - 1; 0 <= i; i--) {\n var c = node.childNodes[i];\n if (c.nodeName.toLowerCase() === name) {\n node.removeChild(c);\n }\n }\n}", "title": "" }, { "docid": "f63c8ea22d90afc42bff7d749df2adf7", "score": "0.61300844", "text": "unvisitAllNodes() {\n this.getNodes().forEach(node => {\n node.unVisit();\n });\n }", "title": "" }, { "docid": "83309c030e4bbeeb39ec6b4d21bc5a22", "score": "0.61077553", "text": "function eraseChilds(elem){\n\t\t\tvar length = elem.childNodes.length;\n\t\t\t\n\t\t\tfor (var i = length-1; i>=0; i--){\n\t\t\t\telem.childNodes[i].remove()\n\t\t\t}\n\t\t}", "title": "" } ]
a2a20c0ee0ffa3d319d12e656e2c8875
This function is used to make each button do its specific event such as delete, backspace, and previous
[ { "docid": "5ec3e629a26eca405b8d747f89270719", "score": "0.0", "text": "function calcKeys(e) {\r\n var calcValue = document.getElementById(\"calcWindow\").value;\r\n var calcDecimal = document.getElementById(\"decimals\").value;\r\n\r\n //this switch case does the same thing but allows the user to use the keyboard to type the equation out\r\n switch (e.key) {\r\n case \"Delete\":\r\n calcValue = \"\";\r\n break;\r\n case \"Enter\":\r\n calcValue += \" = \" + evalEq(calcValue, calcDecimal);\r\n break;\r\n case \"ArrowUp\":\r\n calcValue += lastEq(calcWindow.value);\r\n e.preventDefault();\r\n }\r\n //this document variable is used to put the swtich case into action\r\n document.getElementById(\"calcWindow\").value = calcValue;\r\n}", "title": "" } ]
[ { "docid": "88112a913ef58be351536b65cd239048", "score": "0.6896268", "text": "initButtonsEvents() {\n // get all events on button child elements\n let buttons = document.querySelectorAll(\"#buttons > g, #parts > g\");\n\n // listen events on button\n buttons.forEach((btn, index) => {\n // get events\n this.addEventListenerAll(btn, \"click drag\", (e) => {\n // extracting text from button\n let txt = btn.className.baseVal.replace(\"btn-\", \"\");\n\n // action btn\n this.execBtn(txt);\n\n //Debug get class from button\n //console.log(btn.className.baseVal.replace('btn-',''));\n });\n\n // format cursor for all events on buttons\n this.addEventListenerAll(btn, \"mouseover mouseup mousedown\", (e) => {\n // cursor pointer\n btn.style.cursor = \"pointer\";\n });\n });\n }", "title": "" }, { "docid": "bf1ae274c18c1d4ee66c9ee6ae417d20", "score": "0.6879732", "text": "initButtonEvents(){\n let buttons = document.querySelectorAll(\"#buttons > g, #parts > g\");\n\n buttons.forEach((lstBtn, index) => {\n this.addEventListenerAll(lstBtn, 'click,drag', execEvt => {\n let bClick = lstBtn.className.baseVal.replace(\"btn-\", \"\");\n this.buttonController(bClick);\n });\n\n this.addEventListenerAll(lstBtn, 'mouseover,mouseup,mousedown', execEvt => {\n lstBtn.style.cursor = \"pointer\";\n });\n });\n }", "title": "" }, { "docid": "14426f4ccda9a4d6f7b5ec9a3ebb2286", "score": "0.6877426", "text": "function addEventToButtons(){\n let allDelete = document.getElementsByClassName( \"delete\");\n for (const button of allDelete) {\n button.addEventListener(\"click\" ,deleting );\n }\n let allMark = document.getElementsByClassName( \"mark\");\n for (const button of allMark) {\n button.addEventListener(\"click\" ,marking );\n }\n}", "title": "" }, { "docid": "4f49bd7159d004e60018fe908f620ef1", "score": "0.68673664", "text": "getDisplayKeyboardButtons(){\n numberButtons.forEach(button => {\n button.addEventListener('click', () => {\n this.appendNumber(button.innerText)\n this.updateDisplay()\n })\n })\n\n operationButtons.forEach(button => {\n button.addEventListener('click', () => {\n this.chooseOperation(button.innerText)\n this.updateDisplay()\n })\n })\n\n equalsButton.addEventListener('click', button => {\n this.compute()\n this.updateDisplay()\n })\n\n allClearButton.addEventListener('click', button => {\n this.clear()\n this.updateDisplay()\n })\n\n deleteButton.addEventListener('click', button => {\n this.delete()\n this.updateDisplay()\n })\n }", "title": "" }, { "docid": "98e9aa50ff21810d2223c965adc16f15", "score": "0.68031716", "text": "function buttonHandler() {\r\n\t\tvar value = $(this).attr('data-action');\r\n\t\tswitch(value) {\r\n\t\t\tcase 'Delete':\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'SelectAll':\r\n\t\t\t\t$buddySelList.setSelectedState(true);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'Deselect':\r\n\t\t\t\t$buddySelList.setSelectedState(false);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\r\n\t}", "title": "" }, { "docid": "e33b6bc2d5e44f51c6242b8e2b454d51", "score": "0.67518663", "text": "function identifyButtons(){\n\tfor (var i = 0; i < songs.length; i++) {\n\t\tdocument.getElementsByClassName(\"delete\")[i].addEventListener(\"click\", erase);\n\t}\n}", "title": "" }, { "docid": "63c96e79b43f398e2d8aa9525da1de98", "score": "0.6463434", "text": "function handleDeleteButtons()\n{\n $('button[data-action=\"delete\"]').click(function(){\n target = this.dataset.target;\n $(target).remove();\n });\n}", "title": "" }, { "docid": "5e0d785bd4bd9f8f6a18a95265631cb7", "score": "0.6413096", "text": "function listenForButton() {\n\n\t\ttag.on('simpleKeyChange', function(left, right) {\n\n\t\t\tif (left) {\n\t\t\t\tglobal.logging(tag.address + '(' + tag.type +')> left: ' + left);\n\t\t\t}\n\n\t\t\tif (right) {\n\t\t\t\tglobal.logging(tag.address + '(' + tag.type +')> right: ' + right);\n\t\t\t}\n\n\t\t\t// if both buttons are pressed, disconnect:\n\t\t\tif (left && right) {\n\t\t\t\tglobal.logging(tag.address + '(' + tag.type +')> Both BTN Pressed');\n\t\t\t\ttag.disconnect();\n\t\t\t}\n\t });\n\t}", "title": "" }, { "docid": "1420bd87f7ccce328bb00ab2d0dfde58", "score": "0.6371826", "text": "function buttonsListen() {\n for (i = 0; i < finishButtons.length; i++) {\n let button = finishButtons[i];\n let num = i;\n button.addEventListener(\"click\", function() {\n list1.tasks[num].finish();\n list1.render(taskList);\n buttonsListen();\n });\n }\n for (i = 0; i < deleteButtons.length; i++) {\n let button = deleteButtons[i];\n let num = i;\n button.addEventListener(\"click\", function() {\n list1.tasks.splice(num, 1);\n list1.render(taskList);\n buttonsListen();\n });\n }\n}", "title": "" }, { "docid": "9dec716792ec910b21c0d1cb9b08d185", "score": "0.63712126", "text": "function setupButtons(){\n /*$('.choice').on('mouseover', function(){\n $(this).css({'background-color':'#e1e1e1'});\n });\n $('.choice').on('mouseout', function(){\n $(this).css({'background-color':'#e1e1e1'});\n })*/\n $('.choice').on('click', function(){\n picked = $(this).attr('data-index');\n $('.choice').removeAttr('style').off('mouseout mouseover');\n $(this).css({'color':'black','background-color':'#FFB81C'});\n if(submt){\n submt=false;\n $('#submitbutton')./*css({'color':'#000'}).*/on('click', function(){\n $('.choice').off('click');\n $(this).off('click');\n processQuestion(picked);\n });\n }\n })\n }", "title": "" }, { "docid": "616560a682ce04299bb9e8de7df47a18", "score": "0.63673156", "text": "function button_clicked() {\n //Clear style of all button\n main_buttons.forEach(b => {\n b.style.color = \"white\";\n b.style.backgroundColor = \"rgba(50, 57, 66, 0.952)\";\n })\n\n //Select button\n this.style.color = \"black\";\n this.style.backgroundColor = \"white\";\n mode = this.innerText;\n }", "title": "" }, { "docid": "2214ff66dd8a52492f7d773bb7cb312f", "score": "0.6351718", "text": "function handleButtons(e) {\n if (e.target.className === \"btn-success\") {\n document.querySelectorAll('.btn-success').forEach(button => {\n if (button.getAttribute('success_id') === e.target.attributes.getNamedItem('success_id').value) {\n newLikes = parseInt(button.innerText.slice(-1)) + 1\n button.innerText = button.innerText.slice(0,-1) + newLikes\n\n let id = e.target.attributes.getNamedItem('success_id').value\n changeLikes(id, newLikes)\n }\n })\n } else if (e.target.className === \"btn-danger\") {\n // Delete in database\n document.querySelectorAll('.btn-danger').forEach(button => {\n if (button.getAttribute('danger_id') === e.target.attributes.getNamedItem('danger_id').value) {\n deleteQuote(e.target.attributes.getNamedItem('danger_id').value)\n document.getElementById(e.target.attributes.getNamedItem('danger_id').value).hidden = true\n\n }\n })\n\n // Delete on page\n // let quote = document.querySelector(`.${e.target.className}`)\n\n }\n}", "title": "" }, { "docid": "ac6b15d647f05ce3ff42873c2fa93779", "score": "0.63000053", "text": "function setDeleteBtnListeners(){\n var deleteBtns = document.getElementsByClassName(\"delete_item_button\");\n for(var i = 0; i < deleteBtns.length; i++){\n var btn = deleteBtns[i];\n btn.addEventListener('click', function(event){\n removeItem(event);\n });\n }\n}", "title": "" }, { "docid": "c25d2b1de10c8b39bed2fc00f6ecdf8d", "score": "0.62622577", "text": "function aButton(){\n processLocal();\n buttonPress(info, ID, '#ALL');\n }", "title": "" }, { "docid": "28488b7dad1abe158ad23d07d8859827", "score": "0.62498194", "text": "function listenForButton() {\n\t\ttag.on('simpleKeyChange', function(left, right) {\n\t\t\tif (left) {\n\t\t\t\tconsole.log('left: ' + left);\n\t\t\t}\n\t\t\tif (right) {\n\t\t\t\tconsole.log('right: ' + right);\n\t\t\t}\n\t\t\t// if both buttons are pressed, disconnect:\n\t\t\tif (left && right) {\n\t\t\t\ttag.disconnect();\n\t\t\t}\n\t });\n\t}", "title": "" }, { "docid": "28488b7dad1abe158ad23d07d8859827", "score": "0.62498194", "text": "function listenForButton() {\n\t\ttag.on('simpleKeyChange', function(left, right) {\n\t\t\tif (left) {\n\t\t\t\tconsole.log('left: ' + left);\n\t\t\t}\n\t\t\tif (right) {\n\t\t\t\tconsole.log('right: ' + right);\n\t\t\t}\n\t\t\t// if both buttons are pressed, disconnect:\n\t\t\tif (left && right) {\n\t\t\t\ttag.disconnect();\n\t\t\t}\n\t });\n\t}", "title": "" }, { "docid": "28488b7dad1abe158ad23d07d8859827", "score": "0.62498194", "text": "function listenForButton() {\n\t\ttag.on('simpleKeyChange', function(left, right) {\n\t\t\tif (left) {\n\t\t\t\tconsole.log('left: ' + left);\n\t\t\t}\n\t\t\tif (right) {\n\t\t\t\tconsole.log('right: ' + right);\n\t\t\t}\n\t\t\t// if both buttons are pressed, disconnect:\n\t\t\tif (left && right) {\n\t\t\t\ttag.disconnect();\n\t\t\t}\n\t });\n\t}", "title": "" }, { "docid": "68f2892d41cd6233dd856ecf14050fe0", "score": "0.62326324", "text": "function listenForButton() {\n tag.on('simpleKeyChange', function (left, right) {\n if (left) {\n console.log('left: ' + left);\n }\n if (right) {\n console.log('right: ' + right);\n }\n // if both buttons are pressed, disconnect:\n if (left && right) {\n tag.disconnect();\n }\n });\n }", "title": "" }, { "docid": "cc28b32cb89c1493ffaf9af16b77a494", "score": "0.62290686", "text": "function enableButtons (){\n $(document).on('click', '.number-button', numButtonClick);\n $(document).on('click', '.operator-button', operatorButtonClick);\n $(document).on('click', '.equal-button', postDataOnEqual);\n $(document).on('click', '#clearButton', clearAll);\n\n}", "title": "" }, { "docid": "7b1310d07661e4ec3c40997fe0a96bb4", "score": "0.6211358", "text": "function inputButtonOnClick() {\n /**\n * Init function.\n */\n var inputs = $(\"#inputs\");\n inputs.click((event) => {\n var target = event.target;\n // if click on buttons\n if (target.nodeName === \"BUTTON\") {\n // which operation\n if ($(target).hasClass(\"push\")) {\n var inputArea = $(\"#input_text\");\n var input = inputArea.val().trim();\n var inputs = getInputs(input);\n if (inputArea.val().length == 0) {\n return;\n }\n pushStr(target, inputs);\n updatePush(target, inputs);\n inputArea.val(\"\");\n } else if ($(target).hasClass(\"pop\")) {\n var str = popStr(target);\n updatePop(target, str);\n } else if ($(target).hasClass(\"search_button\")) {\n search_textButtonOnClick();\n } else if ($(target).hasClass(\"example_button\")) {\n exampleButtonOnClick();\n } else if ($(target).hasClass(\"clear\")) {\n $(\"#input_text\").val(\"\");\n }\n }\n });\n}", "title": "" }, { "docid": "980a945bbd906d00adf58f56a1129327", "score": "0.6209647", "text": "function listenForButton() {\n\t\ttag.on('simpleKeyChange', function(left, right) {\n\t\t\tif (left) {\n\t\t\t\tconsole.log('left: ' + left);\n\t\t\t}\n\t\t\tif (right) {\n\t\t\t\tconsole.log('right: ' + right);\n\t\t\t}\n\t\t\t// if both buttons are pressed, disconnect:\n\t\t\tif (left && right) {\n\t\t\t\ttag.disconnect();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "46be2bf5abef29b39937b2c82e5fc20f", "score": "0.620842", "text": "function processButton(param) {\n\n switch (param.element) {\n case \"조회\":\n v_global.process.handler = processRetrieve;\n if (!checkUpdatable({})) return;\n processRetrieve({});\n break;\n case \"추가\":\n v_global.process.handler = processInsert;\n if (!checkUpdatable({})) return;\n processInsert({});\n break;\n case \"삭제\":\n v_global.process.handler = processRemove;\n if (!checkManipulate({})) return;\n checkRemovable({});\n break;\n case \"저장\":\n processSave({});\n break;\n case \"닫기\":\n checkClosable({});\n break;\n }\n\n}", "title": "" }, { "docid": "d63910cb0fdc1a01a22c9bb527eb4ccd", "score": "0.6194006", "text": "buttonMaker(){\n let length = buttonList.length;\n let numberOfRows = Math.ceil(length / 4);\n let lastRow = length % 4;\n for (let i = 0; i < buttonList.length; i++){ // Loop through the saved commands\n let buttonX = (i % 4) * 200;\n let buttonY = ( Math.floor(i / 4) * 45 ) + 525;\n buttons[i] = this.add.sprite(buttonX, buttonY, 'button')\n .setScale(0.8)\n .setOrigin(0)\n .setInteractive();\n let string = Object.keys(buttonList[i])[0]; // Get the key string out\n this.add.text(buttonX, buttonY, string + \": \" + buttonList[i][string]);\n buttons[i].on('pointerdown', function(){\n socket.emit('query', string);\n }, this);\n }\n }", "title": "" }, { "docid": "5c14333dc455cc41a5e840aabeba9a80", "score": "0.6180655", "text": "getEleHtml () {\n const edit = document.getElementsByClassName('btn-edit')\n const save = document.getElementsByClassName('btn-save')\n const cancel = document.getElementsByClassName('btn-cancel')\n const remove = document.getElementsByClassName('btn-remove')\n const undoLet = document.getElementsByClassName('btn-undo')\n const list = [edit, save, cancel, remove, undoLet]\n this.setEleValue(list)\n const that = this\n for (const key of list[0]) {\n key.addEventListener('click', function () {\n const id = (this.getAttribute('idbutton'))\n that.editItem(id)\n })\n }\n\n for (const key of list[1]) {\n key.addEventListener('click', function () {\n const id = (this.getAttribute('idbutton'))\n that.saveEdit(id)\n })\n }\n\n for (const key of list[2]) {\n key.addEventListener('click', function () {\n const id = (this.getAttribute('idbutton'))\n that.cancelSave(id)\n })\n }\n\n for (const key of list[3]) {\n key.addEventListener('click', function () {\n const id = (this.getAttribute('idbutton'))\n that.removeItem(id)\n })\n }\n\n for (const key of list[4]) {\n key.addEventListener('click', function () {\n const id = (this.getAttribute('idbutton'))\n that.undo(id)\n })\n }\n }", "title": "" }, { "docid": "98d22a407aeb314376d3f51b15554d50", "score": "0.6165631", "text": "function setUpListener (){\n var delButtons = document.querySelectorAll('.delete');\n for (var i = 0; i < delButtons.length; i++){\n var delButton = delButtons[i];\n delButton.addEventListener('click', delListItem);\n }\n\n}", "title": "" }, { "docid": "5c92a63c5199a44062c0fc1cd1545d68", "score": "0.61090505", "text": "function buttonManager($pressedButton) {\n // Capture Active button; Remove '.active' class\n var $activeButton = document.getElementsByClassName('active')[0];\n $activeButton.classList = \"\";\n // Add '.active' to Pressed Button\n $pressedButton.classList = \"active\";\n}", "title": "" }, { "docid": "8cf854344adddf8d2db385d085e9d41b", "score": "0.61065775", "text": "function setupButtons() {\n $('.choice').on('mouseover', function () {\n $(this).css({ 'background-color': '#e1e1e1' });\n });\n $('.choice').on('mouseout', function () {\n $(this).css({ 'background-color': '#fff' });\n })\n $('.choice').on('click', function () {\n picked = $(this).attr('data-index');\n $('.choice').removeAttr('style').off('mouseout mouseover');\n $(this).css({ 'border-color': '#222', 'font-weight': 700, 'background-color': '#c1c1c1' });\n if (submt) {\n submt = false;\n $('#submitbutton').css({ 'color': '#000' }).on('click', function () {\n $('.choice').off('click');\n $(this).off('click');\n processQuestion(picked);\n });\n }\n })\n}", "title": "" }, { "docid": "d0f466de2580f96e8ace9abea66e4442", "score": "0.6106373", "text": "function handleButtonClick(e) {\n let dataKey = this.getAttribute('data-key');\n\n // checks if user clicked a digit or dot\n if(!isNaN(dataKey)) {\n handleButtonClickDigit(dataKey);\n } else if(dataKey === '+'|| dataKey === '-' || dataKey === '*' || dataKey === '/') {\n handleButtonClickOperator(dataKey);\n } else if(dataKey === '=') {\n handleButtonClickEquals();\n } else if(dataKey === 'clr') {\n handleButtonClickClear();\n } else if(dataKey === 'del') {\n handleButtonClickDelete();\n } else if(dataKey === '.') {\n handleButtonClickDot(dataKey);\n }\n}", "title": "" }, { "docid": "3ab242acdd72aa6ab03965090572abbb", "score": "0.6100033", "text": "function buttonEvents() {\n\n $(document).on(\"click\", \".editBtn\", function () {\n markSelected(this);\n $(\"#editDiv\").show();\n $(\"#editDiv :input\").prop(\"disabled\", false); // edit mode: enable all controls in the form\n populateFields(this.getAttribute('data-boxId')); // fill the form fields according to the selected row\n });\n\n $(document).on(\"click\", \".viewBtn\", function () {\n markSelected(this);\n $(\"#editDiv\").show();\n row.className = 'selected';\n $(\"#editDiv :input\").attr(\"disabled\", \"disabled\"); // view mode: disable all controls in the form ***\n populateFields(this.getAttribute('data-boxId'));\n });\n\n $(document).on(\"click\", \".deleteBtn\", function () {\n markSelected(this);\n var boxId = this.getAttribute('data-boxId');\n swal({ // this will open a dialouge\n title: \"האם אתה בטוח??\",\n text: \"\",\n icon: \"warning\",\n buttons: true,\n dangerMode: true\n })\n .then(function (willDelete) {\n if (willDelete) DeleteBox(boxId);\n else swal(\"Not Deleted!\");\n });\n });\n}", "title": "" }, { "docid": "f14eff20f50a1c726f0d478d670443fc", "score": "0.60906965", "text": "function delEventHandler(item){\r\n\tconst btns = item.querySelector('.buttons');\r\n btns.lastElementChild.addEventListener('click', (e)=>{\r\n e.preventDefault();\r\n\t\titem.remove();\r\n\t\tnotify('deleted');\r\n });\r\n\t\r\n}", "title": "" }, { "docid": "1442d6196e38c9008b9bd08e21f536a7", "score": "0.6082937", "text": "function btnAct(){\n for(i = 0; i < alphabet.length; i++){\n let currentButton = document.getElementById(`${'alpha-btn' + i}`);\n currentButton.addEventListener(\"click\", btnReveal);\n }\n }", "title": "" }, { "docid": "832b5007428dd7593bbd28b4fff8f2e6", "score": "0.607904", "text": "function SetButtonHandlers() {\n\t$(\".instr_add\").click(function () {\n\t\tGetInstructionType(this);\n\t});\n\t$(\"#addnode\").click(GetNodeType);\n\t$(\"#deletenode\").click(DeleteNode);\n}", "title": "" }, { "docid": "1da370661ef62593fa341d4ce6ff4b58", "score": "0.6077249", "text": "function loopMyButtons() {\n const deleteButtons = document.getElementsByClassName(\"delButton\");\n for (const deleteButton of deleteButtons) {\n deleteButton.addEventListener(\"click\", function () {\n this.parentElement.parentElement.removeChild(this.parentElement);\n });\n }\n}", "title": "" }, { "docid": "63c1af561ecafb5ea7779d4b3e94902f", "score": "0.60760176", "text": "function bindCommands(btn) {\n\n\t\tvar l = btn.length;\n\t\twhile (l--) {\n\t\t\tbtn[l].addEventListener('click', function(ev) {\n\t\t\t\te.execCommand(ev.currentTarget.getAttribute('data-binding'))\n\t\t\t})\n\t\t}\n\n\t}", "title": "" }, { "docid": "7852ac8d3d5ee6a9bc0f65c4529ccf5a", "score": "0.60688335", "text": "function TB_keys (e) {\n\tif (e == null) { // ie\n\t\tkeycode = event.keyCode;\n\t} else { // mozilla\n\t\tkeycode = e.which;\n\t}\n\tkey = String.fromCharCode(keycode).toLowerCase();\n\tif (key == 'x' || key =='q'){\n\t\te.stopPropagation();\n\t\tTB_remove();\n\t} else if (key == ' ' || key == 'n') {\n\t\te.stopPropagation();\n\t\tTB_next();\n\t} else if (key == 'p') {\n\t\te.stopPropagation();\n\t\tTB_prev();\n\t}\n}", "title": "" }, { "docid": "cb479c5a49e50fe2ee5343664ab484b7", "score": "0.6068721", "text": "function EBX_ButtonUtils() {}", "title": "" }, { "docid": "48476ecc72ddecc358b28f581af1be07", "score": "0.6065521", "text": "function action(txtBtn, act) {\n if (txtBtn==\"newBtn\") f.actionArray[0]=act;\n if (txtBtn==\"saveBtn\") f.actionArray[1]=act;\n if (txtBtn==\"removeBtn\") f.actionArray[2]=act;\n //if (txtBtn==\"switchBtn\") f.actionArray[3]=act;\n if (txtBtn==\"refreshBtn\") f.actionArray[3]=act;\n //if (txtBtn==\"homeBtn\") f.actionArray[4]=act;\n if (txtBtn==\"backBtn\") f.actionArray[4]=act;\n }", "title": "" }, { "docid": "154010dd35b2decce018a3cacee70182", "score": "0.6057679", "text": "function deleteOrCheck(e){\r\n\r\n /*************************************If loop and event object to target delete button ******************************/\r\n if(e.target.className == 'delete')\r\n deleteItem(e);\r\n else {\r\n checkTask(e);\r\n }\r\n}", "title": "" }, { "docid": "e40de65d058d5cffa0e03ea0d55517bc", "score": "0.605552", "text": "initializeClickEvents() {\n this.numberButtons.forEach((numberButton) => {\n numberButton.addEventListener(\"click\", (event) => {\n this.input(this.getInputValue(event.target));\n });\n });\n\n this.decimalButton.addEventListener(\"click\", () => {\n this.input(\".\");\n });\n\n this.plusMinusButton.addEventListener(\"click\", () => {\n this.input(\"plus-minus\");\n });\n\n this.clearButton.addEventListener(\"click\", () => {\n this.initializeCalculator();\n });\n\n this.backspaceButton.addEventListener(\"click\", () => {\n this.backspace();\n });\n\n this.percentageButton.addEventListener(\"click\", () => {\n this.percentage();\n });\n\n this.squareRootButton.addEventListener(\"click\", () => {\n this.squareRoot();\n });\n\n this.additionButton.addEventListener(\"click\", () => {\n this.add();\n });\n\n this.subtractionButton.addEventListener(\"click\", () => {\n this.subtract();\n });\n\n this.multiplicationButton.addEventListener(\"click\", () => {\n this.multiply();\n });\n\n this.divisionButton.addEventListener(\"click\", () => {\n this.divide();\n });\n\n this.equalsButton.addEventListener(\"click\", () => {\n this.compute();\n });\n }", "title": "" }, { "docid": "88658f561eb5f3d58f6058bedc5afa43", "score": "0.60538995", "text": "function handleActionClicks() {\n for (let i = 0; i < buttons.length; i++) {\n buttons[i].removeEventListener(\"click\", onClick[i]);\n checkActionProperties(i);\n buttons[i].addEventListener(\"click\", onClick[i]);\n }\n}", "title": "" }, { "docid": "b4b208c2d8e100576bc4343392ecee07", "score": "0.60530967", "text": "_onClearButtonClick() {}", "title": "" }, { "docid": "1778bd0e5f8c3a52136695d6e4fbf626", "score": "0.6036351", "text": "static handleBtnClicked() {\n $(\"#prev\").on({\n click: () => {\n if (collectedData.previous()) {\n SyncUtils.imageDataToView();\n }\n ButtonUtils.updateNavBtnState();\n EventUtils.switchModes();\n }\n });\n $(\"#next\").on({\n click: () => {\n // move the cursor to the next image and render\n if (collectedData.next()) {\n SyncUtils.imageDataToView();\n }\n\n // update the current states of all buttons\n ButtonUtils.updateNavBtnState();\n\n // execute modes\n EventUtils.switchModes();\n }\n });\n $(\"#finish\").on({\n click: () => {\n sendDataToServer();\n EventUtils.switchModes();\n\n function sendDataToServer() {\n let sentData = collectedData.encodeData();\n $.ajax({\n method: \"PUT\",\n url: \"http://localhost:9000/existed/dataEntry\",\n data: \"data=\" + sentData\n }).done((data, textStatus, jqXHR) => {\n window.location.reload();\n })\n .fail((jqXHR, textStatus, errorThrown) => {\n debugger;\n window.location.replace(\"html/error.html\");\n });\n }\n },\n });\n }", "title": "" }, { "docid": "6bde5218ed2ed61a11e9da2331319b6c", "score": "0.60353535", "text": "handleMouseUp(event) {\n const target = event.target;\n const attributesObj = target.attributes;\n\n if (target.dataset.operator === \"backspace\") {\n target.closest(\"button.backspace-button\").classList.remove(\"dark-grey-click\");\n } else if (attributesObj.hasOwnProperty(\"data-value\")) {\n target.classList.remove(\"button-click\"); \n } else if (attributesObj.hasOwnProperty(\"data-operator\")) {\n if (target.classList.contains(\"dark-grey\")) {\n target.classList.remove(\"dark-grey-click\");\n } else if (target.classList.contains(\"button-blue\")) {\n target.classList.remove(\"button-blue-click\");\n } else if (target.classList.contains(\"button-orange\")) {\n target.classList.remove(\"button-orange-click\");\n }\n }\n }", "title": "" }, { "docid": "0ce59e170bcb3970daa3559647ea4ccd", "score": "0.6029345", "text": "function pressButton(e){ //e is the div that the button was pressed on \n const buttonId = e.target.id; //.target.id retursn the ID of the div that was pressed. This identifies what button was pressed. \n switch(buttonId){\n case \"num0\":\n case \"num1\":\n case \"num2\":\n case \"num3\":\n case \"num4\":\n case \"num5\":\n case \"num6\":\n case \"num7\":\n case \"num8\":\n case \"num9\": pressNumber(e)\n break;\n case \"AC\": pressAC(e)\n break;\n case \"add\": \n case \"subtract\":\n case \"multiply\":\n case \"divide\": pressOperator(e,buttonId)\n break;\n case \"equals\": pressEquals(e)\n break; \n case \"plus-minus\": invertSign();\n break; \n case \"percent\" : turnToPercent();\n break; \n case \"decimal\" : addDecimal();\n break;\n } \n}", "title": "" }, { "docid": "c075f697347decb153fe899d040cc485", "score": "0.60284", "text": "onDeleteClick() { }", "title": "" }, { "docid": "4e0e7ca9cd641deb322f7f097f5bd94b", "score": "0.6028267", "text": "function attachedEventToButtons(){\n var btn = document.getElementsByClassName('deleteBook');\n for(let i=0; i < btn.length; i++){\n btn[i].addEventListener('click', () => {\n var id_book = btn[i].parentNode.parentNode.querySelectorAll('td')[1].outerText;\n var DepartmentSelector = document.getElementsByName(\"department\");\n var SubjectSelector = document.getElementsByClassName('DELETEactivitySelector')[0];\n\n for(let o=2; o < DepartmentSelector.length; o++){\n if(DepartmentSelector[o].checked == true){\n // remove subject section\n var data = {\"subject_code\": SubjectSelector.value,\n \"id_book\": id_book};\n \n makeRequest('books/delete_book', JSON.stringify(data));\n }\n }\n var tBodyElement = document.getElementsByTagName('tbody')[0];\n tBodyElement.removeChild(btn[i].parentNode.parentNode);\n });\n }\n }", "title": "" }, { "docid": "d60106035e7dc7f207739d94ff82cd3a", "score": "0.6025319", "text": "function setEvents() { //#b\n document.onkeydown=down; //#b \n document.onkeypress=press;\n\n ($('#skip')[0]).onmousedown=skip;///the cgi looking buttons\n ($('#back')[0]).onmousedown=back;\n ($('#reset')[0]).onmousedown=reset;\n// ($('#addnew')[0]).onmousedown=addnew;\n next();\n}", "title": "" }, { "docid": "3fe6a04e5ed686af08e5d0dec6ff9427", "score": "0.60208154", "text": "function _event_for_delete_btn() {\n\t\t\ttry {\n\t\t\t\tvar optionDialog = Ti.UI.createOptionDialog({\n\t\t\t\t\toptions : (self.is_ipad()) ? [ 'YES', 'NO', '' ] : [ 'YES', 'NO' ],\n\t\t\t\t\tbuttonNames : [ 'Cancel' ],\n\t\t\t\t\tdestructive : 0,\n\t\t\t\t\tcancel : 1,\n\t\t\t\t\ttitle : L('message_delete_note_in_job_note')\n\t\t\t\t});\n\t\t\t\toptionDialog.show();\n\t\t\t\toptionDialog.addEventListener('click', function(e) {\n\t\t\t\t\tif (e.index === 0) {\n\t\t\t\t\t\tvar db = Titanium.Database.open(self.get_db_name());\n\t\t\t\t\t\tif (_selected_job_note_id > 1000000000) {\n\t\t\t\t\t\t\tdb.execute('DELETE FROM my_' + _type + '_note WHERE id=?', _selected_job_note_id);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdb.execute('UPDATE my_' + _type + '_note SET changed=?,status_code=? WHERE id=' + _selected_job_note_id, 1, 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdb.close();\n\t\t\t\t\t\twin.close();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} catch (err) {\n\t\t\t\tself.process_simple_error_message(err, window_source + ' - _event_for_delete_btn');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "39f1ccd0563bc8719d6518706d3460b8", "score": "0.6010614", "text": "function deleteButton (button, commands) {\n\tcommands.push([\"deleteButton\", button.name]);\n}", "title": "" }, { "docid": "0c49449695a06ac56d9c0fa1e04cd175", "score": "0.60106045", "text": "triggerButtons() {\n if (!this.showToolbar) {\n return;\n }\n this.buttons.forEach(e => {\n const result = this.doc.queryCommandState(e);\n const elementById = this.doc.getElementById(e);\n if (result)\n (elementById != null)\n ? this.element = {\n id: elementById,\n color: 'primary'\n }\n : this.element = {\n id: elementById,\n color: 'accent'\n };\n // this.r.addClass(elementById, 'active')\n // this.r.removeClass(elementById, 'active');\n else\n return;\n });\n }", "title": "" }, { "docid": "ca8fba637be01640f9770065baf2cae7", "score": "0.59925133", "text": "_addEvents() {\n this._widgetContainer.onclick = (evt) => {\n if (evt.target === this._widgetContainer || evt.target === this._widgetContainer.querySelector(\".widget-middle\")) {\n this._onSave();\n this._widgetContainer.remove();\n }\n };\n\n this._widgetContainer.querySelector(\".cancel-button\").onclick = (evt) => {\n this._onClose();\n this._widgetContainer.remove();\n };\n\n this._widgetContainer.querySelector(\".save-button\").onclick = (evt) => {\n this._onSave();\n this._widgetContainer.remove();\n };\n }", "title": "" }, { "docid": "8d645682500551a125249a6bd0374e79", "score": "0.598892", "text": "function setupButtons(quiz){\n $('.choice').on('click', function(){\n picked = $(this).attr('data-index');\n $('.choice').removeAttr('style').off('mouseout mouseover');\n $(this).css({'font-weight':'bold', 'border-color':'#51a351', 'color':'#51a351'});\n if(submt){\n submt=false;\n $('#submitbutton').css({'color':'#fff','cursor':'pointer'}).on('click', function(){\n $('.choice').off('click');\n $(this).off('click');\n processQuestion(picked, quiz);\n });\n }\n })\n }", "title": "" }, { "docid": "e6d8615e7f0e134cc338365314921631", "score": "0.5985349", "text": "function handleDeleteBtn(evt) {\n\t\tprops.handleDelete(evt.target.value);\n\t}", "title": "" }, { "docid": "0682b2b3148df95afeda81e2713c0748", "score": "0.5983067", "text": "function btnEvents() {\n $(\"#createCoinBtn\").bind(\"click\", CreateCoin);\n $(\"#updateCoinBtn\").bind(\"click\", UpdateCoin);\n $(\"#deleteCoinBtn\").bind(\"click\", DeleteCoin);\n}", "title": "" }, { "docid": "2d6e50bb551b1410e7adb5894cc928da", "score": "0.59828794", "text": "buttonClicked() {\n vowelButton.addEventListener(\"click\", this.onButtonClicked.bind(this,\n Config.LETTERTYPE.VOWEL));\n consonantButton.addEventListener(\"click\", this.onButtonClicked.bind(this,\n Config.LETTERTYPE.CONSONANT));\n\n }", "title": "" }, { "docid": "46a7387d6e7f07361b88436814e0e24c", "score": "0.59796876", "text": "function findButton(event) {\n if (event.target !== event.currentTarget) {\n clickedItem = event.target;\n if (clickedItem.id === 'update') {\n //Keep for future development\n // eslint-disable-next-line no-console\n console.log(\"Update \" + clickedItem.value);\n //Add Function to Update Field\n\n }\n else if (clickedItem.id === 'remove') {\n database.ref(clickedItem.value).remove();\n }\n else {\n // eslint-disable-next-line no-console\n console.log (\"Error\");\n }\n }\n event.stopPropagation();\n }", "title": "" }, { "docid": "c218ef4a8ea834f344f3de31e330c052", "score": "0.5971386", "text": "handleInteraction(e, event) {\n let show = new Phrase();\n if (e != 0) {\n let letter = e.target;\n show.checkLetter(letter.textContent, letter);\n } else {\n\n let buttons = document.getElementsByTagName('button')\n for (let i = 0; i < 27; i++) {\n if (buttons[i].textContent == event.key) {\n show.checkLetter(event.key, document.getElementsByTagName('button')[i])\n }\n }\n\n }\n\n }", "title": "" }, { "docid": "c39189e7b6bd5e1a711c4f7ac2ea80fc", "score": "0.5971256", "text": "function clickButtons(){\n function _run(commandId,thread,day){\n if(!isNaN(day)){\n if(day > 1){\n createTerminal(commandId,thread,day,true);\n }else{\n createTerminal(commandId,thread,day);\n }\n }else{\n createTerminal(commandId,thread);\n }\n }\n\n actionButton.subscribe(function(commandId){\n //console.log(dayValue());\n //var day = dayValue();\n //day = parseInt(day,10);\n if(dayValue() === true){\n _run(commandId,null,1);\n }else{\n _run(commandId,null);\n }\n });\n\n threadButton.subscribe(function(){\n var day = dayValue(),\n thread = threadValue();\n day = parseInt(day,10);\n thread = parseInt(thread,10);\n _run('command5',thread,day);\n });\n }", "title": "" }, { "docid": "c83db0093d811448a226bf2d09a68081", "score": "0.59622645", "text": "function processButton (button) {\n switch($(button).attr(\"id\")) {\n case \"clear\":\n clearLast();\n break;\n \n case \"AC\":\n if (tokenList.length === 0) {\n calcHistory.length = 0;\n $(\"#calc-history-box\").html(\"\");\n } else {\n tokenList.length = 0;\n displayEquation();\n }\n break;\n \n case \"onoff\":\n onOff();\n break; \n \n case \"decimal\":\n if (isNaN(tokenList[tokenList.length - 1])) {\n addToken(\"0.\");\n } else {\n if(tokenList[tokenList.length - 1].indexOf(\".\") === -1) {\n tokenList[tokenList.length -1] += \".\";\n }\n }\n displayEquation();\n break;\n \n case \"equals\":\n calculate();\n break;\n \n case \"toggle-advanced\":\n toggleAdvanced();\n break;\n \n case \"num-pi\":\n addToken(\"num-pi\");\n break;\n \n default:\n if ($(button).hasClass(\"num\")) {\n addToken($(button).html());\n } else {\n addToken($(button).attr(\"id\"));\n }\n }\n }", "title": "" }, { "docid": "fd37b82318226036591f1d8aa16fe4bc", "score": "0.5955647", "text": "function setupDeleteBtns() {\n let loeschenBtns = document.getElementsByClassName(\"loeschen-button\"); //Da es hier um eine NodeList handelt muss über alle Elemente iteriert werden https://stackoverflow.com/questions/32151704/addeventlistener-is-not-a-function\n for (loeschenBtn of loeschenBtns) {\n loeschenBtn.addEventListener(\"click\", removeListItem);\n }\n}", "title": "" }, { "docid": "b86a287f4e6869dbdbe0f2e9a025f553", "score": "0.59486425", "text": "function process_button()\n\t\t{\n\t\t\tvar oEl = event.srcElement;\n\t\t\tevent.cancelBubble = true;\n\t\t\twhile( -1 == oEl.className.indexOf( \"Btn\" ) )\n\t\t\t{\n\t\t\t\toEl = oEl.parentElement;\n\t\t\t\tif( !oEl ) return;\n\t\t\t}\n\t\t\tvar baseClass = oEl.className.substring( 0 , oEl.className.indexOf( \"Btn\" ) + 3 );\n\t\t\tvar btnImage = null;\n\t\t\tif( oEl.IMG ) btnImage = oEl.all.tags( \"IMG\" )[0];\n\t\n\t\t\tswitch( event.type )\n\t\t\t{\n\t\t\t\tcase \"mouseout\" :\n\t\t\t\t\tif( oEl.contains( event.toElement ) ) return;\n\t\t\t\t\tif( btnImage )\n\t\t\t\t\t{\n\t\t\t\t\t\tbtnImage.src = btnImage.src.substring( 0 , btnImage.src.length - 5 ) + \"1.gif\";\n\t\t\t\t\t}\n\t\t\t\t\tif( oEl.STATE )\n\t\t\t\t\t{\n\t\n\t\t\t\t\t\toEl.className = baseClass + oEl.STATE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\toEl.className = baseClass + \"Off\";\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"mouseover\" :\n\t\t\t\t\tif( oEl.contains( event.fromElement ) ) return;\n\t\t\t\t\t\n\t\t\t\t\tif( btnImage )\n\t\t\t\t\t{\n\t\t\t\t\t\tbtnImage.src = btnImage.src.substring( 0 , btnImage.src.length - 5 ) + \"2.gif\";\n\t\t\t\t\t}\n\t\t\t\t\tif( oEl.STATE )\n\t\t\t\t\t{\n\t\t\t\t\t\tvar tmpState = oEl.STATE == \"Off\" ? \"Up\" : \"Down\";\n\t\t\t\t\t\toEl.className = baseClass + tmpState;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\toEl.className = baseClass + \"Up\";\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\n\t\t\t\tcase \"mousedown\" :\n\t\t\t\t\toEl.className = baseClass + \"Down\";\n\t\t\t\t\tbreak;\n\t\n\t\t\t\tcase \"mouseup\" :\n\t\t\t\t\tif( oEl.STATE )\n\t\t\t\t\t{\n\t\t\t\t\t\toEl.STATE = oEl.STATE == \"Off\" ? \"On\" : \"Off\";\n\t\t\t\t\t\tvar tmpState = oEl.STATE == \"On\" ? \"Down\" : \"Up\";\n\t\t\t\t\t\toEl.className = baseClass + tmpState;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\toEl.className = baseClass + \"Up\";\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\n\t\t\t\tcase \"click\" :\n\t\t\t\t\tevent.returnValue = doButtonClick( oEl );\n\t\t\t\t\tbreak;\n\t\n\t\t\t\tcase \"dblclick\" :\n\t\t\t\t\tevent.returnValue = doButtonClick( oEl );\n\t\t\t\t\tbreak;\n\t\n\t\t\t\tcase \"keyup\" :\n\t\t\t\t\tif( 13 == event.keyCode )\n\t\t\t\t\t{\n\t\t\t\t\t\tif( oEl.STATE )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toEl.STATE = oEl.STATE == \"Off\" ? \"On\" : \"Off\";\n\t\t\t\t\t\t\tvar tmpState = oEl.STATE == \"On\" ? \"Down\" : \"Up\";\n\t\t\t\t\t\t\toEl.className = baseClass + tmpState;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toEl.className = baseClass + \"Up\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tevent.returnValue = doButtonClick( oEl );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"selectstart\" :\n\t\t\t\t\tif( oEl )\n\t\t\t\t\t{\n\t\t\t\t\t\tevent.returnValue = false;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\n\t\t\t\tdefault :\n\t\t\t\t\tbreak;\n\t\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "15f7c3a617e97c69f7ecdd95c679e6ea", "score": "0.5943246", "text": "function onButtonClicked(ev) {\n\t\tswitch (ev.target.id) {\n\t\t\tcase dom.btnRenameList[0].id:\n\t\t\t\tonRenameList(ev);\n\t\t\t\tbreak;\n\t\t\tcase dom.btnDeleteList[0].id:\n\t\t\t\tonDeleteList();\n\t\t\t\tbreak;\n\t\t}\n\t\tev.preventDefault();\n\t\thideActionChooser();\n\t}", "title": "" }, { "docid": "346545f1aadc879616317d18f3318044", "score": "0.593849", "text": "function addDeleteAction() {\r\n var btnDelete = document.getElementsByClassName(\"btn-delete\");\r\n for (var i = 0; i < btnDelete.length; i++) {\r\n btnDelete[i].onclick = deleteRow;\r\n }\r\n}", "title": "" }, { "docid": "a95013f6a265591b14a31faa9eee1e21", "score": "0.592299", "text": "handleMouseDown(event) {\n const target = event.target;\n const attributesObj = target.attributes;\n\n if (target.dataset.operator === \"backspace\") {\n target.closest(\"button.backspace-button\").classList.add(\"dark-grey-click\");\n } else if (attributesObj.hasOwnProperty(\"data-value\")) {\n target.classList.add(\"button-click\"); \n } else if (attributesObj.hasOwnProperty(\"data-operator\")) {\n if (target.classList.contains(\"dark-grey\")) {\n target.classList.add(\"dark-grey-click\");\n } else if (target.classList.contains(\"button-blue\")) {\n target.classList.add(\"button-blue-click\");\n } else if (target.classList.contains(\"button-orange\")) {\n target.classList.add(\"button-orange-click\");\n }\n }\n }", "title": "" }, { "docid": "9f64e78801bc6ed306d5e4b054974e9b", "score": "0.5918623", "text": "function activate_buttons() {\n\t\tvar btnIds = document.querySelectorAll(\"button[type='button']\");\n\t\t/*\n\t\t * forEach learned from Nat Tuck's 03-javascript/page/code2.js lecture notes\n\t\t*/\n\t\tbtnIds.forEach(function(btn) {\n\t\t\tbtn.addEventListener('click', button_clicked, false);\n\t\t});\n\t}", "title": "" }, { "docid": "a7fff1b430bacf66bb2593274ab601ca", "score": "0.5915783", "text": "function updateRemoveItemBtn()\n{\n\tjQuery('.btnDeleteItem').unbind('click');\n\tjQuery('.btnDeleteItem').click(function(e) {\n\t\te.preventDefault();\n\t\taskToDeleteItem( jQuery(this) );\t\t\n\t});\n}", "title": "" }, { "docid": "49cdc421478da16a566229868bd2b11f", "score": "0.59145564", "text": "function commandButtons()\n{\n\tbtnArray = new Array(\n\t\tMM.BTN_OK, \"clickedOK()\", \n MM.BTN_Cancel, \"clickedCancel()\", \n MM.BTN_Test, \"clickedTest()\"\n\t);\n\tvar sm = dw.getDocumentDOM().serverModel.getServerName();\n\t// add a button for each different rs type\n\tfor (i = 0;i < MM.rsTypes.length;i++) {\n\t\tif(MM.rsTypes[i].single == \"true\") {\n\t\t\tcontinue;\n\t\t}\n\t\tif (sm == MM.rsTypes[i].serverModel) {\n \t\tif (RECORDSET_TYPE.toLowerCase() != MM.rsTypes[i].type.toLowerCase()) {\n\t\t\t\tvar btnLabel = dw.loadString(\"recordsetType/\" + MM.rsTypes[i].type);\n\t\t\t\tif (!btnLabel)\n\t\t\t\t\tbtnLabel = MM.rsTypes[i].type;\n\t\t\t\tbtnArray.push(btnLabel+\"...\");\n\t\t\t\tbtnArray.push(\"clickedChange(\" + i + \")\");\n\t\t\t}\n\t\t}\n\t}\n\tbtnArray.push(MM.BTN_Help);\n\tbtnArray.push(\"displayHelp()\"); \n\treturn btnArray;\n}", "title": "" }, { "docid": "30def18d6822d1f35235ae713488996a", "score": "0.589748", "text": "function initButtonListeners() {\n\n\tfor (var i = 0; i < number_of_buttons; i++) {\n\n\t\tbuttons[i].on(\"mouseover\", function(event) {\n\t\t\tif (gameStarted) {\n\t\t\t\tstage.addChild(buttonsh[event.target.id]);\n\t\t\t\tstage.removeChild(buttons[event.target.id]);\n\t\t\t}\n\t\t});\n\n\t\tbuttonsh[i].on(\"mouseout\", function(event) {\n\t\t\tif (gameStarted) {\n\t\t\t\tstage.addChild(buttons[event.target.id]);\n\t\t\t\tstage.removeChild(buttonsh[event.target.id]);\n\t\t\t}\n\t\t});\n\n\t\tbuttonsh[i].on(\"mousedown\", function(event) {\n\t\t\tif (gameStarted) {\n\t\t\t\tplaySound(\"click\");\n\t\t\t\tcheckAnswer(letters[event.target.id]);\n\n\t\t\t}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "897e61efa4e8d87f9f95c82574842974", "score": "0.5888827", "text": "function setButtons(obj) {\r\n\t\t var btn = document.getElementById(obj.id);\r\n\t\t\tbtn.addEventListener(\"click\", function() {\r\n\t\t\t\tbtnPress(obj);\r\n\t\t\t\tarrCheck(obj.id);\r\n\t\t\t}, true);\r\n\t\t}", "title": "" }, { "docid": "b89cfd1d13ec07a5f7b9ef712344be7c", "score": "0.5888029", "text": "function labelAndActivateButtons(){ \n let buttons = document.querySelectorAll('button');\n\n function labelButtons(){\n buttons.forEach((button) => {\n switch(button.id){\n case '10':\n button.id = 'decimal';\n button.innerText = '.';\n break;\n\n case '11':\n button.id = 'exponent';\n button.innerText = '^';\n break;\n\n case '12':\n button.id = 'clear';\n button.innerText = 'Clear';\n break;\n\n case '13':\n button.id = 'delete'\n button.innerText = 'Del'\n break;\n\n case '14':\n button.id = 'sign change';\n button.innerText = '+/-';\n break;\n\n case '15':\n button.id = 'multiply';\n button.innerText = '*';\n break;\n\n case '16':\n button.id = 'subtract';\n button.innerText = '-';\n break;\n\n case '17':\n button.id = 'add';\n button.innerText = '+';\n break;\n\n case '18':\n button.id = 'divide';\n button.innerText = '/';\n break;\n\n case '19':\n button.id = 'enter';\n button.innerText = 'Enter';\n break;\n\n default: \n button.innerText = button.id;\n }\n });\n }\n\n function activateButtons(){\n buttons.forEach((button) => {\n button.addEventListener('click', (e) => {clicked(button);});\n });\n }\n\n labelButtons();\n activateButtons();\n}", "title": "" }, { "docid": "bf0f312b401b1f5fdd52eeea85c816b6", "score": "0.58860236", "text": "function buttonEvents(btnId, removeClassIdArray, textId, cost) {\n document.getElementById(btnId).addEventListener(\"click\", function(e) {\n // Add or remove class on click\n if(!e.target.classList.contains(\"active\")) {\n e.target.classList.add(\"active\")\n\n // Remove active class from other button(s)\n for(id of removeClassIdArray) {\n document.getElementById(id).classList.remove(\"active\")\n }\n } \n \n document.getElementById(textId).innerText = cost\n updatePrimaryTotal()\n })\n}", "title": "" }, { "docid": "cb15920356112be20ba9b72500a92a4a", "score": "0.58849365", "text": "function topButtons(btn) {\n\tif (btn === \"clear\") {\n\t\tac();\n\t} else if (btn === \"plus-minus\") {\n\t\tplus_minus();\n\t} else if (btn === \"delete\") {\n\t\tbackspace();\n\t} \n}", "title": "" }, { "docid": "46de81ad4174c56a7620a870470a353f", "score": "0.58842987", "text": "function attachCallbacks() {\n\t\tvar index = 0;\n\t\tthis.fields.forEach(function(field) {\n\t\t\tif (field.type === 'button') {\n\t\t\t\t$(\"#\" + getId.call(this, (field.id) ? field.id : index)).click(field.callback);\n\t\t\t}\n\t\t\tif(field.key){\n\t\t\t\t// $(\"body\").unbind();\n\t\t\t\t// console.log(Mousetrap);\n\t\t\t\t// $(\"body\").keypress(function(event){\n\t\t\t\t// \tif(event.which == field.key.charCodeAt()){\n\t\t\t\t// \t\tconsole.log(field);\n\t\t\t\t// \t\tfield.callback();\n\t\t\t\t// \t}\n\t\t\t\t// });\n\t\t\t}\n\t\t\tindex++;\n\t\t}.bind(this));\n\t}", "title": "" }, { "docid": "533b0379d98f9948f7dfca1fb3eaba35", "score": "0.586617", "text": "checkDeleteButtonText(e, ticketId, index){\n if(this.props.tickets[index].deleteButton === 'Finish'){\n this.deleteButton(e, ticketId, index);\n } else {\n this.takeButton(e, ticketId, index, 'Finish');\n }\n }", "title": "" }, { "docid": "bc2d9fda9ab2e73c1ffa186e76aad8c5", "score": "0.58657086", "text": "function init () {\n var button0 = document.getElementById(\"button0\");\n var button1 = document.getElementById(\"button1\");\n var button2 = document.getElementById(\"button2\");\n var button3 = document.getElementById(\"button3\");\n var button4 = document.getElementById(\"button4\");\n var button5 = document.getElementById(\"button5\");\n var button6 = document.getElementById(\"button6\");\n var button7 = document.getElementById(\"button7\");\n var button8 = document.getElementById(\"button8\");\n var button9 = document.getElementById(\"button9\");\n var button10 = document.getElementById(\"button10\");\n var button11 = document.getElementById(\"button11\");\n var button12 = document.getElementById(\"button12\");\n var button13 = document.getElementById(\"button13\");\n var button14 = document.getElementById(\"button14\");\n\n function onClickHandler(button) {\n return function() { display.handleButtons(button); };\n }\n\n button0.onclick = onClickHandler(\"button0\");\n button1.onclick = onClickHandler(\"button1\");\n button2.onclick = onClickHandler(\"button2\");\n button3.onclick = onClickHandler(\"button3\");\n button4.onclick = onClickHandler(\"button4\");\n button5.onclick = onClickHandler(\"button5\");\n button6.onclick = onClickHandler(\"button6\");\n button7.onclick = onClickHandler(\"button7\");\n button8.onclick = onClickHandler(\"button8\");\n button9.onclick = onClickHandler(\"button9\");\n button10.onclick = onClickHandler(\"button+\");\n button11.onclick = onClickHandler(\"button-\");\n button12.onclick = onClickHandler(\"button/\");\n button13.onclick = onClickHandler(\"clear\");\n button14.onclick = onClickHandler(\"button*\");\n //var button15 = onClickHandler(\"button.\");\n\n function onKeyPressHandler() {\n return function() { model.compute(); };\n }\n inputText.onclick = onKeyPressHandler();\n\n//1. Note here, 13 is return key, 190 is decimal and 8 is backspace.\n//2. Also note onkeypress doesn't support all keys, where onkeydown does.\n/*onkeypress*/onkeydown = function(e) {\n switch(e.keyCode) {\n case 8:\n button13.click();\n return false;\n break;\n\n case 13:\n inputText.click();\n return false;\n break;\n\n case 48:\n button0.click();\n return false;\n break;\n\n case 49:\n button1.click();\n return false;\n break;\n\n case 50:\n button2.click();\n return false;\n break;\n\n case 51:\n button3.click();\n return false;\n break;\n\n case 52:\n button4.click();\n return false;\n break;\n\n case 53:\n button5.click();\n return false;\n break;\n\n case 54:\n button6.click();\n return false;\n break;\n\n case 55:\n button7.click();\n return false;\n break;\n\n case 56:\n button8.click();\n return false;\n break;\n\n case 57:\n button9.click();\n return false;\n break;\n\n case 190:\n display.handleButtons(\"button.\");\n return false;\n break;\n }\n }\n}", "title": "" }, { "docid": "9a10eca6faa3851a0740bf592d3123c1", "score": "0.58645743", "text": "function _deleteButtonEventHandler(book){\n //console.log('Delete button received this book:',book);\n deleteBook(book);\n updateTableUI();\n}", "title": "" }, { "docid": "f9610cbc2802b4f606e79b7fa41b80fb", "score": "0.58633405", "text": "bindButtons() {\n this.elements.buttons.create.addEventListener('click', () => {\n this.canEdit = false;\n this.create();\n });\n\n this.elements.buttons.autoGenerate.addEventListener('click', () => this.autoGenerate());\n\n this.playground.addEventListener('mousedown', () => {\n if (!this.gameStarted) {\n this.canEdit = true;\n this.createElements();\n }\n });\n\n this.playground.addEventListener('mouseup', () => {\n this.canEdit = false;\n });\n\n document.getElementById('colors').addEventListener('change', (e) => {\n this.config.randomColor = e.target.checked;\n });\n document.getElementById('clearChilds').addEventListener('change', (e) => {\n this.config.clearChilds = e.target.checked;\n });\n\n\n let buttonIndex = 0;\n let buttonsList = this.elements.buttons.start;\n let listLength = buttonsList.length;\n\n for (buttonIndex; buttonIndex < listLength; buttonIndex++) {\n buttonsList[buttonIndex].addEventListener('click', () => this.start());\n }\n }", "title": "" }, { "docid": "c2b2053c15de4fe0ca42cbcec7094e6f", "score": "0.5862439", "text": "function pressBtn(event) {\n const targetEle = event.target;\n const targetEleTxt = targetEle.dataset.calc;\n\n // Clear Button\n if (targetEleTxt == 'C') {\n displayCalc.innerHTML = 0;\n operator = undefined;\n operand = [];\n return;\n }\n\n // Back button\n if (targetEleTxt == '←') {\n if (displayCalc.innerHTML != 0) {\n let str = displayCalc.innerHTML;\n let evalVal = str.substring(0, str.length - 1);\n if (evalVal.length == 0) {\n displayCalc.innerHTML = 0;\n } else {\n displayCalc.innerHTML = evalVal;\n }\n }\n return;\n }\n\n // EqualTo Button\n if (targetEleTxt == '=') {\n if (operand.length != 0) {\n handleTotal(operator);\n displayCalc.innerHTML = operand[0];\n operand = [];\n }\n\n return;\n }\n\n // Operator buttons\n if (\n targetEleTxt == '+' ||\n targetEleTxt == '-' ||\n targetEleTxt == '*' ||\n targetEleTxt == '/'\n ) {\n operator = targetEleTxt;\n handleTotal(operator);\n return;\n }\n\n // Number buttons\n if (\n displayCalc.innerHTML == '0' &&\n typeof Number(targetEleTxt) == 'number'\n ) {\n displayCalc.innerHTML = Number(targetEleTxt);\n } else {\n displayCalc.innerHTML += Number(targetEleTxt);\n }\n}", "title": "" }, { "docid": "d78b817263f079b0678445aff599bbcb", "score": "0.5862275", "text": "function bindActionEvents(){\n var replyBtn = document.getElementsByClassName('reply-btn');\n for(var i=0;i<replyBtn.length;i++){\n replyBtn[i].addEventListener('click', openCommentForm);\n }\n var commentBtn = document.getElementsByClassName('new-comment-btn');\n for(i=0;i<commentBtn.length;i++){\n commentBtn[i].addEventListener('click', submitComment);\n }\n var voteBtn = document.getElementsByClassName('arrow');\n for(i=0;i<voteBtn.length;i++){\n voteBtn[i].addEventListener('click', castVote);\n }\n }", "title": "" }, { "docid": "3f49e176388b96eda6c9d3705e887454", "score": "0.5861597", "text": "cardButtons() {\n\t\t$(`.pcm_pandaCard`).unbind('click').click( e => {\n\t\t\tlet card = $(e.target).closest('.card'), theButton = card.find(\".pcm_deleteButton\"), myId = card.data('myId');\n\t\t\ttheButton.css(\"background-color\", \"\");\n\t\t\tif (e.ctrlKey) {\n\t\t\t\tif (this.ctrlDelete.includes(myId)) { theButton.css(\"background-color\", \"\"); this.ctrlDelete = arrayRemove(this.ctrlDelete,myId); }\n\t\t\t\telse { theButton.css(\"background-color\", \"red\"); this.ctrlDelete.push(myId); }\n\t\t\t} else if (e.altKey) { this.ctrlDelete.length = 0; $(\".pcm_deleteButton\").css(\"background-color\", \"\"); }\n\t\t\ttheButton = card = null;\n\t\t})\n\t\t$(`.pcm_collectButton, .pcm_collectButton1`).unbind('click').click( async (e) => {\n\t\t\tlet theButton = $(e.target).closest(\".btn\"), card = $(e.target).closest('.card');\n\t\t\tlet myId = card.data('myId'), stopped = card.data('stopped');\n\t\t\tlet info = bgPanda.options(myId), data = await bgPanda.dataObj(myId);\n\t\t\tif (stopped === \"noQual\" || stopped === \"blocked\") {\n\t\t\t\tif (pandaUI.pandaStats[myId].collecting) await pandaUI.stopCollecting(myId, \"manual\");\n\t\t\t} else if (theButton.is(\".pcm_buttonOff:not(.pcm_searchOn), .pcm_searchDisable\")) {\n\t\t\t\tinfo.autoAdded = false;\n\t\t\t\tif (info.search !== 'rid') pandaUI.startCollecting(myId, false, (info.search === 'gid') ? 10000 : 0);\n\t\t\t\telse if (info.search === 'rid') {\n\t\t\t\t\t$(`#pcm_collectButton_${myId}`).removeClass(\"pcm_buttonOff\").removeClass(\"pcm_searchDisable\").addClass(\"pcm_buttonOn\");\n\t\t\t\t\t$(`#pcm_collectButton1_${myId}`).removeClass(\"pcm_buttonOff\").removeClass(\"pcm_searchDisable\").addClass(\"pcm_buttonOn\");\n pandaUI.pandaGStats.addCollecting(); pandaUI.pandaGStats.collectingOn();\n\t\t\t\t\tbgPanda.doSearching(myId, null, 10000);\n }\n } else if (info.search === 'rid') bgPanda.disableSearching(myId);\n\t\t\telse pandaUI.stopCollecting(myId, \"manual\");\n\t\t\ttheButton = card = null;\n\t\t});\n\t\t$(`.pcm_hamButton , .pcm_hamButton1`).unbind('click').click( async(e) => { \n\t\t\tlet theButton = $(e.target).closest(\".btn\"), myId = $(e.target).closest('.card').data('myId');\n\t\t\tif (theButton.data(\"longClicked\")) { theButton.removeData(\"longClicked\"); theButton.css({\"background-color\": \"\", \"color\": \"\"});}\n\t\t\telse { pandaUI.hamButtonClicked(myId, theButton); }\n\t\t\ttheButton = null;\n\t\t}).mayTriggerLongClicks({ delay: 1200 }).unbind('longClick').on('longClick', async (e) => {\n\t\t\tlet theButton = $(e.target).closest(\".btn\"), myId = $(e.target).closest('.card').data('myId');\n\t\t\tlet info = bgPanda.options(myId), data = await bgPanda.dataObj(myId);\n\t\t\ttheButton.data(\"longClicked\",true);\n\t\t\tif (theButton.hasClass(\"pcm_delayedHam\")) {\n\t\t\t\ttheButton.css({\"background-color\":this.hamBtnBgColor, \"color\":this.hamBtnColor}).removeClass(\"pcm_delayedHam\");\n\t\t\t\tinfo.autoTGoHam = (data.autoGoHam) ? \"disable\" : \"off\";\n\t\t\t} else { \n\t\t\t\tinfo.autoTGoHam = \"on\";\n\t\t\t\ttheButton.css({\"background-color\": \"#097e9b\", \"color\":\"#FFFFFF\"}).addClass(\"pcm_delayedHam\");\n\t\t\t\tpandaUI.hamButtonClicked(myId, theButton, true);\n\t\t\t}\n\t\t\ttheButton = null;\n\t\t});\n\t\t$(`.pcm_deleteButton , .pcm_deleteButton1`).unbind('click').click((e) => {\n\t\t\tlet myId = $(e.target).closest('.card').data('myId');\n\t\t\tif (!this.ctrlDelete.includes(myId)) this.ctrlDelete.push(myId);\n\t\t\tpandaUI.removeJobs(this.ctrlDelete);\n\t\t});\n\t\t$(`.pcm_detailsButton , .pcm_detailsButton1`).unbind('click').click( async (e) => {\n\t\t\tlet myId = $(e.target).closest('.card').data('myId');\n\t\t\tpandaUI.modalJob = new ModalJobClass();\n\t\t\tpandaUI.modalJob.showDetailsModal(myId,_, () => { pandaUI.modalJob = null; modal = null; });\n\t\t});\n\t\t$(`.pcm_groupId`).unbind('click').click( (e) => {\n\t\t\tconst double = parseInt( $(e.target).data('double'), 10 );\n\t\t\tif (double === 2) $(e.target).data('double', 0);\n\t\t\tsetTimeout( () => {\n\t\t\t\tconst double = parseInt( $(e.target).data('double'), 10 );\n\t\t\t\tif (double !== 2) {\n\t\t\t\t\tlet myId = $(e.target).data('myId');\n\t\t\t\t\tnavigator.clipboard.writeText(bgPanda.pandaUrls[myId].accept);\n\t\t\t\t}\n\t\t\t}, 250);\n\t\t});\n\t$(`.pcm_groupId`).unbind('dblclick').on('dblclick', (e) => {\n\t\t\tlet myId = $(e.target).closest('.card').data('myId');\n\t\t\t$(e.target).data('double', 2);\n\t\t});\n\t\t$(`.pcm_reqName1`).unbind('click').click( (e) => {\n\t\t\tlet myId = $(e.target).closest('.card').data('myId');\n\t\t\t$(e.target).hide(); $(`#pcm_hitStats1_${myId}`).show();\n\t\t});\n\t\t$(`.pcm_hitStats1`).unbind('click').click( (e) => {\n\t\t\tlet myId = $(e.target).closest('.card').data('myId');\n\t\t\t$(e.target).hide(); $(`#pcm_hitReqName1_${myId}`).show();\n\t\t});\n\t}", "title": "" }, { "docid": "54814eabcfa09e7c211b9f2c7a50bb48", "score": "0.5848216", "text": "function createButtons(){\n\n // This function will create the letter button pallate when start button or play again button is pressed \n\n // Array with alphabet letter\n var str = [\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"];\n\n var grid = document.createElement('div');\n grid.className =\"grid\";\n\n for(var i=0; i<str.length;i++){\n\n if (i==21 || i == 26 ){\n // create a p tag for empty spaces to center the buttons in the last line \n var txt = document.createElement('p');\n grid.appendChild(txt);\n }\n\n // creae a button for each letter\n var btn = document.createElement(\"BUTTON\");\n \n // create button id as btnA\n var btnId = \"btn\" + str[i];\n\n // set button attributes\n btn.setAttribute(\"id\",btnId);\n btn.setAttribute(\"value\",str[i]);\n btn.setAttribute(\"text\",str[i]);\n btn.innerHTML =str[i];\n \n btn.setAttribute('onclick',\"validateChar( '\" + btnId + \"')\");\n btn.className=\"btnKey\";\n grid.appendChild(btn);\n \n }\n\n document.body.appendChild(grid);\n\n}", "title": "" }, { "docid": "8f6356e0b746923c08eaf7d5dbf3b148", "score": "0.5847659", "text": "function manageButton(position){\r\n\tif( ((parseInt(position) + 1) < historyArray.length) && (historyArray.length != 1)){\r\n\t\t\tvar redo = document.getElementById('redo');\r\n\t\t\tredo.src = \"./img/redo.gif\";\r\n\t\t\tredo.setAttribute(\"class\", \"pointer\");\r\n\t\t\tvar redoCode = \"historyManage('\"+(parseInt(position) + 1)+\"')\";\r\n\t\t\tredo.onclick = null;\t\r\n\t\t\tredo.onclick = function(){\r\n\t\t\t\t\teval(redoCode);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar redo = document.getElementById(\"redo\");\r\n\t\t\tredo.src = \"./img/redoDisable.gif\";\r\n\t\t\tredo.setAttribute(\"class\", \"\");\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tredo.onclick = null;\t\t\r\n\t\t}\r\n\t\r\n\t\tif((parseInt(position) - 1)>= 0){\r\n\t\t\tvar undo = document.getElementById('undo');\r\n\t\t\tundo.src = \"./img/undo.gif\";\r\n\t\t\tundo.setAttribute(\"class\", \"pointer\");\r\n\t\t\tvar undoCode = \"historyManage('\"+(parseInt(position) - 1)+\"')\";\r\n\t\t\tundo.onclick = null;\t\r\n\t\t\tundo.onclick = function(){\r\n\t\t\t\t\teval(undoCode);\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\tvar undo = document.getElementById('undo');\r\n\t\t\tundo.src = \"./img/undoDisable.gif\";\r\n\t\t\tundo.setAttribute(\"class\", \"\");\r\n\t\t\tundo.onclick = null;\r\n\t\t}\r\n\t\t\r\n}", "title": "" }, { "docid": "d7199ab96250bad286ffb5472b24a71d", "score": "0.5843405", "text": "function editButtons(event, element) {\n document.getElementById(event.target.id).classList.remove('btn-success');\n document.getElementById(event.target.id).classList.add('btn-secondary');\n document.getElementById(event.target.id).disabled = true;\n let todoTextBox = retrieveTodo(element, 'todo');\n document.getElementById(todoTextBox.id).style.backgroundColor = \"#ffd7d7\";\n document.getElementById(todoTextBox.id).setAttribute('readonly', true);\n}", "title": "" }, { "docid": "8b0775bf86ca442bc2cfd6ff09be14ae", "score": "0.583889", "text": "function editButtonHandler() {\n var button = $(this);\n var node = button.data(\"node\"); // find the JS Node object associated with this button\n g_selectedNode = node; // set a global var, yuck //TODO find better way to connect to later button handlers\n var writable = node.isWritable();\n var parentWritable = node.parent.isWritable();\n var canHaveChildren = node.canHaveChildren();\n var canHaveValue = node.canHaveValue();\n // enable and disable buttons as appropriate.\n $(\"#cutButton\").prop('disabled',!parentWritable);\n $(\"#deleteButton\").prop('disabled',!parentWritable);\n $(\"#pasteOntoButton\").prop('disabled',!writable);\n $(\"#pasteUnderButton\").prop('disabled',!writable || !canHaveChildren);\n $(\"#createMetadataDialogButton\").prop('disabled',!writable);\n $(\"#createChildDialogButton\").prop('disabled',!writable || !canHaveChildren);\n $(\"#createInstanceDialogButton\").prop('disabled',!writable || !canHaveChildren);\n $(\"#createSpecialDialogButton\").prop('disabled',!writable || !canHaveChildren);\n $(\"#changeValueDialogButton\").prop('disabled',!writable || !canHaveValue);\n $(\"#editDialog\").dialog(\"open\"); // present all the \"edit\" action buttons\n}", "title": "" }, { "docid": "98e593c67fc9d7f524144413a7278dc2", "score": "0.58370155", "text": "function addListenersToButtons() {\n addListener($(\"start\"), \"click\", restart);\n addListener($(\"end\"), \"click\", endGame);\n addListener(document, \"keypress\", pickedCard);\n}", "title": "" }, { "docid": "cb53e44a6d47b5dd13729b4e84867b19", "score": "0.5835611", "text": "function buttons() {\n\t\n\t// Up button\n\tvar upBtn = document.createElement(\"BUTTON\");\n\tvar upBtnText = document.createTextNode(\"Up\");\n\tupBtn.id = 'upBtnID';\n\tupBtn.appendChild(upBtnText);\n\tdocument.body.appendChild(upBtn);\n\t\n\t// Down button\n\tvar downBtn = document.createElement(\"BUTTON\");\n\tvar downBtnText = document.createTextNode(\"Down\");\n\tdownBtn.id = 'downBtnID';\n\tdownBtn.appendChild(downBtnText);\n\tdocument.body.appendChild(downBtn);\n\t\n\t// Left button\n\tvar leftBtn = document.createElement(\"BUTTON\");\n\tvar leftBtnText = document.createTextNode(\"Left\");\n\tleftBtn.id = 'leftBtnID';\n\tleftBtn.appendChild(leftBtnText);\n\tdocument.body.appendChild(leftBtn);\n\t\n\t// Right button\n\tvar rightBtn = document.createElement(\"BUTTON\");\n\tvar rightBtnText = document.createTextNode(\"Right\");\n\trightBtn.id = 'rightBtnID';\n\trightBtn.appendChild(rightBtnText);\n\tdocument.body.appendChild(rightBtn);\n\t\n\t// Mark button\n\tvar markBtn = document.createElement(\"BUTTON\");\n\tvar markBtnText = document.createTextNode(\"Mark Cell\");\n\tmarkBtn.id = 'markBtnID';\n\tmarkBtn.appendChild(markBtnText);\n\tdocument.body.appendChild(markBtn);\n}", "title": "" }, { "docid": "ad7c7cc55cbf99b106ddc03f12635a86", "score": "0.58317494", "text": "function baseButtonUndo(eventNumber){\n\t\n\ttmpeventscounter = eventscounter;\n\t\n\teventscounter = eventNumber;\n\t\n\tundo();\n\t\n\t//var element = document.getElementById(\"rowcopy\"+eventscounter);\n\t//element.parentNode.removeChild(element);\n\t\n\teventscounter = tmpeventscounter;\n}", "title": "" }, { "docid": "0d5744f85090cdbe509a4e5cb86c488c", "score": "0.5831602", "text": "function buttonHandler(e) {\n const button = e.target.innerText;\n if (inf) return;\n else if (button.includes(\".\")) {\n return decButton(button);\n } else if (isNaN(button)) {\n actionButton(button);\n } else {\n numberButton(button);\n }\n}", "title": "" }, { "docid": "b788a090fd1b76b8c4d901d21a3d7d75", "score": "0.5831404", "text": "function buttonMold(bric, eventManager) {\n\t\tvar config = {\n\t\t\t\"id\" : bric.id,\n\t\t\t\"text\" : bric.text\n\t\t};\n\n\t\tvar button = Object.create(xButton);\n\t\tbutton.init(config, eventManager);\n\t\t// this could be an append action\n\t\t$('#' + bric.targetid).append(button.getRootEl());\n // subscribe to the button press - this shouldn't be in here but should instead be \n // configured out as an action\n\t\teventManager.subscribe(button.pressedEventId, function(){alert('yay' + bric.text);});\n\t}", "title": "" }, { "docid": "3403a08a5e835d79cdba2d7ba47747f2", "score": "0.58292246", "text": "function fillClickHandlers() {\n // Record original button labels\n $(\".storylet .button--go, .card__discard-button\").each(function() {\n if (!this.dataset.originalValue) {\n this.dataset.originalValue = this.value;\n }\n });\n}", "title": "" }, { "docid": "ccf9a0bee359ed3cad56b32d8068eede", "score": "0.5827641", "text": "function initButtons() {\n for (let i = 0; i < buttons.length; i++) {\n buttons[i].innerText = actions[i].text;\n buttons[i].style.pointerEvents = \"auto\";\n }\n}", "title": "" }, { "docid": "26fa04a934fb5d700a018e3a573b6be1", "score": "0.58140355", "text": "buttonPress() {\n\n this.promoButton.addEventListener('click', e => {\n this.clearData()\n this.activeButton()\n return this.getApi()\n })\n\n this.newCustom.addEventListener('click', e => {\n this.clearData()\n this.activeButton('promoOFF')\n return this.getApi(true)\n })\n\n }", "title": "" }, { "docid": "5a4cbc351ea4c9400f137478075e5f35", "score": "0.5809987", "text": "function pressButtons() {\n local_storage.SetLocalStorage(\"slice-btn\", \"default\");\n local_storage.SetLocalStorage(\"time-btn\", \"last-52-weeks\");\n local_storage.SetLocalStorage(\"comp-buttons\", \"BTH\");\n local_storage.SetLocalStorage(\"stat-buttons\", \"stat-all\");\n}", "title": "" }, { "docid": "3f4dadba2a6661f2eb2f7bfa4535c09d", "score": "0.58033293", "text": "_setupBootstrapToolbarButtons() {\n\t\tconst editor = this.editor;\n\n\t\tfor ( const name in this.view.toolbarButtons ) {\n\t\t\t// Retrieve the editor command corresponding with the id of the button in DOM.\n\t\t\tconst command = editor.commands.get( name );\n\t\t\tconst button = this.view.toolbarButtons[ name ];\n\n\t\t\t// Clicking on the buttons should execute the editor command...\n\t\t\tbutton.click( () => editor.execute( name ) );\n\n\t\t\t// ...but it should not steal the focus so the editing is uninterrupted.\n\t\t\tbutton.mousedown( evt => evt.preventDefault() );\n\n\t\t\tconst onValueChange = () => {\n\t\t\t\tbutton.toggleClass( 'active', command.value );\n\t\t\t};\n\n\t\t\tconst onIsEnabledChange = () => {\n\t\t\t\tbutton.attr( 'disabled', () => !command.isEnabled );\n\t\t\t};\n\n\t\t\t// Commands can become disabled, e.g. when the editor is read-only.\n\t\t\t// Make sure the buttons reflect this state change.\n\t\t\tcommand.on( 'change:isEnabled', onIsEnabledChange );\n\t\t\tonIsEnabledChange();\n\n\t\t\t// Bold, Italic and Underline commands have a value that changes\n\t\t\t// when the selection starts in an element the command creates.\n\t\t\t// The button should indicate that e.g. editing text which is already bold.\n\t\t\tif ( !new Set( [ 'undo', 'redo' ] ).has( name ) ) {\n\t\t\t\tcommand.on( 'change:value', onValueChange );\n\t\t\t\tonValueChange();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "ede573c8269676ef9372e6d404d68200", "score": "0.5803294", "text": "function getAllDeletes() {\r\n deleteButtons = document.querySelectorAll(\".itemIcon\")\r\n for (let i = 0; i < elements.length; i++) {\r\n deleteButtons[i].addEventListener(\"click\", deleteItem)\r\n\r\n }\r\n }", "title": "" }, { "docid": "80ed2a96af6800758b3b8f65e32e87fc", "score": "0.580327", "text": "function attachButtonEvents(buttons, callBack) {\n buttons.off('click');\n buttons.on('click', function(e) {\n e.preventDefault();\n const form = $(this).parent();\n callBack(form);\n return false;\n });\n}", "title": "" }, { "docid": "eb99f5706e89faf91cba7e771538e4ac", "score": "0.58017606", "text": "function onDeletePressed() {\n\t\tdeleteEvent(props.event.key);\n\t\tsetShowRemoveModal(false);\n\t}", "title": "" }, { "docid": "405c64d3a666d9427d19b63fd39371a8", "score": "0.57992893", "text": "function clearButtonClickEvents() {\r\n for (let i = 1; i <= POP_CONT_MAX; i++) {\r\n let thisBtn = \".\" + POP_BTN + i;\r\n $(thisBtn).off(\"click\");\r\n }\r\n }", "title": "" }, { "docid": "a85195cad4930add49d04a7cfbdb1f5a", "score": "0.579885", "text": "function addEventListenerOnButton(buttons, query){\n for(let i = 0; i < buttons.length; i++) {\n buttons[i].addEventListener(\"click\", function(event) {\n //change input field value on clicking on +/- button\n changeValue(event, query);\n //update cart total for every click\n updateTotal();\n })\n }\n}", "title": "" }, { "docid": "3b7b2e0bb0a9de51b2dcc4a03e2bf863", "score": "0.5798179", "text": "function inputClick () {\n\tif (firstInput) {\n\t\t$('#inputView').text(\"\");\n\t\tfirstInput = false;\n\t};\n\n\tvar buttonLabel = $(this).text();\n\tswitch (buttonLabel) {\n\t\tcase \"Clear\": case \"Redo\": case \"Undo\":\n\t break;\n\t default:\n\t \tif (clickStack.length > 0) {\n\t \t\tclickStack = [];\n\t \t};\n\t $('#inputView').html($('#inputView').html() + \"<span>\" + buttonLabel + \"</span>\");\n\t}\n}", "title": "" }, { "docid": "6d770f771767faf976e5ed066e94db77", "score": "0.5797414", "text": "deleteEvent() {\n\n const deleteButtons = document.querySelector(\".contentContainer\")\n\n deleteButtons.addEventListener(\"click\", event => {\n if (event.target.id.startsWith(\"deleteButton--\")) {\n const entryToDelete = event.target.id.split(\"--\")[1]\n API.deleteEntry(entryToDelete)\n .then(API.getEvents)\n .then(this.putEventsOnDOM)\n }\n })\n\n }", "title": "" } ]
4917a5ef8db0cf250515de8af4699e00
Write a function `middleElement` that takes an array as an argument and returns the middle element of that array. If the array has an even number of elements, the function should return "Oops, there's no middle..." middleElement(['dog', 'cat', 'bat', 'octopus', 'chinchilla']); returns 'bat' middleElement([1, 2, 3, 4, 5]); returns 3 middleElement([1, "hmm", "wat", 4, 5]); returns "wat" middleElement([1, 2, 3, 4, 5, 6]); returns "Oops, there's no middle" middleElement(["john", "paul", "george", "ringo"]); returns "Oops, there's no middle"
[ { "docid": "23af9a06aae738108c33db72b1976797", "score": "0.8393599", "text": "function middleElement(array){\n if(array.length % 2 !==0){\n return array[(array.length-1)/2] \n } else {\n return \"Oops , there's no middle\"\n }\n}", "title": "" } ]
[ { "docid": "6268e7943b5814a19ec2421eb5787ba5", "score": "0.8272843", "text": "function middleArray(array) {\r\n var x = array.length;\r\n\r\n if (x % 2 !== 0) {\r\n return array[Math.floor((x / 2))];\r\n }\r\n else {\r\n return \"the array must have an odd number of elements\"\r\n }\r\n}", "title": "" }, { "docid": "2f567905116320a7064d69808c9ed466", "score": "0.8022798", "text": "function middleArray(array) {\r\n if (array.length % 2 !== 0) {\r\n return array[(Math.floor(array.length / 2))];\r\n }\r\n else {\r\n return \"Enter an array with an odd length.\"\r\n }\r\n}", "title": "" }, { "docid": "241d6e78548a03058bd83b9c8f490d15", "score": "0.7911611", "text": "function middle (array){\n if (array.length % 2 === 1) return array[((array.length+1)/ 2)-1]\n return array[(array.length/ 2)-1]\n}", "title": "" }, { "docid": "c82e2c0ae2025ffa41f9c99fa9ab1a2c", "score": "0.78793854", "text": "function middle(array) {\r\n if (array.length % 2 === 0) {\r\n return array[Math.floor(array.length/2)];\r\n }\r\n return 'undefined';\r\n}", "title": "" }, { "docid": "9ce2221fe7023661e7fa2e5cf171c2bc", "score": "0.7854929", "text": "function middle(array) {\n\tvar middleIndex = 0\n\tif (array.length % 2 === 1) {\n\t\tmiddleIndex = Math.floor(array.length / 2);\n\t\treturn array[middleIndex];\n\t}\n\telse {\n\t\tmiddleIndex = Math.floor(array.length / 2);\n\t\treturn array[middleIndex -1] + ', ' + array[middleIndex];\n\t}\n}", "title": "" }, { "docid": "dc38da0a7806d8bfdacd832bcdc89309", "score": "0.7425592", "text": "function getMidElement(arr) {\n\t//Check if the input is an array else return invalid input\n\tif(Array.isArray(arr) && arr.length > 1){\n\t\tvar arrLength = arr.length;\n\t\tif(arrLength % 2 === 0){\n\t\t\tvar result = [];\n\t\t\tmid = arrLength/2;\n\t\t\tresult.push(arr[mid-1]);\n\t\t\tresult.push(arr[mid]);\n\t\t\treturn result;\n\t\t}else{\n\t\t\treturn arr[Math.round(arrLength/2) - 1];\n\t\t}\n\t}else{\n\t\treturn 'invalid input';\n\t}\n}", "title": "" }, { "docid": "aa7503c7360a90fcbe410d1a60e379f2", "score": "0.7201117", "text": "function numOfElLessThanMidEl(array) {\n var indexOfMiddleEl = 0;\n var newArray = [];\n\n if (!isArrayOfOddNumOfElements(array)) {\n return 'The input array has an even number of elements.'\n }\n\n indexOfMiddleEl = Math.floor(array.length / 2);\n\n newArray = array.filter(function (element) {\n return element < array[indexOfMiddleEl];\n });\n \n return newArray.length;\n}", "title": "" }, { "docid": "f8951e1449287b6ab598334f2a73680c", "score": "0.71465033", "text": "function middle(numbers) {\n //declare variables for result and index.\n let result = 0;\n let index;\n //checking the middle of the array depends if the length is an odd number.\n if (numbers.length % 2 === 1) {\n //Math.floor to make sure that we get the right index as arrays starts from 0.\n index = Math.floor(numbers.length / 2);\n return numbers[index];\n } else {\n index = numbers.length / 2\n //taking the two elements in the middle when the length of the array is an even number.\n result = (numbers[index] + numbers[index - 1]) / 2\n return result;\n }\n}", "title": "" }, { "docid": "641c8400f011bb6434403e6b9cc7c900", "score": "0.7125937", "text": "function getMiddle(list) {\n list = [5, 10, 15, 20, 25, 30];\n let answer = 0;\n numLength = list.length;\n if (numLength % 2 === 0) { //even length array (two middle elements)\n answer = (list[numLength / 2 - 1] + list[numLength / 2]) / 2;\n } else { // odd length array (middle elements)\n answer = list[(numLength - 1) / 2];\n }\n document.getElementById(\"output\").innerHTML = list;\n document.getElementById(\"showArray\").innerHTML = answer;\n return answer;\n}", "title": "" }, { "docid": "8b56223d2b90a1e1d79f6b2a4e0e419b", "score": "0.7122624", "text": "function ArrayMiddle() {\n\t// YOUR CODE HERE\n\t// check if the array length is even or odd\n\t// call the element in the center if odd and caculate the average if even.\n}", "title": "" }, { "docid": "d73d9304c22d51fa1f886f969da10ddf", "score": "0.7078316", "text": "function arrayMiddle (numbers) {\n //if there is an even number of integers...\n if (numbers.length % 2 === 0) {\n //return the average of the middle two numbers\n return (numbers[Math.floor(numbers.length / 2) -1] + numbers[Math.floor(numbers.length / 2)]) / 2;\n } \n //otherwise return the interger at the middle position\n return numbers[Math.floor(numbers.length / 2)];\n}", "title": "" }, { "docid": "b60e23afe467eb090025e95bbf18e4c7", "score": "0.6991793", "text": "function middle(array){\n let newArray = [];\n if (array.length <= 2 && array.length > 0){\n console.log('empty');\n } else if (array.length % 2 !== 0){\n newArray = [array[Math.floor(array.length / 2)]];\n console.log('odd');\n } else if (array.length % 2 === 0){\n newArray = [array[(array.length / 2) - 1], array[array.length/2]];\n console.log('even');\n }\n return newArray;\n}", "title": "" }, { "docid": "63758ff44fc1fbfccaf8b051cdaf34a2", "score": "0.6894728", "text": "function mid(arr){\n\tvar mElement;\n\tfor(var i = 0; i < arr.length; i++){\n\t\tmElement = arr.length[i] / 2;\n\t}\t\n\treturn mElement[i];\n}", "title": "" }, { "docid": "ddd8fc1a4f1bbbc8aa7f1fad1c789a0d", "score": "0.67112577", "text": "function firstAndLast(arr) {\n if (arr.length !== 0) {\n switch (arr.length%2 === 0) {\n case true:\n return 'First element is ' + arr[0] + ' and the last element is ' + arr[arr.length-1];\n case false:\n return 'First element is ' + arr[0] + ' the middle one is ' + arr[parseInt(arr.length/2+'')] + ' and the last element is ' + arr[arr.length-1];\n }\n }\n else {\n return 'Please input array'\n }\n}", "title": "" }, { "docid": "68883386010b52b0cbe168330212d778", "score": "0.666582", "text": "function firstMiddleLast(someArr) {\n var newResult = [];\n var middle;\n if (someArr.length % 2 !== 0) {\n middle = someArr[(someArr.length / 2) - 0.5];\n newResult[newResult.length] = someArr[0];\n newResult[newResult.length] = middle;\n newResult[newResult.length] = someArr[someArr.length-1];\n }\n else {\n newResult[newResult.length] = someArr[0];\n newResult[newResult.length] = someArr[someArr.length-1];\n }\n return newResult;\n}", "title": "" }, { "docid": "dbe202820ddb61c82349b42ac72fde14", "score": "0.66460836", "text": "function countsMiddleElement(array) {\n var result;\n result = Math.round(array.length / 2);\n return result;\n}", "title": "" }, { "docid": "af3291bc6e99ea43415f636f9dfc87e4", "score": "0.66039586", "text": "function makeMiddle(nums){\n let len = nums.length / 2;\n if(nums.length === 2)\n return nums;\n else\n let a = [nums[len -1] , nums[len]];\n return a ;\n}", "title": "" }, { "docid": "30c084d5a766864e973d73148c8299e0", "score": "0.6468077", "text": "function middleOfArray(abc) {\n if (!abc.length)\n return;\n \n const mid = abc.length / 2;\n if (abc.length % 2 === 1) {\n return abc[Math.floor(mid)];\n } else \n {\n return [\n abc[mid - 1],\n abc[mid],\n ];\n }\n }", "title": "" }, { "docid": "f5abc13d59e794df1088eed0a205e675", "score": "0.6432189", "text": "function getMiddle(s)\n{\n var midOfS = 0;\n var midOfSOdd = 0;\n var evenOrOdd = s.length;\n if (evenOrOdd % 2 == 0) {\n midOfS = evenOrOdd / 2 - 1;\n var mySlice = s.slice(midOfS, (midOfS +2));\n return mySlice;\n }\n else {\n midOfSOdd = evenOrOdd/2;\n var mySliceOdd = s.slice(midOfSOdd, (midOfSOdd +1));\n\n return mySliceOdd;\n }\n}", "title": "" }, { "docid": "003a7152e341898c33483ada01cf9187", "score": "0.6392852", "text": "function findMiddle(word){\n if(word.length === 2){\n return ''\n }\n if(word.length % 2 === 1){\n var mid = Math.floor(word.length/2)\n return word[mid]\n }else{\n var mid1 = (word.length / 2) - 1 \n var mid2 = word.length / 2\n return word[mid1] + word[mid2]\n }\n}", "title": "" }, { "docid": "897bcdfb48ae5dfdb265d68e953a0dde", "score": "0.6176352", "text": "function middle_elements(a, b) \n{\n var new_array = []\n new_array.push(a[1], b[1]);\n\n return new_array;\n}", "title": "" }, { "docid": "b52dc6fe9e44229e9eab000ff4af5dd2", "score": "0.6100356", "text": "function findMedian() {\n if (numArray.length % 2 === 0) {\n //log the two middle numbers if array length is even\n console.log(\"median when array length is even: \" + numArray[middle - 1] + \" \" + numArray[middle]);\n //log the result after dividing the two middle numbers\n console.log(\"**** The median is: \" + (numArray[middle - 1] + numArray[middle]) / 2);\n } else {\n console.log(\"**** The median is: \" + numArray[middle]);\n }\n}", "title": "" }, { "docid": "742feb7dfbca4d9d9831c5fdb4d37b20", "score": "0.6079391", "text": "function firstLastMidleEl(someArr) {\n var first;\n var last;\n var midle;\n\n var res = '';\n for (var i = 0; i < someArr.length; i++) {\n if (someArr.length % 2 !== 0) {\n first = someArr[0];\n last = someArr[someArr.length - 1];\n midle = someArr[(someArr.length - 1) / 2];\n }\n else {\n first = someArr[0];\n last = someArr[someArr.length - 1];\n midle = someArr[someArr.length / 2];\n\n }\n }\n res = 'first element is ' + first + ' midle is ' + midle + ' and the last is ' + last;\n return res;\n}", "title": "" }, { "docid": "97fd6852240718c839897b3c2aa25f8b", "score": "0.60783654", "text": "middle() {\n const center = Math.floor(this.length/2);\n return this._find(center).value;\n }", "title": "" }, { "docid": "bdba76eca7764292b1ecd4f35e1b2327", "score": "0.60459", "text": "function middleSearch(arr, key, startIndex, endIndex) {\n if (startIndex > endIndex) {\n return false\n }\n middle = Math.floor((startIndex + endIndex) / 2)\n if (arr[middle] == key) {\n return middle\n } else if (arr[middle] > key) {\n return middleSearch(arr, key, startIndex, middle - 1)\n } else {\n return middleSearch(arr, key, middle + 1, endIndex)\n }\n}", "title": "" }, { "docid": "af4fe6ed77bf9c1bdadbfd228edf3063", "score": "0.6017241", "text": "function getMiddle(s) {\n if (s.length === 1) {\n return s;\n }\n var mid = (s.length / 2);\n if (Number.isInteger(mid)) {\n return s.slice((mid - 1), mid + 1);\n } else if (!Number.isInteger(mid)) {\n var jay = Math.floor(mid);\n return s.slice(jay, (jay + 1));\n }\n\n}", "title": "" }, { "docid": "050e2d0d72489c397793ba546bfc193d", "score": "0.60127556", "text": "function valueMiddleArray(arr, persona) {\r\n arr.splice((arr.length/2), 0, persona);\r\n return arr;\r\n}", "title": "" }, { "docid": "2004a36380589ceeb634fb500836dc63", "score": "0.59378016", "text": "function getMiddle(s) {\r\n\tlet sArr = s.split(\"\");\r\n\tlet middleInddex = s.length / 2;\r\n\tif (s.length % 2 == 0) {\r\n\t\treturn sArr[middleInddex - 1] + sArr[middleInddex];\r\n\t} else {\r\n\t\treturn sArr[Math.floor(middleInddex)];\r\n\t}\r\n}", "title": "" }, { "docid": "1263fe5eadfa5dde0cbe58a86d07d010", "score": "0.59284043", "text": "function centralEle(arr){\n let arrLength = arr.length\n return arr.slice(arrLength/2, (arrLength/2) + 1);\n }", "title": "" }, { "docid": "3cb0894ae4e773e47b24d18889dfda17", "score": "0.59173375", "text": "function getMiddle(s){\n var lengthS = s.length\n var middleS = Math.floor(Number(lengthS) / 2)\n var output = ''\n\n if(lengthS % 2 == 0){\n for (var i = 0; i < lengthS; i++){\n if(i == middleS){\n output += s[(middleS - 1)]\n output += s[middleS]\n }\n }\n }else{\n for (var i = 0; i < lengthS; i++){\n if(i == middleS){\n output = s[(0 + middleS)]\n }\n }\n }\n\n return output\n}", "title": "" }, { "docid": "9a4b97da8508140c249891969aea7f6f", "score": "0.59150374", "text": "function getMiddle(s)\n{\n //Code goes here!\n var l = s.length;\n //for even number letter words, return the middle 2 index\n if (l%2 === 0){\n return s.slice(l/2-1, l/2+1);\n } else {\n //for odd number letter words, return the middle index\n //trunc is used to drop the decimal\n return s[Math.trunc(l/2)]\n };\n}", "title": "" }, { "docid": "c2dbe1e050a83b5cb4432b47eb70f95d", "score": "0.5909303", "text": "function getMiddle(s)\n { \n if (s.length == 1) return s;\n var ind = Math.round(s.length/2)-1;\n return s.slice(ind,(-1*ind));\n\n }", "title": "" }, { "docid": "820e68e2c9d3304831d370c206f00500", "score": "0.58764946", "text": "function getMiddle(str) {\n let length = str.length\n let middle = Math.floor(length / 2)\n \n if (length % 2 === 0) {\n return str[middle - 1] + str[middle]\n } else {\n return str[middle]\n }\n}", "title": "" }, { "docid": "c95d8ead36a1f00f63cfd353b407069f", "score": "0.58709025", "text": "function median(a) {\n\n for (var i = 0; i < a.length; i++) {\n\n var mediumIndex;\n var mediumElement;\n\n if (a.lenght % 2 === 0) {\n mediumIndex = a.length / 2;\n } else if (a.length % 2 === 1) {\n mediumIndex = (a.length - 1) / 2;\n }\n mediumElement = a[mediumIndex];\n return mediumElement;\n }\n}", "title": "" }, { "docid": "8c5ede4bc0766a39e89a05a54dd321ed", "score": "0.5862243", "text": "function median(arr) {\n //if array empty then no median\n if (arr.length == 0) { \n return \"Wrong!\"; \n }\n //if number of element is odd\n if (arr.length % 2 == 1) {\n return arr[Math.floor(arr.length / 2)];\n } else {//if number of element is even\n var index = arr.length / 2;\n return (arr[index - 1] + arr[index]) / 2;\n }\n}", "title": "" }, { "docid": "31d978063acb4aec658820b7d8f5fb96", "score": "0.5849764", "text": "function getMiddle(s) {\n half = s.length / 2\n return answer = (s.length % 2 === 0)\n ? s.substring(half - 1, half + 1)\n : s.substring(half, half + 1)\n}", "title": "" }, { "docid": "2a727fb19f8483898f391f1d2f715959", "score": "0.58489454", "text": "function median (arr) {\n let sortedArr = arr.sort();\n // console.log(sortedArr);\n let middle = Math.ceil(arr.length / 2);\n // console.log(middle);\n \n let medianArr; \n\n if (arr.length == 0){\n medianArr = null;\n } else if (arr.length % 2 == 0) {\n // if the modus has no remainer. ie. is EVEN\n medianArr = (sortedArr[middle] + sortedArr[middle - 1]) / 2;\n // console.log(medianArr);\n } else {\n medianArr = sortedArr[middle - 1];\n // console.log(medianArr);\n }\n return medianArr;\n}", "title": "" }, { "docid": "e0ca67561987aceb761bd612ddb21b9e", "score": "0.57819974", "text": "function getMiddle(s = document.getElementById(\"str\").value) {\n let mid = (s.length - 1) / 2\n if (mid % 1 === 0) {\n document.getElementById(\"result\").innerHTML = s[mid]\n }\n else {\n mid = Math.floor(mid)\n document.getElementById(\"result\").innerHTML = s[mid] + s[mid + 1]\n }\n}", "title": "" }, { "docid": "9b2f7b705343bc8f46881b1655ab8eab", "score": "0.57732093", "text": "function valueMiddleArray(arr, human) {\n arr.splice(arr.length / 2, 0, human);\n return arr;\n}", "title": "" }, { "docid": "caa9f7ab35c743795c6a964c0e82b352", "score": "0.5772191", "text": "function countElement (array) {\n var result = 0;\n var mid;\n if (array.length % 2 === 0) {\n result = 'Error';\n }\n \n for (var i = 0; i < array.length; i++) {\n if ( array.length % 2 === 1) {\n mid = array[parseInt(array.length /2)];\n }\n }\n for (var i = 0; i < array.length; i++) {\n if(array[i] < mid) {\n result++;\n }\n }\n return result;\n}", "title": "" }, { "docid": "f1ab79e76c35805a67fd4dfa1755dc40", "score": "0.5771342", "text": "function median(input_array)\n {\n input_array.sort(function (a,b){return a - b});\n var middle = Math.floor(input_array.length/2);\n \n if (input_array.length === 0) \n {return null}\n else if ((input_array.length % 2) === 0) \n {return (input_array[middle] + input_array[middle - 1])/ 2;}\n else \n {return input_array[middle]}\n }", "title": "" }, { "docid": "67ddbdc83e00cacf94bab099c56fcfa2", "score": "0.5771115", "text": "function getMiddle(s) {\n s = s.split(\"\");\n console.log(s);\n if (s.length % 2 === 0) {\n return `${s[s.length / 2 - 1]}${s[s.length / 2]}`;\n } else {\n console.log(\"hi\");\n return `${s[Math.floor(s.length / 2)]}`;\n }\n}", "title": "" }, { "docid": "1486847a63235dc91816ab9b2aac8e72", "score": "0.5764962", "text": "function getMedian(array) {\n //sort numbers in ascending order\n array.sort(function(a, b) {\n return a - b;\n });\n var median;\n\n if (array.length % 2 !== 0) {\n // get middle index value on odd index;\n median = array[Math.floor(array.length / 2)];\n } else {\n var mid1 = array[array.length / 2 - 1];\n var mid2 = array[array.length / 2];\n median = (mid1 + mid2) / 2;\n }\n return median;\n}", "title": "" }, { "docid": "c6cbe0cff66d048c1775c72936daf1ed", "score": "0.5744104", "text": "function median(array) {\n\n var middleIndex = Math.floor(array.length / 2)\n array.sort(function(a, b){return a - b;});\n\n if (array.length % 2) {\n return array[middleIndex]}\n else {\n return ((array[middleIndex - 1] + array[middleIndex]) / 2)}\n}", "title": "" }, { "docid": "1fd95ea5cd052de95ebe7cbace512538", "score": "0.5717007", "text": "function middleWay(a, b){\n return [a[1], b[1]]\n}", "title": "" }, { "docid": "8b4638ee54e7ea29d67860b144460c81", "score": "0.5713367", "text": "getMiddleData() {\n let runner = this.head;\n let len = 0;\n while (runner) {\n len++;\n runner = runner.next;\n }\n // even length, no middle\n if (len % 2 === 0) {\n return null;\n }\n runner = this.head;\n let midPoint = Math.floor(len / 2);\n let idx = 0;\n while (idx !== midPoint) {\n idx++;\n runner = runner.next;\n }\n return runner.data;\n }", "title": "" }, { "docid": "e0164f9abcd54ed32b3f2cc2d64a17c9", "score": "0.57030714", "text": "function median(arr) {\n var len = arr.length;\n if (len % 2 !== 0) {\n midtop = Math.ceil(len / 2);\n midbottom = Math.floor(len/2);\n return arr[midbottom];\n } else {\n midtop = len/2;\n midbottom = len/2;\n return (arr[(len/2)-1] + arr[len/2])/2;\n } \n } //end median()", "title": "" }, { "docid": "78cc1aaa94506bc19a4909e53b361315", "score": "0.57002735", "text": "function getMiddle(s)\n{\nif (s.length % 2 === 0) \n return s.slice(s.length / 2 - 1, s.length / 2 + 1 );\n return s[Math.trunc(s.length / 2)];\n}", "title": "" }, { "docid": "c5c664a13c9a7c2eee57bade224d694d", "score": "0.5688345", "text": "function getMiddle(s)\n{\n return s.slice((s.length-1)/2, s.length/2+1);\n}", "title": "" }, { "docid": "fd9fc2b71188a7be4a9db0baf262a67b", "score": "0.5680063", "text": "function getMiddle(s) {\n if (s.length % 2 != 0) {\n return s.substring(((s.length/2)), ((s.length/2)+1)) \n } else {\n return s.substring(((s.length/2)-1), (s.length/2)+1)\n }\n}", "title": "" }, { "docid": "c46edbcdf1b4aea672d44402668efd07", "score": "0.56760716", "text": "function binarySearch(arr, element) {\n\n let start = 0;\n let end = arr.length -1\n let middle = 0\n\n\n while(arr[middle] !== element && start <= end){\n console.log(start, 'start')\n console.log(end, 'end')\n middle = Math.floor((start + end) / 2)\n console.log(arr.slice(start, end))\n console.log(arr[middle], 'MIDDLE')\n console.log(middle, 'MIDDLE element')\n if(element < arr[middle]){\n end = middle - 1\n } else { \n start = middle + 1\n }\n\n }\n return arr[middle] === element ? middle : -1;\n\n}", "title": "" }, { "docid": "b5545dd27a7bba8d5ce58fd559e29b8c", "score": "0.5671444", "text": "function median(arr) {\n\n var middle = Math.floor(arr.length / 2);\n\n arr.sort(function (a, b) { return a - b; });\n\n if (arr.length % 2) {\n\n return arr[middle];\n } else {\n\n return (arr[middle - 1] + arr[middle]) / 2.0;\n }\n}", "title": "" }, { "docid": "115120a7a3c47c00ee7c4acfcc4d69a7", "score": "0.5651223", "text": "function sample(array)\n{\n let first = array[0];\n let middle = array[Math.floor(array.length/2)];\n let last = array[array.length - 1];\n\n return [first, middle, last];\n}", "title": "" }, { "docid": "d5225d88263108066067b4352887ddb5", "score": "0.5630355", "text": "function binarySearch(arr, elem){\n let start = 0;\n let end = arr.length - 1;\n let middle = Math.floor(arr.length / 2);\n while(arr[middle] !== elem && start <= end){\n if(elem < arr[middle]){\n end = middle - 1;\n }\n else {\n start = middle + 1;\n }\n middle = Math.floor((start + end) / 2);\n } \n console.log(start, middle, end); \n console.log(middle);\n}", "title": "" }, { "docid": "a3723a5db8d661fc1d8604771dc3447c", "score": "0.5626214", "text": "function search(arr){\n let first = 0;\n let last = arr.length - 1;\n let middle = Math.floor(last / 2);\n\n while(last - first !== 0){\n if(arr[middle] === val){\n // compare the middle element of the array with the target value.\n return middle;\n }\n\n if(arr[middle] > val){\n // if the target value is less than the middle element, continue search on lower half of array.\n // set last = previous middle\n last = middle;\n // new middle = last / 2;\n middle = Math.floor(last / 2);\n }else{\n // if the target value is greater than the middle element, continue search on upper half of array.\n // set first = previous middle\n first = middle;\n // new middle = (last + first) / 2\n middle = Math.floor((last + first) / 2);\n }\n }\n return -1;\n }", "title": "" }, { "docid": "899de958d93788baa9380076e469f22a", "score": "0.5615532", "text": "function getMiddle(s) {\n let x = Math.floor(s.length / 2);\n return s.length % 2 === 0 ? s[x - 1] + s[x] : s[x];\n // if(s.length % 2 == 0){\n // return s[ x - 1] + s[x]\n // } else {\n // return s[x]\n // }\n\n // if(s.length % 2 === 0){\n // return s.charAt(s.length/2-1) + s.charAt(s.length/2)\n // }else{\n // return s.charAt(s.length/2)\n // }\n}", "title": "" }, { "docid": "20af1f407e8fe69a8fc1190de1611f60", "score": "0.55858505", "text": "function getMiddle(string) {\n\t// create a variable and assign it to the middle character of the string -> round down\n\tlet middle = Math.floor(string.length / 2);\n\t// if string length is even\n\tif (string.length % 2 === 0) {\n\t\t// the return the middle two characters\n\t\treturn string[middle - 1] + string[middle];\n\t}\n\t// otherwise\n\t// return the middle character\n\treturn string[middle];\n}", "title": "" }, { "docid": "b6721b3d2694d83b6181fc93febea0cb", "score": "0.5557823", "text": "function median(array) {\n \n array = array.sort(); \n var half = Math.floor((array.length)/2)\n \n if (array.length % 2 !== 0) { \n var median = array[half];\n } \n else { \n var median = (array[half] + array[(half-1)])/2; \n }\n return median;\n}", "title": "" }, { "docid": "e00dc66631cba2939f3e625a000d8ca2", "score": "0.5546766", "text": "function middleChar(string) {\n // using substr() because it takes two parameters to start from the extraction of the length and return the number of letters.\n let midChar;\n \n if (string.length % 2 == 0){\n // if to check if number is even\n // middle is defined to extract parts of a string from start to length\n // this will return 2 digits for even numbers\n midChar = string.substr((string.length / 2) - 1, 2);\n \treturn midChar;\n }\n \n if (string.length % 2 == 1 ){\n //if to check if the number is odd\n //this is set to where it will return 1 digit\n middle = string.substr(string.length / 2, 1);\n return midChar;\n }\n \n}", "title": "" }, { "docid": "7c817c1861e26644d395e184b6aee0ed", "score": "0.55202484", "text": "function secondLast (arr) {\n if(arr.length >= 3){\n return arr[arr.length-2];\n }else {\n return null;\n }\n}", "title": "" }, { "docid": "496f3843d498356a7913e84eeea0df05", "score": "0.5512511", "text": "function getMiddle(s)\n{\n var letters = s.split('');\n var letter = \"\";\n if(letters.length % 2 === 0){\n letter = letters[letters.length/2 - 1] + letter;\n letter = letter + letters[letters.length/2];\n return letter;\n } else if (letters.length % 2 !== 0) {\n letter = letters[(letters.length - 1)/2] + letter;\n return letter;\n }\n}", "title": "" }, { "docid": "4981c25631a5a6bb2ebd7a09faa1a858", "score": "0.5512256", "text": "function placeInMiddle(arr, vals){\n //find middle of the array\n let middleOfArray = arr.length/2;\n console.log(\"length of array is \" + middleOfArray);\n //now we know the first parameter to pass into splice() method, this is our middleOfArray\n arr.splice(middleOfArray, 0, ...vals);\n return arr;\n}", "title": "" }, { "docid": "fd2f604b0cd4f13f729b6a971a9a8768", "score": "0.54854184", "text": "function GetFirstElementOfArrayInTraditionalWay(elementArray, number) {\n if(elementArray == null || number < 0){\n return [];\n }\n if(number == null){ \n return elementArray[0];\n }\n return elementArray.slice(0,number);\n}", "title": "" }, { "docid": "6a9a235cea2fbbd8ed9adbe68c5f3c60", "score": "0.5483427", "text": "function findMiddleIndex(str) {\r\n let middleOfString = Math.floor(str.length / 2);\r\n return middleOfString;\r\n}", "title": "" }, { "docid": "4b5ce2fc426bb59beecbfb7c5c1b9f34", "score": "0.5480997", "text": "function q3(array){\n console.log(\"the second-to-last value in the array is:\")\n console.log(array[array.length-2]);\n for (var i=0; i<array.length;i++){\n var temp=array[i]%2;\n if(temp!=0){\n console.log(\"he first odd value in the array is:\");\n return array[i];\n }\n }\n}", "title": "" }, { "docid": "85f0fed657599fd1c163701ca2942d19", "score": "0.54733336", "text": "function getMiddle(s) {\n if(s.length % 2 === 0) {\n var l = s[Math.floor((s.length / 2) - 1)];\n var r = s[Math.floor(s.length / 2)];\n return l + r;\n }\n else {\n return s[Math.round((s.length - 1) / 2)];\n }\n}", "title": "" }, { "docid": "97418335f5c46b6c35389b35729f1294", "score": "0.54702777", "text": "function f(arr) {\n let word = arr[0];\n let index = arr[1];\n if (word.length < index + 1 || typeof word !== \"string\") {\n return undefined;\n }\n return word[index];\n}", "title": "" }, { "docid": "9cdddd91f35e72592b59f35ae8afb675", "score": "0.5468887", "text": "function mid(arr1,arr2){\n if((arr1.length === 3) && (arr1.length === arr2.length)){\n return [arr1[1],arr2[1]];\n } \n}", "title": "" }, { "docid": "69df1e9ad0870067fec9ed7650b6955f", "score": "0.54463685", "text": "function middle(list) {\n let slowNode = list.head;\n let fastNode = list.head;\n\n while (fastNode !== null) {\n if (fastNode.next == null) {\n return slowNode.value;\n } else {\n fastNode = fastNode.next.next;\n slowNode = slowNode.next;\n }\n }\n return slowNode.value;\n}", "title": "" }, { "docid": "af91957644669478f7c866e83b3f5c17", "score": "0.5436202", "text": "function search(array, targetElement, firstElement1, lastElement1) {\n // Checking if the lowest index is greater than the high index\n if (firstElement1 > lastElement1) {\n // Returning that the number could not be found in the array\n return \"ERROR. Number is unavailable in array!\";\n } else {\n let middleElement = Math.floor((lastElement1 + firstElement1) / 2);\n\n // Searching for number in array using if statements and recursion\n if (array[middleElement] < targetElement) {\n return search(array, targetElement, middleElement + 1, lastElement1);\n } else if (array[middleElement] > targetElement) {\n return search(array, targetElement, firstElement1, middleElement - 1);\n } else {\n let solution = middleElement;\n return solution;\n }\n }\n}", "title": "" }, { "docid": "07df1cb7b94fcf1abf8a4710c8439132", "score": "0.54291856", "text": "getMiddle() {\n let first = this.first;\n let second = this.first;\n\n while (second !== this.last && second.next !== this.last) {\n second = second.next.next;\n first = first.next;\n }\n if (second === this.last) {\n return [first];\n } else {\n return [first, first.next];\n }\n }", "title": "" }, { "docid": "a6e25b4f6ffb21ab29086ce89d8f38a2", "score": "0.5414864", "text": "function middleName(firstName, middleName, lastName) {\n\tif (middleName === null) {\n\t\treturn firstName + ' ' + lastName;\n\t} else {\n\t\treturn firstName + ' ' + middleName + ' ' + lastName;\n\t}\n}", "title": "" }, { "docid": "daba05b9945a8c5cb8bef03cae2b72a3", "score": "0.5400788", "text": "function printOneReturnAnother(arr)\n{\n for(var i = 0; i < arr.length; i++)\n {\n if(arr[i] % 2 !== 0)\n {\n var odd = arr[i];\n break;\n }\n }\n console.log(arr[arr.length-2] + \" is the second-to-last value in the array\");\n return odd;\n}", "title": "" }, { "docid": "30b756f5b60f211586ebcc93e93aea02", "score": "0.53971267", "text": "function getMiddle(str) {\n\n var position;\n var length;\n\n if(str.length % 2 == 1) {\n position = str.length / 2;\n length = 1;\n } else {\n position = str.length / 2 - 1;\n length = 2;\n }\n\n return str.substring(position, position + length)\n}", "title": "" }, { "docid": "06fd23b7346a6fd34dea2988548ce12b", "score": "0.538225", "text": "function firstElem (array,n) {\r\n if (array==null) {\r\n return undefined;\r\n }\r\n else if(n==undefined){\r\n return array[0];\r\n }else {\r\n return array.splice(0,n);\r\n }\r\n}", "title": "" }, { "docid": "3dd925eae1e2e34071ea8cf8cad22b1e", "score": "0.5378651", "text": "function median(array){\n var halfArrLength = array.length / 2,\n sorted_array = array.sort(function(a, b){return a-b});\n if (array.length % 2 == 0){\n console.log((sorted_array[halfArrLength] + sorted_array[(halfArrLength)-1])/ 2);\n } else {\n console.log(sorted_array[(halfArrLength) - 0.5]);\n }\n}", "title": "" }, { "docid": "3dd925eae1e2e34071ea8cf8cad22b1e", "score": "0.5378651", "text": "function median(array){\n var halfArrLength = array.length / 2,\n sorted_array = array.sort(function(a, b){return a-b});\n if (array.length % 2 == 0){\n console.log((sorted_array[halfArrLength] + sorted_array[(halfArrLength)-1])/ 2);\n } else {\n console.log(sorted_array[(halfArrLength) - 0.5]);\n }\n}", "title": "" }, { "docid": "7786cf54184722185c897ee61b5a3945", "score": "0.5369425", "text": "function findElement(sorterdArr, element) {\n\n let startIndex = 0\n let endIndex = sorterdArr.length - 1\n\n while(startIndex <= endIndex) {\n const middleIndex = startIndex + Math.floor((endIndex - startIndex)/2 )\n\n if (sorterdArr[middleIndex] === element) {\n return middleIndex\n }\n\n if (sorterdArr[middleIndex] < element) {\n startIndex = middleIndex + 1\n } else {\n endIndex = middleIndex - 1\n }\n \n }\n\n}", "title": "" }, { "docid": "05a7f2c4a7a1237828bfc684188a00b5", "score": "0.53678244", "text": "function printReturn(arr){\n let firstOdd = 0\n let secondToLast = arr[arr.length-2]\n\n console.log(secondToLast)\n\n for (i=0; i<arr.length;i++){\n if (arr[i]%2!=0){\n firstOdd = arr[i]\n break\n }\n }\n return firstOdd\n}", "title": "" }, { "docid": "60eae241395d8b0708f135dbcbde91aa", "score": "0.5352513", "text": "function middleOfList(ll) {\n const middle = Math.ceil(size(ll) / 2);\n console.log(middle);\n let counter = 0;\n let currNode = ll.head;\n let prevNode = ll.head;\n while (counter < middle) {\n if (currNode.next === null) {\n return new Error('Linked list not long enough');\n } else {\n prevNode = currNode;\n currNode = currNode.next;\n }\n counter++;\n }\n return prevNode;\n}", "title": "" }, { "docid": "6d054d7b2f0966f8d36cba400a47fc2f", "score": "0.53468484", "text": "function printOneReturnAnother(arr) {\n for(var j = 0; j < arr.length; j++) {\n if(arr[j] % 2 !== 0) {\n var first_odd = arr[j];\n }\n }\n console.log(`This is the second to last number in the array: ${arr[arr.length -2]}`);\n return first_odd;\n}", "title": "" }, { "docid": "2f8ef00f53dde47bff6bc68ed05c8c40", "score": "0.5335316", "text": "function middleOfList(ll) {\r\n const middle = Math.ceil(size(ll) / 2);\r\n console.log(middle);\r\n let counter = 0;\r\n let currNode = ll.head;\r\n let prevNode = ll.head;\r\n while (counter < middle) {\r\n if (currNode.next === null) {\r\n return new Error('Linked list not long enough');\r\n } else {\r\n prevNode = currNode;\r\n currNode = currNode.next;\r\n }\r\n counter++;\r\n }\r\n return prevNode;\r\n}", "title": "" }, { "docid": "cf8e9a9c36f16dc1b19fa6e38d1589fd", "score": "0.530293", "text": "function median(arr) {\n const mid = Math.floor(arr.length / 2)\n const nums = sortArr(arr)\n return arr.length % 2 !== 0 ? nums[mid] : (nums[mid - 1] + nums[mid]) / 2\n}", "title": "" }, { "docid": "3c41b2812e0fd87af2941f7d78e87b62", "score": "0.53007483", "text": "function getFirstElement(arr) {\n return arr.shift();\n}", "title": "" }, { "docid": "3f9a078d433cd6b2e55772c7ccba1c34", "score": "0.5290984", "text": "function median(arr) {\n arr.sort(function(a,b) { return a-b});\n if (arr.length % 2 === 0) {\n let lowerMedian = ((arr.length/2)-1);\n let upperMedian = (arr.length/2);\n let bothMediansAverage = (lowerMedian + upperMedian)/2;\n return arr[Math.floor(bothMediansAverage)];\n } else {\n if (arr.length % 2 !== 0) {\n return arr[Math.floor(arr.length/2)];\n }\n }\n}", "title": "" }, { "docid": "b49de9ccab04fcc2a779b0248a8c122f", "score": "0.52853084", "text": "get middle () {\n let node = this.head && this.head.next;\n let middle = this.head;\n while (node != null) {\n node = node.next && node.next.next;\n if (node != null) {\n middle = middle.next;\n }\n }\n\n return middle;\n }", "title": "" }, { "docid": "1dbb1522e64aaa3e4e9cdf9317bb0f48", "score": "0.52827436", "text": "function search(array, val) {\n\n //beginning of array\n let min = 0;\n //end of array\n let max = array.length - 1;\n\n //pick a middle point and check if the value you are looking for is greater than or less than that value\n while (min <= max) {\n //find the middle of the array using Math.floor to return as integer\n let middle = Math.floor((min + max) / 2)\n\n //middle index of current array\n let currentElement = array[middle]\n\n //look at subarray and pick the middle point again and check if the value you need is greater than or less than the middle point\n if (array[middle] < val) {\n min = middle + 1\n }\n else if (array[middle] > val) {\n max = middle - 1\n }\n else {\n return middle\n }\n }\n return -1;\n\n}", "title": "" }, { "docid": "8a7613b03c539704675af21bfbf2045a", "score": "0.5260689", "text": "function findMiddle(str) {\n if (str) {\n let numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];\n let digits = [];\n for (let i = 0; i < str.length; ++i) {\n let character = str[i];\n if (numbers.includes(parseInt(character))) {\n digits.push(character);\n }\n }\n let middleNumber = \"\";\n let product = digits.reduce((a, b) => a * b, 1).toString();\n if (!digits.length) {\n return -1;\n } else if (product.length % 2 === 1) {\n middleNumber = product[(product.length - 1) / 2];\n } else {\n middleNumber =\n product[product.length / 2 - 1] + product[product.length / 2];\n }\n return parseInt(middleNumber);\n } else {\n return -1;\n }\n}", "title": "" }, { "docid": "ed6c2e59be0fce459ef6eea78fb528f0", "score": "0.5242601", "text": "function median(array){\n var sortedArray = array.sort(function(a,b) { //numbers is not a defined variable, should be array\n return a - b; //a return here exits the function and doesn't give us what we want\n })\n if (array.length%2 != 0){\n return sortedArray[Math.floor(array.length/2)]\n }\n else {\n return mean([sortedArray[Math.floor(array.length/2)-1],sortedArray[Math.floor(array.length/2)]]);\n }\n}", "title": "" }, { "docid": "2127b27a40e8919e274b037c68481590", "score": "0.52381337", "text": "function pora(arr){\n console.log(`The second to last element is ${arr[arr.length - 2]}`)\n\n for(let i = 0; i < arr.length; i++){\n if (arr[i] % 2) { return arr[i] }\n }\n\n return \"No odd numbers in the array\"\n}", "title": "" }, { "docid": "58f4b507d739a796f155cd0c5644b416", "score": "0.5237525", "text": "function findOdd(A) {\n //turn the Array into a string\n //search the string and create subarrays using match\n //starting with the first element and moving forward\n var string = A.slice().join('');\n for (var current = 0; current < A.length; current++) {\n var currentString = A[current].toString();\n var oddOne = string.match(/currentString/g).length;\n if (oddOne % 2 === 1) return oddOne;\n }\n return oddOne;\n}", "title": "" }, { "docid": "8d76c7795602c6992e34d993eda12003", "score": "0.5235466", "text": "function getMiddle(str) {\n return str.substr(\n Math.ceil(str.length / 2 - 1),\n str.length % 2 === 0 ? 2 : 1\n );\n}", "title": "" }, { "docid": "dd5ce8b6cd6b4aabbc1cc7aee1b9eb9c", "score": "0.52244", "text": "function firstElementOf(arr) {\n return arr[0];\n}", "title": "" }, { "docid": "832c226064a980e4cddb1f2938f0acd3", "score": "0.5222177", "text": "function firstelemnt(array)\n{\n\tif(array.length == 0)\n\t{\n\t\tthrow new Error(\"first elemnt called with []\");\n\t}\n\treturn array[0];\n}", "title": "" }, { "docid": "28f887088e7cfe81cdaa33c41070564d", "score": "0.52191263", "text": "function head(array) {\n var firstElement = array[0];\n return firstElement;\n}", "title": "" }, { "docid": "748b53f60650809d4fc58e432af9ce5c", "score": "0.5218734", "text": "function binarySearch(arr, elem) {\n var start = 0;\n var end = arr.length - 1;\n var middle = Math.floor((start + end) / 2);\n while(arr[middle] !== elem && start <= end) {\n if(elem < arr[middle]){\n end = middle - 1;\n } else {\n start = middle + 1;\n }\n middle = Math.floor((start + end) / 2);\n }\n if(arr[middle] === elem){\n return middle;\n }\n return -1;\n}", "title": "" }, { "docid": "1fbe908e950e9126f47ab883a1dfa24b", "score": "0.5211611", "text": "function callback(elem) {\n if (elem % 2 == 0) return elem;\n else return false;\n}", "title": "" }, { "docid": "65914e5438d439e7f50141ff8c0ca8a1", "score": "0.52085423", "text": "function returnFirstHalf(str) {\r\n let middleOfString = findMiddleIndex(str);\r\n let firstHalfOfString = str.slice(0, middleOfString);\r\n return firstHalfOfString; \r\n}", "title": "" }, { "docid": "c44977ac261e328daaebd25e30a17527", "score": "0.52081144", "text": "function secondToLast(arr){\n if (arr.length > 2){\n return arr[arr.length - 2];\n }\n else {\n return null;\n }\n}", "title": "" }, { "docid": "f27eca3e36d06c55c016d4f872eba23a", "score": "0.52016896", "text": "function findMedian(someArr) {\n var result = 0;\n for (var i = 0; i < someArr.length; i++) {\n if (someArr.length % 2 !== 0) {\n result = someArr[(someArr.length/2) - 0.5];\n }\n else {\n result = (someArr[someArr.length/2 - 1] + someArr[(someArr.length/2)]) / 2;\n }\n }\n return result;\n}", "title": "" } ]
0abf333cc5e15debdb7fefb6c76c707e
The full scope of a namespace is the "absolute path" of scopes from parent to child. This is extracted from the namespace, filter only for scopes in the namespace.
[ { "docid": "01c2279d6daa0fd2ca9c29c6f606d450", "score": "0.7852608", "text": "function getFullScope(namespace) {\n return namespace\n .filter(function (c) { return c.indexOf(SCOPE_PREFIX) > -1; })\n .map(function (c) { return c.replace(SCOPE_PREFIX, ''); })\n .join('-');\n}", "title": "" } ]
[ { "docid": "88807244f440847072e89512629a09ef", "score": "0.77207565", "text": "function getFullScope(namespace) {\n return namespace\n .filter(function (c) { return c.indexOf(exports.SCOPE_PREFIX) > -1; })\n .map(function (c) { return c.replace(exports.SCOPE_PREFIX, ''); })\n .join('-');\n}", "title": "" }, { "docid": "88807244f440847072e89512629a09ef", "score": "0.77207565", "text": "function getFullScope(namespace) {\n return namespace\n .filter(function (c) { return c.indexOf(exports.SCOPE_PREFIX) > -1; })\n .map(function (c) { return c.replace(exports.SCOPE_PREFIX, ''); })\n .join('-');\n}", "title": "" }, { "docid": "6defd1dac55408e9482b3688edba96d1", "score": "0.6218863", "text": "function lookupEntry(namespace) {\n var scope = root\n , success =\n namespace.split(\".\")\n .every(function everyPart(part) {\n var entry = scope.children[part];\n if (!entry) {\n return false;\n }\n scope = entry;\n return true;\n })\n ;\n\n if (success) {\n return scope;\n }\n }", "title": "" }, { "docid": "9eaba7b194d49c6300a3ae65256f1903", "score": "0.58317745", "text": "getScope() {\n return Object.create(this.scope);\n }", "title": "" }, { "docid": "4bd3d97a9ffe2e39d2a786e01ad986a5", "score": "0.5712212", "text": "function rootPathTo(construct, ancestor) {\n const scopes = constructs_1.Node.of(construct).scopes;\n for (let i = scopes.length - 2; i >= 0; i--) {\n if (scopes[i] === ancestor) {\n return scopes.slice(i + 1);\n }\n }\n return scopes;\n}", "title": "" }, { "docid": "5b365bb764f2c750238bdf60aaa7e17b", "score": "0.55661964", "text": "get scopes() {\n const ret = new Array();\n let curr = this.host;\n while (curr) {\n ret.unshift(curr);\n curr = Node.of(curr).scope;\n }\n return ret;\n }", "title": "" }, { "docid": "950cb36540ff26400099e78f9d6a6588", "score": "0.5454528", "text": "scopeName(prefix) {\n\t return this._extScope.name(prefix);\n\t }", "title": "" }, { "docid": "a4170a0b1e642314781d6b8bbf36000c", "score": "0.5445371", "text": "function getScopeResource(scope) {\n return scope.replace(/\\/.default$/, \"\");\n}", "title": "" }, { "docid": "d5ec1246f84db282a34bf187589d7b51", "score": "0.54028434", "text": "visitQualifiednamespacespecifier(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "eeb9bcb7f8a8dea972eb18e76d085c6c", "score": "0.5400275", "text": "function Scope(path, parent) {\n _classCallCheck(this, Scope);\n\n if (parent && parent.block === path.node) {\n return parent;\n }\n\n var cached = path.getData(\"scope\");\n if (cached && cached.parent === parent && cached.block === path.node) {\n return cached;\n } else {\n path.setData(\"scope\", this);\n }\n\n this.parent = parent;\n this.hub = path.hub;\n\n this.parentBlock = path.parent;\n this.block = path.node;\n this.path = path;\n }", "title": "" }, { "docid": "f082f7ccf16a6eb93a7f0e268e709a38", "score": "0.5394861", "text": "function Scope(path, parent) {\n _classCallCheck(this, Scope);\n\n if (parent && parent.block === path.node) {\n return parent;\n }\n\n var cached = path.getData(\"scope\");\n if (cached && cached.parent === parent) {\n return cached;\n } else {\n path.setData(\"scope\", this);\n }\n\n this.parent = parent;\n this.hub = path.hub;\n\n this.parentBlock = path.parent;\n this.block = path.node;\n this.path = path;\n }", "title": "" }, { "docid": "cce6ebd3b216c317a2ef8fa9db8da794", "score": "0.5374428", "text": "function getEnclosingScope(node) {\n while (node.type !== 'FunctionDeclaration' && \n node.type !== 'FunctionExpression' && \n node.type !== 'CatchClause' &&\n node.type !== 'Program') {\n node = node.$parent;\n }\n return node;\n}", "title": "" }, { "docid": "7d94aa4d94a838e074cdadd028ebe5f5", "score": "0.53522575", "text": "scopeName(prefix) {\n return this._extScope.name(prefix);\n }", "title": "" }, { "docid": "69116d32e351f30c281b68090696451b", "score": "0.53354263", "text": "function Scope()\n\t{\n\t\tthis.parent = null;\n\t\tthis.local = {};\n\t}", "title": "" }, { "docid": "36d61b36c5b972225ea67660d119f500", "score": "0.53231925", "text": "function getScopes(ast) {\n var scopes = _getScopes(ast);\n scopes.lookup = function (node) {\n var scope;\n while (!scope && node) {\n scope = this.acquire(node, true);\n node = node.parent;\n };\n return scope;\n };\n return scopes;\n}", "title": "" }, { "docid": "dc2f385da8dac45af724800c9010f1d0", "score": "0.528279", "text": "getScope() {\n return null;\n }", "title": "" }, { "docid": "b48a59c1c5ede053f425125388da53e1", "score": "0.52764475", "text": "function Scope(parent) {\n this.names = {}; // names defined in this scope\n this.mangled = {}; // mangled names (orig.name => mangled)\n this.rev_mangled = {}; // reverse lookup (mangled => orig.name)\n this.cname = -1; // current mangled name\n this.refs = {}; // names referenced from this scope\n this.uses_with = false; // will become TRUE if with() is detected in this or any subscopes\n this.uses_eval = false; // will become TRUE if eval() is detected in this or any subscopes\n this.directives = []; // directives activated from this scope\n this.parent = parent; // parent scope\n this.children = []; // sub-scopes\n if (parent) {\n this.level = parent.level + 1;\n parent.children.push(this);\n } else {\n this.level = 0;\n }\n}", "title": "" }, { "docid": "2c7283f849b7db4b663ad31ca9400d17", "score": "0.527635", "text": "function Scope(parent) {\n this.names = {}; // names defined in this scope\n this.mangled = {}; // mangled names (orig.name => mangled)\n this.rev_mangled = {}; // reverse lookup (mangled => orig.name)\n this.cname = -1; // current mangled name\n this.refs = {}; // names referenced from this scope\n this.uses_with = false; // will become TRUE if with() is detected in this or any subscopes\n this.uses_eval = false; // will become TRUE if eval() is detected in this or any subscopes\n this.parent = parent; // parent scope\n this.children = []; // sub-scopes\n if (parent) {\n this.level = parent.level + 1;\n parent.children.push(this);\n } else {\n this.level = 0;\n }\n}", "title": "" }, { "docid": "2c7283f849b7db4b663ad31ca9400d17", "score": "0.527635", "text": "function Scope(parent) {\n this.names = {}; // names defined in this scope\n this.mangled = {}; // mangled names (orig.name => mangled)\n this.rev_mangled = {}; // reverse lookup (mangled => orig.name)\n this.cname = -1; // current mangled name\n this.refs = {}; // names referenced from this scope\n this.uses_with = false; // will become TRUE if with() is detected in this or any subscopes\n this.uses_eval = false; // will become TRUE if eval() is detected in this or any subscopes\n this.parent = parent; // parent scope\n this.children = []; // sub-scopes\n if (parent) {\n this.level = parent.level + 1;\n parent.children.push(this);\n } else {\n this.level = 0;\n }\n}", "title": "" }, { "docid": "4df6368b04fb5c60433aa263da441bc7", "score": "0.5272864", "text": "function currentNameScopePrefix() {\n if (_nameScopeStack.length === 0) {\n return '';\n } else {\n return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider;\n }\n}", "title": "" }, { "docid": "ef52cf0f2d81ca31d45afccc04ea6adf", "score": "0.5264391", "text": "get namespaceName() {\n var _a;\n return (_a = this.findAncestor(reflection_1.isNamespaceStatement)) === null || _a === void 0 ? void 0 : _a.nameExpression;\n }", "title": "" }, { "docid": "ef52cf0f2d81ca31d45afccc04ea6adf", "score": "0.5264391", "text": "get namespaceName() {\n var _a;\n return (_a = this.findAncestor(reflection_1.isNamespaceStatement)) === null || _a === void 0 ? void 0 : _a.nameExpression;\n }", "title": "" }, { "docid": "ef52cf0f2d81ca31d45afccc04ea6adf", "score": "0.5264391", "text": "get namespaceName() {\n var _a;\n return (_a = this.findAncestor(reflection_1.isNamespaceStatement)) === null || _a === void 0 ? void 0 : _a.nameExpression;\n }", "title": "" }, { "docid": "ef52cf0f2d81ca31d45afccc04ea6adf", "score": "0.5264391", "text": "get namespaceName() {\n var _a;\n return (_a = this.findAncestor(reflection_1.isNamespaceStatement)) === null || _a === void 0 ? void 0 : _a.nameExpression;\n }", "title": "" }, { "docid": "8c77cd9b4204e351a91d7769e74f3fa1", "score": "0.525932", "text": "function currentNameScopePrefix() {\n if (_nameScopeStack.length === 0) {\n return '';\n }\n else {\n return _nameScopeStack.join(_nameScopeDivider) + _nameScopeDivider;\n }\n}", "title": "" }, { "docid": "a5213d31285376394fdc756b49debb58", "score": "0.5155105", "text": "function getEnclosingBlockScopeContainer(node) {\n var current = node.parent;\n while (current) {\n if (isBlockScope(current, current.parent)) {\n return current;\n }\n current = current.parent;\n }\n }", "title": "" }, { "docid": "a5213d31285376394fdc756b49debb58", "score": "0.5155105", "text": "function getEnclosingBlockScopeContainer(node) {\n var current = node.parent;\n while (current) {\n if (isBlockScope(current, current.parent)) {\n return current;\n }\n current = current.parent;\n }\n }", "title": "" }, { "docid": "dc59f00130195e8609e85231160ef162", "score": "0.51505095", "text": "function getEnclosingBlockScopeContainer(node) {\n var current = node.parent;\n while (current) {\n if (isBlockScope(current, current.parent)) {\n return current;\n }\n current = current.parent;\n }\n }", "title": "" }, { "docid": "20ca1aac8d2338d1138dda9aa398116f", "score": "0.5140507", "text": "async function getScopes() {\n const lernaPackages = (await new Project().getPackages())\n .map(package => package.name)\n .map((name) => (name.charAt(0) === '@' ? name.split('/')[1] : name));\n const customScopes = CUSTOM_SCOPES;\n const pocs = fs.readdirSync(POC_FOLDER_PATH, { withFileTypes: true })\n .filter(file => file.isDirectory()).map(directory => directory.name);\n\n return [].concat(lernaPackages, customScopes, pocs);\n}", "title": "" }, { "docid": "e6f5ab8f121dafdff3ddaf64b2fb4e0f", "score": "0.51162374", "text": "function collectEnclosingScopes(range) {\n var current = isReadonlyArray(range.range) ? ts.first(range.range) : range.range;\n if (range.facts & RangeFacts.UsesThis) {\n // if range uses this as keyword or as type inside the class then it can only be extracted to a method of the containing class\n var containingClass = ts.getContainingClass(current);\n if (containingClass) {\n var containingFunction = ts.findAncestor(current, ts.isFunctionLikeDeclaration);\n return containingFunction ? [containingFunction, containingClass] : [containingClass];\n }\n }\n var scopes = [];\n while (true) {\n current = current.parent;\n // A function parameter's initializer is actually in the outer scope, not the function declaration\n if (current.kind === 147 /* Parameter */) {\n // Skip all the way to the outer scope of the function that declared this parameter\n current = ts.findAncestor(current, function (parent) {\n return ts.isFunctionLikeDeclaration(parent);\n }).parent;\n }\n // We want to find the nearest parent where we can place an \"equivalent\" sibling to the node we're extracting out of.\n // Walk up to the closest parent of a place where we can logically put a sibling:\n // * Function declaration\n // * Class declaration or expression\n // * Module/namespace or source file\n if (isScope(current)) {\n scopes.push(current);\n if (current.kind === 269 /* SourceFile */) {\n return scopes;\n }\n }\n }\n }", "title": "" }, { "docid": "6062b61503e0d14e46383087b15e54cc", "score": "0.50851893", "text": "function collectEnclosingScopes(range) {\n var current = isReadonlyArray(range.range) ? ts.first(range.range) : range.range;\n if (range.facts & RangeFacts.UsesThis) {\n // if range uses this as keyword or as type inside the class then it can only be extracted to a method of the containing class\n var containingClass = ts.getContainingClass(current);\n if (containingClass) {\n var containingFunction = ts.findAncestor(current, ts.isFunctionLikeDeclaration);\n return containingFunction\n ? [containingFunction, containingClass]\n : [containingClass];\n }\n }\n var scopes = [];\n while (true) {\n current = current.parent;\n // A function parameter's initializer is actually in the outer scope, not the function declaration\n if (current.kind === 147 /* Parameter */) {\n // Skip all the way to the outer scope of the function that declared this parameter\n current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent;\n }\n // We want to find the nearest parent where we can place an \"equivalent\" sibling to the node we're extracting out of.\n // Walk up to the closest parent of a place where we can logically put a sibling:\n // * Function declaration\n // * Class declaration or expression\n // * Module/namespace or source file\n if (isScope(current)) {\n scopes.push(current);\n if (current.kind === 269 /* SourceFile */) {\n return scopes;\n }\n }\n }\n }", "title": "" }, { "docid": "76d0b9d45a618a48264547cb7add74e6", "score": "0.5081836", "text": "function scopesByScope(scope) {\n var q = [ scope || $rootScope ];\n var scopes = [];\n var curScope = null;\n while (q.length > 0) {\n curScope = q.pop();\n if (curScope) {\n scopes.push(curScope);\n }\n if (curScope.$$childHead) {\n q.push(curScope.$$childHead);\n }\n if (curScope.$$nextSibling) {\n q.push(curScope.$$nextSibling);\n }\n }\n return scopes;\n }", "title": "" }, { "docid": "e7c24e38f229537ea9bdf5eeff75067c", "score": "0.5025331", "text": "function Scope(node,parent){\n\tthis._nr = STACK.incr('scopes');\n\tthis._head = [];\n\tthis._node = node;\n\tthis._parent = parent;\n\tthis._vars = new VariableDeclaration([]);\n\tthis._meta = {};\n\tthis._annotations = [];\n\tthis._closure = this;\n\tthis._virtual = false;\n\tthis._counter = 0;\n\tthis._varmap = {};\n\tthis._varpool = [];\n}", "title": "" }, { "docid": "a9d99fcf1b383b7c93dec7e453293b69", "score": "0.49993598", "text": "get path() {\n const components = this.scopes.slice(1).map(c => Node.of(c).id);\n return components.join(Node.PATH_SEP);\n }", "title": "" }, { "docid": "fd82c6748bc846f482b766eb8a22ffdf", "score": "0.4979971", "text": "function inScope(path, scope) {\n for(let i = 0; i < scope.length; i++){\n if (path.includes(scope[i])) {\n return true;\n };\n }\n return false;\n }", "title": "" }, { "docid": "662a02ad7ddcdbf2f6a88aa2f57105ea", "score": "0.49657947", "text": "function getNamespace(uri) {\n if (fn.contains(uri, \"#\")) \n return fn.concat(functx.substringBeforeLast(uri, \"#\"), \"#\");\n else\n return fn.concat(functx.substringBeforeLast(uri, \"/\"), \"/\");\n}", "title": "" }, { "docid": "d00dc0861325e64a1b9cf33752c7a50e", "score": "0.49631736", "text": "function scopedNodes(ast,matching,flat) {\n var matches = [] ;\n parser.treeWalker(ast,function(node, descend, path){\n if (node === ast)\n return descend() ;\n\n if (matching(node,path)) {\n matches.push([].concat(path)) ;\n return ;\n }\n if (flat || examine(node).isScope) {\n return ;\n }\n descend() ;\n }) ;\n return matches ;\n }", "title": "" }, { "docid": "56a2cab8b74523af21559aa59f9c3847", "score": "0.4959505", "text": "function determineScope (req, res, next) {\n var params = req.connectParams;\n\n Scope.get(params.scope.split(' '), function (err, scopes) {\n if (err) { return next(err); }\n\n // remove null results\n var knownScope = scopes.reduce(function (list, scope) {\n if (scope instanceof Scope) {\n list.push(scope);\n }\n return list;\n }, []);\n\n // get authorized scope for user\n req.user.authorizedScope(function (err, authorizedScope) {\n if (err) { return callback(err); }\n\n // filter unauthorized scope\n req.scopes = knownScope.filter(function (scope) {\n return authorizedScope.indexOf(scope.name) !== -1;\n });\n\n // extract scope names\n req.scope = req.scopes.map(function (scope) {\n return scope.name;\n }).join(' ');\n\n next();\n });\n });\n}", "title": "" }, { "docid": "51a55ed5c8bc33295b5692a7282cedaf", "score": "0.49575442", "text": "function _myscope ($scope){ return $scope; }", "title": "" }, { "docid": "b6ffa6c970f291239da1f51a94faa655", "score": "0.49416536", "text": "function Scope() {\n}", "title": "" }, { "docid": "cc4b643804b6f68af2239a1e80b5b63e", "score": "0.49089363", "text": "get root() {\n return this.scopes[0];\n }", "title": "" }, { "docid": "8fff48d3e486ef88e69e2d32f0a043bd", "score": "0.49070665", "text": "function getScope() {\n if (typeof Scope !== 'undefined') {\n return Scope;\n }\n Scope = null;\n if (typeof window !== 'undefined') {\n Scope = window;\n } else if (typeof global !== 'undefined') {\n Scope = global;\n }\n // console.log('scope', scope);\n return Scope;\n}", "title": "" }, { "docid": "2654e59f02037598124e1737ac496373", "score": "0.47935012", "text": "function scopeTest(){\n\tvar scopeStr = 'can you access?';\n\tconsole.log(scopeStr);\n}", "title": "" }, { "docid": "7fd64643470c85aa9319e4bf93a47668", "score": "0.47622356", "text": "function scopeHandler(astArray, node) {\n const parent = astArray[node.parent];\n if (parent) {\n // find functionScope\n node.functionScope = functionScopeNodes.includes(parent.type)\n ? node.index\n : parent.functionScope;\n\n // blockScope must be at least as specific as functionScope (it cannot be a lower number)\n node.blockScope = Math.max(\n blockScopeNodes.includes(parent.type) ? parent.index : parent.blockScope,\n node.functionScope\n );\n } else {\n node.functionScope = node.index;\n node.blockScope = node.index;\n }\n}", "title": "" }, { "docid": "4a867a716fdc16996bb710ac8f60d988", "score": "0.47516197", "text": "scope(name, path) {\n return new Scope(name, path, this);\n }", "title": "" }, { "docid": "45699f6a76ed9ec104d93edb9a015d11", "score": "0.4751164", "text": "function _getScopeForIdentifier(scope, index, id) {\n var result,\n queue = [scope],\n current,\n node;\n \n while (queue.length) {\n current = queue.shift();\n node = current.node;\n \n if (node.range && node.range[0] <= index && index < node.range[1]) {\n queue = [].concat(current.children);\n \n if (current.declarations && current.declarations[id.name]) {\n // found a matching variable name declaration\n result = current;\n }\n }\n }\n \n return result;\n }", "title": "" }, { "docid": "da8800e8145944738eadf5acbe2384a9", "score": "0.4741762", "text": "normalizeScope() {\n let scope;\n // Set to empty string if the scope if not set\n if (typeof this._userConfig.oauth.scope === 'undefined') {\n scope = '';\n }\n // convert an array into a string\n else if (util.isArray(this._userConfig.oauth.scope)) {\n scope = this._userConfig.oauth.scope.join(',');\n }\n return scope;\n }", "title": "" }, { "docid": "470596b6c266d37d85d40f3a2d2b36a2", "score": "0.47076756", "text": "newScope() {\n let s = this.scope;\n this.scope = new Scope(this);\n this.scope.def = {}; // clear definitions.\n this.scope.parent = s;\n \n return this.scope;\n }", "title": "" }, { "docid": "34b21a11d56e13c392a16f8d8dcb9a78", "score": "0.47034615", "text": "function getChromeScopes(state) {\n const frame = getSelectedFrame(state);\n return frame ? frame.scopeChain : undefined;\n}", "title": "" }, { "docid": "8d444b5ef6449ad0e7df7a619923c7b0", "score": "0.47031552", "text": "function getNamespace(subtree, path) {\n if (path.length === 1) return subtree\n\n const namespace = path.shift()\n subtree[namespace] = {\n ...subtree[namespace],\n }\n return getNamespace(subtree[namespace], path)\n}", "title": "" }, { "docid": "407c9bc8d2d896b0aec38c04f22d4fcd", "score": "0.4702446", "text": "scopeSubtree(container, shouldObserve) { // eslint-disable-line no-unused-vars\n }", "title": "" }, { "docid": "7044f923f61f9469ca4f7c09ac5f804f", "score": "0.46778193", "text": "function getNodeScope (node, scopeList) {\n scopeList = scopeList ? scopeList : [];\n\n if (node && node.parent) {\n scopeList = scopeList.concat(node.parent.myChildren);\n getNodeScope(node.parent, scopeList);\n }\n \n return scopeList;\n }", "title": "" }, { "docid": "1176e9885e41094a301717b1ea0c973d", "score": "0.46520776", "text": "scopeName(index = -1) {\n if (index < 0)\n return this.scopes[this.scopes.length + index];\n else\n return this.scopes[index];\n }", "title": "" }, { "docid": "65217adc01ce4193b32732fc2122dee6", "score": "0.4640657", "text": "getChildScope(template) {\n const res = this.childScopes.get(template);\n if (res === undefined) {\n throw new Error(`Assertion error: child scope for ${template} not found`);\n }\n return res;\n }", "title": "" }, { "docid": "65217adc01ce4193b32732fc2122dee6", "score": "0.4640657", "text": "getChildScope(template) {\n const res = this.childScopes.get(template);\n if (res === undefined) {\n throw new Error(`Assertion error: child scope for ${template} not found`);\n }\n return res;\n }", "title": "" }, { "docid": "21e9149064ee519db97b3dbfe56c0558", "score": "0.46386516", "text": "function mapScopesToResource(scopes) {\n let scope = \"\";\n if (Array.isArray(scopes)) {\n if (scopes.length !== 1) {\n return;\n }\n scope = scopes[0];\n }\n else if (typeof scopes === \"string\") {\n scope = scopes;\n }\n if (!scope.endsWith(DefaultScopeSuffix)) {\n return scope;\n }\n return scope.substr(0, scope.lastIndexOf(DefaultScopeSuffix));\n}", "title": "" }, { "docid": "7841afad3b5cd0b90b9cce6e5cf93c7e", "score": "0.4635448", "text": "function getRootScopeSelector (editor) {\n return `.${editor.getGrammar().scopeName}`\n}", "title": "" }, { "docid": "c568816eb47ae2c16227d019d78491ab", "score": "0.46091953", "text": "namespace(namespace) {\n this.iocResolver.namespace(namespace);\n return this;\n }", "title": "" }, { "docid": "5060eae8b2bdd19fb1f5466690571802", "score": "0.46046975", "text": "function $rootScope() {\n\treturn $app().mergeEngine.topScope; \n}", "title": "" }, { "docid": "82e5f7fbe3275852f63c2aea4024d43a", "score": "0.45962864", "text": "async getNamespace(request) {\n return doFetch(request,\"NamespaceService\",\"GetNamespace\")\n\t}", "title": "" }, { "docid": "20a78a7eaf97d8d00510411a92141d8b", "score": "0.45903355", "text": "function scopedNodes(ast, matching, flat) {\n var matches = [];\n parser.treeWalker(ast, function (node, descend, path) {\n if (node === ast)\n return descend();\n if (matching(node, path)) {\n matches.push([].concat(path));\n return;\n }\n if (flat || examine(node).isScope) {\n return;\n }\n descend();\n });\n return matches;\n }", "title": "" }, { "docid": "490e7c46c02331a9cd9cbfac3dadc695", "score": "0.45884663", "text": "__init4() {this.scopes = []}", "title": "" }, { "docid": "ac597221eb9fc90fe2850e0447098ae6", "score": "0.45823348", "text": "name(prefix) {\n\t return this._scope.name(prefix);\n\t }", "title": "" }, { "docid": "3297be84f78eae33e9f95ddaa5adbc8b", "score": "0.45744616", "text": "function getNodesWithIdInScope(astNode, id) {\n id = id.name || id; \n var scope = getIdScope(astNode, id); \n if(scope === undefined) { // undefined is global\n scope = getRoot(astNode); \n }\n return _.filter( getAllDescendants(scope), function(node) {\n return node.type == 'Identifier' && node.name == id; \n });\n}", "title": "" }, { "docid": "e65248bae16f899c1116b64ed6820327", "score": "0.45743766", "text": "function Scope(parnt) {\n this.parnt = parnt;\n this._ = {};\n \n this.add = function(sym) {\n this._[sym.iden] = sym;\n };\n\n this.find = function(sym) {\n return this._[sym];\n };\n\n this.search = function(sym) {\n var found = this._[sym];\n if(found) return found;\n if(this.parnt) return this.parnt.search(sym);\n return false;\n };\n }", "title": "" }, { "docid": "1d45a7d2eb7570dec36c8cf7abc2a432", "score": "0.45725766", "text": "function getSymbolScope(symbol) {\n // If this is the symbol of a named function expression or named class expression,\n // then named references are limited to its own scope.\n var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration;\n if (valueDeclaration && (valueDeclaration.kind === 187 /* FunctionExpression */ || valueDeclaration.kind === 200 /* ClassExpression */)) {\n return valueDeclaration;\n }\n if (!declarations) {\n return undefined;\n }\n // If this is private property or method, the scope is the containing class\n if (flags & (4 /* Property */ | 8192 /* Method */)) {\n var privateDeclaration = ts.find(declarations, function (d) { return ts.hasModifier(d, 8 /* Private */); });\n if (privateDeclaration) {\n return ts.getAncestor(privateDeclaration, 230 /* ClassDeclaration */);\n }\n // Else this is a public property and could be accessed from anywhere.\n return undefined;\n }\n // If symbol is of object binding pattern element without property name we would want to\n // look for property too and that could be anywhere\n if (getObjectBindingElementWithoutPropertyName(symbol)) {\n return undefined;\n }\n /*\n If the symbol has a parent, it's globally visible unless:\n - It's a private property (handled above).\n - It's a type parameter.\n - The parent is an external module: then we should only search in the module (and recurse on the export later).\n - But if the parent has `export as namespace`, the symbol is globally visible through that namespace.\n */\n var exposedByParent = parent && !(symbol.flags & 262144 /* TypeParameter */);\n if (exposedByParent && !((parent.flags & 1536 /* Module */) && ts.isExternalModuleSymbol(parent) && !parent.globalExports)) {\n return undefined;\n }\n var scope;\n for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) {\n var declaration = declarations_9[_i];\n var container = ts.getContainerNode(declaration);\n if (scope && scope !== container) {\n // Different declarations have different containers, bail out\n return undefined;\n }\n if (!container || container.kind === 269 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) {\n // This is a global variable and not an external module, any declaration defined\n // within this scope is visible outside the file\n return undefined;\n }\n // The search scope is the container node\n scope = container;\n }\n // If symbol.parent, this means we are in an export of an external module. (Otherwise we would have returned `undefined` above.)\n // For an export of a module, we may be in a declaration file, and it may be accessed elsewhere. E.g.:\n // declare module \"a\" { export type T = number; }\n // declare module \"b\" { import { T } from \"a\"; export const x: T; }\n // So we must search the whole source file. (Because we will mark the source file as seen, we we won't return to it when searching for imports.)\n return exposedByParent ? scope.getSourceFile() : scope;\n }", "title": "" }, { "docid": "1b3b3efbcc7990cae9e75561122a8025", "score": "0.4564918", "text": "function subtract_scope() {\n subtract_att(SCOPE_ID, SCOPE_LABEL, DEFAULT_DISTANCE_VALUES[3]);\n}", "title": "" }, { "docid": "e80ffad35917f9eb92ff514858376910", "score": "0.45570186", "text": "function setScope(scope){ _scope = scope || 'all' }", "title": "" }, { "docid": "e80ffad35917f9eb92ff514858376910", "score": "0.45570186", "text": "function setScope(scope){ _scope = scope || 'all' }", "title": "" }, { "docid": "e80ffad35917f9eb92ff514858376910", "score": "0.45570186", "text": "function setScope(scope){ _scope = scope || 'all' }", "title": "" }, { "docid": "e80ffad35917f9eb92ff514858376910", "score": "0.45570186", "text": "function setScope(scope){ _scope = scope || 'all' }", "title": "" }, { "docid": "e80ffad35917f9eb92ff514858376910", "score": "0.45570186", "text": "function setScope(scope){ _scope = scope || 'all' }", "title": "" }, { "docid": "e80ffad35917f9eb92ff514858376910", "score": "0.45570186", "text": "function setScope(scope){ _scope = scope || 'all' }", "title": "" }, { "docid": "e80ffad35917f9eb92ff514858376910", "score": "0.45570186", "text": "function setScope(scope){ _scope = scope || 'all' }", "title": "" }, { "docid": "e80ffad35917f9eb92ff514858376910", "score": "0.45570186", "text": "function setScope(scope){ _scope = scope || 'all' }", "title": "" }, { "docid": "e80ffad35917f9eb92ff514858376910", "score": "0.45570186", "text": "function setScope(scope){ _scope = scope || 'all' }", "title": "" }, { "docid": "e80ffad35917f9eb92ff514858376910", "score": "0.45570186", "text": "function setScope(scope){ _scope = scope || 'all' }", "title": "" }, { "docid": "af0114c398b8ee41ddacbcc7b84dba1f", "score": "0.45535445", "text": "function isScope(node, parent) {\n if (t.isBlockStatement(node) && t.isFunction(parent, { body: node })) {\n return false;\n }\n\n return t.isScopable(node);\n}", "title": "" }, { "docid": "da0b4d727ffdd32f944f9eff57813d5f", "score": "0.45493525", "text": "function hasBindingInScope(identifierPath, limitScope) {\n const name = identifierPath.node.name;\n let scope = identifierPath.scope;\n while (scope) {\n if (scope.hasOwnBinding(name)) {\n return true;\n }\n // This check must come after the hasOwnBinding check because it is ok if\n // the binding occurs in the limitScope.\n if (scope === limitScope) {\n return false;\n }\n scope = scope.parent;\n }\n /* istanbul ignore next */\n throw new Error(\n \"identifier has no valid binding and limitScope is not an ancestor scope\"\n );\n }", "title": "" }, { "docid": "8cba4c3e1bd5c7b000e16586d0ede31a", "score": "0.45474184", "text": "function setScope() {\n if (this.opts && this.opts.noScope) return;\n\n var target = this.context || this.parentPath;\n this.scope = this.getScope(target && target.scope);\n if (this.scope) this.scope.init();\n}", "title": "" }, { "docid": "436d2842136c1f024c9042113828176e", "score": "0.45345318", "text": "function scopeA() {\n function scopeB() {\n console.log(scopeVariable);\n }\n scopeB();\n}", "title": "" }, { "docid": "725d869c837baad7c2542576ee448e43", "score": "0.45314726", "text": "scopeRefs(scopeName) {\n\t return this._extScope.scopeRefs(scopeName, this._values);\n\t }", "title": "" }, { "docid": "b535db605d71ea6bc363b522cabaae09", "score": "0.4528924", "text": "function getSymbolScope(symbol) {\n // If this is the symbol of a named function expression or named class expression,\n // then named references are limited to its own scope.\n var declarations = symbol.declarations,\n flags = symbol.flags,\n parent = symbol.parent,\n valueDeclaration = symbol.valueDeclaration;\n if (valueDeclaration && (valueDeclaration.kind === 187 /* FunctionExpression */ || valueDeclaration.kind === 200 /* ClassExpression */)) {\n return valueDeclaration;\n }\n if (!declarations) {\n return undefined;\n }\n // If this is private property or method, the scope is the containing class\n if (flags & (4 /* Property */ | 8192 /* Method */)) {\n var privateDeclaration = ts.find(declarations, function (d) {\n return ts.hasModifier(d, 8 /* Private */);\n });\n if (privateDeclaration) {\n return ts.getAncestor(privateDeclaration, 230 /* ClassDeclaration */);\n }\n // Else this is a public property and could be accessed from anywhere.\n return undefined;\n }\n // If symbol is of object binding pattern element without property name we would want to\n // look for property too and that could be anywhere\n if (getObjectBindingElementWithoutPropertyName(symbol)) {\n return undefined;\n }\n /*\n If the symbol has a parent, it's globally visible unless:\n - It's a private property (handled above).\n - It's a type parameter.\n - The parent is an external module: then we should only search in the module (and recurse on the export later).\n - But if the parent has `export as namespace`, the symbol is globally visible through that namespace.\n */\n var exposedByParent = parent && !(symbol.flags & 262144 /* TypeParameter */);\n if (exposedByParent && !(parent.flags & 1536 /* Module */ && ts.isExternalModuleSymbol(parent) && !parent.globalExports)) {\n return undefined;\n }\n var scope;\n for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) {\n var declaration = declarations_9[_i];\n var container = ts.getContainerNode(declaration);\n if (scope && scope !== container) {\n // Different declarations have different containers, bail out\n return undefined;\n }\n if (!container || container.kind === 269 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) {\n // This is a global variable and not an external module, any declaration defined\n // within this scope is visible outside the file\n return undefined;\n }\n // The search scope is the container node\n scope = container;\n }\n // If symbol.parent, this means we are in an export of an external module. (Otherwise we would have returned `undefined` above.)\n // For an export of a module, we may be in a declaration file, and it may be accessed elsewhere. E.g.:\n // declare module \"a\" { export type T = number; }\n // declare module \"b\" { import { T } from \"a\"; export const x: T; }\n // So we must search the whole source file. (Because we will mark the source file as seen, we we won't return to it when searching for imports.)\n return exposedByParent ? scope.getSourceFile() : scope;\n }", "title": "" }, { "docid": "d9b517452d8c63841eb03491afbfab9e", "score": "0.45258343", "text": "hasAnyScopes() {\n if (this.scopes && this.scopes.length > 0)\n return true;\n if (this.defaultScopes && this.defaultScopes.length > 0)\n return true;\n return false;\n }", "title": "" }, { "docid": "bce9cbdaa4a29d128641959242afd29a", "score": "0.45237783", "text": "function getUserScope() {\n let token = localStorage.getItem(\"token\");\n if (token) {\n let scope = getScope(token);\n return scope;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "9cb25ec4febca0f92103764cf7bf7aee", "score": "0.45233944", "text": "get namespace() {\n return this.extractNamespace(this.options);\n }", "title": "" }, { "docid": "03f40eb249667bbd7a91fe8e24029c74", "score": "0.45101637", "text": "function Scope(node, parent, scope, formatter) {\n if (!formatter.isLoose()) {\n this.skip();\n }\n}", "title": "" }, { "docid": "7e0de294959bd0c752b5d486dfa436da", "score": "0.4504971", "text": "function isScope(oObject) {\n return ($services.is.obj(oObject) && oObject.$root === $rootScope);\n }", "title": "" }, { "docid": "b19eb419557d36385083117d430d9304", "score": "0.44951805", "text": "function ireeNamePrefix() {\n return self.name ? (self.name + ':') : '(unnamed scope)';\n}", "title": "" }, { "docid": "cd8b37abf06df220b5b749066b3e7997", "score": "0.4493048", "text": "function shortname(from, to) {\n var fromPath = from.fullName.split(\".\"),\n toPath = to.fullName.split(\".\"),\n i = 0,\n j = 0,\n k = toPath.length - 1;\n if (!(from instanceof Root) && to instanceof Namespace)\n while (i < fromPath.length && j < k && fromPath[i] === toPath[j]) {\n var other = to.lookup(fromPath[i++], true);\n if (other !== null && other !== to)\n break;\n ++j;\n }\n else\n for (; i < fromPath.length && j < k && fromPath[i] === toPath[j]; ++i, ++j);\n return toPath.slice(j).join(\".\");\n}", "title": "" }, { "docid": "d6d53d17599ecdcc8645b4944df0724a", "score": "0.44929394", "text": "function getScopeNode(initialToken, position, sourceFile) {\n var scope = initialToken;\n while (scope && !ts.positionBelongsToNode(scope, position, sourceFile)) {\n scope = scope.parent;\n }\n return scope;\n }", "title": "" }, { "docid": "d6d53d17599ecdcc8645b4944df0724a", "score": "0.44929394", "text": "function getScopeNode(initialToken, position, sourceFile) {\n var scope = initialToken;\n while (scope && !ts.positionBelongsToNode(scope, position, sourceFile)) {\n scope = scope.parent;\n }\n return scope;\n }", "title": "" }, { "docid": "ceeab2ef1fd846e78b29a59b00b07559", "score": "0.44919622", "text": "function add_scope() {\n add_att(SCOPE_ID, SCOPE_LABEL, false);\n}", "title": "" }, { "docid": "1021a839cae57bccd7a6a63fd82faadc", "score": "0.44843048", "text": "function ns(t) {\n return on(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, \"F\" /* First */ , t.startAt, t.endAt);\n}", "title": "" }, { "docid": "11ae9a6c23718bd9ce39b0891ea81272", "score": "0.44823402", "text": "function checkscope2() {\n\tscope = \"local\"; // Oops! We just changed the global variable.\n\tmyscope = \"local\"; // This implicitly declares a new global variable.\n\treturn [scope, myscope]; // Return two values.\n}", "title": "" }, { "docid": "5ae04d89ea3c9158cdcc4571f2269f33", "score": "0.44714785", "text": "function f() {\n // x = 10;\n console.log(scope); // Prints \"undefined\", not \"global\"\n var scope = \"locale\"; // Variable initialized here, but defined everywhere\n console.log(scope); // Prints \"local\"\n}", "title": "" }, { "docid": "0bf58158f7ae11efac5194ee4f5b3e12", "score": "0.44633013", "text": "function getScope() {\n return $scope;\n }", "title": "" }, { "docid": "de1286bca3a6c5e296638e1513206c23", "score": "0.4461147", "text": "function collectIncludedScopes(result, grammar) {\n if (grammar.patterns && Array.isArray(grammar.patterns)) {\n _extractIncludedScopesInPatterns(result, grammar.patterns);\n }\n if (grammar.repository) {\n _extractIncludedScopesInRepository(result, grammar.repository);\n }\n // remove references to own scope (avoid recursion)\n delete result[grammar.scopeName];\n}", "title": "" }, { "docid": "55fa693f8c24683f25f87a04b00a3d75", "score": "0.44607177", "text": "visitNamespaceDefinition(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "af143b4945c37bf766a647e589e11f42", "score": "0.4458309", "text": "function shortname(from, to) {\r\n var fromPath = from.fullName.split(\".\"),\r\n toPath = to.fullName.split(\".\"),\r\n i = 0,\r\n j = 0,\r\n k = toPath.length - 1;\r\n if (!(from instanceof Root) && to instanceof Namespace)\r\n while (i < fromPath.length && j < k && fromPath[i] === toPath[j]) {\r\n var other = to.lookup(fromPath[i++], true);\r\n if (other !== null && other !== to)\r\n break;\r\n ++j;\r\n }\r\n else\r\n for (; i < fromPath.length && j < k && fromPath[i] === toPath[j]; ++i, ++j);\r\n return toPath.slice(j).join(\".\");\r\n}", "title": "" } ]
a567bebda47ebe74407d420a04b7c013
Metrics Middleware Called by app.use(rpsMeter); This adds the RPS metric, we are using this middleware so that every request is counted.
[ { "docid": "4a02fb59fe76a37f2acebfd1d3895bf4", "score": "0.49964413", "text": "function reqWrapper(req, res, next) {\n\n // Perform some work at the beginning of every request\n\n rps.mark();\n\n // Generate csrf Token\n// res.locals.token = req.csrfToken();\n res.locals.token = require('uuid').v4();\n\n logger.req = req;\n\n // To track response time\n req._rlStartTime = new Date();\n\n var stopwatch = timer.start();\n\n req.on('end', function() {\n logger.log('debug', 'ending request', {});\n stopwatch.end();\n });\n\n req.on('error', function(err) {\n logger.log('error', 'Error in Express Request', { error: err });\n });\n\n // Save the real end that we will wrap\n // http://stackoverflow.com/questions/8719626/adding-a-hook-to-globally-log-all-node-http-responses-in-node-js-express\n // MIT License https://github.com/mathrawka/express-request-logger/blob/master/LICENSE\n\n var rEnd = res.end;\n\n // The following function will be executed when we send our response:\n res.end = function(chunk, encoding) {\n\n // Do the work expected\n res.end = rEnd;\n res.end(chunk, encoding);\n\n // And do the work we want now (logging!)\n req.kvLog.status = res.statusCode;\n req.kvLog.response_time = (new Date() - req._rlStartTime);\n req.kvLog.originalURL = req.originalURL || req.url;\n req.kvLog.referer = (req.referer)?req.referer:'none';\n req.kvLog.remoteAddress = req.headers['x-forwarded-for'] || req.connection.remoteAddress;\n req.kvLog.userAgent = req.useragent.source;\n req.kvLog.isBot = req.useragent.isBot;\n req.kvLog.OS = req.useragent.OS;\n req.kvLog.Browser = req.useragent.Browser;\n req.kvLog.Platform = req.useragent.Platform;\n req.kvLog.isMobile = req.useragent.isMobile;\n req.kvLog.isDesktop = req.useragent.isDesktop;\n\n var level = req.kvLog._rlLevel;\n delete req.kvLog._rlLevel;\n\n var entry = {};\n Object.keys(req.kvLog).forEach(function(key) {\n value = req.kvLog[key];\n if (key !== 'date')\n {\n entry[key] = value;\n }\n });\n\n logger.log('data', 'request analytics', entry);\n };\n\n next();\n}", "title": "" } ]
[ { "docid": "20bee63ac37479760add1c82eca2c975", "score": "0.6273378", "text": "computeRPS(now, context) {\n const unixTime = now.getTime()\n const requestCounts = { last5s: 0, last60s: 0, last300s: 0 }\n this.recentRequestTimes.forEach(x => {\n if (unixTime - 5000 < x) {\n requestCounts.last5s++\n }\n if (unixTime - 60000 < x) {\n requestCounts.last60s++\n }\n if (unixTime - 300000 < x) {\n requestCounts.last300s++\n }\n })\n context.rps_5s = requestCounts.last5s / 5\n context.rps_60s = requestCounts.last60s / 60\n context.rps_300s = requestCounts.last300s / 300\n }", "title": "" }, { "docid": "9ce23b2ca882c64887e0d986818da038", "score": "0.5857424", "text": "function doRequestStats(req, res, time) {\r\n\r\n if (res.locals.isReported) {\r\n return;\r\n }\r\n\r\n const url = urlParse(req.originalUrl);\r\n\r\n const statusType = getStatusType(res.statusCode);\r\n\r\n if (statusType === 2) {\r\n\r\n const statUrl = _.trim(url.pathname.toLowerCase().replace(/\\//g, '_'), '_');\r\n\r\n const endpoint = `request.url.${statUrl}`;\r\n\r\n statsd.timing(endpoint, time);\r\n\r\n statsd.increment(endpoint);\r\n\r\n statsd.increment(`request.method.${req.method.toLowerCase()}`);\r\n\r\n statsd.increment('request.succeeded');\r\n\r\n } else if (statusType === 4) {\r\n\r\n statsd.increment(`request.http.${res.statusCode}`);\r\n statsd.increment('request.failed');\r\n }\r\n\r\n statsd.increment(`request.app.${res.locals.appId}`);\r\n\r\n res.locals.isReported = true;\r\n\r\n}", "title": "" }, { "docid": "9f8f2ad058eb770d9d2950798be5aed7", "score": "0.5772354", "text": "collectRequestStats(req, res, next) {\n const entry = {\n request: req,\n remoteIp: req.ip,\n response: res,\n startTime: new Date(),\n finished: false,\n }\n this.recentRequests.unshift(entry)\n this.recentRequests.splice(MAX_RECENT_REQUESTS)\n\n const requestTime = entry.startTime.getTime()\n this.recentRequestTimes.unshift(requestTime)\n const expired = this.recentRequestTimes.findIndex(\n x => x < requestTime - OLDEST_REQUEST_TIME * 1000)\n if (expired !== -1) {\n this.recentRequestTimes.splice(expired)\n }\n\n res.on(\"finish\", () => {\n this.requestCount.countRequest(req, res)\n entry.finished = true\n entry.endTime = new Date()\n })\n\n next()\n }", "title": "" }, { "docid": "16ea3526ddbfd6ac06188898f38ff175", "score": "0.57523", "text": "function requestCounter(req, res, next) {\n console.log(`Request counter: ${++requestCount}`);\n\n return next();\n}", "title": "" }, { "docid": "a1d1088bbb83339b10bcb4259760a59e", "score": "0.54827017", "text": "function countRequests(req, res, next) {\n reqCount++;\n console.log(`${reqCount} requests so far`);\n return next();\n}", "title": "" }, { "docid": "62e334461f99ac92c1a8e6e8eb912986", "score": "0.5434717", "text": "function goStats(req, res){\n res.redirect('/roundStats');\n res.end();\n}", "title": "" }, { "docid": "43fafcfd06b754e680152e93c9279a04", "score": "0.5373342", "text": "function logRequests(req, res, next) {\n console.count(\"Number of requests \");\n\n return next();\n}", "title": "" }, { "docid": "bca154a4bdeef9f8bfdb5e923965ff0b", "score": "0.53574204", "text": "function quotaMiddleware(consumer) {\n\treturn(async (uri,body) => {\n\t\t\t console.log(uri + \" == \" + JSON.stringify(body))\n\t\t // app server calls this as its middleware\n\t\t\t var resource = consumer.mapToResource(uri,body)\n\t\t\t var decisionInfo = await consumer.handleReqCount(resource,body)\n\t\t \t\tconsole.log(\"DONE !!! \" + uri + \" == \" + JSON.stringify(body))\n\t\t\t // any modifification decisionInfo\n\t\t\t return(decisionInfo)\n\t\t })\n}", "title": "" }, { "docid": "c9f3c093d431cf0a888665efb2427dc4", "score": "0.5331621", "text": "function countAccess(req, res, next){\n console.count(\"Quantidade de requisições\");\n return next();\n}", "title": "" }, { "docid": "89f7090f33a72b90c1595e7f4965e7d1", "score": "0.5316646", "text": "function createCounterMiddleware () {\n /*\n * variable stays alive even after 'createCounterMiddleware'\n * function execution is over because the returned function\n * has a reference to it\n * \n * this is called a closure\n */\n let counter = 0\n\n return function (request, response, next) {\n console.log(request.path, counter++)\n \n next()\n }\n}", "title": "" }, { "docid": "2b86c8184ca571c7389f2761e11f034c", "score": "0.52369523", "text": "function serveCounter(req, res) {\n sendHtmlResponse(HttpStatus.OK, visitCounter.toString(), res);\n}", "title": "" }, { "docid": "764e732fab851caa353fd4a444c42b44", "score": "0.5162472", "text": "function karmaForWishing(req, res, next) {\n models.User.addKarma(req.session.user, 10);\n next();\n}", "title": "" }, { "docid": "16f13ed8813bd8dee1d1383eaffaf195", "score": "0.5142093", "text": "function handleRate(req, res) {\n const weight = Number(req.query.weight);\n console.log(weight);\n\n const mailType = req.query.mailType;\n console.log(mailType);\n\n calculateRate(res, weight, mailType);\n}", "title": "" }, { "docid": "03c083e237c92433c0a26c0531c3cd53", "score": "0.5140103", "text": "function requests(req, res, next) {\n numberRequests++;\n console.log(`Number of Requests: ${numberRequests}`);\n next();\n}", "title": "" }, { "docid": "ff2a6d0c9afb449f875f2a2b559d944c", "score": "0.5060812", "text": "static timingMiddleware( req, res, next ) {\n if ( !Logstasher.logWriteStream( ) ) { return void next( ); }\n if ( req.method === \"OPTIONS\" ) { return void next( ); }\n const startTime = Date.now( );\n const beforePayload = Logstasher.beforeRequestPayload( req );\n if ( process.env.NODE_ENV !== \"test\" ) {\n util.debug( `Started ${req.method} \"${req.originalUrl}\" for ${beforePayload.clientip} at `\n + `${moment( ).local( ).format( \"YYYY-MM-DD HH:mm:ss Z\" )}` );\n }\n res.on( \"finish\", ( ) => {\n const duration = Date.now( ) - startTime;\n const afterPayload = Logstasher.afterRequestPayload( req, res, duration );\n const payload = Object.assign( beforePayload, afterPayload );\n Logstasher.logWriteStream( ).write( `${JSON.stringify( payload )}\\n` );\n if ( process.env.NODE_ENV !== \"test\" ) {\n util.debug( `Finished ${req.method} \"${req.originalUrl}\" for ${beforePayload.clientip} in `\n + `${duration}ms` );\n }\n } );\n next( );\n }", "title": "" }, { "docid": "5f6a994b16916cd39520cd41d4866a9f", "score": "0.5045521", "text": "function rateLimit(strategy) {\n return function(req, res, next) {\n limiter.get(strategy, req, function (err, limit) {\n if (err) { return next(err); }\n if (!limit) { return next(); }\n\n res.set('X-RateLimit-Limit', limit.total);\n res.set('X-RateLimit-Remaining', limit.remaining);\n res.set('X-RateLimit-Reset', limit.reset);\n\n // all good\n // debug('remaining %s/%s %s', limit.remaining, limit.total, id);\n if (limit.remaining) return next();\n\n /* jshint bitwise: false */\n\n // not good\n var delta = (limit.reset * 1000) - Date.now() | 0;\n var after = limit.reset - (Date.now() / 1000) | 0;\n res.set('Retry-After', after);\n return res.send(429, 'Too Many Requests, retry in ' + ms(delta, { long: true }));\n });\n };\n}", "title": "" }, { "docid": "4efcbd899bc4915567d7325428ffc6b6", "score": "0.5002578", "text": "function incRequestCount() {\r\n instagramRequestCount++;\r\n _gaq.push(['_trackEvent', 'instagram', 'request', params, instagramRequestCount]);\r\n var requestPerSecond = timeStart\r\n }", "title": "" }, { "docid": "be54e20640c67f90cbbacd4b10147b5a", "score": "0.49903753", "text": "function getStats(req, res, next) {\n // promises == bluebird\n let countChars = function(condition) {\n return new Promise(function(resolve, reject) {\n Character.count(condition, function(err, charCount) {\n if (err) reject(err);\n resolve(charCount);\n });\n });\n };\n\n let getAggregateVotes = function() {\n return new Promise(function(resolve, reject) {\n Character.aggregate({\n // use _id of null to calculate values for all docs\n $group: {\n _id: null,\n total: { $sum: '$wins' }\n }\n }, function(err, result) {\n if (err) reject(err);\n\n let totalVotes = result.length ? result[0] : 0;\n resolve(totalVotes);\n });\n });\n };\n\n let getLeading = function(cond) { // race, bloodline\n return new Promise(function(resolve, reject) {\n Character\n .find()\n .sort('-wins')\n .limit(100)\n .select(cond)\n .exec(function(err, characters) {\n if (err) reject(err);\n // [ { amarr: 10 }, { caldari: 20 } ]\n let charCount = _.countBy(characters, function(char) {\n return char[cond];\n });\n let maxChar = _.max(charCount, function(val) { return val; });\n let inverted = _.invert(charCount); // { 10: amarr }\n\n let topCond = inverted[maxChar];\n let topCount = charCount[topCond];\n\n let final = {\n [ cond ]: topCond,\n count: topCount\n }\n resolve(final);\n });\n });\n };\n\n Promise.props({\n totalCount: countChars({}),\n amarrCount: countChars({ race: 'Amarr' }),\n caldariCount: countChars({ race: 'Caldari' }),\n gallenteCount: countChars({ race: 'Gallente' }),\n minmatarCount: countChars({ race: 'Minmatar' }),\n maleCount: countChars({ gender: 'Male' }),\n femaleCount: countChars({ gender: 'Female' }),\n totalVotes: getAggregateVotes(),\n leadingRace: getLeading('race'),\n leadingBloodline: getLeading('bloodline')\n }).then(function(allCounts) {\n\n res.send(allCounts);\n }).catch(function(err) {\n return next(err);\n });\n\n // async approach\n\n // let conditions = [{}, { race: 'Amarr' }, { race: 'Caldari' }, { race: 'Gallente' }, { race: 'Minmatar' }, { gender: 'Male' }, { gender: 'Female' }];\n // let charCounts = {};\n\n // let countChars = function(condition, callback) {\n // let keys = _.values(condition);\n // let key = _.isEmpty(keys) ? 'TotalCount' : _.first(keys) + 'Count';\n // Character.count(condition, function(err, charCount) {\n // charCounts[key] = charCount;\n // callback(err, charCounts);\n // });\n // }\n\n // async.each(conditions, countChars, function(err) {\n // if (err) return next(err);\n // console.log(\"final\", charCounts);\n // });\n}", "title": "" }, { "docid": "3d7279e94bf8d38c32c6daef9ed4a4bf", "score": "0.49688226", "text": "function postLabRating(req, res, next) {\n if ((req && req.user && req.user.usertype != \"superadmin\") && (res && !res.isMember)) {\n // Through the UI alone, the user should never reach this point\n // Which means, the user was trying hard to hack the lab's rating.\n console.log(\"You are NOT a member of lab trying to rate!\");\n res.redirect('/listThisLab?specificLab=' + req.session.lab.labname + \"&message=\" + \"If you are reading this, please report this instance to the superadmin.\");\n } else if (req && req.body && req.body.rating && req.body.rating != \"\" && req.user &&\n (parseInt(req.body.rating) <= 10 && parseInt(req.body.rating) >= 1)) {\n var rating_details = {\n from: req.user.email,\n rating: req.body.rating\n }\n\n Lab.findOneAndUpdate({\n \"labname\": req.session.lab.labname,\n \"ratings.from\": req.user.email\n }, {\n \"$set\": { // UPDATE EXISTING RATING\n \"ratings.$\": rating_details\n }\n },\n function(err, numAffected) {\n if (err) {\n console.log(err);\n res.redirect('/listThisLab?specificLab=' + req.session.lab.labname + \"&message=\" + \"Error rating.\");\n }\n if (numAffected == null || numAffected == 0) {\n Lab.findOneAndUpdate({\n labname: req.session.lab.labname\n }, {\n $push: { // INSERT NEW RATING\n ratings: rating_details\n }\n },\n function(err, model) {\n if (err) {\n console.log(err);\n res.redirect('/listThisLab?specificLab=' + req.session.lab.labname + \"&message=\" + \"Error rating.\");\n }\n });\n }\n res.redirect('/listThisLab?specificLab=' + req.session.lab.labname + \"&message=\" + \"Rated successfully!\");\n });\n } else {\n res.redirect('/listThisLab?specificLab=' + req.session.lab.labname + \"&message=\" + \"Error rating.\");\n }\n}", "title": "" }, { "docid": "3b19d56c2c1cc7e33f237b5c3f14328b", "score": "0.49368444", "text": "function timeMiddleware(req, res, next) {\n req.startTime = Date.now();\n next();\n}", "title": "" }, { "docid": "0c931163e3bce7fa14ad71cfa96b6b3c", "score": "0.4912951", "text": "function new_call(req) {\n var total_requests;\n redis_client.incr(\"requests\", function (err, reply) {\n total_requests = reply;\n }); \n request_stats.requests ++;\n request_stats.last_call_date = new Date();\n request_stats.cache_last_ten ++; \n}", "title": "" }, { "docid": "8f8638463ea1b008b0a5d6ad8ef576c3", "score": "0.4903214", "text": "function studentStatsHandler(req, res) {\n var key = Object.keys(req.body)[0]\n studentStatsCallbacks[key](req, res)\n}", "title": "" }, { "docid": "d24789d37b158d5d40abd47f61818237", "score": "0.49001178", "text": "async function middleware(ctx, next) {\n\tconst start = Number(new Date());\n\t// eslint-disable-next-line callback-return\n\tawait next();\n\tconst ms = Number(new Date()) - start;\n\tctx.set('X-Response-Time', `${ms}ms`);\n\tLog.info(`${ctx.method} ${ctx.url} - Responded with ${ctx.status} in ${ms}ms`);\n}", "title": "" }, { "docid": "d820a79e2fb60e1a34e3f9078a807228", "score": "0.48453575", "text": "middleware(R) {\n\n\t}", "title": "" }, { "docid": "83db3866bf874dd2d4cc1d961d30caae", "score": "0.48408404", "text": "_computeAllScores() {\n const self = this;\n self.patientWs.forEach((pw) => {\n pw.scores = RecommendationService._computeScore(pw);\n });\n }", "title": "" }, { "docid": "c746a9519964da0a460338093a7a3f10", "score": "0.48231456", "text": "async check (req, res, endpoint) {\n // User is root -> skip limiting\n if (req.user.scp.includes('write_root') ||\n req.user.scp.includes('ignore_rate_limit') ||\n (endpoint.limit && endpoint.limit.disable)) {\n return // skip to next middleware\n }\n\n // Limit with rate specified in endpoint\n const limited = await new Promise(resolve => {\n const limit = RateLimiter(Object.assign({\n redis: this.redis,\n namespace: 'rate-limiter'\n }, endpoint.limit || this.config.limit))\n\n // Cached value is `uid + url` e.g. nakroma/v1/foo/bar\n limit(req.user.uid + endpoint.route, (err, time, actions) => {\n this.limit(err, time, actions, resolve)\n })\n })\n\n // Reject request if limited\n if (limited) {\n return res.status(429).send(limited)\n }\n }", "title": "" }, { "docid": "d87b14b88f3de243767e91512001e93f", "score": "0.4823136", "text": "configureRateLimiting() {\n return this.for(\"/api/\")\n .perMinute(60)\n .errorMessage()\n .httpStatusCode(429)\n .save();\n }", "title": "" }, { "docid": "496cefd72949410e115c3fd8b4c6fa2a", "score": "0.4820524", "text": "function middleware1(req, res, next) {\n //res.send(\"<h1>Hello Middleware 1</h1>\");\n console.log(\"Hello Middleware 1\");\n req.profile = { id: 1, name: \"Gulraiz\" };\n next();\n}", "title": "" }, { "docid": "a1bc1404d9aa94efd24fa24451a83d1f", "score": "0.47937945", "text": "function SamplingRule(name, priority, rate, reservoirSize,\n host, httpMethod, urlPath, serviceName, serviceType) {\n this.init(name, priority, rate, reservoirSize,\n host, httpMethod, urlPath, serviceName, serviceType);\n}", "title": "" }, { "docid": "5555dd2fbe5f0d3ade91f541dab20597", "score": "0.4780098", "text": "function logRequests( request, response, next ) {\n const { method, url } = request;\n\n const logLabel = `[${method.toUpperCase()}] ${url}`; \n\n console.time(logLabel);\n\n next(); //proximo middleware\n\n console.timeEnd(logLabel);\n}", "title": "" }, { "docid": "bc5e7d03b78b632374c9980f76193f9a", "score": "0.473261", "text": "function load(req, res, next, id) {\n Metric.get(id)\n .then((metric) => {\n req.metric = metric; // eslint-disable-line no-param-reassign\n return next();\n })\n .catch((e) => next(e));\n}", "title": "" }, { "docid": "e32d47adf8ef2d60cc90a54ba5fc7202", "score": "0.47295794", "text": "statusPage(req, res, next) {\n // Restrict to requests from private or loopback addresses.\n const remoteAddress = ipaddr.process(req.ip)\n if (![\"loopback\", \"private\"].includes(remoteAddress.range())) {\n return next()\n }\n\n const now = new Date()\n const memory = process.memoryUsage()\n const context = {\n title: sprintf(\"Status for %s on %s\", this.program.name, os.hostname()),\n start_time: this.startTime.toISOString(),\n start_time_ago: time.ago((now - this.startTime) / 1000),\n version: this.program.version,\n nodejs: process.release.name + \" \" + process.version,\n platform: process.platform,\n hostname: os.hostname(),\n user: process.getuid(),\n command_line: escapeHTML(process.argv.join(\" \")),\n memory_rss: memory.rss,\n memory_heap_used: memory.heapUsed,\n memory_heap_total: memory.heapTotal,\n memory_external: memory.external,\n local_addr: res.socket.localAddress + \" \" + res.socket.localPort,\n remote_addr: req.ip + \" \" + res.socket.remotePort,\n total_requests: this.requestCount.totalCount(),\n requests: html.renderTable(this.requestCount.tableHeaders(),\n this.requestCount.tableData(100)),\n }\n\n this.computeRPS(now, context)\n this.renderRecentRequests(now, context)\n this.renderEnvironmentVariables(context)\n\n const body = sprintf(STATUS_TEMPLATE, context)\n const expires = new Date()\n res.header(\"Cache-Control\", \"max-age=0\")\n res.header(\"Expires\", expires.toUTCString())\n res.status(200).send(body)\n }", "title": "" }, { "docid": "a98dd01cec8f8aeace94c0c1132fccb0", "score": "0.4724948", "text": "static processData(req, res, next) {\n PoolerController.pool(req, res, next)\n }", "title": "" }, { "docid": "31406583a7c671bfeac34ab50c861742", "score": "0.4718831", "text": "function logRequests(req, res, next) {\n const { method, url } = req;\n\n const logLabel = `[${method.toUpperCase()} ${url}]`;\n\n console.log(logLabel);\n console.time(logLabel);\n next();\n console.timeEnd(logLabel);\n}", "title": "" }, { "docid": "2a88e32a6c12d2d352e6182606efc0cd", "score": "0.46982142", "text": "function interceptMiddleware(req, res, next) {\n var oldWrite = res.write,\n oldEnd = res.end;\n\n var chunks = [];\n\n res.write = function (chunk) {\n chunks.push(new Buffer(chunk));\n\n oldWrite.apply(res, arguments);\n };\n\n res.end = function (chunk) {\n if (chunk) {\n chunks.push(new Buffer(chunk));\n }\n \n oldEnd.apply(res, arguments);\n \n var body = Buffer.concat(chunks).toString('utf8');\n \n \n var pathname = '';\n var query = '';\n if (req._parsedUrl) {\n pathname = req._parsedUrl.pathname;\n query = req._parsedUrl.query;\n }\n \n if (pathname == '' || req.baseUrl != '' || req.method == 'OPTIONS' || isExcluedExt(pathname) || isExcluedPath(pathname)) {\n return;\n }\n \n // store it\n var userid = req.headers.userid;\n \n var data = {\n userid: userid,\n direction:'response',\n path: req._parsedUrl.pathname,\n method: req.method,\n params: body\n };\n\n stat_database.stat_route_insert(data, function(err, result) {\n if (err) {\n logger.debug('Error in calling stat_route_insert.');\n logger.debug(JSON.stringify(err));\n\n return;\n }\n\n if (result && result.affectedRows > 0) {\n logger.debug('stat_route_insert success.');\n }\n });\n \n \n };\n\n next();\n}", "title": "" }, { "docid": "2bd9342400c492a46bf66fc3cb795cc5", "score": "0.46975157", "text": "function logRequests(request, response, next){\n const { method, url } = request;\n \n const logLabel = `[${method.toUpperCase()}] ${url}`;\n console.time(logLabel);\n\n next(); //(proximo middleware) essa funcao que faz com que a rota desejada seja disparada, se nao ele fica travado.\n console.timeEnd(logLabel);\n}", "title": "" }, { "docid": "b6b24c05cd77a50ea29da9c934513c7f", "score": "0.46938956", "text": "calculateR(wantRate) {}", "title": "" }, { "docid": "f716a646a83e35c4577147da5ae9183d", "score": "0.469052", "text": "_createRateLimitsForListenCounts(interval, timeInSeconds) {\n const listenCountLimiter = getRateLimiter({\n prefix: `listenCountLimiter:::${interval}-track:::`,\n expiry: timeInSeconds,\n max: config.get(`rateLimitingListensPerTrackPer${interval}`), // max requests per interval\n skip: function (req) {\n const { ip, senderIP } = getIP(req)\n const ipToCheck = senderIP || ip\n // Do not apply user-specific rate limits for any whitelisted IP\n return isIPWhitelisted(ipToCheck, req)\n },\n keyGenerator: function (req) {\n const trackId = req.params.id\n const userId = req.body.userId\n return `${trackId}:::${userId}`\n }\n })\n\n const listenCountIPTrackLimiter = getRateLimiter({\n prefix: `listenCountLimiter:::${interval}-ip-track:::`,\n expiry: timeInSeconds,\n max: config.get(`rateLimitingListensPerIPTrackPer${interval}`), // max requests per interval\n keyGenerator: function (req) {\n const trackId = req.params.id\n const { ip } = getIP(req)\n return `${ip}:::${trackId}`\n }\n })\n\n // Create a rate limiter for listens based on IP\n const listenCountIPRequestLimiter = getRateLimiter({\n prefix: `listenCountLimiter:::${interval}-ip-exclusive:::`,\n expiry: timeInSeconds,\n max: config.get(`rateLimitingListensPerIPPer${interval}`), // max requests per interval\n keyGenerator: function (req) {\n const { ip } = getIP(req)\n return `${ip}`\n }\n })\n\n return [\n listenCountLimiter,\n listenCountIPTrackLimiter,\n listenCountIPRequestLimiter\n ]\n }", "title": "" }, { "docid": "b2a68a61b69ee8fa78a554d335e5cfa0", "score": "0.46892232", "text": "function ourCustomMiddleware(req, res, next){\n console.log(\"ourCustomMiddleware\")\n req.sam = \"Ham\"\n // If query page exists, req.page will equal to req.query.page\n // if(req.query.page){\n // req.page = req.query.page;\n // }\n // // If limit page exists, req.limit will equal to req.query.limit\n // if(req.query.limit){\n // req.limit = req.query.limit;\n // }\n\n // Web may request 20\n // Mobile may request 3\n req.page = req.query.page || 1;\n req.limit = req.query.limit || 20;\n\n next()\n}", "title": "" }, { "docid": "46209f1821c02cd8a6108bb0216721f7", "score": "0.46706873", "text": "function metricServer() {\n\n}", "title": "" }, { "docid": "93e6694606b33343d373b999a6c5c27b", "score": "0.46669257", "text": "async function handleCount(req, res) {\n const incrementBy = (req.body && req.body.incrementBy) ? parseInt(req.body.incrementBy) : 1;\n counter += incrementBy;\n res.json({counter});\n}", "title": "" }, { "docid": "0cae3380e9662d7395466dcb843bc441", "score": "0.4652999", "text": "function RATE_LIMITER(){\n\tif((process.env.SERVER_BEHIND_PROXY).toUpperCase() === 'TRUE'){\n\t\tapp.enable('trust proxy');\n\t}\n}", "title": "" }, { "docid": "dddad480a9948c2f39250d0da81cedb9", "score": "0.46312755", "text": "function ratingQuery(req, res, next) {\n\tif (req.user == null) {\n\t\tres.redirect('/log_in');\n\t} else {\n\t\tvar review_id = req.query.review_id;\n\t\tconsole.log(\"check reviewid\", review_id);\n\t\tvar searchRatingQuery = ' SELECT review_rating, review_count, email FROM review WHERE review_id = \"'\n\t\t\t+ review_id + '\"';\n\t\tconnection.query(searchRatingQuery, function(err, rows) {\n\t\t\tif (err) {\n\t\t\t\tthrow err;\n\t\t\t} else {\n\t\t\t\tif (req.user.email != rows[0].email) {\n\t\t\t\t\tvar review_rating = new Number();\n\t\t\t\t\tvar review_count = rows[0].review_count;\n\t\t\t\t\treview_count++;\n\t\t\t\t\treview_rating = Number(rows[0].review_rating)\n\t\t\t\t\t+ Number(req.query.rating);\n\t\t\t\t\tvar addRatingQuery = 'UPDATE review SET review_rating = \"'\n\t\t\t\t\t\t+ review_rating + '\", review_count = \"'\n\t\t\t\t\t\t+ review_count + '\"WHERE review_id = \"' + review_id\n\t\t\t\t\t\t+ '\"';\n\t\t\t\t\tconnection.query(addRatingQuery, function(err, rating) {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\tthrow err;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tredirectMovies(req, res, movie_id,\n\t\t\t\t\t\t\t\"rating already added!\");\n\t\t\t\t\t\t\tconsole.log(\"rating updated!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tredirectMovies(req, res, movie_id,\n\t\t\t\t\t\"can't rating your own reviews!\");\n\t\t\t\t\tconsole.log(\"can't rating your own review\");\n\t\t\t\t\t// inform user that can't rating their own reviews\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "1a1143a18b407a02d928e10b5fa70fd4", "score": "0.4625051", "text": "async run (req, res) {\n\t\t\n\t\t__app.debugger.debug('api.controllers.app.analytics - DEBUG: `%s`', req.query.debug);\n\t\t\n\t\tconst uaparser = new UAParser(get(req.headers, 'user-agent'));\n\t\tconst update = process.env.APP_ANALYTICS_UPDATE === 'true';\n\t\t\n\t\tlet endpoint = __app.helpers.core.api.endpoint('analytics');\n\t\tlet analytics = req.body.analytics;\n\t\t\n\t\tif (!size(analytics)) return res.status(403).send();\n\t\t\n\t\tlet path = analytics.url;\n\t\t\n\t\tlet page = __app.helpers.core.page.get(get(__app.data, 'pages'), req);\n\t\t\n\t\t/*\n\t\t\tParse and build the browser information from the user agent\n\t\t*/\n\t\t\n\t\tlet agent = uaparser.getResult();\t\n\t\tlet browser = {\n\t\t\tname: get(agent, 'browser.name'),\n\t\t\tversion: get(agent, 'browser.version'),\n\t\t\tmajor: get(agent, 'browser.major'),\n\t\t\toperating_system_name: get(agent.os, 'name'),\n\t\t\toperating_system_version: get(agent.os, 'version'),\n\t\t\tdevice_vendor: get(agent.device, 'vendor'),\n\t\t\tdevice_model: get(agent.device, 'model'),\n\t\t\tdevice_type: get(agent.device, 'type'),\n\t\t\tengine_name: get(agent.engine, 'name'),\n\t\t\tengine_version: get(agent.engine, 'version'),\n\t\t\tuser_agent: uaparser.getUA()\n\t\t};\n\t\t\n\t\t/*\n\t\t\tAppend additional analytics information to the analytics object\n\t\t*/\n\t\n\t\tanalytics.page = analytics.page || page.id;\n\t\tanalytics.ip_address = req.ip_address;\n\t\tanalytics.view_width = get(req.headers, 'window-width');\n\t\tanalytics.view_height = get(req.headers, 'window-height');\n\t\tanalytics.screen_width = get(req.headers, 'screen-width');\n\t\tanalytics.screen_height = get(req.headers, 'screen-height');\n\t\t\n\t\t/*\n\t\t\tParse and build the location information for the IP Address\n\t\t*/\n\t\t\n\t\tlet iplocation = geoIP.lookup(analytics.ip_address);\n\t\tlet location = {\n\t\t\tip_address: analytics.ip_address,\n\t\t\tcity: iplocation.city,\n\t\t\tregion: iplocation.region,\n\t\t\tcountry: iplocation.country,\n\t\t\ttime_zone: iplocation.timezone,\n\t\t\tlatitude: iplocation.ll[0],\n\t\t\tlongitude: iplocation.ll[1]\n\t\t};\n\t\t\n\t\tconst test = await this.test(req, res);\n\t\t\n\t\tif (req.query.debug === 'test') return res.json(test);\n\t\t\n\t\tif (req.query.debug === 'json') return res.json({\n\t\t\tendpoint: endpoint,\n\t\t\tanalytics: analytics,\n\t\t\tbrowser: browser\n\t\t});\n\t\t\n\t\tconst response = await __app.helpers.core.api.connect({\n\t\t\tmethod: 'post',\n\t\t\turl: endpoint,\n\t\t\tsend: {\n\t\t\t\tupdate: update,\n\t\t analytics: analytics,\n\t\t browser: browser,\n\t\t location: location\n\t }\n\t\t}, req);\n\t\t\n\t\treturn res.json(response);\n\t}", "title": "" }, { "docid": "4ad31157b0c8e865b6c796b591167de9", "score": "0.46073598", "text": "function stars(req, res, next) {\n req.requested = req.cookies['resorts-starred'];\n res.locals.title = 'Stars';\n next();\n}", "title": "" }, { "docid": "68e3f66a6eba75644e9d22255978b7d2", "score": "0.45829418", "text": "async function statsCount(req,res){\n\n //busco en la base de datos la cantidad de adn mutante y adn humano\n const mutants = await modelsadn.countDocuments({ result: true });\n const humans = await modelsadn.countDocuments( {result: false });\n const ratio = mutants/(mutants + humans).toPrecision(2);//.toFixed(2); //para formatear el numero\n return res.status(200).json({\n 'count_mutant_dna': mutants,\n 'count_human_dna': humans,\n ratio,\n })\n}", "title": "" }, { "docid": "511b9c1d0b13b26c5c555ff4eba667fc", "score": "0.4582836", "text": "registerMoleculerMetrics() {\n\t\tthis.broker.metrics.register({\n\t\t\tname: METRIC.MOLECULER_DISCOVERER_REDIS_COLLECT_TOTAL,\n\t\t\ttype: METRIC.TYPE_COUNTER,\n\t\t\trate: true,\n\t\t\tdescription: \"Number of Service Registry fetching from Redis\"\n\t\t});\n\t\tthis.broker.metrics.register({\n\t\t\tname: METRIC.MOLECULER_DISCOVERER_REDIS_COLLECT_TIME,\n\t\t\ttype: METRIC.TYPE_HISTOGRAM,\n\t\t\tquantiles: true,\n\t\t\tunit: METRIC.UNIT_MILLISECONDS,\n\t\t\tdescription: \"Time of Service Registry fetching from Redis\"\n\t\t});\n\t}", "title": "" }, { "docid": "a55f0f8707b61859987bf2bd813ccb4f", "score": "0.45703837", "text": "function getCounters(req, res){\n var userId = req.user.sub;\n if(req.params.id){\n userId = req.params.id;\n }\n\n getCountFollow(userId).then((value) => {\n return res.status(200).send(value);\n });\n}", "title": "" }, { "docid": "5d081a159aafc536974f30f2f3577bba", "score": "0.456885", "text": "function serveReset(req, res) {\n visitCounter = 0;\n sendHtmlResponse(HttpStatus.OK, messages.COUNTER_RESET, res);\n}", "title": "" }, { "docid": "3ffb0a035740047a435e06b7b35a7e32", "score": "0.45613107", "text": "spreadRate (/* minutesSinceReport */) {\n return this.reportRate\n }", "title": "" }, { "docid": "bca80ce387ce2299c458e1df14aa717c", "score": "0.4553608", "text": "function logRequests(request, response, next) {\n const { method, url } = request;\n\n const logLabel = `[${method.toUpperCase()}] ${url}`;\n\n console.log('1')\n console.time(logLabel);\n\n next(); // Próximo middleware\n\n console.log('2')\n console.timeEnd(logLabel);\n}", "title": "" }, { "docid": "c7583f9ad0c74dd71654ff48410c4199", "score": "0.45352387", "text": "function make_rate_limiter(log_msg, max_req) {\n\treturn new RateLimit({\n\t\twindowMs: 1 * 60 * 1000, \t\t\t\t\t\t// xx minutes\n\t\tmax: max_req, \t\t\t\t\t\t\t\t\t// limit each (IP + browser) to xxx requests per time windowMs\n\t\tonLimitReached: function (req, res, opts) {\n\t\t\tconst ip = tools.misc.format_ip(req.ip, true);\n\t\t\tlogger.warn(log_msg, '- initial limit breach. ip hash:', ip, 'at:', req.rateLimit.current);\n\t\t},\n\t\tkeyGenerator: function (req) {\n\t\t\tconst ip = tools.misc.format_ip(req.ip, false);\n\t\t\treturn ip + req.headers['user-agent'];\n\t\t},\n\t\thandler: (req, res, opts) => {\n\t\t\tconst ret = {\n\t\t\t\terror: log_msg + ' - too many requests, try again later',\n\t\t\t\trate_limit: max_req + '/min',\n\t\t\t};\n\t\t\tif (req.url.indexOf('/ak/') === 0) {\t\t// add some tips to ak apis responses\n\t\t\t\tret.tips = [\n\t\t\t\t\t'monitor the header \"X-RateLimit-Remaining\" for your current rate',\n\t\t\t\t\t'check the header \"X-RateLimit-Reset\" for when to resume',\n\t\t\t\t];\n\t\t\t}\n\t\t\tlogger.error(log_msg, '- limit: ' + req.rateLimit.limit + '/min, at:', req.rateLimit.current + '/min');\n\t\t\tres.status(429).send(ret);\n\t\t},\n\t});\n}", "title": "" }, { "docid": "f63d291522db5625e3e6d4c1df52d362", "score": "0.45321527", "text": "function timer() {\n clearInterval(perSec)\n perSec = setInterval(increment, 1000);\n function increment() {\n if(counter >= 0) {\n counter++;\n totalHits = refresh + rank1Total + rank2Total + rank3Total;\n }\n \n $(\".totalHits\").html(\"<h2 class='totalHits'>Total Hits: \" + totalHits + \"</h2>\");\n $(\".timer\").html(counter);\n }\n }", "title": "" }, { "docid": "1f40ef3ff99f076d831a853d02e1e2d4", "score": "0.45319027", "text": "function incRMR(){\n\t\tRMR += armour.getDefense();\n\t}", "title": "" }, { "docid": "bcd53587f72eb72211c05fd1ea7d335d", "score": "0.4529858", "text": "function getScore() {\n if (!isAssessing) {\n return 0;\n }\n /*\n * (# of req. pages viewed + # of correctly answered req. questions) /\n * (total req. pages + total req. questions)\n */\n var totalRequired = pages.required + questions.required;\n // User scores 100% if there are no requirements...\n if (totalRequired === 0) {\n return 1;\n }\n return Math.min((pages.viewed.required + questions.answered.requiredCorrect) / totalRequired, 1);\n }", "title": "" }, { "docid": "86837d6247564f59cec093fb1c9b7121", "score": "0.45203882", "text": "get throughput() {\n return this.getNumberAttribute('throughput');\n }", "title": "" }, { "docid": "86837d6247564f59cec093fb1c9b7121", "score": "0.45203882", "text": "get throughput() {\n return this.getNumberAttribute('throughput');\n }", "title": "" }, { "docid": "4553a52532f36a8c5a3a4c199867ff42", "score": "0.45120156", "text": "function calculateRate(req, res) {\n var weight = Number(req.query.weight);\n var total;\n var adjweight;\n var type = req.query.mailType;\n if((type == \"metered\" && (weight > 3 && weight < 3.6)) || (type == \"stamped\" && (weight > 3 && weight < 3.6))) {\n adjweight = 3.5;\n console.log(adjweight);\n } else {\n adjweight = Math.ceil(weight);\n console.log(adjweight);\n }\n\n switch(type) {\n case \"stamped\" : \n total = postalRates.stamped[adjweight];\n ctype = \"stamped letter\";\n break;\n case \"metered\" : \n total = postalRates.metered[adjweight];\n ctype = \"metered letter\";\n break;\n case \"flat\" : \n total = postalRates.flat[adjweight];\n ctype = \"large flat envelope\";\n break;\n case \"package\" :\n total = postalRates.package[adjweight];\n ctype = \"first-class package\";\n break;\n }\n \n const params = {ctype: ctype, weight: adjweight, total: total};\n console.log(params);\n res.render('pages/results', params);\n}", "title": "" }, { "docid": "a38be5ddb0a0b8a2382375eac2a62bd3", "score": "0.45085788", "text": "function nineTrackMiddleware(localReq, localRes) {\n nineTrack.handleConnection(localReq, localRes);\n }", "title": "" }, { "docid": "03ba9781d066aebfe05ac7cec6e048d4", "score": "0.4503261", "text": "function Goldberg (req, res, next) {\n console.log(`There was a ${req.method} request to endpoint: ${req.url} at ${Date()}`);\n next();\n}", "title": "" }, { "docid": "b91075ae6fc039fcc903d0caad18ad43", "score": "0.45010614", "text": "function getCounters(req, res) {\n let userId = req.decoded.id;\n if(req.params.id) {\n userId = req.params.id; \n }\n getFollowAndPublicationCounters(userId).then((value) =>{\n return res.status(200).send(value);\n });\n}", "title": "" }, { "docid": "aa1d86c1f0dbc5f3fb611ff52f67cd15", "score": "0.44930926", "text": "static async count(req, res) {\n let count,\n logger = Logger.create(\"count\", req.trackId),\n query = new NotificationAlertSrv.types.Query(Object.assign(req.query, {\n users: [req.uid]\n }));\n\n logger.info(\"enter\", {query: req.query});\n\n // Try to count records\n try {\n count = await NotificationAlertSrv.client.count(query, logger.trackId);\n }\n catch(error) {\n logger.error(\"notification alert service count error\", error);\n return res.serverError(error);\n }\n\n logger.info(\"notification alert service count success\", {count});\n\n res.success(count);\n }", "title": "" }, { "docid": "3a9383b5f8c802257d97bba984029cd0", "score": "0.44923395", "text": "function getCounter(req, res){\n if(req.params.id){\n getCountFollows(req.params.id).then((value)=>{\n return res.status(200).send({\n followed: value.followed,\n following: value.following,\n publications: value.publications\n }) \n });\n }else{\n getCountFollows(req.user.sub).then((value)=>{\n return res.status(200).send({\n followed: value.followed,\n following: value.following,\n publications: value.publications\n })\n });\n }\n}", "title": "" }, { "docid": "8c7e372245ee2b2ef3b20050d68c7884", "score": "0.44911212", "text": "constructor() {\n super('chucknorris', ['chuck', 'norris'], {\n middleware: [\n 'throttle.channel:1,1'\n ]\n });\n }", "title": "" }, { "docid": "ee72ec0d166d769f56ffc3e2038b2385", "score": "0.44869494", "text": "function main(){\n applicationServer.applyRateLimiter(optsWithIP,'/something');\n applicationServer.start(9191).then(result=>{\n debug(result);\n \n sendTraffic();\n \n });\n\n}", "title": "" }, { "docid": "f4fab56b6558c4958568cc1283e3399d", "score": "0.4482223", "text": "function stats(req, res) {\n\n if (connected_username){\n var query_str = \"select * from Stats order by connection_date desc\";\n run_query(con, query_str, req, res, handler_stats)\n }else{\n res.writeHead(302, {Location: \"/login/\"});\n res.end();\n }\n}", "title": "" }, { "docid": "4be8f4dbbda25d5f632551d08e20a21f", "score": "0.44818246", "text": "function scoreTracker() {\n STORE.currentScore++;\n}", "title": "" }, { "docid": "b969cc49da076603cbf57c1d0c32436d", "score": "0.44806024", "text": "function loggerMiddleware(req, res, next) {\n const timer = new Nanotimer();\n res.on('finish', () => {\n const method = req.method;\n const url = req.originalUrl;\n const status = res.statusCode;\n const time = timer\n .end()\n .milleseconds()\n .round(2);\n const size = res.getHeader('Content-Length') || '-';\n logger.info(`${method} ${url} ${status} ${time} ms - ${size}`);\n });\n next();\n}", "title": "" }, { "docid": "fb5a0cc3d9d130820eaf95f5222adca7", "score": "0.4476945", "text": "incrementStats(data) {\n return postMethodToAPI(this.API_URL + 'games/increment_stats', data);\n }", "title": "" }, { "docid": "3a0dc01a1bd862ed330f621d99fa081b", "score": "0.44724324", "text": "addRequestAndCheckIfRateLimited() {\n return __awaiter(this, void 0, void 0, function* () {\n const now = new Date().getTime();\n this.requestCounter = this.requestCounter.filter((date) => date + this.rateLimitWindowInSeconds * 1000 > now);\n this.requestCounter.push(now);\n return this.requestCounter.length > this.rateLimit;\n });\n }", "title": "" }, { "docid": "aeca9d4a6370c04bfec70df4a777ee43", "score": "0.44722548", "text": "rate() {\n return _.sum(this.history) / this.history.length;\n }", "title": "" }, { "docid": "4300f89c3e9b1779e2df82656dc91c77", "score": "0.4468025", "text": "middleware(R,router){\n\t\t\n\t}", "title": "" }, { "docid": "e5767d52f2b14965e791aea0fe269fd9", "score": "0.44661015", "text": "function updateScore() {\n var questionScore = currentQuestionScoringSystem.points;\n // applying multiplier\n if (questionTimer.getCurrentTime() < currentQuestionScoringSystem.lower_time_bound) {\n questionScore = questionScore * currentQuestionScoringSystem.lower_bound_multiplier;\n } else if (questionTimer.getCurrentTime() > currentQuestionScoringSystem.higher_time_bound) {\n questionScore = questionScore * currentQuestionScoringSystem.higher_bound_multiplier;\n }\n // applying penalty\n questionScore = questionScore - (currentQuestionScoringSystem.number_wrong_answers * currentQuestionScoringSystem.wrong_answer_penalty);\n if (questionScore > 0) {\n score += Math.floor(questionScore);\n }\n currentQuestionScoringSystem = null;\n }", "title": "" }, { "docid": "84143c93b13d2f0a754e731b7ed846c9", "score": "0.44509768", "text": "pushMetrics() {\n var pushStartTime = process.hrtime();\n var pushNumber = this.totalPushes++;\n this.gateway.pushAdd({ jobName: this.metadataManager.getInvocationId() }, (err, resp, body) => {\n var pushDifference = this.timeUtils.getStartEndDiffDecimal(pushStartTime);\n this.metadataManager.log('PushAdd callback reached for push number ' + pushNumber + '. Push time in ms: ' + pushDifference);\n if (err) {\n this.metadataManager.log('Error: ', err);\n if (resp) {\n this.metadataManager.log('Response: ', resp);\n }\n if (body) {\n this.metadataManager.log('Body: ', body);\n }\n }\n });\n }", "title": "" }, { "docid": "4859340d365cae43247f54e746c25a53", "score": "0.44478342", "text": "AddMetrics() {\n this.submitted = true;\n if (this.metricsform.invalid) {\n return;\n }\n const add = { Measure: this.metricsName };\n this.supplerService.AddMetrics(add).subscribe((myMetrics) => {\n if (myMetrics['status']) {\n this._flashMessagesService.show(myMetrics['msg'], { cssClass: 'alert-success', timeout: 1200 });\n }\n else {\n this._flashMessagesService.show(myMetrics['msg'], { cssClass: 'alert-warning', timeout: 1200 });\n }\n this.resetForm();\n this.viewMetrics();\n }, (err) => {\n console.log(err);\n });\n }", "title": "" }, { "docid": "ed1be9b51e7991ff53cf4eca3c361355", "score": "0.4446512", "text": "profile(req, key, optionalDuration) {\n if (typeof req === 'string') {\n // Called without a `req`\n if (arguments.length === 2) {\n return self.profile(null, arguments[0], arguments[1]);\n } else {\n return self.profile(null, arguments[0]);\n }\n }\n if (arguments.length === 2) {\n // You did not supply duration so we return a function\n // for you to call at the end\n return function () {\n };\n }\n }", "title": "" }, { "docid": "d625eab56f4d1a6bbb81a402cd6e2121", "score": "0.44389614", "text": "currentBMI(request, response){\n logger.info('user:', loggedInUser.firstName + loggedInUser.lastName);\n const loggedInUser = accounts.getCurrentUser(request);\n \n const currentBMI = 0;\n \n }", "title": "" }, { "docid": "e7ec44a506ee13d72ce7ad65cacce48c", "score": "0.4437651", "text": "logAccess(req, res, next){\n //doan lay thong tin cac bien su dung sau nay\n var reqUrlString = req.url;\n var method = req.method;\n var pathName = decodeURIComponent(url.parse(reqUrlString, true, false).pathname);\n var reqFullHost = req.protocol + '://' + req.get('host');\n \n var log = {\n name: 'LOG_ACCESS',\n cols: [{\n name: 'IP',\n value: req.ip\n },\n {\n name: 'ACCESS_INFO',\n value: method + \" \" + reqFullHost + '/' + pathName\n },\n {\n name: 'DEVICE_INFO',\n value: req.headers[\"user-agent\"]\n }\n ],\n wheres: [{\n name: 'IP',\n value: req.ip\n }]\n };\n db.insert(log)\n .then(data => {\n if (!isSilence) console.log(data)\n }\n )\n .catch(err=>{\n db.runSql(\"update LOG_ACCESS set LOG_COUNT=LOG_COUNT+1 where IP='\"+req.ip+\"'\")\n .then(data=>{\n if (!isSilence) console.log(data)\n })\n });\n //-----------------------------------------\n //tra den phien tiep theo\n next(); \n }", "title": "" }, { "docid": "9f78327123469e7904c981ccd2ca5343", "score": "0.4437443", "text": "metricCpuUtilization(props) {\n return this.metric('CPUUtilization', props);\n }", "title": "" }, { "docid": "68c400bf30bb181eeefdbf58b95b8f56", "score": "0.4426057", "text": "async check (req, res) {\n // User is root -> skip limiting\n if (req.user.scp.includes('write_root') ||\n req.user.scp.includes('ignore_rate_limit')) {\n return\n }\n\n // Limit with rate specified in endpoint\n const limited = await new Promise(resolve => {\n const limit = RateLimiter(Object.assign({\n redis: this.redis,\n namespace: 'rate-limiter'\n }, this.config.limit))\n\n // Cached value is `uid + url` e.g. nakroma/v1/foo/bar\n limit(req.user.uid + '-global', (err, time, actions) => {\n this.limit(err, time, actions, resolve)\n })\n })\n\n // Reject request if limited\n if (limited) {\n res.status(429).send(limited)\n return true\n }\n }", "title": "" }, { "docid": "b6553bf70fcc6c51a7d812a191dd651c", "score": "0.44253018", "text": "function rateLimitResponse(params) {\n var request = params.request\n var response = params.response\n\n if (params.forward) {\n forwardRequest(request, response)\n } else {\n response.writeHead(503) // server not available as rate limiting is on\n response.end()\n }\n }", "title": "" }, { "docid": "dc713ca209d8551b0489277de39babf0", "score": "0.4419356", "text": "middleware(R, router) {\n\n\t}", "title": "" }, { "docid": "092ffaec6beb171a1c9aa4692949713d", "score": "0.44115502", "text": "function record_user_performance() {\n\n}", "title": "" }, { "docid": "fc87a5d29c58c17bb46dab0bf2fc331f", "score": "0.44092926", "text": "function getStudentCountHandler(req, res) {\n data_access.getStudentCount(function(err, studentCount){\n if (err) sendJsonResponse(res, 404, err)\n else sendJsonResponse(res, 200, studentCount)\n })\n}", "title": "" }, { "docid": "7fe50c243a2415e734a945754576d852", "score": "0.4407624", "text": "function middleware_function(req,res,next){\n\n console.log(\"This is a middle ware function\");\n next();//this function is used to jump control to the next middleware or http request function\n}", "title": "" }, { "docid": "ee84083222450821e6eca9a6a74d995c", "score": "0.44045657", "text": "function emitRoll() {\n console.log(\"EMIT OPTIONS: \", current.r, current.p);\n let data = {\n name: current.round.name,\n queries: current.part.getQueries()\n }\n socket.emit('roll', data);\n // Send rate to chorus\n socket.emit('rate', current.part.rate);\n}", "title": "" }, { "docid": "bbfd8547efa467bff2c24d072a4eec16", "score": "0.44024462", "text": "_applyMiddleware (middleware) {\n this._app.use(middleware);\n }", "title": "" }, { "docid": "fac6eecf89828a9e6f65fd1dee681670", "score": "0.43864995", "text": "report() {\n // Get all the metrics\n let allMetrics = this.getMetrics();\n for (let metrics of [\n allMetrics.counters,\n allMetrics.gauges,\n allMetrics.meters,\n allMetrics.timers,\n allMetrics.histograms\n ]) {\n if (metrics.length > 0) {\n for (let m of metrics) {\n let [metricName, tags] = this._decodeMetric(m);\n // If Wavefront histogram, client send_distribution\n if (m instanceof WavefrontHistogram) {\n let distributions = m.getDistribution();\n if (this.flushCurrentHist) {\n distributions.push(m.getCurrentMinuteDistribution());\n }\n for (let dist of distributions) {\n this.wavefrontClient.sendDistribution(\n metricName,\n dist.centroids,\n this.histogramGranularity,\n dist.timestamp,\n this.source,\n tags\n );\n }\n continue;\n }\n // If metric, client send_metric\n for (let f of metricsFunctionMap[m.type]) {\n const [suffix, value] = f(m);\n this.wavefrontClient.sendMetric(\n metricName + suffix,\n value,\n Date.now(),\n this.source,\n tags\n );\n }\n }\n }\n }\n }", "title": "" }, { "docid": "aa438232cc11e86773a324de3fe87d69", "score": "0.43861476", "text": "function computeStats(){\n\treturn {\n\t\tpages: computePageCounts(),\n\t\treferrers: computeRefererCounts(),\n\t\taactiveUsers: getActiveUsers()\n\n\t};\n}", "title": "" }, { "docid": "1a52a3871389f77b43323c3e38547b65", "score": "0.43802065", "text": "increment(ip, name, ttl) {\n return this._incrementRateBucket(ip, name, ttl)\n .then((bucket) => bucket || this._createRateBucket(ip, name));\n }", "title": "" }, { "docid": "e7c6344a1ff79a63b0ade297e5e0a607", "score": "0.43742448", "text": "update() {\r\n const max = this.scrape_secs * this.pct * 1.25;\r\n const min = this.scrape_secs * this.pct * 0.75;\r\n let value = Math.abs(this.randomGaussian(3)) * (max - min) + min;\r\n this.metric.labels(this.labels).inc(value);\r\n }", "title": "" }, { "docid": "e748c20de481de3df369b164a99988f9", "score": "0.4373857", "text": "function startTimer(req, res, next) {\n req.mainRoutePath = req.route.path;\n req.stopTimer = eyes.start('routes.' + req.mainRoutePath + '.' + req.method);\n next();\n}", "title": "" }, { "docid": "756df5ee893efdc7c128df078c8fcbe7", "score": "0.43501642", "text": "function report(context, { logger }) {\n update();\n const total = delta(process.hrtime(), startTime);\n logger.debug(`total processing time: ${total}ms`);\n\n // calculate the deltas between 2 the timestamps of 2 steps and generate the metric string.\n const metrics = [];\n for (let i = 0; i < times.length - 1; i += 1) {\n const d = delta(times[i + 1].time, times[i].time);\n metrics.push(`p${String(i).padStart(2, '0')};dur=${d};desc=${times[i].name}`);\n }\n const timing = metrics.join(' ,');\n logger.debug(`timing: ${timing}`);\n\n context.response.headers['Server-Timing'] = [\n timing,\n `total;dur=${total}`,\n ].join(',');\n }", "title": "" }, { "docid": "35beaa886898248de93e48aaed26b6f1", "score": "0.43500683", "text": "function addMiddleware(name, fn) {\n MIDDLEWARES[name] = fn;\n}", "title": "" }, { "docid": "1435eaec1b346b459d4fa4a593dfa741", "score": "0.43425557", "text": "function calculateSkiCounter() {\n if (mainSkier.isMoving()) {\n skiCounter++;\n }\n else if (rhino.isRhinoActive() === false){\n skiCounter = 0;\n }\n }", "title": "" }, { "docid": "f7c3da90f1f4313874a75f3462d5c9c9", "score": "0.43415087", "text": "async function refreshCustomMetrics() {\n // reset metrics\n resetMetricsIfNeeded();\n // basic metrics\n gaugeCpuLoad.set((await sysInfo.currentLoad()).currentload, Date.now());\n gaugeMemUsed.set((await sysInfo.mem()).used, Date.now());\n gaugeMemTotal.set((await sysInfo.mem()).total, Date.now());\n gaugeSwapUsed.set((await sysInfo.mem()).swapused, Date.now());\n gaugeSwapTotal.set((await sysInfo.mem()).swaptotal, Date.now());\n gaugeNetworkConnectionsAll.set((await sysInfo.networkConnections()).length, Date.now());\n gaugeUptime.set((await sysInfo.time()).uptime, Date.now());\n}", "title": "" }, { "docid": "8eb5e1851c9871089e5888be1c3c191c", "score": "0.43372247", "text": "function onRequest(req, res) {\n console.log(\"Recieved a request for: \" + req.url);\n var parsedURL = url.parse(req.url, true);\n if (parsedURL.pathname === homeURL) {\n res.writeHead(200, { \"Content-Type\": \"text/html\" });\n res.write(\"<h1>Welcome to the Home Page!</h1>\");\n } else if (parsedURL.pathname === dataURL) {\n res.writeHead(200, { \"Content-Type\": \"application/json\" });\n res.end(JSON.stringify(jsonObj));\n } else if (parsedURL.pathname === mathURL) {\n var qData = parsedURL.query;\n var firstNum = qData.multiply;\n var secNum = qData.by;\n var total = firstNum * secNum;\n\n // IF statement to check if query is not set\n if(firstNum || secNum) {\n firstNum, secNum = 0;\n } \n\n res.writeHead(200, { \"Content-Type\": \"text/html\" });\n res.write(\"<h1>Welcome to the Multiply Function!</h1>\");\n res.write(\"Multiply \" + firstNum + \" by \" + secNum + \". Total is: \" + total + \"<br><br>\");\n res.write(\"<b>Change what you multiply by adding \\\"?multiply=InsertNumberHere&by=InsertNumberHere\\\" at the end of the URL.</b>\");\n } else {\n res.writeHead(404, { \"Content-Type\": \"text/html\" });\n res.write(\"<h1>Error 404: Page Not Found</h1>\");\n }\n\n // Always End responses with end\n res.end();\n}", "title": "" }, { "docid": "c12a63c7d71c10f8229add8e2cc8b97b", "score": "0.43345013", "text": "get count() {\n return this.reqTimes.length\n }", "title": "" }, { "docid": "7da5f0083ddb87162b369f4ade374cba", "score": "0.43308342", "text": "draw() {\n this._middleware.forEach((middleware) => {\n if (middleware.enabled) {\n middleware.draw();\n }\n });\n }", "title": "" }, { "docid": "e8658fcd1fff8b211ab0ddf59a119d8d", "score": "0.4329947", "text": "getStats() {}", "title": "" } ]
0120792b272002d0fbb0cf38d8dcab99
about page title fadein
[ { "docid": "2fc05113bf4f2fa7756bc3ce5e65a4a0", "score": "0.83827406", "text": "function fadeInTitle(){\n var title = $(\"#about-page-title\");\n \n title.hide().fadeIn(2000);\n }", "title": "" } ]
[ { "docid": "822e1cb9d491efbe7e088e8fc8ab51a0", "score": "0.72180986", "text": "function showabout() {\r\n slowappear('#about');\r\n slowappear('#aboutdarken');\r\n }", "title": "" }, { "docid": "f9638d40506667a557dea6773ae9a1dd", "score": "0.71401566", "text": "function showTitle(){\n\t\tshow(title);\n\t}", "title": "" }, { "docid": "e7490c2062cb9da7bbcf116c6addef5d", "score": "0.7061967", "text": "function animateTitle() {\r\n\t\t$('#head').css('color', 'white');\r\n\t\t$('#message').css('color', 'rgba(255, 255, 255, 0.8)');\r\n\t}", "title": "" }, { "docid": "692826913e84917f78c31e44607f590f", "score": "0.6821536", "text": "function _animateTitle(pageID) {\n $('h3', '#' + pageID).addClass('active');\n }", "title": "" }, { "docid": "5709627505de68a0ec4ceec92a2cd83d", "score": "0.680004", "text": "function showTitle() {\n\n let tl = new TimelineMax();\n tl\n .from(\".navbar-brand\", .5, {\n x: '-300%',\n\n }, delay = .5)\n .staggerFrom(\".nav-link\", .5, {\n y: '-50',\n opacity: 0\n }, 0.1, \"-=0.20\")\n .from('#title', 2, {\n y: '-300%',\n ease: Bounce.easeOut\n })\n .from('.hero__subtitle', .5, {\n y: '100',\n opacity: 0\n }, \"-=1\")\n .from('.hero__toscroll', 1, {\n backgroundColor: \"rgba(52, 58, 64)\",\n opacity: .8,\n borderRadius: \"5px\"\n }, \"-=2\")\n\n }", "title": "" }, { "docid": "405980b67bca9b176868319be53dad2e", "score": "0.6642224", "text": "function fadeName(){ //Begin fades\n $('#header h1').fadeTo(800, 1.0, function(){\n fadeDev();\n });\n }", "title": "" }, { "docid": "23df23ecd7f23c1a92615362057fd6ff", "score": "0.66363883", "text": "function title() {\n function appear(element, num, step, speed){\n var t_o;\n t_o = setInterval(function(){\n // get opacity in decimals\n var opacity = num / 100;\n // set the next opacity step\n num = num + step; \n if(opacity > 1){\n clearInterval(t_o);\n // if 1-opaque, stop\n return; \n }\n // modern browsers\n element.style.opacity = opacity;\n // older IE\n element.style.filter = 'alpha(opacity=' + opacity*100 + ')';\n }, speed);\n }\n appear(document.getElementById('title'), 0, 10, 150);\n}", "title": "" }, { "docid": "334cdb94d1debce3d415f3e8c08d48f4", "score": "0.6621039", "text": "function setPageTitle(title) {\n $(\"#pagetitlebox span\").text(title);\n }", "title": "" }, { "docid": "4d320e84ff3765ad17eca57918d91813", "score": "0.6564366", "text": "function revealAboutContent()\n{\n\t$('#about-page').fadeIn(250)\n\t$('.about-content').removeClass('hide')\n}", "title": "" }, { "docid": "9496770229988550f8017196c7590d4b", "score": "0.65398926", "text": "function titleHomePage() {\n // Check if links are alerady added\n if ($('.pirate-all-links').length)\n return; \n\n var title = getOriginalTitle();\n var links = getLinks(title);\n\n $('.title_wrapper').first().children('.subtext').first().append(links);\n}", "title": "" }, { "docid": "dbef33dd58019c51547f669da8020e91", "score": "0.65184265", "text": "function title(d1, d2) {\r\n $h1Title.delay(d1).fadeIn();\r\n $h2Title.delay(d2).fadeIn();\r\n }", "title": "" }, { "docid": "202116abded17c885fafcfd9d3e328b1", "score": "0.6491047", "text": "function TitleAssistant() { }", "title": "" }, { "docid": "1c3c3d30328a03e34308a9245df531af", "score": "0.64908147", "text": "function showTitle() {\n g.selectAll('.count-title')\n .transition()\n .duration(0)\n .attr('opacity', 0);\n\n g.selectAll('.openvis-title')\n .transition()\n .duration(600)\n .attr('opacity', 1.0);\n }", "title": "" }, { "docid": "a1881146f6df1a175f89a46682542471", "score": "0.64627403", "text": "function changePageTitle(page_title) {\n \n // mudar titulo da pagina\n $('#page-title').text(page_title);\n\n // mudar tag titulo\n document.title = page_title;\n}", "title": "" }, { "docid": "15470ea30413f13fb6c2c8040ba2c84f", "score": "0.64604306", "text": "function setTitle() {\r\n title.text(getWebsite());\r\n }", "title": "" }, { "docid": "079ad0de6592ebdbf42b30101dc0df8f", "score": "0.6391557", "text": "function pageAbout()\n{\n // Set the title and subtitle for this page in the navigation\n switchTitle(\"About this App\");\n switchSubtitle(\"Learn more about this Domo App\");\n \n // Highlight this in the top navigation\n sse1.highlight('about');\n \n // Load the page content\n switchPage(\"/pages/about.html\");\n \n}", "title": "" }, { "docid": "2b9653ee4f34156d1276f722a76f3665", "score": "0.6373223", "text": "function hideTitle() {\n $('#titleWrapper').fadeOut('slow');\n}", "title": "" }, { "docid": "7a04d542cc3c046ad4278116ad7987cf", "score": "0.6369655", "text": "function myTimer() {\n var nextTitleIndex = (activeTitleIndex + 1) % titles.length;\n switch (activeTitleState) {\n case 0: // Fade out\n $(titles[activeTitleIndex]).css({\n opacity: 0\n });\n setTimeout(myTimer, config.textAnimationTime + 50);\n activeTitleState = 1;\n break;\n case 1: // Switch visibility\n $(titles[activeTitleIndex]).css({\n opacity: 0,\n display: \"none\"\n });\n $(titles[nextTitleIndex]).css({\n opacity: 0,\n display: \"inline\"\n });\n setTimeout(myTimer, 50);\n activeTitleState = 2;\n break;\n default: // Fade in\n $(titles[nextTitleIndex]).css({\n opacity: 1\n });\n activeTitleIndex = nextTitleIndex;\n setTimeout(myTimer, config.textAnimationTime + 50);\n activeTitleState = 0;\n break;\n }\n }", "title": "" }, { "docid": "90c0b2700f7b961fe67cef983f5ed8a8", "score": "0.6369138", "text": "function showOverOnsPage() {\r\n var page = document.getElementById('page-overons');\r\n hideAllPages();\r\n page.style.display = 'block';\r\n document.title = \"Over ons\";\r\n}", "title": "" }, { "docid": "f2c617f91eb2aa4402f375ee140f315f", "score": "0.6363967", "text": "function hideabout() {\r\n slowdisappear('#about');\r\n slowdisappear('#aboutdarken');\r\n }", "title": "" }, { "docid": "5fda8d875cf90bd0082cba3304b20631", "score": "0.63453656", "text": "function injectTitle(name) {\n document.getElementById(\"pageTitle\").innerHTML = name;\n}", "title": "" }, { "docid": "50a8a8f5c65637881f6e6765ecefa983", "score": "0.63423294", "text": "function transitionTitles() {\n self.playerTimeout = setTimeout(function() {\n $(episodeTitle).toggleClass('hide');\n $(podcastTitle).toggleClass('hide');\n resize(episodeTitle);\n resize(podcastTitle);\n transitionTitles();\n }, 4000);\n }", "title": "" }, { "docid": "50a47380efd140261889c89f61aac5c7", "score": "0.63389784", "text": "function fnSetPageTitle(strPageTitle){\n\ttry{\n\t\tgetEl(\"divPageTitle\").innerHTML=strPageTitle;\n\t}catch(e){}\n\tdocument.title=\"Service Head Quarters : \" + strPageTitle;\n}", "title": "" }, { "docid": "2d93f02e40d88834eca5b6163975b7d1", "score": "0.63324094", "text": "updateTitle(newTitle, newColor) {\n document.title = newTitle;\n let title = document.createElement('h4');\n title.innerText = newTitle;\n if (newColor) {\n title.style.color = newColor;\n } else {\n title.style.color = \"#ccc\";\n }\n title.style.animation = 'fadein';\n title.style.animationDuration = '5s';\n\n this.nodes.header.innerHTML = '';\n this.nodes.header.appendChild(title);\n }", "title": "" }, { "docid": "20ffdc843f22e39de780af4438a4f6af", "score": "0.63158464", "text": "function setPageTitle() {\n var $pageTitle;\n if ($.md.config.title)\n $('title').text($.md.config.title);\n\n $pageTitle = $('#md-content h1').eq(0);\n if ($.trim($pageTitle.toptext()).length > 0) {\n $('#md-title').prepend($pageTitle);\n var title = $pageTitle.toptext();\n // document.title = title;\n } else {\n $('#md-title').remove();\n }\n }", "title": "" }, { "docid": "d0e6306b0d27ed821b630d920d1d5457", "score": "0.63017017", "text": "function setTitle(pgTitle) { $(\"title\").html(pgTitle); }", "title": "" }, { "docid": "12587a6bb6ec58f13724d5686900f2f4", "score": "0.6297589", "text": "function shortenPageTitle() {\n const mainTitle = document.getElementById('main-title');\n console.log('this is the maintitle', mainTitle);\n mainTitle.innerText = \"Dom Toretto's Homepage!\"\n }", "title": "" }, { "docid": "c5736bd9c3d5ca361710ee06ed137ec1", "score": "0.62932694", "text": "function titleChange() {\n\n if (window.matchMedia(\"(max-width: 850px)\").matches) {\n\n var titrePageBrut = $('.titre h2').text().slice($('.titre h2').text().lastIndexOf(' ') + 1);\n var titrePage = capitalizeFirstLetter(titrePageBrut);\n // on ajoute le texte dans le liseret seulement si l'orientation est la bonne\n if (window.matchMedia(\"(orientation: portrait)\").matches) {\n var titreSection = $('section .titre').text().length;\n if (titreSection == 16) {\n $('#portfolio p').append('<span> - Livre d\\'or </span>');\n } else if (titreSection == 13) {\n $('#portfolio p').append('<span> - Sur moi </span>');\n } else {\n $('#portfolio p').append('<span> - ' + titrePage + '</span>');\n }\n } else {\n $('#portfolio span').remove();\n }\n }\n\n }", "title": "" }, { "docid": "c30a91303c795d1ca908bbe74e661ede", "score": "0.6264052", "text": "function updateTitle() {\n ;\n }", "title": "" }, { "docid": "414cfeebc84b26c95d72d3a2db79e9ae", "score": "0.6262458", "text": "function currentPageTitle(pageTitle) {\n $('#page-title-text').text(pageTitle);\n}", "title": "" }, { "docid": "c5717b6046d90cda744dadca9a3f20b5", "score": "0.6253466", "text": "function about() {\n\taboutWindow = createAboutWindow();\n\taboutWindow.show();\n}", "title": "" }, { "docid": "2ef079eabd4a8d5a380a4ea8a98ac3f3", "score": "0.6248108", "text": "function title() {\n header();\n instructions();\n}", "title": "" }, { "docid": "9c713b15e592cf05469752e2d023b7a7", "score": "0.62448794", "text": "_titleUpdate() {\r\n this.title = this.el.querySelector(\".slider-menu h1\");\r\n this.title.innerText = this.images[this.cpt].title;\r\n }", "title": "" }, { "docid": "a2549cfe4a26213e5a94207333118a27", "score": "0.62364155", "text": "function titleScreen() {\n\thiscore = localStorage.getItem(\"hiscore\");\n\tif ( hiscore == 0 || hiscore == undefined || hiscore == null ) hiscore = 0;\n\t\n\thtml(\"hiscore\",\"hi-score<br>\"+hiscore);\n\tshow(\"start\");\n\tshow(\"atras\");\n\thide(\"hiscore\");\n\tshow(\"title\");\n\tshow(\"subtitle\");\n\tshow(\"info\");\n\tshow(\"lives\");\n\thide(\"credit\");\n\thide(\"puntos\");\n\thide(\"nivel\");\n\n\tif (interval != undefined) interval=window.clearInterval(interval);\n\tif (hintsTimer != undefined) hintsTimer=window.clearInterval(hintsTimer);\n\t\n\tanimType = \"demo\";\n\t\n\tif (gumSupported) {\n\t hintsTimer = setInterval(showHints, 4000);\n\t}\n}", "title": "" }, { "docid": "9ddc19d6557e06b91b4c53f4be155175", "score": "0.62101626", "text": "function setTitle(title) {\n\t$( \"title\" ).html( title )\n}", "title": "" }, { "docid": "4087777ae84c117305bda06c2d313a81", "score": "0.6204133", "text": "function playTitle()\n {\n document.title = \"Chat voi nguoi la\";\n window.setTimeout('document.title=\"Chat voi nguoi la\";', 1000);\n window.setTimeout('document.title=\"Ban co tin nhan moi\";', 2000);\n // window.setTimeout('document.title=\"Hay xem ho noi gi\";', 3000);\n\n if (playTitleFlag == true)\n {\n window.setTimeout('playTitle();', 4000);\n }\n }", "title": "" }, { "docid": "f4754dccef167454f7bb756e16371bc7", "score": "0.6198964", "text": "function updateTitle() {\n var text = editor.getLine(0); // TODO: find first # Title line?\n text = text.replace(/^\\s*#+\\s*/, \"\");\n document.title = text + \" | mathdown\";\n window.location.hash = text.replace(/\\W+/g, \"-\").replace(/^-/, \"\").replace(/-$/, \"\");\n }", "title": "" }, { "docid": "72ce24e1c0e03931d8a3ba5f200ec434", "score": "0.6191349", "text": "function setPageTitle() {\n document.getElementById(\"title\").innerHTML = pageTitle\n}", "title": "" }, { "docid": "ed63c5a9f488dc303d6ed5c929f42614", "score": "0.61817414", "text": "function newTitle() {\n document.getElementById(\"main-title\").innerText = \"Dom's Page\";\n}", "title": "" }, { "docid": "d6b190dc84dc450ff17d8fb0e80e87fd", "score": "0.61582524", "text": "function setTitle(title) {\r\n\tactivePage('[data-role=\"header\"] h1').html(title);\r\n}", "title": "" }, { "docid": "4d5652d8621ce9f55fc6df6b68e82935", "score": "0.613461", "text": "function showAboutPage() {\n var headerBackBtn = defaultPagePath + 'backbtnPage.html';\n var pageRef = defaultPagePath + 'aboutPage.html';\n j(document).ready(function() {\n j('#mainHeader').load(headerBackBtn);\n j('#mainContainer').load(pageRef);\n });\n appPageHistory.push(pageRef);\n }", "title": "" }, { "docid": "43c163ece3067ee57d1c0f3860c88295", "score": "0.6126871", "text": "function displayAboutText() {\n var windowHeight = $(window).height();\n var windowScroll = $(window).scrollTop();\n\n if ($('#about').offset().top - windowHeight / 2 < windowScroll) {\n showElement($('.about-text'));\n setTimeout(function() {\n showElement($('.button'));\n }, 750);\n }\n}", "title": "" }, { "docid": "e0c025bd5eecf123dfcf0a066fa92d10", "score": "0.6125132", "text": "function changeMainTitle() {\n let title = document.getElementById(\"main-title\");\n title.innerHTML = \"Welcome to my homepage\";\n }", "title": "" }, { "docid": "b122696db6d8b17add448eb8932ce3fd", "score": "0.611562", "text": "function setTitle() {\n title = infoData['name'];\n $('#titleText').html('Report: ' + title);\n }", "title": "" }, { "docid": "797727fc80cf8af2907d4709c1013b31", "score": "0.6106449", "text": "function hideTitle(disease) {\n map.dataProvider = disease.dataProvider;\n curDisease = disease.h3;\n $('#mapTitle2').html(disease.h2);\n $('#contentBar h3').html(disease.h3);\n $('#date').html(disease.date);\n $('#deaths').html(disease.deaths);\n $('#description').html(disease.description);\n $('#deathTollBar').css('height', ((1 - disease.deathBar) * 87.5) + '%');\n $('#deathToll').animate({'background-color':'#D12716'},2000);\n map.validateData();\n $('#titleScreen').toggle('blind', 2000);\n $('#titleScreen #title').fadeOut(1500);\n $('#timeline').fadeOut(1000);\n }", "title": "" }, { "docid": "9433f5fc334848c354e30724486b6374", "score": "0.60843074", "text": "function updatetitle(meal) {\n\n if(titletrace) {\n\n // Grab the gridobj\n if(!meal.gridobj) meal.gridobj = showattributes.getgridobj();\n\n // Paragraph object\n var titlesp = $(meal.gridobj).find('.titlespan'); \n\n // Format title string\n var title = titlestring(meal);\n\n // Special case no-title\n if (title.length <= 0) {\n \n titlesp.css('color', '#fff');\n title = \".\";\n }\n else {\n titlesp.css('color', titlefontcolor);\n }\n \n // Set the html\n titlesp.html(title);\n }\n }", "title": "" }, { "docid": "6efec34616a751b635a1bdaeb1a1eea5", "score": "0.6082273", "text": "function _intro_page() {\n}", "title": "" }, { "docid": "25ab65cc766daec9534193f0ceb61a89", "score": "0.60764617", "text": "function showAbout() {\r\n\t\tlet w = window.innerWidth;\r\n\t\tmenuColor = \"#4479ff\";\r\n\t\t\r\n\t\t$(\".about\").css({\r\n\t\t\t\"border-bottom-color\": \"#fff\",\r\n\t\t\t\"color\": \"#fff\"\r\n\t\t});\r\n\t\tdocument.getElementById(\"about\").style.display = \"block\";\r\n\t\t$(\"#container\").css({\r\n\t\t\t\"background\": \"#eee url('images/Header-about.png') no-repeat center top\",\r\n\t\t\t\"color\": \"#000\"\r\n\t\t});\r\n\r\n\t\t\r\n\t\t//If window-width is <= 660px change the backgroundColor of the menu elements\r\n\t\tif (w <= 660) {\r\n\t\t\tfor (let t = 0; t < tablinks.length; t++) {\r\n\t\t\ttablinks[t].style.backgroundColor = menuColor;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "845b80e85926db8e90d10318c2f77956", "score": "0.6073227", "text": "function akwSetTitle(akwtitle){\n\tdocument.title = akwtitle;\n\t$(\"#akwH1Title\").text(akwtitle);\n}", "title": "" }, { "docid": "05c0b9ca45c562036c3294d269eb3138", "score": "0.60706824", "text": "function aboutButtonPressed() {\n showPage(\"content__container__aboutUs\");\n}", "title": "" }, { "docid": "c4618b4efda1ed4b6e4926f28c91aa40", "score": "0.60504425", "text": "function close(title) {\n\t$('#content-frame').fadeOut();\n\t$('#back').css('visibility', 'hidden');\n\t$('#title').text(title);\n}", "title": "" }, { "docid": "eccca584c84bc799944785f94e5daae1", "score": "0.6044163", "text": "updateTitle() {\n this.title.text = this.window.title;\n }", "title": "" }, { "docid": "90dd65fc40aaa631e92b00e07b1731b1", "score": "0.6040003", "text": "function beginSite(){\n setTimeout(function(){\n currentSlide++\n show(about)\n setTimeout(function(){\n andrewrussell.style.opacity = 1\n bio.style.opacity = 1\n showArrow()\n }, 750)\n }, 50)\n}", "title": "" }, { "docid": "07328d3a64a61a0481bbc51486719041", "score": "0.6029698", "text": "function intro() {\n // Hide the start button\n $('.start').hide();\n // Fade in 'Alice'\n $('h1').delay(200).fadeIn('slow');\n // Fade in 'Your Virtual Assistant'\n $('h2').delay(800).fadeIn('slow');\n // Fade in 'My name is _____'\n $('.instructions').delay(5000).fadeIn('slow');\n // Alice introduces herself\n responsiveVoice.speak('Welcome, my name is Alice. I am your virtual assistant. To get started, please say your name.', 'UK English Female');\n}", "title": "" }, { "docid": "ef982eeb53751b43d5d334e99c840dcf", "score": "0.6029545", "text": "function setPageTitle() {\n const title = document.getElementById('title');\n title.innerText = pageTitle;\n}", "title": "" }, { "docid": "29b1161f4a5f7e9df01faa2aea2f0ea8", "score": "0.60113865", "text": "function setEmployeeTitle() {\n console.info('setTitle')\n $('#title').html('Medewerker instellingen')\n $('#subtitle').html('Voeg hier medewerker toe')\n}", "title": "" }, { "docid": "7faaac6ffe3b5ca56011269198a95e01", "score": "0.60079485", "text": "function setPageTitle() {\n let title = document.getElementById('title');\n title.innerText = pageTitle;\n}", "title": "" }, { "docid": "ea8d7c5a6bdeafb51c91c855c4fa7e8d", "score": "0.6005581", "text": "function setPageTitle() {\n document.getElementById('profile-email').innerText = 'Email: ' + parameterUsername;\n document.title = parameterUsername + ' - Profile Page';\n}", "title": "" }, { "docid": "42e75eee65788b0848be345f6b8cf586", "score": "0.60000277", "text": "function showStartTitle() {\n hideYAxis();\n hideXAxis();\n g.selectAll('.bbt-section')\n .transition()\n .duration(0)\n .attr('opacity', 0);\n\n g.selectAll('.openvis-title')\n .transition()\n .duration(600)\n .attr('opacity', 1.0);\n }", "title": "" }, { "docid": "0036729e6a8713e02508360775ff424a", "score": "0.59972477", "text": "function setPageTitle(title) {\n document.title = title;\n}", "title": "" }, { "docid": "e8497e4401a58996591077af793f23c6", "score": "0.59936005", "text": "function ShowHomeContents(){\n\t\t$('.menu-container, .logo, .countdown-container').removeClass('entrance').addClass('fadeInDown');\n\t\t$('.home-title, .wordsrotator-container').removeClass('entrance').addClass('fadeInUp');\n\t\t$('.keyboard-guide').removeClass('entrance').addClass('fadeInUpCenterX');\n\t\t$('.social-media-container a').each(function(index, element) {\n $(this).removeClass('entrance').addClass('bounceIn');\n });\n\t}", "title": "" }, { "docid": "eeb1398496088d2318679b8314e84b78", "score": "0.59927535", "text": "function setTitle(title) {\n const element = document.querySelector('.title-sec-cur')\n element.innerHTML = title\n }", "title": "" }, { "docid": "de261876fc1292ff6be6ae8c7cf70e84", "score": "0.5967907", "text": "function pageTitle($rootScope, $timeout, $transitions) {\n\treturn {\n\t\tlink : function(scope, element) {\n\t\t\t$transitions.onSuccess({\n\t\t\t\tto : '**'\n\t\t\t}, function(trans) {\n\t\t\t\tvar current = trans.router.globals.current;\n\t\t\t\tvar title = \"后台管理\";\n\t\t\t\tif (angular.isDefined(current.data)\n\t\t\t\t\t\t&& angular.isDefined(current.data.pageTitle)) {\n\t\t\t\t\ttitle = current.data.pageTitle;\n\t\t\t\t}\n\t\t\t\telement.text(title);\n\t\t\t});\n\t\t}\n\t}\n}", "title": "" }, { "docid": "88a62fbf9fa2b153e4a4a17320bc7c2c", "score": "0.5964325", "text": "function FadeInPageContent() {\n $(\"#placeholder\").hide();\n\n $(\"#placeholder\").fadeIn(300);\n}", "title": "" }, { "docid": "f6a7cf93f9762db9570438d258e4ef65", "score": "0.5962482", "text": "function addTitle(title){\n\tif(title=='[church_name]'){\n\t\tvar title = \"<span class='churchName'>\" + globJson.church.name + \"</span>\";\n\t}else{\n\t\tvar title = title;\n\t}\n\t$('.pageTitle').html(title);\n}", "title": "" }, { "docid": "ff47a9f2bcccee2d0c92256f994083a6", "score": "0.59585655", "text": "function aboutPageInit() {\n scrollPageAnimate();\n \n}", "title": "" }, { "docid": "2deaa8d3fc74b2f15fd10cb124540663", "score": "0.5949426", "text": "function showAbout() {\n aboutPage.style.display = \"block\";\n contactPage.style.display = \"none\";\n portfolioPage.style.display = \"none\";\n changeCSS('css/style.css', 1, 'images/background-tech-07.jpg');}", "title": "" }, { "docid": "979d356f8bfe81d8c34ad68e482d49b5", "score": "0.5948873", "text": "function showSplash(delay)\n\t{\n\t\t// Open ajax request for the splash.html page\n\t\t$.ajax({\n\t\t\t url: \"splash.html\",\n\t\t\t dataType: \"html\",\n\t\t\t success: function(data) \n\t\t\t { \n\t\t\t\t // Change the container content with effect\n\t\t\t\t $('#container').html(data).delay(delay).fadeOut(400, function() {\n\t\t\t\t \t // Show the header\n\t\t\t\t\t $(\"#header\").show();\n\t\t\t\t\t \n\t\t\t\t\t // Load the content of the page\n\t\t\t\t\t showContent(1000); \n\t\t\t\t });\n\t\t\t }\n\t\t\t});\n\t}", "title": "" }, { "docid": "4e8a1cb9b7646fa7e51091b50af223ca", "score": "0.5945529", "text": "function titleChange() { updateVis(); }", "title": "" }, { "docid": "74b97206a3022bd4cfc4d66900d5508d", "score": "0.59290564", "text": "function changeTitle(page1, page2) {\n if (findLocation() === page1) {\n document.title = 'Webprogramming (LIX019P05) - Index';\n } else if (findLocation() === page2) {\n document.title = 'Webprogramming (LIX019P05) - Second';\n }\n}", "title": "" }, { "docid": "81952901a68cd1d419da7de1ba4b246a", "score": "0.59271306", "text": "function setPageTitle() {\n\n let title = document.getElementById(`title`);\n\n title.innerText = pageTitle;\n}", "title": "" }, { "docid": "9e1873e1f644f9c8634bacd8756a5554", "score": "0.59271306", "text": "function setPageTitle(){\r\n\r\n const title = document.getElementById('title');\r\n title.innerText = pageTitle;\r\n}", "title": "" }, { "docid": "1562f574b7655ae5fa5255a748d9a32f", "score": "0.59267306", "text": "function showAnimAboutusHeading () {\n const lineFirstLeft = document.querySelector('.heading-aboutus__line-left');\n const lineFirstRight = document.querySelector('.heading-aboutus__line-right');\n const firstHeading = document.querySelector('.heading-aboutus__heading');\n\n if(window.scrollY >= lineFirstLeft.scrollHeight + 220) {\n lineFirstLeft.style.animation = 'bounce-left 1s';\n lineFirstLeft.style.animationIterationCount = '1';\n lineFirstLeft.style.opacity = '1';\n\n lineFirstRight.style.animation = 'bounce-right 1s';\n lineFirstRight.style.animationIterationCount = '1';\n lineFirstRight.style.opacity = '1';\n \n firstHeading.style.opacity = '1';\n } else {\n lineFirstLeft.style.animation = null;\n lineFirstRight.style.animation = null;\n lineFirstLeft.style.opacity = '0';\n lineFirstRight.style.opacity = '0'; \n firstHeading.style.opacity = '0';\n };\n }", "title": "" }, { "docid": "242186a808ec9d0e299b2cb6f9d3f68f", "score": "0.5918994", "text": "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) {\n\t\treturn;\n\t}\n\n\tif( $('#title-meta').length == 0 ) {\n\t\treturn;\n\t}\n\n\tvar newTitle = $('#title-meta').html();\n\tif( skin == \"oasis\" ) {\n\t\t$('header.WikiaPageHeader > h1').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html() + ';');\n\t} else {\n\t\t$('.firstHeading').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('.firstHeading').attr('style','text-align:' + $('#title-align').html() + ';');\n\t}\n}", "title": "" }, { "docid": "2ba7c1192d15734992c6006127a91cb2", "score": "0.59147274", "text": "function updateTitle(){\n var appname = \"platform chat\";\n if (CONFIG.unread) {\n document.title = \"(\" + CONFIG.unread.toString() + \") \"+ appname;\n } else {\n document.title = appname;\n }\n }", "title": "" }, { "docid": "9a2c083c36780337927244b26fa7b314", "score": "0.5913552", "text": "function homeline_about_us_page() {\n\t\tif ( !( $( 'body' ).hasClass( 'about-us-page' ) ) ) return false;\n\n\t\t$( '.counter-value' ).counterUp( {\n\t\t\tdelay: 10,\n\t\t\ttime: 1000\n\t\t} );\n\t}", "title": "" }, { "docid": "2e6e23f299ec8272411292138dd32e3d", "score": "0.59088284", "text": "function setTitle(title) {\n document.querySelector('h1').innerHTML = title;\n}", "title": "" }, { "docid": "488daee044a07933c49bfd6264039ebc", "score": "0.59003043", "text": "function tooltipTitreOn (pObjet, pEvenement, pTitre, pLibelle)\n{\n domTT_activate (pObjet, pEvenement, 'caption', pTitre, 'content', pLibelle, 'trail', true, 'fade', 'in') ;\n}", "title": "" }, { "docid": "d90f2c9a6a0ccb0dcbecd98e435d494c", "score": "0.58997977", "text": "switchTitle() {\n\t\tif (this.state.switchView === true) {\n\t\t\treturn 'Your Top Artists'\n\t\t} else {\n\t\t\treturn 'Your Top Tracks'\n\t\t}\n\t}", "title": "" }, { "docid": "78dee0be472a0517510c0ec5a09eb4da", "score": "0.58938825", "text": "function update_title(content)\n{\n let title = $('title');\n\n let update = title.html();\n let uPos = update.search(' - ');\n\n if (uPos !== -1) {\n update = content + update.substr(uPos);\n $(title).html(update);\n }\n}", "title": "" }, { "docid": "daadd86da3cb6c771039bd744bae6e5b", "score": "0.5893803", "text": "title(newTitle) {\n store.commit(\"setupSearch\", { show: false });\n store.commit(\"setupSlide\");\n store.commit(\"setPageTitle\", newTitle);\n store.commit(\"setPageFluid\", false);\n return SetupPage;\n }", "title": "" }, { "docid": "a3e8544420b0096bacfe03c0d35d3877", "score": "0.5888099", "text": "function setCategoryTitle() {\n $('#title').html('Cattegorie instellingen')\n $('#subtitle').html('Stel hier de waarde in waarop gegroepeerd op de gevonden resultaten van uw social media kanalen')\n}", "title": "" }, { "docid": "dc5badf95050dcbbbf148395147fadca", "score": "0.5887647", "text": "function update_page_title() {\n if ($scope.params.status_message === $scope.defaults.messages.failed) {\n $window.document.title = 'Search failed';\n } else if ($scope.params.search_in_progress) {\n $window.document.title = 'Searching...';\n } else if ($scope.params.status_message === $scope.defaults.messages.done) {\n $window.document.title = 'Search done';\n } else {\n $window.document.title = 'Sequence search';\n }\n }", "title": "" }, { "docid": "4034f5bf09e28ddaf97ef7ac1ec0ca3a", "score": "0.58846354", "text": "function titleScreen(){\n btnTitle.run();\n btnEasy.run();\n btnMed.run();\n btnHard.run();\n }", "title": "" }, { "docid": "3ed1a3bac3ef129657841dc748ec01dc", "score": "0.5882736", "text": "function contentFadeIn() { \n $(\".titleBox\").css({ opacity: 0 }, 1).show().animate({ opacity: 1 }, 1000);\n $(\"#profileImage\").animate({ opacity: 1 }, 1000);\n $(\"#progressBarArea\").animate({ opacity: 1 }, 1000);\n $(\"#bodyText\").css({ marginTop: \"40px\" }).animate({ marginTop: \"10px\", opacity: 1 }, 1000);\n}", "title": "" }, { "docid": "1733e53aadb8bc865c2b6e33c0de9f78", "score": "0.5869718", "text": "function setPageTitle() {\n\n document.title = parameterUsername + ' - User Page';\n document.getElementById('page-title').innerText = parameterUsername;\n\n const url = '/about?user=' + parameterUsername;\n fetch(url).then((response) => {\n return response.json();\n }).then((user) => {\n if (user.name) {\n document.getElementById('page-title').innerText = user.name;\n document.title = user.name + ' - User Page';\n\n }\n\n })\n\n}", "title": "" }, { "docid": "f1227b786227182adeb242de23d23a48", "score": "0.58687437", "text": "function instructions(){\n\t\t$('.intro').show();\n\t\t$('.wrapper').fadeOut;\n\t\t$('.intro').animate({\n\t\t\topacity: 1\n\t\t}, 850);\n\t\t$('.intro').css(\"z-index\", \"4\");\n\t}", "title": "" }, { "docid": "7f454e5d72db11777457723fa3bd9940", "score": "0.58660114", "text": "function upChangeText(){\n\t$('.aboutText').css('display','block');\n\n\t$('.text').fadeIn(150); \n\t$('.resumeText').hide();\n\t$('.contactText').hide();\n\t$('.projectsText').hide();\n}", "title": "" }, { "docid": "1bba02fb7698da32b770a2daec741130", "score": "0.5862154", "text": "function setup() {\r\n $ = jQuery = window.jQuery;\r\n\r\n title = $('title');\r\n\r\n \r\n // Sets updated title every ~5000ms.\r\n //--------------------\r\n (function runTimer() {\r\n setTimeout(function () {\r\n setTitle();\r\n runTimer();\r\n }, 5000);\r\n })();\r\n }", "title": "" }, { "docid": "99bc82c359f2d70450d2a5ad35f4e6d8", "score": "0.585997", "text": "function New_Title () {\ndocument.querySelector(\"#title1\").style.display = \"none\";\ndocument.querySelector(\"#title2\").style.color = \"white\";\n}", "title": "" }, { "docid": "8e098c09d7d3c7a4acd8005a3d2d4e6a", "score": "0.58594936", "text": "function activate() {\n\t\t\tappState.pageTitle = \"Home\";\n\t\t}", "title": "" }, { "docid": "3a539999bee618a7ec24e2ddc6ad358c", "score": "0.5856241", "text": "handleSetPageTitle(name) {\n document.title = `${name} / Mass Effect Checklist`;\n }", "title": "" }, { "docid": "c2dca4d90856b76c1f58159c2b726d70", "score": "0.5851023", "text": "function showHome() {\n hideHome(notHide=true)\n setTitle('')\n destroyFrame()\n }", "title": "" }, { "docid": "7767933def76fed0aab0afbedf4dca0b", "score": "0.5848741", "text": "function readyNow(){\n $('h1').text('Tier 2, next week!'); //reference H1, set the text to:\n //put in any quick handlers, any setup, etc\n}", "title": "" }, { "docid": "eb68083b00031bf03db5367dc4150e06", "score": "0.5847977", "text": "function fadeTitleOut() {\n if (document.getElementsByClassName('active-content')[0]) {\n let activeC = document.getElementsByClassName('active-content')[0];\n activeC.style.opacity = '0';\n activeC.classList.remove(\"active-content\");\n }\n}", "title": "" }, { "docid": "b940d3a96e1986c9466398c8bec1c8fc", "score": "0.5842995", "text": "function setTitle(t) {\n\t$(\"#vizTitle\").html(t);\n\tdocument.title = \"See UK :: \" + t.replace('&amp;', '&');\n}", "title": "" }, { "docid": "ec74b449ae7d1eb6c296ea4e7ab9639a", "score": "0.5837247", "text": "function titleLesen(string) { \n\tvar title = document.title;\n\tdocument.getElementById(string).innerHTML = title;\n}", "title": "" }, { "docid": "32e3df2c0d31f8b9a361396a8b2f4a9d", "score": "0.5837102", "text": "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) {\n\t\treturn;\n\t}\n\n\tif( $('#title-meta').length == 0 ) {\n\t\treturn;\n\t}\n\n\tvar newTitle = $('#title-meta').html();\n\t$('header.WikiaPageHeader > h1').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t$('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html() + ';');\n}", "title": "" }, { "docid": "66d757998de26ef2f3d5ae15af02cf12", "score": "0.58186495", "text": "function updateTitle() {\n document.title = Math.floor(GmB.cantidad) + \" GmB - Gummy Bears\";\n}", "title": "" }, { "docid": "dc014104e5b731ef37c01c9556d8c29a", "score": "0.58162284", "text": "function setTitle(title) {\n UI.find(\"title\").innerText = title;\n}", "title": "" } ]
08e9607815fa04b366aa7c5451eb5bb7
List of Intents functions Fallback Intent Start
[ { "docid": "7544e60d980ba50d259fbf0c10317507", "score": "0.0", "text": "function fallback(agent) {\n agent.add(`I'm sorry, can you try again?`);\n }", "title": "" } ]
[ { "docid": "5851b1436e55f7ddd47ddc613f5023f1", "score": "0.5614732", "text": "'AMAZON.FallbackIntent'(){\n this.ask(\"sorry i did not under stand that, please try again, or ask something else\");\n }", "title": "" }, { "docid": "e1a79cde25b1442bbe5b321a65b63c6c", "score": "0.52685565", "text": "function AlbedoIntent() {\n}", "title": "" }, { "docid": "26ea58c7e859625a365faae57dc8f24c", "score": "0.5260063", "text": "getIntentFromInteractions() {\n let intent = null;\n //Reverse the array - that way we pick up any new intent changes\n let reversedInteractions = this.interactions.slice().reverse();\n reversedInteractions.some(interaction => {\n if (interaction.type === 'message') {\n return false;\n }\n\n //Gets the first intent - presumably highest coincidence\n //This will break if we wish to handle multiple intents.\n if (interaction.data && interaction.data.entities && interaction.data.entities.intent) {\n intent = interaction.data.entities.intent[0].value;\n return true;\n }\n });\n\n // //Make sure that the intent is defined for the service\n // if (this.getPossibleIntents().indexOf(intent) === -1) {\n //\n // return rejectError(400, `Found intent: ${intent} not found on service with serviceId: ${this.serviceId}.`, false);\n // }\n\n return intent;\n }", "title": "" }, { "docid": "e0482264f1b34ddb54cbdbc83cfe3462", "score": "0.506242", "text": "async dispatchToTopIntentAsync(context, intent, recognizerResult) {\n switch (intent) {\n case 'Lebenslauf':\n await context.sendActivity(`Grundschule`);\n await context.sendActivity(`Realschule`);\n await context.sendActivity(`weiterführendes Gymnasium`);\n await context.sendActivity(`HfG Schwäbisch Gmünd`);\n break;\n case 'Hobbies':\n await context.sendActivity(`Meine Hobbys sind:`);\n await context.sendActivity(`Fußball schauen und spielen,`);\n await context.sendActivity(`Gitarre spielen und singen`);\n break;\n case 'Sprachen':\n await context.sendActivity(`Ich Spreche:`);\n await context.sendActivity(`Englisch,`);\n await context.sendActivity(`Deutsch`);\n await context.sendActivity(`Und Spanisch.`);\n break;\n case 'Programmiersprachen':\n await context.sendActivity(`Durch die Uni habe ich:`);\n await context.sendActivity(`Java Script,`);\n await context.sendActivity(`PHP,`);\n await context.sendActivity(`Und die Arduino IDE gelernt!`);\n await context.sendActivity(`Aber auch mit Datenbanken also MySql hatte ich dort schon zu tun.`);\n break;\n case 'Programme':\n await context.sendActivity(`Ich kenne mich mit folgender Software aus:`);\n await context.sendActivity(`Adobe XD,`);\n await context.sendActivity(`Photoshop CC,`);\n await context.sendActivity(`Sketch`);\n await context.sendActivity(`Und allen Microsoft Programmen`);\n break;\n case 'EntwurfTools':\n await context.sendActivity(`In Entwurf Grundlagen 2 haben wir hauptsächlich mit Adobe XD gearbeitet.`);\n await context.sendActivity(`Damals war das Teamwork Feature noch ganz neu und auch noch nicht so stabil. Häufig haben wir Zwischenstände deswegen verloren.`);\n break;\n case 'EntwurfAufgabe':\n await context.sendActivity(`Die Kühlschrank App ist das Ergebnis des Fachs 'Entwurf Grundlagen 2'. Die Aufgabenstellung hierfür war relativ eng gehalten.`);\n await context.sendActivity(`Wir hatten einen Funktionsumfang der erreicht werden sollte. Die nötigen Funktionen waren:\n \\n - Einsehen welche Nahrungsmittel sich im Kühlschrank befinden\n \\n - Es musste möglich sein Einstellungen am Kühlschrank zu ändern\n \\n - Mindestens eine Benachrichtigung sollte designt werden. \n \\n Außerdem wurde es uns frei gehalten zusärtzliche Funktionen einzubauen.`);\n break;\n case 'EntwurfAufteilung':\n await context.sendActivity(`Eigentlich haben wir an allem gemeinsam gearbeitet. Auch wenn sich die Team Arbeit nicht immer einfach dargestellt hat da man sich bei Formen und Farben sehr oft abstimmen musste, sind wir mit dem Endergebnis sehr zufrieden.`);\n break;\n default:\n console.log(`Dispatch unrecognized intent: ${ intent }.`);\n await context.sendActivity(`Da weiß ich leider nicht weiter\n \\nSie könnten mich aber zum Beispiel nach folgenden Sachen fragen:\n \\n - 'Programmiersprachen und Software'\n \\n - 'Sprachen und Eigenschaften'\n \\n - 'Projekten auf dieser Seite' oder 'meinem Lebenslauf'.`);\n break;\n }\n }", "title": "" }, { "docid": "51bdc587bfc6ae933c694e24772681b0", "score": "0.50417155", "text": "function identifyIntent(message) {\n var intent = []\n if (isScoresPrompt(message)) {\n intent.push(\"scores\")\n }\n if (isCalendarPrompt(message)) {\n intent.push(\"calendar\")\n }\n if (isMockingPrompt(message)) {\n intent.push(\"mocking\")\n }\n if (isAggressiveMockingPrompt(message)) {\n intent.push(\"aggressive\")\n }\n return intent;\n}", "title": "" }, { "docid": "b884775cde48485a9bd830b0f3c82a1f", "score": "0.49742788", "text": "triggerActions(id, ACTIONS) {\r\n if (!ACTIONS) {\r\n return\r\n }\r\n\r\n let actions = this.currentOptions\r\n .filter(option => option.id === id)\r\n .map(option => option.action)\r\n\r\n actions.push(this.current.getAttribute(\"then\"))\r\n\r\n actions\r\n .map(action => ACTIONS[action]) //map to functions\r\n .filter(action => typeof action === \"function\") //filter non-functions\r\n .filter((action, i, list) => list.indexOf(action) === i) //filter duplicates\r\n .forEach(action => action()) //trigger actions\r\n }", "title": "" }, { "docid": "a20ab092ecb4621437311c57fe6806ff", "score": "0.49360332", "text": "function onIntent(intentRequest, session, callback) {\n\n var intent = intentRequest.intent\n var intentName = intentRequest.intent.name;\n\n // dispatch custom intents to handlers here\n if (intentName == \"findDerivativeIntent\") \n {\n \n handlefindDerivativeIntent(intent, session, callback)\n \n }\n else if (intentName == \"findDerivativeIntentConstant\") \n {\n \n handlefindDerivativeIntentConstant(intent, session, callback)\n \n }\n \n else if (intentName == \"findDerivativeIntentConstantPlusX\") \n {\n \n handlefindDerivativeIntentConstantPlusX(intent, session, callback)\n \n }\n else if (intentName == \"findDerivativeIntentConstantXPlus\")\n {\n handlefindDerivativeIntentConstantXPlus(intent,session,callback)\n }\n else if (intentName == \"findCon\")\n {\n handlefindCon(intent,session,callback)\n }\n else if (intentName == \"AMAZON.StopIntent\")\n {\n callback(session.attributes,buildSpeechletResponse(\"Derive Me!\",\"GOOD BYE! Come back again by telling Alexa, start Derive Me!\", \"\", true))\n\n }\n else if (intentName == \"AMAZON.HelpIntent\")\n {\n getTutorial(callback);\n }\n \n else \n {\n throw \"Invalid Intent\"\n }\n}", "title": "" }, { "docid": "c840ac54867b74d3cc8306e1339bf0af", "score": "0.49165633", "text": "function startActivityListeners() {\n $('a.do-btn').click(function (){\n var activity = $(this).data('activity-id');\n\n var completion = {\n activity: parseInt(activity)\n };\n\n var options = {\n data: { completion: JSON.stringify(completion) }\n };\n\n $.request('onComplete', options);\n // Prep and send analytics event\n var label = 'Generic';\n var recommendation = $(this).parents('.rover-activity-list-item').data('recommendation');\n if (recommendation == 1) {\n label = 'Recommendation';\n }\n sendAnalyticsEvent('Activity', 'Complete', label);\n\n return false;\n });\n\n $('a.ignore-btn').click(function() {\n var activity = $(this).data('activity-id');\n\n var rating = {\n activity: parseInt(activity),\n rating: 0\n };\n\n var options = {\n data: { rating: JSON.stringify(rating) }\n };\n\n $.request('onRate', options);\n \n // Prep and send analytics event\n var label = 'Generic';\n var recommendation = $(this).parents('.rover-activity-list-item').data('recommendation');\n if (recommendation == 1) {\n label = 'Recommendation';\n }\n sendAnalyticsEvent('Activity', 'Hide', label);\n\n return false;\n });\n\n $('a.unignore-btn').click(function() {\n var activity = $(this).data('activity-id');\n\n var options = {\n data: { activity: parseInt(activity) }\n };\n\n $.request('onUndoHide', options);\n\n // Prep and send analytics event\n var label = $(this).parents('.rover-activity-list-item')\n .find('.details h3')\n .html();\n sendAnalyticsEvent('Activity', 'Unhide', label);\n\n return false;\n });\n }", "title": "" }, { "docid": "61ffd8f2c9dc9e619af58908941910a7", "score": "0.4913277", "text": "getLocalActions() {\n\t\tlet res = [];\n\t\tthis.actions.forEach((entry, key) => {\n\t\t\tlet endpoint = entry.getLocalEndpoint();\n\t\t\tif (endpoint)\n\t\t\t\tres.push(omit(endpoint.action, [\"handler\", \"service\"]));\n\t\t});\n\t\treturn res;\n\t}", "title": "" }, { "docid": "f2ef480907674451f7056cf87ec71165", "score": "0.48194295", "text": "function onIntent(intentRequest, session, callback) {\n console.log(\"onIntent requestId=\" + intentRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n var intent = intentRequest.intent,\n intentName = intentRequest.intent.name;\n\n console.log(\"Dispatching\", intentName);\n\n // dispatch custom intents to handlers here\n if (\"IngredientList\" === intentName) {\n getSpecifiedIngredients(intent, session, callback);\n } else if (\"TimeConstraint\" === intentName) {\n getTimeRestriction(intent, session, callback);\n } else if (\"CuisineFilter\" === intentName) {\n getCuisineType(intent, session, callback);\n } else if (\"MealFilter\" === intentName) {\n getMealType(intent, session, callback);\n } else if (\"DietaryConstraint\" === intentName) {\n getDietaryRestrictions(intent, session, callback);\n } else if (\"RatingFilter\" === intentName) {\n getRating(intent, session, callback);\n } else if (\"ListRecipies\" === intentName) {\n listRecipies(intent, session, callback);\n } else if (\"StartReading\" === intentName) {\n // todo change\n if (session.attributes && session.attributes.hasChosenRecipie) {\n session.attributes.inStepsMode = true;\n // read steps\n readSteps(intent, session, callback);\n }\n else if (session.attributes && !session.attributes.filterEntryMode) {\n // read recipies\n listRecipies(intent, session, callback);\n }\n } else if (\"NoIntent\" === intentName) {\n handleNo(intent, session, callback);\n } else if (\"YesIntent\" === intentName) {\n handleYes(intent, session, callback);\n } else if (\"NextStep\" === intentName) {\n nextStep(intent, session, callback);\n } else if (\"LastStep\" === intentName) {\n lastStep(intent, session, callback);\n } else if (\"SubmitRecipe\" === intentName) {\n handleWebChoice(intent, session, callback);\n } else if (\"HelpIntent\" === intentName) {\n handleGetHelpRequest(intent, session, callback);\n } else if (\"StartOver\" === intentName) {\n handleRestartActivity(intent, session, callback);\n } else if (\"MainMenuIntent\" === intentName) {\n getWelcomeResponse(callback);\n } else {\n getWelcomeResponse(callback);\n }\n}", "title": "" }, { "docid": "52f01c15424b892187dfac18b979258f", "score": "0.47396177", "text": "function getIntent(witEntities) {\n if(isGreeting(witEntities)) {\n return INTENTS.GREETING;\n }\n\n if(isBye(witEntities)) {\n return INTENTS.BYE;\n }\n\n // Find most confident intent\n\n // If nothing return unknown\n return INTENTS.UNKNOWN;\n}", "title": "" }, { "docid": "65cf6aaf5e6f3a5db02f482c9c526f66", "score": "0.47332343", "text": "function onIntent(intentRequest, session, callback) {\r\n var intent = intentRequest.intent;\r\n var intentName = intentRequest.intent.name;\r\n\r\n\r\n// Decode which handler to call based on intent\r\n if (\"turn\" == intentName) {\r\n handleTurnIntent(intent, session, callback);\r\n } else if (\"gate\" == intentName) {\r\n handleGateIntent(intent, session, callback);\r\n } else if (\"done\" == intentName) {\r\n handleExitIntent(intent, session, callback);\r\n } else if (\"AMAZON.CancelIntent\" == intentName) {\r\n handleExitIntent(intent, session, callback);\r\n } else if (\"AMAZON.HelpIntent\" == intentName) {\r\n handleHelpIntent(intent, session, callback);\r\n } else if (\"AMAZON.StopIntent\" == intentName) {\r\n handleExitIntent(intent, session, callback);\r\n } else {\r\n throw \"Invalid intent\";\r\n }\r\n}", "title": "" }, { "docid": "2661f9ca4c897d6913361d3b3017ea3c", "score": "0.47243896", "text": "function onIntent(req, session, callback) {\n // console.log(`onIntent requestId=${req.request.requestId}, sessionId=${session.sessionId}`);\n\nconsole.log(\"---------request-------------\",req);\n //const intent = req.request.intent;\n const intentName = req.request.intent.name;\n\n\n // Dispatch to your skill's intent handlers\n if (intentName === 'more') {\n\t getFunfactResponse(req, session, callback);\n }else if (intentName === 'start') {\n\t getFunfactResponse(req, session, callback);\n\t}else if (intentName === 'somethingElse') {\n getFallbackResponse(req, session, callback); \n }else if (intentName === 'AMAZON.RepeatIntent') {\n getRepeatResponse(req, session, callback);\n }else if (intentName === 'AMAZON.FallbackIntent') {\n getFallbackResponse(req, session, callback);\n }else if (intentName === 'AMAZON.HelpIntent') { \n getHelpResponse(req, session, callback);\n } else if (intentName === 'AMAZON.StopIntent' || intentName === 'AMAZON.CancelIntent') {\n handleSessionEndRequest(callback);\n } else {\n throw new Error('Invalid intent');\n }\n}", "title": "" }, { "docid": "7cac96272e185f58ad6d169aa42054b3", "score": "0.47193006", "text": "function importStartAutomated() {\n \n}", "title": "" }, { "docid": "36a93dcb3f98de59d1092d45cd5f8683", "score": "0.46815154", "text": "componentWillMount() {\r\n this.props.startActivityDetection();\r\n }", "title": "" }, { "docid": "04171931aea3e157cdb6b4ab24a73a75", "score": "0.46427324", "text": "function runActions(){\n switch(actions){\n case 'concert-this':\n shows();\n break;\n case 'spotify-this-song':\n spotify();\n break;\n case 'movie-this':\n movie();\n break;\n\n default:\n console.log('Search for something..');\n }\n}", "title": "" }, { "docid": "c6b4dd70eb9686adc0ea7a7b91b5b835", "score": "0.46189353", "text": "function intentDispatch(req,res,cb){\n var intentName = req.body.request.intent.name;\n var responder = require('./responseBuilder');\n\n var exceptions = [\"AMAZON.LoopOffIntent\",\"AMAZON.LoopOnIntent\",\"AMAZON.RepeatIntent\",\"AMAZON.ShuffleOffIntent\",\"AMAZON.ShuffleOnIntent\",\"AMAZON.StartOverIntent\"];\n if(exceptions.indexOf(intentName)!=-1){throw \"Sorry <break time='0.5s'/> I can't do that.\";return;}\n\n switch(intentName){\n\n case \"getRadioTrack\":\n responder.trackRespond(req,res,cb);\n break;\n case \"getRadioStream\":\n responder.streamPlayRespond(req,res,cb);\n break;\n case \"AMAZON.PauseIntent\":\n responder.streamStopRespond(req,res,cb);\n break;\n case \"AMAZON.CancelIntent\":\n responder.streamStopRespond(req,res,cb);\n break;\n case \"AMAZON.PreviousIntent\":\n responder.streamGenreRespond(-1,req,res,cb);\n break;\n case \"AMAZON.NextIntent\":\n responder.streamGenreRespond(1,req,res,cb);\n break;\n case \"AMAZON.HelpIntent\":\n responder.simpleSpeechRespond(\"The shoutcas skill allows you to listen to any music registered at shoutcast.com. Try <break time='0.5s' /><emphasis level='reduced'>Alexa, ask shoutcast to start <emphasis>pandashowradio</emphasis></emphasis> <break time='0.5s' /> or <break time='0.5s' /> <emphasis level='reduced'>Alexa, ask shoutcast what song is <emphasis>jazz and lounge station</emphasis> playing</emphasis> <break time='1s' />If you don't know any radio station<break time='0.5s'/> try <break time='0.5s' /><emphasis level='reduced'>Alexa, ask shoutcast to play rock songs</emphasis>\",req,res,cb);\n break;\n case \"AMAZON.ResumeIntent\":\n responder.streamResumeRespond(req,res,cb);\n break;\n case \"AMAZON.CancelIntent\":\n responder.streamStopRespond(req,res, cb);\n break;\n case \"getRadioGenre\":\n responder.streamGenreRespond(0,req,res,cb);\n break;\n default:\n throw \"Sorry <break strength='medium'/> I can't do that.\";\n break;\n }\n\n}", "title": "" }, { "docid": "fd1d434f393610227907b0328384e091", "score": "0.46138474", "text": "async NoIntent(){\n\t\t\tthis.say(`Ok. Let's start over.`)\n\t\t\treturn await this.toIntent('OnboardCustomerSlots.START')\n\t\t}", "title": "" }, { "docid": "35a97290e522181d96a3eb58e7e562f3", "score": "0.4613449", "text": "function intentClass(intent) {\n if (intent == null || intent === _intent__WEBPACK_IMPORTED_MODULE_2__[\"Intent\"].NONE) {\n return undefined;\n }\n return NS + \"-intent-\" + intent.toLowerCase();\n}", "title": "" }, { "docid": "d54eb208b1c20ff37c79416ab8fd74ae", "score": "0.4607908", "text": "function initiateIntentHandling() {\n var currentResponsePayloadSetter = Api.setWatsonPayload;\n Api.setWatsonPayload = function(payload) {\n currentResponsePayloadSetter.call(Api, payload);\n intentHandler(payload);\n };\n }", "title": "" }, { "docid": "ba866eea08506703fc07575e7f9aa130", "score": "0.4586563", "text": "function isFallbackCompositionStart(domEventName,nativeEvent){return domEventName==='keydown'&&nativeEvent.keyCode===START_KEYCODE;}", "title": "" }, { "docid": "ba866eea08506703fc07575e7f9aa130", "score": "0.4586563", "text": "function isFallbackCompositionStart(domEventName,nativeEvent){return domEventName==='keydown'&&nativeEvent.keyCode===START_KEYCODE;}", "title": "" }, { "docid": "ba866eea08506703fc07575e7f9aa130", "score": "0.4586563", "text": "function isFallbackCompositionStart(domEventName,nativeEvent){return domEventName==='keydown'&&nativeEvent.keyCode===START_KEYCODE;}", "title": "" }, { "docid": "b27a52baa870535d979eb928307c367d", "score": "0.45405513", "text": "function navigationStartingEvent(evt) {\r\n if (handleCordovaExecCalls(evt)) {\r\n evt.stopImmediatePropagation();\r\n evt.preventDefault();\r\n return;\r\n }\r\n\r\n if (evt.uri && evt.uri !== \"\") {\r\n var isInWhitelist = false;\r\n for (var i = 0; i < _whiteList.length; i++) {\r\n var rule = _whiteList[i];\r\n if (rule.test(evt.uri)) {\r\n isInWhitelist = true;\r\n break;\r\n }\r\n }\r\n\r\n // if the url to navigate to does not match any of the rules in the whitelist, open it outside de app\r\n if (!isInWhitelist) {\r\n evt.stopImmediatePropagation();\r\n evt.preventDefault();\r\n console.log(\"Whitelist rejection: url='\" + evt.uri + \"'\");\r\n Windows.System.Launcher.launchUriAsync(new Windows.Foundation.Uri(evt.uri));\r\n }\r\n }\r\n}", "title": "" }, { "docid": "6bfe7e34f16d07a954ffca244ff67b0d", "score": "0.4539051", "text": "function ActionList() {}", "title": "" }, { "docid": "9f36ec338b3cea11eaaee5776ada3ff5", "score": "0.45378846", "text": "function onIntent(intentRequest, session, callback) {\n\n var intent = intentRequest.intent\n var intentName = intentRequest.intent.name;\n\n if (intentName == \"CheckAvailIntent\") {\n handleCheckAvailIntent(intent, session, callback)\n } else if (intentName == \"CheckFireIntent\") {\n handleCheckFireIntent(intent, session, callback)\n } else {\n throw \"Invalid intent\"\n }\n}", "title": "" }, { "docid": "8c88ab21de8ca45f97d5a6c0b3a983cd", "score": "0.45327568", "text": "run () {\n strings.setLocale(this.app.getUserLocale());\n /** @type {*} */\n const map = this;\n const action = this.app.getIntent();\n console.log(action);\n if (!action) {\n return this.app.ask(`I didn't hear a number. What's your guess?`);\n }\n map[action]();\n }", "title": "" }, { "docid": "407cfe06faeae06ad5a56aab65cc291b", "score": "0.4525304", "text": "function intentClass(intent) {\n if (intent == null || intent === _intent__WEBPACK_IMPORTED_MODULE_2__[/* Intent */ \"a\"].NONE) {\n return undefined;\n }\n return NS + \"-intent-\" + intent.toLowerCase();\n}", "title": "" }, { "docid": "ec103d3f9ce6ac8ba398b6adb4438a73", "score": "0.44989526", "text": "function start() {\n activityAllowed = true;\n }", "title": "" }, { "docid": "47c08987561099b3fad59a152ecdefb2", "score": "0.44956946", "text": "function onIntent(intentRequest, session, callback) {\n console.log(`onIntent requestId=${intentRequest.requestId}, sessionId=${session.sessionId}`);\nconst intent = intentRequest.intent;\n const intentName = intentRequest.intent.name;\n// Dispatch to your skill's intent handlers\n if (intentName === 'AMAZON.HelpIntent') {\n getWelcomeResponse(callback);\n } else if (intentName === 'AMAZON.StopIntent') {\n handleSessionEndRequest(callback);\n } else if (intentName === 'GetNewFactIntent') {\n getFactResponse(callback);\n } else if (intentName === 'CountdownIntent') {\n getCountdownResponse(callback);\n } else if (intentName === 'AMAZON.FallbackIntent'){\n getFallbackResponse(callback);\n }\n}", "title": "" }, { "docid": "9c53880630dd72939bf39a7410bfc72b", "score": "0.44930634", "text": "function onIntent(intentRequest, session, callback) {\n console.log(`onIntent requestId=${intentRequest.requestId}, sessionId=${session.sessionId}`);\n\n const intent = intentRequest.intent;\n const intentName = intentRequest.intent.name;\n console.log(\"Intent : \"+intent);\n console.log(\"Intent Name : \"+intentName);\n //these variables save the current intent names\n\n // Dispatch to your skill's intent handlers\n if (intentName === 'HelloWorldIntent') {\n sayHelloWorld(intent, session, callback);\n }\n else if (intentName === 'ConditionInquiryIntent') {\n sayConditionInquiry(intent, session, callback);\n }\n else if (intentName === 'TriggerDiagnosisIntent') {\n sayTriggerDiagnosis(intent, session, callback);\n }\n else if (intentName === 'DiagnosisSexInputIntent') {\n sayDiagnosisSexInput(intent, session, callback);\n }\n else if (intentName === 'DiagnosisAgeInputIntent') {\n sayDiagnosisAgeInput(intent, session, callback);\n }\n else if (intentName === 'DiagnosisSymptomInputIntent') {\n saySymptom(intent, session, callback);\n }\n else if (intentName === 'SatisfactoryIntent') {\n saySatisfactory(intent, session, callback);\n }\n /*else if (intentName === 'AMAZON.NoIntent') {\n onFeedbackFalse(callback);\n }\n else if (intentName === 'AMAZON.YesIntent') {\n onFeedbackTrue(callback);\n }*/\n else if (intentName === 'AMAZON.YesIntent') {\n getYesResponse(intent, session, callback);\n }\n else if (intentName === 'AMAZON.NoIntent') {\n getNoResponse(intent, session, callback);\n }\n else if (intentName === 'AMAZON.HelpIntent') {\n getHelpResponse(callback);\n }\n else if (intentName === 'AMAZON.StopIntent' || intentName === 'AMAZON.CancelIntent') {\n handleSessionEndRequest(callback);\n }\n else {\n throw new Error('Invalid intent');\n }\n}", "title": "" }, { "docid": "6abb1a4762f4663d4031795d8e0e9985", "score": "0.448386", "text": "function goLiri() {\n\n\tswitch(action){\n\tcase 'my-tweets':\n\tmyTweets();\n\tbreak;\n\n\tcase 'spotify-this-song':\n\tmySpotify();\n\tbreak;\n\n\tcase 'movie-this':\n\tmyMovie();\n\tbreak;\n\n\tcase 'do-what-it-says':\n\tmyWhat();\n\tbreak;\n\n}\n\n\n}", "title": "" }, { "docid": "6a136a77e3b519cea6f6f63515d9384f", "score": "0.44823033", "text": "function beginDialogOnLuisIntent(intent, entities, session) {\n console.log(\"Switch to Dialog based on luis intent \" + intent.intent);\n if (intent.intent.startsWith(\"Absenzen\")) {\n //hier müssen wir noch die Daten übergeben\n session.beginDialog(\"Absenzen\", { \"intent\": intent, \"entities\": entities });\n } else if (intent.intent.startsWith(\"Spesen\")) {\n //hier müssen wir noch die Daten übergeben\n session.beginDialog(\"Spesen\", { \"intent\": intent, \"entities\": entities });\n } if (intent.intent.startsWith(\"Monatsabschluss\")) {\n //hier müssen wir noch die Daten übergeben\n session.beginDialog(\"Monatsabschluss\", { \"intent\": intent, \"entities\": entities });\n } else {\n console.log(\"no dialog found for intend \" + intent.intent);\n }\n}", "title": "" }, { "docid": "8c2801121b96e084955665b91d91d94f", "score": "0.4482138", "text": "function getAllStart() {\n return {\n type: 'GET_ALL_START',\n };\n}", "title": "" }, { "docid": "6485b41f2cba0b163e52369f08eb984c", "score": "0.44815028", "text": "function getAvailableAlarmPaths(app, defaultMethods, ignore=[]) {\n var retval = app.streambundle.getAvailablePaths()\n .filter(p => (!(ignore.reduce((a,ip) => { return(p.startsWith(ip)?true:a); }, false))))\n .filter(p => {\n var meta = app.getSelfPath(p + \".meta\");\n if ((meta) && (meta.zones) && (meta.zones.length > 0)) {\n meta.alertMethod = (meta.alertMethod || defaultMethods.alertMethod);\n meta.warnMethod = (meta.warnMethod || defaultMethods.warnMethod);\n meta.alarmMethod = (meta.alarmMethod || defaultMethods.alarmMethod);\n meta.emergencyMethod = (meta.emergencyMethod || defaultMethods.emergencyMethod);\n return(true);\n } else {\n return(false);\n }\n });\n return(retval);\n }", "title": "" }, { "docid": "176978746291fb7f183336f240d650c8", "score": "0.44807556", "text": "function getIntent(state) {\n var intentString = \"\";\n switch (state) {\n case states.BOOKDOCTOR:\n intentString = (\"bookDoctorForIntent\");\n break;\n case states.DESCRIPTION:\n intentString = (\"eventIntent\");\n break;\n default:\n intentString = (\"AMAZON.HelpIntent\");\n }\n return intentString;\n}", "title": "" }, { "docid": "c54fb5d86e4617c674c145a5d3b460eb", "score": "0.44786444", "text": "get intent () {\n\t\treturn this._intent;\n\t}", "title": "" }, { "docid": "d8f4d3390e1a27c54134bbd9b93c889e", "score": "0.4473339", "text": "function startActivity() {\n\t\t//set up button listeners\n\t\tvar btn0 = document.getElementById('btn0');\n\t\tbtn0.addEventListener(\"click\", this.startPress);\n\t\tvar btn1 = document.getElementById('btn1');\n\t\tbtn1.addEventListener(\"click\", this.hiccupPress);\n\t\tvar btnE = document.getElementById('btnEnd');\n\t\tbtnE.addEventListener(\"click\", this.successPress);\n\t\tvar btnTA = document.getElementById('btnTryAgain');\n\t\tbtnTA.addEventListener(\"click\", this.tryAgainPress);\n\t\tvar btnGU = document.getElementById('btnGiveUp');\n\t\tbtnGU.addEventListener(\"click\", this.giveUpPress);\n\t\t\n\t\t// show caution0 and btn0 on load.\n\t\ttransistion('show','caution0');\n transistion('show','btn0');\n\t\tconsole.log('startActivity');\n}", "title": "" }, { "docid": "ec9e89adc90e727e7c81898f33eddf8f", "score": "0.44695607", "text": "function routeToIntent() {\n\n switch (this.event.request.type) {\n case 'IntentRequest':\n this.emit(this.event.request.intent.name);\n break;\n case 'LaunchRequest':\n this.emit('LaunchRequest');\n break;\n default:\n this.emit('LaunchRequest');\n }\n}", "title": "" }, { "docid": "2e8f2dd9cc6342994b541a9645f48985", "score": "0.446884", "text": "function getEvent(intent, context, callback) {\n const slots = intent.slots;\n console.log(slots);\n if (slots.zip && slots.zip.hasOwnProperty('value')) {\n \tlet zip = slots.zip.value;\n \tconsole.log(\"zip: \" + zip);\n \tlookupZip(zip, slots, callback);\n } else if (slots.city && slots.city.hasOwnProperty('value') && slots.city.value.length > 0) {\n \tlet city = slots.city.value;\n \tlet state = \"\";\n \tif (slots.state && slots.state.hasOwnProperty('value')) {\n \t\tstate = slots.state.value;\n \t}\n \tconsole.log(\"city-state: \" + city + \", \" + state);\n \tlookupCity(city, state, slots, callback); \t\n } else {\n \tlookupNearMe(context, slots, callback);\n }\n\t\n}", "title": "" }, { "docid": "c5903e54aaea7c997c6d37467536ca39", "score": "0.44318777", "text": "function getAvailableActions(context) {\n var rangeToExtract = getRangeToExtract(context.file, { start: context.startPosition, length: context.endPosition - context.startPosition });\n var targetRange = rangeToExtract.targetRange;\n if (targetRange === undefined) {\n return undefined;\n }\n var extractions = getPossibleExtractions(targetRange, context);\n if (extractions === undefined) {\n // No extractions possible\n return undefined;\n }\n var actions = [];\n var usedNames = ts.createMap();\n var i = 0;\n for (var _i = 0, extractions_1 = extractions; _i < extractions_1.length; _i++) {\n var extr = extractions_1[_i];\n // Skip these since we don't have a way to report errors yet\n if (extr.errors && extr.errors.length) {\n continue;\n }\n // Don't issue refactorings with duplicated names.\n // Scopes come back in \"innermost first\" order, so extractions will\n // preferentially go into nearer scopes\n var description = ts.formatStringFromArgs(ts.Diagnostics.Extract_function_into_0.message, [extr.scopeDescription]);\n if (!usedNames.has(description)) {\n usedNames.set(description, true);\n actions.push({\n description: description,\n name: \"scope_\" + i\n });\n }\n // *do* increment i anyway because we'll look for the i-th scope\n // later when actually doing the refactoring if the user requests it\n i++;\n }\n if (actions.length === 0) {\n return undefined;\n }\n return [{\n name: extractMethod.name,\n description: extractMethod.description,\n inlineable: true,\n actions: actions\n }];\n }", "title": "" }, { "docid": "7e5155bd8659f9e9c589a6a0f1f33207", "score": "0.4391144", "text": "function initActions() {\n const actions = [{\n name: 'fax_management_information',\n main: true,\n picto: 'ovh-font-details',\n sref: 'telecom.telephony.fax.management.informations',\n text: $translate.instant('telephony_group_fax_management_action_informations'),\n }, {\n name: 'fax_management_terminate',\n sref: 'telecom.telephony.fax.management.terminate',\n main: true,\n picto: 'ovh-font-filled-error',\n text: $translate.instant('telephony_group_fax_management_action_terminate'),\n }];\n\n self.actions = actions;\n }", "title": "" }, { "docid": "bd1ddf789cec25beb8fb869284e1166b", "score": "0.43884158", "text": "recentClick() {\n mLog.showInfo(TAG, `recent click and start ability recent`);\n let result = FeatureAbility.startAbility({\n want: {\n bundleName: RECENT_BUNDLE_NAME,\n abilityName: RECENT_ABILITY_NAME,\n },\n }).then(data =>\n mLog.showInfo(TAG, `promise then: ${JSON.stringify(data)}`)).catch(error =>\n mLog.showError(TAG, `promise catch: ${JSON.stringify(error)}`));\n mLog.showInfo(TAG, `start ability ${result}`);\n }", "title": "" }, { "docid": "786a5f6313e060f2c0651b732ed2187d", "score": "0.43871498", "text": "function actOnUnwantedSuggestions() {\r\n var links = getSuggestionLinks(linkTextPossibilities, suggestionGrid), i, link, block;\r\n if (!links || links.snapshotLength === 0) {\r\n logger.log(\"No fan page suggestions found.\", logger.DEBUG);\r\n }\r\n else {\r\n for (i = 0; i < links.snapshotLength; i++) {\r\n try {\r\n link = links.snapshotItem(i);\r\n block = getContainingSuggestionBlock(link);\r\n if (!actions.suggestions.applyCurrent(block)) {\r\n logger.log(\"Suggestion action \" + actions.suggestions.selected + \" requested action-chain stop. No more actions will be processed.\", logger.DEBUG);\r\n break;\r\n }\r\n }\r\n catch (e) {\r\n logger.log(e.message, logger.ERROR);\r\n gm_config.openToCorrectError(\"selectedAction\");\r\n break;\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "3652a334d62c6a080e7bf6db91d249b0", "score": "0.43801904", "text": "onIntentChanged(){\n const intent = this.prevIntentSpan.textContent + this.intentSelect.value;\n for (let i = 0; i < this.subintents.length; i++) {\n const child = this.subintents[i];\n child.prevIntentChanged(intent);\n }\n }", "title": "" }, { "docid": "005dcedeb91fed777b429bb3a39f3cea", "score": "0.4379795", "text": "function start() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"task\",\n message: \"What would you like to do?\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add new Products\", \"Quit\"]\n }\n ]).then(function(answer) {\n // Switch caste statements to call different functions for above choices\n switch (answer.task) {\n case \"View Products for Sale\":\n display();\n break;\n case \"View Low Inventory\":\n viewLowInv();\n break;\n case \"Add to Inventory\":\n addInv();\n break;\n case \"Add new Products\":\n addProduct();\n break;\n case \"Quit\":\n quitManager();\n };\n });\n}", "title": "" }, { "docid": "218d9c7f6ed87e2abfbb4b730161a0d4", "score": "0.43792725", "text": "function getActions() {\n // Determine the events to bind. IE11 implements pointerEvents without\n // a prefix, which breaks compatibility with the IE10 implementation.\n return window.navigator.pointerEnabled ? {\n start: \"pointerdown\",\n move: \"pointermove\",\n end: \"pointerup\"\n } : window.navigator.msPointerEnabled ? {\n start: \"MSPointerDown\",\n move: \"MSPointerMove\",\n end: \"MSPointerUp\"\n } : {\n start: \"mousedown touchstart\",\n move: \"mousemove touchmove\",\n end: \"mouseup touchend\"\n };\n } // https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md", "title": "" }, { "docid": "a3b28a5a1cbd63acf7ad8471bb69dad7", "score": "0.43646678", "text": "function Activities() {\n window.addEventListener('mozChromeEvent', this);\n window.addEventListener('appopened', this);\n window.addEventListener('applicationinstall', this);\n this.actionMenu = null;\n }", "title": "" }, { "docid": "8864352fa7190e9a7607e03701a23e7e", "score": "0.43626156", "text": "function addAppIntent(intent, func) {\r\n app.intent(intent.name,\r\n intent.utterances, (slots, attr, data) => {\r\n var context = sessionContext.create(slots, attr, data); \r\n return exception.try(() => {\r\n\r\n logger.info('Intent invoked: ' + intent.name); \r\n logger.info('Data: ' + JSON.stringify(data)); \r\n logger.info('Slots: ' + JSON.stringify(slots)); \r\n logger.info('Session: ' + JSON.stringify(attr)); \r\n return func(context, slots, attr, data); \r\n }, { \r\n defaultValue:responseBuilder.generalError(context, false, true)\r\n });\r\n }\r\n );\r\n}", "title": "" }, { "docid": "b0c1ca9166306b887827b7958a3c3db4", "score": "0.4361598", "text": "function enlistForSystemStartupActions()\r\n{\r\n if (kony.gps){\r\n if(kony.gps.checkIfAppRequiresGPS() === true)\r\n {\r\n kony.gps.invokeGPSToGetLatLon();\r\n }\r\n }\r\n if (kony.widgets.Calendar)\r\n {\r\n if(kony.widgets.Calendar.Inlineview)\r\n {\r\n //kony.widgets.Calendar.Inlineview.checkCalendarwidget();\r\n }\r\n }\r\n //Suma:August 17,2011 Added theme based support to dynamically load the CSS relevant to the theme.\r\n var konyElement = new kony.dom.Element();\r\n var theme = konyElement.getElementByIDNS(\"CURRENT_THEME\"); \r\n if(theme && theme.value != null)\r\n {\r\n\t\tvar themeurl = theme.getAttribute(\"url\")\r\n\t\tif(themeurl)\r\n\t\t\tkony.system.themes.executeDynamicCSSLoad(theme,themeurl);\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(isStartUp == true)\r\n\t\t\t{\r\n\t\t\t\tisStartUp = false;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tkony.system.themes.executeDynamicCSSLoad(theme,\"\");\r\n\t\t}\r\n }\r\n}", "title": "" }, { "docid": "1321c01fb96153317d444b8984695841", "score": "0.43595806", "text": "function onIntent(intentRequest, session, callback) {\n\n var intent = intentRequest.intent\n var intentName = intentRequest.intent.name;\n\n // dispatch custom intents to handlers here\n if (intentName == \"GetInfoIntent\") {\n handleGetInfoIntent(intent, session, callback)\n }else if (intentName == \"GetUpcomingIntent\") {\n handleGetUpcomingIntent(intent, session, callback)\n }\n else if (intentName == \"AMAZON.YesIntent\") {\n handleYesIntent(intent, session, callback)\n }else if (intentName == \"AMAZON.NoIntent\") {\n handleFinishSessionRequest(intent, session, callback)\n }else if (intentName == \"GetDateIntent\") {\n handlesDateIntent(intent, session, callback)\n } else {\n throw \"Invalid intent\"\n }\n}", "title": "" }, { "docid": "43b7ab38fff5f5a416d8d42bb277e08d", "score": "0.4358886", "text": "function iglooActions () {\n\t//Placeholder\n}", "title": "" }, { "docid": "8b0b7719984fb7b1c9c66bcb2f2bbc95", "score": "0.43563178", "text": "function getIntent(messages, replies) {\n \n /*\n 0)- unknown\n 1)- tell_score_live_match\n 2)- tell_score_finished_match\n 3)- confirm_score\n 4)- tell_match_is_over\n 5)- not_confirm_score\n 6)- tell_score_live_match_without_teams\n */\n let intents = [\n 'unknown',\n 'tell_score_live_match',\n 'tell_score_finished_match',\n 'confirm_score',\n 'tell_match_is_over',\n 'not_confirm_score',\n 'tell_score_live_match_without_teams',\n ];\n \n let gut = [1, 0, 0, 0, 0];\n \n let latest_msg = messages[0].text;\n console.log(latest_msg);\n \n if (latest_msg.length > 160) {\n messages[0].intent = \"unknown\";\n return \"unknown\";\n }\n \n if (latest_msg.length > 80)\n gut[0] += 2;\n \n if (/^[a-z\\.\\á\\ç\\ã\\õ\\é\\ó\\s]+(\\s)?([0-9][0-9]?(\\s)?(\\-|\\—|\\.|\\a)(\\s)?[0-9][0-9]?)(\\s)?[a-z\\.\\á\\ç\\ã\\õ\\é\\ó\\s]+/.test(latest_msg))\n gut[1] += 3;\n \n if (/^([0-9][0-9]?(\\s)?(\\-|\\—|\\.|\\a)(\\s)?[0-9][0-9]?)/.test(latest_msg))\n gut[6] += 3;\n \n if (/^[a-z\\.\\á\\ç\\ã\\õ\\é\\ó\\s]+\\s[0-9][0-9]?\\s?(\\,|\\-|\\;|\\—)\\s?[a-z\\.\\á\\ç\\ã\\õ\\é\\ó\\s]+\\s[0-9][0-9]?/.test(latest_msg))\n gut[1] += 3;\n \n if (/(final da partida)|(fim da partida)|(fim do jogo)|(terminou)$|(acabou)$|(terminado)$|(acabou o jogo)$/.test(latest_msg))\n gut[4] += 3;\n \n if (/(resultado final)/)\n gut[2]++;\n \n if (/([0-9][0-9]?(\\s)?(\\-|\\—|\\.|\\a)(\\s)?[0-9][0-9]?)\\s(resultado final)|(resultado final)\\s([0-9][0-9]?(\\s)?(\\-|\\—|\\.|\\a)(\\s)?[0-9][0-9]?)/.test(latest_msg))\n gut[2]++;\n \n if (/^[a-z\\.\\á\\ç\\ã\\õ\\é\\ó\\s]+(\\s)?([0-9][0-9]?(\\s)?(\\-|\\—|\\.|\\a)(\\s)?[0-9][0-9]?)(\\s)?[a-z\\.\\á\\ç\\ã\\õ\\é\\ó\\s]+\\s(resultado final)|^(resultado final)\\s[a-z\\.\\á\\ç\\ã\\õ\\é\\ó\\s]+(\\s)?([0-9][0-9]?(\\s)?(\\-|\\—|\\.|\\a)(\\s)?[0-9][0-9]?)(\\s)?[a-z\\.\\á\\ç\\ã\\õ\\é\\ó\\s]+/.test(latest_msg))\n gut[2]++;\n \n let biggest_score = -1;\n let intent_chosen = 0;\n \n for (let i = 0; i < gut.length; i++) {\n if (gut[i] > biggest_score) {\n biggest_score = gut[i];\n intent_chosen = i;\n }\n }\n \n return intents[intent_chosen];\n \n }", "title": "" }, { "docid": "0da2dbd877f51ee7a867c455bb2d0d4b", "score": "0.43540147", "text": "function start() {\n inquirer.prompt({\n name: \"choices\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\"View products for sale.\", \"View low inventory.\", \"Add to inventory.\", \"Add new product.\", \"Delete a product.\", \"Delete units of a product.\"]\n }) .then(function(answer) {\n console.log(\"answer: \", answer.choices);\n\n // Switch function to run chosen functions\n switch (answer.choices) {\n case \"View products for sale.\":\n return viewProducts();\n case \"View low inventory.\":\n return lowInventory();\n case \"Add to inventory.\":\n return addInventory();\n case \"Add new product.\":\n return newProduct();\n case \"Delete a product.\":\n return deleteItem();\n case \"Delete units of a product.\":\n return deleteUnits();\n default:\n return console.log(\"You're doing it wrong!!!\")\n };\n})}", "title": "" }, { "docid": "bc5abd86949ff07644b44ae478410639", "score": "0.43446445", "text": "function intentHandler(data) {\n if (data && data.intents && data.entities) {\n var primaryIntent = data.intents[0];\n var primaryEntity = data.entities[0];\n\n // TODO: handle multiple entities and check state\n\n if (primaryIntent && primaryEntity && !data.output.error) {\n switch (primaryEntity.entity) {\n case ConversationResponse.entities.genre.name:\n Panel.playMusic(primaryEntity.value);\n break;\n\n case ConversationResponse.entities.appliance.name:\n switch (primaryEntity.value) {\n case ConversationResponse.entities.appliance.values.air_conditioner:\n if (primaryIntent.intent === ConversationResponse.intents.turn_on) {\n Panel.ac('lo');\n } else {\n Panel.ac('hi');\n }\n break;\n\n case ConversationResponse.entities.appliance.values.heater:\n if (primaryIntent.intent === ConversationResponse.intents.turn_on) {\n Panel.heat('lo');\n } else {\n Panel.heat('hi');\n }\n break;\n\n case ConversationResponse.entities.appliance.values.light:\n if (primaryIntent.intent === ConversationResponse.intents.turn_on) {\n Animations.lightsOn();\n } else if (primaryIntent.intent === ConversationResponse.intents.turn_off) {\n Animations.lightsOff();\n }\n break;\n\n case ConversationResponse.entities.appliance.values.wiper:\n if (primaryIntent.intent === ConversationResponse.intents.turn_on) {\n Animations.wipersOn();\n } else if (primaryIntent.intent === ConversationResponse.intents.turn_off) {\n Animations.wipersOff();\n }\n break;\n\n case ConversationResponse.entities.appliance.values.music:\n if (primaryIntent.intent === ConversationResponse.intents.turn_up) {\n Panel.playMusic('general');\n }\n break;\n\n default:\n break;\n }\n break;\n\n case ConversationResponse.entities.amenity.name:\n switch (primaryEntity.value) {\n case ConversationResponse.entities.amenity.values.gas_station:\n Panel.mapGas();\n break;\n case ConversationResponse.entities.amenity.values.restaurant:\n if (primaryIntent.intent === ConversationResponse.intents.locate_amenity) {\n Panel.mapFoodCuisine();\n } else {\n Panel.mapFoodNumbers();\n }\n break;\n default:\n break;\n }\n break;\n\n case ConversationResponse.entities.cuisine.name:\n Panel.mapFoodNumbers();\n break;\n\n case ConversationResponse.entities.phone.name:\n switch (primaryEntity.value) {\n case ConversationResponse.entities.phone.values.call:\n Panel.mapGas();\n break;\n case ConversationResponse.entities.phone.values.text:\n Panel.text();\n break;\n default:\n break;\n }\n break;\n\n default:\n break;\n }\n } else if (primaryIntent && !data.output.error && !primaryEntity) {\n // handle case if there in an intent but no entity\n switch (primaryIntent.intent) {\n case ConversationResponse.intents.locate_amenity:\n Panel.mapGeneral();\n break;\n\n default:\n break;\n }\n }\n }\n }", "title": "" }, { "docid": "e7a697225ff6ae2c822631f0478b1a26", "score": "0.43433592", "text": "function startInfinityCustomFunctions() {\n\t\tsetReworkStyleCSS();\n\t\tloadTitlePhoneNumber();\n\t}", "title": "" }, { "docid": "277e867c076d44ca6c39d9fcb4555399", "score": "0.43376315", "text": "canHandle(handlerInput) {\n const request = handlerInput.requestEnvelope.request;\n return request.type === \"IntentRequest\" && request.intent.name === \"AMAZON.FallbackIntent\";\n }", "title": "" }, { "docid": "cdd75e7f298a4ef18a77bab8c7bce55d", "score": "0.43360165", "text": "function main(data) {\n\t\tvar action = data.result.action;\n\t\tvar speech = data.result.fulfillment.speech;\n\t\t// use incomplete if u use required in api.ai questions in intent\n\t\t// check if actionIncomplete = false\n\t\tvar incomplete = data.result.actionIncomplete;\n\t\tif(data.result.fulfillment.messages) { // check if messages are there\n\t\t\tif(data.result.fulfillment.messages.length > 0) { //check if quick replies are there\n\t\t\t\tvar suggestions = data.result.fulfillment.messages[1];\n\t\t\t}\n\t\t}\n\t\tswitch(action) {\n\t\t\t// case 'your.action': // set in api.ai\n\t\t\t// Perform operation/json api call based on action\n\t\t\t// Also check if (incomplete = false) if there are many required parameters in an intent\n\t\t\t// if(suggestions) { // check if quick replies are there in api.ai\n\t\t\t// addSuggestion(suggestions);\n\t\t\t// }\n\t\t\t// break;\n\t\t\tdefault:\n\t\t\t\tsetBotResponse(speech);\n\t\t\t\tif(suggestions) { // check if quick replies are there in api.ai\n\t\t\t\t\taddSuggestion(suggestions);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "8da892d4fde678956fff1655ca74eee3", "score": "0.43195257", "text": "function getActions ( ) {\r\n\r\n\t\t// Determine the events to bind. IE11 implements pointerEvents without\r\n\t\t// a prefix, which breaks compatibility with the IE10 implementation.\r\n\t\treturn window.navigator.pointerEnabled ? {\r\n\t\t\tstart: 'pointerdown',\r\n\t\t\tmove: 'pointermove',\r\n\t\t\tend: 'pointerup'\r\n\t\t} : window.navigator.msPointerEnabled ? {\r\n\t\t\tstart: 'MSPointerDown',\r\n\t\t\tmove: 'MSPointerMove',\r\n\t\t\tend: 'MSPointerUp'\r\n\t\t} : {\r\n\t\t\tstart: 'mousedown touchstart',\r\n\t\t\tmove: 'mousemove touchmove',\r\n\t\t\tend: 'mouseup touchend'\r\n\t\t};\r\n\t}", "title": "" }, { "docid": "48cbe991f6dc691f97de8a69272879e0", "score": "0.43077517", "text": "get intent() {\n\t\treturn this.__intent;\n\t}", "title": "" }, { "docid": "85d709ac42ace5bf1002e23a80716205", "score": "0.4306496", "text": "function getAvailableActions() {\n return TelephonyMediator.getApiModelEnum(\n 'telephony.OvhPabxIvrMenuEntryActionEnum',\n ).then((enumValues) => {\n self.availableActions = map(\n filter(enumValues, (enumVal) => {\n if (self.menuEntryCtrl.menuCtrl.ovhPabx.featureType === 'cloudIvr') {\n return enumVal !== 'callcenter';\n }\n return true;\n }),\n (enumVal) => ({\n value: enumVal,\n label: $translate.instant(\n `telephony_number_feature_ovh_pabx_menu_entry_action_${snakeCase(\n enumVal,\n )}`,\n ),\n explain: $translate.instant(\n `telephony_number_feature_ovh_pabx_menu_entry_action_${snakeCase(\n enumVal,\n )}_explain`,\n ),\n }),\n );\n });\n }", "title": "" }, { "docid": "245b5bd694af39129f9ed2faa11796ad", "score": "0.43058255", "text": "function getActions ( ) {\n\n // Determine the events to bind. IE11 implements pointerEvents without\n // a prefix, which breaks compatibility with the IE10 implementation.\n return window.navigator.pointerEnabled ? {\n start: 'pointerdown',\n move: 'pointermove',\n end: 'pointerup'\n } : window.navigator.msPointerEnabled ? {\n start: 'MSPointerDown',\n move: 'MSPointerMove',\n end: 'MSPointerUp'\n } : {\n start: 'mousedown touchstart',\n move: 'mousemove touchmove',\n end: 'mouseup touchend'\n };\n }", "title": "" }, { "docid": "124e2a13448353a0ed65a3579bb131b9", "score": "0.43036747", "text": "function getActions ( ) {\n\n\t\t\t// Determine the events to bind. IE11 implements pointerEvents without\n\t\t\t// a prefix, which breaks compatibility with the IE10 implementation.\n\t\t\treturn window.navigator.pointerEnabled ? {\n\t\t\t\tstart: 'pointerdown',\n\t\t\t\tmove: 'pointermove',\n\t\t\t\tend: 'pointerup'\n\t\t\t} : window.navigator.msPointerEnabled ? {\n\t\t\t\tstart: 'MSPointerDown',\n\t\t\t\tmove: 'MSPointerMove',\n\t\t\t\tend: 'MSPointerUp'\n\t\t\t} : {\n\t\t\t\tstart: 'mousedown touchstart',\n\t\t\t\tmove: 'mousemove touchmove',\n\t\t\t\tend: 'mouseup touchend'\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "c5abda158c5d60e1ec8350c7f23b7d87", "score": "0.4299855", "text": "function onIntent(intentRequest, session, callback) {\n console.log(\"onIntent requestId=\" + intentRequest.requestId +\n \", sessionId=\" + session.sessionId);\n\n var intent = intentRequest.intent,\n intentName = intentRequest.intent.name;\n\n // handle yes/no intent after the user has been prompted\n if (session.attributes && session.attributes.userPromptedToContinue) {\n delete session.attributes.userPromptedToContinue;\n if (\"AMAZON.NoIntent\" === intentName) {\n handleFinishSessionRequest(intent, session, callback);\n } else if (\"AMAZON.YesIntent\" === intentName) {\n handleRepeatRequest(intent, session, callback);\n }\n }\n\n // dispatch custom intents to handlers here\n if (\"AnswerIntent\" === intentName) {\n handleAnswerRequest(intent, session, callback);\n } else if (\"AnswerOnlyIntent\" === intentName) {\n handleAnswerRequest(intent, session, callback);\n } else if (\"DontKnowIntent\" === intentName) {\n handleAnswerRequest(intent, session, callback);\n } else if (\"AMAZON.YesIntent\" === intentName) {\n handleAnswerRequest(intent, session, callback);\n } else if (\"AMAZON.NoIntent\" === intentName) {\n handleAnswerRequest(intent, session, callback);\n } else if (\"LaunchIntent\" === intentName) {\n getWelcomeResponse(callback);\n } else if (\"AMAZON.StartOverIntent\" === intentName) {\n handleQuestionRequest(callback);\n } else if (\"AMAZON.RepeatIntent\" === intentName) {\n handleRepeatRequest(intent, session, callback);\n } else if (\"AMAZON.HelpIntent\" === intentName) {\n handleGetHelpRequest(intent, session, callback);\n } else if (\"AMAZON.StopIntent\" === intentName) {\n handleFinishSessionRequest(intent, session, callback);\n } else if (\"AMAZON.CancelIntent\" === intentName) {\n handleFinishSessionRequest(intent, session, callback);\n } else {\n throw \"Invalid intent\";\n }\n}", "title": "" }, { "docid": "04af969fa00ad5d531089132903f5667", "score": "0.42985666", "text": "canHandle(handlerInput) {\n const request = handlerInput.requestEnvelope.request;\n return request.type === 'IntentRequest'\n && request.intent.name === 'AMAZON.FallbackIntent';\n }", "title": "" }, { "docid": "04af969fa00ad5d531089132903f5667", "score": "0.42985666", "text": "canHandle(handlerInput) {\n const request = handlerInput.requestEnvelope.request;\n return request.type === 'IntentRequest'\n && request.intent.name === 'AMAZON.FallbackIntent';\n }", "title": "" }, { "docid": "04af969fa00ad5d531089132903f5667", "score": "0.42985666", "text": "canHandle(handlerInput) {\n const request = handlerInput.requestEnvelope.request;\n return request.type === 'IntentRequest'\n && request.intent.name === 'AMAZON.FallbackIntent';\n }", "title": "" }, { "docid": "04af969fa00ad5d531089132903f5667", "score": "0.42985666", "text": "canHandle(handlerInput) {\n const request = handlerInput.requestEnvelope.request;\n return request.type === 'IntentRequest'\n && request.intent.name === 'AMAZON.FallbackIntent';\n }", "title": "" }, { "docid": "04af969fa00ad5d531089132903f5667", "score": "0.42985666", "text": "canHandle(handlerInput) {\n const request = handlerInput.requestEnvelope.request;\n return request.type === 'IntentRequest'\n && request.intent.name === 'AMAZON.FallbackIntent';\n }", "title": "" }, { "docid": "96d6863d51f82f2d6c6c09590880435d", "score": "0.42972618", "text": "function getActions() {\n // Determine the events to bind. IE11 implements pointerEvents without\n // a prefix, which breaks compatibility with the IE10 implementation.\n return window.navigator.pointerEnabled ? {\n start: \"pointerdown\",\n move: \"pointermove\",\n end: \"pointerup\"\n } : window.navigator.msPointerEnabled ? {\n start: \"MSPointerDown\",\n move: \"MSPointerMove\",\n end: \"MSPointerUp\"\n } : {\n start: \"mousedown touchstart\",\n move: \"mousemove touchmove\",\n end: \"mouseup touchend\"\n };\n } // https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md", "title": "" }, { "docid": "0230c34822e7ff8e53ef3b7af2ff0f54", "score": "0.42878762", "text": "function getActions ( ) {\n\n\t\t// Determine the events to bind. IE11 implements pointerEvents without\n\t\t// a prefix, which breaks compatibility with the IE10 implementation.\n\t\treturn window.navigator.pointerEnabled ? {\n\t\t\tstart: 'pointerdown',\n\t\t\tmove: 'pointermove',\n\t\t\tend: 'pointerup'\n\t\t} : window.navigator.msPointerEnabled ? {\n\t\t\tstart: 'MSPointerDown',\n\t\t\tmove: 'MSPointerMove',\n\t\t\tend: 'MSPointerUp'\n\t\t} : {\n\t\t\tstart: 'mousedown touchstart',\n\t\t\tmove: 'mousemove touchmove',\n\t\t\tend: 'mouseup touchend'\n\t\t};\n\t}", "title": "" }, { "docid": "0230c34822e7ff8e53ef3b7af2ff0f54", "score": "0.42878762", "text": "function getActions ( ) {\n\n\t\t// Determine the events to bind. IE11 implements pointerEvents without\n\t\t// a prefix, which breaks compatibility with the IE10 implementation.\n\t\treturn window.navigator.pointerEnabled ? {\n\t\t\tstart: 'pointerdown',\n\t\t\tmove: 'pointermove',\n\t\t\tend: 'pointerup'\n\t\t} : window.navigator.msPointerEnabled ? {\n\t\t\tstart: 'MSPointerDown',\n\t\t\tmove: 'MSPointerMove',\n\t\t\tend: 'MSPointerUp'\n\t\t} : {\n\t\t\tstart: 'mousedown touchstart',\n\t\t\tmove: 'mousemove touchmove',\n\t\t\tend: 'mouseup touchend'\n\t\t};\n\t}", "title": "" }, { "docid": "0230c34822e7ff8e53ef3b7af2ff0f54", "score": "0.42878762", "text": "function getActions ( ) {\n\n\t\t// Determine the events to bind. IE11 implements pointerEvents without\n\t\t// a prefix, which breaks compatibility with the IE10 implementation.\n\t\treturn window.navigator.pointerEnabled ? {\n\t\t\tstart: 'pointerdown',\n\t\t\tmove: 'pointermove',\n\t\t\tend: 'pointerup'\n\t\t} : window.navigator.msPointerEnabled ? {\n\t\t\tstart: 'MSPointerDown',\n\t\t\tmove: 'MSPointerMove',\n\t\t\tend: 'MSPointerUp'\n\t\t} : {\n\t\t\tstart: 'mousedown touchstart',\n\t\t\tmove: 'mousemove touchmove',\n\t\t\tend: 'mouseup touchend'\n\t\t};\n\t}", "title": "" }, { "docid": "0230c34822e7ff8e53ef3b7af2ff0f54", "score": "0.42878762", "text": "function getActions ( ) {\n\n\t\t// Determine the events to bind. IE11 implements pointerEvents without\n\t\t// a prefix, which breaks compatibility with the IE10 implementation.\n\t\treturn window.navigator.pointerEnabled ? {\n\t\t\tstart: 'pointerdown',\n\t\t\tmove: 'pointermove',\n\t\t\tend: 'pointerup'\n\t\t} : window.navigator.msPointerEnabled ? {\n\t\t\tstart: 'MSPointerDown',\n\t\t\tmove: 'MSPointerMove',\n\t\t\tend: 'MSPointerUp'\n\t\t} : {\n\t\t\tstart: 'mousedown touchstart',\n\t\t\tmove: 'mousemove touchmove',\n\t\t\tend: 'mouseup touchend'\n\t\t};\n\t}", "title": "" }, { "docid": "1db683d5477acdf4231c6a72b9063bef", "score": "0.42873892", "text": "getActivities(type, starts_at) {\n const params = { type, starts_at };\n\n return Activity.query(params, `${this.getUri()}/activities`);\n }", "title": "" }, { "docid": "e9870cc15a0044a60ca869728b4ec433", "score": "0.42823416", "text": "notifyFastPairApplicationInstalled() {\n chrome.send('notifyFastPairApplicationInstalled');\n }", "title": "" }, { "docid": "06984863bcdc3fd4342898666faa6ebf", "score": "0.42762884", "text": "function Start() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"Choose an option.\",\n choices: [\n \"my tweets\",\n \"spotify this song\",\n \"movie this\",\n \"do what it says\"\n ]\n }\n ])\n .then(function(res) {\n if (res.choice === \"my tweets\") {\n twitterSearch();\n } else if (res.choice === \"spotify this song\") {\n spotifySearch();\n } else if (res.choice === \"movie this\") {\n omdbSearch();\n } else if (res.choice === \"do what it says\") {\n specialRead();\n } else {\n console.log(\"error\");\n return;\n }\n });\n}", "title": "" }, { "docid": "ae927ba77e0339c915292ae04aa17201", "score": "0.42729098", "text": "recognize(context) {\n return new Promise((resolve, reject) => {\n this.runEnabled(context)\n .then((enabled) => {\n if (enabled) {\n this.runRecognize(context)\n .then((intents) => this.runFilter(context, intents || []))\n .then((intents) => resolve(intents))\n .catch((err) => reject(err));\n }\n else {\n resolve([]);\n }\n })\n .catch((err) => reject(err));\n });\n }", "title": "" }, { "docid": "dc64741c20ebdb44656102539391cc16", "score": "0.42606288", "text": "function onIntent(intentRequest, session, callback) {\n\n\n var intent = intentRequest.intent,\n intentName = intentRequest.intent.name;\n\n console.log(\"onIntent \"+intentName+\", rapLine \"+getRapLine(intent)+\" requestId=\" + intentRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // dispatch custom intents to handlers here\n if (isStartOverIntent(intent)) {\n console.log(\"StartOverIntent\");\n initSession(session);\n getWelcomeResponse(session, callback);\n }\n else if (isInspireMeIntent(session, intent)) {\n console.log(\"InspireMeIntent\");\n retrieveHaiku(session, callback);\n }\n else if (getPlayerNumberIntent(session, intent)) {\n console.log(\"PlayerNumberIntent\");\n handlePlayerCountRequest(getPlayerNumberIntent(session, intent), session, callback);\n }\n else if (getPlayerNameIntent(session, intent)) {\n console.log(\"PlayerNameIntent\");\n handlePlayerNameRequest(getPlayerNameIntent(session, intent), session, callback);\n }\n else {\n console.log(\"AnswerRequest\");\n handleAnswerRequest(intent, session, callback);\n }\n}", "title": "" }, { "docid": "7839e296956a826f665f083d43d45a67", "score": "0.4258946", "text": "function flowStartParseImportSpecifiers() {\n if (match(TokenType$2._typeof) || isContextual(ContextualKeyword._type)) {\n const lh = lookaheadTypeAndKeyword();\n if (isMaybeDefaultImport(lh) || lh.type === TokenType$2.braceL || lh.type === TokenType$2.star) {\n next();\n }\n }\n}", "title": "" }, { "docid": "4bfc44b9e0f11f416571b22f03224b95", "score": "0.42535383", "text": "function onIntent(intentRequest, session, callback) {\n console.log(\"onIntent requestId=\" + intentRequest.requestId +\n \", sessionId=\" + session.sessionId);\n\n var intent = intentRequest.intent,\n intentName = intentRequest.intent.name;\n\n // Dispatch to your skill's intent handlers\n if (\"VisibilityIntent\" === intentName) {\n getWeatherInfo(intent, session, callback);\n } else if (\"TempratureIntent\" === intentName) {\n getWeatherInfo(intent, session, callback);\n } else if (\"CuriosityIntent\" === intentName) {\n getCuriositySounds(intent, session, callback);\n } else if (\"SpaceSuitIntent\" === intentName) {\n getWeatherInfo(intent, session, callback);\n } else if (\"SafeIntent\" === intentName) {\n getWeatherInfo(intent, session, callback);\n } else if (\"AMAZON.HelpIntent\" === intentName) {\n getWelcomeResponse(callback);\n } else if (\"AMAZON.StopIntent\" === intentName || \"AMAZON.CancelIntent\" === intentName) {\n handleSessionEndRequest(callback);\n } else {\n throw \"Invalid intent\";\n }\n}", "title": "" }, { "docid": "2adc1fda37c6db75002f4ec8b17b76e3", "score": "0.4246557", "text": "function allCommands (command, args) { \n\tif (command === 'spotify-this-song') { //Calls function in spotify.js\n\t\tif (!args) { // if no song was selected\n\t\t\treturn spotifyFunction('The Sign'); // Searches for default song 'The Sign'\n\t\t};\n\t\tspotifyFunction(args);\n\t};\n\tif (command === 'movie-this') {\n\t\tif (!args) {\n\t\t\treturn omdbFunction('Mr. Nobody');\n\t\t};\n\t\tomdbFunction(args);\n\t};\n\tif(command === 'my-tweets') {\n\t\ttwitterFunction();\n\t};\n}", "title": "" }, { "docid": "7694565134d78ce7c49aad9c0b073a7a", "score": "0.4245658", "text": "function onIntent(deviceID, intentRequest, session, callback) {\r\n\r\n var intent = intentRequest.intent;\r\n var intentName = intentRequest.intent.name;\r\n\r\n // dispatch custom intents to handlers here (done)\r\n if(intentName == \"setTopic\"){\r\n handleTopicResponse(deviceID, intent, session, callback);\r\n } else if (intentName == \"setAmount\") {\r\n handleAmountResponse(deviceID, intent, session, callback);\r\n } else if (intentName == \"AMAZON.HelpIntent\"){\r\n handleHelpResponse(deviceID, intent, session, callback);\r\n } else if (intentName == \"AMAZON.CancelIntent\"){\r\n getGoodbyeResponse(callback);\r\n } else if (intentName == \"AMAZON.StopIntent\"){\r\n getGoodbyeResponse(callback);\r\n } else if (intentName == \"startOver\") {\r\n getWelcomeResponse(callback);\r\n } else {\r\n throw \"Invalid intent\";\r\n }\r\n}", "title": "" }, { "docid": "fe1529d432959217a5b349c50e75479f", "score": "0.42422575", "text": "function startAlarm() {\n chrome.alarms.get(\"1inch_alarm\", alarm => {\n if (alarm) {\n // alarm exists, do nothing\n console.log(\"1inch alarm already exists\");\n } else {\n // start the alarm since it doesn't exist\n chrome.alarms.create(\"1inch_alarm\", {\n delayInMinutes: 30,\n periodInMinutes: 30\n });\n console.log(\"1inch alarm created\");\n }\n })\n}", "title": "" }, { "docid": "cb530cb22673e9ad820415bc6caee88b", "score": "0.4241855", "text": "function enlistCustomTimerActions()\r\n{\r\n\r\n}", "title": "" }, { "docid": "6e38e2a4d1ef4d1588fe4fa43acace44", "score": "0.42397216", "text": "function intentClass(intent) {\n if (intent == null || intent === _intent.Intent.NONE) {\n return undefined;\n }\n\n return NS + \"-intent-\" + intent.toLowerCase();\n}", "title": "" }, { "docid": "6e38e2a4d1ef4d1588fe4fa43acace44", "score": "0.42397216", "text": "function intentClass(intent) {\n if (intent == null || intent === _intent.Intent.NONE) {\n return undefined;\n }\n\n return NS + \"-intent-\" + intent.toLowerCase();\n}", "title": "" }, { "docid": "4b47f1f9cb9f3bc7fb8b570eccf8da21", "score": "0.4236881", "text": "welcomeIntent(assistant) {\n this.assistant = assistant;\n this.agent.randomGreeting();\n }", "title": "" }, { "docid": "eee195f0a50a467f570b4a88c8c609bb", "score": "0.42354217", "text": "function setActions() {\n\t\t\tactions.each(function() {\n\t\t\t\tvar action = $(this), val;\n\t\t\t\tif (/args=/.test(this.href) && (depends = action.metadata().depends)) {\n\t\t\t\t\tval = selects.filter(depends).val();\n\t\t\t\t\tif (!val) action.fadeOut('fast');\n\t\t\t\t\telse {\n\t\t\t\t\t\taction.fadeIn('fast');\n\t\t\t\t\t\tthis.href = this.href.substring(0, this.href.indexOf('args=') + 5) + val;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "dfe56d59834ea3a6285f9cc561c7ba61", "score": "0.4234282", "text": "async NoIntent(){\n if (NoKey == 0){\n\n this.tell(\"GoodBye and have a great day\");\n \n }\n else if (NoKey == 1){\n const responsetotalexpense = await getSerachNameProfitSheet(FirstnameSave, \"\", CheckNameNum );\n this.ask(responsetotalexpense);\n }\n\n }", "title": "" }, { "docid": "6b89a0742dbb7dbd9e865861c0a16e3e", "score": "0.4230274", "text": "function flowStartParseImportSpecifiers() {\n if (match(TokenType._typeof) || isContextual(ContextualKeyword._type)) {\n const lh = lookaheadTypeAndKeyword();\n if (isMaybeDefaultImport(lh) || lh.type === TokenType.braceL || lh.type === TokenType.star) {\n next();\n }\n }\n}", "title": "" }, { "docid": "b7e7baf5867180fbfb0932d200c56973", "score": "0.42287788", "text": "function getFordWithAction(_) {\r\n\tvar neworder = [];\r\n\tfor (var i in _.ford) {\r\n\t\tif (_.frames[_.ford[i]].timeline.waitoncall)\r\n\t\t\tneworder.push(_.ford[i]);\r\n\t\telse\r\n\t\t\tneworder.push(\"skip\");\r\n\t}\r\n\treturn neworder;\r\n}", "title": "" }, { "docid": "33374a56ec74211a87b1f96df1dd6ab9", "score": "0.42208055", "text": "function registerShortcuts() {\r\n\r\n globalShortcut.register('F4',() => { \r\n mainWindow.webContents.send('trigger', 0);\r\n });\r\n \r\n globalShortcut.register('F6',() => { \r\n mainWindow.webContents.send('trigger', 75);\r\n \r\n });\r\n globalShortcut.register('F9',() => { \r\n mainWindow.webContents.send('trigger', 74);\r\n });\r\n globalShortcut.register('F8',() => {\r\n mainWindow.webContents.send('trigger', 88);\r\n });\r\n\r\n \r\n globalShortcut.register('Shift+F4',() => { \r\n mainWindow.webContents.send('trigger', 0);\r\n });\r\n \r\n globalShortcut.register('Shift+F6',() => { \r\n mainWindow.webContents.send('trigger', 75);\r\n \r\n });\r\n globalShortcut.register('Shift+F9',() => { \r\n mainWindow.webContents.send('trigger', 74);\r\n });\r\n globalShortcut.register('Shift+F8',() => {\r\n mainWindow.webContents.send('trigger', 88);\r\n });\r\n //Shortcut Plus\r\n globalShortcut.register('=',() => { \r\n mainWindow.webContents.send('trigger', 999);\r\n });\r\n globalShortcut.register('Shift+=',() => { \r\n mainWindow.webContents.send('trigger', 999);\r\n });\r\n //Shortcut Shift+Hashtag\r\n globalShortcut.register('?',() => { \r\n mainWindow.webContents.send('trigger', 998);\r\n });\r\n globalShortcut.register('Shift+?',() => { \r\n mainWindow.webContents.send('trigger', 998);\r\n });\r\n \r\n //Shorcut ü \r\n \r\n globalShortcut.register(';',() => { \r\n mainWindow.webContents.send('trigger', 997);\r\n });\r\n globalShortcut.register('Shift+;',() => { \r\n mainWindow.webContents.send('trigger', 997);\r\n });\r\n\r\n //Shortcut ü ?\r\n globalShortcut.register('[',() => { \r\n mainWindow.webContents.send('trigger', 995);\r\n });\r\n globalShortcut.register('Shift+[',() => { \r\n mainWindow.webContents.send('trigger', 995);\r\n });\r\n\r\n globalShortcut.register('-',() => { \r\n mainWindow.webContents.send('trigger', 996);\r\n });\r\n globalShortcut.register('Shift+-',() => { \r\n mainWindow.webContents.send('trigger', 996);\r\n });\r\n\r\n globalShortcut.register('Alt+A',() => { \r\n mainWindow.webContents.send('trigger', 137);\r\n });\r\n globalShortcut.register('Shift+Alt+A',() => { \r\n mainWindow.webContents.send('trigger', 137);\r\n });\r\n // this stops the alarm\r\n globalShortcut.register('F10',() => { \r\n mainWindow.webContents.send('trigger', 'holdup');\r\n });\r\n globalShortcut.register('Shift+F10',() => { \r\n mainWindow.webContents.send('trigger', 'holdup');\r\n });\r\n // this stops the alarm\r\n\r\n // this starts and stops the shoptimer\r\n globalShortcut.register('F11',() => { \r\n mainWindow.webContents.send('trigger', 'shop');\r\n });\r\n globalShortcut.register('Shift+F11',() => { \r\n mainWindow.webContents.send('trigger', 'shop');\r\n });\r\n // this starts and stops the shoptimer\r\n\r\n\r\n globalShortcut.register('F7',() => { \r\n mainWindow.webContents.send('trigger', 73);\r\n });\r\n globalShortcut.register('Shift+F7',() => { \r\n mainWindow.webContents.send('trigger', 73);\r\n });\r\n\r\n\r\n\r\n //Other alam levels\r\n globalShortcut.register('Alt+y',() => { \r\n mainWindow.webContents.send('trigger', 1);\r\n });\r\n globalShortcut.register('Alt+x',() => { \r\n mainWindow.webContents.send('trigger', 2);\r\n });\r\n globalShortcut.register('Alt+c',() => { \r\n mainWindow.webContents.send('trigger', 3);\r\n });\r\n globalShortcut.register('Alt+v',() => { \r\n mainWindow.webContents.send('trigger', 4);\r\n });\r\n globalShortcut.register('Alt+b',() => { \r\n mainWindow.webContents.send('trigger', 5);\r\n });\r\n globalShortcut.register('Alt+n',() => { \r\n mainWindow.webContents.send('trigger', 6);\r\n });\r\n globalShortcut.register('Alt+m',() => { \r\n mainWindow.webContents.send('trigger', 7);\r\n });\r\n globalShortcut.register('Alt+,',() => { \r\n mainWindow.webContents.send('trigger', 8);\r\n });\r\n globalShortcut.register('0',() => { \r\n mainWindow.webContents.send('trigger', 431);\r\n });\r\n\r\n\r\n globalShortcut.register('Shift+Alt+y',() => { \r\n mainWindow.webContents.send('trigger', 1);\r\n });\r\n globalShortcut.register('Shift+Alt+x',() => { \r\n mainWindow.webContents.send('trigger', 2);\r\n });\r\n globalShortcut.register('Shift+Alt+c',() => { \r\n mainWindow.webContents.send('trigger', 3);\r\n });\r\n globalShortcut.register('Shift+Alt+v',() => { \r\n mainWindow.webContents.send('trigger', 4);\r\n });\r\n globalShortcut.register('Shift+Alt+b',() => { \r\n mainWindow.webContents.send('trigger', 5);\r\n });\r\n globalShortcut.register('Shift+Alt+n',() => { \r\n mainWindow.webContents.send('trigger', 6);\r\n });\r\n globalShortcut.register('Shift+Alt+m',() => { \r\n mainWindow.webContents.send('trigger', 7);\r\n });\r\n globalShortcut.register('Shift+Alt+,',() => { \r\n mainWindow.webContents.send('trigger', 8);\r\n });\r\n globalShortcut.register('Shift+0',() => { \r\n mainWindow.webContents.send('trigger', 431);\r\n });\r\n\r\n\r\n\r\n}", "title": "" }, { "docid": "844bd06887f69c5626929bd4b91a5d31", "score": "0.4218706", "text": "function aplicar_funciones(funs, z) {\n for (let i = 0; i < funs.length; i++) {\n console.log(`Aplicar función ${i} pasando ${z}: ${funs[i](z)}`);\n }\n}", "title": "" }, { "docid": "baa928a02eeaf522d6e8f6fc4d7c9390", "score": "0.4214529", "text": "function playListClicks() {\n for (i= 0; i < playList.length; i ++) {\n playList[i].element.addEventListener('click', navigateByClick, true);\n }\n }", "title": "" }, { "docid": "28a53ef3a276ef1a297f0d3d6d8ec4e3", "score": "0.42141616", "text": "function getallalarms() {\n\tchrome.alarms.getAll(function(alarms){\n\t\tif(alarms.length === 1){var punchsinplu = \"Nothing™\";\n\t\t}else{punchsinplu = \"Nothings™\"};\n\t\tvar notification2 = new Notification('Well, fuck!', {\n\t\t\ticon: 'icons/icon48.png',\n\t\t\tbody: alarms.length + \" \" + punchsinplu + \" to run.\",\n\t\t});\n\t\t\n\t\tsetTimeout(function(){\n\t\t\tnotification2.close();\t\n\t\t}, 3000); \n\t});\n\t\n\tsetTimeout(function(){\n\t\tchrome.extension.sendRequest({ elementaction: \"btnstopspinning\" });\n\t}, 3000); \n}", "title": "" }, { "docid": "cf2aded5cf3542e61795500700ab2858", "score": "0.42111713", "text": "function onIntent(intentRequest, session, callback) {\n console.log(\"onIntent requestId=\" + intentRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n var intent = intentRequest.intent,\n intentName = intentRequest.intent.name;\n\n // handle yes/no intent after the user has been prompted\n if (session.attributes && session.attributes.userPromptedToContinue) {\n delete session.attributes.userPromptedToContinue;\n if (\"AMAZON.NoIntent\" === intentName) {\n handleFinishSessionRequest(intent, session, callback);\n } else if (\"AMAZON.YesIntent\" === intentName) {\n handleRepeatRequest(intent, session, callback);\n }\n }\n\n // dispatch custom intents to handlers here\n if (\"AnswerIntent\" === intentName) {\n handleAnswerRequest(intent, session, callback);\n } else if (\"AnswerOnlyIntent\" === intentName) {\n handleAnswerRequest(intent, session, callback);\n } else if (\"DontKnowIntent\" === intentName) {\n handleAnswerRequest(intent, session, callback);\n } else if (\"AMAZON.YesIntent\" === intentName) {\n handleAnswerRequest(intent, session, callback);\n } else if (\"AMAZON.NoIntent\" === intentName) {\n handleAnswerRequest(intent, session, callback);\n } else if (\"AMAZON.StartOverIntent\" === intentName) {\n getWelcomeResponse(callback);\n } else if (\"AMAZON.RepeatIntent\" === intentName) {\n handleRepeatRequest(intent, session, callback);\n } else if (\"AMAZON.HelpIntent\" === intentName) {\n handleGetHelpRequest(intent, session, callback);\n } else if (\"AMAZON.StopIntent\" === intentName) {\n handleFinishSessionRequest(intent, session, callback);\n } else if (\"AMAZON.CancelIntent\" === intentName) {\n handleFinishSessionRequest(intent, session, callback);\n } else {\n throw \"Invalid intent\";\n }\n}", "title": "" }, { "docid": "6fe48d047a1fdb8dc53983aa5546ca88", "score": "0.42079997", "text": "function getSteps() {\n return ['Marketplace Integration', 'Shipping Profile', 'Product Import','Product Sync','Import Customers'];\n }", "title": "" }, { "docid": "3bd70d5317963a95349f37b2b31ae81f", "score": "0.4207167", "text": "function onIntent(intentRequest, session, callback) {\n\n var intent = intentRequest.intent,\n intentName = intentRequest.intent.name;\n\n // Dispatch to your skill's intent handlers\n switch (intentName) {\n case \"conform\":\n //getdata(intent, session, callback);\n getdataCountry(intent, session, callback);\n break;\n case \"getdataCountry\":\n getdataCountry(intent, session, callback);\n break;\n\n case \"AMAZON.CancelIntent\":\n Wrong(intent, session, callback);\n break;\n\n case \"AMAZON.StopIntent\":\n End(intent, session, callback);\n break\n case \"AMAZON.FallbackIntent\":\n\n default:\n Wrongagain(intent, session, callback);\n break;\n\n }\n }", "title": "" }, { "docid": "8902790b37f9dfa727628707e4ea9e14", "score": "0.42021668", "text": "_startPressIn() {\n utils.Press('start');\n }", "title": "" }, { "docid": "47669c8eb49ff14559f86312787942fd", "score": "0.42007926", "text": "function onInstall() {\n onOpen();\n}", "title": "" } ]
38c7f29b49fe7401c1df7eebc8e6a12a
render() is a required method for React Class base component
[ { "docid": "67af68f251416ed2d8c578eb305b4b80", "score": "0.7109636", "text": "render() {\n\t\treturn <div className=\"container\">{this.renderContent()}</div>;\n\t}", "title": "" } ]
[ { "docid": "dbea5f9f82472414156f333259053048", "score": "0.79355687", "text": "render() {\n console.log('Executing RenderClassDemo Render');\n\n return <div>\n <h4>RenderClassDemo Component</h4>\n </div>;\n }", "title": "" }, { "docid": "8254583166621f1c37e6f9207510e655", "score": "0.7670598", "text": "render() {\n throw new Error(\"Renderer#render() must be implemented by subclass!\");\n }", "title": "" }, { "docid": "aff2a1977e7c42afbde2ef7d05260ebb", "score": "0.7536264", "text": "render () {\n console.error('child class must override render method')\n }", "title": "" }, { "docid": "f4017334c1530c0fd3e7a99738f635d4", "score": "0.7425937", "text": "render() {\n\t\t// Also, we shouldn't call the fucntion inside render because it\n\t\t// will get called again and again for re-rendering so, its gonna make some time if we call it here\n\t\t// Also direct object assignment will throw error\n\t\treturn <div className=\"border red\">{this.renderContent()}</div>;\n\t}", "title": "" }, { "docid": "43447fed3efcf1e5b22bc12a313a8312", "score": "0.73583436", "text": "render() {\r\n return <div className=\"border red\">{this.renderContent()}</div>;\r\n }", "title": "" }, { "docid": "0fe366758ff806d4fc60566ba411024d", "score": "0.7332075", "text": "render() {\n return <div className=\"border red\">{this.renderContent()}</div>;\n }", "title": "" }, { "docid": "1a4933b849821343f3b190089f3b50e8", "score": "0.73118246", "text": "render() {\n return <div className=\"border red\">{this.renderContent()}</div>;\n }", "title": "" }, { "docid": "77fc7bd411c300ad5a2908e6beea16a0", "score": "0.7293847", "text": "render() {\n return <div className=\"border red\">{this.renderContent()}</div>;\n }", "title": "" }, { "docid": "77fc7bd411c300ad5a2908e6beea16a0", "score": "0.7293847", "text": "render() {\n return <div className=\"border red\">{this.renderContent()}</div>;\n }", "title": "" }, { "docid": "09fdfe698589c82cd28042dd5b31a0e8", "score": "0.7278863", "text": "render() {\r\n return (\r\n <div>\r\n <h2>CONTENT OF THE PAGE</h2>\r\n <p>this component is made from a class</p>\r\n </div>\r\n )\r\n }", "title": "" }, { "docid": "c32407ffa2a07feab642c5236a299737", "score": "0.72739595", "text": "render() {\n throw new Error(\"RENDER NOT IMPLEMENTED FOR \" + this.name());\n }", "title": "" }, { "docid": "b91a3cc47730537deb7f8ca92fff8c21", "score": "0.72359246", "text": "constructor(props) {\n super(props);\n\n console.log('Executing RenderClassDemo Constructor');\n }", "title": "" }, { "docid": "697e13aafa2fd5d24bc7d724eda49106", "score": "0.719597", "text": "render() { /* abstract */ }", "title": "" }, { "docid": "bb022fab6ce78ded10b9cf0e1b89238c", "score": "0.7180636", "text": "render(...args) {\n super.render(...args)\n }", "title": "" }, { "docid": "fcfdddd223a2d0813abcb2c34f7e96ab", "score": "0.7163631", "text": "render() {\n return <div />;\n }", "title": "" }, { "docid": "fcfdddd223a2d0813abcb2c34f7e96ab", "score": "0.7163631", "text": "render() {\n return <div />;\n }", "title": "" }, { "docid": "cee885e97eb9e1946ca3b64cb6065ff4", "score": "0.71594155", "text": "render() {\r\n return (\r\n <div>\r\n {this.renderContent()}\r\n </div>\r\n );\r\n }", "title": "" }, { "docid": "ee1cf183dfa39a2e3fedfd90bdffd752", "score": "0.71294", "text": "render(){\n\t\treturn <div className={this.state.element_classname} />\n\t}", "title": "" }, { "docid": "f3b35e38dcc89e1ec7e82facc1b86c35", "score": "0.70953804", "text": "render() {\n return <div className='border-red'>{this.renderContent()}</div>;\n }", "title": "" }, { "docid": "740cc9781cd1784970c5600f16ff0425", "score": "0.7077278", "text": "render() {\n return this.state.component;\n }", "title": "" }, { "docid": "a75d764e4d32fb6c399633abb99ebe2e", "score": "0.7060052", "text": "render() { \n return (\n <div className=\"border red\">\n {this.renderContent() }\n </div>\n );\n }", "title": "" }, { "docid": "cfc5c26b4bedfb94178e4a07362dc944", "score": "0.69951206", "text": "render() {\n return (\n <div className=\"border red\">\n {this.renderContent()}\n </div>\n );\n }", "title": "" }, { "docid": "e3facdfaa11728a08ed3dc32b2e941a3", "score": "0.69910735", "text": "constructor() {\n super();\n this.render();\n }", "title": "" }, { "docid": "e3facdfaa11728a08ed3dc32b2e941a3", "score": "0.69910735", "text": "constructor() {\n super();\n this.render();\n }", "title": "" }, { "docid": "67d0dc82f6ae478ce219e3424f539aca", "score": "0.6985173", "text": "render() {\n\t\t// Default components just need to scope a piece of DOM from constructor\n\t\tthis.setElement();\n\t\tsetTimeout(() => this.onRender(), 0);\n\t}", "title": "" }, { "docid": "d1b986d1ad90a1045c7de30203e353e5", "score": "0.6961421", "text": "render () {\n return <div></div>\n }", "title": "" }, { "docid": "53ce475be874348fb0f386aa5a2c1f0b", "score": "0.6953273", "text": "render(props, state) {\n\t\treturn h('div', { component:this.constructor.name }, props.children);\n\t}", "title": "" }, { "docid": "4fde8d308f0c19fb09ea3a1d672b588c", "score": "0.6948253", "text": "render() {\n return (\n <div className=\"border red\">\n { this.renderContent()}\n </div>\n )\n }", "title": "" }, { "docid": "db21f22bd6dc9307145759528188582b", "score": "0.6946327", "text": "render() {\n if (this.props.controller) {\n return <this.props.controller.View />;\n }\n return this.props.prerenderedHTML.value;\n }", "title": "" }, { "docid": "a480473fef5aa8c61585eefe3bc0dbf6", "score": "0.6938322", "text": "render (props) {\n if (this.state.error) return this.renderDefaultError(props)\n return this.renderContent(props)\n }", "title": "" }, { "docid": "229b00b74044e2a2a9a1982fed09e2cd", "score": "0.69179004", "text": "constructor (props) {\n super(props);\n\n // Member Variables\n this.state = {\n };\n\n // Function Bindings\n this.render = this.render.bind(this);\n\n }", "title": "" }, { "docid": "4467c70410c5bbf8c5b658e6a890c5e2", "score": "0.6902922", "text": "function doRender(props, state, context) {\n return this.constructor(props, context);\n }", "title": "" }, { "docid": "4467c70410c5bbf8c5b658e6a890c5e2", "score": "0.6902922", "text": "function doRender(props, state, context) {\n return this.constructor(props, context);\n }", "title": "" }, { "docid": "ae3eaf2600940c5d1ccaf1dec567cb79", "score": "0.68972135", "text": "render(){\n\t\treturn (\n\t\t\t<div className = \"border red\">\n\t\t\t\t{this.renderContent()}\n\t\t\t</div>\n\t\t)\n\t}", "title": "" }, { "docid": "933bcef9a71e8f17c3ce9cc9ccadaf78", "score": "0.68822414", "text": "render(){\n return(<div></div>)\n }", "title": "" }, { "docid": "587b60c25bb008c3685d57ecb9859547", "score": "0.6877859", "text": "render(){\n return(\n <div className=\"border red\">\n {this.renderContent()}\n </div>\n );\n }", "title": "" }, { "docid": "9f65ccc5f39304837c47c5aa9b202c06", "score": "0.6873096", "text": "render() {\n return super.render();\n }", "title": "" }, { "docid": "745d4859351d4d0c5f72a3cb52447923", "score": "0.6868173", "text": "function render() {\n\t\tReact.render(\n\t\t\t<TodoApp/>,\n\t\t\tdocument.getElementsByClassName('todoapp')[0]\n\t\t);\n\t}", "title": "" }, { "docid": "08d55ffb4a57dd2e2da4db2b7b35723b", "score": "0.684772", "text": "render() {\n /**\n * You can create `ReactElements` in plain JavaScript using `React.\n * createElement` or use the built-in factories for common HTML tags. A\n * `ReactElement` factory takes a hash of properties as their first\n * argument followed by a variable number of optional child arguments.\n */\n return (\n <p>Hello {this.props.name}<strong>!</strong></p>\n );\n }", "title": "" }, { "docid": "8652d7283bbe95bb153027346cae5c82", "score": "0.68442404", "text": "render() {\n return (\n <div>\n <div>{this.renderContent()}</div>\n\n </div>\n )\n }", "title": "" }, { "docid": "f733370a7272cf8c2505baba3106d531", "score": "0.68383", "text": "render() {\n throw new Error(\"Abstract method!\");\n }", "title": "" }, { "docid": "10ddae6e4d4268f23ba0bd0b0994c22e", "score": "0.68133444", "text": "function doRender(props, state, context) {\n return this.constructor(props, context);\n}", "title": "" }, { "docid": "10ddae6e4d4268f23ba0bd0b0994c22e", "score": "0.68133444", "text": "function doRender(props, state, context) {\n return this.constructor(props, context);\n}", "title": "" }, { "docid": "5926a3bfe1056aa95774012841625873", "score": "0.68105996", "text": "function doRender(props, state, context) {\n \treturn this.constructor(props, context);\n }", "title": "" }, { "docid": "0d11419045d66f8bb929962575334dcd", "score": "0.68039656", "text": "render(){}", "title": "" }, { "docid": "0d11419045d66f8bb929962575334dcd", "score": "0.68039656", "text": "render(){}", "title": "" }, { "docid": "0d11419045d66f8bb929962575334dcd", "score": "0.68039656", "text": "render(){}", "title": "" }, { "docid": "3a7a2d74fa1429ba1ab3b51eaae4fe7a", "score": "0.68007493", "text": "render() {\n console.log(\"Render\");\n return (\n <div>\n </div>\n );\n }", "title": "" }, { "docid": "b626a67d2f4548621f3d44fd3f382fd0", "score": "0.6800705", "text": "render() {\n return (\n <div></div>\n );\n }", "title": "" }, { "docid": "d1f66b4d4f2ef4597d51881e21e49873", "score": "0.6773061", "text": "render () {\n\n }", "title": "" }, { "docid": "50a3f79909cec4190fe65c158b1b5226", "score": "0.675518", "text": "render() {\n // the reason we return this.props is because for render virtual doms need to have the INSTANT/tick\n return (\n <div>\n <div className=\"header\">{this.props.title}</div>\n <Card/>\n </div>\n );\n }", "title": "" }, { "docid": "a397b3d8e209accaf3e187cc56cbc937", "score": "0.6744716", "text": "render() {\n return (\n <div>testy</div>\n )\n }", "title": "" }, { "docid": "a928ae62e0a697aa814e7801a2fa5215", "score": "0.6740085", "text": "function render() {}", "title": "" }, { "docid": "d76e157405771fa7948b6f4ab801efe2", "score": "0.6730197", "text": "render () {\n return (<div>Hello World</div>);\n }", "title": "" }, { "docid": "d001d8cdf01dcbb048bba11488d4d2f5", "score": "0.6717403", "text": "render() { //render= load\n return <h1>Hello, {this.props.name}</h1>;\n }", "title": "" }, { "docid": "c53a28010895c232c89ba7ddec2e708b", "score": "0.67141396", "text": "function renderComponent(ComponentClass, props = {}, state = {}) {\n //ComponentClass refers to component class build (ex. CommentBox extends Component)\n //make instance of said class (below)\n //renderIntoDocument requires DOM, need react-dom library.\n const componentInstance = TestUtils.renderIntoDocument(\n // probably going to need to wrap this in Provider once reducers come into play....\n <ComponentClass {...props} />\n\n );\n //find & return DOM node.\n //ReactDOM.findDOMNode gives reference to html\n //wrapped in jQuery to connect it to helpers from jQuery Chai.\n return $(ReactDOM.findDOMNode(componentInstance));\n}", "title": "" }, { "docid": "d12a96dbca6cf20b391d0e239807d29c", "score": "0.6711594", "text": "render(force = false, options = {}) {\n this.#instance?.render(force, options);\n }", "title": "" }, { "docid": "e2412c13b781f91222d1f0933110c926", "score": "0.67012787", "text": "render() {\n return (\n <div>\n that's pretty cool\n </div>\n )\n }", "title": "" }, { "docid": "76be2194b3fe849792e1008ca7ff33a0", "score": "0.6700705", "text": "render () {\n return <WrappedComponent { ...this.props }/>\n }", "title": "" }, { "docid": "1ce8c8221be1e9a76e8247908b5b838e", "score": "0.66939235", "text": "render() {\n return <View>{this.renderContent()}</View>;\n }", "title": "" }, { "docid": "e0adc0956ee7d2f71425b220350d05c1", "score": "0.6692219", "text": "render(){\n return <sub className=\"x\">Hello X<Y/></sub>\n }", "title": "" }, { "docid": "44b3ad3446b3d62cba1a536d79e5a8c9", "score": "0.6677595", "text": "render() {\n return <div className=\"App\"></div>;\n }", "title": "" }, { "docid": "0372a6b6d5b1728c3c0ad90c6e6d2440", "score": "0.6667822", "text": "render() {\n return (\n <div>\n Hello\n </div>\n )\n }", "title": "" }, { "docid": "1d4e2ff445ccd7a4120f1d40460504ff", "score": "0.66622704", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "d2595ef449c6f89b157d1adeb705334e", "score": "0.6656632", "text": "render() { }", "title": "" }, { "docid": "f377966d38ff45fde23aedf1343cd77a", "score": "0.6645395", "text": "render() {\n console.log('render');\n /*\n return (\n <div>\n Latitude : {this.state.lat}\n <br />\n Error : {this.state.errorMessage}\n </div>\n );*/\n\n return <div className=\"border red\">{this.renderContent()}</div>;\n }", "title": "" }, { "docid": "e95563c99b16b24ff3027eebbf757d8c", "score": "0.66414326", "text": "render() { \n \n \n\n return (\n this.renderDisplay()\n )\n }", "title": "" }, { "docid": "f2972cf748d7a64e9188a6ba92a6117c", "score": "0.6640284", "text": "render() {\n }", "title": "" }, { "docid": "00398f0ec7b6d8abe9c95335fbd8c038", "score": "0.6635306", "text": "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "title": "" }, { "docid": "d08acca6cc8e2fa75da282ee860f6472", "score": "0.66348463", "text": "function renderComponent(ComponentClass, props ={}, state={}) { //components need state and props to render sometimes, hooked up to redux store.\n //Hooking up redux store to our component in case it requires props.\n //Using JSX to get the isntance of our class\n const componentInstance = TestUtils.renderIntoDocument(\n <Provider store={createStore(reducers,state)}>\n <ComponentClass {...props}/>\n </Provider>\n );\n return $(ReactDOM.findDOMNode(componentInstance)); //We wrap the DOM node with jquery and return it so it can be used by the chai library.\n}", "title": "" }, { "docid": "55d09c0edf32afefc9aa988d46c8f364", "score": "0.6630595", "text": "render() \n {\n return <div className=\"ui divided list\">{this.renderList()}</div>;\n }", "title": "" }, { "docid": "1ea9297a0595413d9624b5e69eaad102", "score": "0.66279924", "text": "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "title": "" }, { "docid": "1ea9297a0595413d9624b5e69eaad102", "score": "0.66279924", "text": "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "title": "" }, { "docid": "1ea9297a0595413d9624b5e69eaad102", "score": "0.66279924", "text": "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "title": "" }, { "docid": "1ea9297a0595413d9624b5e69eaad102", "score": "0.66279924", "text": "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "title": "" }, { "docid": "1ea9297a0595413d9624b5e69eaad102", "score": "0.66279924", "text": "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "title": "" }, { "docid": "1ea9297a0595413d9624b5e69eaad102", "score": "0.66279924", "text": "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "title": "" }, { "docid": "1ea9297a0595413d9624b5e69eaad102", "score": "0.66279924", "text": "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "title": "" }, { "docid": "1ea9297a0595413d9624b5e69eaad102", "score": "0.66279924", "text": "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "title": "" }, { "docid": "1ea9297a0595413d9624b5e69eaad102", "score": "0.66279924", "text": "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "title": "" }, { "docid": "1ea9297a0595413d9624b5e69eaad102", "score": "0.66279924", "text": "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "title": "" }, { "docid": "1ea9297a0595413d9624b5e69eaad102", "score": "0.66279924", "text": "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "title": "" }, { "docid": "1ea9297a0595413d9624b5e69eaad102", "score": "0.66279924", "text": "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "title": "" }, { "docid": "1ea9297a0595413d9624b5e69eaad102", "score": "0.66279924", "text": "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "title": "" }, { "docid": "1ea9297a0595413d9624b5e69eaad102", "score": "0.66279924", "text": "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "title": "" }, { "docid": "1ea9297a0595413d9624b5e69eaad102", "score": "0.66279924", "text": "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "title": "" }, { "docid": "1ea9297a0595413d9624b5e69eaad102", "score": "0.66279924", "text": "function doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}", "title": "" }, { "docid": "8b26cd4815995e8a4b86df1967b4e607", "score": "0.66255987", "text": "render() {\n return <React.Fragment>{this.props.children}</React.Fragment>\n }", "title": "" }, { "docid": "2d5f7ce9115bbf56b50d3c6bfe4feac8", "score": "0.66205245", "text": "function MyClass (props){\n render(\n <h1>hello, {props.name}</h1>\n )\n}", "title": "" }, { "docid": "2552c79ef232e7bb3e42b381ec4ac788", "score": "0.66147375", "text": "render(){\n return <ComponentToBeRendered {...this.props} />\n }", "title": "" }, { "docid": "8fa93c1a7efd297a6faf7c7772f8a93f", "score": "0.6590764", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "18e31cc300bb9cdaf1808eed31477a00", "score": "0.6584071", "text": "render(){\n if(this.renderer){\n this.renderer.render();\n }\n }", "title": "" }, { "docid": "63e678913607b1454ae8da088bdf7912", "score": "0.65839416", "text": "render(){\n return(\n <sub className=\"v\">Hello U<V/></sub>\n );\n }", "title": "" }, { "docid": "3eb613133d902305780421bc3227b791", "score": "0.65826", "text": "render() {\n // parenthesis is not required but makes it nice to put things on new lines:\n return (\n <div>\n <h1>Hello World render methods</h1> <b>bold child </b>\n </div>\n );\n }", "title": "" }, { "docid": "0cabf7966d08c89694fa7a3666a22554", "score": "0.6580923", "text": "function renderComponent(ComponentClass, props, state) {\n //creating a component witth renderIntoDocument method that will use our Window obj\n const componentInstance = TestUtils.renderIntoDocument(\n // pushing reducers ,state to the create store redux function \n <Provider store={createStore(reducers, state)}>\n {/* and passing props to the component from reducer */}\n <ComponentClass {...props} />\n </Provider>\n );\n\n return $(ReactDOM.findDOMNode(componentInstance)); // THIS IS PODUCES HTML + we add jQuery to it L\n}", "title": "" }, { "docid": "301b221e5cdf649e08563efa82331163", "score": "0.657337", "text": "render() {\n }", "title": "" }, { "docid": "e4ab7d785d8d8d1be8ca09ab497050fc", "score": "0.6561547", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "e4ab7d785d8d8d1be8ca09ab497050fc", "score": "0.6561547", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "e4ab7d785d8d8d1be8ca09ab497050fc", "score": "0.6561547", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "4bfac131763f28196002409f7c0f8ee7", "score": "0.6534547", "text": "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "title": "" } ]
c0840d1c4a98c7ea1e84a1e035d0a0a6
Parses the given data into HTML using markdown and Latex syntax and loads it into the required destination
[ { "docid": "8654bce90393fb40137b894ccac19c53", "score": "0.61838543", "text": "function runMarkdownLatexAtDest(destination, markdownData) {\r\n $(destination).html(runMarkdownLatex(markdownData));\r\n}", "title": "" } ]
[ { "docid": "87f28b2e18f4455ecef142aea898013b", "score": "0.63849676", "text": "function PostToHTML(relpath, markdown_body) {\n var callback = function (text) {\n\n /* circumvent github's auto-meta parsing */\n text = text.replace(\"(((\",'---');\n text = text.replace(\")))\",'---');\n\n /* write some HTML to format the data */\n var body = document.getElementById(markdown_body);\n var post_head = document.createElement('div');\n var post_body = document.createElement('div');\n body.appendChild(post_head);\n body.appendChild(post_body);\n\n if ((isBlank(text)) || (text == null) || (text == 'null') || (typeof text === 'undefined')) {\n post_head.innerHTML = 'Unable to load text for: '+relpath;\n return;\n }\n\n /* parse YAML header */\n var obj = jsyaml.loadFront(text)\n\n /* check for post meta data */\n var date = typeof obj.Date !== 'undefined' ? obj.Date.toDateString() : '';\n var author = typeof obj.Author !== 'undefined' ? obj.Author : '';\n var summary = typeof obj.Summary !== 'undefined' ? obj.Summary : '';\n var title = typeof obj.Title !== 'undefined' ? obj.Title : '';\n\n /* write some HTML to format the data */\n post_head.innerHTML = '<b>'+title+'</b><br> &nbsp; &nbsp; '+author+\n ' | <small>'+date+'</small><br><br>';\n\n /* convert the unparsed content as markdown */\n post_body.innerHTML = Showdown(obj.__content);\n $('.linenums').removeClass('linenums');\n prettyPrint();\n };\n getFile(relpath, callback);\n}", "title": "" }, { "docid": "a86275783877cb7582c62027ff45c5a0", "score": "0.6327644", "text": "function processMarkdown(fileData) {\n\n\t// Convert this to a string and check that we had\n\tlet fileString = fileData.toString();\n\n\t// We'll do a regex on this and check matches\n\tlet blocks = fileString.match(/{{(.*?)}}/g);\n\tif (blocks === undefined || blocks === null)\n\t\treturn fileData\n\n\tfor (let k=0; k < blocks.length; k++)\n\t{\n\t\t// We already know where these should be\n\t\tlet blockPath = \"views/\" + blocks[k].substr(2, blocks[k].length - 4);\n\n\t\t// Check that they exist synchronously\n\t\tif (fs.existsSync(blockPath) ){\n\n\t\t\t// Same thing, do it synchronously\n\t\t\tlet partialFileData = fs.readFileSync(blockPath);\n\n\t\t\t// A bit redundant as we're calling this FROM here, but it will\n\t\t\t// allow us to nest other partial html blocks\n\t\t\tlet partialFileString = processMarkdown(partialFileData);\n\n\t\t\t// Replace all of the markdown\n\t\t\tfileString = fileString.replace(blocks[k], partialFileString);\n\n\t\t} else {\n\t\t\tconsole.log(\">> Partial HTML file not found: \" + blockPath);\n\t\t}\n\t}\n\n\treturn fileString;\n}", "title": "" }, { "docid": "d7782872794846d2322646a18e7fc025", "score": "0.6295711", "text": "function doPager(data) {\n\t\t//\tDocument Breaks\n\t\t\tvar br, major, minor;\n\t\t\tvar headingsRE, headingMajor, headingMinor, headingMiniscule, RE;\n\t\t\t//\tHeading Regular Expressions:\n\t\t\t\tvar breaks=settings.languages[data.language].breaks;\n\t\t\t\tvar literals=/[-\\/\\\\^$*+.()|[\\]{}]/g;\n\t\t\t//\tBreaks\n\t\t\t\tif(Array.isArray(breaks.major)) {\n\t\t\t\t\tmajor=[];\n\t\t\t\t\tbreaks.major.forEach((value,i)=>major[i]=value.replace(literals,'\\\\$&'));\n\t\t\t\t\tmajor=major.join('|');\n\t\t\t\t}\n\t\t\t\telse major=breaks.major.replace(literals,'\\\\$&');\n\t\t\t\tif(breaks.minor) {\n\t\t\t\t\tif(Array.isArray(breaks.minor)) {\n\t\t\t\t\t\tminor=[];\n\t\t\t\t\t\tbreaks.minor.forEach((value,i)=>minor[i]=value.replace(literals,'\\\\$&'));\n\t\t\t\t\t\tminor=minor.join('|');\n\t\t\t\t\t}\n\t\t\t\t\telse minor=breaks.minor.replace(literals,'\\\\$&');\n\t\t\t\t}\n\t\t\t\telse minor=null;\n\t\t\t\tdata.br=`${major}\\\\s+|${minor}\\\\s+`;\n\t\t\t\t//\tBreak Regular Expressions\n\n\t\t\t\t\theadingsRE=new RegExp(`(?:\\\\n\\\\s*)(?=${data.br})`);\n\t\t\t\t\theadingsRE=new RegExp(`(?:\\\\n)(?=\\\\s*(${data.br}))`);\n\n\t\t\t\t\theadingMajor=new RegExp(`^(\\\\s*)(${major})\\\\s+(.*?)\\\\r?\\\\n`);\n\t\t\t\t\theadingMinor=new RegExp(`^(\\\\s*)(${minor})\\\\s+(.*?)\\\\r?\\\\n`);\n\n\t\t\t\t\t//\tSpecial Case: Markdown\n\n\t\t\t\t\t\tif(data.language=='markdown') {\n\t\t\t\t\t\t\theadingsRE=/(?:\\n)(?=#{1,3}[^#])/;\n\t\t\t\t\t\t\theadingMajor=/^(\\s*)(##[^#]*?)\\s+(.*)/m;\n\t\t\t\t\t\t\theadingMajor=/^(\\s*)(#[^#]*?)\\s+(.*)/m;\n\t\t\t\t\t\t\theadingMinor=/^(\\s*)(#{2,3}[^#]*?)\\s+(.*)/m;\n\t\t\t\t\t\t\theadingMiniscule=/^(\\s*)(###[^#]*?)\\s+(.*)/m;\n\t\t\t\t\t\t}\n\n\t\t//\tDocument Info Footer\n\t\t\telements.indexHeading.innerHTML=data.fileName;\n\t\t\telements.footerHeading.innerHTML=`Breaks: ${data.br}`;\n\n\t\t//\tVariables\n\t\t\tlet selected = null;\n\t\t\tlet title;\n\n\t\t//\tToggle Heading\n\t\t\tfunction toggleHeading(event) {\n\t\t\t\t//\tif(this !== event.target) return;\n\t\t\t\tif(event.shiftKey) {\n\t\t\t\t\tvar open = event.target.parentElement.classList.contains('open');\n\t\t\t\t\theadingItems.forEach(i => {\n\t\t\t\t\t\ti.classList.toggle('open',!open);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse event.target.parentElement.classList.toggle('open');\n\n\t\t\t\t//\tSave Index Status\n\t\t\t\t\tdata.indexStatus = [];\n\n\t\t\t\t\tlet ul = elements.indexUL.querySelectorAll('li');\n\t\t\t\t\tul.forEach(li => {\n\t\t\t\t\t\tdata.indexStatus.push(Array.from(li.classList));\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t//\tPopulate Index\n\t\t\telements.indexUL.innerHTML = '';\n\t\t\tlet nested=false, ul, previous=null;\n\t\t\tlet headingItems = [];\n\t\t\tlet items = data.text.split(headingsRE);\n\n\t\t\tif(items.length>1) {\n\t\t\t\tlet previous = undefined, selected = undefined;\n\t\t\t\titems.forEach((value,i) => {\n\t\t\t\t\tlet li = document.createElement('li');\n\n\t\t\t\t\tRE = value.match(headingMajor);\n\t\t\t\t\tif(RE && RE[3]) {\t\t//\tMajor Heading\n\t\t\t\t\t\tnested = false;\n\t\t\t\t\t\ttitle=RE[3];\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tRE = value.match(headingMinor);\n\t\t\t\t\t\tif(RE && RE[3]) {\t//\tNesting\n\t\t\t\t\t\t\tif(!nested) {\n\t\t\t\t\t\t\t\tnested = true;\n\t\t\t\t\t\t\t\telements.indexUL.appendChild(li);\n\n\t\t\t\t\t\t\t\tif(state['index-open-all']) previous.classList.add('open');\n\t\t\t\t\t\t\t\tvar button = document.createElement('button');\n\t\t\t\t\t\t\t\t\tbutton.innerHTML = '›';\n\t\t\t\t\t\t\t\t\tbutton.onclick = toggleHeading;\n\t\t\t\t\t\t\t\tprevious.insertAdjacentElement('afterbegin',button);\n\n\t\t\t\t\t\t\t\tprevious.ondblclick = toggleHeading;\n\n\t\t\t\t\t\t\t\tul = document.createElement('ul');\n\t\t\t\t\t\t\t\tprevious.appendChild(ul);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttitle = RE[3];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse title = '';\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!title.length) return;\n\n\t\t\t\t\tli.insertAdjacentHTML('beforeend',`<span>${title}</span>`);\n\t\t\t\t\tif(data.language == 'markdown' && value.match(headingMiniscule)) li.classList.add('subtitle');\n\t\t\t\t\tli.next=li.previous = undefined;\n\t\t\t\t\tif(previous) {\n\t\t\t\t\t\tprevious.next = li;\n\t\t\t\t\t\tli.previous = previous;\n\t\t\t\t\t}\n\t\t\t\t\tprevious = li;\n\t\t\t\t\theadingItems.push(li);\n\n//\t\t\t\t\tvar thing=value.split(/\\r?\\n/).forEach((v,i,a)=>a[i]=v.replace(new RegExp(`^${RE[1]}`),''));\n\t\t\t\t\tif(RE[1]) {\n\t\t\t\t\t\tvar lines = value.split(/\\r?\\n/);\n\t\t\t\t\t\tvar indent = new RegExp(`^${RE[1]}`);\n\t\t\t\t\t\tlines.forEach((v,i,a) => {\n\t\t\t\t\t\t\ta[i]=v.replace(indent,'');\n\t\t\t\t\t\t});\n\t\t\t\t\t\tvalue = lines.join('\\n');\n\t\t\t\t\t}\n\n\t\t\t\t\tli.data = data;\n\t\t\t\t\tli.item = value;\n\t\t\t\t\tli.title = title;\n\t\t\t\t\tli.i = i;\n\n//\t\t\t\t\tli.onclick = loadItem.bind(li,data,value,title,i);\n\t\t\t\t\tli.onclick = loadItem;\n\n\n\t\t\t\t\tif(nested) ul.appendChild(li);\n\t\t\t\t\telse elements.indexUL.appendChild(li);\n\t\t\t\t\tif(i==data.item) selected = li;\n\t\t\t\t\tprevious = li;\n\n\t\t\t\t\tif(!selected) selected = li;\n\t\t\t\t});\n\n\t\t\t\tif(data.indexStatus.length) {\n\t\t\t\t\tlet ul = elements.indexUL.querySelectorAll('li');\n\n\t\t\t\t\tul.forEach(li => {\n\t\t\t\t\t\tlet shift = data.indexStatus.shift();\n\t\t\t\t\t\tshift.forEach(className => {\n\t\t\t\t\t\t\tli.classList.add(className);\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif(selected) selected.click();\n\t\t\t}\n\t\t\telse showItem(data.text,data.fileName,true);\n\n\t//\tNot Empty\n\t\telements.contentDiv.classList.remove('empty');\n\n\t//\tLoad Content - when heading selected\n\t\tfunction loadItem(event) {\n\t\t\tevent.stopPropagation();\n\n\t\t\tlet data = event.currentTarget.data;\n\t\t\tlet item = event.currentTarget.item;\n\t\t\tlet title = event.currentTarget.title;\n\t\t\tlet i = event.currentTarget.i;\n\n\t\t\telements.previousButton.onclick = elements.nextButton.onclick = null;\n\t\t\tlet p, n;\n\t\t\tif(p = event.currentTarget.previous) elements.previousButton.onclick = event => {\n\t\t\t\t\tp.click();\n\t\t\t\t};\n\t\t\tif(n = event.currentTarget.next) elements.nextButton.onclick = event=> {\n\t\t\t\t\tn.click();\n\t\t\t\t};\n\n\t\t\tvar doHighlight = elements.formControl.elements['show-highlight'].checked?!event.altKey:event.altKey;\n\t\t\tcurrentItem = data.li = event.currentTarget;\n\n\t\t\tif(selected) selected.classList.remove('selected');\n\t\t\tselected = event.currentTarget;\n\t\t\tselected.classList.add('selected');\n\t\t\tdata.item = i;\n\n\t\t\tshowItem(item, title, doHighlight);\n\t\t}\n\n\t\tfunction prepareItem() {\n\n\t\t}\n\n\t\tfunction showItem(item, title, doHighlight) {\n\t\t\telements.footerFile.innerHTML = `${data.path}/${data.fileName}`;\n\t\t\telements.footerLanguage.innerHTML = `Language: ${data.language}`;\n\t\t\telements.iframeBody.classList.remove('markdown');\n\n\t\t\tvar language=['js','javascript','sql','php'].indexOf(data.language)>-1;\n\t\t\telements.codeElement.textContent = item;\n\n\t\t\telements.codeElement.classList.forEach(className => {\n\t\t\t\tif(className.startsWith('language-')) elements.codeElement.classList.remove(className);\n\t\t\t});\n\t\t\telements.codeElement.classList.add(`language-${data.language}`);\n\t\t\tlineNumbers.style.display='block';\n\t\t\telements.codeElement.style.display = 'block';\n\t\t\telements.mdElement.style.display = 'none';\n\t\t\telements.iframeCSS.href = '';\n\n\t\t\tif(data.language && doHighlight) {\n\t\t\t\tif(data.language != 'markdown') {\n\t\t\t\t\telements.codeElement.innerHTML = Prism.highlight(item, Prism.languages[data.language], data.language);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar div=document.createElement('div');\n\n\t\t\t\t\tvar innerHTML=marked.parse(item,{baseUrl: `${data.path}/${data.fileName}`, renderer});\n\n\t\t\t\t\tinnerHTML=innerHTML.replace(/<img(.*?)src=\"(.*)\"(.*?)>/g,function(match,p1,p2,p3,offset,string) {\n\t\t\t\t\t\tif (p2.match(/^https?:\\/\\//) || p2.startsWith('/') || p2.match(/^[A-Z]:\\//)) return `<img${p1}src=\"${p2}\"${p3}>`;\n\t\t\t\t\t\telse return `<img${p1}src=\"${currentTab.data.path}/${p2.replace(/^\\//,'')}\"${p3}>`;\n\t\t\t\t\t});\n\n\t\t\t\t\tdiv.innerHTML=innerHTML;\n\n\t//\t\t\t\tvar doEtc = false;\tif(doEtc)\n\t\t\t\t\tdiv.querySelectorAll('pre').forEach(pre=>{\n\t\t\t\t\t\tvar code = pre.querySelector('code');\n\t\t\t\t\t\tvar html = code.textContent;\n\t\t\t\t\t\tvar language = code.className.match(/\\blanguage-(.*)\\b/);\n\t\t\t\t\t\tif(language) {\n\t\t\t\t\t\t\tlanguage = language[1];\n\t\t\t\t\t\t\tcode.innerHTML=Prism.highlight(html, Prism.languages[language], language);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tvar h2 = div.querySelector('h1,h2,h3');\n\t\t\t\t\tdiv.id=h2.id;\n\t\t\t\t\th2.id='';\n\t\t\t\t\tdiv.className=h2.className;\n\t\t\t\t\tdiv.classList.add(h2.tagName.toLowerCase());\n\t\t\t\t\th2.removeAttribute('id');\n\t\t\t\t\th2.removeAttribute('class');\n\t\t\t\t\telements.mdElement.innerHTML=div.outerHTML;\n\t\t\t\t\telements.iframeBody.classList.add('markdown');\n\n\t\t\t\t\t//\tvar open=null;\n\t\t\t\t\telements.iframeBody.querySelectorAll('li').forEach(li=>{\n\t\t\t\t\t\tli.addEventListener('click',function(event) {\n\t\t\t\t\t\t\tthis.classList.toggle('selected');\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t},false);\n\t\t\t\t\t\tif(li.querySelector('ul'))\n\t\t\t\t\t\t\tli.addEventListener('click',function(event) {\n\t\t\t\t\t\t\t\tif(event.shiftKey) {\n\t\t\t\t\t\t\t\t\tthis.classList.toggle('open');\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t[...this.parentNode.children].forEach(li=>{\n\t\t\t\t\t\t\t\t\tif(li==event.target) li.classList.toggle('open');\n\t\t\t\t\t\t\t\t\telse li.classList.remove('open');\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t//\tevent.stopPropagation();\n\t\t\t\t\t\t\t},false);\n\t\t\t\t\t});\n\n\t\t\t\t\tlineNumbers.style.display='none';\n\t\t\t\t\telements.codeElement.style.display='none';\n\t\t\t\t\telements.mdElement.style.display='block';\n\n\t\t\t\t\telements.iframeCSS.href=`${data.css}`;\n\n\n\t\t\t\t}\n\t\t\t}\n\n//\t\t\t\telements.iframeCSS.href=`${data.css}`;\n\n\t\t\tdocument.title=documentTitle+': '+data.fileName+' — '+title;\n//\t\t\telements.h1.innerHTML=documentTitle+': '+data.fileName+' — '+title;\n\t\t\telements.contentHeading.innerHTML=title;\n\t\t\telements.codeElement.resetLineNumbers();\n\n\t\t}\n\t}", "title": "" }, { "docid": "7c71e7e020b036cf3bdb38c041707076", "score": "0.6076059", "text": "function process(){\n var parsed = parser.parse(editor.getValue());\n\n when.all([ \n mGen1.render(parsed.html, parsed.exercises, parsed.rubrics, {mode:'preview', userType: 'viewer'}),\n mGen2.render(parsed.html, parsed.exercises, parsed.rubrics, {mode:'preview', userType: 'presenter'})\n ])\n .then(function(out){\n //make html pretty\n var viewerHtml = beautify_html(out[0], { \n indent_size: 2 ,\n preserve_newlines: true });\n var presenterHtml = beautify_html(out[1], { \n indent_size: 2 ,\n preserve_newlines: true });\n\n\n injectHtmltoIframe(viewerIframe, viewerHtml)\n injectHtmltoIframe(presenterIframe, presenterHtml)\n \n\n $('#render-presenter').html(presenterHtml)\n // show generated code\n $('#viewer-src').html(ent.encode(viewerHtml));\n $('#presenter-src').html(ent.encode(presenterHtml));\n $('.markup-section pre code').each(function(i, e) {\n hljs.highlightBlock(e)});\n }).catch(function(err){\n console.log(err, err.stack)\n })\n}", "title": "" }, { "docid": "e8289e078f0345a7d48952edd63fc3a3", "score": "0.5961299", "text": "function getMarkdownHTML(location) {\r\n\t\r\n\t\r\n\t$.ajax({\r\n\t async: false,\r\n\t type: 'GET',\r\n\t url: '/markdoco/a/up/'+location,\r\n\t success: function(data) {\r\n\t\t\t//get markdown HTML formated version for content tab\r\n\t\t\t$(\"#wiki_content\").html(data);\r\n\r\n\t\t\t//apply highlight javascript to pre code blocks\r\n\t\t\t$('pre code').each(function(i, e) {hljs.highlightBlock(e)}); \r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "84adaa8e699d2749b386d31d8af1e7ea", "score": "0.5958812", "text": "function getHTML() {\n var vulnote = $('#vulnote a').attr('href');\n $.get(vulnote).done(function(h) {\n var plainText = $($.parseHTML(h)).find(\"#id_content\").val();\n $('body').append('<textarea style=\"display:none\" id=\"ccB\"></textarea>');\n var simplemde = new EasyMDE({element: document.getElementById('ccB')})\n var simpleHTML = simplemde.markdown(plainText);\n\tvar link = document.createElement(\"a\");\n\tlink.download = \"VulReport.html\";\n\tlink.href = \"data:text/html;charset=utf8,\"+ encodeURIComponent(simpleHTML);\n\tdocument.body.appendChild(link);\n\tlink.click();\n\tdocument.body.removeChild(link);\n\tdelete link;\n });\n}", "title": "" }, { "docid": "09001a80f458fcd7db9fbd7d1589e6e9", "score": "0.5957455", "text": "function processHTML(done) {\n return gulp.src(PATHS.source.htmlPages)\n .pipe(nunjucksRender({\n path: [\n PATHS.source.nunjucks,\n PATHS.source.frontEndLibRoot\n ],\n autoescape: true,\n data: {}\n }))\n .pipe(gulp.dest(PATHS.destination.html))\n .pipe(reload({\n stream: true\n }));\n done();\n }", "title": "" }, { "docid": "a4b52d5e12230ad3323a1484f104d292", "score": "0.59565145", "text": "function generateMarkdown(data, data1) {\n return `# ${data.title}\n \n# Description: \n ${data.description}\n\n# Table of Contents:\n\n - Installation Instructions - Anything you need to install to make ${data.title} work\n\n - Usage Info - Lets you know how to use ${data.title}\n\n - Contributing Guidelines - How you can help improve ${data.title}\n\n - Testing Info - Any built in testing for ${data.title}\n\n - Licensing Info - Keeping ${data.title} as legal as possible\n \n - Questions or Concerns - Pass on your feedback for ${data.title}\n\n\n# Installation Instructions: \n ${data.installation}\n\n# Usage Info: \n ${data.usage}\n\n# Contributing Guidelines: \n ${data.contributing}\n\n# Testing Info: \n ${data.tests}\n\n# Licensing Info:\n\n ${renderLicenseBadge(data.license, data.github, data.title)}\n\n ${renderLicenseSection(data.license)}\n\n# Questions or Concerns: \n\n![](${data1.data.avatar_url}) \n\nIf you have any questions feel free to find me on GitHub. I'm ${data.github} and my email address is: ${data.email}`;\n\n\n}", "title": "" }, { "docid": "0c7fabd3595d440928d52b3212f4af5e", "score": "0.5954565", "text": "function load_markdown(map){\n load_markdown(map.data.mdfile, map.data.div);\n}", "title": "" }, { "docid": "0c7fabd3595d440928d52b3212f4af5e", "score": "0.5954565", "text": "function load_markdown(map){\n load_markdown(map.data.mdfile, map.data.div);\n}", "title": "" }, { "docid": "de80ae86f358cab900f3876a5316980f", "score": "0.5950412", "text": "function generateMarkdown(data) {\n// * Create content for Title, Desc, Image\n\nlet titleDesc = `# ${data.title}\\n\\n${data.desc}\\n\\n`\n\n\nif (data.relPath !== undefined){\n titleDesc += `![${data.title}](${data.relPath})\\n`\n}\n\n// * Create Table of contents based on which fields the user populated\n\nfunction tableFunc() {\nlet table = `## Table of Contents\\n\\n`\n\nif (data.instal !== undefined){\n table += `* [Installation](#installation)\\n`\n}\nif (data.usage !== undefined){\n table += `* [Usage](#usage)\\n`\n}\ntable += `* [Questions](#Questions?)\\n`\nif (data.collab !== undefined){\n table += `* [Collaborators](#collaborators)\\n`\n}\ntable += `* [License](#license)\\n`\nreturn table\n}\nlet finalTable = tableFunc()\n\n// Create content for Installation\n\nlet instal = ``\n if (data.usage !== undefined){\n instal += `\\n## Usage\\n\\n${data.usage}\\n`\n }\n\n// Create content for Usage\n\nlet usage = ``\nif (data.instal !== undefined){\n instal += `\\n## Installation\\n\\n${data.instal}\\n`\n} \n\n// Create Questions\n\nfunction quest(){ \n let questSec = `\\n## Questions?\\n\\nFor any inquiries or feedback, please reach me at [${data.github}](https://github.com/${data.github})\\n` \n if(data.email === undefined) {\n return questSec\n };\n let email = ` or at ${data.email}`\n questSec += email;\n return questSec\n};\n\nlet questions = quest()\n\n\n// Create content for Collaborators\n\nlet collab = ``;\nif (data.collab !== undefined){\n collab += `\\n## Collaborators\\n\\n${data.collab}\\n\\n`\n} \n\nlet lice = `## License\\n\\n${data.licen}\\nCopyright (c) ${moment().format(\"YYYY\")} ${data.github}`\n\n\n return titleDesc += finalTable += instal += usage += questions += collab += lice;\n}", "title": "" }, { "docid": "21e5dd3f7834c3ae9ebf3a7862679976", "score": "0.5887218", "text": "parseRaw(data, callback) {\n if (data) {\n data = applyExtendedMarkdown(data);\n data = applyGroupCode(data, \"\");\n data = applySpoiler(data, \"\");\n }\n callback(null, data);\n }", "title": "" }, { "docid": "76842812f42208857db375c8977bbbbb", "score": "0.5883834", "text": "function generateMarkdown(data) {\n let markDownFile = `# ${data.projectTitle}\\n\\n`;\n\n // Description\n markDownFile += `## Description\\n\\n`;\n markDownFile += `${data.projectDescription}\\n\\n`;\n\n if (data.addContent) {\n markDownFile += `**Project Motivation** - ${data.projectMotivation}\\n`;\n markDownFile += `**Project Reason** - ${data.projectReason}\\n`;\n markDownFile += `**Problem Addressed** - ${data.projectProblemAddressed}\\n`;\n markDownFile += `**Lessons Learned** - ${data.projectLessons}\\n`;\n markDownFile += `**Project Uniqueness** - ${data.projectUniqueness}\\n\\n`;\n }\n\n // Agile\n if (data.addAgile) {\n if (data.projectUserStory.length > 0) {\n markDownFile += `### User Story\\n\\n`;\n markDownFile += \"```\\n\" + data.projectUserStory + \"\\n\";\n markDownFile += \"```\\n\\n\";\n }\n\n if (data.projectAcceptanceCriteria.length > 0) {\n markDownFile += `### Acceptance Criteria\\n\\n`;\n markDownFile += \"```\\n\" + data.projectAcceptanceCriteria + \"\\n\";\n markDownFile += \"```\\n\\n\";\n }\n }\n\n // Table of Contents\n if (data.addTableOfContent) {\n markDownFile += `## Table of Contents\\n\\n`;\n markDownFile += `- [Installation](#installation)\\n`;\n markDownFile += `- [Usage](#usage)\\n`;\n markDownFile += `- [Credits](#credits)\\n`;\n markDownFile += `- [License](#license)\\n\\n`;\n\n markDownFile += `## Installation\\n\\n`;\n markDownFile += `Provide a step-by-step description of how to get the development environment running.\\n\\n`;\n markDownFile += `## Usage\\n\\n`;\n markDownFile += `Provide instructions and examples for use including screenshots as needed.\\n\\n`;\n markDownFile += `## Credits\\n\\n`;\n markDownFile += `List collaborators with links to their GitHub profiles.\\n\\n`;\n markDownFile += `## License\\n\\n`;\n markDownFile += `Let other developers know what they can and cannot do with your project.\\n\\n`;\n }\n\n // Features\n if (data.addFeatures) {\n markDownFile += `## Features\\n\\n`;\n markDownFile += `Provide product features here.\\n\\n`;\n }\n\n // Contributing\n if (data.addContribute) {\n markDownFile += `## Contributing Guidelines\\n\\n`;\n markDownFile += `Let other developers know how to contribute to your application or package.\\n\\n`;\n }\n\n // Tests\n if (data.addTests) {\n markDownFile += `## Test Instructions\\n\\n`;\n markDownFile += `Provide tests and examples of how to run your application.\\n\\n`;\n }\n\n // Contact Information\n if (data.addContactInformation) {\n markDownFile += `## Contact Information\\n\\n`;\n markDownFile += `For questions, comments, or suggestions, please contact me by E-Mail:\\n\\n`;\n markDownFile += `${data.projectEmailAddress}\\n\\n`;\n markDownFile += `Check out my other **cool** projects in GitHub - ${data.projectGitHubUsername}\\n\\n`;\n }\n\n // if (data.addLicense) {\n // License\n markDownFile += `## License\\n\\n`;\n markDownFile += `This application is licensed under the following license:\\n\\n`;\n markDownFile += renderLicenseSection(data.projectTypeOfLicense) + \"\\n\\n\";\n markDownFile += `For more information, please follow the link provided above.`;\n // }\n\n return markDownFile;\n}", "title": "" }, { "docid": "3772d96e146ba972cff563fd3af69f16", "score": "0.58655524", "text": "function generateMarkdown(data) {\n return `\n \n # ${data.title}\n \n\n ## Description \n\n ${data.description}\n\n https://github.com/${data.username}/UT06-2021-BG-Challenge9/blob/main/Develop/README.md\n\n The walkthrough video link : https://youtu.be/zD7MfmdJRd4\n\n ## Table of Contents\n\n * [Installation](#installation)\n * [Usage](#usage)\n * [Contributing](#contributing) \n * [Test](#tests) \n * [License](#license) \n * [Questions](#questions) \n\n ## Installation\n\n ${data.installation}\n\n ## Usage \n\n ${data.usage}\n\n ![alt text](./assets/images/Screenshot-proreadme.png)\n \n ## Badges\n\n ![badmath](https://img.shields.io/github/languages/top/nielsenjared/badmath)\n\n ${data.badges}\n\n ## Contributing\n\n ${data.contributing}\n\n ## Tests\n\n ${data.tests}\n\n ## License\n\n ${renderLicenseSection(`${data.license}`)}\n\n ${renderLicenseBadge(`${data.license}`)}\n\n If you have any question about license ,please visit to ${renderLicenseLink(`${data.license}`)}.\n\n ## Questions\n\n If you have any questions ,please check the link : https://github.com/${data.username}/UT06-2021-BG-Challenge9 \n\n If you have any additional questions , please Email to me by ${data.email}.\n\n`;\n}", "title": "" }, { "docid": "a50ed492f0970a311a792aeb425757cf", "score": "0.58594275", "text": "function generateMarkdown(data) {\n return `<h1 align=\"center\">${data.title}</h1> \n \n[LinkedIn]: https://www.linkedin.com/in/jason-barrera-ramirez-b2a473204/\n${renderLicenseBadge(data.license)}\n![followers](https://img.shields.io/github/followers/jbramirez03?style=social)\n\n${renderLicenseLink(data.license)}\n## Summary\n${data.description}\n## Table of Contents\n- [Installation](#installation)\n- [Usage](#usage)\n- [Credits](#credits)\n${renderTableContent(data.license)}\n- [Challenges](#challenges)\n- [Technologies](#technologies)\n- [Future development](#future-development)\n- [How to contribute](#how-to-contribute)\n- [Tests](#tests)\n- [Questions](#questions)\n## Installation\n${data.installation}\n## Usage\n${data.usage}\n## Credits\n${data.collaborators}<br><br>\n[<img align=\"left\" width=\"28px\" alt=\"LinkedIn\" src=\"https://user-images.githubusercontent.com/82244776/128110957-497edff3-59dc-41d6-89bc-be7570e441fe.png\" />][LinkedIn]<br><br>\n${renderLicenseSection(data.license)}\n## Challenges\n${data.challenges}\n## Technologies\n${data.technologies}\n## Features\n${data.features}\n## Future Development\n${data.future}\n## How to Contribute\n${data.contribute}\n## Tests\n${data.tests}\n## Questions\nIf there are any questions about the project get in contact with me at my [Email](mailto:[email protected])\n`;\n\n}", "title": "" }, { "docid": "c95e80d55bdf7a1ef8b31db01b4b83fa", "score": "0.58194584", "text": "function generateMarkdown(data) {\n return `# Readme\n\n# Table of Contents:\n1. ## Github Repo\n2. ## Github User\n3. ## Description\n4. ## Installation Steps\n5. ## Usage Description\n6. ## License\n7. ## Contributors\n8. ## Tests\n9. ## Questions\n\n## Github Repo\n${data.repo}\n\n## Github User\n${data.username}\n\n## Description\n${data.description}\n\n## Installation Steps\n${data.installation}\n\n## Usage Description\n${data.usage}\n\n## License\n![GitHub](https://img.shields.io/github/license/${data.username}/${data.repo})\n\n![Badge](${data.badge})\n\nhttps://github.com/${data.username}\n\n\n## Contributors\n${data.contributor}\n\n## Tests\n${data.test}\n\n## Questions\nQuestions/issues can be sent to: ${data.email}\n\n\n\n\n\n\n\n`;\n}", "title": "" }, { "docid": "5f3b2ea69ac95fe4c62f601f3e1f11a3", "score": "0.5815848", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n## Description\n\n ${data.description}\n\n \n ### Finished Product:\n\n![Finished README.md Example](assets/images/screenShot.png)\n \n \n## Table of Contents\n\n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#license)\n * [Contributing](#contributing)\n * [Tests](#tests)\n * [Questions](#questions)\n\n\n## Installation\n\n Steps for installation\n \n ${data.instalattionInstructions}\n\n\n## Usage\n\n${data.ussageInformation} \n\nExample: Answer the command line prompts\n\n![${data.usageAltImage}](${data.usageImage})\n\n\nFor a full video of real life application please refer to this link: http://github.com \n[Youtube](http://github.com)\n\n \n## ${renderLicenseSection(data)}\n\n\n\n## Badges\n${renderLicenseBadge(data)}\n\n## Contributing\n\n ${data.name} \n\n [Github](${data.githubLink})\n\n## Tests\n\n ${data.tests}\n\n## Questions\n\n ### Contact Me:\n -Email: ${data.email}\n\n -Github: ${data.githubName} Link: [GITHUB](${data.githubLink})\n`;\n}", "title": "" }, { "docid": "be60cb67a63c6e21b7097936f3492b07", "score": "0.58009624", "text": "function htmlTask() {\n console.info(Loggy.blue`[${config.buildOptions.project.name}]: Parsing HTML...`);\n\n return gulp.src(concatSource([\n config.buildOptions.pages.source,\n config.buildOptions.partials.source,\n config.buildOptions.includes.source,\n ]), {\n base: createSource(config.buildOptions.pages.base)\n })\n .pipe(map(inlineSvgHTML()))\n .pipe(map(replaceVariables()))\n // .pipe(htmlmin({ collapseWhitespace: true }))\n .pipe(gulp.dest(config.buildOptions.project.destination));\n}", "title": "" }, { "docid": "594ec4cfba2437ccfe3b5cbe793a52fd", "score": "0.57590777", "text": "function generateMarkdown(data) {\n\n const s = renderTableOfContent(data);\n\n return `# ${data.title}\n${renderLicenseSection(data.license)}\n \n## Description \n${data.description} \n \n## Table of Content\n${s[0]} \n\n${s[1]}\n\n\n\n`;\n}", "title": "" }, { "docid": "986af7faeb60b43f75e79bf0d686e68a", "score": "0.5748751", "text": "function generateMarkdown(data) {\n return `\n # ${data.title}\n ## Description\n ${data.discreption}\n ## Table of content\n ${tableOfContent(data)}\n ${checkIfExist(data.installation, '## Installation')}\n ${checkIfExist(data.usage, '## Usage')}\n ${renderLicenseSection(data.license)}\n ${checkIfExist(data.contributing, '## Contributing')}\n ${contact(data.email,data.username)}\n`;\n}", "title": "" }, { "docid": "54e6b827280107b2b63628479e236bf4", "score": "0.5723816", "text": "async function parseHTMLSource( path ) {\n const content = await readFile( path );\n if( content === null ) {\n throw new Error(`File not found: ${path}`);\n }\n const { attributes: frontmatter, body: html } = FM( content );\n return { frontmatter, html };\n}", "title": "" }, { "docid": "e5b3f31f8f4f23e62eb5dd66648c9d63", "score": "0.57236683", "text": "function generateMarkdown(data) {\n return `### ${data.title}\n ![badge](https://img.shields.io/badge/${encodeURI(data.license)}-License-<color>)\n\n Table of Contents\n * [Description](#description)\n * [Github Repository](#githubRepo)\n * [Github Deployed Site](#homepage)\n * [Author](#author)\n * [Installation](#installation)\n * [Usage](#usage)\n * [Test Instructions](#testInstructions)\n * [Contributors](#contributors)\n * [License](#license)\n * [Questions](#questions)\n \n \n ### Description\n \n ${data.description}\n\n\n ### Github Repository\n\n ${data.githubRepo}\n\n\n ### Github Site\n\n ${data.homepage}\n\n\n ### Author\n\n ${data.author}\n\n\n ### Installation\n\n ${data.installation}\n\n\n ### Usage\n\n ${data.usage}\n\n\n ### Test Instructions\n\n ${data.testInstructions}\n\n\n ### Contributors\n\n ${data.contributors}\n\n\n ### License\n\n ![badge](https://img.shields.io/badge/${encodeURI(data.license)}-License-<color>)\n ${data.license}\n\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n © 2020 ${data.author}. All Rights Reserved.\n\n\n ### Questions\n\n For additional questions, reach me at ${data.email}\n`;\n}", "title": "" }, { "docid": "7293c6f4c6e6f781ae8cd2305ada3118", "score": "0.5709561", "text": "function generateMarkdown(data) {\n return `#Title for read me: ${data.readMeTitle}\n ## Table of Contents\n\n [About](#About)\n [Project](#Project)\n\n\n # About -\n\n #### Github User: ${data.Username}\n\n #### User Email: ${data.email}\n\n # Project -\n ## Project Name: ${data.nameOfProject}\n ### Project Descritption: ${data.descriptionOfProject}\n #### Repository License: ${data.licenseType}\n ### Repository Info: ${data.information}\n ### Badge:\n\n ${renderLicenseBadge(data.licenseType)}\n`;\n}", "title": "" }, { "docid": "7cbfc40d82820029f088532a0b3e058d", "score": "0.5705062", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ${data.gitub}\n\n ## Project Name\n\n ${data.projectName}\n`;\n}", "title": "" }, { "docid": "4443f9fe94993b06a0dd7012394f8b30", "score": "0.5682808", "text": "function parse_markdown(file, options, callback) { \n fs.readFile(file, 'utf8', function (err, source) {\n if (err) {\n callback(err);\n return;\n }\n var sourceLines = source.split(\"\\n\");\n var metaExpr = /\\{(([\\\"\\']).+\\1\\s*:\\s*[\\\"\\'].+\\1)\\}/g;\n var metaString;\n\n var firstClass = {\n found: false,\n name: \"\"\n };\n var re;\n\n if (re = sourceLines[0].match(/^\\#{1}\\s+(.+)/)) { // if #, it's a title\n var metaString = sourceLines[1].match(metaExpr);\n\n if (!metaString) {\n console.error(\"Error\".red + \": on \" + file + \" you started with #, but provided no context--that's bad.\");\n process.exit(1);\n }\n\n var metaJson = JSON.parse(metaString);\n\n if (metaJson.type == 'misc') {\n var title = sourceLines[0].substr(2).replace(/(\\w) /g, \"$1\");\n sourceLines[0] = \"/** section: \" + title + \"\\n\";\n sourceLines[1] = \"* class \" + title;\n\n for (l = 2; l < sourceLines.length; l++) {\n sourceLines[l] = \"* \" + sourceLines[l];\n }\n sourceLines.push(\"**/\");\n return pdoc_parser(\"\", {registered: true, source: sourceLines.join(\"\\n\"), file: file, options: options, callback: callback});\n }\n else {\n console.error(\"In \" + file + \" I did not understand the type '\" + metaJson.type + \"'\");\n }\n }\n else if (re = sourceLines[0].match(/^\\#{2}\\s+(.+)/)) { // if ##, it's a class\n if (!firstClass.found) {\n firstClass.found = true;\n firstClass.name = re[1];\n sourceLines[0] = \"/**\\n* \" + \"class \" + firstClass.name;\n if ( (metaString = sourceLines[1].match(metaExpr) ) ) {\n var metaString = metaString[0].replace(\"(\", \"\").replace(\")\", \"\");\n sourceLines[0] = \"/** \" + metaString + \"\\n* \" + \"class \" + firstClass.name;\n sourceLines[1] = \"* \";\n }\n else\n sourceLines[1] = \"* \";\n }\n }\n else {\n console.error(\"Error\".red + \": first line in \" + file + \" is neither # or ##--that's bad.\");\n process.exit(1);\n }\n\n for (var l = 2; l < sourceLines.length; l++) {\n if (re = sourceLines[l].match(/^\\#{2}\\s+(.+)/)) { // if ##, it's a class\n if (!firstClass.found) {\n firstClass.found = true;\n firstClass.name = re[1];\n sourceLines[l] = \"/**\\n* \" + sourceLines[l].replace(\"##\", \"class \" + firstClass.name);\n }\n else {\n if (re[1].indexOf(\"<\") < 0) {\n sourceLines[l] = \"**/\\n\\n/**\\n* \" + \"class \" + re[1] + \" < \" + firstClass.name;\n }\n else {\n sourceLines[l] = \"**/\\n\\n/**\\n* \" + \"class \" + re[1];\n }\n }\n }\n else if (sourceLines[l].match(/^\\#{3}\\s+/)) { // if ###, it's a member\n var startingDefPos = l;\n sourceLines[l] = \"**/\\n\\n/**\\n* \" + sourceLines[l].replace(\"###\", \"\");\n var n = l + 1;\n\n while (sourceLines[n].match(/^\\#{3}\\s+/)) { // it has aliases\n sourceLines[n] = \" \" + sourceLines[n].replace(\"###\", \"\");\n n++;\n }\n\n var tagRE = sourceLines[n].match(/^(\\((.+)\\))$/);\n if (tagRE) { // if it's got tags, add them appropriately to the starting /**\n sourceLines[l] = sourceLines[l].replace(\"/**\", \"/** \" + tagRE[2]);\n sourceLines[n] = \"\";\n n++;\n }\n // while (sourceLines[n].match(/[-|*|+]\\s*.+?\\s*{.+?}\\s*/)) {\n // sourceLines[n] = sourceLines[n].replace(\"{\", \"(\").replace(\"}\", \"):\");\n /* n++;\n } */\n }\n else { // catch tags after param lists\n var tagRE = sourceLines[l].match(/^(\\((.+)\\))$/);\n var indentedParam = sourceLines[l].match(/^\\s+[*|-]/);\n \n if (tagRE) { // if it's got tags, add them appropriately to the starting /**\n sourceLines[startingDefPos] = sourceLines[startingDefPos].replace(\"/**\", \"/** \" + tagRE[2]);\n sourceLines[l] = \"\";\n }\n else if (indentedParam) {\n // noop\n }\n else { // everything else just prefix with a \"*\"\n sourceLines[l] = \"*\" + sourceLines[l];\n }\n }\n }\n\n sourceLines.push(\"**/\");\n\n pdoc_parser(\"\", {registered: true, source: sourceLines.join(\"\\n\"), file: file, options: options, callback: callback});\n });\n}", "title": "" }, { "docid": "3c6c3fe575832bc50a4660a33ac37e40", "score": "0.568177", "text": "function markdown(el, data) {\n if (window.md == undefined) {\n //$.getScript('https://cdn.jsdelivr.net/npm/[email protected]/dist/markdown-it.min.js',function(){\n window.md = window.markdownit();\n markdown(el, data);\n //});\n } else {\n var html = md.render(data);\n $(el).show().html(html);\n }\n}", "title": "" }, { "docid": "53141b2242d7ea3b82b50d477bbe847f", "score": "0.5681014", "text": "function md_to_html(abs_src,abs_des){\n var rules={\n header:/^ *(#{1,6}) *([^\\n]+?) *#* *(?:\\n+|$)/g, //?:是为因为()是为了表示优先级而不是为了创建一个匹配组,所以用?:来说明\n quote:/^ *> ([^\\n]+?) *(?:\\n+|$)/g,\n img:/!\\[.*\\]\\((.*\\/)([^\\n]+?\\.[^\\n]+?)\\)/,\n normal:/^([^\\n]+?) *(?:\\n+|$)/g,\n code:/^```/,\n bold:/(\\*{2})([^\\n]+?)(\\*{2})/\n }\n fs.readFile(abs_src,{encoding:'utf-8'},(err,data)=>{\n var content=data;\n var blocks=content.split('\\r\\n');\n var code_block_flag=1;\n for(var x in blocks){\n if(blocks[x]){\n \n if(rules.code.exec(blocks[x])){\n blocks[x]=(code_block_flag===1?'<pre style=\\\"background-color:black;color:white;white-space:pre-wrap\\\">':'</pre>');\n //console.log(code_block_flag===1?'<p style=\\\"background-color:black;color:white\\\"><pre>':'</pre></p>');\n code_block_flag*=-1;\n continue;\n }\n if(code_block_flag===1){\n var header=rules.header.exec(blocks[x]);\n if(header){\n var header_content=header[2];\n h_size=header[1].length;\n h_size=String(h_size);\n blocks[x]=`<h${h_size}>${header_content}</h${h_size}>`;\n continue;//直接下一次循环,不支持嵌套\n }\n var quote=rules.header.exec(blocks[x]);\n if(quote){\n quote=quote[1];\n blocks[x]=`<p><cite>${quote}</cite></p>`;\n continue;\n }\n blocks[x]=`<p>${blocks[x]}</p>`\n blocks[x]=blocks[x].replace(rules.bold,\"<strong>$2</strong>\")\n blocks[x]=blocks[x].split('').map((x)=>{\n if(x.charCodeAt===8203){\n return '&nbsp&nbsp';\n }else if(x===' '){\n return '&nbsp';\n }else{\n return x;\n }\n }).join('');\n //blocks[x]=blocks[x].replace(' ','&nbsp');\n blocks[x]=blocks[x].replace(rules.img,`<img src=\\\"../img/$2\\\" />`);\n }\n }else{\n blocks[x]='<br/>'\n }\n }\n var template=`<html>\n <head>\n <meta charset=\\\"utf-8\\\">\n <title>blog</title>\n </head>\n <body>\n ${blocks.join('\\r\\n')}\n </body>\n </html>`;\n fs.writeFile(abs_des,template,()=>{\n console.log(`${abs_des}写入完成`);\n })\n \n })\n \n \n}", "title": "" }, { "docid": "6a42fd9a653267f7cfb421b2f7fa5acc", "score": "0.56658757", "text": "function MarkdownFromHTML(text) {\n\tGWLog(\"MarkdownFromHTML\");\n\t// Wrapper tags, paragraphs, bold, italic, code blocks.\n\ttext = text.replace(/<(.+?)(?:\\s(.+?))?>/g, (match, tag, attributes, offset, string) => {\n\t\tswitch(tag) {\n\t\tcase \"html\":\n\t\tcase \"/html\":\n\t\tcase \"head\":\n\t\tcase \"/head\":\n\t\tcase \"body\":\n\t\tcase \"/body\":\n\t\tcase \"p\":\n\t\t\treturn \"\";\n\t\tcase \"/p\":\n\t\t\treturn \"\\n\";\n\t\tcase \"strong\":\n\t\tcase \"/strong\":\n\t\t\treturn \"**\";\n\t\tcase \"em\":\n\t\tcase \"/em\":\n\t\t\treturn \"*\";\n\t\tdefault:\n\t\t\treturn match;\n\t\t}\n\t});\n\n\t// <div> and <span>.\n\ttext = text.replace(/<div.+?>(.+?)<\\/div>/g, (match, text, offset, string) => {\n\t\treturn `${text}\\n`;\n\t}).replace(/<span.+?>(.+?)<\\/span>/g, (match, text, offset, string) => {\n\t\treturn `${text}\\n`;\n\t});\n\n\t// Unordered lists.\n\ttext = text.replace(/<ul>\\s+?((?:.|\\n)+?)\\s+?<\\/ul>/g, (match, listItems, offset, string) => {\n\t\treturn listItems.replace(/<li>((?:.|\\n)+?)<\\/li>/g, (match, listItem, offset, string) => {\n\t\t\treturn `* ${listItem}\\n`;\n\t\t});\n\t});\n\n\t// Ordered lists.\n\ttext = text.replace(/<ol.+?(?:\\sstart=[\"']([0-9]+)[\"'])?.+?>\\s+?((?:.|\\n)+?)\\s+?<\\/ol>/g, (match, start, listItems, offset, string) => {\n\t\tvar countedItemValue = 0;\n\t\treturn listItems.replace(/<li(?:\\svalue=[\"']([0-9]+)[\"'])?>((?:.|\\n)+?)<\\/li>/g, (match, specifiedItemValue, listItem, offset, string) => {\n\t\t\tvar itemValue;\n\t\t\tif (typeof specifiedItemValue != \"undefined\") {\n\t\t\t\tspecifiedItemValue = parseInt(specifiedItemValue);\n\t\t\t\tcountedItemValue = itemValue = specifiedItemValue;\n\t\t\t} else {\n\t\t\t\titemValue = (start ? parseInt(start) - 1 : 0) + ++countedItemValue;\n\t\t\t}\n\t\t\treturn `${itemValue}. ${listItem.trim()}\\n`;\n\t\t});\n\t});\n\n\t// Headings.\n\ttext = text.replace(/<h([1-9]).+?>(.+?)<\\/h[1-9]>/g, (match, level, headingText, offset, string) => {\n\t\treturn { \"1\":\"#\", \"2\":\"##\", \"3\":\"###\" }[level] + \" \" + headingText + \"\\n\";\n\t});\n\n\t// Blockquotes.\n\ttext = text.replace(/<blockquote>((?:.|\\n)+?)<\\/blockquote>/g, (match, quotedText, offset, string) => {\n\t\treturn `> ${quotedText.trim().split(\"\\n\").join(\"\\n> \")}\\n`;\n\t});\n\n\t// Links.\n\ttext = text.replace(/<a.+?href=\"(.+?)\">(.+?)<\\/a>/g, (match, href, text, offset, string) => {\n\t\treturn `[${text}](${href})`;\n\t}).trim();\n\n\t// Images.\n\ttext = text.replace(/<img.+?src=\"(.+?)\".+?\\/>/g, (match, src, offset, string) => {\n\t\treturn `![](${src})`;\n\t});\n\n\t// Horizontal rules.\n\ttext = text.replace(/<hr(.+?)\\/?>/g, (match, offset, string) => {\n\t\treturn \"\\n---\\n\";\n\t});\n\n\t// Line breaks.\n\ttext = text.replace(/<br\\s?\\/?>/g, (match, offset, string) => {\n\t\treturn \"\\\\\\n\";\n\t});\n\n\t// Preformatted text (possibly with a code block inside).\n\ttext = text.replace(/<pre>(?:\\s*<code>)?((?:.|\\n)+?)(?:<\\/code>\\s*)?<\\/pre>/g, (match, text, offset, string) => {\n\t\treturn \"```\\n\" + text + \"\\n```\";\n\t});\n\n\t// Code blocks.\n\ttext = text.replace(/<code>(.+?)<\\/code>/g, (match, text, offset, string) => {\n\t\treturn \"`\" + text + \"`\";\n\t});\n\n\t// HTML entities.\n\ttext = text.replace(/&(.+?);/g, (match, entity, offset, string) => {\n\t\tswitch(entity) {\n\t\tcase \"gt\":\n\t\t\treturn \">\";\n\t\tcase \"lt\":\n\t\t\treturn \"<\";\n\t\tcase \"amp\":\n\t\t\treturn \"&\";\n\t\tcase \"apos\":\n\t\t\treturn \"'\";\n\t\tcase \"quot\":\n\t\t\treturn \"\\\"\";\n\t\tdefault:\n\t\t\treturn match;\n\t\t}\n\t});\n\n\treturn text;\n}", "title": "" }, { "docid": "b348d0d0077cfddb8e88b408b9ec6718", "score": "0.5665571", "text": "function generateMarkdown(data) {\n return `# ${data.projName}\n\n<img src=\"${renderLicenseBadge(data.license)}\"> \n\n## Github\n[${data.userName}](https://github.com/${data.userName}/)\n\n## Description\n${data.projDesc}\n\n## Table of Contents\n\n1. [Installation](#installation)\n2. [Usage](#usage)\n3. [License](#license)\n4. [Contributing](#contributing)\n5. [Tests](#tests)\n6. [Questions](#tests)\n\n## Installation <a name=\"installation\"></a>\n${data.projInstall}\n\n\n## Usage <a name=\"usage\"></a>\n${data.projUsage}\n\n\n## License <a name=\"license\"></a>\nLicensed under ${renderLicenseLink(data.license)} License\n\n## Contributing <a name=\"contributing\"></a>\n${data.projContribute}\n\n## Tests <a name=\"tests\"></a>\n${data.projTest}\n\n## Questions <a name=\"questions\"></a>\nPlease reach out to ${data.email} with further questions about this application.\n\n`;\n}", "title": "" }, { "docid": "867f488be4c0788b5cb40ea39b0b155d", "score": "0.5664486", "text": "function generateMarkdown(data) {\n const {title, description, usage, tests, license, githubUsername, email, howToReach, contributors, ...steps} = data;\n return `\n# ${title}\n${renderLicenseBadge(license)}\n\n##### Table of Contents:\n[Description](#description)\n[Installation](#install)\n[Usage](#usage)\n[Contact](#contact)\n[Email](#email)\n[Additional Info](#addContact)\n[Tests](#tests)\n[Github](#github)\n[License Notice](#license)\n[Contributors](#contributors)\n\n## Description\n\n${description}\n\n## Installation\n\n${generateStepContent(steps)}\n\n## Usage \n\n${usage}\n\n## Contact\n\n### Email\n${email}\n\n### Additional instructions on contacting me\n${validateHowToReach(howToReach)}\n\n${validateTestsAttr(tests)}\n\n## Github Profile\n\n${'https://github.com/' + githubUsername}\n\n${renderLicenseSection(license)}\n\n## Contributors\n\n${contributors}\n\n\n`;\n}", "title": "" }, { "docid": "c71af2a253570bf39fd76486cc73d7c9", "score": "0.56371397", "text": "function generateMarkdown(data) {\n\n\n // readMe contents = description, installation instructions,\n // usage information, contribution guidelines, test instructions\n\n let README = ''\n\n const tableContentSection = `\n ## Table of Contents\n [Description](#description) \n [Installation Instructions](#installationInstructions)\n [Usage Information](#usageInformation)\n [Contribution Guidelines](#contributionGuidelines)\n [Test Instructions](#testInstructions)` \n \n\n const licenseSection = renderLicenseSection(data.license)\n\n const description = `<a name=\"#description\"/>## Description\\n\\n${data.description}`\n\n const installationInstructions = `<a name=\"#installationInstructions\"/>## Installation Instructions\\n\\n${data.installationInstructions}`\n\n const usageInformation = `<a name=\"#usageInformation\"/>## Usage Information\\n\\n${data.usageInformation}`\n\n const contributionGuidelines = `<a name=\"#contributionGuidelines\"/>## Contribution Guidelines\\n\\n${data.contributionGuidelines}`\n\n const testInstructions = `<a name=\"#testInstructions\"/>## Test Instructions\\n\\n${data.testInstructions}`\n\n README += `# ${data.title}\\n${tableContentSection}\\n${data.username}\\n${data.email}\\n${licenseSection}\\n${description}\\n${installationInstructions}\\n${usageInformation}\\n${contributionGuidelines}\\n${testInstructions}\\n`\n\n return README\n\n}", "title": "" }, { "docid": "1b3b5f717839b83424cdea8afa5cd7cc", "score": "0.56264716", "text": "function generateMarkdown(data) {\n splitContributions(data);\n renderLicenseBadge(data);\n renderLicenseLink(licenseString);\n return `# ${data.name}\n\n ## Table of Contents\n * [Description](#description)\n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#license)\n * [Contributing](#contributing)\n * [Tests](#tests)\n * [Questions](#questions)\n \n ## Description\n ${data.description}\n\n ## Installation\n ${data.installation}\n\n ## Usage\n ${data.usage}\n\n ## License\n ${licenseRender}\n\n ## Contributing\n ${splitContributions(data)}\n\n ## Tests\n ${data.test}\n\n ## Questions\n Please reach out to me through github at [${data.github}](https://github.com/${data.github}) or by email at ${data.email}\n\n `;\n}", "title": "" }, { "docid": "25a730e0b813d4270a158c9e80d6fc0a", "score": "0.56238365", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ## Description\n ${data.description}\n \n ## Table of Contents\n \n ## Installation\n To install neccessary dependecies, run the following command:\n \n ${data.dependent}\n \n ## Usage\n ${data.knowledge}\n \n ## License\n This project is under the ${data.license}\n \n ## Tests\n Use the following command to run tests: \n \n npm test\n \n ## Questions\n If you have any questions about this repo, you can contact me via email at ${data.email}. For more of my work, you can find my github page at ${data.github}\n\n`;\n\n}", "title": "" }, { "docid": "98af2f126a8d6cf2989e524473ee0314", "score": "0.5619093", "text": "function LinkedDataFragmentHtmlParser() { }", "title": "" }, { "docid": "418e5ac0887106941b18c21367b71ce1", "score": "0.56138915", "text": "function generateMarkdown(data) {\n return `# **${data.title}**\n \n ***\n ## Table of Contents\n *[Description](#Description)\n *[License](#License)\n *[Installation](#Installation)\n *[Usage](#Usage)\n *[Contributing](#Contributing)\n *[Tests](#Tests)\n *[Questions](#Questions)\n\n ***\n\n ## Description\n ## ${data.description}\n\n ## ${data.license}\n \n #**Installation**\n ## -Command To Install Dependancies : ${data.dependancies}\n\n #**Usage**\n ## -To use this Repo, please note that, ${data.user} \n\n #**Contributing**\n ## If you want to contribute to this repo be mindful of, ${data.contributing}\n\n #**Tests**\n ## -To Run Tests You have to type in : ${data.command} \n \n #**Questions**\n ## Email: *${data.email}*\n ## GitHub Username: *${data.name}* \n [GitHub](${data.link} \"GitHub Page\")'\n\n`;\n}", "title": "" }, { "docid": "978071c7b62ee1f31bc76c6ac8e08c53", "score": "0.56131434", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ${renderLicenseBadge(data.license)}\n ${renderLicenseSection(data.license)}\n \n ## Description\n \n ${data.description}\n\n <!-- [URL](${data.URL}) -->\n\n ## Table of Content\n \n * [Installation](#installation) \n * [Usage](#usage)\n * [Visual](#visual) \n * [Test](#test)\n * [Contribution](#contribution) \n * [Acknowledgement](#acknowledgement)\n * [Resources](#resources)\n * [License](#license) \n * [Contact Me](#contactme) \n \n ## Installation\n \n ${data.install} \n ${data.install_code}\n \n ## Usage\n \n ${data.usage} \n ${data.usage_code}\n\n ## Visuals\n\n \n ## Test\n \n ${data.test}\n \n ## Contribution\n\n ${data.contribution}\n\n ## Acknowledgement\n\n ${data.acknowledgement}\n\n ## License\n \n ${renderLicenseLink(data.license)}\n\n ## Resources\n\n ${data.resources}\n \n ## Contact Me\n \n GitHub Username: [@${data.github}](https://github.com/${data.github}) \n \n `;\n}", "title": "" }, { "docid": "760155d030ffb3e51784e5894a3bde16", "score": "0.56071967", "text": "function convertMarkdown(mdText) {\n // Send the Markdown text to the server.\n $.ajax({\n url: '/api/render',\n dataType: 'html',\n type: 'POST',\n contentType: 'text/plain',\n data: mdText\n })\n .done(function (data) {\n updateResult(data);\n updateSource(data);\n });\n }", "title": "" }, { "docid": "79269abeaacac66884cb33202ea3b94a", "score": "0.5601012", "text": "function generateMarkdown(data) {\n return `# ${data.projectName}\n ${data.github}\n\n ## Project Name\n\n ${data.projectName}\n\n ## Description\n\n ${data.description}\n\n ## Table Of Contents\n\n [Description](#Description)\n [Installation](#Installation)\n [Usage](#Usage)\n [Licence](#Licence)\n [Contributors](#Contributors)\n [Test](#Test)\n\n ## Installation\n\n ${data.installation}\n\n ## Usage\n\n ${data.usage}\n\n ## License\n\n ${data.license}\n\n ## Contributors\n\n ${data.contributing}\n\n ## Tests\n ${data.test}\n\n ## Questions\n\n ${data.questions}\n ${data.github}\n\n`;\n}", "title": "" }, { "docid": "f3b6556cae172300883d55d09a7f0f41", "score": "0.55982447", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n## Table of Contents\n\n1. [Description](#description)\n2. [Installation](#installation-instructions)\n3. [Usage](#usage)\n4. [Contributing](#contributers)\n5. [Tests](#test)\n6. [Copyright](#copyright)\n\n${renderLicenseLink()}\n\n${renderLicenseBadge(data.license)}\n\n### Description\n${data.description}\n\n### Installation Instructions\n${data.installation}\n\n### Usage\n${data.usage}\n\n### Test\n${data.test}\n\n### Questions\nIf you have any other questions, you can reach me:\n- via email: ${data.email}\n- via GitHub: https://github.com/${data.github}\n\n### Contributers\n${data.contribution}\n\n### License\nThis project is covered under the ${data.license} license.\n\n### Copyright\n© ${data.contribution}`;\n}", "title": "" }, { "docid": "b7fd436889b7b114e0ad73e831a8be48", "score": "0.55980575", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n## Badge: ${renderLicenseBadge(data)}\n## Table of Contents:\n 1. [Description](#description)\n 2. [Installation](#installation)\n 3. [Usage](#usage)\n 4. [Credits](#credits)\n 5. [License](#license)\n 6. [Features](#features)\n 7. [Contirbute](#contribute)\n 8. [Questions](#questions)\n## Description:\n${data.description}\n## Installation:\n${data.installation}\n## Usage:\n${data.usage}\n## Credits:\n${data.credits}\n## Licenses:\n1. Your Badge: ${renderLicenseBadge(data)}\n2. Your Badge link: ${renderLicenseLink(data)}\n3. Your Badge Readme: ${renderLicenseSection(data)}\n## Features:\n${data.features}\n## Contribute:\n${data.contribute}\n## Questions:\n1. Please click the link for Github: <a href = \"https://github.com/${data.questions1}\">My Github Site</a>\n2. Please click the link for my Website: <a href = \"${data.question2}\">My Website</a>\n3. Email: ${data.question3} \n`;\n}", "title": "" }, { "docid": "b4778439f48cdb32fa75c3d5895301ac", "score": "0.5593882", "text": "function convertToDynamicHtml(opts) {\n // https://github.com/evilstreak/markdown-js\n scripts.push('https://raw.github.com/evilstreak/markdown-js/master/lib/markdown.js');\n\n var mdstr = fs.readFileSync(opts.input, 'utf-8');\n\n var html = template({\n scripts: scripts,\n styles: styles,\n mdstr: mdstr,\n pretty: opts.pretty\n });\n\n convert(opts.output, html);\n}", "title": "" }, { "docid": "91c42cf85606f29afefe34e00fdb1a04", "score": "0.55920935", "text": "function runMarkdownLatex(markdownData) {\r\n var renderData = $(md.render(markdownData));\r\n $(renderData).find(\"img\").addClass(\"img-fluid\");\r\n return $(renderData);\r\n}", "title": "" }, { "docid": "97f3de0ec67c3415288813dd8790f648", "score": "0.5587166", "text": "function process(paths) {\n return Promise.all(paths.map(source => new Promise((resolve) => {\n const targetDirectory = \n path.dirname(source).\n replace('md', 'html');\n let targetFile = \n source.\n replace('md', 'html');\n targetFile = targetFile.replace(/\\.[^\\.]+$/, \".md.html\");\n\n fs.readFile(source, 'utf8', (err, markdown) => {\n const html = md.render(markdown);\n mkdirp.sync(targetDirectory);\n fs.writeFileSync(targetFile, html);\n resolve();\n });\n })));\n}", "title": "" }, { "docid": "46f34e8246e7f30b7d3e500760a414fb", "score": "0.5584006", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n ## Description\n ${data.description}\n\n ## Installation\n ${data.installation}\n\n ## Usage\n ${data.usage}\n\n ## Contributions\n ${data.contributions}\n\n ${renderLicenseSection(data.licensing)}\n\n ## Questions\n For any questions, email me at: ${data.email}.\n Or find me at Github https://github.com/${data.username}.\n\n`;\n}", "title": "" }, { "docid": "d62a6715fa311e308da43414676592a4", "score": "0.5579122", "text": "function generateMarkdown(data) {\n\n let license_section = renderLicenseSection(data);\n content = renderLicenseBadge(data.license);\n content = content+\"\\n# Project: \";\n content = content + data.title;\n content = content + \"\\n\\n\" + \"## Description\\n \" + data.overview;\n content = content + \"\\n\\n\" + \"## Table of Contents\\n\";\n content = content + \"\\n - [Installation Instructions](#installation-instructions)\";\n content = content + \"\\n - [Getting Started](#getting-started-clone-the-repository-to-your-local-machine)\";\n content = content + \"\\n - [Usage Instructions](#usage-instructions)\";\n content = content + \"\\n - [Testing](#testing)\";\n content = content + \"\\n - [Questions](#for-additional-question-reach-me-at)\";\n content = content + \"\\n - [contributions](#contributions)\";\n content = content + \"\\n - [Support](#show-your-support)\";\n content = content + \"\\n - [Acknowledgements](#acknowledgements)\";\n content = content + \"\\n - [Issues](#issues)\";\n \n content = content + \"\\n\\n## Installation instructions \\n \" + data.installation;\n content = content + \"\\n\\n## Getting started clone the repository to your local machine\\n\";\n content = content + \"\\n $ git clone \" + data.repo + \"\\n\";\n content = content + \"\\n\\n\" + \"## Usage instructions\\n \" + data.usage;\n content = content + \"\\n\\n\" + \"## Testing\\n \" + data.test;\n content = content + \"\\n\\n\" + \"## For additional question reach me at\\n email: \" + \"[@\" + data.name +\"](\" + data.email + \")\";\n content = content + \"\\n\\n## Contribution \\n\\n \" + \"👤 ** \" + data.name + \" **\";\n content = content + \"\\n\\n - Github: [@\" + data.Github + \"](https://github.com/\" + data.Github + \")\";\n content = content + \"\\n - LinkedIn: [@\" + data.LinkedIn + \"](https://linkedin.com/in/\" + data.LinkedIn + \")\";\n content = content + license_section+ \"\\n\\n## Issues\\n Please address any issues at [issues page](https://github.com/\"+data.Github+\"/\"+data.reponame+\"/issues)\";\n \n return content;\n}", "title": "" }, { "docid": "83fa177a977959e3ce5c548bf5630940", "score": "0.5577455", "text": "function generateMarkdown(data) {\n return `# ${data.projectTitle}\n${renderLicenseBadge(data)}\n\n${tableFunction(data)}\n\n## Description\n\n${data.description}\n\n## Installation\n\n${data.installation}\n\n## Usage\n\n${data.usage}\n\n## Contributing\n\n${data.contribute}\n\n${renderTestSection(data)}\n\n## Questions\n\nFor any additional questions or comments, please email the author of this project at: \n${data.email}.\n\n*OR*\n\nYou can view other repositories made by me at https://github.com/${data.github}.\n\n${data.contact}\n\n${renderLicenseSection(data)}\n`;\n}", "title": "" }, { "docid": "792dfe93ad1125a29156cf1658d1e8f7", "score": "0.5576648", "text": "function generateMarkdown(data) {\n return `\n # ${data.title}\n\n ## Description \n ${data.description}\n \n ## Table of Contents\n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#license)\n * [Contributions](#contributions)\n * [Tests](#tests)\n * [Questions](#questions)\n \n \n ## Installation\n ${data.install}\n \n ## Usage \n ${data.usage}\n \n ## License\n ${renderLicenseBadge(data.license)}\n\n ${renderLicenseLink(data.license)}\n \n ## Contributions\n ${data.contributions}\n \n ## Tests\n ${data.test}\n \n ## Questions\n \n If you would like to discuss this project, please reach out via my GitHub or Email:\n \n GitHub: [${data.questions1}](https://www.github.com/${data.questions1})\n \n Email: ${data.questions2}\n`;\n}", "title": "" }, { "docid": "f612cc1daed52409af5c694d6757f063", "score": "0.5571422", "text": "function generateMarkdown(data) {\n \n return ` \n ${renderLicenseBadge(data.License)}\n \n ## THIS IS MY TITLE\n ${data.Title} \n\n ## DESCRIPTION\n ${data.Description}\n\n ## TABLE OF CONTENTS\n - [TITLE](#THIS-IS-MY-TITLE)\n - [DESCRIPTION](#DESCRIPTION)\n - [INSTALLTION](#INSTALLATION)\n - [USAGE](#USAGE)\n - [CONTRIBUTORS](#CONTRIBUTION)\n - [LICENSE](#License)\n - [TESTS](#TESTS)\n - [QUESTIONS](#QUESTIONS) \n \n ## INSTALLATION\n ${data.Installation}\n\n ## USAGE\n ${data.Usage} \n\n ## CONTRIBUTION\n ${data.Contribution}\n\n # License\n ${renderLicenseBadge(data.License)}\n ${renderLicenseLink(data.License)}\n\n ## TESTS\n ${data.Tests}\n\n ## QUESTIONS\n If you have any questions for me about this Application, please feel free to reach \n out to me directly on Github on my profile page <a href=\"https://github.com/${data.github}\">https://github.com/${data.github}</a>\n or you can email me directly to <a href=\"mailto:${data.email}\">mailto:${data.email}</a>\n `;\n}", "title": "" }, { "docid": "f4f0972d5427cd1a7f243b96c6b7356f", "score": "0.55605084", "text": "function generateMarkdown(data) {\n return `# ${data.Title}\n ${renderLicenseBadge(data.License)}\n\n ## Table of contents\n - [Description](#Description)\n - [Installation](#Installation)\n - [Usage](#Usage)\n - [License](#License)\n - [Contributors](#Contributors)\n - [Test](#Test)\n - [email](#email)\n - [GitHub](#GitHub)\n \n ## Description\n ${data.Description}\n\n ## Installation \n${data.Installation}\n\n## Usage \n${data.Usage}\n\n## License\n${renderLicenseSection(data.License)}\n\n## Contributors\n${data.Contributors}\n\n## Test\n${data.Test}\n\n## Questions\n\nGithub:[${data.Username}](https://github.com/${data.Username}\n email: ${data.Email}\n `;\n}", "title": "" }, { "docid": "f7b85b9f83fc36d7d814555e772429ea", "score": "0.55560887", "text": "function generateMarkdown(data) {\n return `# ${data.title} \n${renderLicenseBadge(data.license)}\n\n## Description\n${data.description}\n\n## Table of Contents\n\n- [Installation](#Installation)\n- [Usage](#Usage)\n- [Credits](#Credits)\n- [License](#License)\n- [Badges](#Badges)\n- [Features](#Features)\n- [How to Contribute](#How-to-Contribute)\n- [Tests](#Tests)\n- [Questions](#Questions)\n\n## Installation \n${data.installation}\n\n## Usage \n${data.usage} \n![alt text](assets/images/${data.screenshot})\n\n## Credits \n${data.credits}\n\n## License \n${renderLicenseLink(data.license)} \n${renderLicenseSection(data.license, data.name, data.year)}\n\n## Badges\n${renderLicenseBadge(data.license)}\n\n## Features\n${data.features}\n\n## How to Contribute\n${data.contribute}\n\n## Tests\n${data.tests}\n\n## Questions\nGithub username: ${data.git} \nLink to Github: (https://github.com/${data.git}) \n\nEmail: ${data.email} \nInstructions on how to contact: ${data.emaili} \n`;\n}", "title": "" }, { "docid": "4d3a8bb70dd4aabf2d26e9851db524a2", "score": "0.55505556", "text": "function generateMarkdown(data) {\n return `\n # ${data.projectTitle}\n\n ## Description\n ${data.projectDescription}\n\n ## Table of Contents\n * [Description](#description)\n * [GitHub Information](#github-information)\n * [Installation](#installation)\n * [Usage](#usage)\n * [Collaborators](#collaborators)\n * [License](#license)\n * [Languages](#languages)\n * [Contributions](#contributions)\n * [Tests](#tests)\n \n ## GitHub Information\n ${data.githubUsername}\n ${data.githubRepolink}\n ${data.emailAddress}\n\n ## Installation\n ${data.installationRequirements}\n \n ## Usage\n ${data.repoUsage}\n\n ## Languages\n ${data.programmingLanguages}\n \n ## Contributions\n ${data.projectContributors}\n\n ## Tests\n ${data.projectTests}\n \n ## License\n ${data.licenseUsage}\n`;\n}", "title": "" }, { "docid": "6ac97081a1ae2305cdf85e3682a5254e", "score": "0.5549159", "text": "function generateMarkdown(data) {\n return `\n # ${data.title}\n\n ![license](https://img.shields.io/badge/License%3A-${data.license}-blue.svg)\n ![Github] (https://github.com/bmralph87-${data.questions})\n [Contact] <[email protected]>\n \n ## Table of Contents(Optional)\n\n\n * [Installation](#installation)\n * [Usage](#usage)\n * [Credits](#credits)\n * [License](#license)\n * [Contributing](#contributing)\n * [Tests](#tests)\n * [Questions](#questions)\n\n\n## Installation\n${data.installation}\n\n## Usage \n${data.usage}\n\n## Credits\n${data.credits}\n\n## License\n${data.license}\n\n## Contributing\n${data.contributing}\n\n## Tests\n${data.tests}\n\n ## Questions\n ${data.questions}\n\n ## Contact\n ${data.contact}\n`\n;\n}", "title": "" }, { "docid": "26266242507c5aa1f8e8775af93d3591", "score": "0.55483294", "text": "function generateMarkdown(data) {\n return `# ${data.project}\n\n ${renderLicenseBadge(data.license)}\n\n ## Description\n\n ${data.description}\n\n ## Table of Contents\n\n * [Installation](#-installation)\n\n * [Usage](#-usage)\n\n * [Contributing](#-contributing)\n\n * [Tests](#-tests)\n\n * [License](#-license)\n\n * [Video](#-video)\n\n * [Questions](#-questions)\n\n ## Installation\n\n To install necessary dependencies, run the following command:\n\n ${data.dependencies}\n\n ## Usage\n\n ${data.repo}\n\n ## Contributing \n\n ${data.contributing}\n\n ## Tests\n\n To run tests, run the following command:\n\n ${data.test}\n\n ## License \n\n ${renderLicenseBadge(data.license)}\n ${renderLicenseSection(data.license)}\n\n ## video\n\n https://drive.google.com/file/d/1322qvvWcoO7vXSSzZ25UNy73fqVRWWwa/view\n\n ## Questions \n\n If you have any questions about the repo, open an issue or contact me directly at ${data.email}. You can find more of my work at [https://github.com/${data.username}/](https://github.com/${data.username}/).\n \n\n`;\n}", "title": "" }, { "docid": "2bdac401a3fd4da75850ce18c558390d", "score": "0.5546452", "text": "function generateMarkdown(data) {\n\n return `# ${data.title}\n${renderLicenseBadge(data.license)}\n\n#Title\n ${data.title}\n\n##Table of Contents\n\n##Description\n ${data.description}\n\n##Dependency\n ${data.dependency}\n \n##Testing\n ${data.test}\n\n##Contact\n ${data.name}\n ${data.userName}\n ${data.emailAddress}\n \n##Contribute\n ${data.contribute} \n`\n}", "title": "" }, { "docid": "4d39d7c4b62a4f313387e3d68e5eb856", "score": "0.5545042", "text": "function generateMarkdown(data) {\n return `\n # ${data.title} (Repo - ${data.gitHubRepoName})\n \n ## Table of Contents\n * [Description](#description)\n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#licesnse)\n * [Badges](#badges)\n * [Contributing](#contributing)\n * [Tests](#tests)\n * [Questions](#questions)\n \n \n ## Description\n ${data.description}\n \n ## Installation\n ${data.installation}\n \n ## Usage\n ${data.usage}\n \n ## License \n ![${data.license} License](https://img.shields.io/badge/License-${data.license}-green)\n \n ## Contributing\n ${data.contributing}\n \n ## Tests \n ${data.tests}\n \n ## Questions\n ![Ask Me Anything!](https://img.shields.io/badge/Ask%20me-anything-1abc9c.svg)\n \n ![Profile Pic](https://avatars.githubusercontent.com/${data.gitHubUN})\n \n ### Email - ${data.gitHubEmail}\n \n `;\n}", "title": "" }, { "docid": "381ef83aff85765c3b9c74cd3d02c529", "score": "0.55412036", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ## Table of Contents\n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#license)\n * [Contributing](#contributing)\n * [Tests](#tests)\n * [Questions](#questions)\n\n ## Description\n ${data.description}\n\n ## Installation\n ${data.installation}\n\n ## Usage\n ${data.usage}\n\n ## Contributing\n ${data.contributing}\n\n ## Tests\n ${data.tests}\n\n ## License\n ${renderLicenseBadge(data.license)}\n\n ## Questions\n gitHub Name: ${data.gitHub}\n GitHub Link: <a href=\"https://github.com/${data.github}\">https://github.com/${data.gitHub}</a>\n Email: ${data.email}\n\n`;\n}", "title": "" }, { "docid": "1b7e704fbf62f7d4b94f73e670aed203", "score": "0.5538437", "text": "function generateMarkdown(data, license) {\n\n // save the array of selected selections to a string\n var chosenSections = data.tableOfContents;\n\n //if the substring 'installation' is found in the string:\n if (chosenSections.indexOf('Installation') !=-1) {\n //create section contents \n let sectionHead = 'Installation';\n let sectionContent = data.installation;\n var installationSection = `\n ## ${sectionHead}\n ${sectionContent}`;\n //create table of contents line with internal link\n var tocInstallation = `\n * [Installation](#Installation)`;\n //if the section is not selected, then return empty strings\n } else {\n installationSection = '';\n tocInstallation = '';\n };\n\n //check for 'Usage' selection\n if (chosenSections.indexOf('Usage') !=-1) {\n let sectionHead = 'Usage';\n let sectionContent = data.usage;\n var usageSection = `\n ## ${sectionHead}\n ${sectionContent}`;\n var tocUsage = `\n * [Usage](#Usage)`;\n } else {\n usageSection = '';\n tocUsage = '';\n };\n\n //check for 'Contributing' selection\n if (chosenSections.indexOf('Contributing') !=-1) {\n let sectionHead = 'Contributing';\n let sectionContent = `* ${data.contributing}`;\n var contributingSection = `\n ## ${sectionHead}\n View the Github profiles of contributing members\n ${sectionContent}`;\n var tocContributing = `\n * [Contributing](#Contributing)`;\n } else {\n contributingSection = '';\n tocContributing = '';\n };\n\n //check for 'Tests' selection\n if (chosenSections.indexOf('Tests') !=-1) {\n let sectionHead = 'Tests';\n let sectionContent = data.tests;\n var testsSection = `\n ## ${sectionHead}\n ${sectionContent}`;\n var tocTests = `\n * [Tests](#Tests)`;\n } else {\n testsSection = '';\n tocTests = '';\n };\n\n //check for 'Questions' selection\n if (chosenSections.indexOf('Questions') !=-1) {\n let sectionHead = 'Questions';\n let sectionContent = `* ${data.questions}`;\n var questionsSection = `\n ## ${sectionHead}\n * Github Username: ${data.githubName}\n * [View Github Profile](${data.githubURL})\n * Email: ${data.email}\n ${sectionContent}`;\n var tocQuestions = `\n * [Questions](#Questions)`;\n } else {\n questionsSection = '';\n tocQuestions = '';\n };\n\n //check for 'License' selection\n if (chosenSections.indexOf('License') !=-1) {\n var license = data.license;\n var licenseLink = renderLicenseLink(license);\n var badgeImg = renderLicenseBadge(license);\n var licenseSection = renderLicenseSection(license, renderLicenseLink(license));\n var tocLicense = `\n * [License](#License)`;\n } else {\n licenseSection = '';\n badgeImg = '';\n tocLicense = '';\n\n };\n\n//call data and created sections to create the markdown\n return `\n# ${data.title} ${badgeImg} \n${data.description}\n\n## Table of Contents\n${tocInstallation}\n${tocUsage}\n${tocContributing}\n${tocTests}\n${tocQuestions}\n${tocLicense}\n\n${installationSection}\n\n${usageSection}\n\n${contributingSection}\n\n${testsSection}\n\n${questionsSection}\n\n${licenseSection}\n`;\n}", "title": "" }, { "docid": "1083d7c058fd3e619e1062edc70252e0", "score": "0.5535952", "text": "function editHTML(err, data) {\n\tif (err) {\n\t\treturn console.log(err);\n\t}\n\n\tloadData(data, startServer);\n}", "title": "" }, { "docid": "f81557ad56c8bdb89abe0a764d6e2915", "score": "0.5531882", "text": "fromMD(text) {\n if(!text) return text;\n\n\n /**\n * Clean up text to make it easier to match\n * Necessary prep work before converting to html \n * ref: https://github.com/showdownjs/showdown/blob/master/src/converter.js\n *\n * List Items\n * /(\\n)?(^ {0,3})([*+-]|\\d+[.])[ \\t]+((\\[(x|X| )?])?[ \\t]*[^\\r]+?(\\n{1,2}))(?=\\n*(¨0| {0,3}([*+-]|\\d+[.])[ \\t]+))/gmi;\n */\n text = text.replace(/¨/g, '¨T');\n text = text.replace(/\\$/g, '¨D');\n text = text.replace(/\\r\\n/g, '\\n'); // DOS to Unix\n text = text.replace(/\\r/g, '\\n'); // Mac to Unix\n text = text.replace(/\\u00A0/g, '&nbsp;');\n text = '\\n\\n' + text + '\\n\\n';\n text = text.replace(/^[ \\t]+$/mg, '');\n\n // Grab View Links\n let view = this.viewLink(text);\n\n\n // Convert List Items\n let l = /(\\n{0,1})(^ {0,3})([*+-]|\\d+[.])(.*?)(\\n)/gmi;\n text = text.replace(l, this.listItems);\n\n // Convert Paragraphs\n let p = /^\\w+(.*)+[\\r\\n]$/gmi;\n text = text.replace(p, this.paragraphs);\n \n // Convert Headers\n let h = /^(#{1,6})[ \\t]+(.+?)[ \\t]*#*\\n+/gmi;\n text = text.replace(h, this.headers);\n\n\n /**\n * Restore signs \n *\n */\n text = text.replace(/¨D/g, '$$');\n text = text.replace(/¨T/g, '¨');\n\n return {text, view};\n }", "title": "" }, { "docid": "9cb0bfae2563c9d57c104749f25a2b1f", "score": "0.5524252", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n #Table of Contents\n\n -[Intallation](#installation)\n -[Usage](#usage)\n -[Credits](#credits)\n -[License](#license)\n\n ## Installation:\n ${data.install}\n\n ## Usage:\n ${data.usage}\n\n ## Credits:\n ${data.credits}\n\n ##GitHub:\n ${data.github}\n\n ##Email\n ${data.email}\n\n ## License:\n ${data.license}\n\n\n\n\n// `;\n}", "title": "" }, { "docid": "cb1c5cbd4a996d8ae6ba8b2b6783af9d", "score": "0.5523708", "text": "function generateMarkdown(data) {\n const {github,email,title,...extra} = data;\n return `\n# ${title}\n\n${renderLicenseBadge(extra.license)}\n\n## Description\n\n${extra.description}\n\n## Table of Contents\n\n* [Installation](#installation)\n* [Usage](#usage)\n${renderLicenseLink(extra.license)}\n* [Contributing](#contributing)\n* [Tests](#tests)\n* [Questions](#questions)\n\n## Installation\n\n${extra.installation}\n\n## Usage\n\n${extra.usage}\n\n${renderLicenseSection(extra.license)}\n\n## Contributing\n\n${extra.contributing}\n\n## Tests\n\n${extra.tests}\n\n## Questions\n\nIf you have any remaining questions, feel free to contact me below:\n\n* [GitHub Profile](https://github.com/${github})\n\n* Email Address: ${email}\n`;\n}", "title": "" }, { "docid": "9ab13faef5de93569f24df2804f5b48a", "score": "0.5516052", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n ${renderLicenseBadge(data.license)}\n ${renderLicenseSection(data.license)}\n This project uses ${data.license}.\n\n # Description\\n\n ${data.description}\n\n # Table of Contents\\n\n ${data.contents}\\n\n *[Description](#description)\\n\n *[Usage](#usage)\\n\n *[install](#install)\\n\n *[Contributing](#contributing)\\n\n *[Test](#tests)\\n\n *[Contact Information for Questions](#for-questions)\\n\n\n # Usage\\n\n ${data.usage}\n\n # Install\\n\n ${data.install}\n\n # Contributing\\n\n ${data.contributions}\n\n # Tests\\n\n ${data.test}\n\n # For Questions\\n\n Name:\\n\n ${data.name}\\n\n Email:\\n\n ${data.email}\\n\n Github Profile:\\n\n https://github.com/${data.github}\n\n\n`;\n}", "title": "" }, { "docid": "2232bfba2b0ae589beab7a12f876c7c7", "score": "0.5510648", "text": "function generateMarkdown(data) {\n return `\n # ${data.title}\n ## Description \n ${data.description}\n ## Table of Contents \n * [Installation](#installation)\n * [Usage](#usage)\n * [Credits](#credits)\n * [Test](#test)\n * [License](#license)\n * [Author](#author)\n \n \n ## Installation\n ${data.installation}\n \n ## Usage\n ${data.usage}\n\n ## Credits\n ${data.contributing}\n\n ## Test\n ${data.test}\n\n ${renderLicenseSection(data.license)}\n\n ## Author\n [${data.username}](https://github.com/${data.username})\n \n ${data.email}\n`;\n}", "title": "" }, { "docid": "b873a68c88e7357ef1954894d653ba57", "score": "0.5506513", "text": "function processFile(path) {\n\n\n var line = \"\",\n i,\n mdActive = false,\n lines = [],\n mdLines = [],\n htmlLines = [];\n //markdown = require( 'markdown').markdown;\n //markdown = new require('showdown').converter();\n\n var Showdown = require('showdown');\n var markdown = new Showdown.converter();\n\n\n\n//var html = markdown.toHTML(md);\n\n const\n SEP = '+',\n MD_START_TOKEN = '$%&',\n MD_STOP_TOKEN = '$%/',\n FMD_TOKEN = '$§',\n MACRO_TOKEN = '$=';\n\n\n function startsWith(token, line) {\n return line.indexOf(token) == 0;\n }\n\n function isMDActive() {\n return mdActive;\n }\n\n function startMD(){\n mdLines = [];\n mdActive = true;\n }\n\n function processMD(mdLines) {\n var md = mdLines.join('\\n'),\n //html = markdown.toHTML(md);\n html = markdown.makeHtml(md);\n\n htmlLines = htmlLines.concat(html.split('\\n'));\n }\n\n function stopMD(){\n processMD(mdLines);\n mdActive = false;\n }\n\n\n function collect(line) {\n if (isMDActive()) {\n mdLines.push(line);\n } else {\n htmlLines.push(line);\n }\n\n }\n\n function prcCommand(cmd, tagAttributes) {\n const START = '&',\n STOP = '/',\n COMMENT = '!',\n MD = '%',\n CMD = '§',\n OPEN_TAG = 1,\n CLOSE_TAG = 0;\n\n var mode = cmd[0],\n command = cmd[1],\n comment = '',\n tagOpener = '<',\n tagCloser ='>',\n tags,\n tag,\n htmlTag,\n htmlLine = '',\n i;\n\n switch (mode) {\n case MD:\n if (command == START) {\n startMD();\n } else if (command == STOP) {\n stopMD();\n }\n break;\n case CMD:\n tags = cmd.substring(2);\n if (command == STOP) {\n tagOpener += '/';\n } else if (command == START) {\n tagCloser = ' '+tagAttributes + tagCloser;\n }\n for (i = 0; i < tags.length; i += 1) {\n tag = tags[i];\n switch(tag) {\n case 'a':\n htmlTag = tagOpener + \"article\"+tagCloser;\n break;\n case 's':\n htmlTag = tagOpener + \"section\"+tagCloser;\n break;\n case 'd':\n htmlTag = tagOpener + \"div\"+tagCloser;\n break;\n case 'h':\n htmlTag = tagOpener + \"header>\";\n break;\n default:\n htmlTag = tag;\n }\n //htmlLine += htmlTag;\n htmlLines.push(htmlTag);\n }\n //htmlLines.push(htmlLine);\n break;\n case COMMENT:\n comment = cmd.substring(1);\n htmlLines.push('<!-- ' + comment + '-->');\n break;\n default:\n }\n }\n\n function prcFMD(line) {\n\n const OPEN_TOKEN = '&',\n OPEN_TAG = 1,\n CLOSE_TAG = 0;\n\n\n var cmds = [],\n c,\n cmd,\n macro,\n sepIndex = line.indexOf(SEP),\n tagAttributes = '',\n token;\n\n if (sepIndex > 0) {\n token = line.split(SEP);\n macro = token[0];\n tagAttributes = token[1];\n var a = 1;\n } else {\n macro = line;\n }\n\n cmds = macro.split('$');\n\n if (isMDActive()) {\n stopMD();\n }\n\n for (c = 1; c < cmds.length; c += 1) {\n cmd = cmds[c];\n prcCommand(cmd, tagAttributes);\n }\n\n\n }\n\n function prcMacro(line) {\n var macro,\n sepIndex = line.indexOf(SEP),\n tagAttributes = '',\n token;\n\n\n if (sepIndex > 0) {\n token = line.split(SEP);\n macro = token[0];\n tagAttributes = SEP + token[1];\n } else {\n macro = line;\n }\n switch(macro) {\n case '$=START_SECTION_BODY':\n macro = '$§/h$%&$!startSectionBody'+tagAttributes;\n break;\n case '$=START_ARTICLE':\n macro = '$§&ah$%&$!startArticle'+tagAttributes;\n break;\n case '$=FIRST_SECTION':\n macro = '$§/h$§&sh$%&!firstSection'+tagAttributes;\n break;\n case '$=NEXT_SECTION':\n macro = '$§/s$§&sh$%&!nextSection'+tagAttributes;\n break;\n case '$=DIV':\n macro = '$§&d$%&'+tagAttributes;\n break;\n case '$=/DIV':\n macro = '$§/d$%&';\n break;\n case '$=STOP_ARTICLE':\n macro = '$§/sa';//NO COMMENT: doesnt work here!\n break;\n }\n\n prcFMD(macro);\n }\n\n\n\n\n\n\n\n\n\n lines = fs.readFileSync(path).toString().split(\"\\n\");\n\n\n for(i = 0; i < lines.length; i += 1) {\n line = lines[i];\n\n if (startsWith(MD_START_TOKEN, line)) {\n startMD();\n } else if (startsWith(MD_STOP_TOKEN, line)) {\n stopMD();\n } else if (startsWith(FMD_TOKEN, line)) {\n prcFMD(line);\n } else if (startsWith(MACRO_TOKEN, line)) {\n prcMacro(line);\n } else {\n collect(line);\n }\n\n }\n\n return htmlLines;\n\n}", "title": "" }, { "docid": "dae6fc27ec27297bd9e48be6f9c9c5eb", "score": "0.5505243", "text": "function generateMarkdown(data) {\n return `\n <h1>${data.title}</h1>\n\n ${renderLicense(data.license)}\n\n ## Description\n ${data.description}\n\n ## Table Of Contents\n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#license)\n * [Contributing](#contribution)\n * [Test](#test)\n * [Questions](#questions)\n\n ## Installation\n To install the necessary dependencies, run the following command:\n <p style=\"background-color:rgb(20, 20, 20); padding:1em\">\n ${data.installation}\n </p>\n\n ## Usage\n ${data.usage}\n\n ## License\n The license used is \"${data.license}\"<br>\n Click the license button at the top to learn more about your license. \n <br>\n\n ## Contribution\n ${data.contribution}\n\n ## Test\n To run tests, run the following command:\n <p style=\"background-color:rgb(20, 20, 20); padding:1em\">\n ${data.test}\n </p>\n\n ## Questions\n If you have any questions about the repo, open an issue or contact me directly at ${data.email}. You can find more of my work at https://github.com/${data.github}\n <br>\n ${data.questions}\n\n `;\n}", "title": "" }, { "docid": "4181906389d2e0233d652625c2effae3", "score": "0.5503228", "text": "function generateMarkdown(data) {\n return `\n # ${data.title}\n\n ## License\n ${licenses[data.license]}\n\n Click ${licenseLinks[data.license]} for license information.\n \n ## Table of Contents\n * [Project-Description](#Project-Description) \n * [GitHub-URL](#GitHub-URL)\n * [Contact](#Contact) \n * [Installation-Steps](#Installation-Steps) \n * [Contributions](#Contributions)\n * [Testing-Process](#Testing-Process)\n\n ## Project-Description\n ${data.description}\n\n ## GitHub-URL\n ${data.githubURL}\n\n ## Contact\n If you have any questions please feel free to reach out to me at ${data.email}\n\n ## Installation-Steps\n ${data.installation}\n\n ## Contributions \n ${data.contribution}\n\n ## Testing-Process \n ${data.tests}\n\n`;\n}", "title": "" }, { "docid": "dd3045b4f21ca62e3cfcdba56c1b0c4e", "score": "0.5495491", "text": "function generateMarkdown(data) {\nreturn `# ${data.Title}\n${renderLicenseBadge(data.License)}\n## Description\n\n${data.Description}\n\n## Table of Contents\n\n* [Installation](#Installation)\n\n* [Usage](#Usage)\n${renderLicenseLink(data.License)}\n\n* [Contributions](#Contributions)\n\n* [Tests](#Tests)\n\n* [Questions](#Questions)\n\n## Installation\n\nTo install the necessary dependencies, run the following command: \n\n\\`\\`\\`\n${data.Installation}\n\\`\\`\\`\n\n## Usage\n\n${data.Usage}\n\n${renderLicenseSection(data.License)}\n\n## Contributions\n\n${data.Contributions}\n\n## Tests\n\nTo run tests, run the following command:\n\n\\`\\`\\`\n${data.Tests}\n\\`\\`\\`\n\n## Questions\n\nIf you have any questions about the repo, contact me here: \n\n${data.Email}. You can find more of my work at [{data.GitHub}](https://github.com/${data.GitHub}/).\n\n`;\n}", "title": "" }, { "docid": "d4e9155df41dd780e3d3b483c7e747e8", "score": "0.5485418", "text": "function populatePage(data) {\n\n\t// Clear out the html text that is already there\n\t$(\"#articles\").html(\"\");\n\tvar innerHTML = \"\";\n\t// Loop through each article in data and format the html for it\n\tfor (var i=0; i<5; i++) {\n\t\tvar len = data[i][\"description\"][0].length;\n\n\t\tinnerHTML += '<div class=\"row\"><div class=\"article\">';\n\t\tinnerHTML += '<p class=\"article-title\"><a href=\"' +\n\t\t\tdata[i][\"link\"][0] + '\">' + data[i][\"title\"] + '</a></p><br>';\n\t\t/* The first letter of the description has a special style so\n\t\t slicing is used to get the rest of the text */\n\t\tif (len != 0) {\n\t\t\tinnerHTML += '<p class=\"article-description\"><span>'+\n\t\t\t\tdata[i][\"description\"][0][0] + '</span>' +\n\t\t\t\tdata[i][\"description\"][0].slice(1, len) + '</p>';\n\t\t}\n\t\tinnerHTML += '</div></div>';\n\n\t}\n\t$(\"#articles\").html(innerHTML);\n}", "title": "" }, { "docid": "f1b35978908d39755d30025754bcf084", "score": "0.548312", "text": "function getPage (data) {\n var fileName = path.join(__dirname, 'page.html')\n var content = fs.readFileSync(fileName, 'utf8')\n return mu.render(content, { 'body': data })\n}", "title": "" }, { "docid": "6f82601fa86b62843276fd156b844d2d", "score": "0.5482094", "text": "function generateMarkdown(data) {\n return `\n # ${data.title} \n\n ${renderLicenseBadge(data.license)}\n\n ### Description\n\n ${data.description}\n \n \n ### Table of Contents \n * [Description](https://github.com/Kristy-coding/README-Generator/blob/main/README.md#description)\n * [Installation](https://github.com/Kristy-coding/README-Generator/blob/main/README.md#installation)\n * [Usage](https://github.com/Kristy-coding/README-Generator/blob/main/README.md#usage)\n * [License](https://github.com/Kristy-coding/README-Generator/blob/main/README.md#license)\n * [Contributing](https://github.com/Kristy-coding/README-Generator/blob/main/README.md#contributing)\n * [Tests](https://github.com/Kristy-coding/README-Generator/blob/main/README.md#tests)\n * [Questions](https://github.com/Kristy-coding/README-Generator/blob/main/README.md#questions)\n \n ### Installation\n ${data.installation}\n \n\n ### Usage\n ${data.usage}\n\n ${renderLicenseSection(data.license)}\n \n ### Contributing\n ${data.contribution}\n \n \n ### Tests\n ${data.test}\n \n ### Questions\n \n Find me on GitHub [HERE](https://github.com/${data.username})<br/>\n If you have any addition questions about the project feel free to reach out via my email: ${data.email}\n \n\n `;\n}", "title": "" }, { "docid": "c8b95ef45f83fdbc49424fd543ba11bb", "score": "0.5475052", "text": "function generateMarkdown(data) {\n\n const generatedMarkdown = \n `# **${data.projectNameAns}**\n ![Contents](https://img.shields.io/github/languages/top/${data.userNameAns}/${data.projectNameAns})\n ![Last-Commit](https://img.shields.io/github/last-commit/${data.userNameAns}/${data.projectNameAns})\n ![License](https://img.shields.io/github/license/${data.userNameAns}/${data.projectNameAns})\n ## **Description**\n \n ${data.descriptionAns}\n <br><br>\n \n ## **Table of Contents**\n \n * [Installation](#Installation)\n * [Usage](#Usage)\n * [License](#License)\n * [Contributing](#Contributing)\n * [Tests](#Tests)\n * [Questions](#Questions)\n \n <br><br>\n \n ## **Installation**\n \n 1. Clone the repo\n \\`\\`\\`sh\n git clone https://github.com/${data.userNameAns}/${data.projectNameAns}.git\n \\`\\`\\` \n 2. Install NPM packages\n \\`\\`\\`sh\n npm install\n \\`\\`\\`\n <br><br>\n \n ## **Usage**\n !! To be filled in when the project has working code !!\n \n Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.\n <br><br>\n \n ## **License**\n \n Distributed under the ${data.licenseAns} License.\n <br><br>\n \n ## **Contributing**\n Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n \n 1. Fork the Project\n 2. Create your Feature Branch (\\`git checkout -b feature/AmazingFeature\\`)\n 3. Commit your Changes (\\`git commit -m 'Add some AmazingFeature'\\`)\n 4. Push to the Branch (\\`git push origin feature/AmazingFeature\\`)\n 5. Open a Pull Request\n \n <br><br>\n \n ## **Tests**\n \\`\\`\\`sh\n npm run test\n \\`\\`\\`\n <br><br>\n \n ## **Questions**\n Learn about more of my work at [my GitHub](https://github.com/${data.userNameAns})\n \n You can send any additional questions to my email : ${data.emailAns}\n <br><br><br><br>\n \n ![created](https://img.shields.io/badge/Helped%20by-Virlym-blue)`;\n \n return (generatedMarkdown);\n}", "title": "" }, { "docid": "c9d1e7bcd763050a5f7070e009553843", "score": "0.5467712", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n # Table of Contents\n1. [Description](#projectDescription)\n2. [Installation Instructions](#installation)\n3. [How to Use](#usage)\n4. [License](#license)\n5. [How to Contribute](#contributing)\n6. [Tests](#tests)\n7. [Questions](#github)\n\n # Description\n ${data.projectDescription}\n # Installation Instructions\n ${data.installation}\n # How to Use\n ${data.usage}\n # License\n Licensed under the ${data.license} license.\n\n ${renderLicenseBadge(data.license)}\n\n License URL: ${renderLicenseLink(data.license)}\n\n ${renderLicenseSection(data.license)}\n # How to Contribute\n ${data.contributing}\n # Tests\n ${data.tests}\n # Contact with Questions\n Github: https://github.com/${data.github}\n \n Email Address: ${data.email}\n`;\n}", "title": "" }, { "docid": "be3d0c9743e52f7af1961ccd17e434ea", "score": "0.54663056", "text": "function parseTemplate() {\n var editor = EditorManager.getFocusedEditor();\n if (editor) {\n \n var HTMLString = editor.document.getText()\n var HTMLDoc = $.htmlDoc( HTMLString );\n \n $(HTMLDoc).find(\"head\").append(\"<title>asdf asdf asdf</title>\")\n $(HTMLDoc).find(\"cc-partgroupvariable[variablename='mooi']\").attr(\"options\",\"heelmooi\")\n $(HTMLDoc).find(\"cc-partgroupvariable[variablename='lelijk']\").attr(\"options\",\"heellelijk\")\n editor.document.setText( $(HTMLDoc).prop('outerHTML') )\n }\n }", "title": "" }, { "docid": "ea501860a34544b5c4a4c25a6a090cbd", "score": "0.5459908", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n${renderLicenseBadge(data.license)}\n${renderLicenseSection(data.license)}\n${renderLicenseLink(data.license)}\n\n\n ## Table of Contents:\n 1. [Title] (#title)\n 2. [Description] (#description)\n 3. [Installation] (#install)\n 4. [Link] (#link)\n 5. [Github] (#github)\n 6. [E-mail] (#Email)\n 7. [Instructions] (#instructions)\n 8. [License] (#license)\n 9. [Contribution] (#contribute)\n 10. [Collaborators] (#collaborators)\n\n ## Title\n ${data.title}\n\n ## Description\n ${data.description}\n\n ## Installation\n ${data.install}\n\n ## Link\n ${data.link}\n\n ## Github\n ${data.github}\n\n ## E-mail\n ${data.email}\n\n ## Instructions\n ${data.instructions}\n\n ## Contribution\n ${data.constribute}\n\n ## Collaborators\n ${data.collaborators}`\n}", "title": "" }, { "docid": "00ec43fde34f0a431184214faa7f3a89", "score": "0.5458954", "text": "function generateMarkdown(data) {\n\n switch (data.license) {\n case 'Apache 2.0':\n licenseBadge = `![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)`;\n break;\n case 'GNU GPLv3':\n licenseBadge = `![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)`;\n break;\n case 'MIT':\n licenseBadge = `![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)`;\n break;\n case 'Mozilla Public 2.0':\n licenseBadge = `![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)`;\n break;\n default:\n break;\n }\n return `# ${data.title}\n\n ## Project Description:\n ${data.description}\n\n\n ## Table of Contents\n -[Installation](#install)\n -[Usage](#usage)\n -[Contributors](#contributors)\n -[Test](#test)\n -[Questions](#questions)\n -[License](#license)\n -[Author](#author)\n\n## License\n${licenseBadge}\n\n## Installation\n${data.install}\n\n\n## Usage\n${data.use}\n\n\n## Contributors\n${data.contribute}\n\n\n## Test\n${data.test}\n\n\n## Questions\nYou can checkout my GitHub here: https://github.com/${data.username};\nIf you have any questions, contact ${data.email}.\n\n\n## Author\n![Github Profile Picture](${data.image})\n\n\n`;\n}", "title": "" }, { "docid": "06513c639a0e15e6434eb3c36cb142e4", "score": "0.5455415", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n${assignLicenseBadge (data.license)}\n\n##Project Description-\n\n${data.description}\n\n##Table of Contents:\n\n[Installation] (#installation)\n\n[Usage] (#usage)\n${assignLicenseLink (data.license)}\n\n[Contributing] (#contributing)\n\n[Tests](#tests)\n\n[Questions](#questions)\n\n##Installation-\n\nTo install the dependencies needed, type the following command:\n${data.installation}\n\n##Usage-\n${data.usage}\n${assignLicenseSection(data.license)}\n\n##Contributing- \n${data.contributing}\n\n##Tests-\nTo perform a test of the application, type the following command:\n${data.test}\n\n##Questions-\nIf you have any questions about this repository, please contact me at ${data.email}. \nFor more information, please visit my GitHub page at ${data.github} (https://github.com/${data.github}/)\n`;\n}", "title": "" }, { "docid": "6fee370a4cc116a3d2ffd74d756c4001", "score": "0.5453465", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n${renderLicenseBadge(data.license)}\n## Description\n\n${data.description}\n${renderToC(data)}${renderInstallSection(\n data.installation\n )}${renderUsageSection(data.usage)}${renderCollaboratorSection(\n data.collaborators\n )}${renderLicenseSection(data.license)}${renderFeatureSection(\n data.features\n )}${renderTestSection(data.tests)}${renderHowToContributeSection(\n data.contribution\n )}${renderQuestionsSection(data.gitHub, data.email)}\n`;\n}", "title": "" }, { "docid": "b417d91452041d8e3a8e941ee4ed21fe", "score": "0.5447396", "text": "function generateMarkdown(data) {\n return `\n # ${data.name}\n\n${renderLicenseBadge(data.license)}\n\n ## Description \n ${data.description}\n\n View the live application [here](${data.link}).\n\n ## Table of Contents\n * [Installation](#Installation)\n * [Usage](#Usage)\n * [License](#License)\n * [Contributions](#Contributions)\n * [Testing](#Testing)\n * [Questions](#Questions)\n\n ## Installation\n ${data.install}\n\n ## Usage\n ${data.usage}\n\n ## License\n This project is covered under the ${data.license} license. \n\n ## Contributions\n ${data.contribute}\n\n ## Testing\n ${data.tests}\n\n ## Questions\n In case of any questions, please reach out to me at the email ${data.email} or you can open an issue and I'll get to it as soon as possible. \n To see more of my work, visit my GitHub profile at [${data.username}](https://github.com/magikarppe/).\n`;\n}", "title": "" }, { "docid": "81ec7caf05f0c350cea6206e7ebb2396", "score": "0.5444028", "text": "function generateMarkdown(data) {\n return `\n \n # ${data.project}\n [![License](https://img.shields.io/badge/License-${data.license}-blue.svg)]\n\n ## Table of Contents\n - [Description](#description)\n - [Install](#install)\n - [Usage](#usage)\n - [License](#license)\n - [Contributing](#contribute)\n - [Tests](#test)\n - [Questions](#questions)\n\n # Installation\n The following must be installed in order for this application to run: ${data.install}\n\n # Usage\n To use this application: ${data.usage}\n\n # Contributing \n Contributors: ${data.contribute}\n\n # Test Instructions\n The following is needed to run the application test: ${data.test}\n\n # Questions\n To Find Me on Github: [${data.questions}](https://github.com/${data.questions})\n Email Me With Questions: ${data.questions2}\n\n # Google Drive Link\n [Link to Professional README Generator](https://drive.google.com/file/d/1ZjSHBcwfIDhW4MBtRCSt4M6g2et3han8/view)\n\n`;\n}", "title": "" }, { "docid": "5597e276719bde00105e8a0269feb176", "score": "0.54399884", "text": "function generateMarkdown(data) {\nreturn `# ${data.project}\n![license](https://img.shields.io/github/license/${data.username}/${data.repo})\n\n## Description\n${data.description}\n\n## Table of Contents \n* [Installation](#installation)\n* [Usage](#usage)\n* [License](#license)\n* [Contributing](#contributing)\n* [Tests](#tests)\n* [Questions](#questions)\n\n## Installation\nRun the following code to install dependencies:\\n\n ${data.dependencies}\n\n## Usage\n${data.usage}\n\n## License\nThis project uses ${data.license} license.\n\n## Contributing\n${data.contributions}\n\n## Tests\nRun the following code in your console to run tests\\n\n ${data.test}\n\n## Questions\nFor any further questions, reach out to ${data.email} or visit my [Github profile](https://github.com/${data.username}).\n\n`\n}", "title": "" }, { "docid": "833ee0b2517db2ebc2a48c2a202c92a8", "score": "0.54382277", "text": "async getHTML() {\n return new Promise( (resolve, reject) => {\n fs.readFile(\"./templates/engineer.html\", \"utf8\", (err, data) => {\n if (err) {\n return reject(err);\n }\n let result = data.replace(/%name%/g, this.name);\n result = result.replace(/%id%/g, this.id);\n result = result.replace(/%email%/g, this.email);\n result = result.replace(/%github%/g, this.github);\n resolve(result);\n });\n });\n }", "title": "" }, { "docid": "33cb4956c5c330c8b61e90b763ca26a7", "score": "0.5437394", "text": "function generateMarkdown(data) {\n \n\nreturn `# ${data.projectTitle}\n\n${renderLicenseBadge(data.license)}\n\n\n## Table of Contents\n - [Description](#description)\n - [Installation](#installation)\n - [Credits](#credits)\n\n\n\n## Description\n${data.description}\n\n\n## Installation\n${data.installation}\n\n## Credits\n${data.credits}\n\n${renderLicenseSection(data.license)}\n\n\n## Check out more of my work via my GitHub Profile at: ${data.githubProfile}\n\n`;\n\n}", "title": "" }, { "docid": "5c286fbdff2bd28012fd58ed9ffaa1d2", "score": "0.54361594", "text": "function generateMarkdown(data) {\n return `# ${data.ProjectTitle}\n ## License\n ${renderLicenseBadge(data.License)}\n ## Description\n ${data.Description}\n ## Installation\n ${data.Installation}\n ## Usage\n ${data.Usage}\n ## Contributing\n ${data.Contributing}\n ## Tests\n ${data.Tests}\n ## GitHub Username\n ${data.GitHubUserName}\n ## Email Address\n ${data.EmailAddress}\n\n \n`;\n}", "title": "" }, { "docid": "98d9fd45452d6d858c644e1caf4f7b9f", "score": "0.5433343", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n ![GitHub Logo](https://img.shields.io/badge/license-${fixLicense(data.license)}-blue)\n\n ## Table of Contents\n - [Description](#description)\n - [Installation](#installation)\n - [Usage](#usage)\n - [Tests](#tests)\n - [Contributing](#contributing)\n - [License](#license)\n - [Questions](#questions)\n\n ## Description\n ${data.description}\n\n ## Installation\n ${data.installation}\n\n ## Usage\n ${data.usage}\n\n ## Tests\n ${data.tests}\n\n ## Contributing\n ${data.contributing}\n\n ## License\n ${data.license}\n\n ## Questions\n * [GitHub](http://github.com/${data.username})\n * [E-mail](${data.questions})\n\n`;\n}", "title": "" }, { "docid": "43eecc147d73bb142b5f7e32eedef73f", "score": "0.5428531", "text": "function generateMarkdown(data) {\n // First, get all licenses and corresponding badges required by the user\n getLicenseLink(data);\n\n // Conditionals for each confirm prompt (table of contents, contributing, and images)\n if (data.tableContents === true) {\n contents = `\n## Table of Contents\n * [Description](#Description)\\\n * [Installation](#Installation)\\\n * [Usage](#Usage)\\\n * [Licenses](#Licenses)\\\n * [Contributors](#Contributors)\\\n * [Testing](#Testing)\\\n * [Questions](#Questions)\n `\n };\n if (data.contributing === true) {\n contributing = `${data.howToContribute}`\n };\n if (data.images === true) {\n for (var i=0 ; i < data.imagesNumber ; i++) {\n imagesSection += `<img src = \"./example${i}\" width=100% >\\n` \n }\n }\n // Then, return the README content\n return `\n# ${data.title}\n\n${contents}\n\n## Description\n${data.description}\n \n## Installation\n${data.installation}\n \n## Usage\n${data.usage}\n \n## Licenses\n${licensesSection}\n \n## Contributing\n${contributing}\n\n## Testing\n${data.testing}\n\n## Images\n${imagesSection}\nIMPORTANT: You'll need to add relative paths to these images' src attributes!\n\n## Questions\nTo submit questions about this project, please visit my GitHub profile here: https://github.com/${data.username}\n`;\n}", "title": "" }, { "docid": "3d26bbfa45d90db60e98ffd0e8de6a0d", "score": "0.54260325", "text": "function buildHtml() {\n return gulp.src(['app/**/*.md', '!app/**/README.md', 'packages/**/README.md'])\n .pipe(replace(/\\[([^\\]]*?)\\]\\(([^\\)]*?)\\.md\\)/g, function(match, p1, p2) {\n // replace .md links with .html\n return `[${p1}](${p2}.html)`;\n }))\n .pipe(markdown())\n .pipe(wrap({src: 'app/_templates/markdown-wrapper.njk'}))\n .pipe(gulp.src(['app/**/*.njk']))\n .pipe(gulpNunjucks.compile({\n // site-wide data goes here\n baseUrl: config.baseUrl,\n }, {\n env: new nunjucks.Environment(\n new nunjucks.FileSystemLoader(config.templates)\n ),\n }))\n .pipe(rename({\n extname: '.html',\n }))\n .pipe(gulp.dest(config.dest))\n}", "title": "" }, { "docid": "446faba5b8256e96f805de8a602495b2", "score": "0.54221785", "text": "function generateMarkdown(data) {\n if (data.openSource === true && data.contribution === true) {\n return `# ${data.title}\\n## Description\\n${data.descript}\\n## Table of Contents\\n* [Installation](#installation)\\n* [Usage](#usage)\\n* [License](#license)\\n* [Contributing](#contributing)\\n* [Tests](#tests)\\n* [Questions](#questions)\\n## Installation Instructions\\n ${data.install}\\n ## Usage\\n${data.usage}\\n## License\\n This project is licensed under the ${data.license} license\\n## Contributing\\nPlease view my contribution guidelines at my [contribution file](${data.contribFile})\\n## Tests\\n${data.testInfo}\\n## Questions\\nPlease feel free to contact me with any questions at my email: ${data.email}. You can find access to this repo or any of my other projects at my [Github](${data.gitURL}) `\n}\n else if (data.contribution === false && data.openSource === true) {\n renderLicenseLink(data.license);\n console.log(licenseLink);\n return `# ${data.title} ${licenseLink}\\n## Description\\n${data.descript}\\n## Table of Contents\\n* [Installation](#installation)\\n* [Usage](#usage)\\n* [License](#license)\\n* [Contributing](#contributing)\\n* [Tests](#tests)\\n* [Questions](#questions)\\n## Installation Instructions\\n ${data.install}\\n ## Usage\\n${data.usage}\\n## License\\n This project is licensed under the ${data.license} license\\n## Contributing\\n${data.contribGuide}\\n## Tests\\n${data.testInfo}\\n## Questions\\nPlease feel free to contact me with any questions at my email: ${data.email}. You can find access to this repo or any of my other projects at my [Github](${data.gitURL}) `\n}\n\n;\n}", "title": "" }, { "docid": "35f4b188e120bf644c02605844d29f1e", "score": "0.5420778", "text": "function generateMarkdown(data) {\n console.log(\"data: \", data)\n let _data = {...data};\n _data.licenseName = \"GNU AGPLv3\";\n _data.licenseUrl = \"https://choosealicense.com/licenses/gpl-3.0/\";\n let filename = \"README.md\";\n\n let str =`# ${data.title}\\n\\n\n [GitHub Profile](https://github.com/dewrivers)\\n\\n\n ## Table of Contents\\n\\n\n [Description](#Description)\\n\n [Installation](#Installation)\\n\n [Usage](#Usage)\\n\n [License](#License)\\n\n [Contributions](#Contributions)\\n\n [Tests](#Tests)\\n\n ## Description\\n\n ${data.description}\\n\\n\n ## Installation\\n\n ${data.installation}\\n\\n\n ## Usage\\n\n ${data.usage}\\n\\n\n ## License\\n\n ${data.license}\\n\\n\n ## Contributions\\n\n ${data.contributions}\\n\n ## Tests\\n\n ${data.tests}\\n\\n\n `;\n\n console.log(\"str: \", str);\n\n fs.writeFile(\n filename,\n str,\n function (err) {\n if (err) {\n return console.log(err)\n }\n else {\n console.log(\"Done!!\")\n }\n }\n );\n console.log(\"_data: \", _data);\n return _data;\n}", "title": "" }, { "docid": "52e05773b9bb27dfe09d76e726ff5996", "score": "0.54154", "text": "function generateMarkdown(data) {\n // console.log(data)\n\n return `\n# ${data.title} ${renderLicenseBadge(data)}\n\n## Table of Contents\n* [Description](#description)\n* [Installation](#installation)\n* [Usage](#usage)\n* [License](#license)\n* [Contributions](#contributions)\n* [Github](#github)\n* [Tests](#tests)\n* [Questions](#questions)\n\n<a name='description'></a>\n## Description\n${data.description}\n\n<a name='installation'></a>\n## Installation\n${data.installation}\n\n<a name='usage'></a>\n## Usage\nThe deployed app can be found at ${data.usage2}.\nTo initiate the app from your local computer, navigate in your terminal to where you have cloned the repository and type ${data.usage}.\n\n<a name='license'></a>\n## License\nThis application is covered by ${data.license}.\n\n<a name='contributions'></a>\n## Contributions\n${data.contributions}\n\n<a name='github'></a>\n## Github\nThis app can be found on GitHub at ${data.github}.\n\n<a name='tests'></a>\n## Tests\n${data.tests}\n\n<a name='questions'></a>\n## Questions\nHave a question about this app? [Send an e-mail](mailto:${data.questions}).\n\n##### This README was generated using [Bri's README generator](https://github.com/bcassellius/readme-generator).\n `\n}", "title": "" }, { "docid": "6017ac80473d723543db3c2164955c45", "score": "0.5412576", "text": "function generateMarkdown(data) {\n const {\n title, \n description,\n installation,\n usage,\n contribution,\n license,\n test,\n github,\n email,\n } = data;\n \n\n return ` # ${title}\n\n${renderLicenseBadge(license)}\n\n## Description\n${description}\n \n # Table of Contents\n 1. [Installation](#Installation)\n 2. [Usage](#Usage)\n 3. [License](#License)\n 4. [Contribution](#Contribution)\n 5. [Tests](#Tests)\n 6. [Contact Me](#Contact-Me)\n\n\n\n## Installation\nPlease follow the instructions to install the application. \n${installation}\n\n## Usage\n${usage}\n\n## License\nThis application is covered under the following licenses: https://choosealicense.com/licenses/.\n\n## Contribution\nPlease follow these guidelines when contributing to the project. \nPlease follow the Contributer Covenant Guidelines https://www.contributor-covenant.org/.\n\n\n## Tests\nThe following test can be used to test the application. \n${test}\n\n## Contact-Me\nI can be reached via: \n- Github: [${github}](http://github.com/${github})\n- Email: ${email}\n\n`;\n}", "title": "" }, { "docid": "ef235c769d505b243715fabc8201d97d", "score": "0.5403997", "text": "function generateMarkdown(data) {\n \n return `# ${data.title}\n ${renderLicenseBadge(data.license)}\n ## Description \n \n ${data.description}\n ## Table of Contents\n * [Installation](#installation)\n * [Usage](#usage)\n * [Contributing](#contributing)\n * [License](#license)\n * [Testing](#testing)\n * [Questions](#questions)\n \n \n ## Installation\n \n ${data.install}\n ## Usage \n \n ${data.usage}\n \n ## Contributing\n \n * **${data.credits}**\n \n \n ## License\n \n ${renderLicenseLink(data.license)}\n \n \n ---\n \n \n ## Testing\n \n ${data.test}\n ## Questions\n \n - [Link to Github](https://github.com/${data.username})\n or alternatively you can contact me with questions using the email listed below\n Email: ${data.email}\n `;\n }", "title": "" }, { "docid": "1196d996c6fa50f2b379c9871995365c", "score": "0.5403815", "text": "function generateMarkdown(data) {\n return `\n # ${data.title} \n ### ${data.user}\n #### Contributors:\n ${data.contributors}\n\n ${renderLicenseBadge(data.license)}\n\n ## Table of Contents\n * [Description](#description)\n * [Installation](#installation)\n * [Usage](#usage)\n * [Test](#test)\n * [License](#license)\n * [Questions](#questions)\n \n ## Demo\n [Demo Video](https://drive.google.com/file/d/1sVn8TvGWqNYG8rel0a0Bl3W786FlWbmG/view)\n\n\n ## Description\n ${data.description}\n\n ## Installation\n ${data.installation}\n \n ## Usage\n ${data.usage}\n\n ## Test Instruction\n ${data.test}\n\n ## License\n For more information please visit: ${renderLicenseLink(data.license)}\n \n ## Questions\n For more information or questions about the README Generator, please contact <${data.email}> \n You may also visit my GitHub page here: https://github.com/Emilyrh1058\n `;\n}", "title": "" }, { "docid": "29d0a19c72f16d3fb84f26c5dbeb5e3d", "score": "0.54019535", "text": "function MarkdownToHTML(relpath, markdown_div)\n{\n var callback = function (text) {\n html = Showdown(text);\n fillDiv(html, markdown_div);\n $('.linenums').removeClass('linenums');\n prettyPrint();\n };\n getFile(relpath, callback);\n}", "title": "" }, { "docid": "f144f19db21eabd87f55710a909712ba", "score": "0.5401061", "text": "function generateMarkdown(data) {\n return ` # ${data.project}\n \n ## Description \n ${data.description}\n\n ## Table of Contents\n - [Installation](#Install)\n - [Usage](#usage)\n - [Credits](#credits)\n - [License](#license)\n - [Tests](#tests)\n\n ## Installation\n ${data.dependencies}\n\n ## Usage\n ${data.usage}\n\n ## Credits\n ${data.contributing}\n\n ## Tests:\n ${data.tests}\n \n ## License:\n ${data.license}\n\n ## Contact Information\n -Email: ${data.email}\n -GitHub: www.github.com/${data.username}\n`;\n}", "title": "" }, { "docid": "21c38342b02b8179e22b486a525df95e", "score": "0.5400291", "text": "function _REBUILD_POST(data) {\n\n // meta data dari post\n const meta = data.match(/[\\+--\\_]{2}([^\\\\_]+)[\\+--\\_]{2}/g);\n const info = meta[0].match(/[^\\r\\n]+/g);\n info.pop();\n info.shift();\n\n let dm = {};\n\n info.forEach(function (i) {\n\n let d = i.split(' : ');\n\n if (d[1] == undefined) {\n console.log(\"Perhatikan penulisan meta pada file markdown.\");\n }\n\n dm[d[0]] = d[1].trim().replaceAll('\"', '');\n\n });\n\n // dm.isi = data.replace(meta, '');\n // console.log(dm);\n\n const isi = data.replace(meta[0], '');\n dm.isi = _PARSE_MARKDOWN(isi);\n // console.log(dm.isi);\n\n\n return dm;\n\n}", "title": "" }, { "docid": "dc0a5da05bee162da6dc70ccbdbdec41", "score": "0.5398911", "text": "function generateMarkdown(data) {\n return `\n# ${data.title}\n\n[![License](https://img.shields.io/static/v1?label=License&message=${data.license.split(\" \").join(\"+\")}&color=green)](${getLicenseLink(data.license)})\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](https://www.contributor-covenant.org/version/2/0/code_of_conduct/)\n\n## Description\n${data.description}\n\n## Table of Contents\n* [Installation](#Installation)\n* [Usage](#Usage)\n* [License](#License)\n* [Contribution](#Contribution)\n* [Tests](#Tests)\n* [Questions](#Questions)\n\n## Installation\n${data.installation}\n\n## Usage\n${data.usage}\n\n## License\nThis repository is protected under the [${data.license}](${getLicenseLink(data.license)}) license.\n<br>\n© 2020 Melinda Ivanov\n\n## Contribution\n${data.contributing}\n\n## Tests\n${data.tests}\n\n## Questions\nYou can contact me about issues and suggestions in [Email](mailto:${data.email}), you can also find me on [Github](https://github.com/${data.github}).\n`;\n}", "title": "" }, { "docid": "6b2a7308a3771b96097eedc007541715", "score": "0.53982395", "text": "async function readHTML( path, processor ) {\n const { html } = await parseHTMLSource( path );\n return html;\n}", "title": "" }, { "docid": "aa9c75e01fc6449435ae043278ec29f9", "score": "0.5392267", "text": "function generateMarkdown(data) {\n\n let licenseBadge = renderLicenseBadge(data.license);\n let licenseSection = renderLicenseSection(data.license);\n\n return `\n # ${data.title}\n ${licenseBadge}\n ## Table of Contents: \\n\n [Description](#description)\\n\n [Installation](#installation)\\n\n [Usage](#usage)\\n\n [Contributing](#contributing)\\n\n [Tests](#tests)\\n\n [License](#license)\\n\n [Questions](#questions)\\n\n <hr>\\n\n ## Description: \\n\n ${data.description} \\n\n <hr>\\n\n ## Installation: \\n\n ${data.installationInstructions}\\n\n <hr>\\n\n ## Usage: \\n\n ${data.usageInformation}\\n\n <hr>\\n\n ## Contributing: \\n\n ${data.contributionGuidelines}\\n\n <hr>\\n\n ## Tests: \\n\n ${data.testInstructions}\\n\n <hr>\\n\n ### License: \\n\n ${licenseSection}\\n\n <hr>\\n\n ### Questions: \\n\n If you would like to learn more, please take a look through my github below:\\n\n <a href=\"https://github.com/${data.username}\"><img src=\"./assets/images/github-brands.svg\" height=\"40px\" width=\"auto\" alt=\"github icon\"> </a>Visit my GitHub at <a href=\"https://github.com/${data.username}\">github.com/${data.username}</a>\\n\n If you still have questions, please send me an email and I will respond as soon as I can:\\n\n <a href=\"mailto:${data.email}\">${data.email}</a>\\n\n`;\n}", "title": "" }, { "docid": "cb9923b7feadfade4c8a5c42fcf30a1a", "score": "0.539123", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n${renderLicenseBadge(data.license)}\n\n## Table of Contents\n\n* [Description](##Description)\n* [Installation](##Installation)\n* [Usage](##Usage)\n* [Contributing](##Contributing)\n* [Tests](##Tests)\n* [Questions](##Questions)\n* [License](##License)\n\n## Description\n\n### What?\n${data.description}\n\n### Why?\n${data.problem}\n\n### How?\n${data.process}\n\n### Significance\n${data.identity}\n\n### Lessons Learned\n${data.lessons}\n\n## Installation\n${data.installation}\n\n## Usage \n${data.usage}\n\nHere is an image of the ${data.title} application: \n\n![](${data.screenshot})\n\n## Contributing\n${data.contributing}\n\n## Tests\n${data.tests}\n\n## Questions\n\nGitHub username: ${data.github} \nGitHub profile: [GitHub Profile](https://github.com/${data.github})\n\nFor questions, please email: <${data.email}>\n\n## License\n\n${renderLicenseSection(data.license)}`;\n}", "title": "" }, { "docid": "237235ecb1e7ced5c88f682babde31b5", "score": "0.5386023", "text": "function generateMarkdown(data) {\n return `# ${data.title}'s, READMe\n \n ${renderLicenseBadge(data.license)}\n \n ## Descriptions\n ${data.description}\n \n ## Table of Contents\n * [Description](#description)\n * [GitHub](#github)\n ${data.usage ? `* [Usage](#usage)`:''}\n ${data.install ? `* [Installation](#installation)`:''}\n ${data.contributions ? `* [Contributions](#contribution)`:''}\n ${data.tests ? `* [Tests](#tests)`:''}\n ${data.license ? `* [License](#license)`:''}\n \n ## GitHub\n ${data.github}\n \n ${usage(data.usage)}\n\n ${installation(data.install)}\n \n ${contributor(data.contributor)}\n \n ${tests(data.tests)}\n \n ${renderLicenseSection(data.license)}\n \n Questions or comments find me on GitHub [${data.github}](https://github.com/${data.github}) or E-mail me: ${data.email}\n \n `;\n}", "title": "" } ]
63d0edd29cbdcd20daf5a9943560cb5f
Signature: checkQueryFeatures : Object, Array, Array> Object Description: Checks the parameter of a get map request for their validity.
[ { "docid": "f63d4b82f3423bfcd5eac84905e0a141", "score": "0.6321571", "text": "function checkQueryFeatures(req, services, WFSCache) {\n console.log(\"At function checkQueryFeatures\");\n\n //Parameters needed for construction of the request URL\n // By returning this, it can be decided later how tor react on not valid query content\n var requestParams = {\n features: null,\n bbox: null,\n srs: null,\n format: null\n }\n\n\n if (req.params.features) {\n\n var featureCheck = checkFeatures(req.params.features, WFSCache.getServices()[req.params.id]); // Are they valid?\n\n if (featureCheck.body) {\n console.log(\"Requested feature did not past test.\")\n return featureCheck;\n }\n else {\n console.log(\"Feature valid\");\n requestParams.features = req.params.features;\n }\n }\n\n\n if (req.params.srs) {\n console.log(\"At params.srs\");\n\n if(crsValid(req.params.srs)) {\n requestParams.srs = req.params.srs;\n } else {\n return new error.BadRequestError(\"The requested CRS is not supported.\");\n }\n }\n\n\n if (req.params.minx || req.params.miny || req.params.maxx || req.params.maxy) { // Are elements of a bbox requested?\n if (req.params.minx && req.params.miny && req.params.maxx && req.params.maxy) { // Are they complete?\n console.log(\"CHECKING BBOX\");\n requestParams.bbox = checkBbox(req, getMaxExtentWFS(WFSCache, req)); // Is the given bbox valid? getting bbox or error\n } else {\n return new error.BadRequestError(\"Not all parameters (minx, miny, maxx, maxy) given for the bbox\");\n }\n }\n\n\n console.log(\"Format check? \" + req.params.format);\n if (req.params.format) {\n console.log(\"Check the format\")\n // Problem is: There are formats, which do have a \"+\" - sign and/ore a \"; \" in their name.\n // \"+\" is a whitespace in URLs. So we have to replace unintended whitespaces\n var requestedFormat = String(req.params.format).replace(\"; \",\"placemark\"); // mark intended whitespaces\n requestedFormat = requestedFormat.replace(\" \", \"+\");\n requestedFormat = requestedFormat.replace(\"placemark\", \"; \"); // recreate intended whitespaces\n console.log(\"REQUESTED FORMAT = \" + requestedFormat);\n\n var validFormats = [];\n console.log(\"validFormats are \" + validFormats);\n var operations = WFSCache.getServices()[req.params.id][\"wfs:WFS_Capabilities\"][\"operationsMetadata\"][\"operation\"];\n\n for (let i = 0; i < operations.length; i++){\n if (operations[i].name === \"GetFeature\") {\n var k = 0;\n while (operations[i].parameter[k]) {\n if (operations[i].parameter[k].name === \"outputFormat\") {\n validFormats = operations[i].parameter[k].value;\n break;\n }\n else {\n ++k;\n }\n }\n }\n }\n\n // Is the requested format a member of validFormats?\n var notValid = true;\n for (let i = 0; i < validFormats.length; i++) {\n if (validFormats[i] === requestedFormat) {\n notValid = false;\n break;\n }\n }\n\n // Action according requested format is valid / not valid\n\n if (notValid) {\n return new error.BadRequestError(\"The requested format is not supported. Supported formats are : \" + validFormats);\n }\n else {\n requestParams.format = req.params.format;\n }\n }\n\n return requestParams;\n\n}", "title": "" } ]
[ { "docid": "7b7f2a706aba588034d54ccd6481ba77", "score": "0.5704336", "text": "function checkQueryParameters(){\n\tvar mark = getQueryParam(\"mark\");\n\tvar loc = getQueryParam(\"loc\");\n\tif(mark && loc) {\n\t\tshowMarkOnMap({markId:mark, location:loc});\n\t}\n}", "title": "" }, { "docid": "f3a7b096532cad067ecdea731383b66c", "score": "0.5257934", "text": "function checkFeatures (feature, getCapabilities) {\n console.log(\"At function checkFeatures()\");\n var requestedFeatures = String(feature).split(\",\");\n var offeredFeatures = processGetCapabilities.getAllFeatures(getCapabilities);\n var offeredFeaturesTitle = [];\n\n for (var element in offeredFeatures) {\n try {\n offeredFeaturesTitle.push(offeredFeatures.title);\n }\n catch (e) {\n console.log(\"Finishing checkFeatures()\");\n return new error.InternalServerError(\"Error while checking offered Features\");\n }\n }\n\n\n\n // Requested layer supported?\n for (var element in requestedFeatures) {\n var notContained = true;\n for (var checkElement in offeredFeaturesTitle) {\n if (String(element) === String(checkElement)) {\n notContained = false;\n break;\n }\n }\n\n if (notContained) {\n console.log(\"Finishing checkFeatures()\");\n return new error.BadRequestError(\"The requested feature '\" + element + \"' is not supported. Supported features are: \" + offeredFeaturesTitle.toString());\n }\n }\n\nreturn {};\n}", "title": "" }, { "docid": "b9b4e72333effbc480076f8264cd0830", "score": "0.5066615", "text": "function checkQuery(req, services, serviceChache) {\n console.log(\"At function checkQuery\");\n\n //Parameters needed for construction of the request URL\n // By returning this, it can be decided later how tor react on not valid query content\n var requestParams = {\n \"layer\": null,\n \"bbox\": null,\n \"crs\": null,\n \"width\": null,\n \"height\": null,\n \"format\": null\n }\n\n if (req.params.layer) { // Are specific layers requested? If not, All Layers will be requested later in getRequestURL\n console.log(\"check params.layer\");\n var notValid = checkLayers(serviceChache, req.params.id, req.params.layer); // Are they valid?\n console.log(\"Layer not valid?: \" + notValid);\n if (notValid) {\n var message = new error.BadRequestError(\"At least one requested layer is not valid\");\n console.log(\"Error message assigned\");\n requestParams.layer = {\n \"error\": message\n };\n } else {\n console.log(\"Layer valid\");\n requestParams.layer = req.params.layer;\n\n }\n }\n\n\n if (req.params.crs) {\n console.log(\"At params.crs\");\n // Is it supported?\n var layer = null;\n\n if (req.params.layer) {\n console.log(\"params.layer\");\n layer = req.params.layer.split(\",\");\n console.log(layer);\n } else {\n console.log(\"At else params.layer\");\n console.log(\"params.id: \" + req.params.id);\n console.log()\n var ServiceGetCapabilities = serviceChache.getServices()[req.params.id];\n console.log(\"ServiceVapabilities passed\");\n layer = processGetCapabilities.getAllLayersAsString(ServiceGetCapabilities);\n console.log(\"else layer\" + layer);\n }\n\n var crsSupported = crsValid(req.params.crs);\n console.log(\"PARAMS:CRS: \" + req.params.crs);\n if (crsSupported) {\n requestParams.crs = req.params.crs;\n } else {\n var message = new error.BadRequestError(\"The requested CRS is not supported for all layers\");\n requestParams.crs = {\n \"error\": message\n };\n }\n }\n\n\n if (req.params.minx || req.params.miny || req.params.maxx || req.params.maxy) { // Are elements of a bbox requested?\n if (req.params.minx && req.params.miny && req.params.maxx && req.params.maxy) { // Are they complete?\n console.log(\"CHECKING BBOX\");\n requestParams.bbox = checkBbox(req, getMaxExtentWMS(serviceChache, req)); // Is the given bbox valid? getting bbox or error\n } else {\n var message = new error.BadRequestError(\"Not all parameters (minx, miny, maxx, maxy) given for the bbox\");\n requestParams.bbox = {\n \"error\": message\n };\n }\n }\n\n if (req.params.width) {\n console.log(\"width is: \" + req.params.width);\n if (!isNaN(req.params.width) && Number(req.params.width > 0) && Number(req.params.width) % 1 === 0) {\n requestParams.width = req.params.width;\n } else {\n var message = new error.BadRequestError(\"Width must be a integer greater than zero\");\n requestParams.width = {\n \"error\": message\n };\n }\n }\n\n\n if (req.params.height) {\n if (!isNaN(req.params.height) && Number(req.params.height > 0) && Number(req.params.height) % 1 === 0) {\n requestParams.height = req.params.height;\n } else {\n var message = new error.BadRequestError(\"Height must be a number greater than zero\");\n requestParams.height = {\n \"error\": message\n };\n }\n }\n\n\n if (req.params.format) {\n console.log(\"USER INPUT FORMAT = \" + req.params.format);\n\n // Problem is: There are formats, which do have a \"+\" - sign and/ore a \"; \" in their name.\n // \"+\" is a whitespace in URLs. So we have to replace unintended whitespaces\n var format = String(req.params.format).replace(\"; \",\"placemark\"); // mark intended whitespaces\n format = format.replace(\" \", \"+\");\n format = format.replace(\"placemark\", \"; \"); // recreate intended whitespaces\n\n var allowedValues = serviceChache.getServices()[req.params.id].WMS_Capabilities.capability.request.getMap.format;\n var isNotValid = true;\n\n for (var i = 0; i < allowedValues.length; i++) {\n if (format === allowedValues[i]) {\n isNotValid = false;\n }\n }\n\n if (isNotValid) {\n var message = new error.BadRequestError(\"Requested format is not valid. Valid formats are: \" + allowedValues);\n requestParams.format = {\n \"error\": message\n };\n } else {\n requestParams.format = req.params.format;\n }\n\n }\n\n console.log(\"Finishing checkQuery()\");\n return requestParams;\n}", "title": "" }, { "docid": "c7271b06d9ed43367f696b5c3993e41d", "score": "0.495063", "text": "function getMapRequestURL(req, serviceCache, services) {\n console.log(\"At function getMapRequestURL()\");\n var checkedQuery = checkQuery(req, services, serviceCache);\n console.log(\"Query Parameter\");\n console.log(checkedQuery);\n\n for (var key in checkedQuery) {\n try {\n if (checkedQuery[key].error) { // Was a queryparameter not valid?\n return (checkedQuery[key]); // Return the error.\n }\n } catch (err) {}\n }\n\n\n\n //\n var allLayers = false;\n var bboxString = null\n var ServiceGetCapabilities = serviceCache.getServices()[req.params.id];\n\n var layer = !checkedQuery.layer ? processGetCapabilities.getAllLayersAsString(ServiceGetCapabilities) : checkedQuery.layer;\n\n var bboxString = !checkedQuery.bbox ? processGetCapabilities.getGlobalBboxAsString(ServiceGetCapabilities) : (checkedQuery.bbox.miny + \",\" + checkedQuery.bbox.minx + \",\" + checkedQuery.bbox.maxy + \",\" + checkedQuery.bbox.maxx);\n\n var crs = !checkedQuery.crs ? processGetCapabilities.getCRS(ServiceGetCapabilities)[0].crs : checkedQuery.crs;\n\n var width = !checkedQuery.width ? getDefaultWidth(req, services) : checkedQuery.width;\n\n var height = !checkedQuery.height ? getDefaultHeight(req, services) : checkedQuery.height;\n\n var format = !checkedQuery.format ? getDefaultFormatMaps(req, services) : checkedQuery.format;\n\n var baseURL = processJSON.getBaseURL(services, req.params.id) + \"wms?\";\n var service = \"service=wms\";\n var version = \"version=\" + ServiceGetCapabilities.WMS_Capabilities.version;\n var request = \"request=GetMap\";\n console.log(\"bboxString: \" + bboxString);\n var requestURL = baseURL + service + \"&\" + version + \"&\" + request + \"&\" + \"layers=\" + layer + \"&\" + \"bbox=\" + bboxString + \"&\" + \"crs=\" + crs + \"&\" + \"width=\" + width + \"&\" + \"height=\" + height + \"&\" + \"format=\" + format;\n console.log(\"Constructed URL in getRequestURL\");\n console.log(requestURL);\n console.log(\"Finishing getMapRequestURL()\");\n return requestURL;\n}", "title": "" }, { "docid": "ebac39b8d97462f5adab899971010466", "score": "0.49229693", "text": "function hasAnyQueryParam(query) {\n if (query.fromVideoTime || query.toVideoTime ||\n query.minVideoDuration || query.minVideoDuration || query.copyright ||\n query.minTraceHeight || query.minTraceWidth || query.source ||\n (query.boundingShapeType && query.boundingShapeCoordinates)) {\n return true;\n }\n}", "title": "" }, { "docid": "4305a17a462bd1afa2f1b31ba0410e14", "score": "0.47451976", "text": "function hasParams(){\n\tvar link = document.location.href;\n\tif ((link.indexOf(\"zoom\") > -1) && (link.indexOf(\"lon\") > -1) && (link.indexOf(\"lat\") > -1)) return true;\n\treturn false;\n\t}", "title": "" }, { "docid": "8c628f98eb929886f2835af0e883049b", "score": "0.47178137", "text": "function checkBbox(req, maxExtent) {\n // Valid format? We only want to use numbers\n if (isNaN(req.params.minx)) {\n var message = new error.BadRequestError(\"minx is not a number\");\n return {\n \"error\": message\n };\n }\n\n if (isNaN(req.params.miny)) {\n var message = new error.BadRequestError(\"miny is not a number\");\n return {\n \"error\": message\n };\n }\n\n if (isNaN(req.params.maxx)) {\n var message = new error.BadRequestError(\"maxx is not a number\");\n return {\n \"error\": message\n };\n }\n\n if (isNaN(req.params.maxy)) {\n var message = new error.BadRequestError(\"maxy is not a number\");\n return {\n \"error\": message\n };\n }\n\n // logically correct?\n if (Number(req.params.minx) >= Number(req.params.maxx)) {\n var message = new error.BadRequestError(\"minx must be smaller than maxx\");\n return {\n \"error\": message\n };\n }\n\n if (Number(req.params.miny) >= Number(req.params.maxy)) {\n var message = new error.BadRequestError(\"miny must be smaller than maxy\");\n return {\n \"error\": message\n };\n }\n\n // in the context of the offered layer correct?\n var checkResult = checkExtent(req, maxExtent);\n\n if (checkResult.ok) { // If checkResult is ok (true)\n return checkResult.bbox;\n }\n\n return checkResult.error;\n\n}", "title": "" }, { "docid": "500cfa5c8fc093593c2dabd51330a1cf", "score": "0.47107175", "text": "function getQueryParams() {\n\n\tvar bounds_arr, minlat, minlon, maxlat, maxlon = \"\";\n\n\tif (d3.select('#filter-maptool').property('checked')) {\n\n\t\tbounds_arr = current_tool_bounds.toUrlValue().split(\",\");\n\n\t\tminlat = bounds_arr[0];\n\t\tminlon = bounds_arr[1];\n\t\tmaxlat = bounds_arr[2];\n\t\tmaxlon = bounds_arr[3];\n\n\t} else if (d3.select('#filter-mapbox').property('checked')) {\n\n\t\tbounds_arr = current_bounds.toUrlValue().split(\",\");\n\n\t\tminlat = bounds_arr[0];\n\t\tminlon = bounds_arr[1];\n\t\tmaxlat = bounds_arr[2];\n\t\tmaxlon = bounds_arr[3];\n\t} \n\n\tvar measure = d3.select(\"#filter-bll-measure-category\").node().value;\n\t\tvar measure_val = d3.select(\"#bllmeasure\").property(\"value\");\n\n\tvar abatement = d3.selectAll(\"#filter-compliance-group\").property(\"value\");\n\n\tvar ntests = \"n_high_tests_build\";\n\t\tvar ntests_val = d3.select(\"#n_high_tests_build\").property(\"value\");\n\n\tvar samplewhen = d3.select(\"#filter-testperiod\").node().value;\n\n\tvar sincetype = d3.select(\"#filter-sincetype\").node().value;\n\n\tvar sincelast = d3.select(\"#sincelast\").property(\"value\");\n\n\tvar housebuilt = d3.select(\"#filter-housebuilt\").node().value;\n\n\tvar housetype = d3.select(\"#filter-htype\").node().value;\n\n\tvar addr_vector = [];\n\n\t$(\"input:checkbox[name=address-vector]:checked\")\n\t\t\t\t\t\t.each(function() {\n\t\t\t\t\t\t addr_vector.push( $(this).val().split(\"-\")[1] );\n\t\t\t\t\t\t});\n\taddr_vector = addr_vector.join(\",\");\n\n\tvar params = { \t\n\t\t\t\t\t\"getevents\":'false',\n\t\t\t\t\t\"oldpview\":\"multi\",\n\t\t\t\t\t\"pview\":pageview, \n\t\t\t\t\t\"gview\":graphview,\n\t\t\t\t\t\"tview\":\"control-tab\",\n\t\t\t\t\t\"meas\": measure, \n\t\t\t\t\t\"meas_val\": measure_val, \n\t\t\t\t\t\"abatement\": abatement,\n\t\t\t\t\t\"n_high_tests_build\":ntests_val, \n\t\t\t\t\t\"sample_when\":samplewhen, \n\t\t\t\t\t\"sincetype\":sincetype, \n\t\t\t\t\t\"sincelast\":sincelast,\n\t\t\t\t\t\"housebuilt\":housebuilt, \n\t\t\t\t\t\"housetype\":housetype, \n\t\t\t\t\t\"addr_vector\":addr_vector,\n\t\t\t\t\t\"minlat\":minlat,\n\t\t\t\t\t\"maxlat\":maxlat,\n\t\t\t\t\t\"minlon\":minlon,\n\t\t\t\t\t\"maxlon\":maxlon\n\t\t\t\t};\n\n\tstartload(params);\n\n}", "title": "" }, { "docid": "8054af563e3374b6396461eff054afa8", "score": "0.4680033", "text": "function assertValidQueryOptions (options) {\n var scanOptions = new Set(['UDF', 'concurrent', 'percentage', 'priority'])\n var invalid = Object.keys(options).filter(function (key) {\n return scanOptions.has(key)\n })\n assert(invalid.length === 0, util.format('Invalid query arguments: %s. Use Client#scan instead.', invalid.toString()))\n assert(!options.aggregationUDF, 'Invalid query arguments: Pass UDF params to Query#apply instead.')\n}", "title": "" }, { "docid": "c0e3e3d381aa10b29cdafc68788ba077", "score": "0.4636445", "text": "function geoVerify (req, res, e) {\n return isInRectangle(e.latA, e.longA, e.latB, e.longB, req.body.Latitude, req.body.Longitude);\n}", "title": "" }, { "docid": "1e3bb62df36d3e472f6b5ca6d2a4d0ba", "score": "0.45884678", "text": "function queryLayerFeatures(map, point, opts) {\n\n var queryResults = map.queryRenderedFeatures(pixelPointToSquare(point, opts.radius), {\n layers: opts.layers\n });\n\n return queryResults;\n\n}", "title": "" }, { "docid": "57449315248105fe7c85f57568145090", "score": "0.4571898", "text": "async getParams() {\n // skip when query is null\n if(this.query1 == null) {\n return;\n }\n\n // run the query\n const data = await queryData(this.query1);\n // check response mismatch\n if (data.hasOwnProperty('dataquery') == false) {\n console.log(`dataquery key not found in the response of the query:\\n${this.query1}\\n`);\n failures += 1;\n return false;\n }\n // check empty response\n if (data.dataquery.length < 0) {\n console.log(`Empty response returned from Dgraph for query:\\n${this.query1}\\n`);\n failures += 1;\n return false;\n }\n // extract the data from object arrays to arrays\n this.params = data.dataquery.map(element => element[this.reference]);\n successes += 1;\n return true;\n }", "title": "" }, { "docid": "07fe045031796d5c3169dd41f0d1c246", "score": "0.45179534", "text": "function checkExtent(req, maxExtent) {\n var requestedCrs = null\n var currentCrs = maxExtent.crs;\n var givenCoordinates = {\n \"minx\": req.params.minx,\n \"miny\": req.params.miny,\n \"maxx\": req.params.maxx,\n \"maxy\": req.params.maxy\n };\n\n // If a coordinate system is specified, it is assumed that is different from the globale one (see endpoint maps).\n // So to validate the coordinates one hase to compare the coordinates from the request with the one from the globals bbox.\n if (req.params.crs) {\n requestedCrs = req.params.crs // Validity checked in checkQuery().\n\n proj4.defs(supportedCRS.get());\n\n //I'm not going to redefine those two in latter examples.\n console.log(\"current Projection: \" + currentCrs);\n console.log(\"requestedCrs: \" + requestedCrs);\n\n //Transforming coordinates\n var mins = proj4(currentCrs, requestedCrs, {\n x: maxExtent.minx,\n y: maxExtent.miny\n });\n var maxs = proj4(currentCrs, requestedCrs, {\n x: maxExtent.maxx,\n y: maxExtent.maxy\n });\n\n // Assigning the given coordinates to the max Extent. Now requested coordinates and the max-bbox-coordinates are in the same system.\n\n maxExtent.minx = mins.x;\n maxExtent.miny = mins.y;\n maxExtent.maxx = maxs.x;\n maxExtent.maxy = maxs.y;\n }\n\n\n console.log(\"maxExtent.minx \" + maxExtent.minx);\n console.log(\"givenCoordinates.minx \" + givenCoordinates.minx);\n if (maxExtent.minx > givenCoordinates.minx || maxExtent.miny > givenCoordinates.miny || maxExtent.maxx < givenCoordinates.maxx || maxExtent.maxy < givenCoordinates.maxy) {\n console.log(\"THE EXTENT IS NOT OK\");\n var message = new error.BadRequestError(\"The requested coordinates are not in the extent of the globale bbox. \");\n return {\n \"ok\": false,\n \"error\": {\n \"error\": message\n }\n };\n }\n\n console.log(\"EXTEND OK\");\n return {\n \"ok\": true,\n \"bbox\": givenCoordinates\n };\n}", "title": "" }, { "docid": "511a2f0a00da92af949d561b03505a6f", "score": "0.4474817", "text": "check_valid_input(req){\n this.rule.Query.forEach((key)=>{\n const query = req.query[key];\n if (typeof query === \"undefined\"){\n this.logger.warn(`[${this.label}] Missing game rule attribute.`, {'query': req.query})\n return false;\n }\n })\n if (typeof req.query.ip === \"undefined\" ||\n typeof req.query.time === \"undefined\"){\n this.logger.warn(`[${this.label}] Missing IP or time attribute.`, {'query': req.query})\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "ca35d253aa723916bb683a2007bc9572", "score": "0.44323182", "text": "function llbIntersects( \n OtherSWLat, \n OtherSWLng, \n OtherNELat, \n OtherNELng,\n SWLat, \n SWLng, \n NELat, \n NELng \n ) { \n document.getElementById('llbResultsMapisnull').value = \"0\"; \n if (map != null) { \n var Bounds = new google.maps.LatLngBounds(new google.maps.LatLng(SWLat, SWLng), new google.maps.LatLng(NELat, NELng)); \n var OtherBounds = new google.maps.LatLngBounds(new google.maps.LatLng(OtherSWLat, OtherSWLng), new google.maps.LatLng(OtherNELat, OtherNELng)); \n document.getElementById('llbResultsBoolVal').value = \"0\";\n if (Bounds.intersects(OtherBounds)) \n document.getElementById('llbResultsBoolVal').value = \"1\"; \n } \n else \n document.getElementById('llbResultsMapisnull').value = \"1\"; \n}", "title": "" }, { "docid": "0c2395fbf1268918d143fa128049685f", "score": "0.442931", "text": "function validateGetParameters (req, res) {\n if (!hasMonthAndYearQueryParameters(req.query)) {\n return res.status(500).send({'error': 'Missing year and/or month query paramters.'});\n }\n}", "title": "" }, { "docid": "1afd9440572ff89cea3c368af833d437", "score": "0.44177333", "text": "function filterLayers(checkboxId, mapData) {\n if (checkboxId) mapData[checkboxId] = document.getElementById(checkboxId).checked;\n Object.keys(mapData.labelLayers).forEach(function (key) {\n for (let i = 0; i < mapData.labelLayers[key].length; i++) {\n mapData.labelLayers[key][i].setFilter(function(feature) {\n return (mapData.lowQualityUsers || feature.properties.high_quality_user) &&\n (\n (mapData.correct && feature.properties.correct) ||\n (mapData.incorrect && feature.properties.correct === false) ||\n (mapData.notsure && feature.properties.correct === null && feature.properties.has_validations) ||\n (mapData.unvalidated && feature.properties.correct === null && !feature.properties.has_validations)\n );\n });\n }\n });\n}", "title": "" }, { "docid": "658c5c62e47f3aa2c0b9af2dea1624d2", "score": "0.44168836", "text": "function isValidMap (map) {\n return Array.isArray(map) || isObject(map)\n }", "title": "" }, { "docid": "3fe26eff017bce59a9c63369cb44b381", "score": "0.43830395", "text": "validGeo(feature) {\r\n if (\r\n feature &&\r\n (feature[0] || feature[0] === 0) &&\r\n (feature[1] || feature[1] === 0)\r\n ) {\r\n if (isFinite(feature[0]) && isFinite(feature[1])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "title": "" }, { "docid": "99bae620a6a6d3bf1b2af61a483bf3a9", "score": "0.43196172", "text": "function whitelistParameters (req, success, failure){\n if(JSON.stringify(matchedData(req)) === JSON.stringify(req.query)){\n success()\n } else {\n failure()\n }\n}", "title": "" }, { "docid": "0e819497033a37a46cc574796ea42afc", "score": "0.4313608", "text": "function getFeatureRequestURL(req, WFSCache, services) {\n console.log(\"At function getFeatureRequestURL\");\n var checkedQuery = checkQueryFeatures(req, services, WFSCache);\n console.log(\"checkedQuery error ? \" + checkedQuery);\n if (checkedQuery.body) { // If true -> error\n\n return checkedQuery;\n }\n\n var baseURL = processJSON.getBaseURL(services, req.params.id) + \"wfs?\";\n var service = \"service=wfs\";\n\n var serviceGetCapabilities = WFSCache.getServices()[req.params.id];\n var version = \"version=\" + serviceGetCapabilities[\"wfs:WFS_Capabilities\"][\"version\"];\n\n var request = \"request=GetFeature\";\n var featureID = checkedQuery.features;\n var outputformat = \"outputFormat=\" + (checkedQuery.format || getDefaultFormatFeatures(req, services));\n console.log(outputformat);\n\n var requestURL = baseURL + service + \"&\" + version + \"&\" + request + \"&\" + \"typeName=\" + featureID + \"&\" + outputformat;\n\n console.log(\"Finishing getFeatureRequestURL\");\n return requestURL;\n}", "title": "" }, { "docid": "bad0d7609be58fe4ea31451bbf583a06", "score": "0.43024024", "text": "function hasResultsAtRequestedLayers(results, requested_layers) {\n return !_.isEmpty(_.intersection(_.keys(results), requested_layers));\n}", "title": "" }, { "docid": "1b9443e43ce42645311aafff4ca60f1f", "score": "0.4298161", "text": "function getFeatures() {\n // set up query\n var q = new Query();\n // only within extent\n q.geometry = map.extent;\n q.returnGeometry = true;\n q.outFields = [\"*\"];\n \n // give me all of them!\n q.where = \"1=1\";\n // make sure I get them back in my spatial reference\n q.outSpatialReference = map.spatialReference;\n // get em!\n featureLayer.queryFeatures(q, function (featureSet) {\n var data = [];\n // if we get results back\n if (featureSet && featureSet.features && featureSet.features.length) {\n // set data to features\n data = featureSet.features; // Graphic []\n }\n // set heatmap data\n heatLayer.setData(data);\n });\n }", "title": "" }, { "docid": "73e75f236942ec6417c57a73192e58ad", "score": "0.42977694", "text": "function getAllFeaturesInfo(WFSCache, req) {\n const featureTypeList = getAllFeatures(WFSCache.getServices()[req.params.id]);\n\n if (featureTypeList.body) {\n // If getAllFeatures returned an error, pass it to the top.\n return featureTypeList;\n }\n\n\n var features = [];\n console.log(\"featureTypeList\" + featureTypeList);\n for (var i = 0; i < featureTypeList.length; i++) {\n features.push({\n title: featureTypeList[i].title,\n minx: featureTypeList[i].wgs84BoundingBox[0].lowerCorner[0],\n miny: featureTypeList[i].wgs84BoundingBox[0].lowerCorner[1],\n maxx: featureTypeList[i].wgs84BoundingBox[0].upperCorner[0],\n maxy: featureTypeList[i].wgs84BoundingBox[0].upperCorner[1]\n });\n }\n\n console.log(\"features: \" + features);\n\n var fo = {};\n for (var i = 0; i < features.length; i++) {\n var property = features[i].title;\n var value = req.fullUrl + '/' + features[i].title + \"/data\";\n fo[property] = value;\n }\n\n\n var globWGS84BBOX = {\n TYPE_NAME: \"wgs84BoundingBox\",\n crs: \"EPSG:4326\",\n minx: null,\n miny: null,\n maxx: null,\n maxy: null\n }\n\n for (var i = 0; i < features.length; i++) {\n globWGS84BBOX.minx = !globWGS84BBOX.minx || globWGS84BBOX.minx < features[i].minx ? features[i].minx : globWGS84BBOX.minx;\n globWGS84BBOX.miny = !globWGS84BBOX.miny || globWGS84BBOX.miny < features[i].miny ? features[i].miny : globWGS84BBOX.miny;\n globWGS84BBOX.maxx = !globWGS84BBOX.maxx || globWGS84BBOX.maxx < features[i].maxx ? features[i].maxx : globWGS84BBOX.maxx;\n globWGS84BBOX.maxy = !globWGS84BBOX.maxy || globWGS84BBOX.maxy < features[i].maxy ? features[i].maxy : globWGS84BBOX.maxy;\n }\n\n var result = {}\n result[\"features\"] = [fo];\n result[\"crs\"] = [globWGS84BBOX];\n\n return result;\n\n}", "title": "" }, { "docid": "93f261dd8ca30935250412550727e0e6", "score": "0.4293541", "text": "function checkMap(item){\r\n\t\r\n\t$.ajax({type:'POST',url:'checkmap.php',data:{item:wadi,source:source},success: function(data){\r\n\t\tif(data==\"error\"){\r\n\t\t\t\tmappings=\"false\"\r\n\t\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tdata=JSON.parse(data)\r\n\t\t\t\tif(data[0]==null){\r\n\t\t\t\t\tmappings=\"false\"\r\n\t\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tmappings=data\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t },async:false})\r\n}", "title": "" }, { "docid": "d9971d1abce3e86cee0839650204ba7d", "score": "0.42729875", "text": "function queryZones(query_params = {}) {\n return Object(_resources_functions__WEBPACK_IMPORTED_MODULE_0__[\"query\"])({ query_params, fn: process, path: PATH });\n}", "title": "" }, { "docid": "385d4b5f8f73ab62444b50e7bb3b7866", "score": "0.4263199", "text": "function validateQueries(queries, location=null) {\n // If there aren't any keys in the queries object then we don't have to do anything, \n // so check that here.\n //\n // If it does find keys, try to match the key names to one of the 3 appropriate filters\n // and if the key matches, save the key-value pair to the filters object.\n //\n // If the key does not match either of the 3 appropriate keys, it is an invalid key name\n // so we throw a BadRequestError.\n //\n // (Also makes sure the values passed into either min/max Employees is a number and not anything else.)\n const filters = {};\n \n if (Object.keys(queries).length > 0) {\n // First check to see if filter is coming from a request to /companies or /jobs\n if (location == \"companies\") {\n if (queries.name) {\n filters.name = queries.name;\n delete queries.name;\n }\n if (queries.minEmployees) {\n filters.minEmployees = parseInt(queries.minEmployees);\n if (!filters.minEmployees) {\n throw new BadRequestError(\"Min Employees query must be a number\")\n }\n delete queries.minEmployees;\n }\n if (queries.maxEmployees) {\n filters.maxEmployees = parseInt(queries.maxEmployees);\n if (!filters.maxEmployees) {\n throw new BadRequestError(\"Max Employees query must be a number\")\n }\n delete queries.maxEmployees;\n }\n // If there are queries remaining (therefore invalid queries)\n if (Object.keys(queries).length > 0) {\n throw new BadRequestError(\n `Invalid filter(s): ${Object.keys(queries)}`)\n }\n // The if logic for the request being to /jobs\n } else {\n if (queries.title) {\n filters.title = queries.title;\n delete queries.title;\n }\n if (queries.minSalary) {\n filters.minSalary = queries.minSalary;\n delete queries.minSalary;\n }\n if (Object.keys(queries).includes(\"hasEquity\")) {\n if (queries.hasEquity == \"true\") {\n filters.hasEquity = \"> 0\";\n } else {\n filters.hasEquity = \"= 0\";\n }\n delete queries.hasEquity;\n }\n\n }\n } else {\n // Branches to this if there are no keys at all.\n return false;\n }\n \n // If we have both a minEmployees key and maxEmployees key, we have to make sure\n // that minEmployees is not greater than maxEmployees\n if (filters.minEmployees && filters.maxEmployees && filters.minEmployees > filters.maxEmployees) {\n throw new BadRequestError(\"Minimum employees cannot exceed maximum employees\");\n }\n\n return filters;\n}", "title": "" }, { "docid": "c7a09ebbd484c93a9cad6b691b1de1a2", "score": "0.42551908", "text": "function queryReady() {\n\t\tcurrentLatitude = QueryString[\"lat\"];\n\t\tcurrentLongitude = QueryString[\"lon\"];\n\t initialize(); // assigns google map\n\n\t\tif ( typeof QueryString[\"category\"] !== \"undefined\" ) {\n\t\t var elmnt = document.getElementById('catselect');\n \t var encoded = elmnt.value;\n\t\t var value = decodeURIComponent(QueryString[\"category\"].replace(/\\+/g, \" \"));\n//\t\t\tdecodeURI(QueryString[\"category\"]);\n//\t\t value = value.replace(/[+]/g, \" \");\n//\t\t alert(\"Category is \" + value + \", encoded is \" + encoded);\n\t\t for(var i=0; i < elmnt.options.length; i++)\n\t\t {\n\t\t if(elmnt.options[i].value === value) {\n\t\t elmnt.selectedIndex = i;\n\t\t break;\n\t\t }\n\t\t }\n\t\t}\n\t\tif ( typeof QueryString[\"zipcode\"] !== \"undefined\" ) \n\t\t\tdocument.getElementById('distform').elements[\"zipcode\"].value = QueryString[\"zipcode\"];\n\t\tif ( typeof QueryString[\"milesdist\"] !== \"undefined\" ) \n\t\t\tdocument.getElementById('distform').elements\t\t[\"milesdist\"].value = QueryString[\"milesdist\"];\n\t\n//\t\talert(\"End of queryReady\");\n/*\t\taf.ui.autoLaunch = true; // stops splashscreen\n\t\taf.ui.launch();\n*/\t}", "title": "" }, { "docid": "1ac93d29d53f3a6c147494a2f16770dc", "score": "0.42420843", "text": "function getAllFeatures(getCapabilities) {\n console.log(\"At function getAllFeatures\");\n if (!(\"wfs:WFS_Capabilities\" in getCapabilities)) {\n return new error.InternalServerError(\"GetCapabilities for the WFS does not contain the property wfs:WFS_Capabilities\");\n }\n\n var wfs_GetCapabilities = getCapabilities[\"wfs:WFS_Capabilities\"];\n if (!(\"featureTypeList\" in wfs_GetCapabilities)) {\n console.log(new error.InternalServerError(\"GetCapabilities for the WFS does not contain the property featureTypeList\"));\n return new error.InternalServerError(\"GetCapabilities for the WFS does not contain the property featureTypeList\");\n }\n\n var featureTypeList = wfs_GetCapabilities[\"featureTypeList\"];\n\n if (!(\"featureType\" in featureTypeList)) {\n return new error.InternalServerError(\"GetCapabilities for the WFS does not contain the property featureType\");\n }\n\n console.log(\"Finisching getAllFeatures\");\n return featureTypeList[\"featureType\"];\n}", "title": "" }, { "docid": "424d28252460c94fdf21beafa8a1f221", "score": "0.4239399", "text": "async function queryViewport() {\n const features = await scene.queryFeatures({ filter: { $source: '_xyzspace' }});\n console.log(\"features in viewport:\", features.length);\n appUI.set({ featuresInViewport: features });\n updateViewportProperties(features);\n}", "title": "" }, { "docid": "adac0112f5585cef1bb877c45dea4fda", "score": "0.42353126", "text": "_checkSetup() {\n if (!this.queryName) {\n this._fail('Query name is required.');\n }\n if (!this.queryHost) {\n this._fail('Query host is required.');\n }\n if (!this.queryUrl) {\n this._fail('Query URL is required.');\n }\n if (this.noEmptyFilter && !Object.keys(this.fixed).length && !Object.keys(this.mixed).length) {\n this._fail('Query is always filtered but no filters provided.');\n }\n }", "title": "" }, { "docid": "192695603e00c1d8d9a64fea30589c77", "score": "0.4227657", "text": "function hasMap() {\n if (selectRoute.selectedIndex == 0) { // means no map\n return false;\n }\n else {\n return true;\n }\n }", "title": "" }, { "docid": "f874dfb4f7b81d6552ad731cbce0acd1", "score": "0.41990116", "text": "function validQueryParameters(mandatory) {\n\t\tvar result = true;\n\t\tmandatory.forEach(function(parameter) {\n\t\t\tif (!(parameter in queryParameters)) {\n\t\t\t\tresult = false;\n\t\t\t}\n\t\t});\n\t\treturn result;\n\t}", "title": "" }, { "docid": "2e5d6723aea5f2391f4a59f3ee18fe19", "score": "0.41813192", "text": "function checkLayers(serviceCache, id, layer) {\n console.log(\"At function checkLayers\");\n var serviceGetCapabilities = serviceCache.getServices()[id];\n console.log(\"1\");\n var storedLayer = serviceGetCapabilities.WMS_Capabilities.capability.layer;\n console.log(\"2\");\n var validLayers = [];\n\n if (\"name\" in storedLayer) { // if TRUE => Onle this layer exists and no further layer in a folowing array.\n res.send(\"name gefunden\"); // TO Do: Implemenetation of something useful!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n } else {\n for (var i = 0; i < storedLayer.layer.length; i++) {\n validLayers.push(String(storedLayer.layer[i].name));\n }\n }\n\n console.log(\"validLayers: \" + validLayers);\n\n console.log(\"layer: \" + layer);\n var requestLayerArray = layer.split(\",\");\n console.log(\"Splitted layers: \");\n console.log(requestLayerArray);\n\n var notValid = false;\n\n for (var i = 0; i < requestLayerArray.length; i++) {\n var validRequest = false;\n for (var j = 0; j < validLayers.length; j++) {\n if (requestLayerArray[i] == validLayers[j]) {\n validRequest = true;\n }\n }\n if (!validRequest) {\n notValid = true;\n }\n }\n console.log(\"ErrorValue: \" + notValid);\n console.log(\"Finishing checkLayers()\");\n return notValid;\n}", "title": "" }, { "docid": "225e94965826826ce8859081aa8ab4e5", "score": "0.41585118", "text": "function checkGISFeilds(bufferCheck) {\r\n\tfor ( var obj in bufferCheck) {\r\n\t\tvar bufChkItem = bufferCheck[obj];\r\n\r\n\t\tif (proximityForGISObject(bufChkItem.service, bufChkItem.layer, bufChkItem.distance, \"Address\")) {\r\n\t\t\tValidationMessage += \" </br> you cant add this record because there is another record in this location \" + bufChkItem.service + \" - \" + bufChkItem.layer + \" - \"\r\n\t\t\t\t\t+ bufChkItem.distance;\r\n\r\n\t\t}\r\n\r\n\t}\r\n}", "title": "" }, { "docid": "b324e67d8b1c6a53ebbfdc534d1f1772", "score": "0.41567677", "text": "request(event) {\n console.log('Handling feature request');\n\n this._coordinate = event.coordinate;\n this.showClickMarker();\n\n const forceHttps = location.protocol === 'https:';\n\n const viewResolution = /** @type {number} */ (this._olMap.getView().getResolution());\n const projection = this._olMap.getView().getProjection().getCode();\n const pixel = this._olMap.getEventPixel(event.originalEvent);\n\n this._$featuresEl.empty();\n\n // iterate over all layers and send a request\n let firstFeatureInfoElement = null;\n this._olMap.forEachLayerAtPixel(pixel, olLayer => {\n // find layer in active layer model\n let layer = this._layerModel.findByLayerId(olLayer.get('layerId'));\n\n if (layer && layer.wmsQueryable === true) {\n let featureInfoElement = this._elementList.find(element => element.layerId === layer.layerId);\n if (featureInfoElement === undefined) {\n featureInfoElement = new GetFeatureInfoElement(layer);\n this._elementList.push(featureInfoElement);\n }\n\n let url = olLayer.getSource().getGetFeatureInfoUrl(\n this._coordinate,\n viewResolution,\n projection,\n Object.assign({'QUERY_LAYERS': layer.shortLayerId}, this._params)\n );\n\n if (url) {\n // when the library is used under https, all feature requests need to be https too\n if (forceHttps && url.toLowerCase().startsWith('http:')) {\n url = url.replace('http:', 'https:');\n }\n\n // if host differs from default, use proxy\n const protocol = url.startsWith('https') ? 'https' : 'http';\n if (!url.startsWith(protocol + '://' + this._mapConfig.host)) {\n url = protocol + '://' + this._mapConfig.host + this._mapConfig.proxyUrl + encodeURIComponent(url);\n }\n\n this._$featuresEl.append(featureInfoElement.render());\n featureInfoElement.sendRequest(url);\n\n if (firstFeatureInfoElement === null) {\n firstFeatureInfoElement = featureInfoElement;\n }\n }\n }\n });\n\n // no request has been sent\n if (firstFeatureInfoElement === null) {\n this._$featuresEl.html('<p>No results</p>');\n }\n // show first feature info element when all are closed\n else if (this._$featuresEl.find('.aims-map-collapsible-element-content-open').length === 0 && firstFeatureInfoElement.keepState === false) {\n firstFeatureInfoElement.show();\n }\n }", "title": "" }, { "docid": "9cb025419fee2226dcbfcad15434f128", "score": "0.4151673", "text": "getMapII(token, code, fuel, lat, long, popup, tooltip, lat1, long1, popup1, tooltip1, lat2, long2, popup2, tooltip2, lat3, long3, popup3, tooltip3) {\n const path = `${this.api}/mapaDrawMock?code_query=${token}${code}${fuel}${lat}${long}${popup}${tooltip}${lat1}${long1}${popup1}${tooltip1}${lat2}${long2}${popup2}${tooltip2}${lat3}${long3}${popup3}${tooltip3}`;\n return this.http.get(path, { responseType: 'text' });\n }", "title": "" }, { "docid": "6e9ed07fbaf0fb4192cd975e181bd6cf", "score": "0.40865558", "text": "function getWithin(query, latLng, distance, callback, errorCallback) {\n\n if (distance > MAX_RADIUS) {\n KR.Util.handleError(errorCallback, 'to wide search radius (max is ' + MAX_RADIUS + ')');\n return;\n }\n\n var params = {\n action: 'query',\n list: 'geosearch',\n gsradius: distance,\n gscoord: latLng.lat + '|' + latLng.lng,\n format: 'json',\n gslimit: 50\n };\n var url = BASE_URL + '?' + KR.Util.createQueryParameterString(params);\n KR.Util.sendRequest(url, null, function (response) {\n _parseWikimediaItems(response, callback, errorCallback);\n }, errorCallback);\n }", "title": "" }, { "docid": "30c740b36f01d7d2b83e24640ff98575", "score": "0.40842673", "text": "function checkFeatures(featuresToCheck) {\n\n if (featuresToCheck != null && featuresToCheck != []) {\n featuresToCheck.forEach(function (elt) {\n if (validator.isEmpty(elt.toString())) isFeaturesCorrect = false;\n });\n }\n return isFeaturesCorrect;\n }", "title": "" }, { "docid": "a466757f3924db7ca3b33ae1ded55bd1", "score": "0.4080396", "text": "async function fetchUserFeatureFlags(req) {\n // istanbul ignore next: Covered by functional tests\n const user = await authorisedRequest(req, `${config.apiRoot}/whoami/`)\n return get(user, 'active_features', [])\n}", "title": "" }, { "docid": "775cb6be07df564a498875fe0e65846d", "score": "0.40736413", "text": "isFieldInMapRange(x, y){\n var map = MapEditor.map;\n if(x < 0 || x >= map.width){\n return false;\n } else if(y < 0 || y >= map.height) {\n return false;\n } else {\n return true;\n }\n }", "title": "" }, { "docid": "047c6d2b8fc5a34a00560913d991b577", "score": "0.4070453", "text": "function qt(t) {\n return !!t && \"mapValue\" in t;\n}", "title": "" }, { "docid": "d411ac371ee3c063f8e67e6eebbd3d52", "score": "0.40508336", "text": "function getAllFeatures(event) {\n clearmessages();\n self.mapview.hitTest(event.screenPoint)\n .then(function (response) {\n if (response.results.length == 0) {\n clearmessages();\n return;\n }\n var featurefound = response.results[0].graphic;\n $scope.statusmessage = \"Feature is a \" + featurefound.attributes.LocationType + \" with ID \" + featurefound.attributes.FID;\n addFeaturetomap(featurefound.clone());\n //construct request url\n var requesturl = setRequestUrl(response.results[0].mapPoint);\n //get data from weather service\n requestWeatherData(requesturl);\n });\n }", "title": "" }, { "docid": "8fc055e03c968be531e49c3c516968f0", "score": "0.40502447", "text": "async function getDevicesBounded([min, max]){\n const [minlat, minlon] = LatLngToLatLon(min);\n const [maxlat, maxlon] = LatLngToLatLon(max);\n const query = `minlat=${minlat}&minlon=${minlon}&maxlat=${maxlat}&maxlon=${maxlon}`;\n const res = await GET(`/v2/markers?${query}`);\n if(res.error){\n console.log('error', res.error);\n throw new Error(res.error);\n }\n return res.results;\n}", "title": "" }, { "docid": "aadfaa94e5ae708b6366863ae62ee50c", "score": "0.40475455", "text": "function validateTemplateFieldsParams(query) {\n if (query.templateFields && query.templateFields.length > 0) {\n query.templateFields.forEach(template => {\n if (queryParams.templateFields.hasOwnProperty(template.key)) {\n if (template.type === 'number' && !isFinite(+queryParams.templateFields[template.key])) {\n return handleError({body: {message: `Invalid URL parameter “${template.key}” (it must be a number)`}});\n }\n } else {\n return handleError({body: {message: `Missing URL parameter “${template.key}”`}});\n }\n });\n }\n}", "title": "" }, { "docid": "b466a2624de7bdbd90069415cacdcd03", "score": "0.4042647", "text": "is_in_bounds(...args){\n let mapPos = args_to_pos(args);\n return (mapPos.x >= 0 && mapPos.y >= 0 && mapPos.z >= 0) && (this.size_y > mapPos.y && this.size_z > mapPos.z && this.size_x > mapPos.x);\n }", "title": "" }, { "docid": "755bac69b71bce6631dcd546fa64361d", "score": "0.4034938", "text": "isOnMap() {\n const map = this.getMap()\n const mapgl = this.getMapGL()\n return Boolean(\n map &&\n map.styleIsLoaded() &&\n this._layers.find(l => mapgl.getLayer(l.id))\n )\n }", "title": "" }, { "docid": "7597235cee96c2bb58b7819747b90d46", "score": "0.4023166", "text": "function for_all_topicmaps(topicmap_func, arg) {\n var return_value\n dm4c.get_plugin(\"de.deepamehta.topicmaps\").iterate_topicmaps(function(_topicmap) {\n var ret = _topicmap[topicmap_func](arg)\n if (topicmap.get_id() == _topicmap.get_id()) {\n return_value = ret\n }\n })\n return return_value\n }", "title": "" }, { "docid": "31fd2fd70fc18bf762a27ce79c39a3cb", "score": "0.40003744", "text": "function getWMSKMLinfo(point) {\r\n\t//*** Identify Functionality for WMS Layers\r\n\t//*** point = GLatLng\r\n\t\r\n\t // Initialize variable to determine if any layer is toggled for selection\r\n\t\tvar bLayerFound = new Boolean();\r\n\t\tbLayerFound = false;\r\n\t\t\r\n\t\tfor(var wmslayer in wmslayers) {\r\n\t\t\tif (document.getElementById(wmslayer).checked == true &&\r\n\t\t\tdocument.getElementById(wmslayer + \"_rdo\").checked == true )\r\n\t\t\t{\r\n\t\t\t\tbLayerFound = true;\r\n\t\t\t\t\r\n\t\t\t\tif (wmslayers[wmslayer].layertype == \"wms\")\r\n\t\t\t\t{\r\n\t\t\t\t\t//--------------------------------------------------------//\r\n\t\t\t\t\t//-- Calculate WMS get feature info location parameters --//\r\n\t\t\t\t\tvar tileCoordinate = new google.maps.Point();\r\n\t\t\t\t\tvar tilePoint = new google.maps.Point();\r\n\t\t\t\t\tvar currentProjection = G_NORMAL_MAP.getProjection();\r\n\t\t\t\t\tvar tileNWCornerpx = new google.maps.Point();\r\n\t\t\t\t\tvar tileNWCorner = new google.maps.Point();\r\n\t\t\t\t\tvar tileSECornerpx = new google.maps.Point();\r\n\t\t\t\t\tvar tileSECorner = new google.maps.Point();\r\n\t\t\t\t\tvar tileOffsetpx = new google.maps.Point();\r\n\t\t\r\n\t\t\t\t\t//*Debug*/window.alert(\"wms layer: \"+ wmslayers[wmslayer].layername);\r\n\t\t\r\n\t\t\t\t\t//* Get global pixel location of point based on Google function\r\n\t\t\t\t\ttilePoint = currentProjection.fromLatLngToPixel(point, map.getZoom());\r\n\t\t\t\t\t//* Get tile boundary pixel coordinates - round down based on 256px tiles\r\n\t\t\t\t\ttileCoordinate.x = Math.floor(tilePoint.x / 256);\r\n\t\t\t\t\ttileCoordinate.y = Math.floor(tilePoint.y / 256);\r\n\t\t\r\n\t\t\t\t\t//** Use edge of tile to calculate NW corner pixel coordinates of tile that contains point\r\n\t\t\t\t\ttileNWCornerpx.x = tileCoordinate.x * 256;\r\n\t\t\t\t\ttileNWCornerpx.y = tileCoordinate.y * 256;\r\n\t\t\t\t\t//** Convert NW corner pixel coordinates back to Lat Long\r\n\t\t\t\t\ttileNWCorner = currentProjection.fromPixelToLatLng(tileNWCornerpx, map.getZoom());\r\n\t\t\r\n\t\t\t\t\t//** Use edge of tile to calculate SE corner pixel coordinates of tile that contains point\r\n\t\t\t\t\ttileSECornerpx.x = (tileCoordinate.x + 1) * 256;\r\n\t\t\t\t\ttileSECornerpx.y = (tileCoordinate.y + 1) * 256;\r\n\t\t\t\t\t//** Convert SE corner pixel coordinates back to Lat Long\r\n\t\t\t\t\ttileSECorner = currentProjection.fromPixelToLatLng(tileSECornerpx, map.getZoom());\r\n\t\t\r\n\t\t\t\t\t//** Calculate offset - in pixels - from edge to point identified\r\n\t\t\t\t\ttileOffsetpx.x = tilePoint.x - tileNWCornerpx.x\r\n\t\t\t\t\ttileOffsetpx.y = tilePoint.y - tileNWCornerpx.y\r\n\t\t\r\n\t\r\n\t\t\t\t\t//** Static values of WMS URL \r\n\t\t\t\t\tvar gfiserviceUrl = \"SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo\";\r\n\t\t\t\t\tvar gfiXYoffset = \"&X=\" + tileOffsetpx.x + \"&Y=\" + tileOffsetpx.y;\r\n\t\t\t\t\t//* WMS only cares about the offset from the edge of a define window. Here we define it as a 256px tile\r\n\t\t\t\t\tvar gfiWidthHeight = \"&WIDTH=256&HEIGHT=256\";\r\n\t\t\t\t\tvar gfiEPSG = \"&SRS=EPSG:\" + 4326;\r\n\t\t\t\t\tvar gfiBBox = \"&BBOX=\" + tileNWCorner.x + \",\"+ tileSECorner.y + \",\" + tileSECorner.x + \",\" + tileNWCorner.y;\r\n\t\t\t\t\t//** For tabbed info box\r\n\t\t\t\t\t//var infoTabs = [];\r\n\t\t\t\t\t//var tabContent;\r\n\t\t\r\n\t\t\t\t\t//*Debug*/alert(\"Building Url for layer: \" + wmslayers[wmslayer].layername);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//** Build WMS location portion of URL\r\n\t\t\t\t\t//** wms base url **\r\n\t\t\t\t\tvar gfiWMSbaseUrl = wmslayers[wmslayer].url;\r\n\t\t\t\t\t//** layer name **\r\n\t\t\t\t\tvar gfiQueryLayer = \"&QUERY_LAYERS=\" + wmslayers[wmslayer].layername;\r\n\t\t\t\t\tvar gfiLayerName = \"&LAYERS=\" + wmslayers[wmslayer].layername;\r\n\t\t\t\t\tvar gfiOptions = \"&INFO_FORMAT=\" + wmslayers[wmslayer].infoformat + \"&STYLES=&FORMAT=\" + wmslayers[wmslayer].format;\r\n\t\t\r\n\t\t\r\n\t\t\t\t\tvar gfiURL = gfiWMSbaseUrl+gfiserviceUrl+gfiQueryLayer+gfiLayerName+gfiXYoffset+gfiWidthHeight+gfiEPSG+gfiBBox+gfiOptions;\r\n\t\t\r\n\t\t\t\t\t// Create an iframe window for each wms layer processed\r\n\t\t\t\t\tvar content = \"<div height='300px' width='300px'>Query Results:<br/>\" + wmslayers[wmslayer].legendname + \"<br/><iframe height='80%' width='100%' src=\" + gfiURL + \">Iframe Not Supported</iframe></div>\";\r\n\t\t\r\n\t\t\t\t\t// Multi-Tab Option: Load Tabs\r\n\t\t\t\t\t//tabContent = \"<iframe height='100%' width='100%' src=\" + gfiURL + \">Iframe Not Supported</iframe>\";\r\n\t\t\t\t\t//infoTabs.push(new GInfoWindowTab(wmslayers[wmslayer].legendname, tabContent));\r\n\t\t\r\n\t\t\t\t\t// Dialog to replace Info Window\r\n\t\t\t\t\t//$(\"#query-results\").html(content);\r\n\t\t\t\t\t//$('#query-results').dialog('open');\r\n\t\t\r\n\t\t\t\tmap.openInfoWindowHtml(point, content);\r\n\r\n\t\t\t\t} // if wms type\r\n\t\t\t\telse { //** KML Layer is selected\r\n\t\t\t\t\t//** put code here for handling kml layers passed through click event\r\n\t\t\t\t\t//** currently, kml layers are handled by hidden event in gm (not controlled)\r\n\t\t\t\t\twindow.alert(\"KML Layers can be queried by simply left-clicking on the feature\");\r\n\t\t\t\t\t//map.enableInfoWindow();\r\n\t\t\t\t\t//google.maps.event.trigger(point,\"click\");\r\n\t\t\t\t\t//google.maps.event.trigger(map,\"click\",null,tilePoint,tilePoint);\r\n\t\t\t\t\t//map.openInfoWindow(point);\r\n\t\t\t\t}\r\n\t\t\t} // if layer visible and selectable\r\n\t\t} // for each layer\r\n\r\n if (!bLayerFound ) {\r\n \twindow.alert(\"Sorry, you haven't selected a layer to query. You must toggle a layer's selection button to query features.\");\r\n }\r\n\r\n\t\t// ** Tabbed InfoWindow Version\r\n\t\t//map.openInfoWindowTabsHtml(point, infoTabs);\r\n\t\t\r\n\t\t//** Single InfoWindow Version\r\n\t\t//map.openInfoWindowHtml(point, content);\r\n\t\t\r\n\t\t\r\n}// end function getWMSinfo", "title": "" }, { "docid": "03cd205f16c9dd405281ff172acec6a1", "score": "0.3999548", "text": "function checkHasFeature(options, feature){\n return options.staticHasFeatures[feature];\n}", "title": "" }, { "docid": "ec82e3e80c26184e235bc05b705e3b73", "score": "0.3988087", "text": "get queryParamMap() {\n if (!this._queryParamMap) {\n this._queryParamMap =\n this.queryParams.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.map)((p) => convertToParamMap(p)));\n }\n return this._queryParamMap;\n }", "title": "" }, { "docid": "44aeff3992f567c59b0763844e75956e", "score": "0.39858168", "text": "function wfsRequest(filter){\r\n\t\t\t\tfunction getJsonCurrUtil(data){}\r\n\t\t\t\tvar defaultParameters = {\r\n\t\t\t\t\tservice: 'WFS',\r\n\t\t\t\t\tversion: '2.0.0',\r\n\t\t\t\t\trequest: 'GetFeature',\r\n\t\t\t\t\ttypeName: Selected_layer,\r\n\t\t\t\t\tmaxFeatures: 500,\r\n\t\t\t\t\toutputFormat: 'application/json',\r\n\t\t\t\t\tcql_filter: filter,\r\n\t\t\t\t\tformat_options: 'callback: getJson',\r\n\t\t\t\t\tsrsName: 'EPSG:4326'\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar parameters = L.Util.extend(defaultParameters);\r\n\t\t\t\tvar URL = owsURI + L.Util.getParamString(parameters);\r\n\t\t\t\t$.ajax({\r\n\t\t\t\t\turl : URL,\r\n\t\t\t\t\tdataType : 'json',\r\n\t\t\t\t\tjsonpCallback : 'getJson',\r\n\t\t\t\t\tbeforeSend : function (){\r\n\t\t\t\t\t\t//$(\".mapOverlay\").addClass(\"active\");\r\n\t\t\t\t\t\t$('#maploader').show();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tsuccess : function (response) {\r\n\t\t\t\t\t\t$('#maploader').hide();\r\n\t\t\t\t\t\t//$('.mapOverlay').removeClass(\"active\");\r\n\t\t\t\t\t\tif(response.features.length > 0){\r\n\t\t\t\t\t\t\tWFSLayer = L.geoJson(response, {\r\n\t\t\t\t\t\t\t\tstyle: function (feature) {\r\n\t\t\t\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\t\t\t\tstroke: false,\r\n\t\t\t\t\t\t\t\t\t\tfillColor: null,\r\n\t\t\t\t\t\t\t\t\t\tfillOpacity: 0\r\n\t\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}).addTo(map);\r\n\t\t\t\t\t\t\tmap.fitBounds(WFSLayer.getBounds());\t\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$(\"#mun_message\").html($('#textInput').val() +\" not found in CARAGA REGION\");\r\n\t\t\t\t\t\t\t$(\".cover\").addClass(\"active\");\r\n\t\t\t\t\t\t\t$(\".popup-overlay, .popup-content\").addClass(\"active\");\r\n\r\n\t\t\t\t\t\t\tload_municipalities();\r\n\t\t\t\t\t\t\tmap.setView([9.1204, 125.59], 8);\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}", "title": "" }, { "docid": "852d1d3de2553f6f4b85d3f02fbfb941", "score": "0.3971776", "text": "function check1(){\n\n\tmap.forEach(function(value, key){\n\t\n\tif(value == null) {\n\n checkIfValid(value,key);\n\t}\n\t});\n}", "title": "" }, { "docid": "d15ac9ee462de7cffc3d61f402364d30", "score": "0.39702475", "text": "function queryForArtsLayerGeometries() {\n //console.log(\"test!!!\")\n var artsQuery = artsLayer.createQuery();\n \n return artsLayer.queryFeatures(artsQuery)\n .then(function(response) {\n console.log(response)\n //console.log(myArray(response.features.length, response.features))\n //console.log(response.features.length, response.features)\n myArray(response.features.length, response.features)\n artsGeometries = response.features.map(function(feature) {\n return feature.geometry;\n });\n return artsGeometries;\n });\n }", "title": "" }, { "docid": "b4360023783dd8b7dcdc61b12a6bbbaf", "score": "0.39683032", "text": "function requestCheck(message) {\n\tfor(key in message) {\n\t\tif(!message[key]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\treturn true;\n}", "title": "" }, { "docid": "834e5940538bcd130a1f4303c734daf6", "score": "0.39659268", "text": "function loadVisitorServiceFeatures(sqlQueryFilteredVisitorServiceFeatures) {\n\n // If the layer is already shown on the map, remove it\n if (map.hasLayer(visitorServiceFeatures)) {\n map.removeLayer(visitorServiceFeatures);\n }\n \n // Clear the contents of the visitor service features layer group\n // so it can be redrawn with the filtered set\n visitorServiceFeaturesLayerGroup.clearLayers();\n \n // Get the icon size for the new zoom level\n getIconSize(); \n\n // Run the specified sqlQuery from CARTO, return it as a JSON, convert it to a Leaflet GeoJson, and add it to the map with a popup\n // For the data source, enter the URL that goes to the SQL API, including our username and the SQL query\n $.getJSON(\"https://\" + cartoUserName + \".carto.com/api/v2/sql?format=GeoJSON&q=\" + sqlQueryFilteredVisitorServiceFeatures, function (data) {\n\n // Convert the JSON to a Leaflet GeoJson\n visitorServiceFeatures = L.geoJson(data, {\n\n // Create a style for the points\n pointToLayer: function (feature, latlng) {\n\n // Get the feature category to use to set its icon\n var featureType = feature.properties.category; \n \n // Get the appropriate visitor service icon based on the feature category\n return L.marker(latlng, {\n icon: getVisitorServiceIcon(featureType)\n });\n\n },\n\n // Loop through each feature\n onEachFeature: function (feature, layer) {\n\n // Bind the name to a popup\n layer.bindPopup(feature.properties.name);\n\n }\n\n }).addTo(visitorServiceFeaturesLayerGroup);\n\n\n });\n}", "title": "" }, { "docid": "4864f16c7078acdf1c65cf15078e2487", "score": "0.39585406", "text": "function checkIfMapboxStyleIsLoaded() {\n if (map.isStyleLoaded()) {\n return true; // When it is safe to manipulate layers\n } else {\n return false; // When it is not safe to manipulate layers\n }\n}", "title": "" }, { "docid": "5b6b2ade8b6ed7f50a00131e0dbe7d70", "score": "0.39542747", "text": "function validateMetadata(){\n\t\tvar res = true;\n\t\tvar md = MapDescription.getInstance();\n\n\t\tmd.setMapUri($(\"#paperMapUri\").val());\n\t\tmd.setMapCreator($.trim($(\"#paperMapCreator\").val()));\n\t\tmd.setMapSize($.trim($(\"#paperMapSize\").val()));\n\t\tmd.setMapTitle($.trim($(\"#paperMapTitle\").val()));\n\t\tmd.setMapTime($.trim($(\"#paperMapTime\").val()));\n\t\tif(imgModelOriginal != null){\n\t\t\tmd.setImageUrl(imgModelOriginal.getUrl());\n\t\t}\n\t\tmd.setMapScale($.trim($(\"#paperMapScale\").val()));\n\t\tmd.setMapPlaces($.trim($(\"#paperMapPlaces\").val()));\n\t\tmd.setMapArea($.trim($(\"#mapAreawkt\").val()));\n\t\tvar messages = md.validate();\n\t\tvar emessage = [];\n\t\tvar wmessage = [];\n\t\tif (messages.length > 0 ){\n\t\t\tfor (var i = 0; i < messages.length; i++) {\n\t\t\t\tvar m = messages[i];\n\t\t\t\tif(m[0] == \"ERROR\"){\n\t\t\t\t\temessage.push(m[1]);\n\t\t\t\t}else if(m[0] == \"WARNING\"){\n\t\t\t\t\twmessage.push(m[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(emessage.length > 0){\n\t\t\t\talert(\"ERRORS: \" + emessage.join(\" \"));\n\t\t\t\tres = false;\n\t\t\t}\n\t\t\tif(wmessage.length > 0){\n\t\t\t\talert(\"WARNINGS: \" + wmessage.join(\" \"));\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}", "title": "" }, { "docid": "4f640fa69d1a866a45b2a5e0f5ca3cce", "score": "0.3945606", "text": "async getQueries(location, query) {\n // Show loading message\n this.setState({\n loading: true,\n });\n // Pass lat/long from (Geocode Address API) here ↓ , in (Place Search API)\n try {\n // Retrieve coordinates data (lat, long) + await for a promise to be resolved\n const {\n data: {\n results: [\n {\n locations: [\n {\n latLng: { lat, lng },\n },\n ],\n },\n ],\n },\n } = await axios({\n url: `https://www.mapquestapi.com/geocoding/v1/address`,\n method: \"GET\",\n responseType: \"json\",\n params: {\n key,\n location: location,\n },\n });\n\n // Retrieve query results\n const {\n data: { results },\n } = await axios({\n url: `https://www.mapquestapi.com//search/v4/place`,\n method: \"GET\",\n responseType: \"json\",\n params: {\n // Passing long, lat from (Get Geocode Address API see below) to check the response\n circle: `${lng}, ${lat}, ${this.state.range}`,\n pageSize: 20,\n key: key,\n sort: \"relevance\",\n q: query,\n },\n });\n\n // Update state with the results data from an API call\n this.setState({\n queryList: results,\n searchResults: true,\n location,\n loading: false,\n });\n // Handle error if promise is rejected\n } catch (error) {\n swal(\"Error has occurred!\", `${error}`);\n }\n }", "title": "" }, { "docid": "7f2e13fe04e76ecfc3a07bc12c7313d3", "score": "0.39242068", "text": "static hasParams(res, params, expected){\n if (typeof expected === 'string' && expected.length > 0){\n return params[expected] != null\n }\n\n if (!Array.isArray(expected))\n throw new VError('invalid `expected` args')\n\n var allExist = expected.every(value => {\n return params[value] != null\n })\n\n if (!allExist){\n res.send(400, 'missing parameters')\n return false\n }\n\n return true\n }", "title": "" }, { "docid": "4482395ad1262418fc804fa2196ef63c", "score": "0.39205372", "text": "function QueryLayer(node, mapPoint) {\n var layerInfo = layers[GetLayerInfo(node.getAttribute(\"layerId\"))];\n var queryTask = new esri.tasks.QueryTask(layerInfo.ServiceURL);\n var query = new esri.tasks.Query();\n query.outSpatialReference = map.spatialReference;\n query.returnGeometry = true;\n query.outFields = [\"*\"];\n query.geometry = ExtentFromPoint(mapPoint);\n query.maxAllowableOffset = MaxOffSet();\n query.spatialRelationship = esri.tasks.Query.SPATIAL_REL_INTERSECTS;\n queryTask.execute(query, function (results) {\n responseCount++\n if (results.features.length == 0) {\n if (layerCount == responseCount) {\n LocateParcelonMap(null, mapPoint);\n }\n return;\n }\n responseCount = 0;\n selectedGraphic = results.features[0].geometry;\n RemoveChildren(dojo.byId('divFeatureDataScrollbarContent'));\n var table = document.createElement(\"table\");\n table.style.width = \"95%\";\n table.style.height = \"100%\";\n table.style.textAlign = \"left\";\n dojo.byId(\"divFeatureDataScrollbarContent\").appendChild(table);\n var tbody = document.createElement(\"tbody\");\n table.appendChild(tbody);\n var resultSet = results.features[0];\n\n for (var attr in resultSet.attributes) {\n if (!resultSet.attributes[attr]) {\n resultSet.attributes[attr] = \"\";\n }\n }\n\n for (var index in layerInfo.Fields) {\n var tr = document.createElement(\"tr\");\n tbody.appendChild(tr);\n var td = document.createElement(\"td\");\n td.innerHTML = layerInfo.Fields[index].DisplayText;\n var td1 = document.createElement(\"td\");\n td1.className = \"tdWordBreak\";\n var value = dojo.string.substitute(layerInfo.Fields[index].FieldName, resultSet.attributes);\n if (layerInfo.Fields[index].isDate) {\n var date = new js.date();\n var utcMilliseconds = Number(dojo.string.substitute(layerInfo.Fields[index].FieldName, resultSet.attributes));\n td1.innerHTML = dojo.date.locale.format(date.utcTimestampFromMs(utcMilliseconds), { datePattern: datePattern, selector: \"date\" });\n }\n else if (layerInfo.Fields[index].DataType == \"double\") {\n var formattedValue = dojo.number.format(value, { pattern: \"#,##0.##\" });\n td1.innerHTML = currency + \" \" + formattedValue;\n }\n else {\n td1.innerHTML = dojo.string.substitute(layerInfo.Fields[index].FieldName, resultSet.attributes);\n }\n tr.appendChild(td);\n tr.appendChild(td1);\n }\n var screenPoint;\n dojo.byId('tdFeatureHeading').innerHTML = layerInfo.Title;\n (isMobileDevice) ? map.setExtent(GetMobileMapExtent(selectedGraphic)) : map.setExtent(GetBrowserMapExtent(mapPoint));\n setTimeout(function () {\n if (isMobileDevice) {\n map.infoWindow.setTitle(\"\");\n map.infoWindow.setContent(\"\");\n setTimeout(function () {\n var screenPoint;\n screenPoint = map.toScreen(selectedGraphic);\n screenPoint.y = map.height - screenPoint.y;\n map.infoWindow.resize(225, 65);\n map.infoWindow.show(screenPoint);\n map.infoWindow.setTitle(dojo.string.substitute(infoWindowHeader, resultSet.attributes).trimString(20));\n map.infoWindow.setContent(dojo.string.substitute(infoWindowContent, resultSet.attributes));\n dojo.connect(map.infoWindow.imgDetailsInstance(), \"onclick\", function () {\n dojo.byId('divFeatureInformation').style.display = \"block\";\n dojo.replaceClass(\"divFeatureInformation\", \"opacityShowAnimation\", \"opacityHideAnimation\");\n dojo.addClass(\"divFeatureInformation\", \"divFeatureInformation\");\n dojo.replaceClass(\"divFeatureInfoWindow\", \"showContainer\", \"hideContainer\");\n dojo.addClass(\"divFeatureInfoWindow\", \"divFeatureInfoWindow\");\n SetHeightFeatureData();\n });\n });\n }\n else {\n map.infoWindow.resize(330, 270);\n screenPoint = map.toScreen(mapPoint);\n screenPoint.y = map.height - screenPoint.y;\n map.infoWindow.show(screenPoint);\n map.infoWindow.setTitle(\"\");\n map.infoWindow.reSetLocation(screenPoint);\n dojo.byId('divFeatureInfoWindow').style.display = \"block\";\n\n }\n // SetHeightFeatureData();\n }, 100);\n }, function (err) {\n });\n}", "title": "" }, { "docid": "b6c37fba1cebbfbf7794c457b0f23692", "score": "0.3916708", "text": "get queryParamMap() {\n if (!this._queryParamMap) {\n this._queryParamMap =\n this.queryParams.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])((p) => convertToParamMap(p)));\n }\n return this._queryParamMap;\n }", "title": "" }, { "docid": "b6c37fba1cebbfbf7794c457b0f23692", "score": "0.3916708", "text": "get queryParamMap() {\n if (!this._queryParamMap) {\n this._queryParamMap =\n this.queryParams.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])((p) => convertToParamMap(p)));\n }\n return this._queryParamMap;\n }", "title": "" }, { "docid": "f16aa3c0c28d4ff5eb77bf173cd3c8f2", "score": "0.39153785", "text": "function checkAvailable() {\n const args = Array.prototype.slice.call(arguments);\n args.forEach(function(lookup) {\n if(API[''+lookup] === undefined) return;\n throw new Error('Enum must be bijective with keys distinctive from values');\n });\n }", "title": "" }, { "docid": "0712fb821e2d7696ff305771a658cb45", "score": "0.39152238", "text": "function getECOSProperties (cb){\n //This should fetch data from the server that pertains to the features loaded in the current extent.\n //var url = \"http://localhost:3001/services/custom/custom_operation?name=getaggregatedthemefeaturesbyextent&format=geojson&bbox=:bbox&theme=:theme&gadm_level=0&filters=:filters\";\n\n var level = $rootScope.level;\n\n if (!level) return; //exit if no level\n\n var url = \"../services/custom/custom_operation?name=getallaggregatedthemefeatures&format=geojson&theme=:theme&gadm_level=\" + level + \"&filters=:filters\";\n\n if ($rootScope.$stateParams.filters) {\n filters = $rootScope.$stateParams.filters;\n //Add filters to URL.\n url = url.replace(\":filters\", filters);\n }\n else {\n url = url.replace(\"&filters=:filters\", \"\"); //no filters. Remove\n }\n\n var theme = $rootScope.$stateParams.theme || 'project';\n url = url.replace(\":theme\", theme);\n\n //When done, call the cb (callback) function\n $http.get(url, {cache: true}).success(cb).error(function (err) {\n console.log(\"err\");\n });\n }", "title": "" }, { "docid": "3e07bc3d1b21b696b532f1468b700216", "score": "0.39125198", "text": "validateQuery(token, query, queryOptions, session, logFn) {\n return Promise.try(reqlJsonToAst, [{query, queryOptions}]).then(ast => {\n return Promise.try(parseQuery, [query, queryOptions]).then(rq => {\n return this.queryInWhitelist(rq, ast, session).then(inWhitelist => {\n const allow = this.unsafelyAllowAnyQuery || inWhitelist;\n const allowText = allow ? colors.green('[ALLOW]') : colors.red('[DENY]');\n const logMsgParts = [allowText, ' ', ast.query.toString()];\n Object.keys(ast.queryOptions || {}).forEach(x => {\n const key = JSON.stringify(x);\n const value = ast.queryOptions[x].toString();\n logMsgParts.push('.opt(', key, ', ', value, ')');\n });\n const shouldLog = (\n this.loggingMode === 'all'\n ) || (\n this.loggingMode === 'denied' && !inWhitelist\n );\n if (shouldLog) {\n logFn(logMsgParts.join(''), token);\n }\n return Promise.resolve(allow);\n });\n });\n });\n }", "title": "" }, { "docid": "0be277beeb386266abf1a83c45b358b2", "score": "0.39088938", "text": "getKeysOfQuery(query) {\n return Object.keys(query);\n }", "title": "" }, { "docid": "4b310b3122051c891315c68589cdcfc5", "score": "0.39024684", "text": "function hasKeys() {\n var keys = _.toArray(arguments);\n\n var fun = function(obj) {\n return _.every(keys, function(k) {\n return _.has(obj, k);\n })\n }\n\n fun.message = cat([\"Must have values for keys:\"], keys).join(\" \");\n return fun;\n}", "title": "" }, { "docid": "c50565f7e59dd3a12f1d98100d930e31", "score": "0.38949588", "text": "function loadFusionTable(qs1, qs2) {\n\t$.getJSON(qs1, function(response) {\n\t\tif (response.rows == null) {\n\t\t\t$('#map-canvas').html('<p style=\"margin:15px;\">Add either a city and state abbreviation (Make sure to add a comma between the city and the State Abbreviation) or just the state abbreviation to the form above. Please check your spelling if you continue to receive this message. For now, this project is only usable to find artist in the United States.</p>');\n\n\t\t} else {\n\t\t\tlat_range = response.rows[0] + ':' + response.rows[(response.rows.length - 1)];\n\t\t\tcombineCalls(lat_range);\n\n\t\t\t$.getJSON(qs2, function(response) {\n\n\t\t\t\tlong_range = response.rows[0][0] + ':' + response.rows[(response.rows.length-1)][0];\n\t\t\t\tmap.state = response.rows[0][1]\n\t\t\t\tif (map.city != \"\") {\n\n\t\t\t\t\t//alert(map.state)\n\t\t\t\t\tif (map.state == \"District of Columbia\") {\n\t\t\t\t\t\tmap.loc = \"Washington, DC\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmap.loc = (map.city + ', ' + map.state);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcombineCalls(long_range);\n\t\t\t});\n\t\t}\n\t\t\n\t});\n}", "title": "" }, { "docid": "12d1b8100d02f87ac7909c789a7619de", "score": "0.38933167", "text": "function getAccessAuthFeatureGeo (props) {\n const { auth, feature } = props\n const noGeoData =\n !feature.getIn(['georestrictions', 'availability']) ||\n feature.getIn(['georestrictions', 'countries'], Map()).size === 0\n // If you are anonymous, you have access to all titles\n if (!auth.get('jwt') || noGeoData) {\n return ACCESS_PREVIEW\n }\n\n const userCountry = auth.get('country')\n const featureHasGeoData = feature.getIn(['georestrictions', 'availability'])\n let featureGeoAllowed = true\n if (auth.get('jwt') && featureHasGeoData) {\n featureGeoAllowed = getGeoAllowed(\n feature.getIn(['georestrictions', 'availability']),\n feature.getIn(['georestrictions', 'countries']),\n userCountry,\n )\n }\n\n const featureEntitlementAllowed = isFeatureAllowedWithSubscription(feature, auth)\n\n // If you are anonymous, you have access to all titles\n if (featureGeoAllowed && featureEntitlementAllowed) {\n return ACCESS_FEATURE\n } else if (\n featureGeoAllowed &&\n !featureEntitlementAllowed &&\n auth.get('jwt')\n ) {\n return ACCESS_PREVIEW\n }\n return false\n}", "title": "" }, { "docid": "7235158dee833a541c2bca9eb44fcf4c", "score": "0.3893061", "text": "function IsOnMap(x,y) {\n\n return (x < width && x >= 0 && y < height - 2 && y >= 0);\n\n}", "title": "" }, { "docid": "77e6eb3d6d521fdf0ec183632556afe1", "score": "0.3889877", "text": "function doQuery(evt){\n\t\t\n\t\tif(lotFlag == 1) /** buy plan **/\n\t\t{\t\t\n\t\t\t$(\".firstWindow\").hide(500);\t\n\t\t\t$(\".salesWindow\").show(500);\t\n\t\t\t\n\t\t\tvar x = evt.mapPoint.x ;\n\t\t\tvar y = evt.mapPoint.y ;\n\t\t\t\n\t\t\tqueryLandLot(x, y);\t/** Query Land Lot and display the polygon **/\n\t\t \n\t\t\t/** To check if the polygon is inside or outside central area **/\n\t\t\tqueryTask = new esri.tasks.QueryTask(\"https://www.ura.gov.sg/ArcGIS/rest/services/common/Singapore_Planning_Boundaries/MapServer/3\");\n\t\t\tquery = new esri.tasks.Query();\n\t\t\tvar XY = new esri.geometry.Point (x,y, new esri.SpatialReference({ wkid: 3414 }));\n\t\t\tquery.returnGeometry = true;\n\t\t\tquery.geometry = XY;\n\t\t\tquery.outSpatialReference = {wkid:3414}; \n\t\t\tquery.outFields = [\"*\"];\t\t\t\n\t\t\tqueryTask.execute(query,centralAreaCheck);\t\n\t\t\t\n\t\t\t \t\n\t\t}\n\t}", "title": "" }, { "docid": "c0aaee4270266238b20af55d93dc3b26", "score": "0.38848048", "text": "function checkRequiredKeywords()\n{\n\n\tvar ret = true;\n\tvar tbl = ge(\"keywordTable\");\n\n\tif (tbl)\n\t{\n\n\tvar arr = tbl.getElementsByTagName(\"input\");\n\t\n\t\tfor (var i=0;i<arr.length;i++)\n\t\t{\n\t\n\t\t\tvar kid = arr[i].getAttribute(\"keyword_id\");\n\t\t\tvar req = arr[i].getAttribute(\"required\");\n\t\t\t\n\t\t\tif (kid && req && req==\"t\" && arr[i].value.length==\"0\")\n\t\t\t{\n\t\n\t\t\t\tret = false;\n\t\t\t\tbreak;\n\t\n\t\t\t}\n\t\n\t\t}\n\t\n\t}\n\n\treturn ret;\n\n}", "title": "" }, { "docid": "4edb0fa24c8d07d8d33d2aae289a6ffa", "score": "0.38828808", "text": "function checkReturnedData(data, inOptionsCallback)\n{\n\toptionsCallback = inOptionsCallback;\n\n\tif (data.from != null && data.from['numlocations'] > 0)\n\t{\n\t\tvar allLocations = new Array();\n\t\t$zipGiven = data.from['zipGiven'];\n\t\tfromExcludedState = data.from.stateExcluded;\n\t\tfromZipCount = data.from.zipCount;\n\t\t$.each(data.from['locations'], function(i, location)\n\t\t{\n\t\t\tvar thisLocation = new Array();\n\t\t\tthisLocation['zipGiven'] = $zipGiven\n\t\t\tthisLocation['zipcode'] = location.zipcode;\n\t\t\tthisLocation['state'] = location.state;\n\t\t\tthisLocation['city'] = location.city;\n\t\t\tthisLocation['county'] = location.county;\n\t\t\tthisLocation['latitude'] = location.latitude;\n\t\t\tthisLocation['longitude'] = location.longitude;\n\t\t\tfromStateFullName = location.StateFullName;\n\t\t\tallLocations[i] = thisLocation;\n\t\t});\n\n\t\tlistAlternatives(\"from\", allLocations, true);\n\t\tif (data.from['numlocations'] > 1)\n\t\t{\n\t\t\t$('#from_select_error').css({\n\t\t\t\t'left' : $('#fromselect').offset().left,\n\t\t\t\t'top' : $('#fromselect').offset().top - $('#from_select_error').height(),\n\t\t\t\t'z-index' : 1000\n\t\t\t});\n\t\t\t$('#from_select_error').show();\n\t\t\t$(window).resize(function(){\n\t\t\t\t$('#from_select_error').css({\n\t\t\t\t\t'left' : $('#fromselect').offset().left,\n\t\t\t\t\t'top' : $('#fromselect').offset().top - $('#from_select_error').height(),\n\t\t\t\t\t'z-index' : 1000\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t//if (document.getElementById(\"quoteform\").disabled) document.getElementById(\"quoteform\").disabled = false;\n\t}\n\telse\n\t\tdisplayError(\"from\", reasons[UNAVAILABLE_CITY] + \" [111]\");\n\n\ttoExcludedState = data.to.stateExcluded;\n\ttoStateFullName = data.to.StateFullName;\n\tif (data.to != null && data.to['numlocations'] > 0)\n\t{\n\t\tvar allLocations = new Array();\n\t\t$zipGiven = data.to['zipGiven'];\n\t\ttoExcludedState = data.to.stateExcluded;\n\t\ttoZipCount = data.to.zipCount;\n\t\t$.each(data.to['locations'], function(i, location)\n\t\t{\n\t\t\tvar thisLocation = new Array();\n\t\t\tthisLocation['zipGiven'] = $zipGiven\n\t\t\tthisLocation['zipcode'] = location.zipcode;\n\t\t\tthisLocation['state'] = location.state;\n\t\t\tthisLocation['city'] = location.city;\n\t\t\tthisLocation['county'] = location.county;\n\t\t\tthisLocation['latitude'] = location.latitude;\n\t\t\tthisLocation['longitude'] = location.longitude;\n\t\t\ttoStateFullName = location.StateFullName;\n\t\t\tallLocations[i] = thisLocation;\n\t\t});\n\n\t\tlistAlternatives(\"to\", allLocations, true);\n\t\tif (data.to['numlocations'] > 1)\n\t\t{\n\t\t\t$('#to_select_error').css({\n\t\t\t\t'left' : $('#toselect').offset().left,\n\t\t\t\t'top' : $('#toselect').offset().top - $('#to_select_error').height(),\n\t\t\t\t'z-index' : 1000\n\t\t\t});\n\t\t\t$('#to_select_error').show();\n\t\t\t$(window).resize(function(){\n\t\t\t\t$('#to_select_error').css({\n\t\t\t\t\t'left' : $('#toselect').offset().left,\n\t\t\t\t\t'top' : $('#toselect').offset().top - $('#to_select_error').height(),\n\t\t\t\t\t'z-index' : 1000\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n\telse\n\t\tdisplayError(\"to\", reasons[UNAVAILABLE_CITY] + \" [111]\");\n\n\t//if (document.getElementById(\"quoteform\").disabled) document.getElementById(\"quoteform\").disabled = false;\n\n\tif (data.distance != null && continueSubmit)\n\t{\n\t\tdocument.getElementById(\"distance\").value = data.distance['total_distance'];\n\t\tdocument.getElementById(\"srcDistnoti\").value = data.distance['source_distance'];\n\t\tdocument.getElementById(\"desDistnoti\").value = data.distance['dest_distance'];\n\t\tdocument.getElementById(\"distnoti\").value = data.distance['total_not_i'];\n\n\t\tupdateFormAndSubmit();\n\t}\n\n}", "title": "" }, { "docid": "35c77dbe7b6b67f4aaa0025124675590", "score": "0.38815668", "text": "function validateOptionNames(functionName,options,optionNames){forEach(options,function(key,_){if(optionNames.indexOf(key)<0){throw new FirestoreError(Code.INVALID_ARGUMENT,\"Unknown option '\"+key+\"' passed to function \"+functionName+\"(). \"+\"Available options: \"+optionNames.join(\", \"))}})}", "title": "" }, { "docid": "35c77dbe7b6b67f4aaa0025124675590", "score": "0.38815668", "text": "function validateOptionNames(functionName,options,optionNames){forEach(options,function(key,_){if(optionNames.indexOf(key)<0){throw new FirestoreError(Code.INVALID_ARGUMENT,\"Unknown option '\"+key+\"' passed to function \"+functionName+\"(). \"+\"Available options: \"+optionNames.join(\", \"))}})}", "title": "" }, { "docid": "89d3630050f7c0c46019b329367695ec", "score": "0.3875747", "text": "function validateOptionNames(functionName,options,optionNames){forEach(options,function(key,_){if(optionNames.indexOf(key)<0){throw new FirestoreError(Code.INVALID_ARGUMENT,\"Unknown option '\"+key+\"' passed to function \"+functionName+\"(). \"+'Available options: '+optionNames.join(', '));}});}", "title": "" }, { "docid": "d5d361200cdcf94a7a0d7e11a23c5297", "score": "0.38736594", "text": "function check_restrictions (data) {\n\tlet values = Object.values(data);\n\tlet error_array = [];\n\n\tvalues.forEach((value,index) => {\n\t\tif ( value.length < 3) {\n\t\t\terror_array.push(index)\n\t\t}\n\t})\n\treturn error_array;\n}", "title": "" }, { "docid": "738357291b077c82c884befc9474c4d7", "score": "0.38662612", "text": "function hasValidQuery(req, res, next) {\n const { date, mobile_number } = req.query;\n if (!date && !mobile_number)\n return next({\n status: 400,\n message:\n \"Missing required properties. Must include date or mobile_number.\",\n });\n\n/* Will list reservations by mobile number if included\nThis implementation will ignore date if mobile_number is included\nDue to the wide variances in formats for mobile numbers, this is not validated */\n if (mobile_number) {\n res.locals.mobile_number = mobile_number;\n return next();\n }\n let reso_date = date ? date : getToday();\n if (!isYYYYMMDD(reso_date))\n return next({\n status: 400,\n message: `Date must be in YYYY-MM-DD format. Received ${reso_date}`,\n });\n res.locals.date = reso_date;\n next();\n}", "title": "" }, { "docid": "5918c0a5eba1130fda738cd5071c8429", "score": "0.3865073", "text": "ground_check(callback, enabled = null) {\n if(null !== enabled) {\n return this._request([\"FF G\", enabled ? \"1\" : \"0\"],\n // OLD API < 4.0.1\n // return this._request([\"SG\", enabled ? \"1\" : \"0\"],\n () => {\n this.ground_check(callback);\n });\n }\n\n var request = this.flags((flags) => {\n callback(flags.ground_check);\n });\n return request;\n }", "title": "" }, { "docid": "69ad13e8ee3f5db7ccd13d60b1f1d55d", "score": "0.3858297", "text": "function isValidParameter(key, value) {\n \n /*\n * Function SeedlinkLatencyProxy.validateParameters::isValidParameter\n * Returns boolean whether parameter attributes are valid\n */\n \n const NETWORK_REGEXP = new RegExp(/^([0-9a-z?*]{1,2},){0,}([0-9a-z?*]{1,2})$/i);\n const STATION_REGEXP = new RegExp(/^([0-9a-z?*]{1,5},){0,}([0-9a-z?*]{1,5})$/i);\n const LOCATION_REGEXP = new RegExp(/^([0-9a-z-?*]{1,2},){0,}([0-9a-z-?*]{1,2})$/i);\n const CHANNEL_REGEXP = new RegExp(/^([0-9a-z?*]{1,3},){0,}([0-9a-z?*]{1,3})$/i);\n \n // Check individual parameters\n switch(key) {\n case \"network\":\n return NETWORK_REGEXP.test(value);\n case \"station\":\n return STATION_REGEXP.test(value);\n case \"location\":\n return LOCATION_REGEXP.test(value);\n case \"channel\":\n return CHANNEL_REGEXP.test(value);\n case \"min\":\n case \"max\":\n return Number(value) % 1 === 0;\n }\n \n }", "title": "" }, { "docid": "2a2d8399c07e8acaf57e73ae9dbaacff", "score": "0.38579205", "text": "function getFeatureTypeFromWFS(availableLayers){\n\t\tlog(\"getFeatureTypeFromWFS()\",\"info\",{'availableLayers':availableLayers});\n return new Promise((resolve, reject) => {\n\t\t\tlet availableFilterForLayers = [];\n\t\t\tfor(let i=0;i<availableLayers.length;i++){\n\t _getFeatureTypeFromWFS(availableLayers[i],(layerAvailableFilters)=>{\n\t availableFilterForLayers.push({'layer':availableLayers[i],'availableFilters':layerAvailableFilters});\n\t\t\t\t\tif(i===availableLayers.length-1){\n\t\t\t\t\t\tlog(\"getFeatureTypeFromWFS()\",\"success\",availableFilterForLayers);\n\t\t\t\t\t\tresolve(availableFilterForLayers);\n\t\t\t\t\t}\n\t });\n\t\t\t}\n });\n }", "title": "" }, { "docid": "1f0c969e04f7d6d2db8f9ece7aa2413f", "score": "0.38578457", "text": "function missingRequiredFeatures(targetInfo) {\n if (!targetInfo.requiredFeatures) {\n return false;\n }\n return targetsMissingFeatures[toString(targetInfo)];\n }", "title": "" }, { "docid": "79910446f96427d76831d9074d5e19fc", "score": "0.38561115", "text": "function getGISInfoByParcel(param_svc, param_layer, param_attributename, param_parcelToLookup, param_distance) {\r\n\t//SHOULD ADD INPUT VALIDATION CHECKS HERE. \r\n\t\r\n\tvar gisSVC = param_svc;\r\n\tvar gisLayer = param_layer;\r\n\tvar gisAttribute = param_attributename;\r\n\tvar actionString = \"attribute\";\r\n\tvar targetParcel = param_parcelToLookup;\r\n\tif (targetParcel.length != 10) {\r\n\t\tretValue = \"WARNING: getGISInfoByParcel parcel number length is not 10 digits\";\r\n\t}\r\n\r\n\tvar gisDistance = 0;\r\n\tif (arguments.length >= 6) {\r\n\t\tgisDistance = arguments[5];\r\n\t}\r\n\r\n\tvar gisDistanceUnit = \"feet\";\r\n\r\n\tvar retValue = null;\r\n\r\n\t//GET GIS BUFFER AND GIS OBJECT\r\n\tvar bufferTargetResult = aa.gis.getGISType(gisSVC, gisLayer); // get the buffer target\r\n\r\n\tif (bufferTargetResult.getSuccess()) {\r\n\t\tvar buf = bufferTargetResult.getOutput();\r\n\t\tif (gisAttribute != null) {\r\n\t\t\tbuf.addAttributeName(gisAttribute);\r\n\t\t}\r\n\t} else {\r\n\t\tretValue = \"**WARNING: Getting GIS Type for Buffer Target. Reason is: \" + bufferTargetResult.getErrorType() + \":\" + bufferTargetResult.getErrorMessage();\r\n\t\treturn retValue;\r\n\t}\r\n\r\n\tvar gisObjResult = aa.gis.getParcelGISObjects(targetParcel); // get gis objects on the parcel number\r\n\tif (gisObjResult.getSuccess())\r\n\t\tvar fGisObj = gisObjResult.getOutput();\r\n\telse {\r\n\t\tretValue = \"**WARNING: Getting GIS objects for Cap. Reason is: \" + gisObjResult.getErrorType() + \":\" + gisObjResult.getErrorMessage();\r\n\t\treturn retValue;\r\n\t}\r\n\r\n\tfor (a1 in fGisObj) // for each GIS object related to the parcel\r\n\t{\r\n\t\tvar bufchk = aa.gis.getBufferByRadius(fGisObj[a1], gisDistance, gisDistanceUnit, buf);\r\n\r\n\t\tif (bufchk.getSuccess()) {\r\n\t\t\tvar proxArr = bufchk.getOutput();\r\n\t\t} else {\r\n\t\t\tretValue = \"**WARNING: Retrieving Buffer Check Results. Reason is: \" + bufchk.getErrorType() + \":\" + bufchk.getErrorMessage();\r\n\t\t\treturn retValue;\r\n\t\t}\r\n\r\n\t\tfor (a2 in proxArr) {\r\n\t\t\tvar proxObj = proxArr[a2].getGISObjects(); // if there are GIS Objects here, get the relevant data and return it\r\n\r\n\t\t\tif (proxObj.length >= 2) {\r\n\t\t\t\tretValue = \"WARNING: Within getGISInfoByParcel, multiple GIS objects were found while looking for a single attribute. Consider retrieving and parsing the array of data.\";\r\n\t\t\t}\r\n\t\t\tfor (z1 in proxObj) {\r\n\t\t\t\tvar v = proxObj[z1].getAttributeValues();\r\n\t\t\t\tretValue = v[0];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn retValue;\r\n\t//RETURN A BOOL, STRING, OR ARRAY AS APPROPRIATE\r\n}", "title": "" }, { "docid": "96ca17f221c501ce5eb6b9e4d16b50d4", "score": "0.3852373", "text": "function validate_map(map) {\n let vw = map[0];\n let hw = map[1];\n let rows = vw.length;\n let cols = hw[0].length;\n // Start at top left grid square\n // Do a search of some kind\n // If we don't count all the nodes then it's a bad map\n let s = [];\n let explored = new Set();\n s.push(0);\n let count = 0;\n\n while (s.length != 0) {\n let v = s.pop();\n explored.add(v);\n ++count;\n\n // Add connected vertices if they haven't been visited\n let r = Math.floor(v / cols);\n let c = v % cols;\n // up\n if (r - 1 >= 0 && hw[r - 1][c] == 0) {\n let w = (r - 1) * cols + c;\n if (!explored.has(w)) {\n s.push(w);\n }\n }\n // down\n if (r < rows - 1 && hw[r][c] == 0) {\n let w = (r + 1) * cols + c;\n if (!explored.has(w)) {\n s.push(w);\n }\n }\n // left\n if (c - 1 >= 0 && vw[r][c - 1] == 0) {\n let w = r * cols + c - 1;\n if (!explored.has(w)) {\n s.push(w);\n }\n }\n // right\n if (c < cols - 1 && vw[r][c] == 0) {\n let w = r * cols + c + 1;\n if (!explored.has(w)) {\n s.push(w);\n }\n }\n }\n\n return explored.size == rows * cols;\n}", "title": "" }, { "docid": "4ceaf7b5aa168be3350f43a9f0490aaa", "score": "0.38480404", "text": "checkParams() {\n const id = this.props.match.params.id;\n const searches = this.props.searches;\n return checkList(id, searches);\n }", "title": "" }, { "docid": "a181151c6c1a9510edd777eaf9eb081a", "score": "0.38472408", "text": "function Mt(t) {\n return !!t && \"mapValue\" in t;\n}", "title": "" }, { "docid": "a53b6a2a05c7e819724f7774f788ee1e", "score": "0.38452798", "text": "function testBounds(){\n return true\n}", "title": "" }, { "docid": "e55907ce9c58fdcb0a5cd94660210c61", "score": "0.3844284", "text": "function mineForSearchQueryValues(document, queries, callback) {\r\n return requiredQueryValues.every(function(value) {\r\n if(value in query) {\r\n callback(value, query[value]);\r\n return true;\r\n } else return [].some.call(document.getElementsByTagName(\"a\"), function(a) { // We search through all links on the page\r\n var index = a.href.indexOf(\"?\");\r\n if(index === -1) return false;\r\n var match = a.href.substring(index + 1).match(new RegExp(value + \"=([^&;]*)\")); // We are searching for a match for the given GET search query value\r\n if(match == null) return false;\r\n callback(value, match[1]);\r\n return true;\r\n });\r\n });\r\n }", "title": "" }, { "docid": "5db690c078fc05c59afd7b336cb68cd4", "score": "0.38438737", "text": "async onBoundsChanged(map) {\n let bounds = map.getBounds();\n let data = await fetch(`${Global.API_URL}/geo`, {\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n },\n method: \"POST\",\n body: JSON.stringify({\n token: Global.API_TOKEN,\n latMin: bounds.getSouthWest().lat(),\n longMin: bounds.getSouthWest().lng(),\n latMax: bounds.getNorthEast().lat(),\n longMax: bounds.getNorthEast().lng(),\n })\n });\n let json = await data.json();\n this.setState({\n markers: json,\n center_lat: map.getCenter().lat(),\n center_lng: map.getCenter().lng(),\n zoom: map.getZoom()\n });\n }", "title": "" }, { "docid": "4d6efa70c67bedd7fcef4e50339f8a2b", "score": "0.38407543", "text": "checkQueryParams(){\n\t\tconst {location} = this.props\n\t\tconst {search} = location\n\t\tif(search) {\n\t\t\tlet queryParams = new URLSearchParams(search);\n\n\t\t\tif (queryParams.get('date') && queryParams.get('size')) {\n\t\t\t\tthis.setState({date: queryParams.get('date'), size: queryParams.get('size')})\n\t\t\t}\n\n\t\t\tif(queryParams.get('ammenities')){\n\t\t\t\tthis.setState({ammenities: queryParams.get('ammenities').split(\",\")})\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "947517fbb12ce2ab778781fc167de3b8", "score": "0.38398027", "text": "function waitForMapLoad() {\n\n}", "title": "" }, { "docid": "bc79e664a6a26c988dcdf4e6ee524f1b", "score": "0.38351583", "text": "function waitUntilGoogleMapsIsReady() {\n var getBoundsApi = ctrl.map.getBounds();\n if (getBoundsApi) {\n delete (scope.waitUntilGoogleMapsIsReadyTimeoutId);\n // Change to dragend https://developers.google.com/maps/documentation/javascript/events?hl=de\n scope.onDragEndListener = ctrl.map.addListener('dragend', function () {\n onBoundsChanged(true);\n });\n scope.onZoomChangedListener = ctrl.map.addListener('zoom_changed', function () {\n onBoundsChanged(true);\n });\n // window.addEventListener('resize', function () {\n // onBoundsChanged(false);\n // });\n\n disbaleNotifications = false;\n mapApiReadyDefer.resolve();\n } else {\n scope.waitUntilGoogleMapsIsReadyTimeoutId = $timeout(waitUntilGoogleMapsIsReady, 100);\n }\n }", "title": "" }, { "docid": "98fb2b8d18de98e5ebbc6d25433a4b11", "score": "0.3834209", "text": "function hasFeature(name) {\n try {\n var _availableAPIs$featur;\n const availableAPIs = require(`gatsby/apis.json`);\n return !!(availableAPIs !== null && availableAPIs !== void 0 && (_availableAPIs$featur = availableAPIs.features) !== null && _availableAPIs$featur !== void 0 && _availableAPIs$featur.includes(name));\n } catch (e) {\n throw new Error(`Couldn't check available APIs. Make sure you are on gatsby version >=2.13.41`);\n }\n}", "title": "" }, { "docid": "22bbc7a51cc13b398fcd72134ae54c54", "score": "0.3832826", "text": "function getAllPoints(){\n localPointsTable.queryFeatures(\"OBJECTID > 0\");\n}", "title": "" }, { "docid": "ca1775a4d2d648d2f96ca3ef1dab7e3c", "score": "0.38311017", "text": "function recalculateMap(in_cb ///< Optional checkbox item. If supplied, then the \"all reset\" will be bypassed.\n )\n {\n var element_id = g_main_id+'_options_1_a';\n \n g_basic_options_open = document.getElementById ( g_main_id+'_options_1' ).style.display != 'none'; // See if the basic options area is visible.\n \n // We process the checkboxes. These functions allow them to configure properly.\n var args = readWeekdayCheckBoxes(in_cb);\n args += readFormatCheckBoxes(in_cb);\n \n // We may not need to refresh the search. We only refresh if we have already done a search and either one of the filters is off of \"All.\"\n if ( (in_cb || ((args != '') && !g_basic_options_open) || ((args != '') && g_basic_options_open)) && g_main_map.g_location_coords )\n {\n map_clicked ( {'latLng':g_main_map.g_location_coords} );\n };\n }", "title": "" }, { "docid": "8d6f671a12c35a4476c2926212f64cd0", "score": "0.38287663", "text": "function _consultaFeature(){\n let f= app.map.getLayer(app.idNombreFeature);\n var query = new Query();\n query.where = \"MAGNITUDE >6 AND MAGNITUDE < 7\"; \n f.selectFeatures(query,FeatureLayer.SELECTION_NEW);\n f.refresh();\n }", "title": "" }, { "docid": "d9f907455ada5be95a0738eadfde3240", "score": "0.38286027", "text": "function doQuery(evt) {\r\n click = query.geometry = evt.mapPoint;\r\n queryTask.execute(query);\r\n}", "title": "" }, { "docid": "e5833fa497d0d68324cbc6f7db264edb", "score": "0.38280487", "text": "checkRequired (reqd) {\n /*\n *| Check for the presence of each required property in the passed args.\n */\n const isMissing = x => (x === undefined || x === null)\n const missing = Object.keys(reqd).filter(isMissing)\n\n /*\n *| If there were any missing required properties. Throw an error.\n */\n if (missing.length > 0) {\n throw new Error(`Missing Parameter${missing.length > 1 ? 's' : ''}: ${missing.join(', ')}!`)\n } else {\n return true\n }\n }", "title": "" }, { "docid": "534f6331eb1a061f7a1d26d2c7983153", "score": "0.3826197", "text": "get hasParameters() {\n return this._parameters.length > 0;\n }", "title": "" } ]
7cccc7b60057b6283f178046334f23b3
make helper function to iterate over arrays
[ { "docid": "6993e05e41fc1a64aac1d19bb95e12c5", "score": "0.0", "text": "function randomArrayElement(array){\r\n\tvar index = getRandomArbitrary(0,array.length);\r\n\treturn array[index];\r\n}", "title": "" } ]
[ { "docid": "62fb1f2d2708a3fa5fd283232de8aa08", "score": "0.69650954", "text": "function arrayEach(arr, fn, startIndex, loop) {\n var index, i, length = +arr.length;\n if (startIndex < 0) startIndex = arr.length + startIndex;\n i = isNaN(startIndex) ? 0 : startIndex;\n if (loop === true) {\n length += i;\n }\n while(i < length) {\n index = i % arr.length;\n if (!(index in arr)) {\n return iterateOverSparseArray(arr, fn, i, loop);\n } else if (fn.call(arr, arr[index], index, arr) === false) {\n break;\n }\n i++;\n }\n }", "title": "" }, { "docid": "4cb83d87a96c550e97be9195668ec626", "score": "0.69388795", "text": "function arrayEach(a, iterator) {\n for (var i = 0; i < a.length;) {\n iterator(a[i], i++);\n }\n return a;\n}", "title": "" }, { "docid": "b4fe27bdaeda46b1c2da91189e068c8d", "score": "0.68124247", "text": "function arraysFunction ( arr ) { // This function is called an unspecified number of times depending on which array we have\n\n if ( Array.isArray(arr) ) { // If the 'arr' is a array, go deep into 'arr'\n for ( var i in arr ) {\n arraysFunction ( arr[i] ); \n }\n \n }\n \n else { // If the 'arr' is not a array, place it in the newArray\n newArray.push( arr );\n multiplies *= arr;\n }\n \n }", "title": "" }, { "docid": "87fa048740e324ba9a870d7f7d4e447a", "score": "0.6787185", "text": "function eachFor(arr) {\n x = [];\n arr.forEach(n => {\n x.push(n);\n });\n return x;\n}", "title": "" }, { "docid": "80cc6e8818d84a731dcf45289ae250ca", "score": "0.67738974", "text": "function forEach(func, array) {\n for (var i = 0; i < array.length; i++) {\n func(array[i], i, array);\n }\n }", "title": "" }, { "docid": "d5645b0fa5777db91fc4025c79a370be", "score": "0.6773069", "text": "function arrForEach(arr, fn){\n for (var i = 0, l = arr.length; i < l; i++) {\n fn(arr[i], i, arr);\n }\n }", "title": "" }, { "docid": "bcca020d89d764ce361960d1fa2fe76d", "score": "0.6729264", "text": "function each(arr, fn) { for(var i = 0; i < arr.length; ++i) fn(arr[i]) }", "title": "" }, { "docid": "84e679a3d942e7beee65742dbcb398de", "score": "0.659569", "text": "function each(array, func) {\n for (var i = 0; i < array.length; i++) {\n func(array[i]);\n }\n }", "title": "" }, { "docid": "84e679a3d942e7beee65742dbcb398de", "score": "0.659569", "text": "function each(array, func) {\n for (var i = 0; i < array.length; i++) {\n func(array[i]);\n }\n }", "title": "" }, { "docid": "52efae38ee549760d28e0e247a215079", "score": "0.6583437", "text": "function each(array, func) {\n for (var i = 0; i < array.length; i++) {\n func(array[i], i);\n }\n }", "title": "" }, { "docid": "52efae38ee549760d28e0e247a215079", "score": "0.6583437", "text": "function each(array, func) {\n for (var i = 0; i < array.length; i++) {\n func(array[i], i);\n }\n }", "title": "" }, { "docid": "fcd492a789840325d8c6722cacfb19aa", "score": "0.6582956", "text": "function each(arr, fn, _this) {\n var i, len = (arr && arr.length) || 0;\n for(i = 0; i < len; i++) {\n fn.call(_this, arr[i], i);\n }\n }", "title": "" }, { "docid": "fcd492a789840325d8c6722cacfb19aa", "score": "0.6582956", "text": "function each(arr, fn, _this) {\n var i, len = (arr && arr.length) || 0;\n for(i = 0; i < len; i++) {\n fn.call(_this, arr[i], i);\n }\n }", "title": "" }, { "docid": "36695730ba33adf7f4ab307a10844289", "score": "0.65720636", "text": "function each(array, fun) {\n array.forEach(fun);\n}", "title": "" }, { "docid": "1444d0ae0c6d8029320502c630d8fa11", "score": "0.65519", "text": "function each(arr, func){\n\tfor(var i in arr){\n\t\tfunc(arr[i], i);\n\t}\n\n}", "title": "" }, { "docid": "9662f08bd16f180a8e1d65f747c3d2b9", "score": "0.6550587", "text": "function each(thyArray,f){\n for(var i=0;i<thyArray.length;i++){\n f(thyArray[i],i);\n }\n}", "title": "" }, { "docid": "0fe016f72f92b49a2db6912535a0428c", "score": "0.65359634", "text": "static each(arr, callback) {\n if( BaseUtils.isArray(arr)) {\n for( let i = 0; i < arr.length; i ++ ) {\n let elem = arr[i];\n callback.call(this, elem);\n }\n }\n }", "title": "" }, { "docid": "9cef2dc294073615a2672557428593fe", "score": "0.65252817", "text": "function each(array, f){\n for(var i = 0; i < array.length; i++){\n f(array[i], i);\n }\n}", "title": "" }, { "docid": "8c5fc5f7822597d6f7d8b875e9c105c4", "score": "0.65186507", "text": "function forEach(array, iterator) {\n var index, length;\n\n for (index = 0, length = array.length; index < length; index += 1) {\n iterator(array[index], index);\n }\n }", "title": "" }, { "docid": "39433cb0e4a6620ea2e626cfbbe391be", "score": "0.6514291", "text": "function each(array, func) {\n if (Array.isArray(array)) {\n for (var i = 0; i < array.length; i++) {\n func(array[i], i);\n }\n } else {\n for (var key in array) {\n func(array[key], key);\n }\n }\n}", "title": "" }, { "docid": "0a54f9dd4969e5e652bc31c7618de37e", "score": "0.6482492", "text": "function each(array, f){\n\tfor(var i = 0; i < array.length; i++){\n \t\tf(array[i]);\n\t}\n}", "title": "" }, { "docid": "cf151c6f896efa29c50eb5e776853718", "score": "0.6481923", "text": "function each(array, func) {\n for (var i = 0; i < array.length; i++) {\n func(array[i], i);\n }\n}", "title": "" }, { "docid": "3d6f1b62d8bb498fc2c14f995efd886f", "score": "0.6474441", "text": "function forEachSimple(arr, iterator, context) {\n var result;\n\n for (var x = 0; x < arr.length; x++) {\n result = iterator.call(context, arr[x], x, arr);\n\n if (result !== undefined) {\n return result;\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "489eefad3b9f2c0acc27e97adb090a16", "score": "0.6444099", "text": "function forEach (array, fn) {\n for (var i = 0; i < array.length; i++)\n fn(array[i], i, array);\n}", "title": "" }, { "docid": "a11543e792eb28652b27b644470c9525", "score": "0.6410373", "text": "function forEach(array, fn) {\n for (var i = 0; i < array.length; i++)\n fn(array[i], i);\n }", "title": "" }, { "docid": "933aaaa7e9453353844501b314115274", "score": "0.64059633", "text": "function forAll(arr, fn) {\n var out = [], i;\n for (i = 0; i < arr.length; i++) {\n out.push(fn(arr[i], i));\n }\n\n return out;\n}", "title": "" }, { "docid": "921f38aad4d52e52097ee9ca185a4e11", "score": "0.6402428", "text": "function myCustomForEach2(func){\n\t//this keyword refers to the array in the Array.prototype\n\tfor(var i = 0; i < this.length; i++){\n\t\t//Calling the passed function with the Array.prototype value\n\t\tfunc(this[i]);\n\t}\n}", "title": "" }, { "docid": "d43be82209c72fbcbd056d5ce10a5757", "score": "0.6401549", "text": "function i(t,e){for(var n,r=0,o=t.length;r<o;r++)n=t[r],Array.isArray(n)?i(n,e):e.push(n);return e}", "title": "" }, { "docid": "82e862ff264004062a4d227227b85960", "score": "0.63909084", "text": "function iterateArr(arr) {\n for(var i = 0; i < arr.length; i++) {\n console.log(arr[i]);\n }\n}", "title": "" }, { "docid": "969ab4c6c065f1f6342e1ef111224c62", "score": "0.63825506", "text": "function foreach(arr, f) {\n\n}", "title": "" }, { "docid": "5b58529bf0366100670025ae39fb512b", "score": "0.63659716", "text": "function each(arr, otherFunction) {\n for (var i = 0; i < arr.length; i++) {\n otherFunction(arr[i]);\n }\n}", "title": "" }, { "docid": "c04a0f5c35dbd9f7c10535a20f3aedb4", "score": "0.63648576", "text": "function each(array, fn) {\r\n var length = array.length;\r\n for (var i = 0; i < length; ++i) {\r\n fn(array[i], i);\r\n }\r\n}", "title": "" }, { "docid": "39ef301ffe6b88b2036fa6cf156ce2c0", "score": "0.63527787", "text": "function forEach(array, func) {\n\tfor (var i = 0; i < array.length; i++) {\n\t\tfunc(array[i]);\n\t}\n}", "title": "" }, { "docid": "1c5859f29d11519b9ff5b3eeeed48089", "score": "0.63520634", "text": "function loopArr( arr, action ) {\n\tfor(var i = 0; i < arr.length; i++) {\n action(arr[i]);\n\t}\n}", "title": "" }, { "docid": "b0cd604c0f85193fa8f82f4f4ba6a56b", "score": "0.63466907", "text": "function mapforeach(arr, fn){\n\tvar newArray = [];\n\tfor(var i=0; i<arr.length; i++){\n\t\tnewArray.push(\n\t\t\tfn(arr[i])\n\t\t);\n\t}\n\treturn newArray;\n}//One fn can be used multiple times", "title": "" }, { "docid": "2fa957540875b30909318a0a9660c624", "score": "0.6338629", "text": "function forEach(arr, f) {\n for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);\n }", "title": "" }, { "docid": "06354b28ee5b2c0d99c214242e6c4868", "score": "0.6316159", "text": "function each(arr, fn) {\n for (var i in arr) {\n fn(arr[i], i);\n }\n}", "title": "" }, { "docid": "e99cede4d6e1f3885dcb3464932e387c", "score": "0.6316131", "text": "function each(array, fn) {\n var length = array.length;\n\n for (var i = 0; i < length; ++i) {\n fn(array[i], i);\n }\n}", "title": "" }, { "docid": "0e669ef5e3e6cc7baa0d9f66535ced8a", "score": "0.62908345", "text": "function example2(arr) {\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < arr.length; j++) {\n console.log(arr[i] + \",\" + arr[j]);\n }\n }\n}", "title": "" }, { "docid": "6934434b4560f1d29f695cd067c040c7", "score": "0.6290827", "text": "function forEach (arr, fun) { return HTMLCollection.prototype.each.call(arr, fun); }", "title": "" }, { "docid": "90064fcef32d4f69086ab99efc3781e0", "score": "0.6290813", "text": "function forEachArrayMethod(fn) {\n function call(name, mustConvertThisToArray) {\n var desc = Object.getOwnPropertyDescriptor(Array.prototype, name);\n fn(name, desc, !! mustConvertThisToArray);\n }\n\n call(\"every\");\n call(\"filter\");\n call(\"find\");\n call(\"findIndex\");\n call(\"forEach\");\n call(\"includes\");\n call(\"indexOf\");\n call(\"join\");\n call(\"lastIndexOf\");\n call(\"map\");\n call(\"reduce\");\n call(\"reduceRight\");\n call(\"slice\");\n call(\"some\");\n call(\"toLocaleString\");\n call(\"toString\");\n\n // The `reverse` and `sort` methods are usually destructive, but for\n // `tuple` objects they return a new `tuple` object that has been\n // appropriately reversed/sorted.\n call(\"reverse\", true);\n call(\"sort\", true);\n\n // Make `[...someTuple]` work.\n call(useSymbol && Symbol.iterator || \"@@iterator\");\n}", "title": "" }, { "docid": "90064fcef32d4f69086ab99efc3781e0", "score": "0.6290813", "text": "function forEachArrayMethod(fn) {\n function call(name, mustConvertThisToArray) {\n var desc = Object.getOwnPropertyDescriptor(Array.prototype, name);\n fn(name, desc, !! mustConvertThisToArray);\n }\n\n call(\"every\");\n call(\"filter\");\n call(\"find\");\n call(\"findIndex\");\n call(\"forEach\");\n call(\"includes\");\n call(\"indexOf\");\n call(\"join\");\n call(\"lastIndexOf\");\n call(\"map\");\n call(\"reduce\");\n call(\"reduceRight\");\n call(\"slice\");\n call(\"some\");\n call(\"toLocaleString\");\n call(\"toString\");\n\n // The `reverse` and `sort` methods are usually destructive, but for\n // `tuple` objects they return a new `tuple` object that has been\n // appropriately reversed/sorted.\n call(\"reverse\", true);\n call(\"sort\", true);\n\n // Make `[...someTuple]` work.\n call(useSymbol && Symbol.iterator || \"@@iterator\");\n}", "title": "" }, { "docid": "90064fcef32d4f69086ab99efc3781e0", "score": "0.6290813", "text": "function forEachArrayMethod(fn) {\n function call(name, mustConvertThisToArray) {\n var desc = Object.getOwnPropertyDescriptor(Array.prototype, name);\n fn(name, desc, !! mustConvertThisToArray);\n }\n\n call(\"every\");\n call(\"filter\");\n call(\"find\");\n call(\"findIndex\");\n call(\"forEach\");\n call(\"includes\");\n call(\"indexOf\");\n call(\"join\");\n call(\"lastIndexOf\");\n call(\"map\");\n call(\"reduce\");\n call(\"reduceRight\");\n call(\"slice\");\n call(\"some\");\n call(\"toLocaleString\");\n call(\"toString\");\n\n // The `reverse` and `sort` methods are usually destructive, but for\n // `tuple` objects they return a new `tuple` object that has been\n // appropriately reversed/sorted.\n call(\"reverse\", true);\n call(\"sort\", true);\n\n // Make `[...someTuple]` work.\n call(useSymbol && Symbol.iterator || \"@@iterator\");\n}", "title": "" }, { "docid": "90064fcef32d4f69086ab99efc3781e0", "score": "0.6290813", "text": "function forEachArrayMethod(fn) {\n function call(name, mustConvertThisToArray) {\n var desc = Object.getOwnPropertyDescriptor(Array.prototype, name);\n fn(name, desc, !! mustConvertThisToArray);\n }\n\n call(\"every\");\n call(\"filter\");\n call(\"find\");\n call(\"findIndex\");\n call(\"forEach\");\n call(\"includes\");\n call(\"indexOf\");\n call(\"join\");\n call(\"lastIndexOf\");\n call(\"map\");\n call(\"reduce\");\n call(\"reduceRight\");\n call(\"slice\");\n call(\"some\");\n call(\"toLocaleString\");\n call(\"toString\");\n\n // The `reverse` and `sort` methods are usually destructive, but for\n // `tuple` objects they return a new `tuple` object that has been\n // appropriately reversed/sorted.\n call(\"reverse\", true);\n call(\"sort\", true);\n\n // Make `[...someTuple]` work.\n call(useSymbol && Symbol.iterator || \"@@iterator\");\n}", "title": "" }, { "docid": "90064fcef32d4f69086ab99efc3781e0", "score": "0.6290813", "text": "function forEachArrayMethod(fn) {\n function call(name, mustConvertThisToArray) {\n var desc = Object.getOwnPropertyDescriptor(Array.prototype, name);\n fn(name, desc, !! mustConvertThisToArray);\n }\n\n call(\"every\");\n call(\"filter\");\n call(\"find\");\n call(\"findIndex\");\n call(\"forEach\");\n call(\"includes\");\n call(\"indexOf\");\n call(\"join\");\n call(\"lastIndexOf\");\n call(\"map\");\n call(\"reduce\");\n call(\"reduceRight\");\n call(\"slice\");\n call(\"some\");\n call(\"toLocaleString\");\n call(\"toString\");\n\n // The `reverse` and `sort` methods are usually destructive, but for\n // `tuple` objects they return a new `tuple` object that has been\n // appropriately reversed/sorted.\n call(\"reverse\", true);\n call(\"sort\", true);\n\n // Make `[...someTuple]` work.\n call(useSymbol && Symbol.iterator || \"@@iterator\");\n}", "title": "" }, { "docid": "90064fcef32d4f69086ab99efc3781e0", "score": "0.6290813", "text": "function forEachArrayMethod(fn) {\n function call(name, mustConvertThisToArray) {\n var desc = Object.getOwnPropertyDescriptor(Array.prototype, name);\n fn(name, desc, !! mustConvertThisToArray);\n }\n\n call(\"every\");\n call(\"filter\");\n call(\"find\");\n call(\"findIndex\");\n call(\"forEach\");\n call(\"includes\");\n call(\"indexOf\");\n call(\"join\");\n call(\"lastIndexOf\");\n call(\"map\");\n call(\"reduce\");\n call(\"reduceRight\");\n call(\"slice\");\n call(\"some\");\n call(\"toLocaleString\");\n call(\"toString\");\n\n // The `reverse` and `sort` methods are usually destructive, but for\n // `tuple` objects they return a new `tuple` object that has been\n // appropriately reversed/sorted.\n call(\"reverse\", true);\n call(\"sort\", true);\n\n // Make `[...someTuple]` work.\n call(useSymbol && Symbol.iterator || \"@@iterator\");\n}", "title": "" }, { "docid": "1f346d262aaff9f742c7082d339d5335", "score": "0.62749726", "text": "function myEach(var array[],callback) {\n var i = 0;\n for(i; i<array.size();i++) {\n return callback(array[i]);\n }\n}", "title": "" }, { "docid": "9043b6540ec4f4b4f1af7c779a1b0f5f", "score": "0.6255277", "text": "function forEach(array, func) {\n for (var i = 0; i < array.length; i++) {\n func(array[i]);\n }\n}", "title": "" }, { "docid": "3e658442606762ab0f248c2fd534340d", "score": "0.6254076", "text": "function forLoop(arr) {\n x = [];\n for (let i = 0; i < arr.length; i++) x.push(arr[i]);\n return x;\n}", "title": "" }, { "docid": "477d6a4b925264839435ed68a6f1a0e6", "score": "0.62483656", "text": "function steamrollArray(arr) {\n let retArr = [];\n for (let val of arr)\n {\n if (Array.isArray(val))\n {\n for (let i = 0; i < val.length; i++)\n {\n let retVal = retValue(val, i);\n retArr.push(retVal);\n }\n }\n else\n {\n retArr.push(val);\n }\n }\n return retArr;\n}", "title": "" }, { "docid": "16c70a25b78eb4f44b5d167cdc51c552", "score": "0.6247427", "text": "function loopArray(){\n //for of\n for(const day of arr){\n console.log(day);\n }\n //for of keys\n for(const day of arr.keys()){\n console.log(day);\n }\n //for in for keys also\n for(const day in arr){\n console.log(day);\n }\n //for of for index value pairs\n for(const day of arr.entries()){\n console.log(day);\n }\n}", "title": "" }, { "docid": "998aa86628aba4ed85cd0d76daaba6e6", "score": "0.62443733", "text": "function eachOfArrayLike(coll, iteratee, callback) {\n callback = once(callback || noop);\n var index = 0,\n completed = 0,\n length = coll.length;\n if (length === 0) {\n callback(null);\n }\n\n function iteratorCallback(err, value) {\n if (err) {\n callback(err);\n } else if (++completed === length || value === breakLoop) {\n callback(null);\n }\n }\n\n for (; index < length; index++) {\n iteratee(coll[index], index, onlyOnce(iteratorCallback));\n }\n }", "title": "" }, { "docid": "cc3dccf54d4498ffa0cd480010c6e6b1", "score": "0.62279683", "text": "function iterate_array(){\n\t\t\tfor(var i = 0; i < arr.length; i++){\n\t\t\t\tconsole.log(arr[i]);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "35ea080cffb46bdbacd6c9d4cadd0b51", "score": "0.62216747", "text": "function eachOfArrayLike(coll, iteratee, callback) {\n\t\t callback = once(callback || noop);\n\t\t var index = 0,\n\t\t completed = 0,\n\t\t length = coll.length;\n\t\t if (length === 0) {\n\t\t callback(null);\n\t\t }\n\n\t\t function iteratorCallback(err) {\n\t\t if (err) {\n\t\t callback(err);\n\t\t } else if (++completed === length) {\n\t\t callback(null);\n\t\t }\n\t\t }\n\n\t\t for (; index < length; index++) {\n\t\t iteratee(coll[index], index, onlyOnce(iteratorCallback));\n\t\t }\n\t\t}", "title": "" }, { "docid": "1db59fabb2cfc745abce57fd37762fc2", "score": "0.62178195", "text": "function eachOfArrayLike(coll, iteratee, callback) {\n callback = once(callback || noop)\n var index = 0,\n completed = 0,\n length = coll.length\n if (length === 0) {\n callback(null)\n }\n\n function iteratorCallback(err, value) {\n if (err) {\n callback(err)\n } else if (++completed === length || value === breakLoop) {\n callback(null)\n }\n }\n\n for (; index < length; index++) {\n iteratee(coll[index], index, onlyOnce(iteratorCallback))\n }\n }", "title": "" }, { "docid": "f0ef3b93c64bfa21edc80f05586752d1", "score": "0.62071234", "text": "function forEach(arr, func) {\n for (var i = 0; i < arr.length; i++) {\n func(arr[i]);\n }\n}", "title": "" }, { "docid": "ee460e228c26c7b835d0afc0a465a069", "score": "0.6183426", "text": "function forEach(work, arr, bool) {\n for(var i = 0; i < arr.length; i++) {\n work(arr[i], bool);\n }\n}", "title": "" }, { "docid": "429a5be8ebe3ea4ab09336596ac5d903", "score": "0.6174258", "text": "function eachOfArrayLike(coll, iteratee, callback) {\n callback = (0, _once2.default)(callback || _noop2.default)\n var index = 0,\n completed = 0,\n length = coll.length\n if (length === 0) {\n callback(null)\n }\n\n function iteratorCallback(err, value) {\n if (err) {\n callback(err)\n } else if (++completed === length || value === _breakLoop2.default) {\n callback(null)\n }\n }\n\n for (; index < length; index++) {\n iteratee(\n coll[index],\n index,\n (0, _onlyOnce2.default)(iteratorCallback),\n )\n }\n }", "title": "" }, { "docid": "4c7d331f30f2ab89d2cf3efcf79719c7", "score": "0.6172799", "text": "function helper(currArr, outputArr){\n // For each array, loop through the values\n for(let i = 0; i<currArr.length; i++){\n // If the current value is another array, then\n if (Array.isArray(currArr[i])){\n helper(currArr[i], outputArr);\n }\n else{\n outputArr.push(currArr[i]);\n }\n }\n}", "title": "" }, { "docid": "f4ca68ffcefdb56815353fe85ead8a7e", "score": "0.6168791", "text": "function loopAndApply(array, func) {\n for (var i = 0; i < array.length; i++) {\n func(array[i]);\n }\n}", "title": "" }, { "docid": "0e461dae67148c0b22cdac36f1a8f793", "score": "0.6158517", "text": "function array_for_each(array, func) {\n return Array.prototype.forEach.call(array, func);\n}", "title": "" }, { "docid": "70763e153c45ad86141befa6ce7cf5ea", "score": "0.6154134", "text": "function printArrayValues(array) {\n // YOUR CODE BELOW HERE //\n // loop forward over the array and print each value\n // use for of loop because we are looping over all the arrays\n \n for(let i of array){\n console.log(i);\n }\n \n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "95a0a282fd99f7a19d0de96b4b94150e", "score": "0.6151546", "text": "function foreach(arr, f) {\n for (const item of arr) {\n f(item);\n }\n}", "title": "" }, { "docid": "22ba4bcf249ca10a6274e22a0dc88518", "score": "0.61427903", "text": "function forEach(xs, f){\n for(var i=0; i<xs.length; i++){\n f(xs[i], i, xs);\n }\n}", "title": "" }, { "docid": "2e28680e5783c871c47c3063f9c390b7", "score": "0.6134493", "text": "function myForEach(arr, func){\n for(var i=0; i<arr.length; i++){\n func(arr[i]);\n }\n}", "title": "" }, { "docid": "1ec23232d6e4ef769ec0cb75502a1d8f", "score": "0.61336976", "text": "function arrRead(arr){\n \n arr.forEach(element => {\n console.log(element);\n });\n}", "title": "" }, { "docid": "7c184c780d5c74a7e0f9cdb4e09f716e", "score": "0.6128835", "text": "function each(a, fn) {\n var i = 0, l = a.length\n for (; i < l; i++) fn(a[i])\n }", "title": "" }, { "docid": "53f0cf1f657867f341fd100786f9c154", "score": "0.61255413", "text": "function each(f, a) {\n return a.forEach(f);\n}", "title": "" }, { "docid": "5ec7061cdab96adbc93ffa7c3a5074fa", "score": "0.6124982", "text": "function forEach (array, func) {\n\n}", "title": "" }, { "docid": "a6591f5ff4eeb4b4171ac624d923e5cf", "score": "0.61130744", "text": "function myForEach(arr, cb) {\n cb(arr);\n}", "title": "" }, { "docid": "adfde0c00387fdcdf81e660f62d824c2", "score": "0.6110642", "text": "function eachOfArrayLike(coll, iteratee, callback) {\n\t callback = (0, _once2.default)(callback || _noop2.default);\n\t var index = 0,\n\t completed = 0,\n\t length = coll.length;\n\t if (length === 0) {\n\t callback(null);\n\t }\n\n\t function iteratorCallback(err, value) {\n\t if (err) {\n\t callback(err);\n\t } else if (++completed === length || value === _breakLoop2.default) {\n\t callback(null);\n\t }\n\t }\n\n\t for (; index < length; index++) {\n\t iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback));\n\t }\n\t}", "title": "" }, { "docid": "a22c7f1f30ee9b968723590c6037c54f", "score": "0.60929555", "text": "function eachOfArrayLike(coll, iteratee, callback) {\n callback = once(callback || noop);\n var index = 0,\n completed = 0,\n length = coll.length;\n if (length === 0) {\n callback(null);\n }\n\n function iteratorCallback(err, value) {\n if (err) {\n callback(err);\n } else if (++completed === length || value === breakLoop) {\n callback(null);\n }\n }\n\n for (; index < length; index++) {\n iteratee(coll[index], index, onlyOnce(iteratorCallback));\n }\n }", "title": "" }, { "docid": "cbb3db87234173b6c96fb1d6aafc3188", "score": "0.6087517", "text": "function each(a, fn) {\n var i = 0, l = a.length\n for (; i < l; i++) fn.call(null, a[i])\n }", "title": "" }, { "docid": "89cc337db013f57703f619a5623f1d8c", "score": "0.60822713", "text": "function loopArr( arr, action ) {\n\tfor(var i = 0; i < arr.length; i++) {\n // console.log(ary[i]); // start out with something simple\n\t\taction(arr[i]); // invoke the function and pass in the current element in the array\n\t}\n}", "title": "" }, { "docid": "d696a0885ef7178e0ac00d22795a49a7", "score": "0.60592717", "text": "function each(array, fn) {\n\t\tvar index = array.length;\n\t\twhile (index--) {\n\t\t\tfn(array[index], index);\n\t\t}\n\t}", "title": "" }, { "docid": "d7b9e953bd8d6e5710985401df48f6dd", "score": "0.6057782", "text": "function extractAllvalues({\n frontendarray:shoppinglistarray,\n backendarray:demoarray\n}){\nvar newarray = []\nfor( var i = 0; i<demoarray.length;i++){\n extractCleanvalues({\n frontendarray:shoppinglistarray,\n backendarray:demoarray[i]\n}).map(item => {return newarray.push(item)})\n}\nreturn newarray\n}", "title": "" }, { "docid": "c595486b7c8d3b5e2ac00bdf771243ac", "score": "0.6055312", "text": "function eachOfArrayLike(coll, iteratee, callback) {\n\t callback = (0, _once2.default)(callback || _noop2.default);\n\t var index = 0,\n\t completed = 0,\n\t length = coll.length;\n\t if (length === 0) {\n\t callback(null);\n\t }\n\t\n\t function iteratorCallback(err) {\n\t if (err) {\n\t callback(err);\n\t } else if (++completed === length) {\n\t callback(null);\n\t }\n\t }\n\t\n\t for (; index < length; index++) {\n\t iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback));\n\t }\n\t}", "title": "" }, { "docid": "60d8af1ac8d38fd47a80765b69dd8dee", "score": "0.6036221", "text": "function looped2() {\n\tvar names = [\"Ben\", \"Jafar\", \"Matt\", \"Priya\", \"Brian\"];\n\tnames.forEach(function(arr){\n\t\tconsole.log(arr);\n\t});\n\n}", "title": "" }, { "docid": "cd0b2f7cd58a6b45e2b271b9789a8ab8", "score": "0.6020072", "text": "forEach( array, callback, scope ) {\n\t\tfor( let i = 0; i < array.length; i++ ) {\n\t\t\tcallback.call( scope, array[i] );\n\t\t}\n\t}", "title": "" }, { "docid": "a52e6d6ec0a8f23587d0bfc2ce238183", "score": "0.60167503", "text": "function forEach(array, callback, scope) {\n for (var i = 0; i < array.length; ++i) {\n callback.call(scope, i, array[i]); // pass back stuff we need\n }\n}", "title": "" }, { "docid": "57272186b6fb5b1aafda481f46e7782b", "score": "0.60084385", "text": "function forEach(array, callback) { //array must be passed an array type.\n \"use strict\" //callback must be passed a function type.\n for (var i = 0; i < array.length; i++)\n callback(array[i])\n }", "title": "" }, { "docid": "6f452f8829b1cd54f7635979f7dfe451", "score": "0.6005131", "text": "function mapForEach(arr, fn) { // run a function at each array index\n var newArr = [];\n for (var i = 0; i < arr.length; i++) {\n newArr.push(\n fn(arr[i])\n )\n };\n return newArr;\n}", "title": "" }, { "docid": "10c4205b7736c481e5b947137e9f3a51", "score": "0.60023564", "text": "function multiplyArrays(arr = []) {\n return arr.map(function (elem, i, arr) {\n return elem * 10;\n });\n}", "title": "" }, { "docid": "9f86ab13fbf543720168602c430118cf", "score": "0.5997577", "text": "function array(array1){\n for (let i = 0; i <array1.length ; i++) {\n console.log(array1[i]);\n }\n}", "title": "" }, { "docid": "57f367ad2a7193e716604164d8b1bac6", "score": "0.599425", "text": "function myForEach(arr, cb) {\n for (i = 0; i < arr.length; i++) {\n cb(arr[i], i, arr)\n }\n}", "title": "" }, { "docid": "8a495afbe9b63a7b0f1be45672525a0a", "score": "0.59925", "text": "function forEach(array, f) {\n for(var i = 0; i < array.length; i++) {\n var item = array[i];\n f(item);\n }\n}", "title": "" }, { "docid": "53c090e8fcf94e8cbe4a19c23275c68c", "score": "0.59898895", "text": "function iterador(arr, callback) {\n for (var i = 0; i < arr.length; i++) {\n callback(arr[i]); //<- Index es opcional aquí\n }\n}", "title": "" }, { "docid": "5e919033bba9f8addc39cca6b9075c15", "score": "0.59662473", "text": "function each(array){\n return array.reduce(function(a, b) {\n return a + b;\n });\n}", "title": "" }, { "docid": "f54a56a39cd3f81bb5d4e0da9b27a397", "score": "0.5965234", "text": "function elementosArray(miArray) {\n\t//var miArray = [1,2,3,4,5];\n\tfor (var i=0; i<miArray.length; i++) {\n\t\tconsole.log(miArray[i]);\n\t}\n}", "title": "" }, { "docid": "50b4df954543f1655e8f6832c47da7a8", "score": "0.59630954", "text": "function myForEach(array, callback){\n for ( var i = 0; i < array.length; i++)\n callback(array[i], i, array);\n}", "title": "" }, { "docid": "76ff109bddfb65c275bfb8a3bf6923db", "score": "0.59553355", "text": "function each(array, cb) {\r\n for (var i = 0; i < array.length; i++) {\r\n cb(array[i], i);\r\n }\r\n }", "title": "" }, { "docid": "abc22511778b283e6f412ee7af2e938e", "score": "0.5944066", "text": "function executeForeEach(array, func) {\n for(let i = 0; i < array.length; i++){\n func(array[i]);\n }\n return array;\n}", "title": "" }, { "docid": "2170082053f72c8bbdce2b8287da1103", "score": "0.5941154", "text": "function each(array, callback) {\n for (var i = 0; i < array.length; i++) {\n callback(array[i], i, array);\n }\n}", "title": "" }, { "docid": "9bd5f6d465029cc9aea6831b46674412", "score": "0.5938541", "text": "function arrayCalc (arr, fn ){\n var arrRes = []; \n for( var i = 0; i < arr.length; i++){\n arrRes.push(fn(arr[i])); \n } \n return arrRes; \n }", "title": "" }, { "docid": "fb1657e390471f0847bf12b58f7d466e", "score": "0.5934503", "text": "function forEach(array, callback){\n // YOUR CODE HERE\n //reading itmes from the array.\n for(var i=0; i<array.length; i++){\n callback(array[i]);\n }\n //making sure that each item is not an array\n //executing the callback funciton and returning the value\n\n}", "title": "" }, { "docid": "2ac32fc36c60ff6476119c82b035ee11", "score": "0.5932301", "text": "function eachOfArrayLike(coll, iteratee, callback) {\n callback = once(callback || noop);\n var index = 0,\n completed = 0,\n length = coll.length;\n if (length === 0) {\n callback(null);\n }\n\n function iteratorCallback(err, value) {\n if (err) {\n callback(err);\n } else if (++completed === length || value === breakLoop) {\n callback(null);\n }\n }\n\n for (; index < length; index++) {\n iteratee(coll[index], index, onlyOnce(iteratorCallback));\n }\n}", "title": "" }, { "docid": "098a1d2989533318e864d87785869c45", "score": "0.592234", "text": "function eachOfArrayLike(coll, iteratee, callback) {\n callback = once(callback || noop);\n var index = 0,\n completed = 0,\n length = coll.length;\n if (length === 0) {\n callback(null);\n }\n\n function iteratorCallback(err, value) {\n if (err) {\n callback(err);\n } else if ((++completed === length) || value === breakLoop) {\n callback(null);\n }\n }\n\n for (; index < length; index++) {\n iteratee(coll[index], index, onlyOnce(iteratorCallback));\n }\n}", "title": "" }, { "docid": "098a1d2989533318e864d87785869c45", "score": "0.592234", "text": "function eachOfArrayLike(coll, iteratee, callback) {\n callback = once(callback || noop);\n var index = 0,\n completed = 0,\n length = coll.length;\n if (length === 0) {\n callback(null);\n }\n\n function iteratorCallback(err, value) {\n if (err) {\n callback(err);\n } else if ((++completed === length) || value === breakLoop) {\n callback(null);\n }\n }\n\n for (; index < length; index++) {\n iteratee(coll[index], index, onlyOnce(iteratorCallback));\n }\n}", "title": "" }, { "docid": "098a1d2989533318e864d87785869c45", "score": "0.592234", "text": "function eachOfArrayLike(coll, iteratee, callback) {\n callback = once(callback || noop);\n var index = 0,\n completed = 0,\n length = coll.length;\n if (length === 0) {\n callback(null);\n }\n\n function iteratorCallback(err, value) {\n if (err) {\n callback(err);\n } else if ((++completed === length) || value === breakLoop) {\n callback(null);\n }\n }\n\n for (; index < length; index++) {\n iteratee(coll[index], index, onlyOnce(iteratorCallback));\n }\n}", "title": "" }, { "docid": "098a1d2989533318e864d87785869c45", "score": "0.592234", "text": "function eachOfArrayLike(coll, iteratee, callback) {\n callback = once(callback || noop);\n var index = 0,\n completed = 0,\n length = coll.length;\n if (length === 0) {\n callback(null);\n }\n\n function iteratorCallback(err, value) {\n if (err) {\n callback(err);\n } else if ((++completed === length) || value === breakLoop) {\n callback(null);\n }\n }\n\n for (; index < length; index++) {\n iteratee(coll[index], index, onlyOnce(iteratorCallback));\n }\n}", "title": "" }, { "docid": "098a1d2989533318e864d87785869c45", "score": "0.592234", "text": "function eachOfArrayLike(coll, iteratee, callback) {\n callback = once(callback || noop);\n var index = 0,\n completed = 0,\n length = coll.length;\n if (length === 0) {\n callback(null);\n }\n\n function iteratorCallback(err, value) {\n if (err) {\n callback(err);\n } else if ((++completed === length) || value === breakLoop) {\n callback(null);\n }\n }\n\n for (; index < length; index++) {\n iteratee(coll[index], index, onlyOnce(iteratorCallback));\n }\n}", "title": "" } ]